aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-04-17 17:33:46 +0200
committerlonkaars <loek@pipeframe.xyz>2023-04-17 17:33:46 +0200
commit151ef82382104cfef375d8c1d256d72cb61b16fd (patch)
tree70f846994fafb6c0b44d04d50b6428b3d67d1536 /src
parent572e304947fae828c67deaaa1301f807fcb062ff (diff)
Diffstat (limited to 'src')
-rw-r--r--src/main.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/main.c b/src/main.c
index 37a8719..d061bb3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -17,21 +17,17 @@ volatile unsigned short g_hh_hcount;
void hh_ppu_vblank_interrupt() {
static unsigned long frame = 0;
-// #ifdef HH_TARGET_STM32
-// hh_ppu_flush();
-// hh_input_read();
-// hh_demo_loop(frame);
-// #endif
- // if (frame > 1) return;
- for (size_t i = 0; i < HH_PPUINTDEMO_LENGTH; i += 4) {
- uint8_t* d = HH_PPUINTDEMO_ARR + i;
- if (d[0] == 0xff && d[1] == 0xff && d[2] == 0xff && d[3] == 0xff) {
- hh_ppu_flush();
- } else {
- hh_ppu_vram_buffer(d);
- }
- }
- hh_ppu_flush();
+
+ // hh_ppu_flush();
+ // hh_input_read();
+ // hh_demo_loop(frame);
+
+ size_t offset = frame * 4;
+ if (offset >= HH_PPUINTDEMO_LENGTH) return;
+ uint8_t* d = HH_PPUINTDEMO_ARR + offset;
+ hh_ppu_vram_buffer(d);
+ hh_ppu_vram_flush();
+
frame++;
}