Don't read joysticks during auto-joypad read.

This commit is contained in:
Colin McMillen 2015-05-30 09:28:07 -04:00
parent 5c45dfa834
commit 0e7d46c46f
2 changed files with 21 additions and 3 deletions

View File

@ -322,7 +322,7 @@ MainLoop:
lda #%00000001 ; Disable NMI interrupt while processing.
sta NMITIMEN
jsr JoypadDebug
jsr JoypadRead
jsr JoypadHandler
jsr UpdateWorld
jsr FillSecondarySpriteTable
@ -331,8 +331,12 @@ MainLoop:
JoypadDebug:
; Load joypad registers into RAM for easier inspection.
JoypadRead:
; Load joypad registers into RAM for easy inspection & manipulation.
-
lda HVBJOY
bit #$01 ; If auto-joypad read is happening, loop.
bne -
ldx JOY1L
stx joy1
ldx JOY2L

View File

@ -145,6 +145,20 @@
; Each bit that's set enables one channel: 76543210
.define DMAENABLE $420B
; $4212: VBlank/HBlank/Joypad status [HVBJOY]
; vh-----a
; v = V-Blank Flag. If we're currently in V-Blank, this flag is set,
; otherwise it is clear. The setting seems to occur at H Counter
; about $16-$17 when V Counter is $E1, and the clearing at about $1E
; with V Counter 0.
; h = H-Blank Flag. If we're currently in H-Blank, this flag is set,
; otherwise it is clear. The setting seems to occur at H Counter
; about $121-$122, and the clearing at about $12-$18.
; a = Auto-Joypad Status. This is set while Auto-Joypad Read is in
; progress, and cleared when complete. It typically turns on at
; the start of V-Blank, and completes 3 scanlines later.
.define HVBJOY $4212
; $4218: Joypad #1 status [JOY1L]
; Format: AXLR0000
.define JOY1L $4218