From 2e5cc6552f3e43f97fa049bb91498b4ae8877438 Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Thu, 27 Oct 2022 20:17:09 +0300 Subject: [PATCH 1/1] proper screen cleanup and switching back&forth between screens --- src/gamescr.c | 32 ++++++++++++++++++++++++++++---- src/menuscr.c | 1 + src/util.h | 2 +- src/voxscape.c | 16 ++++++++++++---- 4 files changed, 42 insertions(+), 9 deletions(-) diff --git a/src/gamescr.c b/src/gamescr.c index cc089f2..fa74c94 100644 --- a/src/gamescr.c +++ b/src/gamescr.c @@ -21,7 +21,7 @@ static void gamescr_stop(void); static void gamescr_frame(void); static void gamescr_vblank(void); -static void update(void); +static int update(void); static void draw(void); static struct screen gamescr = { @@ -88,6 +88,7 @@ static int gamescr_start(void) prev_iwram_top = iwram_sbrk(0); gba_setmode(4, DISPCNT_BG2 | DISPCNT_OBJ | DISPCNT_FB1); + fillblock_16byte(gba_vram_lfb1, 0, 240 * 160 / 16); vblperf_setcolor(0); @@ -125,7 +126,7 @@ static int gamescr_start(void) num_enemies = total_enemies = 0; energy = 5; - srand(0); + memset(enemies, 0, sizeof enemies); cptr = color_pixels; for(i=0; i