Chapter 4- July 22th, 2013
Before we can start any serious coding, we must firstly define the memory map for the game. Things like where the display screen will be, where the graphics and sound samples will be stored and where the program will reside.
The video display will be using double buffering so I will need to allocate 2 areas for this and because I am enabling horizontal scrolling with a 320x225 16 color screen, this will mean each screen needs 57K.
The block size that the GIME chip's Memory Management Unit (MMU) works with is 8K. There are 64 of these blocks defined in the Color Computer 3's 512K memory space. The 6809 can only address 64K so the MMU lets me choose any 8 of these blocks to construct the 64K address space that the 6809 can address.
Having access to only 64K complicates things because the video display almost consumes all of that space. I therefore need to bank in different 8K blocks frequently during the running of the game in order to access different parts of the total 512K.
To fit the display, I divide the screen into seven 8K blocks. The top block (seen at the top of the screen) will contain the score and level displays while the bottom 8K (seen at the bottom of the screen) will contain other displays such as a fuel gauge and lives counter. That leaves me with 5 blocks for the active game play area. This makes my actual game screen area 40K (5 x 8K) which is a bit more manageable in the 6809 address space and leaves me with enough space for the actual game code to reside.
The two tables below show the memory allocation of each screen within the GIME's 512K address space.
The table below shows the MMU mapping for the 64K address space the 6809 will see when accessing the video display screen memory.
There are still more areas to define such as where the graphics used in the game and sound samples will be stored.
Copyright 2013 by Nickolas Marentes