Fix joystick code

This commit is contained in:
hkz 2025-10-13 17:48:52 +02:00
commit 31018463ad
3 changed files with 10 additions and 8 deletions

Binary file not shown.

View file

@ -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$

View file

@ -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();