From a1b95e9ccf9bd7b316adf21952e43e03f2bf3746 Mon Sep 17 00:00:00 2001 From: Ben Bridle <ben@derelict.engineering> Date: Tue, 19 Nov 2024 17:52:36 +1300 Subject: Implement memory device The memory device is fully implemented, with 3MB of heap memory. This commit is a bit messy, additional changes are: - The program memory and program counter in each Bedrock struct have been moved to a dedicated struct to prevent a name collision with the memory device - The run_bg and debug functions have been moved to core.c and debug.c - The blank screen colour has been changed back to black - No second program runs on the sub screen by default - The number of Bedrock instances to run has been parameterized --- arm9/source/devices/screen.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'arm9/source/devices/screen.c') diff --git a/arm9/source/devices/screen.c b/arm9/source/devices/screen.c index 492bb05..0d2fc36 100644 --- a/arm9/source/devices/screen.c +++ b/arm9/source/devices/screen.c @@ -52,8 +52,6 @@ void set_palette_low(ScreenDevice *scr, u8 low) { u8 r = scr->palette_write >> 7 & 0x1e; u8 g = scr->palette_write >> 3 & 0x1e; u8 b = scr->palette_write << 1 & 0x1e; - // TODO: With 4-bit we multiply by 17, find equivalent - // here to get best value of least-significant bit. scr->palette[i] = RGB15(r,g,b); scr->nds->pal[i] = RGB15(r,g,b); } @@ -132,7 +130,7 @@ void flip_buffer(Screen *nds) { } void black_screen(Screen *nds) { - nds->pal[0] = RGB15(8,0,0); + nds->pal[0] = RGB15(0,0,0); dmaFillWords(0, nds->bgv, TILES_MEM); dmaFillWords(0, nds->fgv, TILES_MEM); } -- cgit v1.2.3-70-g09d2