Bun Runner Devlog -- 2024-11-15

November 15, 2024

We have a main menu! It’s very simple, but it also forced me to restructure huge chunks of code in order to allow swapping out the menu and the game code.

This included asset loading code, and this restructuring caused me to find a bug that took a few hours to track down. Symptoms:

  • The background would occasionally glitch out when swapping buffers
  • The glitching would mostly stop if I didn’t allocate memory for sprites.

What it came down to was this line:

; D0 contains the address to the background art
ADD.W #GAME_SCREEN_LAST_WORD_POSITION,D0

I was adding a value to an address and scoping to word boundaries, and it kinda worked, as long as I wasn’t wrapping around a 64k boundary when adding that value to the address. Changing how memory was allocated, as sprite memory was allocated before screen memory, would change the start address of screen memory and make this “work”.

But I have a menu now! Oh and some more animation! The rabbit will angle up and down depending on vertical velocity, and the jetpack has animation now, too!

A cartoon rabbit running around in a world of floors and ceilings

Next will be changing up some game behaviors, and then on to some fun bits of the game.