aboutsummaryrefslogtreecommitdiff
path: root/src/demo.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-04-04 20:44:15 +0200
committerlonkaars <loek@pipeframe.xyz>2023-04-04 20:44:15 +0200
commit4881723cf765fbd7bad2a1f08baf5897a7425401 (patch)
tree96b828de8f27b8bb39a9c3f0aa31166552f99b41 /src/demo.c
parent47bf3627e4f44fa5e8095af0f70d5fccdb0f8cae (diff)
WIP DMA SPI TX
Diffstat (limited to 'src/demo.c')
-rw-r--r--src/demo.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/demo.c b/src/demo.c
index c4207c7..ecfc79f 100644
--- a/src/demo.c
+++ b/src/demo.c
@@ -7,14 +7,13 @@
hh_s_ppu_loc_fam_entry g_hh_demo_balls[HH_DEMO_BALL_COUNT];
void hh_demo_setup() {
- hh_ppu_update_aux((hh_s_ppu_loc_aux) { .sysreset = 1 });
-
// load sprites
hh_ppu_update_sprite(0, HH_DBG_SPRITE_BALL);
hh_ppu_update_sprite(1, HH_DBG_SPRITE_CHECKERBOARD);
// background pattern
- hh_ppu_update_color(0, 1, (hh_ppu_rgb_color_t) {0x4, 0x4, 0x4});
+ hh_ppu_update_color(0, 0, (hh_ppu_rgb_color_t) {0x1, 0x1, 0x3});
+ hh_ppu_update_color(0, 1, (hh_ppu_rgb_color_t) {0x4, 0x4, 0x6});
for (unsigned i = 0; i < HH_PPU_BG_CANVAS_TILES_H * HH_PPU_BG_CANVAS_TILES_V; i++) {
hh_ppu_update_background(i, (hh_s_ppu_loc_bam_entry) {
.horizontal_flip = false,
@@ -42,12 +41,7 @@ void hh_demo_setup() {
void hh_demo_loop(unsigned long frame) {
// set background pattern position
- hh_ppu_update_aux((hh_s_ppu_loc_aux) {
- .bg_shift_x = (frame / 2) % HH_PPU_SPRITE_WIDTH,
- .bg_shift_y = (frame / 8) % HH_PPU_SPRITE_HEIGHT,
- .fg_fetch = 0,
- .sysreset = 0,
- });
+ hh_ppu_update_background_pos((frame / 5) % HH_PPU_SPRITE_WIDTH, (frame / 20) % HH_PPU_SPRITE_HEIGHT);
for (unsigned i = 0; i < HH_DEMO_BALL_COUNT; i++) {
g_hh_demo_balls[i].position_x = HH_PPU_SCREEN_WIDTH/2 - HH_PPU_SPRITE_WIDTH/2 + (int)(60 * (double)sin((1*(double)frame / 10) + (double)i * 12));