From 6b68cbd8a25dc2e554cf6741ff61ef87c030d841 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Wed, 2 Jun 2021 20:57:38 +0200 Subject: Update comments on renderer.c --- src/renderer.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/renderer.c') 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 @@ +// +// This Mode 0 renderer provides a way of drawing directly to a framebuffer +// (similar to Mode 3 and 4) while retaining the flexibility of using other +// backgrounds if needed. It also performs double buffering to avoid tearing +// artifacts and tries to only draw tiles that changed on each frame. +// +// In addition to the frontbuffer (displayed on background 0), a tiled text +// layer is displayed on background 1, which can be used for application +// development or for debug information. +// +// These two layers occupy the first and second background charblocks, leaving +// the remaining two available for other background layers. There are 14KB of +// sprite memory available, since the backbuffer is located at the end of the +// VRAM, but if more space is needed it can be moved to the end of the BG +// charblocks instead. +// + #include "bd-font.c" // The frontbuffer is located at the beginning of the VRAM, and requires 20KB of @@ -24,6 +41,7 @@ #define FONT_TILEMAP ((u16*)(MEM_VRAM + KB(30))) #define FONT_SB 15 +// Keep track of which tiles need to be copied to the frontbuffer. static u32 dirty_tiles[21] = {0}; // TODO: Allow disable bound checking at compile time. -- cgit v1.2.1