Fix accidental 19.99609375G mode.

This commit is contained in:
Randy Thiemann 2023-10-27 01:21:56 +02:00
parent b0e78d5a6c
commit 9bc2937b10
3 changed files with 15 additions and 17 deletions

Binary file not shown.

Binary file not shown.

View File

@ -41,7 +41,7 @@ hPieceDataBase: ds 2
hPieceDataBaseFast: ds 2 hPieceDataBaseFast: ds 2
hPieceDataOffset: ds 1 hPieceDataOffset: ds 1
hCurrentLockDelayRemaining:: ds 1 hCurrentLockDelayRemaining:: ds 1
hDeepestY: ds 1 hGrounded: ds 1
hWantedTile: ds 1 hWantedTile: ds 1
hWantedG: ds 1 hWantedG: ds 1
hActualG: ds 1 hActualG: ds 1
@ -530,10 +530,10 @@ TrySpawnPiece::
ldh [hAwardDownBonus], a ldh [hAwardDownBonus], a
ldh [hLockDelayForce], a ldh [hLockDelayForce], a
ldh [hShouldLockIfGrounded], a ldh [hShouldLockIfGrounded], a
ldh [hGravityCtr], a
ldh [hGrounded], a
ldh a, [hCurrentLockDelay] ldh a, [hCurrentLockDelay]
ldh [hCurrentLockDelayRemaining], a ldh [hCurrentLockDelayRemaining], a
ld a, 1
ldh [hGravityCtr], a
ld a, $FF ld a, $FF
ldh [hRemainingDelay], a ldh [hRemainingDelay], a
ld a, DELAY_STATE_DETERMINE_DELAY ld a, DELAY_STATE_DETERMINE_DELAY
@ -1221,19 +1221,6 @@ FieldProcess::
ldh [hAwardDownBonus], a ldh [hAwardDownBonus], a
ld a, 20 ld a, 20
ldh [hWantedG], a ldh [hWantedG], a
ldh a, [hCurrentFractionalGravity]
ld b, a
ldh a, [hGravityCtr]
add a, b
ldh [hGravityCtr], a
jr c, .grav
ld a, 1
ldh [hGravityCtr], a
ld a, [wDropModeState]
cp a, DROP_MODE_SNIC
jr z, .grav
ld a, $FF
ldh [hShouldLockIfGrounded], a
jr .grav jr .grav
; Hard drop. ; Hard drop.
@ -1277,12 +1264,14 @@ FieldProcess::
; Gravity? ; Gravity?
: ldh a, [hCurrentFractionalGravity] : ldh a, [hCurrentFractionalGravity]
cp a, $FF
jr z, :+
ld b, a ld b, a
ldh a, [hGravityCtr] ldh a, [hGravityCtr]
add a, b add a, b
ldh [hGravityCtr], a ldh [hGravityCtr], a
jr nc, .nograv jr nc, .nograv
ldh a, [hCurrentIntegerGravity] : ldh a, [hCurrentIntegerGravity]
ldh [hWantedG], a ldh [hWantedG], a
; Can we drop the full requested distance? ; Can we drop the full requested distance?
@ -1316,6 +1305,8 @@ FieldProcess::
; Are we grounded? ; Are we grounded?
.postgrav .postgrav
.nograv .nograv
xor a, a
ldh [hGrounded], a
ldh a, [hYPosAtStartOfFrame] ldh a, [hYPosAtStartOfFrame]
ld b, a ld b, a
ldh a, [hCurrentPieceY] ldh a, [hCurrentPieceY]
@ -1338,6 +1329,8 @@ FieldProcess::
; We're grounded. ; We're grounded.
.grounded .grounded
ld a, $FF
ldh [hGrounded], a
ldh a, [hCurrentPieceY] ldh a, [hCurrentPieceY]
ld b, a ld b, a
ldh a, [hYPosAtStartOfFrame] ldh a, [hYPosAtStartOfFrame]
@ -1500,6 +1493,11 @@ FieldProcess::
cp a, b cp a, b
jr z, .drawpiece jr z, .drawpiece
; If we're not grounded, draw the piece normally.
ldh a, [hGrounded]
cp a, $FF
jr nz, .drawpiece
; If the lock delay is 0, draw the piece in the final color. ; If the lock delay is 0, draw the piece in the final color.
ldh a, [hCurrentPiece] ldh a, [hCurrentPiece]
ld b, TILE_PIECE_0+7 ld b, TILE_PIECE_0+7