dpad invert support

This commit is contained in:
Karkat
2018-03-13 00:16:23 -04:00
parent d2576c9433
commit 365cb58f01
4 changed files with 28 additions and 0 deletions

18
dpadinvert.asm Normal file
View File

@@ -0,0 +1,18 @@
;================================================================================
; D-Pad Invert
; runs in NMI, must use minimum possible # of cycles
;--------------------------------------------------------------------------------
; Filtered Joypad 1 Register: [BYST | udlr].
!INVERT_DPAD = "$7F50CB"
InvertDPad:
LDA !INVERT_DPAD : BEQ .normal
.inverted
LDA $4219
BIT.b #$0C : BEQ + : EOR #$0C : +
BIT.b #$03 : BEQ + : EOR #$03 : +
STA $01
RTL
.normal
LDA $4219 : STA $01
RTL
;--------------------------------------------------------------------------------