NES Homebrew Source Code

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

February update (I’m not dead!)

Whoa! Nearly five months have passed and I haven’t posted anything. How did I let that happen? Oh, right, I’ve been very busy working on my new game!

After studying a few game engines I had to pick one of them. At first I settled with UDK, and I had pixel perfect 2D graphics working, but in the end, it was just overkill. There are better engines dedicated to 2D games out there. I’ve tried a few, and in the end I chose YoYo Games’ GameMaker Studio. It is perfect for an intermediate programmer such as myself. And now they have released GameMaker 2 Beta which has a lot of nice features and improved performance. I can add four thousand enemies with simple AI without a frame drop on my i7 notebook! The engine is still in Beta though, so it’s not perfect, but I’m very satisfied.

devlog01

Continue reading