Read from joypad

This commit is contained in:
Greg Shuflin 2022-06-15 11:30:27 -07:00
parent 8f947ae232
commit f1d3f2f6b6

View File

@ -85,23 +85,32 @@ start:
sta VMDATAL sta VMDATAL
stz VMDATAH 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 ; Show bg1
lda #%00000001 lda #%00000001
sta TM sta TM
lda #$0f lda #$0f
sta INIDISP 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: busywait:
bra busywait bra busywait