As I’m making my PC game Super Hiking League, sometimes I need a break. Recently, it’s been in the form of translating some of its elements into a NES homebrew program. I can’t call it a game yet, as there’s very little going on gameplay-wise.
Still, it was quite an achievement for myself to get something not only being displayed on screen, but with interactivity resembling a videogame! So I decided to share this as an out-of-the-box, 100% portable, working project that compiles a NES ROM with graphics, screen transitions, music and interactivity. It is for Windows only, and since it uses the graphics from Super Hiking League, it is for educational purposes only, unless stated otherwise. Look in the license.txt file for more info on this.
By running the batch file, it generates a NES Mapper 3 ROM with 2 16k PRG banks and 8 8k CHR banks, with vertical mirroring. You can edit these settings on the nes.cfg and header.asm files in the system folder, provided you know what you are doing. Included in the zip are the ca65.exe and ld65.exe programs required by the batch file. So hopefully, absolutely no configuration is required. Just unzip the folder and run the batch!
I feel like not many working projects such as this are available out there, so here it is! The code is all in assembly language. Use any text editor for the files. The main file is “main.asm” in the src folder. Disclaimer: the code comes from an unexperienced NES developer who’s just really happy that it works, so you may use it to try things out, but do not take it as an example of good coding practices, as I’m pretty sure it’s far from that!
Continue reading →