Why is he doing this with an x86 compiler. The c64 used a 6510. None of this code would ever work.
...Oh, if you jump to about halfway through he starts using an x86->65xx translator. Okay. Nice.
...Oh, if you jump to about halfway through he starts using an x86->65xx translator. Okay. Nice.
https://github.com/c64scene-ar/llvm-6502
Which means you can just use the clang frontend and even write C++17 code which compiles down to 6502 ML.
cc65 seems to be the only viable one around last I looked. And it doesn't support the 65816, only the 6502. WDC offers their own compiler, but it's not fully open/free.