Read from joypad

This commit is contained in:
Greg Shuflin 2022-06-15 11:30:27 -07:00
parent 8f947ae232
commit f1d3f2f6b6
1 changed files with 19 additions and 10 deletions

View File

@ -85,23 +85,32 @@ start:
sta VMDATAL
stz VMDATAH
; write tile 2 to position (4, 8)
TILE_X2= 4
TILE_Y2= 8
ldx #(VRAM_BG1 + (TILE_Y2* 32) + TILE_X2)
stx VMADDL
lda #$02
sta VMDATAL
stz VMDATAH
; Show bg1
lda #%00000001
sta TM
lda #$0f
sta INIDISP
lda #$01
sta NMITIMEN
mainloop:
lda JOY1H
bit #%00000100 ; Down button
beq down_not_pressed
; write tile 2 to position (4, 8)
TILE_X2= 4
TILE_Y2= 8
ldx #(VRAM_BG1 + (TILE_Y2* 32) + TILE_X2)
stx VMADDL
lda #$02
sta VMDATAL
stz VMDATAH
down_not_pressed:
bra mainloop
busywait:
bra busywait