Constants for controller input

This commit is contained in:
Greg Shuflin 2022-06-16 13:40:58 -07:00
parent f1d3f2f6b6
commit a5d8084260
2 changed files with 20 additions and 2 deletions

View File

@ -0,0 +1,17 @@
; Joypad bitmaps
JOYH_B = %10000000
JOYH_Y = %01000000
JOYH_SEL = %00100000
JOYH_START = %00010000
JOYH_UP = %00001000
JOYH_DOWN = %00000100
JOYH_LEFT = %00000010
JOYH_RIGHT = %00000001
JOYL_A = %10000000
JOYL_X = %01000000
JOYL_L = %00100000
JOYL_R = %00010000

View File

@ -3,6 +3,7 @@
.include "macros.inc" .include "macros.inc"
.include "registers.inc" .include "registers.inc"
.include "keys.inc"
.include "header.asm" .include "header.asm"
@ -96,8 +97,8 @@ start:
sta NMITIMEN sta NMITIMEN
mainloop: mainloop:
lda JOY1H lda JOY1L
bit #%00000100 ; Down button bit #JOYL_L
beq down_not_pressed beq down_not_pressed
; write tile 2 to position (4, 8) ; write tile 2 to position (4, 8)
TILE_X2= 4 TILE_X2= 4