Fix scoring
This commit is contained in:
parent
2946208ccc
commit
2c5ee3049b
|
@ -9,6 +9,7 @@
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"name": "Launch in Emulicious",
|
"name": "Launch in Emulicious",
|
||||||
"program": "${workspaceFolder}\\bin\\DMGTRIS.gbc",
|
"program": "${workspaceFolder}\\bin\\DMGTRIS.gbc",
|
||||||
|
"emuliciousPath": "K:\\TGM\\dmgtris\\tools",
|
||||||
"port": 58870,
|
"port": 58870,
|
||||||
"stopOnEntry": false,
|
"stopOnEntry": false,
|
||||||
"preLaunchTask": "buildrom"
|
"preLaunchTask": "buildrom"
|
||||||
|
|
BIN
DMGTRIS.GBC
BIN
DMGTRIS.GBC
Binary file not shown.
137
src/field.asm
137
src/field.asm
|
@ -54,8 +54,8 @@ hClearedLines: ds 4
|
||||||
hLineClearCt: ds 1
|
hLineClearCt: ds 1
|
||||||
hComboCt: ds 1
|
hComboCt: ds 1
|
||||||
hLockDelayForce: ds 1
|
hLockDelayForce: ds 1
|
||||||
hHighestStack: ds 1
|
|
||||||
hDownFrames: ds 1
|
hDownFrames: ds 1
|
||||||
|
hAwardDownBonus: ds 1
|
||||||
hStalePiece: ds 1
|
hStalePiece: ds 1
|
||||||
hBravo: ds 1
|
hBravo: ds 1
|
||||||
|
|
||||||
|
@ -64,8 +64,6 @@ SECTION "Field Functions", ROM0
|
||||||
FieldInit::
|
FieldInit::
|
||||||
xor a, a
|
xor a, a
|
||||||
ldh [hBravo], a
|
ldh [hBravo], a
|
||||||
ld a, 23
|
|
||||||
ldh [hHighestStack], a
|
|
||||||
ld a, 1
|
ld a, 1
|
||||||
ldh [hComboCt], a
|
ldh [hComboCt], a
|
||||||
ld hl, wField
|
ld hl, wField
|
||||||
|
@ -528,6 +526,7 @@ TrySpawnPiece::
|
||||||
xor a, a
|
xor a, a
|
||||||
ldh [hStalePiece], a
|
ldh [hStalePiece], a
|
||||||
ldh [hDownFrames], a
|
ldh [hDownFrames], a
|
||||||
|
ldh [hAwardDownBonus], a
|
||||||
ldh [hLockDelayForce], a
|
ldh [hLockDelayForce], a
|
||||||
ldh a, [hCurrentLockDelay]
|
ldh a, [hCurrentLockDelay]
|
||||||
ldh [hCurrentLockDelayRemaining], a
|
ldh [hCurrentLockDelayRemaining], a
|
||||||
|
@ -682,33 +681,6 @@ FindMaxG:
|
||||||
ldh a, [hCurrentPieceX]
|
ldh a, [hCurrentPieceX]
|
||||||
call XYToSFieldPtr
|
call XYToSFieldPtr
|
||||||
|
|
||||||
;DEF EXPERIMENTAL_OPTIMIZATION EQU 1
|
|
||||||
IF DEF(EXPERIMENTAL_OPTIMIZATION)
|
|
||||||
; The stack height marker gives a lower bound to how far the piece can fall.
|
|
||||||
ldh a, [hHighestStack]
|
|
||||||
sub a, 4
|
|
||||||
ld b, a
|
|
||||||
ld a, [hCurrentPieceY]
|
|
||||||
cp a, b
|
|
||||||
jr nc, .unoptimized ; If our piece is already past that, we can't optimize.
|
|
||||||
|
|
||||||
; But if we're NOT, that means we can assume a minimum fall distance!
|
|
||||||
.optimized
|
|
||||||
ld c, a
|
|
||||||
ld a, b
|
|
||||||
sub a, c
|
|
||||||
inc a
|
|
||||||
ldh [hActualG], a
|
|
||||||
dec a
|
|
||||||
ld de, 14
|
|
||||||
: add hl, de
|
|
||||||
dec a
|
|
||||||
jr nz, :-
|
|
||||||
push hl
|
|
||||||
jr .try
|
|
||||||
ENDC
|
|
||||||
|
|
||||||
.unoptimized
|
|
||||||
push hl
|
push hl
|
||||||
ld a, 1
|
ld a, 1
|
||||||
ldh [hActualG], a
|
ldh [hActualG], a
|
||||||
|
@ -1212,7 +1184,10 @@ FieldProcess::
|
||||||
|
|
||||||
; **************************************************************
|
; **************************************************************
|
||||||
; HANDLE UP
|
; HANDLE UP
|
||||||
; Is a hard/sonic drop requested?
|
; Is a hard/sonic drop requested? Skip if in 20G mode.
|
||||||
|
ldh a, [hCurrentGravityPerTick]
|
||||||
|
cp a, 20
|
||||||
|
jr z, .postdrop
|
||||||
ldh a, [hUpState]
|
ldh a, [hUpState]
|
||||||
cp a, 0
|
cp a, 0
|
||||||
jr z, .postdrop
|
jr z, .postdrop
|
||||||
|
@ -1226,9 +1201,8 @@ FieldProcess::
|
||||||
|
|
||||||
; Sonic drop.
|
; Sonic drop.
|
||||||
.sonicdrop
|
.sonicdrop
|
||||||
ldh a, [hDownFrames]
|
ld a, $FF
|
||||||
add a, 10
|
ldh [hAwardDownBonus], a
|
||||||
ldh [hDownFrames], a
|
|
||||||
ld a, 20
|
ld a, 20
|
||||||
ldh [hWantedG], a
|
ldh [hWantedG], a
|
||||||
ldh a, [hTicksUntilG]
|
ldh a, [hTicksUntilG]
|
||||||
|
@ -1241,9 +1215,8 @@ FieldProcess::
|
||||||
|
|
||||||
; Hard drop.
|
; Hard drop.
|
||||||
.harddrop
|
.harddrop
|
||||||
ldh a, [hDownFrames]
|
ld a, $FF
|
||||||
add a, 10
|
ldh [hAwardDownBonus], a
|
||||||
ldh [hDownFrames], a
|
|
||||||
ld a, 20
|
ld a, 20
|
||||||
ld b, a
|
ld b, a
|
||||||
ldh a, [hActualG]
|
ldh a, [hActualG]
|
||||||
|
@ -1423,7 +1396,7 @@ FieldProcess::
|
||||||
jr z, .ghost
|
jr z, .ghost
|
||||||
ldh a, [hEvenFrame]
|
ldh a, [hEvenFrame]
|
||||||
cp a, 1
|
cp a, 1
|
||||||
jr nz, :+
|
jr nz, .postghost
|
||||||
|
|
||||||
.ghost
|
.ghost
|
||||||
ldh a, [hYPosAtStartOfFrame]
|
ldh a, [hYPosAtStartOfFrame]
|
||||||
|
@ -1444,8 +1417,8 @@ FieldProcess::
|
||||||
pop de
|
pop de
|
||||||
call DrawPiece
|
call DrawPiece
|
||||||
|
|
||||||
; If the lock delay is at the highest value, draw the piece normally.
|
|
||||||
.postghost
|
.postghost
|
||||||
|
; If the lock delay is at the highest value, draw the piece normally.
|
||||||
ldh a, [hCurrentPiece]
|
ldh a, [hCurrentPiece]
|
||||||
ld b, TILE_PIECE_0
|
ld b, TILE_PIECE_0
|
||||||
add a, b
|
add a, b
|
||||||
|
@ -1463,19 +1436,10 @@ FieldProcess::
|
||||||
ldh [hWantedTile], a
|
ldh [hWantedTile], a
|
||||||
ldh a, [hCurrentLockDelayRemaining]
|
ldh a, [hCurrentLockDelayRemaining]
|
||||||
cp a, 0
|
cp a, 0
|
||||||
jr nz, :+
|
jr z, .drawpiece
|
||||||
|
|
||||||
; Check if the stack usage went up.
|
|
||||||
ldh a, [hHighestStack]
|
|
||||||
ld b, a
|
|
||||||
ldh a, [hCurrentPieceY]
|
|
||||||
cp a, b
|
|
||||||
jr nc, .drawpiece
|
|
||||||
ldh [hHighestStack], a
|
|
||||||
jr .drawpiece
|
|
||||||
|
|
||||||
; Otherwise, look it up.
|
; Otherwise, look it up.
|
||||||
: call GetTileShade
|
call GetTileShade
|
||||||
|
|
||||||
.drawpiece
|
.drawpiece
|
||||||
ldh a, [hCurrentPieceY]
|
ldh a, [hCurrentPieceY]
|
||||||
|
@ -1857,37 +1821,64 @@ FieldDelay::
|
||||||
ld c, a
|
ld c, a
|
||||||
xor a, a
|
xor a, a
|
||||||
ld b, a
|
ld b, a
|
||||||
|
|
||||||
|
; Lock bonus?
|
||||||
|
ldh a, [hAwardDownBonus]
|
||||||
|
cp a, $FF
|
||||||
|
jr nz, .premultiplier
|
||||||
|
ld a, 10
|
||||||
|
add a, c
|
||||||
|
ld c, a
|
||||||
|
|
||||||
|
; Final total pre-multipliers.
|
||||||
|
.premultiplier
|
||||||
add hl, bc
|
add hl, bc
|
||||||
|
|
||||||
; Copy the running total.
|
; Copy the running total for multiplication.
|
||||||
ld b, h
|
ld b, h
|
||||||
ld c, l
|
ld c, l
|
||||||
|
|
||||||
; Get a multiplier consisting of...
|
; Do we have a bravo? x4 if so.
|
||||||
xor a, a
|
.bravo
|
||||||
ld d, a
|
ldh a, [hBravo]
|
||||||
|
|
||||||
ldh a, [hBravo] ; 4 if the field is empty and...
|
|
||||||
cp a, 0
|
cp a, 0
|
||||||
jr nz, :+
|
jr nz, .lineclears
|
||||||
ld a, 4
|
add hl, bc
|
||||||
ld d, a
|
add hl, bc
|
||||||
|
add hl, bc
|
||||||
|
ld b, h
|
||||||
|
ld c, l
|
||||||
|
|
||||||
: ldh a, [hLineClearCt] ; The number of lines cleared and...
|
; x line clears
|
||||||
add a, d
|
.lineclears
|
||||||
ld d, a
|
ldh a, [hLineClearCt]
|
||||||
|
|
||||||
ldh a, [hComboCt] ; The combo count.
|
|
||||||
dec a
|
dec a
|
||||||
add a, d
|
jr z, .combo
|
||||||
|
|
||||||
; Multiply the running total by the multiplier.
|
|
||||||
: add hl, bc
|
: add hl, bc
|
||||||
dec a
|
dec a
|
||||||
cp a, 0
|
|
||||||
jr nz, :-
|
jr nz, :-
|
||||||
|
ld b, h
|
||||||
|
ld c, l
|
||||||
|
|
||||||
|
; x combo
|
||||||
|
.combo
|
||||||
|
ldh a, [hComboCt]
|
||||||
|
dec a
|
||||||
|
jr z, .applyscore
|
||||||
|
: add hl, bc
|
||||||
|
jr c, .forcemax
|
||||||
|
dec a
|
||||||
|
jr nz, :-
|
||||||
|
jr .applyscore
|
||||||
|
|
||||||
|
; Overflow = 65535
|
||||||
|
.forcemax
|
||||||
|
ld a, $FF
|
||||||
|
ld h, a
|
||||||
|
ld l, a
|
||||||
|
|
||||||
; And apply the score.
|
; And apply the score.
|
||||||
|
.applyscore
|
||||||
ld a, l
|
ld a, l
|
||||||
ldh [hScoreIncrement], a
|
ldh [hScoreIncrement], a
|
||||||
ld a, h
|
ld a, h
|
||||||
|
@ -2078,9 +2069,6 @@ ClearLines:
|
||||||
|
|
||||||
; If it does, increment the clearing counter, but skip this line.
|
; If it does, increment the clearing counter, but skip this line.
|
||||||
jr nz, .clear\@
|
jr nz, .clear\@
|
||||||
ldh a, [hHighestStack]
|
|
||||||
inc a
|
|
||||||
ldh [hHighestStack], a
|
|
||||||
inc de
|
inc de
|
||||||
inc de
|
inc de
|
||||||
inc de
|
inc de
|
||||||
|
@ -2136,13 +2124,6 @@ ClearLines:
|
||||||
DEF row -= 1
|
DEF row -= 1
|
||||||
ENDR
|
ENDR
|
||||||
|
|
||||||
; Check if the stack marker is out of bounds.
|
|
||||||
ldh a, [hHighestStack]
|
|
||||||
cp a, 23
|
|
||||||
jr c, .fixgarbo
|
|
||||||
ld a, 23
|
|
||||||
ldh [hHighestStack], a
|
|
||||||
|
|
||||||
; Make sure there's no garbage in the top de lines.
|
; Make sure there's no garbage in the top de lines.
|
||||||
.fixgarbo
|
.fixgarbo
|
||||||
ld hl, wField
|
ld hl, wField
|
||||||
|
|
83
src/gbc.asm
83
src/gbc.asm
|
@ -460,7 +460,7 @@ GBCGameplayInit::
|
||||||
ldh [rOCPD], a
|
ldh [rOCPD], a
|
||||||
|
|
||||||
; Pal 2 (purple, S)
|
; Pal 2 (purple, S)
|
||||||
ld bc, R3 | B3
|
ld bc, R2 | B3
|
||||||
ld a, c
|
ld a, c
|
||||||
ldh [rBCPD], a
|
ldh [rBCPD], a
|
||||||
ldh [rOCPD], a
|
ldh [rOCPD], a
|
||||||
|
@ -468,7 +468,7 @@ GBCGameplayInit::
|
||||||
ldh [rBCPD], a
|
ldh [rBCPD], a
|
||||||
ldh [rOCPD], a
|
ldh [rOCPD], a
|
||||||
|
|
||||||
ld bc, R2 | B2
|
ld bc, R1 | B2
|
||||||
ld a, c
|
ld a, c
|
||||||
ldh [rBCPD], a
|
ldh [rBCPD], a
|
||||||
ldh [rOCPD], a
|
ldh [rOCPD], a
|
||||||
|
@ -476,7 +476,7 @@ GBCGameplayInit::
|
||||||
ldh [rBCPD], a
|
ldh [rBCPD], a
|
||||||
ldh [rOCPD], a
|
ldh [rOCPD], a
|
||||||
|
|
||||||
ld bc, R1 | B1
|
ld bc, R0 | B1
|
||||||
ld a, c
|
ld a, c
|
||||||
ldh [rBCPD], a
|
ldh [rBCPD], a
|
||||||
ldh [rOCPD], a
|
ldh [rOCPD], a
|
||||||
|
@ -734,16 +734,44 @@ GBCGameplayProcess::
|
||||||
cp a, $11
|
cp a, $11
|
||||||
ret nz
|
ret nz
|
||||||
|
|
||||||
; 20G?
|
; Color based on mode.
|
||||||
|
ld a, [wSpeedCurveState]
|
||||||
|
cp a, SCURVE_DMGT
|
||||||
|
ld a, $03 ;Blue
|
||||||
|
jr z, .higoverride
|
||||||
|
ld a, [wSpeedCurveState]
|
||||||
|
cp a, SCURVE_TGM1
|
||||||
|
ld a, $05 ;Yellow
|
||||||
|
jr z, .higoverride
|
||||||
|
ld a, [wSpeedCurveState]
|
||||||
|
cp a, SCURVE_TGM3
|
||||||
|
ld a, $04 ;Orange
|
||||||
|
jr z, .higoverride
|
||||||
|
ld a, [wSpeedCurveState]
|
||||||
|
cp a, SCURVE_DEAT
|
||||||
|
ld a, $06 ;Cyan
|
||||||
|
jr z, .higoverride
|
||||||
|
ld a, [wSpeedCurveState]
|
||||||
|
cp a, SCURVE_SHIR
|
||||||
|
ld a, $00 ;Red
|
||||||
|
jr z, .colorfield ;Always red
|
||||||
|
ld a, [wSpeedCurveState]
|
||||||
|
cp a, SCURVE_CHIL
|
||||||
|
ld a, $01 ;Green
|
||||||
|
jr z, .higoverride
|
||||||
|
|
||||||
|
; Are we 20G?
|
||||||
|
.higoverride
|
||||||
|
ld d, a
|
||||||
ldh a, [hCurrentGravityPerTick]
|
ldh a, [hCurrentGravityPerTick]
|
||||||
cp a, 20
|
cp a, 20
|
||||||
jr nz, :+
|
jr nz, .colorfield
|
||||||
|
|
||||||
|
; Strobe the frame.
|
||||||
ld a, $00
|
ld a, $00
|
||||||
jr .colorfield
|
ld d, a
|
||||||
: ld a, $03
|
|
||||||
|
|
||||||
.colorfield
|
.colorfield
|
||||||
ld d, a
|
|
||||||
ld hl, wShadowTileAttrs
|
ld hl, wShadowTileAttrs
|
||||||
ld bc, 32-12
|
ld bc, 32-12
|
||||||
|
|
||||||
|
@ -861,6 +889,45 @@ GBCGameplayProcess::
|
||||||
dec a
|
dec a
|
||||||
ld [wOuterReps], a
|
ld [wOuterReps], a
|
||||||
jr nz, .outer2
|
jr nz, .outer2
|
||||||
|
|
||||||
|
; Maybe flash numbers.
|
||||||
|
ldh a, [hCurrentGravityPerTick]
|
||||||
|
cp a, 20
|
||||||
|
jr nz, .black
|
||||||
|
|
||||||
|
ld hl, hFrameCtr
|
||||||
|
bit 1, [hl]
|
||||||
|
jr z, .lighter
|
||||||
|
|
||||||
|
.darker
|
||||||
|
ld a, OCPSF_AUTOINC | (7*8)+(3*2)
|
||||||
|
ldh [rOCPS], a
|
||||||
|
ld bc, R2 | G2
|
||||||
|
wait_vram
|
||||||
|
ld a, c
|
||||||
|
ldh [rOCPD], a
|
||||||
|
ld a, b
|
||||||
|
ldh [rOCPD], a
|
||||||
|
ret
|
||||||
|
|
||||||
|
.lighter
|
||||||
|
ld a, OCPSF_AUTOINC | (7*8)+(3*2)
|
||||||
|
ldh [rOCPS], a
|
||||||
|
ld bc, R3 | G3
|
||||||
|
wait_vram
|
||||||
|
ld a, c
|
||||||
|
ldh [rOCPD], a
|
||||||
|
ld a, b
|
||||||
|
ldh [rOCPD], a
|
||||||
|
ret
|
||||||
|
|
||||||
|
.black
|
||||||
|
ld a, OCPSF_AUTOINC | (7*8)+(3*2)
|
||||||
|
ldh [rOCPS], a
|
||||||
|
xor a, a
|
||||||
|
wait_vram
|
||||||
|
ldh [rOCPD], a
|
||||||
|
ldh [rOCPD], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -137,9 +137,9 @@ LevelUp::
|
||||||
add a, l
|
add a, l
|
||||||
ld l, a
|
ld l, a
|
||||||
adc a, h
|
adc a, h
|
||||||
sub l
|
sub a, l
|
||||||
ldh [hLevel+1], a
|
ldh [hLevel+1], a
|
||||||
ld l, a
|
ld a, l
|
||||||
ldh [hLevel], a
|
ldh [hLevel], a
|
||||||
|
|
||||||
; Save the current hundred digit.
|
; Save the current hundred digit.
|
||||||
|
@ -191,6 +191,11 @@ LevelUp::
|
||||||
ldh [hCLevel+1], a
|
ldh [hCLevel+1], a
|
||||||
ldh [hCLevel+2], a
|
ldh [hCLevel+2], a
|
||||||
ldh [hCLevel+3], a
|
ldh [hCLevel+3], a
|
||||||
|
ld hl, 9999
|
||||||
|
ld a, l
|
||||||
|
ldh [hLevel], a
|
||||||
|
ld a, h
|
||||||
|
ldh [hLevel+1], a
|
||||||
call DoSpeedUp
|
call DoSpeedUp
|
||||||
ld a, SFX_RANKUP
|
ld a, SFX_RANKUP
|
||||||
call SFXEnqueue
|
call SFXEnqueue
|
||||||
|
|
14
src/main.asm
14
src/main.asm
|
@ -53,6 +53,7 @@ rRotModeState:: ds 1
|
||||||
rDropModeState:: ds 1
|
rDropModeState:: ds 1
|
||||||
rSpeedCurveState:: ds 1
|
rSpeedCurveState:: ds 1
|
||||||
rAlways20GState:: ds 1
|
rAlways20GState:: ds 1
|
||||||
|
rSelectedStartLevel:: ds 2
|
||||||
|
|
||||||
|
|
||||||
SECTION "Stack", WRAM0
|
SECTION "Stack", WRAM0
|
||||||
|
@ -122,7 +123,7 @@ Main::
|
||||||
cp a, "G"
|
cp a, "G"
|
||||||
jr nz, .nosavedata
|
jr nz, .nosavedata
|
||||||
ld a, [rMagic+3]
|
ld a, [rMagic+3]
|
||||||
cp a, "0"
|
cp a, "1"
|
||||||
jr nz, .nosavedata
|
jr nz, .nosavedata
|
||||||
|
|
||||||
.savedata
|
.savedata
|
||||||
|
@ -138,6 +139,10 @@ Main::
|
||||||
ld [wSpeedCurveState], a
|
ld [wSpeedCurveState], a
|
||||||
ld a, [rAlways20GState]
|
ld a, [rAlways20GState]
|
||||||
ld [wAlways20GState], a
|
ld [wAlways20GState], a
|
||||||
|
ld a, [rSelectedStartLevel]
|
||||||
|
ldh [hStartSpeed], a
|
||||||
|
ld a, [rSelectedStartLevel+1]
|
||||||
|
ldh [hStartSpeed+1], a
|
||||||
jr .otherinit
|
jr .otherinit
|
||||||
|
|
||||||
.nosavedata
|
.nosavedata
|
||||||
|
@ -147,7 +152,7 @@ Main::
|
||||||
ld [rMagic+1], a
|
ld [rMagic+1], a
|
||||||
ld a, "G"
|
ld a, "G"
|
||||||
ld [rMagic+2], a
|
ld [rMagic+2], a
|
||||||
ld a, "0"
|
ld a, "1"
|
||||||
ld [rMagic+3], a
|
ld [rMagic+3], a
|
||||||
|
|
||||||
ld a, BUTTON_MODE_NORM
|
ld a, BUTTON_MODE_NORM
|
||||||
|
@ -178,12 +183,15 @@ Main::
|
||||||
ld [rAlways20GState], a
|
ld [rAlways20GState], a
|
||||||
ld [wAlways20GState], a
|
ld [wAlways20GState], a
|
||||||
|
|
||||||
.otherinit
|
|
||||||
ld hl, sSpeedCurve
|
ld hl, sSpeedCurve
|
||||||
ld a, l
|
ld a, l
|
||||||
ldh [hStartSpeed], a
|
ldh [hStartSpeed], a
|
||||||
|
ld [rSelectedStartLevel], a
|
||||||
ld a, h
|
ld a, h
|
||||||
ldh [hStartSpeed+1], a
|
ldh [hStartSpeed+1], a
|
||||||
|
ld [rSelectedStartLevel+1], a
|
||||||
|
|
||||||
|
.otherinit
|
||||||
call TimeInit
|
call TimeInit
|
||||||
call IntrInit
|
call IntrInit
|
||||||
call InputInit
|
call InputInit
|
||||||
|
|
Binary file not shown.
|
@ -530,8 +530,8 @@ Tiles::
|
||||||
DB $4A,$4A,$4A,$4A,$E4,$E4,$00,$00
|
DB $4A,$4A,$4A,$4A,$E4,$E4,$00,$00
|
||||||
DB $CA,$CA,$2A,$2A,$2A,$2A,$4E,$4E
|
DB $CA,$CA,$2A,$2A,$2A,$2A,$4E,$4E
|
||||||
DB $82,$82,$82,$82,$E2,$E2,$00,$00
|
DB $82,$82,$82,$82,$E2,$E2,$00,$00
|
||||||
DB $FE,$FE,$06,$06,$0C,$0C,$38,$38
|
DB $FF,$FF,$81,$81,$24,$24,$3C,$3C
|
||||||
DB $60,$60,$C0,$C0,$FE,$FE,$00,$00
|
DB $24,$24,$81,$81,$FF,$FF,$00,$00
|
||||||
TilesEnd::
|
TilesEnd::
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -114,9 +114,6 @@ SwitchToTitle::
|
||||||
; GBC init
|
; GBC init
|
||||||
call GBCTitleInit
|
call GBCTitleInit
|
||||||
|
|
||||||
; Make sure the speed curve is aimed at the right place.
|
|
||||||
call InitSpeedCurve
|
|
||||||
|
|
||||||
; Install the event loop handlers.
|
; Install the event loop handlers.
|
||||||
ld a, 0
|
ld a, 0
|
||||||
ldh [hGameState], a
|
ldh [hGameState], a
|
||||||
|
@ -301,8 +298,10 @@ DecrementLevel:
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, l
|
ld a, l
|
||||||
ldh [hStartSpeed], a
|
ldh [hStartSpeed], a
|
||||||
|
ld [rSelectedStartLevel], a
|
||||||
ld a, h
|
ld a, h
|
||||||
ldh [hStartSpeed+1], a
|
ldh [hStartSpeed+1], a
|
||||||
|
ld [rSelectedStartLevel+1], a
|
||||||
jp CheckLevelRange
|
jp CheckLevelRange
|
||||||
|
|
||||||
|
|
||||||
|
@ -414,8 +413,10 @@ IncrementLevel:
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, l
|
ld a, l
|
||||||
ldh [hStartSpeed], a
|
ldh [hStartSpeed], a
|
||||||
|
ld [rSelectedStartLevel], a
|
||||||
ld a, h
|
ld a, h
|
||||||
ldh [hStartSpeed+1], a
|
ldh [hStartSpeed+1], a
|
||||||
|
ld [rSelectedStartLevel+1], a
|
||||||
jp CheckLevelRange
|
jp CheckLevelRange
|
||||||
|
|
||||||
InitSpeedCurve:
|
InitSpeedCurve:
|
||||||
|
@ -425,8 +426,10 @@ InitSpeedCurve:
|
||||||
.set
|
.set
|
||||||
ld a, l
|
ld a, l
|
||||||
ldh [hStartSpeed], a
|
ldh [hStartSpeed], a
|
||||||
|
ld [rSelectedStartLevel], a
|
||||||
ld a, h
|
ld a, h
|
||||||
ldh [hStartSpeed+1], a
|
ldh [hStartSpeed+1], a
|
||||||
|
ld [rSelectedStartLevel+1], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
@ -492,8 +495,10 @@ CheckLevelRange:
|
||||||
jr nz, .notatend
|
jr nz, .notatend
|
||||||
call GetStart
|
call GetStart
|
||||||
ld a, l
|
ld a, l
|
||||||
|
ld [rSelectedStartLevel], a
|
||||||
ldh [hStartSpeed], a
|
ldh [hStartSpeed], a
|
||||||
ld a, h
|
ld a, h
|
||||||
|
ld [rSelectedStartLevel+1], a
|
||||||
ldh [hStartSpeed+1], a
|
ldh [hStartSpeed+1], a
|
||||||
|
|
||||||
.notatend
|
.notatend
|
||||||
|
@ -513,8 +518,10 @@ CheckLevelRange:
|
||||||
ld l, c
|
ld l, c
|
||||||
add hl, de
|
add hl, de
|
||||||
ld a, l
|
ld a, l
|
||||||
|
ld [rSelectedStartLevel], a
|
||||||
ldh [hStartSpeed], a
|
ldh [hStartSpeed], a
|
||||||
ld a, h
|
ld a, h
|
||||||
|
ld [rSelectedStartLevel+1], a
|
||||||
ldh [hStartSpeed+1], a
|
ldh [hStartSpeed+1], a
|
||||||
|
|
||||||
.notatstart
|
.notatstart
|
||||||
|
|
Loading…
Reference in New Issue