Constants for controller input
This commit is contained in:
parent
f1d3f2f6b6
commit
a5d8084260
17
homebrew-tutorial/keys.inc
Normal file
17
homebrew-tutorial/keys.inc
Normal 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
|
@ -3,6 +3,7 @@
|
||||
|
||||
.include "macros.inc"
|
||||
.include "registers.inc"
|
||||
.include "keys.inc"
|
||||
|
||||
.include "header.asm"
|
||||
|
||||
@ -96,8 +97,8 @@ start:
|
||||
sta NMITIMEN
|
||||
|
||||
mainloop:
|
||||
lda JOY1H
|
||||
bit #%00000100 ; Down button
|
||||
lda JOY1L
|
||||
bit #JOYL_L
|
||||
beq down_not_pressed
|
||||
; write tile 2 to position (4, 8)
|
||||
TILE_X2= 4
|
||||
|
Loading…
Reference in New Issue
Block a user