Fix 20G oopsie and clear out unused sprites.

This commit is contained in:
Randy Thiemann 2023-10-30 01:04:19 +01:00
parent 022a815082
commit 9386c1bc98
5 changed files with 84 additions and 53 deletions

Binary file not shown.

Binary file not shown.

View File

@ -1281,7 +1281,7 @@ FieldProcess::
ld b, a ld b, a
ldh a, [hCurrentIntegerGravity] ldh a, [hCurrentIntegerGravity]
cp a, 20 ; No increased DAS at 20G. cp a, 20 ; No increased DAS at 20G.
jr z, .wantright jr z, .checkdasleft
ldh a, [hGrounded] ; If we're grounded, assume some urgency in getting DAS charged, charge at twice the rate. ldh a, [hGrounded] ; If we're grounded, assume some urgency in getting DAS charged, charge at twice the rate.
cp a, $FF cp a, $FF
jr nz, .checkdasleft jr nz, .checkdasleft
@ -1310,7 +1310,7 @@ FieldProcess::
ld b, a ld b, a
ldh a, [hCurrentIntegerGravity] ldh a, [hCurrentIntegerGravity]
cp a, 20 ; No increased DAS at 20G. cp a, 20 ; No increased DAS at 20G.
jr z, .donemanipulating jr z, .checkdasright
ldh a, [hGrounded] ; If we're grounded, assume some urgency in getting DAS charged, charge at twice the rate. ldh a, [hGrounded] ; If we're grounded, assume some urgency in getting DAS charged, charge at twice the rate.
cp a, $FF cp a, $FF
jr nz, .checkdasright jr nz, .checkdasright
@ -3341,7 +3341,7 @@ BigFieldProcess::
ld b, a ld b, a
ldh a, [hCurrentIntegerGravity] ldh a, [hCurrentIntegerGravity]
cp a, 20 ; No increased DAS at 20G. cp a, 20 ; No increased DAS at 20G.
jr z, .wantright jr z, .checkdasleft
ldh a, [hGrounded] ; If we're grounded, assume some urgency in getting DAS charged, charge at twice the rate. ldh a, [hGrounded] ; If we're grounded, assume some urgency in getting DAS charged, charge at twice the rate.
cp a, $FF cp a, $FF
jr nz, .checkdasleft jr nz, .checkdasleft
@ -3370,7 +3370,7 @@ BigFieldProcess::
ld b, a ld b, a
ldh a, [hCurrentIntegerGravity] ldh a, [hCurrentIntegerGravity]
cp a, 20 ; No increased DAS at 20G. cp a, 20 ; No increased DAS at 20G.
jr z, .wantright jr z, .checkdasright
ldh a, [hGrounded] ; If we're grounded, assume some urgency in getting DAS charged, charge at twice the rate. ldh a, [hGrounded] ; If we're grounded, assume some urgency in getting DAS charged, charge at twice the rate.
cp a, $FF cp a, $FF
jr nz, .checkdasright jr nz, .checkdasright

View File

