Forgot to de-irs when IRS would cause a game over

This commit is contained in:
Randy Thiemann 2023-10-20 11:40:39 +02:00
parent 2eb1e5888f
commit e1077ebde4
3 changed files with 26 additions and 9 deletions

View File

@ -11,7 +11,6 @@ wShadowField:: ds (14*26)
SECTION "Field High Variables", HRAM
hToppedOut:: ds 1
hPieceDataBase:: ds 2
hPieceDataOffset:: ds 1
hCurrentLockDelayRemaining:: ds 1
@ -370,10 +369,6 @@ TrySpawnPiece::
; Copy the field to the shadow field.
call ToShadowField
; Assume we're not topped out.
xor a, a
ldh [hToppedOut], a
; Point the piece data to the correct piece.
call SetPieceData
call SetPieceDataOffset
@ -388,9 +383,31 @@ TrySpawnPiece::
ld d, h
ld e, l
call GetPieceData
jp CanPieceFit
call CanPieceFit
; A will be $FF if the piece can fit.
; We jump instead of return to save a few cycles.
cp a, $FF
ret z
; Otherwise check the rotation, and if it's not zero, try to reset it.
ldh a, [hCurrentPieceRotationState]
cp a, 0
ret nz
; Reset the rotation.
xor a, a
ldh [hCurrentPieceRotationState], a
call SetPieceDataOffset
ldh a, [hCurrentPieceY]
ld b, a
ldh a, [hCurrentPieceX]
call XYToSFieldPtr
ld d, h
ld e, l
call GetPieceData
jp CanPieceFit
; Draws the piece onto the field.

View File

@ -218,7 +218,7 @@ spawnPieceMode:
jr z, :+
ld a, MODE_GAME_OVER
ld [wMode], a
jr drawStaticInfo
jp drawStaticInfo
: ld a, MODE_PIECE_IN_MOTION
ld [wMode], a

View File

@ -1,5 +1,5 @@
#Emulicious settings file
#Fri Oct 20 08:52:26 CEST 2023
#Fri Oct 20 11:39:58 CEST 2023
WindowEventViewerWindowHeight=1416
WindowEventViewerWindowDivider=876
WindowMemoryTracerWindowY=631