Scoring fixes

This commit is contained in:
Randy Thiemann 2023-10-25 04:13:52 +02:00
parent ef7b2b2b6d
commit fd1a1f47c0
1 changed files with 14 additions and 10 deletions

View File

@ -1791,15 +1791,6 @@ FieldDelay::
ld e, a ld e, a
call LevelUp call LevelUp
; Update the combo counter.
ldh a, [hLineClearCt]
ld b, a
ldh a, [hComboCt] ; Old combo count.
add b ; + lines
add b ; + lines
sub 2 ; - 2
ldh [hComboCt], a
; Score the line clears. ; Score the line clears.
; Get the new level. ; Get the new level.
ldh a, [hLevel] ldh a, [hLevel]
@ -1844,8 +1835,11 @@ FieldDelay::
cp a, 0 cp a, 0
jr nz, .lineclears jr nz, .lineclears
add hl, bc add hl, bc
jr c, .forcemax
add hl, bc add hl, bc
jr c, .forcemax
add hl, bc add hl, bc
jr c, .forcemax
ld b, h ld b, h
ld c, l ld c, l
@ -1855,6 +1849,7 @@ FieldDelay::
dec a dec a
jr z, .combo jr z, .combo
: add hl, bc : add hl, bc
jr c, .forcemax
dec a dec a
jr nz, :- jr nz, :-
ld b, h ld b, h
@ -1885,9 +1880,18 @@ FieldDelay::
ldh [hScoreIncrement+1], a ldh [hScoreIncrement+1], a
call IncreaseScore call IncreaseScore
; Update the combo counter.
ldh a, [hLineClearCt]
ld b, a
ldh a, [hComboCt] ; Old combo count.
add b ; + lines
add b ; + lines
sub 2 ; - 2
ldh [hComboCt], a
; Line clear delay. ; Line clear delay.
; Count doen the delay. If we're out of delay, clear the lines and go to ARE. ; Count down the delay. If we're out of delay, clear the lines and go to ARE.
.lineclear .lineclear
ldh a, [hRemainingDelay] ldh a, [hRemainingDelay]
dec a dec a