diff options
author | lonkaars <loek@pipeframe.xyz> | 2023-04-16 18:28:35 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2023-04-16 18:28:35 +0200 |
commit | e73473f5292664427bfeeef0063452e88b066e72 (patch) | |
tree | 44efee0615fc1acb77c515c0e2081253413ff19e /src | |
parent | 597de95572721ea51569caeba40bfb816f505400 (diff) |
more debugging
Diffstat (limited to 'src')
-rw-r--r-- | src/demo.c | 2 | ||||
-rw-r--r-- | src/main.c | 35 | ||||
-rw-r--r-- | src/stm32/setup.c | 2 |
3 files changed, 18 insertions, 21 deletions
@@ -9,6 +9,7 @@ hh_s_ppu_loc_fam_entry g_hh_demo_balls[HH_DEMO_BALL_COUNT]; void hh_demo_setup() { + return; // load sprites hh_ppu_update_sprite(1, HH_DBG_SPRITE_BALL); hh_ppu_update_sprite(2, HH_DBG_SPRITE_CHECKERBOARD); @@ -43,6 +44,7 @@ void hh_demo_setup() { } void hh_demo_loop(unsigned long frame) { + return; // if (frame % 300 == 0) hh_demo_setup(); // // if (frame > 1) return; @@ -2,13 +2,13 @@ #include "main.h" #include "demo.h" +#include "ppu/internals.h" #include "ppu/ppu.h" #include "input.h" +#include "../test/ppu-stm-integration-demo/data.h" #ifdef HH_TARGET_DESKTOP #include <stdio.h> -#include "../test/ppu-stm-integration-demo/data.h" -#include "ppu/internals.h" #endif bool g_hh_run = true; @@ -17,26 +17,21 @@ 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 -#ifdef HH_TARGET_DESKTOP - static bool done = false; - //hh_ppu_vram_dwrite((uint8_t*) HH_PPUINTDEMO_ARR, HH_PPUINTDEMO_LENGTH); - for (unsigned int limit = 0; limit < 1000; limit++) { - if (frame * 4 >= HH_PPUINTDEMO_LENGTH) { - if (!done) printf("done\n"); - done = true; - return; +// #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_vram_dwrite((uint8_t*) HH_PPUINTDEMO_ARR + frame * 4, 4); - uint8_t* d = HH_PPUINTDEMO_ARR + frame * 4; - if (d[0] == 0xff && d[1] == 0xff && d[2] == 0xff && d[3] == 0xff) break; // run all commands until flush - else frame++; } -#endif + hh_ppu_flush(); frame++; } diff --git a/src/stm32/setup.c b/src/stm32/setup.c index 6975592..7b9f35a 100644 --- a/src/stm32/setup.c +++ b/src/stm32/setup.c @@ -34,7 +34,7 @@ SPI_HandleTypeDef hspi1 = { .Init.CLKPolarity = SPI_POLARITY_LOW, .Init.CLKPhase = SPI_PHASE_1EDGE, .Init.NSS = SPI_NSS_SOFT, - .Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2, + .Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16, .Init.FirstBit = SPI_FIRSTBIT_MSB, .Init.TIMode = SPI_TIMODE_DISABLE, .Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE, |