@ -30,34 +30,24 @@ wSPRNext1:: ds 4
wSPRNext2:: ds 4 wSPRNext2:: ds 4
wSPRNext3:: ds 4 wSPRNext3:: ds 4
wSPRNext4:: ds 4 wSPRNext4:: ds 4
wUnused0:: ds 4
wUnused1:: ds 4
wSPRHold1:: ds 4 wSPRHold1:: ds 4
wSPRHold2:: ds 4 wSPRHold2:: ds 4
wSPRHold3:: ds 4 wSPRHold3:: ds 4
wSPRHold4:: ds 4 wSPRHold4:: ds 4
wUnused2:: ds 4
wUnused3:: ds 4
wSPRScore1:: ds 4 wSPRScore1:: ds 4
wSPRScore2:: ds 4 wSPRScore2:: ds 4
wSPRScore3:: ds 4 wSPRScore3:: ds 4
wSPRScore4:: ds 4 wSPRScore4:: ds 4
wSPRScore5:: ds 4 wSPRScore5:: ds 4
wSPRScore6:: ds 4 wSPRScore6:: ds 4
wUnused4:: ds 4
wUnused5:: ds 4
wSPRCLevel1:: ds 4 wSPRCLevel1:: ds 4
wSPRCLevel2:: ds 4 wSPRCLevel2:: ds 4
wSPRCLevel3:: ds 4 wSPRCLevel3:: ds 4
wSPRCLevel4:: ds 4 wSPRCLevel4:: ds 4
wUnused6:: ds 4
wUnused7:: ds 4
wSPRNLevel1:: ds 4 wSPRNLevel1:: ds 4
wSPRNLevel2:: ds 4 wSPRNLevel2:: ds 4
wSPRNLevel3:: ds 4 wSPRNLevel3:: ds 4
wSPRNLevel4:: ds 4 wSPRNLevel4:: ds 4
wUnused8:: ds 4
wUnused9:: ds 4
wSPRQueue1A:: ds 4 wSPRQueue1A:: ds 4
wSPRQueue1B:: ds 4 wSPRQueue1B:: ds 4
wSPRQueue2A:: ds 4 wSPRQueue2A:: ds 4
@ -66,6 +56,16 @@ wSPRModeRNG:: ds 4
wSPRModeRot:: ds 4 wSPRModeRot:: ds 4
wSPRModeDrop:: ds 4 wSPRModeDrop:: ds 4
wSPRModeHiG:: ds 4 wSPRModeHiG:: ds 4
wUnused0:: ds 4
wUnused1:: ds 4
wUnused2:: ds 4
wUnused3:: ds 4
wUnused4:: ds 4
wUnused5:: ds 4
wUnused6:: ds 4
wUnused7:: ds 4
wUnused8:: ds 4
wUnused9:: ds 4
ENDU ENDU
@ -101,11 +101,11 @@ CopyOAMHandler::
; Clears OAM and shadow OAM. ; Clears OAM and shadow OAM.
ClearOAM:: ClearOAM::
ld hl, _OAMRAM ld hl, _OAMRAM
ld bc, $9F ld bc, 160
ld d, 0 ld d, 0
call SafeMemSet call SafeMemSet
ld hl, wShadowOAM ld hl, wShadowOAM
ld bc, $9F ld bc, 160
ld d, 0 ld d, 0
jp UnsafeMemSet jp UnsafeMemSet
@ -366,7 +366,7 @@ ApplyHold::
; Generic function to draw a BCD number (6 digits) as 6 sprites. ; Generic function to draw a BCD number (6 digits) as 6 sprites.
; Address of first sprite in hl. ; Address of first sprite in hl.
; Address of first digit in de. ; Address of first digit in de.
ApplyNumbers:: ApplyNumbers6::
inc hl inc hl
inc hl inc hl
ld bc, 4 ld bc, 4
@ -406,6 +406,37 @@ ApplyNumbers::
ld [hl], a ld [hl], a
ret ret
; Generic function to draw a BCD number (4 digits) as 4 sprites.
; Address of first sprite in hl.
; Address of first digit in de.
ApplyNumbers4::
inc hl
inc hl
ld bc, 4
ld a, [de]
add a, TILE_0
ld [hl], a
add hl, bc
inc de
ld a, [de]
add a, TILE_0
ld [hl], a
add hl, bc
inc de
ld a, [de]
add a, TILE_0
ld [hl], a
add hl, bc
inc de
ld a, [de]
add a, TILE_0
ld [hl], a
ret
; Positions all number sprites for gameplay. ; Positions all number sprites for gameplay.
SetNumberSpritePositions:: SetNumberSpritePositions::

View File

@ -603,15 +603,15 @@ drawStaticInfo:
ld hl, wSPRScore1 ld hl, wSPRScore1
ld de, hScore ld de, hScore
call ApplyNumbers call ApplyNumbers6
ld hl, wSPRCLevel1 ld hl, wSPRCLevel1
ld de, hCLevel ld de, hCLevel
call ApplyNumbers call ApplyNumbers4
ld hl, wSPRNLevel1 ld hl, wSPRNLevel1
ld de, hNLevel ld de, hNLevel
call ApplyNumbers call ApplyNumbers4
jp GBCGameplayProcess jp GBCGameplayProcess
@ -1212,15 +1212,15 @@ GamePlayBigEventLoopHandlerB:
ld hl, wSPRScore1 ld hl, wSPRScore1
ld de, hScore ld de, hScore
call ApplyNumbers call ApplyNumbers6
ld hl, wSPRCLevel1 ld hl, wSPRCLevel1
ld de, hCLevel ld de, hCLevel
call ApplyNumbers call ApplyNumbers4
ld hl, wSPRNLevel1 ld hl, wSPRNLevel1
ld de, hNLevel ld de, hNLevel
call ApplyNumbers call ApplyNumbers4
jp GBCBigGameplayProcess jp GBCBigGameplayProcess