diff options
-rw-r--r-- | 1_hello_world/main.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/1_hello_world/main.c b/1_hello_world/main.c index ee4ee64..1a30562 100644 --- a/1_hello_world/main.c +++ b/1_hello_world/main.c @@ -28,12 +28,12 @@ #define TEXT_POS_X (0x08) #define TEXT_POS_Y (0x04) -// ============================================================== -// TILE IDs -// ============================================================== -// The indices of each tile above. Once the tiles have been -// written to VRAM, the VDP refers to each tile by its index. -// ============================================================== +//============================================================== +// TILE IDs +//============================================================== +// The indices of each tile above. Once the tiles have been +// written to VRAM, the VDP refers to each tile by its index. +//============================================================== #define TILE_ID_SPACE (0x0) #define TILE_ID_H (0x1) #define TILE_ID_E (0x2) @@ -165,6 +165,16 @@ static uint32_t characters[TILE_COUNT * SIZE_TILE_L] = { 0x00000000L, }; +//============================================================== +// VRAM WRITE MACROS +//============================================================== +// Some utility macros to help generate addresses and commands for +// writing data to video memory, since they're tricky (and +// error prone) to calculate manually. +// The resulting command and address is written to the VDP's +// control port, ready to accept data in the data port. +//============================================================== + // Set the VRAM (video RAM) address to write to next static inline void SetVRAMWrite(uint16_t addr) { @@ -220,9 +230,9 @@ static void VDP_LoadRegisters(void) int main(void) { - // ============================================================== - // Initialise the Mega Drive - // ============================================================== + //============================================================== + // Initialise the Mega Drive + //============================================================== // Write the TMSS signature (if a model 1+ Mega Drive) VDP_WriteTMSS(); |