Add internal button swap.

This commit is contained in:
Randy Thiemann 2023-10-21 14:07:28 +02:00
parent 8844b163b9
commit 33e1bf3520
4 changed files with 42 additions and 7 deletions

View File

@ -757,7 +757,15 @@ FieldProcess::
; Want rotate CCW? ; Want rotate CCW?
.wantrotccw .wantrotccw
ldh a, [hAState] ld a, [hSwapAB]
cp a, 0
jr z, .ldb1
.lda1
ld a, [hAState]
jr .cp1
.ldb1
ld a, [hBState]
.cp1
cp a, 1 cp a, 1
jr nz, .wantrotcw jr nz, .wantrotcw
ldh a, [hWantRotation] ldh a, [hWantRotation]
@ -768,7 +776,15 @@ FieldProcess::
; Want rotate CW? ; Want rotate CW?
.wantrotcw .wantrotcw
ldh a, [hBState] ld a, [hSwapAB]
cp a, 0
jr z, .lda2
.ldb2
ld a, [hBState]
jr .cp2
.lda2
ld a, [hAState]
.cp2
cp a, 1 cp a, 1
jr nz, .moverotrequested jr nz, .moverotrequested
ldh a, [hWantRotation] ldh a, [hWantRotation]

View File

@ -10,6 +10,7 @@ INCLUDE "res/title_map.inc"
SECTION "Globals", HRAM SECTION "Globals", HRAM
hGameState:: ds 1 hGameState:: ds 1
hSwapAB:: ds 1
SECTION "Stack", WRAM0 SECTION "Stack", WRAM0
@ -40,6 +41,8 @@ Main::
call CopyOAMHandler call CopyOAMHandler
; Zero out the ram where needed. ; Zero out the ram where needed.
xor a, a
ldh [hSwapAB], a
call TimeInit call TimeInit
call IntrInit call IntrInit
call InputInit call InputInit

View File

@ -180,7 +180,15 @@ fetchPieceMode:
; Check if IRS is requested. ; Check if IRS is requested.
; Apply the rotation if so. ; Apply the rotation if so.
.checkIRSA .checkIRSA
ld a, [hSwapAB]
cp a, 0
jr z, .lda1
.ldb1
ld a, [hBState]
jr .cp1
.lda1
ld a, [hAState] ld a, [hAState]
.cp1
cp a, 0 cp a, 0
jr z, .checkIRSB jr z, .checkIRSB
ld a, 1 ld a, 1
@ -189,7 +197,15 @@ fetchPieceMode:
call SFXEnqueue call SFXEnqueue
.checkIRSB .checkIRSB
ld a, [hSwapAB]
cp a, 0
jr z, .ldb2
.lda2
ld a, [hAState]
jr .cp1
.ldb2
ld a, [hBState] ld a, [hBState]
.cp2
cp a, 0 cp a, 0
jr z, .checkJingle jr z, .checkJingle
ld a, 3 ld a, 3

View File

@ -1,5 +1,5 @@
#Emulicious settings file #Emulicious settings file
#Sat Oct 21 13:58:43 CEST 2023 #Sat Oct 21 14:06:55 CEST 2023
WindowProfilerWindowOpen=false WindowProfilerWindowOpen=false
WindowEventViewerWindowHeight=1416 WindowEventViewerWindowHeight=1416
WindowEventViewerWindowDivider=876 WindowEventViewerWindowDivider=876
@ -7,7 +7,7 @@ WindowMemoryTracerWindowY=631
WindowMemoryTracerWindowX=383 WindowMemoryTracerWindowX=383
Update=2 Update=2
AudioSync=false AudioSync=false
DebuggerMemoryTabVisibleRect=0,0,0,0 DebuggerMemoryTabVisibleRect=0,0,687,128
WindowProfilerWindowWidth=1073 WindowProfilerWindowWidth=1073
UninitializedMemoryBreakpointSuspend=true UninitializedMemoryBreakpointSuspend=true
GameBoyErrorBreakpointEnabled32=false GameBoyErrorBreakpointEnabled32=false
@ -92,7 +92,7 @@ GameBoyErrorBreakpointSuspend2=true
GameBoyErrorBreakpointSuspend1=true GameBoyErrorBreakpointSuspend1=true
GameBoyErrorBreakpointSuspend0=true GameBoyErrorBreakpointSuspend0=true
DebuggerConsoleLogBreakpoints=true DebuggerConsoleLogBreakpoints=true
WindowDebuggerOpen=false WindowDebuggerOpen=true
Gamepad1Key37=-1 Gamepad1Key37=-1
Gamepad1Key36=-1 Gamepad1Key36=-1
Gamepad1Key35=-1 Gamepad1Key35=-1
@ -287,8 +287,8 @@ SouthPanelHeight=1064
SMSbuttonsKeyboard=false SMSbuttonsKeyboard=false
StackSplitLocation=534 StackSplitLocation=534
WindowMemoryEditorHeight=534 WindowMemoryEditorHeight=534
GBGamepadKeyboard=false
WindowTilemapViewerWidth=404 WindowTilemapViewerWidth=404
GBGamepadKeyboard=false
UninitializedMemoryBreakpointCondition= UninitializedMemoryBreakpointCondition=
GameBoyErrorBreakpointSuspend19=true GameBoyErrorBreakpointSuspend19=true
GameBoyErrorBreakpointSuspend18=true GameBoyErrorBreakpointSuspend18=true
@ -300,5 +300,5 @@ WindowSpriteViewerOpen=false
WindowProfilerWindowY=639 WindowProfilerWindowY=639
WindowProfilerWindowX=461 WindowProfilerWindowX=461
Scale=5.0 Scale=5.0
WindowProfilerWindowProcedureProfiler=true
KeyboardRequireWindowFocus=true KeyboardRequireWindowFocus=true
WindowProfilerWindowProcedureProfiler=true