Skip to content

Instantly share code, notes, and snippets.

View dleslie's full-sized avatar

Dan Leslie dleslie

View GitHub Profile
@dleslie
dleslie / retro.hlsl
Last active January 25, 2024 11:45
Modified Windows Terminal retro renderer
// The original retro pixel shader
Texture2D shaderTexture;
SamplerState samplerState;
cbuffer PixelShaderSettings {
float Time;
float Scale;
float2 Resolution;
float4 Background;
};
function a() {
document.fonts && document.fonts.ready && document.fonts.ready.then && "function" == typeof document.fonts.ready.then && document.fonts.ready.then(function() {
window.DOCS_timing.mfle = (new Date).getTime()
})
}
var b = ["DOCS_attachInitialMaterialFontLoadListener"],
c = this || self;
b[0] in c || "undefined" == typeof c.execScript || c.execScript("var " + b[0]);
for (var d; b.length && (d = b.shift());) b.length || void 0 === a ? c[d] && c[d] !== Object.prototype[d] ? c = c[d] : c = c[d] = {} : c[d] = a;
}).call(this); <
Building 32x-skeleton/
/data/Workspace/github/dleslie/32x-games/examples/marsdev/32x-skeleton /data/Workspace/github/dleslie/32x-games/examples/marsdev
make: Entering directory '/data'
/root/mars/m68k-elf/bin/m68k-elf-as -m68000 --register-prefix-optional m68k_crt0.s -o m68k_crt0.bin.o
/root/mars/m68k-elf/bin/m68k-elf-ld -nostdlib --oformat=binary m68k_crt0.bin.o -o m68k_crt0.bin
/root/mars/m68k-elf/bin/m68k-elf-ld: warning: cannot find entry symbol _start; defaulting to 0000000080000000
/root/mars/m68k-elf/bin/m68k-elf-as -m68000 --register-prefix-optional m68k_crt1.s -o m68k_crt1.bin.o
/root/mars/m68k-elf/bin/m68k-elf-ld -nostdlib --oformat=binary m68k_crt1.bin.o -o m68k_crt1.bin
Building 3d_example/
~/Workspace/GitHub/dleslie/genesis-dev/examples/gendev/3d_example ~/Workspace/GitHub/dleslie/genesis-dev/examples/gendev
mkdir -p src/boot
mkdir -p out
mkdir -p out/src
mkdir -p out/res
cp /opt/gendev/sgdk/src/boot/sega.s src/boot/sega.s
cp /opt/gendev/sgdk/src/boot/rom_head.c src/boot/rom_head.c
@dleslie
dleslie / enum_madness.c
Last active November 21, 2020 00:56
How to make C enum/char*[] pairs with a single line
#include <stdio.h>
#define _COUNT_ARGS(X100, X99, X98, X97, X96, X95, X94, X93, X92, X91, X90, X89, X88, X87, X86, X85, X84, X83, X82, X81, X80, X79, X78, X77, X76, X75, X74, X73, X72, X71, X70, X69, X68, X67, X66, X65, X64, X63, X62, X61, X60, X59, X58, X57, X56, X55, X54, X53, X52, X51, X50, X49, X48, X47, X46, X45, X44, X43, X42, X41, X40, X39, X38, X37, X36, X35, X34, X33, X32, X31, X30, X29, X28, X27, X26, X25, X24, X23, X22, X21, X20, X19, X18, X17, X16, X15, X14, X13, X12, X11, X10, X9, X8, X7, X6, X5, X4, X3, X2, X1, N, ...) N
#define COUNT_ARGS(...) _COUNT_ARGS(__VA_ARGS__, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)
#define EXPAND(X) X
#define CAR(X, ..
It so happens that I've found myself in possession of a Pixel 2,
Google's new flagship Android device. My current device is a Blackberry
Priv, which I hitherto have had little complaint for.
For some time now I've been a technological skeptic; the notion that
newer is better does not appeal to me, and I believe that the presence
of additional new behaviour doesn't necessarily mean greater general
utility.
So here I am holding this shiny new phone and looking at my Priv. I
@dleslie
dleslie / bbslinks.md
Created April 12, 2018 18:35
BBS links
! Useless Distractions
reddit.com
! Facebook
facebook.com
fb.com
fbcdn.net
tfbnw.net
fbcdn.com
messenger.com

The risk you run with any NOFX album is that it's almost guaranteed to be 50% garbage, but I have fond memories of Punk in Drublic (disclaimer: I haven't listened to it in over 1/2 a decade, at least). I know you already listened to at least a few song off So Long...

Other bands, you've got the well known guys like Anti-Flag (they've always been catchy as fuck, but American Fall has some next-level ear worms), Bad Religion (Generator through Stranger Than Fiction are probably their strongest albums), Pennywise I know you've listened to, Strung Out has some good stuff (An American Paradox was a favourite of younger Geoff, and revisiting it now, it's still a fun album).

Good Riddance leans a little more towards the hardcore end, but they're still one of my favourite bands. I'd recommend checking out "A Comprehensive Guide to Modern Rebellion" and "Ballads from the Revolution"

The Lawrence Arms (and associated acts Slapstick!, The Falcon [1/2 Lawrence Arms, 1/2 Alkaline Trio members], and Sundowner) are pret

@dleslie
dleslie / oka.md
Last active March 6, 2018 16:10
Oka and Guns

/u/canadianscofflaw

The Oka Crisis showed that an armed population can stand up to our Government and prevail. Whether or not you agree with the Mohawks, the fact remains that the golf course was not built and the conflict greatly reshaped how the Federal Government involves itself in native issues. Further reading.

/u/metameanderer

I understand where you're coming from, but was the Oka crisis really that representative of what happens if an armed populace rose up? If it was the case presented it would have been put down pretty quickly as the military would have rolled over the territory.

If we were talking about the whole population I might disagree, but if there had been a "full blown uprising" the military could have put it down rather quickly. The iconic picture would never have happened as the