Bouncy Ball Version 1 Available

Bouncy Ball version 1.0 has been released, and in time for the 2016 25th Cocofest. I was working on a timer bug, and RGB mapping, while Simon was working on the end game sequence. I owe him a case of beer for his efforts, staying up till 2am his time, on a work day! I am so looking forward to watching people play on my Coco 3.

 

The timer bug had me stumped for a while. I’m still using the 16-bit timer that DECB updates, as it was convenient. I do not plan to do that again. Eventually I tracked the problem down to having a global variable of the same name, and initializing it to 0 instead of the current time.

RGB color mapping was interesting. John Linville pointed me to a document (see page 14 here) that explained where the color registers were, and the default values. It also reminded me of the PALETTE RGB and PALETTE CMP commands. From the document:

$FFB0 GREEN     18   $FFB8 BLACK      00
$FFB1 YELLOW    36   $FFB9 GREEN      18
$FFB2 BLUE      11   $FFBA BLACK      00
$FFB3 RED       07   $FFBB BUFF       63
$FFB4 BUFF      63   $FFBC BLACK      00
$FFB5 CYAN      31   $FFBD GREEN      18
$FFB6 MAGENTA   09   $FFBE BLACK      00
$FFB7 ORANGE    38   $FFBF ORANGE     38

So all I needed to do was run PALETTE RGB, and inspect the values at those memory locations. Note however that you need to mask bit 6 off, so subtract 64 or logical and with 63.

The final colors are

byte rgbColorValues[] = {18,54,09,36,63,27,45,38,00,18,00,63,00,18,00,38};
byte cmpColorValues[] = {18,36,11,07,63,31,09,38,00,18,00,63,00,18,00,38};

Note that I had to map the color at $FFB3 a second time. Either that’s a bug I am over looking, or something odd with mapping colors. I’ll experiment more later.

Simon was fixing up his end game sequence and got it to run in the 128×96 graphics mode. We had been toying with the idea of the game returning to the title page after the sequence, but a bug prevented that. So we leave the sequence running forever to avoid a crash. He also had to help figure out where to map Bouncy Ball and his code. Glad he knew his way around.

CMOC is a wonderful tool. However, it lacks the ability to link with assembly routines. You can do inline, but it’s not quite the same. In this case, it was not practical to convert his assembly to inline. So we ended up having to load both the Bouncy Ball binary at $E00, and Simon’s compiled routine somewhere else. However, that meant you had to load 2 binary files. Not good.

So we went into DECB, loaded the 2 binaries with LOADM, then saved the combined them with a SAVEM. This is the cool part. Since MAME didn’t seem to update the disk image, I ended up using my real Coco 3 to create the final disk image! So at least the Coco had a little something to do with the Coco game that I run on it.

Head over to the Bouncy Ball home page to download. This video is a sneak peek of the game. I hope you enjoy playing it as much as I enjoyed making it.

Bounce on!