Browse Source

Don't read joysticks during auto-joypad read.

main
Colin McMillen 9 years ago
parent
commit
0e7d46c46f
  1. 10
      pewpew.asm
  2. 14
      registers.asm

10
pewpew.asm

@ -322,7 +322,7 @@ MainLoop:
lda #%00000001 ; Disable NMI interrupt while processing. lda #%00000001 ; Disable NMI interrupt while processing.
sta NMITIMEN sta NMITIMEN
jsr JoypadDebug
jsr JoypadRead
jsr JoypadHandler jsr JoypadHandler
jsr UpdateWorld jsr UpdateWorld
jsr FillSecondarySpriteTable 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 ldx JOY1L
stx joy1 stx joy1
ldx JOY2L ldx JOY2L

14
registers.asm

@ -145,6 +145,20 @@
; Each bit that's set enables one channel: 76543210 ; Each bit that's set enables one channel: 76543210
.define DMAENABLE $420B .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] ; $4218: Joypad #1 status [JOY1L]
; Format: AXLR0000 ; Format: AXLR0000
.define JOY1L $4218 .define JOY1L $4218

Loading…
Cancel
Save