Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

I made an NES thing

A topic by Escapegoat Games created Aug 11, 2018 Views: 212
Viewing posts 1 to 1
Submitted(+2)

Hi. Here's a write-up for my entry, Spooter:

So the first thing my stupid brain though upon hearing "1.44MB limit" was "NES game written in god-awful assembly" and now here I am a month later to tell this train wreck of a tale.

Starting off, I copied the Pong basecode I had written following Nerdy Nights last year, leaving a lot of the hardware shenanigans intact while deleting just enough Pong functionality for the assembly to still compile and run. After fiddling a little bit more with the code, I managed to get a space ship sprite to load and went from there.

Progress proceeded relatively smoothly after that until I started working on the aliens. Before, I had been hard-coding all functionality (movement for all three lasers were done individually as opposed with a loop). I planned on adding 4 aliens and, as you might expect, since every alien needed to be checked against every laser, I would be re-writing upwards of 12 blocks of code. This kinda ticked me off. I had avoided anything too complicated before this, but now I braced myself for the inevitable and wrote what may be called in the most primitive sense, a "nested for-loop". After somehow successfully doing that, I started to get into the groove of things and began navigating and building a jungle of jumps, loops, and register juggling, even working in a system of activating and deactivating groups of objects with a bitmask where the bits in a byte would dictate active members of a group (so a bitmask of 00001001 would mean that the 4th and 1st object were active).

Despite these improvements, writing the rest of the game was still a mess:

  • Labels would occasionally get out of range. This was solved by hacking sections of code out and putting them into subroutines which worked somehow...
  • More than enough bugs arose simply from bad math in hex and writing to the wrong addresses
  • Nine-out-of-ten, a bug somehow got fixed by clearing/setting the carry bit
  • For the longest time, I thought I was bit-shifting right when I was really going left
  • The score is an 8-bit value and, as such, will overflow once the player gets a score of 256. This will remain a feature that I now dub, "Spaceship Reincarnation"
  • The game over screen is made of BG tiles and flickers since the only working method I have of writing to the background is turning off NMI, writing to an address, and turning it back on...

In any case, the finished game ended up being a very simple space shooter where enemy floppy disks float down, get shot, and respawn.

And that's the end.

There's probably way too much text here and not enough pics actually.

Anyways, thanks for reading!