diff options
Diffstat (limited to 'src/renderer.c')
-rw-r--r-- | src/renderer.c | 18 |
1 files changed, 18 insertions, 0 deletions
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. | ||
27 | static u32 dirty_tiles[21] = {0}; | 45 | static 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. |