aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gba/gba.h1
-rw-r--r--src/renderer.c18
2 files changed, 18 insertions, 1 deletions
diff --git a/src/gba/gba.h b/src/gba/gba.h
index 56c4876..a53363a 100644
--- a/src/gba/gba.h
+++ b/src/gba/gba.h
@@ -113,7 +113,6 @@ typedef Color Palette[16];
113// 113//
114 114
115// NOTE: Only defining 4bpp tiles for now. 115// NOTE: Only defining 4bpp tiles for now.
116// TODO: typedef u32 Tile[8];
117typedef struct Tile { 116typedef struct Tile {
118 u32 row[8]; 117 u32 row[8];
119} Tile; 118} Tile;
diff --git a/src/renderer.c b/src/renderer.c
index ec54411..bddaacd 100644
--- a/src/renderer.c
+++ b/src/renderer.c
@@ -1,3 +1,20 @@
1//
2// This Mode 0 renderer provides a way of drawing directly to a framebuffer
3// (similar to Mode 3 and 4) while retaining the flexibility of using other
4// backgrounds if needed. It also performs double buffering to avoid tearing
5// artifacts and tries to only draw tiles that changed on each frame.
6//
7// In addition to the frontbuffer (displayed on background 0), a tiled text
8// layer is displayed on background 1, which can be used for application
9// development or for debug information.
10//
11// These two layers occupy the first and second background charblocks, leaving
12// the remaining two available for other background layers. There are 14KB of
13// sprite memory available, since the backbuffer is located at the end of the
14// VRAM, but if more space is needed it can be moved to the end of the BG
15// charblocks instead.
16//
17
1#include "bd-font.c" 18#include "bd-font.c"
2 19
3// The frontbuffer is located at the beginning of the VRAM, and requires 20KB of 20// The frontbuffer is located at the beginning of the VRAM, and requires 20KB of
@@ -24,6 +41,7 @@
24#define FONT_TILEMAP ((u16*)(MEM_VRAM + KB(30))) 41#define FONT_TILEMAP ((u16*)(MEM_VRAM + KB(30)))
25#define FONT_SB 15 42#define FONT_SB 15
26 43
44// Keep track of which tiles need to be copied to the frontbuffer.
27static u32 dirty_tiles[21] = {0}; 45static u32 dirty_tiles[21] = {0};
28 46
29// TODO: Allow disable bound checking at compile time. 47// TODO: Allow disable bound checking at compile time.