I've been learning how to make an SNES game in 65816 Assembly with the help of this guide. It's a really cool set of blog posts.

https://georgjz.github.io/snesaa01/

SNES Assembly Adventure 01: Develop for the SNES

Learn how to get started in writing your own game for the SNES by setting up a development environment

Machine Code Construction Yard
I've rendered my first sprite! I'm doing all of the sprite and color palette encoding by hand to learn how it works. It involved converting everything to binary, rotating that, and converting the result to hex. The colors were way off at first, but I managed to get a working sprite.

I spent my evening debugging a tricky issue in the 65816 assembly code of my SNES game. Before finding a debugger, I was able to find the line of code causing the problem, but couldn't figure out what the actual issue was!

It turns out I was pushing a value to the stack from an 8-bit register and comparing it with a 16-bit register, so instead of the loop ending at $0014, it was trying to loop until $8014 due to the adjacent memory on the stack!

Not the progress I'd hoped, but good learning!

Tonight's progress isn't really in the game itself, but in the tooling. I wrote a little 40 line program in C to help translate my sprite index values into hex to be pasted into the hex editor.

I'm sure appending the binary directly to the sprite file wouldn't be too hard, but I don't remember how to do that. I suppose `man 3 fwrite` could probably tell me...

Nah, that feels like work, this will do fine.

@ryan I see aseprite back there! Are you using its scripting for exporting?

@adamp That's right! I briefly looked into its Lua scripting and support for exporting, but didn't immediately find a script for the SNES format. I'd been doing it by hand, so get the process, and it'd be reasonably trivial to do there, but I was intrigued by the idea of making a simple C CLI tool. I might revisit that later.

Have you used it and if so, do you have a good export script?

@ryan yes, I don't know about "good" but I wrote an export script for NES CHR-ROM. I can try to dig it up later this evening/weekend if you'd like. I assume SNES is similar