From 76343003abd8bc686e6bb5ca4bcb77cb33b76e10 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Fri, 4 Jun 2021 10:30:53 +0200 Subject: Add text drawing support for framebuffer --- src/renderer.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'src/renderer.c') diff --git a/src/renderer.c b/src/renderer.c index 500cc78..f950a4d 100644 --- a/src/renderer.c +++ b/src/renderer.c @@ -16,31 +16,7 @@ // #include "text.h" - -// The frontbuffer is located at the beginning of the VRAM, and requires 20KB of -// video memory for 32 * 20 tiles at 4bpp. -#define FRONTBUF ((u32*)(MEM_VRAM)) - -// Adjust both of these if the location of the map changes. Each screnblock -// requires less than 2KB. -#define FRONTBUF_TILEMAP ((u16*)(MEM_VRAM + KB(20))) -#define FRONTBUF_SB 10 - -// The backbuffer is located at the end of the VRAM. This can allow us to use -// more backgrounds but eats into the available memory for sprites. This should -// be fine for non sprite intensive applications. If more sprite memory is -// needed, the backbuffer can be located at the end of the background memory -// instead (64KB - 20KB). -#define BACKBUF ((u32*)(MEM_VRAM + KB(96) - KB(20))) - -// The font data is located at the end of the frontbuffer memory, after the tile -// map and requires 8KB for 256 8x8 characters at 4bpp. This, along with the -// tilemap information allow us to store the frontbuffer and font for a text -// background in the first 2 charblocks (32KB). -#define FONT_DATA ((u32*)(MEM_VRAM + KB(22))) -#define FONT_TILEMAP ((u16*)(MEM_VRAM + KB(30))) -#define FONT_SB 15 -#define FONT_OFFSET 192 +#include "renderer.h" // Keep track of which tiles need to be copied to the frontbuffer. static u32 dirty_tiles[21] = {0}; -- cgit v1.2.1