summaryrefslogtreecommitdiff
path: root/engine/joypad.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/joypad.asm')
-rw-r--r--engine/joypad.asm12
1 files changed, 7 insertions, 5 deletions
diff --git a/engine/joypad.asm b/engine/joypad.asm
index 791056ca..bca84b33 100644
--- a/engine/joypad.asm
+++ b/engine/joypad.asm
@@ -2,14 +2,16 @@ ReadJoypad_:: ; c000 (3:4000)
; Poll joypad input.
; Unlike the hardware register, button
; presses are indicated by a set bit.
-
+ ld a, [hReadJoypad]
+ and a
+ ret nz
+
ld a, 1 << 5 ; select direction keys
- ld c, 0
+ ;ld c, 0
ld [rJOYP], a
- rept 6
ld a, [rJOYP]
- endr
+ ld a, [rJOYP]
cpl
and %1111
swap a
@@ -17,7 +19,7 @@ ReadJoypad_:: ; c000 (3:4000)
ld a, 1 << 4 ; select button keys
ld [rJOYP], a
- rept 10
+ rept 6
ld a, [rJOYP]
endr
cpl