diff --git a/src/field.asm b/src/field.asm index 438ed09..a3435ca 100644 --- a/src/field.asm +++ b/src/field.asm @@ -757,7 +757,15 @@ FieldProcess:: ; Want rotate CCW? .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 jr nz, .wantrotcw ldh a, [hWantRotation] @@ -768,7 +776,15 @@ FieldProcess:: ; Want rotate CW? .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 jr nz, .moverotrequested ldh a, [hWantRotation] diff --git a/src/main.asm b/src/main.asm index 37ce098..8d57a7a 100644 --- a/src/main.asm +++ b/src/main.asm @@ -10,6 +10,7 @@ INCLUDE "res/title_map.inc" SECTION "Globals", HRAM hGameState:: ds 1 +hSwapAB:: ds 1 SECTION "Stack", WRAM0 @@ -40,6 +41,8 @@ Main:: call CopyOAMHandler ; Zero out the ram where needed. + xor a, a + ldh [hSwapAB], a call TimeInit call IntrInit call InputInit diff --git a/src/state_gameplay.asm b/src/state_gameplay.asm index c6caf8d..f4a8741 100644 --- a/src/state_gameplay.asm +++ b/src/state_gameplay.asm @@ -180,7 +180,15 @@ fetchPieceMode: ; Check if IRS is requested. ; Apply the rotation if so. .checkIRSA + ld a, [hSwapAB] + cp a, 0 + jr z, .lda1 +.ldb1 + ld a, [hBState] + jr .cp1 +.lda1 ld a, [hAState] +.cp1 cp a, 0 jr z, .checkIRSB ld a, 1 @@ -189,7 +197,15 @@ fetchPieceMode: call SFXEnqueue .checkIRSB + ld a, [hSwapAB] + cp a, 0 + jr z, .ldb2 +.lda2 + ld a, [hAState] + jr .cp1 +.ldb2 ld a, [hBState] +.cp2 cp a, 0 jr z, .checkJingle ld a, 3 diff --git a/tools/Emulicious.ini b/tools/Emulicious.ini index dce7865..b869117 100644 --- a/tools/Emulicious.ini +++ b/tools/Emulicious.ini @@ -1,5 +1,5 @@ #Emulicious settings file -#Sat Oct 21 13:58:43 CEST 2023 +#Sat Oct 21 14:06:55 CEST 2023 WindowProfilerWindowOpen=false WindowEventViewerWindowHeight=1416 WindowEventViewerWindowDivider=876 @@ -7,7 +7,7 @@ WindowMemoryTracerWindowY=631 WindowMemoryTracerWindowX=383 Update=2 AudioSync=false -DebuggerMemoryTabVisibleRect=0,0,0,0 +DebuggerMemoryTabVisibleRect=0,0,687,128 WindowProfilerWindowWidth=1073 UninitializedMemoryBreakpointSuspend=true GameBoyErrorBreakpointEnabled32=false @@ -92,7 +92,7 @@ GameBoyErrorBreakpointSuspend2=true GameBoyErrorBreakpointSuspend1=true GameBoyErrorBreakpointSuspend0=true DebuggerConsoleLogBreakpoints=true -WindowDebuggerOpen=false +WindowDebuggerOpen=true Gamepad1Key37=-1 Gamepad1Key36=-1 Gamepad1Key35=-1 @@ -287,8 +287,8 @@ SouthPanelHeight=1064 SMSbuttonsKeyboard=false StackSplitLocation=534 WindowMemoryEditorHeight=534 -GBGamepadKeyboard=false WindowTilemapViewerWidth=404 +GBGamepadKeyboard=false UninitializedMemoryBreakpointCondition= GameBoyErrorBreakpointSuspend19=true GameBoyErrorBreakpointSuspend18=true @@ -300,5 +300,5 @@ WindowSpriteViewerOpen=false WindowProfilerWindowY=639 WindowProfilerWindowX=461 Scale=5.0 -WindowProfilerWindowProcedureProfiler=true KeyboardRequireWindowFocus=true +WindowProfilerWindowProcedureProfiler=true