From 31018463ada4589c066c49ba14882b7e4c6630ac Mon Sep 17 00:00:00 2001 From: hkz Date: Mon, 13 Oct 2025 17:48:52 +0200 Subject: [PATCH] Fix joystick code --- data/vdp_colortable.bin | Bin 32 -> 32 bytes src/game_vdp_graphics.s | 14 ++++++++------ src/vdgam_main.c | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/data/vdp_colortable.bin b/data/vdp_colortable.bin index 20da2c52f6ce161b98fe5aa4fc6e0b7241c5ac61..1387e29bb50a664b01df8d566ae88b20b136467b 100644 GIT binary patch literal 32 dcmezH0RajYG<;wH0R@MIf&~W*0tzN<003~$5`h2! literal 32 ccmezH0RajYG%$dHfVf&&Ht1rs&^0ASw{kpKVy diff --git a/src/game_vdp_graphics.s b/src/game_vdp_graphics.s index e5ad36e..90215b1 100644 --- a/src/game_vdp_graphics.s +++ b/src/game_vdp_graphics.s @@ -101,7 +101,9 @@ T_X$: .equ _Zp+0 jsr vdp_point_to_vram_xy lda #0 sta VDP_MEM - sta VDP_MEM + nop ; Slow down, we're using this while the IC is rendering + sta VDP_MEM + nop sta VDP_MEM ; Jump to the correct code to handle joystick drawing @@ -117,23 +119,23 @@ T_X$: .equ _Zp+0 J_Center$: ldx #29 - ldy #18 + ldy #17 bcs J_Done$ J_Up$: ldx #29 - ldy #17 + ldy #16 bcs J_Done$ J_Down$: ldx #29 - ldy #19 + ldy #18 bcs J_Done$ J_Left$: ldx #28 - ldy #18 + ldy #17 bcs J_Done$ J_Right$: ldx #30 - ldy #18 + ldy #17 J_Done$: stx zp:T_X$ sty zp:T_Y$ diff --git a/src/vdgam_main.c b/src/vdgam_main.c index d511f58..d6be51c 100644 --- a/src/vdgam_main.c +++ b/src/vdgam_main.c @@ -89,9 +89,9 @@ void main(void) { decbuf_to_ascii(5, text_buf); vdp_print_string(0, SCORE_TEXT_X, SCORE_TEXT_Y, (char*)text_buf); - //vdp_draw_joystick(JS_POS_CENTER); // Center the joystick + vdp_draw_joystick(JS_POS_CENTER); // Center the joystick - //vdp_redraw_tiles(get_front_grid()); + vdp_redraw_tiles(get_front_grid()); while(1); __enable_interrupts();