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.

Bun Runner Devlog -- 2024-11-09

November 9, 2024

Another week of slow progress, but this is mainly due to some really heavy refactoring work. I wanted to use ptplayer for music, and that required having my code in a ready-to-link format. If I was going to do this, I was going to do it right, and so I restructured all of the code using all of the techniques I use when working with higher level languages:

  • proper separation of concerns into deep modules
  • “data classes” that enforce structure

My biggest problem holding me back was that MonAm did not like it as all when I gave it linked code:

  • I lost all my symbols
  • Source code mode was non-existent, though that barely worked for me anyways

Along with all the refactoring, I switched to using BDebug in the Barfly assembler package, and I haven’t looked back. Symbols, source code, proper OS 2.0 windows, full mouse support, command line arguments, and lots and lots of great options.

Along with reworking the game code in this way, I restructured my art compression tool to get more practice. I’ve gotten a lot better at restructing assembler code and figuring out the good places to divide up modules. Once I feel really confident that this is the way to go, I’ll write up an article detailing my approach, if you want to try it out yourself.

Oh, and music playback works!

Bun Runner Devlog -- 2024-11-01

November 1, 2024

Not as much progress this week, but some good code cleanups and performance enhancements:

  • Spreading out redraw work across multiple frames
  • Getting background rendering mostly working
  • Precalculating double buffer calculations

Next will be getting the double buffering to happen independently between the front and back planes, which will allow for smooth backgrounds and foregrounds. Then I’ll work on externalizing some more of the game from the code, moving maps to separate files that can be loaded in and adding some other colors to the output.

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

Bun Runner Devlog -- 2024-10-25

October 25, 2024

Lots of progress this week!

  • Full joystick handling, including getting the jetpack working and decent jumping physics
  • Drawing lots more stuff on screen:
    • Textured 4 bitplane floors
    • 1 bitplane ceilngs
    • The jetpack meter
  • Collisions with the floor, ceiling, and walls work
A cartoon rabbit running around in a world of floors and ceilings

I also fixed up some really stupid bugs and got the game working on my MiSTer and A1200:

Bun Runner running on my Amiga 1200
Bun Runner running on my MiSTer

Additionally, I tightened up the art pipeline so when I’m creating assets, it’s easy to get them into the game. I will need to figure out the best way to automate more of the XPK compression, too.

Next I’ll be getting the rest of the draw operations for the background into the game and spreading the writes to the double buffer over a few frames.

Bun Runner Devlog -- 2024-10-18

October 18, 2024

Going to write up a blog post every week with the progress of my finite-at-first runner for the Amiga. My goals:

  • write something large in Assembler
  • learn as many of the Amiga subsystems as I can
  • make an entertaining, easy-to-pick-up game with as many modern sensibilities as possible

I have no timeline to get a WIP out for testing because I’ve never worked in Assembler nor this deeply with the Amiga and AmigaOS before!

This week:

  • set up the main game project
  • extracted out relevant code from some things I posted to Mastodon
  • cleaned up keyboard, mouse, and joystick handling, using OS routines for the first two, and direct CIA access for the joystick
    • The two dots in the upper left are the state of the joystick
  • set up file logging for debug messages as printing to stdout while I’ve turned off enough OS things doesn’t work, but writing to a file does
  • cleaned up my assembler XPK art compressor and made it more generic so I can compress more objects into different files as needed (think sprites vs. blitter objects vs. backgrounds vs. music)
  • Got rabbit rendered on the screen and movable with the joystick
  • Animated rabbit frames while moving around on screen
A cartoon rabbit running around on a black screen

I also learned:

  • doing assembler debugging on a PiStorm-equipped Amiga using something like MonAm doesn’t work: https://github.com/michalsc/Emu68/issues/282
    • I tried a build of this branch on my PiStorm32 Lite and tracing in MonAm crashed the machine

The Obligatory Amiga Blitter Video

September 26, 2024

It’s time…time for a video on the Commodore Amiga Blitter! Topaz walks through the memory copy capabilities of this feature in the context of a small demo written to exercise the blitter, copper, and sprites.

Thanks to Tyrel (@tyrel@mastodon.social), corb0!

References

Code

Documentation

Credits

Music

SFX