Compare commits
No commits in common. "dfa5e5b19b5bca1999a71653c1836b9e1f5366f2" and "228cdfec9ec067ae6c266abdf320371024c775f8" have entirely different histories.
dfa5e5b19b
...
228cdfec9e
|
@ -8,6 +8,7 @@
|
|||
"type": "emulicious-debugger",
|
||||
"request": "launch",
|
||||
"name": "Launch in Emulicious",
|
||||
"emuliciousPath": "${workspaceFolder}\\tools\\emulicious.exe",
|
||||
"program": "${workspaceFolder}\\bin\\out.gb",
|
||||
"port": 58870,
|
||||
"stopOnEntry": false,
|
||||
|
|
BIN
DMGTRIS.GB
BIN
DMGTRIS.GB
Binary file not shown.
|
@ -41,9 +41,7 @@ Soft = Amount of frames the down button was held during this piece + 10 if the p
|
|||
|
||||
Combo = Old combo + (2 x Lines) - 2
|
||||
|
||||
Bravo = 1 if the field isn't empty, 4 if it is.
|
||||
|
||||
ScoreIncrement = ((Level + Lines) >> 4 + 1 + Soft) x Combo x Lines x Bravo.
|
||||
ScoreIncrement = ((Level + Lines) >> 4 + 1 + Soft) x Combo x Lines.
|
||||
|
||||
ScoreIncrement points are then awarded.
|
||||
|
||||
|
|
105
src/field.asm
105
src/field.asm
|
@ -29,9 +29,7 @@ DEF DELAY_STATE_ARE EQU 2
|
|||
|
||||
SECTION "Field Variables", WRAM0
|
||||
wField:: ds (10*24)
|
||||
wBackupField:: ds (10*24)
|
||||
wShadowField:: ds (14*26)
|
||||
wDelayState: ds 1
|
||||
|
||||
|
||||
SECTION "High Field Variables", HRAM
|
||||
|
@ -48,6 +46,7 @@ hWantX: ds 1
|
|||
hYPosAtStartOfFrame: ds 1
|
||||
hWantRotation: ds 1
|
||||
hRemainingDelay:: ds 1
|
||||
hDelayState: ds 1
|
||||
hClearedLines: ds 4
|
||||
hLineClearCt: ds 1
|
||||
hComboCt: ds 1
|
||||
|
@ -55,13 +54,10 @@ hLockDelayForce: ds 1
|
|||
hHighestStack: ds 1
|
||||
hDownFrames: ds 1
|
||||
hStalePiece: ds 1
|
||||
hBravo: ds 1
|
||||
|
||||
|
||||
SECTION "Field Functions", ROM0
|
||||
FieldInit::
|
||||
xor a, a
|
||||
ldh [hBravo], a
|
||||
ld a, 23
|
||||
ldh [hHighestStack], a
|
||||
ld a, 1
|
||||
|
@ -517,7 +513,7 @@ TrySpawnPiece::
|
|||
ld a, $FF
|
||||
ldh [hRemainingDelay], a
|
||||
ld a, DELAY_STATE_DETERMINE_DELAY
|
||||
ld [wDelayState], a
|
||||
ldh [hDelayState], a
|
||||
|
||||
; Copy the field to the shadow field.
|
||||
call ToShadowField
|
||||
|
@ -1662,8 +1658,7 @@ GetTileShade:
|
|||
|
||||
|
||||
FieldDelay::
|
||||
; Switch on the delay state.
|
||||
ld a, [wDelayState]
|
||||
ldh a, [hDelayState]
|
||||
cp DELAY_STATE_DETERMINE_DELAY
|
||||
jr z, .determine
|
||||
cp DELAY_STATE_LINE_CLEAR
|
||||
|
@ -1671,9 +1666,6 @@ FieldDelay::
|
|||
cp DELAY_STATE_ARE
|
||||
jr z, .are
|
||||
|
||||
; Check if there were line clears.
|
||||
; If so, we need to do a line clear delay.
|
||||
; Otherwise, we skip to ARE delay.
|
||||
.determine
|
||||
call FindClearedLines
|
||||
ldh a, [hClearedLines]
|
||||
|
@ -1687,23 +1679,21 @@ FieldDelay::
|
|||
and a, c
|
||||
and a, d
|
||||
cp a, $FF
|
||||
jr z, .skip ; If there were no line clears, skip to ARE delay.
|
||||
ld a, DELAY_STATE_LINE_CLEAR ; Otherwise, do a line clear delay.
|
||||
ld [wDelayState], a
|
||||
jr z, .skip
|
||||
ld a, DELAY_STATE_LINE_CLEAR
|
||||
ldh [hDelayState], a
|
||||
ldh a, [hCurrentLineClearDelay]
|
||||
ldh [hRemainingDelay], a
|
||||
call MarkClear
|
||||
jr .lineclear
|
||||
.skip
|
||||
ld a, DELAY_STATE_ARE ; If there were no line clears, do an ARE delay.
|
||||
ld [wDelayState], a
|
||||
ld a, DELAY_STATE_ARE
|
||||
ldh [hDelayState], a
|
||||
ldh a, [hCurrentARE]
|
||||
ldh [hRemainingDelay], a
|
||||
jr .are
|
||||
|
||||
|
||||
; Line clear delay.
|
||||
; Count doen the delay. If we're out of delay, clear the lines and go to ARE.
|
||||
.lineclear
|
||||
ldh a, [hRemainingDelay]
|
||||
dec a
|
||||
|
@ -1717,12 +1707,10 @@ FieldDelay::
|
|||
call SFXEnqueue
|
||||
|
||||
ld a, DELAY_STATE_ARE
|
||||
ld [wDelayState], a
|
||||
ldh [hDelayState], a
|
||||
ldh a, [hCurrentARE]
|
||||
ldh [hRemainingDelay], a
|
||||
|
||||
; ARE delay.
|
||||
; Count down the delay. If it hits 0, award levels and score if necessary, then end the delay phase.
|
||||
.are
|
||||
ldh a, [hRemainingDelay]
|
||||
dec a
|
||||
|
@ -1730,17 +1718,12 @@ FieldDelay::
|
|||
cp a, 0
|
||||
ret nz
|
||||
|
||||
; Increment bravo by 4.
|
||||
ldh a, [hBravo]
|
||||
add a, 4
|
||||
ldh [hBravo], a
|
||||
|
||||
; Check if there were any line clears.
|
||||
; If we're out of delay, spawn a new piece.
|
||||
call SFXKill
|
||||
ldh a, [hLineClearCt]
|
||||
cp a, 0
|
||||
jr nz, :+ ; If there were, award levels and score.
|
||||
ld a, 1 ; Otherwise, increment the level counter by one if it's not at a breakpoint, and end the delay phase.
|
||||
jr nz, :+
|
||||
ld a, 1
|
||||
ldh [hComboCt], a
|
||||
ldh a, [hRequiresLineClear]
|
||||
cp a, $FF
|
||||
|
@ -1749,22 +1732,8 @@ FieldDelay::
|
|||
call LevelUp
|
||||
ret
|
||||
|
||||
; There were line clears! Clear the level counter breakpoint.
|
||||
: xor a, a
|
||||
ldh [hRequiresLineClear], a
|
||||
|
||||
|
||||
; Decrement bravo by 10 for each line clear.
|
||||
ldh a, [hLineClearCt]
|
||||
ld b, a
|
||||
ldh a, [hBravo]
|
||||
: sub a, 10
|
||||
dec b
|
||||
jr nz, :-
|
||||
ldh [hBravo], a
|
||||
|
||||
|
||||
; Check if we are in a TGM3 mode and thus need to handle line counts of 3 and 4 differently.
|
||||
ldh a, [hLineClearCt]
|
||||
ld e, a
|
||||
ldh a, [hSimulationMode]
|
||||
|
@ -1786,71 +1755,47 @@ FieldDelay::
|
|||
inc a
|
||||
ld e, a
|
||||
ldh [hLineClearCt], a
|
||||
|
||||
; Increment the level counter by the amount of lines.
|
||||
.applylines
|
||||
call LevelUp
|
||||
|
||||
; Update the combo counter.
|
||||
ld c, a
|
||||
ld b, a
|
||||
ldh a, [hComboCt] ; Old combo count.
|
||||
add b ; + lines
|
||||
add b ; + lines
|
||||
sub 2 ; - 2
|
||||
ldh a, [hComboCt]
|
||||
add b
|
||||
add b
|
||||
sub 2
|
||||
ldh [hComboCt], a
|
||||
|
||||
; Score the line clears.
|
||||
; Get the new level.
|
||||
xor a, a
|
||||
ld b, a
|
||||
ldh a, [hLevel]
|
||||
ld l, a
|
||||
ldh a, [hLevel+1]
|
||||
ld h, a
|
||||
|
||||
; Divide by 4.
|
||||
add hl, bc
|
||||
rrc h
|
||||
rr l
|
||||
rrc h
|
||||
rr l
|
||||
|
||||
; Add 1.
|
||||
inc hl
|
||||
|
||||
; Add soft drop points.
|
||||
ldh a, [hDownFrames]
|
||||
ld c, a
|
||||
xor a, a
|
||||
ld b, a
|
||||
add hl, bc
|
||||
|
||||
; Copy the running total.
|
||||
ld b, h
|
||||
ld c, l
|
||||
|
||||
; Get a multiplier consisting of...
|
||||
xor a, a
|
||||
ld d, a
|
||||
|
||||
ldh a, [hBravo] ; 4 if the field is empty and...
|
||||
cp a, 0
|
||||
jr nz, :+
|
||||
ld a, 4
|
||||
ld d, a
|
||||
|
||||
: ldh a, [hLineClearCt] ; The number of lines cleared and...
|
||||
add a, d
|
||||
ld d, a
|
||||
|
||||
ldh a, [hComboCt] ; The combo count.
|
||||
ldh a, [hComboCt]
|
||||
: add hl, bc
|
||||
dec a
|
||||
add a, d
|
||||
|
||||
; Multiply the running total by the multiplier.
|
||||
cp a, 0
|
||||
jr nz, :-
|
||||
ldh a, [hLineClearCt]
|
||||
: add hl, bc
|
||||
dec a
|
||||
cp a, 0
|
||||
jr nz, :-
|
||||
|
||||
; And apply the score.
|
||||
ld a, l
|
||||
ldh [hScoreIncrement], a
|
||||
ld a, h
|
||||
|
|
Binary file not shown.
|
@ -530,8 +530,8 @@ Tiles::
|
|||
DB $4A,$4A,$4A,$4A,$E4,$E4,$00,$00
|
||||
DB $00,$00,$00,$00,$CC,$CC,$22,$22
|
||||
DB $44,$44,$82,$82,$EC,$EC,$00,$00
|
||||
DB $00,$00,$00,$00,$0C,$0C,$0A,$0A
|
||||
DB $0C,$0C,$0A,$0A,$0C,$0C,$00,$00
|
||||
DB $00,$00,$00,$00,$04,$04,$0A,$0A
|
||||
DB $0E,$0E,$0A,$0A,$0A,$0A,$00,$00
|
||||
TilesEnd::
|
||||
|
||||
|
||||
|
|
|
@ -582,7 +582,6 @@ DoHold:
|
|||
ldh [hCurrentPieceRotationState], a
|
||||
|
||||
.doHoldOperation
|
||||
ldh a, [hHeldPiece]
|
||||
ld b, a
|
||||
ldh a, [hCurrentPiece]
|
||||
ldh [hHeldPiece], a
|
||||
|
|
Loading…
Reference in New Issue