Start with one held piece to mitigate lack of 3-piece-preview.

This commit is contained in:
Randy Thiemann 2023-10-23 06:22:27 +02:00
parent 9b347b9e76
commit 65a74661a7
2 changed files with 7 additions and 18 deletions

View File

@ -64,6 +64,10 @@ RNGInit::
ld bc, 7
call UnsafeMemCopy
; Start with a random piece held.
call Next7Piece
ldh [hHeldPiece], a
; If we're in HELL mode, we don't care about anything but a random piece to start with.
ldh a, [hSimulationMode]
cp a, MODE_HELL

View File

@ -39,7 +39,7 @@ hCurrentPiece:: ds 1
hCurrentPieceX:: ds 1
hCurrentPieceY:: ds 1
hCurrentPieceRotationState:: ds 1
hHeldPiece: ds 1
hHeldPiece:: ds 1
hHoldSpent:: ds 1
hSkipJingle: ds 1
hMode: ds 1
@ -91,9 +91,7 @@ SwitchToGameplay::
call LevelInit
call FieldInit
; We don't start with a held piece.
ld a, PIECE_NONE
ldh [hHeldPiece], a
; We don't start with hold spent.
xor a, a
ldh [hHoldSpent], a
@ -464,8 +462,6 @@ gameOverMode:
call ScoreInit
call LevelInit
call FieldInit
ld a, PIECE_NONE
ldh [hHeldPiece], a
xor a, a
ldh [hHoldSpent], a
ld a, MODE_LEADY
@ -586,18 +582,7 @@ DoHold:
ldh [hCurrentPieceRotationState], a
.doHoldOperation
; If we're not holding a piece, hold the current piece and get a new one.
ldh a, [hHeldPiece]
cp a, PIECE_NONE
jr nz, :+
ldh a, [hCurrentPiece]
ldh [hHeldPiece], a
ldh a, [hNextPiece]
ldh [hCurrentPiece], a
call GetNextPiece
ret
: ld b, a
ld b, a
ldh a, [hCurrentPiece]
ldh [hHeldPiece], a
ld a, b