From 0daeed25c65412400e7b0b12ee1dc371c4060920 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Fri, 7 Apr 2023 23:14:46 +0200 Subject: last-ditch debugging efforts --- src/demo.c | 5 ++++- src/ppu/internals.c | 1 + src/ppu/stm.c | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/demo.c b/src/demo.c index a5a3a1e..27b8db2 100644 --- a/src/demo.c +++ b/src/demo.c @@ -39,11 +39,14 @@ void hh_demo_setup() { g_hh_demo_balls[i].palette_index = i+1; g_hh_demo_balls[i].tilemap_index = 1; } - hh_ppu_flush(); + // hh_ppu_flush(); } void hh_demo_loop(unsigned long frame) { // if (frame % 300 == 0) hh_demo_setup(); + // + // if (frame > 1) return; + // frame = 40; // set background pattern position hh_ppu_update_background_pos((frame / 5) % HH_PPU_SPRITE_WIDTH, (frame / 20) % HH_PPU_SPRITE_HEIGHT); diff --git a/src/ppu/internals.c b/src/ppu/internals.c index 7fd2eb9..5badfc9 100644 --- a/src/ppu/internals.c +++ b/src/ppu/internals.c @@ -105,6 +105,7 @@ void hh_ppu_vram_buffer(uint8_t data[4]) { } void hh_ppu_vram_flush() { + if (g_hh_ppu_vram_buffer_size == 0) return; hh_ppu_vram_buffer((uint8_t[4]){ 0xff, 0xff, 0xff, 0xff }); hh_ppu_vram_dwrite(g_hh_ppu_vram_buffer_ptr, g_hh_ppu_vram_buffer_size); g_hh_ppu_vram_buffer_size = 0; diff --git a/src/ppu/stm.c b/src/ppu/stm.c index ccf3566..7f60aed 100644 --- a/src/ppu/stm.c +++ b/src/ppu/stm.c @@ -8,6 +8,7 @@ void hh_ppu_init() { hh_ppu_update_aux((hh_s_ppu_loc_aux) { .sysreset = 1 }); hh_ppu_vram_buffer((uint8_t[4]) { 0xff, 0xff, 0xff, 0xff }); hh_ppu_flush(); + HAL_Delay(10); } void hh_ppu_deinit() {} -- cgit v1.2.3