Today’s exercise was line up which was largely simple string substitution with a few edge cases. This one was specified nicely but they really should tell you the type and order of parameters to the function. I shouldn’t have to go look in the test cases to see what they want.

Even more constants changed since my Gameboy programming book was written.

Book Current
LCDCF_OBJOFF LCDC_OBJ_OFF
LCDCF_OBJON LCDC_OBJ_ON
LCDCF_OBJ8 LCDC_OBJ_8
LCDCF_OBJ16 LCDC_OBJ_16
LCDF_OBJ8 LCDC_OBJ_8
LCDF_OBJ16 LCDC_OBJ_16
_OAMRAM Not found
OAMF_PAL0 OAM_PAL0
sizeof_OAM_ATTRS OBJ_SIZE
OAMF_XFLIP OAM_XFLIP
OAMF_YFLIP OAM_YFLIP
_RAM Not found

I finished up Chapter 7. I could have moved on to Chapter 8 joypad input, but I didn’t.

Yesterday I made a hello world app. I still had one more simple app I wanted to try and that was the DVD screen saver.

I downloaded LibreSprite so that I could make the tiles more easily and still had problems. There is a pre-built GameBoy palette, but it wanted to save a transparency color if you didn’t fill the entire thing with color (I thought I had but I guess not). Then the graphics conversion threw up because I didn’t have a proper blank tile in the tile map tile space. Eventually I got it working, but it was a pain. Yesterday I downloaded Tiled to make the Hello World map. Today I just wanted a blank background so it wasn’t used.

It is just a DVD logo that bounces around the screen. Unfortunately, the GameBoy has a squarish screen so it doesn’t bounce very well, just follows a set path. It still works, and boy did it take a lot more effort than expected to make it work. The logo itself is four 8×16 sprites. I calculated all of the addresses and values in a loop and even used some memory addresses as sort-of variables.

It was a huge amount of assembly (~130 lines) to get it working. Strangely the bouncing seemed to work just fine but setting the status of all of the sprites was a nightmare.

Ok, on to Chapter 8 tomorrow. First, however, the screensaver.