Forgot that TGM3 gives more levels for more lines!

This commit is contained in:
Randy Thiemann 2023-10-22 22:33:35 +02:00
parent 1802659875
commit 384a8fa801
3 changed files with 36 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@ -52,6 +52,7 @@ hLineClearCt: ds 1
hComboCt: ds 1 hComboCt: ds 1
hLockDelayForce: ds 1 hLockDelayForce: ds 1
hHighestStack: ds 1 hHighestStack: ds 1
hDownFrames: ds 1
SECTION "Field Functions", ROM0 SECTION "Field Functions", ROM0
@ -501,6 +502,7 @@ ForceSpawnPiece::
TrySpawnPiece:: TrySpawnPiece::
; Always reset these for a new piece. ; Always reset these for a new piece.
xor a, a xor a, a
ldh [hDownFrames], a
ldh [hLockDelayForce], a ldh [hLockDelayForce], a
ldh a, [hCurrentLockDelay] ldh a, [hCurrentLockDelay]
ldh [hCurrentLockDelayRemaining], a ldh [hCurrentLockDelayRemaining], a
@ -756,6 +758,9 @@ FieldProcess::
; Sonic drop. ; Sonic drop.
.sonicdrop .sonicdrop
ldh a, [hDownFrames]
add a, 10
ldh [hDownFrames], a
ld a, 20 ld a, 20
ldh [hWantedG], a ldh [hWantedG], a
ldh a, [hTicksUntilG] ldh a, [hTicksUntilG]
@ -768,6 +773,9 @@ FieldProcess::
; Hard drop. ; Hard drop.
.harddrop .harddrop
ldh a, [hDownFrames]
add a, 10
ldh [hDownFrames], a
ld a, 20 ld a, 20
ld b, a ld b, a
ldh a, [hActualG] ldh a, [hActualG]
@ -789,6 +797,9 @@ FieldProcess::
ldh a, [hDownState] ldh a, [hDownState]
cp a, 0 cp a, 0
jr z, :+ jr z, :+
ldh a, [hDownFrames]
inc a
ldh [hDownFrames], a
ld a, 1 ld a, 1
ldh [hTicksUntilG], a ldh [hTicksUntilG], a
@ -1695,6 +1706,26 @@ FieldDelay::
ldh [hRequiresLineClear], a ldh [hRequiresLineClear], a
ldh a, [hLineClearCt] ldh a, [hLineClearCt]
ld e, a ld e, a
ldh a, [hSimulationMode]
cp a, MODE_TGM3
jr z, .modifylines
cp a, MODE_TGW3
jr z, .modifylines
jr .applylines
.modifylines
ldh a, [hLineClearCt]
cp a, 1
jr z, .applylines
cp a, 2
jr z, .applylines
cp a, 3
jr z, .addone
inc a
.addone
inc a
ld e, a
ldh [hLineClearCt], a
.applylines
call LevelUp call LevelUp
ld c, a ld c, a
ld b, a ld b, a
@ -1717,6 +1748,11 @@ FieldDelay::
rrc h rrc h
rr l rr l
inc hl inc hl
ldh a, [hDownFrames]
ld c, a
xor a, a
ld b, a
add hl, bc
ld b, h ld b, h
ld c, l ld c, l
ldh a, [hComboCt] ldh a, [hComboCt]