Save hi scores.

This commit is contained in:
Randy Thiemann 2023-11-11 15:32:48 +01:00
parent 91f213c2aa
commit 920bfa7553
5 changed files with 703 additions and 390 deletions

Binary file not shown.

View File

@ -2,10 +2,7 @@ ROM0 bank #0:
SECTION: $0000-$0007 ($0008 bytes) ["Bank ID BANK_MAIN"] SECTION: $0000-$0007 ($0008 bytes) ["Bank ID BANK_MAIN"]
SECTION: $0008-$0024 ($001d bytes) ["Switch Bank"] SECTION: $0008-$0024 ($001d bytes) ["Switch Bank"]
$0008 = RSTSwitchBank $0008 = RSTSwitchBank
SECTION: $0025-$0026 ($0002 bytes) ["Hi Score Functions"] EMPTY: $0025-$0027 ($0003 bytes)
$0025 = CheckAndAddHiscore
$0026 = GetTargetHSTable
EMPTY: $0027-$0027 ($0001 byte)
SECTION: $0028-$0042 ($001b bytes) ["Restore Bank"] SECTION: $0028-$0042 ($001b bytes) ["Restore Bank"]
$0028 = RSTRestoreBank $0028 = RSTRestoreBank
EMPTY: $0043-$0047 ($0005 bytes) EMPTY: $0043-$0047 ($0005 bytes)
@ -420,125 +417,151 @@ ROM0 bank #0:
$30e9 = Next7Piece $30e9 = Next7Piece
$30e9 = !20 $30e9 = !20
$30f3 = NextByte $30f3 = NextByte
SECTION: $3113-$325c ($014a bytes) ["Progress Data"] SECTION: $3113-$3281 ($016f bytes) ["Hi Score Functions"]
$3113 = sProgressData $3113 = CheckAndAddHiscore
SECTION: $325d-$339c ($0140 bytes) ["Hi Score Data"] $311d = CheckAndAddHiscore.checkloop
$325d = sHiscoreDefaultData $3161 = CheckAndAddHiscore.notbetter
SECTION: $339d-$347c ($00e0 bytes) ["Score Functions"] $316d = CheckAndAddHiscore.better
$339d = ScoreInit $316f = InsertHiScore
$33c5 = IncreaseScore $316f = InsertHiScore.copylower
$33fd = IncreaseScore.doConvert $3180 = InsertHiScore.copyupper
$33ff = !0 $318d = !0
$3415 = IncreaseScore.carry $31a1 = InsertHiScore.findrow
$3417 = IncreaseScore.postConvert $31ae = !1
$3424 = !1 $31b2 = InsertHiScore.insert
$342b = IncreaseScore.preAddDigit $31fb = InsertHiScore.persist
$3453 = IncreaseScore.addDigit $320c = GetHiScoreEntry
$3469 = IncreaseScore.nextDigit $3221 = !2
SECTION: $347d-$3549 ($00cd bytes) ["Input Functions"] $3225 = GetHiScoreEntry.store
$347d = InputInit $322e = InitTargetHSTable
$348f = GetInput $3239 = InitTargetHSTable.jumps
$348f = GetInput.btns $324e = InitTargetHSTable.dmgt
$349c = GetInput.readA $3253 = InitTargetHSTable.tgm1
$34a0 = GetInput.setA $3258 = InitTargetHSTable.tgm3
$34ab = GetInput.clearA $325d = InitTargetHSTable.deat
$34ae = GetInput.readB $3262 = InitTargetHSTable.shir
$34b2 = GetInput.setB $3267 = InitTargetHSTable.chil
$34bd = GetInput.clearB $326c = InitTargetHSTable.myco
$34c0 = GetInput.readSelect $326f = InitTargetHSTable.store
$34c4 = GetInput.setSelect SECTION: $3282-$33cb ($014a bytes) ["Progress Data"]
$34cf = GetInput.clearSelect $3282 = sProgressData
$34d2 = GetInput.readStart SECTION: $33cc-$350b ($0140 bytes) ["Hi Score Data"]
$34d6 = GetInput.setStart $33cc = sHiscoreDefaultData
$34e1 = GetInput.clearStart SECTION: $350c-$35eb ($00e0 bytes) ["Score Functions"]
$34e4 = GetInput.dpad $350c = ScoreInit
$34f1 = GetInput.readUp $3534 = IncreaseScore
$34f5 = GetInput.setUp $356c = IncreaseScore.doConvert
$3500 = GetInput.clearUp $356e = !0
$3503 = GetInput.readDown $3584 = IncreaseScore.carry
$3507 = GetInput.setDown $3586 = IncreaseScore.postConvert
$3512 = GetInput.clearDown $3593 = !1
$3515 = GetInput.readLeft $359a = IncreaseScore.preAddDigit
$3519 = GetInput.setLeft $35c2 = IncreaseScore.addDigit
$3524 = GetInput.clearLeft $35d8 = IncreaseScore.nextDigit
$3527 = GetInput.readRight SECTION: $35ec-$36b8 ($00cd bytes) ["Input Functions"]
$352b = GetInput.setRight $35ec = InputInit
$3536 = GetInput.clearRight $35fe = GetInput
$3539 = GetInput.priorities $35fe = GetInput.btns
$3544 = GetInput.zero $360b = GetInput.readA
SECTION: $354a-$3614 ($00cb bytes) ["Title Function Trampolines"] $360f = GetInput.setA
$354a = SwitchToTitle $361a = GetInput.clearA
$3553 = TitleEventLoopHandler $361d = GetInput.readB
$355d = TitleVBlankHandler $3621 = GetInput.setB
$3567 = PersistLevel $362c = GetInput.clearB
$3575 = DrawSpeedMain $362f = GetInput.readSelect
$35c5 = DrawSpeedSettings $3633 = GetInput.setSelect
SECTION: $3615-$36da ($00c6 bytes) ["Time Functions"] $363e = GetInput.clearSelect
$3615 = TimeInit $3641 = GetInput.readStart
$3635 = StartCountdown $3645 = GetInput.setStart
$3643 = ResetGameTime $3650 = GetInput.clearStart
$364e = CheckTorikan $3653 = GetInput.dpad
$3665 = CheckTorikan.failure $3660 = GetInput.readUp
$3667 = CheckTorikan.success $3664 = GetInput.setUp
$366a = HandleTimers $366f = GetInput.clearUp
$3690 = HandleTimers.reduce $3672 = GetInput.readDown
$369d = HandleTimers.clock $3676 = GetInput.setDown
$36b7 = HandleTimers.go $3681 = GetInput.clearDown
SECTION: $36db-$378c ($00b2 bytes) ["Progress Functions"] $3684 = GetInput.readLeft
$36db = SetProgress $3688 = GetInput.setLeft
$36e6 = SetProgress.loop $3693 = GetInput.clearLeft
$36ea = SetProgress.correct $3696 = GetInput.readRight
$3711 = SetProgress.wvr_u1 $369a = GetInput.setRight
$371d = SetProgress.wvr_u2 $36a5 = GetInput.clearRight
$372b = SetProgress.wvr_u3 $36a8 = GetInput.priorities
$3737 = SetProgress.wvr_u4 $36b3 = GetInput.zero
$3745 = SetProgress.wvr_u5 SECTION: $36b9-$3783 ($00cb bytes) ["Title Function Trampolines"]
$3751 = SetProgress.wvr_u6 $36b9 = SwitchToTitle
$375f = SetProgress.wvr_u7 $36c2 = TitleEventLoopHandler
$376b = SetProgress.wvr_u8 $36cc = TitleVBlankHandler
$3779 = SetProgress.wvr_u9 $36d6 = PersistLevel
$3785 = SetProgress.wvr_u10 $36e4 = DrawSpeedMain
SECTION: $378d-$381e ($0092 bytes) ["Code Entry Point"] $3734 = DrawSpeedSettings
$378d = Main SECTION: $3784-$3849 ($00c6 bytes) ["Time Functions"]
$37b6 = Main.notgbc $3784 = TimeInit
$37bc = Main.wvr_u1 $37a4 = StartCountdown
$37e3 = EventLoop $37b2 = ResetGameTime
$37f9 = EventLoop.eventloopjumps $37bd = CheckTorikan
$3802 = EventLoopPostHandler $37d4 = CheckTorikan.failure
$3804 = EventLoopPostHandler.wvb_u2 $37d6 = CheckTorikan.success
$3816 = EventLoopPostHandler.vblankjumps $37d9 = HandleTimers
SECTION: $381f-$3870 ($0052 bytes) ["Tile Functions"] $37ff = HandleTimers.reduce
$381f = LoadTitleTiles $380c = HandleTimers.clock
$383d = LoadGameplayTiles $3826 = HandleTimers.go
$3853 = LoadGameplayTiles.gbc SECTION: $384a-$38fb ($00b2 bytes) ["Progress Functions"]
$3862 = LoadGameplayTiles.dmg $384a = SetProgress
SECTION: $3871-$38ac ($003c bytes) ["Time Data"] $3855 = SetProgress.loop
$3871 = sFramesToCS $3859 = SetProgress.correct
SECTION: $38ad-$38da ($002e bytes) ["Memory Functions"] $3880 = SetProgress.wvr_u1
$38ad = UnsafeMemCopy $388c = SetProgress.wvr_u2
$38b6 = SafeMemCopy.wvr_u1 $389a = SetProgress.wvr_u3
$38b6 = SafeMemCopy $38a6 = SetProgress.wvr_u4
$38c5 = UnsafeMemSet $38b4 = SetProgress.wvr_u5
$38cd = SafeMemSet $38c0 = SetProgress.wvr_u6
$38cd = SafeMemSet.wvr_u2 $38ce = SetProgress.wvr_u7
SECTION: $38db-$3900 ($0026 bytes) ["Gameplay Function Trampolines"] $38da = SetProgress.wvr_u8
$38db = SwitchToGameplay $38e8 = SetProgress.wvr_u9
$38e4 = SwitchToGameplayBig $38f4 = SetProgress.wvr_u10
$38ed = GamePlayEventLoopHandler SECTION: $38fc-$398d ($0092 bytes) ["Code Entry Point"]
$38f7 = GamePlayBigEventLoopHandler $38fc = Main
SECTION: $3901-$3925 ($0025 bytes) ["Interrupt Initialization Functions"] $3925 = Main.notgbc
$3901 = EnableScreenSquish $392b = Main.wvr_u1
$391b = DisableScreenSquish $3952 = EventLoop
SECTION: $3926-$3947 ($0022 bytes) ["OAM Functions"] $3968 = EventLoop.eventloopjumps
$3926 = CopyOAMHandler $3971 = EventLoopPostHandler
$3932 = ClearOAM $3973 = EventLoopPostHandler.wvb_u2
SECTION: $3948-$3956 ($000f bytes) ["Banking Functions"] $3985 = EventLoopPostHandler.vblankjumps
$3948 = BankingInit SECTION: $398e-$39df ($0052 bytes) ["Tile Functions"]
SECTION: $3957-$3960 ($000a bytes) ["OAM DMA Code"] $398e = LoadTitleTiles
$3957 = OAMDMA $39ac = LoadGameplayTiles
$3961 = OAMDMAEnd $39c2 = LoadGameplayTiles.gbc
EMPTY: $3961-$3fff ($069f bytes) $39d1 = LoadGameplayTiles.dmg
TOTAL EMPTY: $06a8 bytes SECTION: $39e0-$3a1b ($003c bytes) ["Time Data"]
$39e0 = sFramesToCS
SECTION: $3a1c-$3a49 ($002e bytes) ["Memory Functions"]
$3a1c = UnsafeMemCopy
$3a25 = SafeMemCopy.wvr_u1
$3a25 = SafeMemCopy
$3a34 = UnsafeMemSet
$3a3c = SafeMemSet
$3a3c = SafeMemSet.wvr_u2
SECTION: $3a4a-$3a6f ($0026 bytes) ["Gameplay Function Trampolines"]
$3a4a = SwitchToGameplay
$3a53 = SwitchToGameplayBig
$3a5c = GamePlayEventLoopHandler
$3a66 = GamePlayBigEventLoopHandler
SECTION: $3a70-$3a94 ($0025 bytes) ["Interrupt Initialization Functions"]
$3a70 = EnableScreenSquish
$3a8a = DisableScreenSquish
SECTION: $3a95-$3ab6 ($0022 bytes) ["OAM Functions"]
$3a95 = CopyOAMHandler
$3aa1 = ClearOAM
SECTION: $3ab7-$3ac5 ($000f bytes) ["Banking Functions"]
$3ab7 = BankingInit
SECTION: $3ac6-$3acf ($000a bytes) ["OAM DMA Code"]
$3ac6 = OAMDMA
$3ad0 = OAMDMAEnd
EMPTY: $3ad0-$3fff ($0530 bytes)
TOTAL EMPTY: $053b bytes
ROMX bank #1: ROMX bank #1:
SECTION: $4000-$4007 ($0008 bytes) ["Bank ID BANK_OTHER"] SECTION: $4000-$4007 ($0008 bytes) ["Bank ID BANK_OTHER"]
@ -2719,96 +2742,99 @@ WRAM0 bank #0:
$cd1f = wRightSlamTimer $cd1f = wRightSlamTimer
$cd20 = wMovementLastFrame $cd20 = wMovementLastFrame
$cd21 = wReturnToSmall $cd21 = wReturnToSmall
SECTION: $cd22-$ce83 ($0162 bytes) ["Hi Score Variables"] SECTION: $cd22-$ce86 ($0165 bytes) ["Hi Score Variables"]
$cd22 = wTargetHSTable $cd22 = wTargetHSTable
$cd24 = wWorkingCopy $cd24 = wWorkingIdx
SECTION: $ce84-$cec4 ($0041 bytes) ["Stack"] $cd25 = wWorkingPtr
$ce84 = wStack $cd26 = wWorkingCopy
$cec5 = wStackEnd $ce86 = wInsertTarget
SECTION: $cec5-$cef0 ($002c bytes) ["TGM3 RNG Variables"] SECTION: $ce87-$cec7 ($0041 bytes) ["Stack"]
$cec5 = wTGM3Bag $ce87 = wStack
$cee8 = wTGM3Droughts $cec8 = wStackEnd
$ceef = wTGM3GeneratedIdx SECTION: $cec8-$cef3 ($002c bytes) ["TGM3 RNG Variables"]
$cef0 = wTGM3WorstDroughtIdx $cec8 = wTGM3Bag
SECTION: $cef1-$cf03 ($0013 bytes) ["Level Variables"] $ceeb = wTGM3Droughts
$cef1 = wBoneActivationLevel $cef2 = wTGM3GeneratedIdx
$cef3 = wInvisActivationLevel $cef3 = wTGM3WorstDroughtIdx
$cef5 = wKillScreenActivationLevel SECTION: $cef4-$cf06 ($0013 bytes) ["Level Variables"]
$cef7 = wKillScreenActivationLevelBCD $cef4 = wBoneActivationLevel
$cef9 = wLastLockLevel $cef6 = wInvisActivationLevel
$cefb = wStaffRollDuration $cef8 = wKillScreenActivationLevel
$cefd = wBigStaffRoll $cefa = wKillScreenActivationLevelBCD
$cefe = wBonesActive $cefc = wLastLockLevel
$ceff = wInvisActive $cefe = wStaffRollDuration
$cf00 = wKillScreenActive $cf00 = wBigStaffRoll
$cf01 = wLockLevel $cf01 = wBonesActive
$cf02 = wShouldGoStaffRoll $cf02 = wInvisActive
$cf03 = wNoMoreLocks $cf03 = wKillScreenActive
SECTION: $cf04-$cf15 ($0012 bytes) ["Grade Variables"] $cf04 = wLockLevel
$cf04 = wDecayRate $cf05 = wShouldGoStaffRoll
$cf05 = wGradePoints $cf06 = wNoMoreLocks
$cf06 = wInternalGrade SECTION: $cf07-$cf18 ($0012 bytes) ["Grade Variables"]
$cf07 = wDisplayedGrade $cf07 = wDecayRate
$cf08 = wEffectTimer $cf08 = wGradePoints
$cf09 = wRankingDisqualified $cf09 = wInternalGrade
$cf0a = wDecayCounter $cf0a = wDisplayedGrade
$cf0b = wGradeGauge $cf0b = wEffectTimer
$cf0c = wSMult $cf0c = wRankingDisqualified
$cf0d = wDMult $cf0d = wDecayCounter
$cf0e = wTMult $cf0e = wGradeGauge
$cf0f = wSRate $cf0f = wSMult
$cf10 = wDRate $cf10 = wDMult
$cf11 = wTRate $cf11 = wTMult
$cf12 = wQRate $cf12 = wSRate
$cf13 = wTGM1level300RequirementMet $cf13 = wDRate
$cf14 = wTGM1level500RequirementMet $cf14 = wTRate
$cf15 = wTGM1level999RequirementMet $cf15 = wQRate
SECTION: $cf16-$cf1f ($000a bytes) ["Progress Variables"] $cf16 = wTGM1level300RequirementMet
$cf16 = wProgress0B1 $cf17 = wTGM1level500RequirementMet
$cf17 = wProgress0B2 $cf18 = wTGM1level999RequirementMet
$cf18 = wProgress1B1 SECTION: $cf19-$cf22 ($000a bytes) ["Progress Variables"]
$cf19 = wProgress1B2 $cf19 = wProgress0B1
$cf1a = wProgress2B1 $cf1a = wProgress0B2
$cf1b = wProgress2B2 $cf1b = wProgress1B1
$cf1c = wProgress3B1 $cf1c = wProgress1B2
$cf1d = wProgress3B2 $cf1d = wProgress2B1
$cf1e = wProgress4B1 $cf1e = wProgress2B2
$cf1f = wProgress4B2 $cf1f = wProgress3B1
SECTION: $cf20-$cf28 ($0009 bytes) ["Globals"] $cf20 = wProgress3B2
$cf20 = wSwapABState $cf21 = wProgress4B1
$cf21 = wRNGModeState $cf22 = wProgress4B2
$cf22 = wRotModeState SECTION: $cf23-$cf2b ($0009 bytes) ["Globals"]
$cf23 = wDropModeState $cf23 = wSwapABState
$cf24 = wSpeedCurveState $cf24 = wRNGModeState
$cf25 = wAlways20GState $cf25 = wRotModeState
$cf26 = wInitialA $cf26 = wDropModeState
$cf27 = wInitialB $cf27 = wSpeedCurveState
$cf28 = wInitialC $cf28 = wAlways20GState
SECTION: $cf29-$cf2e ($0006 bytes) ["Time Variables"] $cf29 = wInitialA
$cf29 = wMinutes $cf2a = wInitialB
$cf2a = wSeconds $cf2b = wInitialC
$cf2b = wFrames SECTION: $cf2c-$cf31 ($0006 bytes) ["Time Variables"]
$cf2c = wCountDown $cf2c = wMinutes
$cf2e = wCountDownZero $cf2d = wSeconds
SECTION: $cf2f-$cf33 ($0005 bytes) ["Title Variables"] $cf2e = wFrames
$cf2f = wSelected $cf2f = wCountDown
$cf30 = wTitleMode $cf31 = wCountDownZero
$cf31 = wProfileName SECTION: $cf32-$cf36 ($0005 bytes) ["Title Variables"]
SECTION: $cf34-$cf37 ($0004 bytes) ["Banking Variables"] $cf32 = wSelected
$cf34 = wBankBackup $cf33 = wTitleMode
SECTION: $cf38-$cf3b ($0004 bytes) ["Gameplay Variables"] $cf34 = wProfileName
$cf38 = wRollLine SECTION: $cf37-$cf3a ($0004 bytes) ["Banking Variables"]
$cf39 = wInStaffRoll $cf37 = wBankBackup
$cf3a = wBigModeTransfered SECTION: $cf3b-$cf3e ($0004 bytes) ["Gameplay Variables"]
$cf3b = wGameOverIgnoreInput $cf3b = wRollLine
SECTION: $cf3c-$cf3e ($0003 bytes) ["GBC Variables"] $cf3c = wInStaffRoll
$cf3c = wOuterReps $cf3d = wBigModeTransfered
$cf3d = wInnerReps $cf3e = wGameOverIgnoreInput
$cf3e = wTitlePal SECTION: $cf3f-$cf41 ($0003 bytes) ["GBC Variables"]
SECTION: $cf3f-$cf3f ($0001 byte) ["SRAM Variables"] $cf3f = wOuterReps
$cf3f = wTarget $cf40 = wInnerReps
EMPTY: $cf40-$cfff ($00c0 bytes) $cf41 = wTitlePal
TOTAL EMPTY: $00c0 bytes SECTION: $cf42-$cf42 ($0001 byte) ["SRAM Variables"]
$cf42 = wTarget
EMPTY: $cf43-$cfff ($00bd bytes)
TOTAL EMPTY: $00bd bytes
HRAM bank #0: HRAM bank #0:
SECTION: $ff80-$ff9a ($001b bytes) ["High Field Variables"] SECTION: $ff80-$ff9a ($001b bytes) ["High Field Variables"]
@ -2899,8 +2925,8 @@ HRAM bank #0:
TOTAL EMPTY: $0003 bytes TOTAL EMPTY: $0003 bytes
SUMMARY: SUMMARY:
ROM0: 14680 bytes used / 1704 free ROM0: 15045 bytes used / 1339 free
ROMX: 64126 bytes used / 34178 free in 6 banks ROMX: 64126 bytes used / 34178 free in 6 banks
SRAM: 2951 bytes used / 5241 free in 1 bank SRAM: 2951 bytes used / 5241 free in 1 bank
WRAM0: 3904 bytes used / 192 free WRAM0: 3907 bytes used / 189 free
HRAM: 124 bytes used / 3 free HRAM: 124 bytes used / 3 free

Binary file not shown.

View File

@ -1,7 +1,5 @@
; File generated by rgblink ; File generated by rgblink
00:0008 RSTSwitchBank 00:0008 RSTSwitchBank
00:0025 CheckAndAddHiscore
00:0026 GetTargetHSTable
00:0028 RSTRestoreBank 00:0028 RSTRestoreBank
00:0048 LCDCInterrupt 00:0048 LCDCInterrupt
00:004d LCDCInterrupt_WaitUntilNotBusy 00:004d LCDCInterrupt_WaitUntilNotBusy
@ -321,105 +319,127 @@
00:30df Next35Piece 00:30df Next35Piece
00:30e9 Next7Piece 00:30e9 Next7Piece
00:30f3 NextByte 00:30f3 NextByte
00:3113 sProgressData 00:3113 CheckAndAddHiscore
00:325d sHiscoreDefaultData 00:311d CheckAndAddHiscore.checkloop
00:339d ScoreInit 00:3161 CheckAndAddHiscore.notbetter
00:33c5 IncreaseScore 00:316d CheckAndAddHiscore.better
00:33fd IncreaseScore.doConvert 00:316f InsertHiScore
00:3415 IncreaseScore.carry 00:316f InsertHiScore.copylower
00:3417 IncreaseScore.postConvert 00:3180 InsertHiScore.copyupper
00:342b IncreaseScore.preAddDigit 00:31a1 InsertHiScore.findrow
00:3453 IncreaseScore.addDigit 00:31b2 InsertHiScore.insert
00:3469 IncreaseScore.nextDigit 00:31fb InsertHiScore.persist
00:347d InputInit 00:320c GetHiScoreEntry
00:348f GetInput 00:3225 GetHiScoreEntry.store
00:348f GetInput.btns 00:322e InitTargetHSTable
00:349c GetInput.readA 00:3239 InitTargetHSTable.jumps
00:34a0 GetInput.setA 00:324e InitTargetHSTable.dmgt
00:34ab GetInput.clearA 00:3253 InitTargetHSTable.tgm1
00:34ae GetInput.readB 00:3258 InitTargetHSTable.tgm3
00:34b2 GetInput.setB 00:325d InitTargetHSTable.deat
00:34bd GetInput.clearB 00:3262 InitTargetHSTable.shir
00:34c0 GetInput.readSelect 00:3267 InitTargetHSTable.chil
00:34c4 GetInput.setSelect 00:326c InitTargetHSTable.myco
00:34cf GetInput.clearSelect 00:326f InitTargetHSTable.store
00:34d2 GetInput.readStart 00:3282 sProgressData
00:34d6 GetInput.setStart 00:33cc sHiscoreDefaultData
00:34e1 GetInput.clearStart 00:350c ScoreInit
00:34e4 GetInput.dpad 00:3534 IncreaseScore
00:34f1 GetInput.readUp 00:356c IncreaseScore.doConvert
00:34f5 GetInput.setUp 00:3584 IncreaseScore.carry
00:3500 GetInput.clearUp 00:3586 IncreaseScore.postConvert
00:3503 GetInput.readDown 00:359a IncreaseScore.preAddDigit
00:3507 GetInput.setDown 00:35c2 IncreaseScore.addDigit
00:3512 GetInput.clearDown 00:35d8 IncreaseScore.nextDigit
00:3515 GetInput.readLeft 00:35ec InputInit
00:3519 GetInput.setLeft 00:35fe GetInput
00:3524 GetInput.clearLeft 00:35fe GetInput.btns
00:3527 GetInput.readRight 00:360b GetInput.readA
00:352b GetInput.setRight 00:360f GetInput.setA
00:3536 GetInput.clearRight 00:361a GetInput.clearA
00:3539 GetInput.priorities 00:361d GetInput.readB
00:3544 GetInput.zero 00:3621 GetInput.setB
00:354a SwitchToTitle 00:362c GetInput.clearB
00:3553 TitleEventLoopHandler 00:362f GetInput.readSelect
00:355d TitleVBlankHandler 00:3633 GetInput.setSelect
00:3567 PersistLevel 00:363e GetInput.clearSelect
00:3575 DrawSpeedMain 00:3641 GetInput.readStart
00:35c5 DrawSpeedSettings 00:3645 GetInput.setStart
00:3615 TimeInit 00:3650 GetInput.clearStart
00:3635 StartCountdown 00:3653 GetInput.dpad
00:3643 ResetGameTime 00:3660 GetInput.readUp
00:364e CheckTorikan 00:3664 GetInput.setUp
00:3665 CheckTorikan.failure 00:366f GetInput.clearUp
00:3667 CheckTorikan.success 00:3672 GetInput.readDown
00:366a HandleTimers 00:3676 GetInput.setDown
00:3690 HandleTimers.reduce 00:3681 GetInput.clearDown
00:369d HandleTimers.clock 00:3684 GetInput.readLeft
00:36b7 HandleTimers.go 00:3688 GetInput.setLeft
00:36db SetProgress 00:3693 GetInput.clearLeft
00:36e6 SetProgress.loop 00:3696 GetInput.readRight
00:36ea SetProgress.correct 00:369a GetInput.setRight
00:3711 SetProgress.wvr_u1 00:36a5 GetInput.clearRight
00:371d SetProgress.wvr_u2 00:36a8 GetInput.priorities
00:372b SetProgress.wvr_u3 00:36b3 GetInput.zero
00:3737 SetProgress.wvr_u4 00:36b9 SwitchToTitle
00:3745 SetProgress.wvr_u5 00:36c2 TitleEventLoopHandler
00:3751 SetProgress.wvr_u6 00:36cc TitleVBlankHandler
00:375f SetProgress.wvr_u7 00:36d6 PersistLevel
00:376b SetProgress.wvr_u8 00:36e4 DrawSpeedMain
00:3779 SetProgress.wvr_u9 00:3734 DrawSpeedSettings
00:3785 SetProgress.wvr_u10 00:3784 TimeInit
00:378d Main 00:37a4 StartCountdown
00:37b6 Main.notgbc 00:37b2 ResetGameTime
00:37bc Main.wvr_u1 00:37bd CheckTorikan
00:37e3 EventLoop 00:37d4 CheckTorikan.failure
00:37f9 EventLoop.eventloopjumps 00:37d6 CheckTorikan.success
00:3802 EventLoopPostHandler 00:37d9 HandleTimers
00:3804 EventLoopPostHandler.wvb_u2 00:37ff HandleTimers.reduce
00:3816 EventLoopPostHandler.vblankjumps 00:380c HandleTimers.clock
00:381f LoadTitleTiles 00:3826 HandleTimers.go
00:383d LoadGameplayTiles 00:384a SetProgress
00:3853 LoadGameplayTiles.gbc 00:3855 SetProgress.loop
00:3862 LoadGameplayTiles.dmg 00:3859 SetProgress.correct
00:3871 sFramesToCS 00:3880 SetProgress.wvr_u1
00:38ad UnsafeMemCopy 00:388c SetProgress.wvr_u2
00:38b6 SafeMemCopy.wvr_u1 00:389a SetProgress.wvr_u3
00:38b6 SafeMemCopy 00:38a6 SetProgress.wvr_u4
00:38c5 UnsafeMemSet 00:38b4 SetProgress.wvr_u5
00:38cd SafeMemSet 00:38c0 SetProgress.wvr_u6
00:38cd SafeMemSet.wvr_u2 00:38ce SetProgress.wvr_u7
00:38db SwitchToGameplay 00:38da SetProgress.wvr_u8
00:38e4 SwitchToGameplayBig 00:38e8 SetProgress.wvr_u9
00:38ed GamePlayEventLoopHandler 00:38f4 SetProgress.wvr_u10
00:38f7 GamePlayBigEventLoopHandler 00:38fc Main
00:3901 EnableScreenSquish 00:3925 Main.notgbc
00:391b DisableScreenSquish 00:392b Main.wvr_u1
00:3926 CopyOAMHandler 00:3952 EventLoop
00:3932 ClearOAM 00:3968 EventLoop.eventloopjumps
00:3948 BankingInit 00:3971 EventLoopPostHandler
00:3957 OAMDMA 00:3973 EventLoopPostHandler.wvb_u2
00:3961 OAMDMAEnd 00:3985 EventLoopPostHandler.vblankjumps
00:398e LoadTitleTiles
00:39ac LoadGameplayTiles
00:39c2 LoadGameplayTiles.gbc
00:39d1 LoadGameplayTiles.dmg
00:39e0 sFramesToCS
00:3a1c UnsafeMemCopy
00:3a25 SafeMemCopy.wvr_u1
00:3a25 SafeMemCopy
00:3a34 UnsafeMemSet
00:3a3c SafeMemSet
00:3a3c SafeMemSet.wvr_u2
00:3a4a SwitchToGameplay
00:3a53 SwitchToGameplayBig
00:3a5c GamePlayEventLoopHandler
00:3a66 GamePlayBigEventLoopHandler
00:3a70 EnableScreenSquish
00:3a8a DisableScreenSquish
00:3a95 CopyOAMHandler
00:3aa1 ClearOAM
00:3ab7 BankingInit
00:3ac6 OAMDMA
00:3ad0 OAMDMAEnd
01:4008 sDMGTSpeedCurve 01:4008 sDMGTSpeedCurve
01:4203 sDMGTSpeedCurveEnd 01:4203 sDMGTSpeedCurveEnd
01:4205 sDMGTSpeedCurveSpecialData 01:4205 sDMGTSpeedCurveSpecialData
@ -2393,80 +2413,83 @@
00:cd20 wMovementLastFrame 00:cd20 wMovementLastFrame
00:cd21 wReturnToSmall 00:cd21 wReturnToSmall
00:cd22 wTargetHSTable 00:cd22 wTargetHSTable
00:cd24 wWorkingCopy 00:cd24 wWorkingIdx
00:ce84 wStack 00:cd25 wWorkingPtr
00:cec5 wStackEnd 00:cd26 wWorkingCopy
00:cec5 wTGM3Bag 00:ce86 wInsertTarget
00:cee8 wTGM3Droughts 00:ce87 wStack
00:ceef wTGM3GeneratedIdx 00:cec8 wStackEnd
00:cef0 wTGM3WorstDroughtIdx 00:cec8 wTGM3Bag
00:cef1 wBoneActivationLevel 00:ceeb wTGM3Droughts
00:cef3 wInvisActivationLevel 00:cef2 wTGM3GeneratedIdx
00:cef5 wKillScreenActivationLevel 00:cef3 wTGM3WorstDroughtIdx
00:cef7 wKillScreenActivationLevelBCD 00:cef4 wBoneActivationLevel
00:cef9 wLastLockLevel 00:cef6 wInvisActivationLevel
00:cefb wStaffRollDuration 00:cef8 wKillScreenActivationLevel
00:cefd wBigStaffRoll 00:cefa wKillScreenActivationLevelBCD
00:cefe wBonesActive 00:cefc wLastLockLevel
00:ceff wInvisActive 00:cefe wStaffRollDuration
00:cf00 wKillScreenActive 00:cf00 wBigStaffRoll
00:cf01 wLockLevel 00:cf01 wBonesActive
00:cf02 wShouldGoStaffRoll 00:cf02 wInvisActive
00:cf03 wNoMoreLocks 00:cf03 wKillScreenActive
00:cf04 wDecayRate 00:cf04 wLockLevel
00:cf05 wGradePoints 00:cf05 wShouldGoStaffRoll
00:cf06 wInternalGrade 00:cf06 wNoMoreLocks
00:cf07 wDisplayedGrade 00:cf07 wDecayRate
00:cf08 wEffectTimer 00:cf08 wGradePoints
00:cf09 wRankingDisqualified 00:cf09 wInternalGrade
00:cf0a wDecayCounter 00:cf0a wDisplayedGrade
00:cf0b wGradeGauge 00:cf0b wEffectTimer
00:cf0c wSMult 00:cf0c wRankingDisqualified
00:cf0d wDMult 00:cf0d wDecayCounter
00:cf0e wTMult 00:cf0e wGradeGauge
00:cf0f wSRate 00:cf0f wSMult
00:cf10 wDRate 00:cf10 wDMult
00:cf11 wTRate 00:cf11 wTMult
00:cf12 wQRate 00:cf12 wSRate
00:cf13 wTGM1level300RequirementMet 00:cf13 wDRate
00:cf14 wTGM1level500RequirementMet 00:cf14 wTRate
00:cf15 wTGM1level999RequirementMet 00:cf15 wQRate
00:cf16 wProgress0B1 00:cf16 wTGM1level300RequirementMet
00:cf17 wProgress0B2 00:cf17 wTGM1level500RequirementMet
00:cf18 wProgress1B1 00:cf18 wTGM1level999RequirementMet
00:cf19 wProgress1B2 00:cf19 wProgress0B1
00:cf1a wProgress2B1 00:cf1a wProgress0B2
00:cf1b wProgress2B2 00:cf1b wProgress1B1
00:cf1c wProgress3B1 00:cf1c wProgress1B2
00:cf1d wProgress3B2 00:cf1d wProgress2B1
00:cf1e wProgress4B1 00:cf1e wProgress2B2
00:cf1f wProgress4B2 00:cf1f wProgress3B1
00:cf20 wSwapABState 00:cf20 wProgress3B2
00:cf21 wRNGModeState 00:cf21 wProgress4B1
00:cf22 wRotModeState 00:cf22 wProgress4B2
00:cf23 wDropModeState 00:cf23 wSwapABState
00:cf24 wSpeedCurveState 00:cf24 wRNGModeState
00:cf25 wAlways20GState 00:cf25 wRotModeState
00:cf26 wInitialA 00:cf26 wDropModeState
00:cf27 wInitialB 00:cf27 wSpeedCurveState
00:cf28 wInitialC 00:cf28 wAlways20GState
00:cf29 wMinutes 00:cf29 wInitialA
00:cf2a wSeconds 00:cf2a wInitialB
00:cf2b wFrames 00:cf2b wInitialC
00:cf2c wCountDown 00:cf2c wMinutes
00:cf2e wCountDownZero 00:cf2d wSeconds
00:cf2f wSelected 00:cf2e wFrames
00:cf30 wTitleMode 00:cf2f wCountDown
00:cf31 wProfileName 00:cf31 wCountDownZero
00:cf34 wBankBackup 00:cf32 wSelected
00:cf38 wRollLine 00:cf33 wTitleMode
00:cf39 wInStaffRoll 00:cf34 wProfileName
00:cf3a wBigModeTransfered 00:cf37 wBankBackup
00:cf3b wGameOverIgnoreInput 00:cf3b wRollLine
00:cf3c wOuterReps 00:cf3c wInStaffRoll
00:cf3d wInnerReps 00:cf3d wBigModeTransfered
00:cf3e wTitlePal 00:cf3e wGameOverIgnoreInput
00:cf3f wTarget 00:cf3f wOuterReps
00:cf40 wInnerReps
00:cf41 wTitlePal
00:cf42 wTarget
00:ff80 hPieceDataBase 00:ff80 hPieceDataBase
00:ff82 hPieceDataBaseFast 00:ff82 hPieceDataBaseFast
00:ff84 hPieceDataOffset 00:ff84 hPieceDataOffset

View File

@ -48,14 +48,278 @@ sHiscoreDefaultData::
SECTION "Hi Score Variables", WRAM0 SECTION "Hi Score Variables", WRAM0
wTargetHSTable:: ds 2 wTargetHSTable:: ds 2
wWorkingIdx:: ds 1
wWorkingPtr:: ds 1
wWorkingCopy:: ds ((HISCORE_ENTRY_COUNT+1)*(HISCORE_ENTRY_SIZE)) wWorkingCopy:: ds ((HISCORE_ENTRY_COUNT+1)*(HISCORE_ENTRY_SIZE))
wInsertTarget:: ds 1
SECTION "Hi Score Functions", ROM0 SECTION "Hi Score Functions", ROM0
CheckAndAddHiscore:: CheckAndAddHiscore::
; Get the table
ld a, [wSpeedCurveState]
call InitTargetHSTable
; Initialize loop at 0.
xor a, a
ld [wInsertTarget], a
.checkloop
; Load the score at position a.
call GetHiScoreEntry
; HL is pointing to that score, make BC point to our current score.
ld bc, hScore
; First digit
ld a, [bc]
cp a, [hl]
jr c, .notbetter
jr nz, .better
inc bc
inc hl
; Second digit
ld a, [bc]
cp a, [hl]
jr c, .notbetter
jr nz, .better
inc bc
inc hl
; Third digit
ld a, [bc]
cp a, [hl]
jr c, .notbetter
jr nz, .better
inc bc
inc hl
; Fourth digit
ld a, [bc]
cp a, [hl]
jr c, .notbetter
jr nz, .better
inc bc
inc hl
; Fifth digit
ld a, [bc]
cp a, [hl]
jr c, .notbetter
jr nz, .better
inc bc
inc hl
; Sixth digit
ld a, [bc]
cp a, [hl]
jr c, .notbetter
jr nz, .better
inc bc
inc hl
; Seventh digit
ld a, [bc]
cp a, [hl]
jr c, .notbetter
jr nz, .better
inc bc
inc hl
; Eighth digit
ld a, [bc]
cp a, [hl]
jr c, .notbetter
jr nz, .better
; Loop or return if we didn't make the scores.
.notbetter
ld a, [wInsertTarget]
inc a
ld [wInsertTarget], a
cp a, 10
ret z
jr .checkloop
.better
jr InsertHiScore
; Inserts the current score data into the table.
; Data will be saved and persisted.
InsertHiScore::
; Copy the entire table to working data, but one row down.
.copylower
ld a, [wTargetHSTable]
ld e, a
ld a, [wTargetHSTable+1]
ld d, a
ld hl, wWorkingCopy+HISCORE_ENTRY_SIZE
ld bc, (HISCORE_ENTRY_COUNT*HISCORE_ENTRY_SIZE)
call UnsafeMemCopy
; Copy the top rows to the working data.
.copyupper
ld a, [wInsertTarget]
cp a, 0
jr z, .findrow
ld hl, 0
ld bc, HISCORE_ENTRY_SIZE
: add hl, bc
dec a
jr nz, :-
ld b, h
ld c, l
ld a, [wTargetHSTable]
ld e, a
ld a, [wTargetHSTable+1]
ld d, a
ld hl, wWorkingCopy
call UnsafeMemCopy
; Make HL point to the correct location to insert the new score
.findrow
ld hl, wWorkingCopy
ld bc, HISCORE_ENTRY_SIZE
ld a, [wInsertTarget]
cp a, 0
jr z, .insert
: add hl, bc
dec a
jr nz, :-
; And do the insertion
.insert
ldh a, [hScore+0]
ld [hl+], a
ldh a, [hScore+1]
ld [hl+], a
ldh a, [hScore+2]
ld [hl+], a
ldh a, [hScore+3]
ld [hl+], a
ldh a, [hScore+4]
ld [hl+], a
ldh a, [hScore+5]
ld [hl+], a
ldh a, [hScore+6]
ld [hl+], a
ldh a, [hScore+7]
ld [hl+], a
ld a, [wProfileName+0]
ld [hl+], a
ld a, [wProfileName+1]
ld [hl+], a
ld a, [wProfileName+2]
ld [hl+], a
ld a, [wDisplayedGrade]
ld [hl+], a
ld a, [wRNGModeState]
ld [hl+], a
ld a, [wRotModeState]
ld [hl+], a
ld a, [wDropModeState]
ld [hl+], a
ld a, [wAlways20GState]
ld [hl+], a
; 16 filler bytes.
xor a, a
REPT 16
ld [hl+], a
ENDR
; And copy it back.
.persist
ld de, wWorkingCopy
ld a, [wTargetHSTable]
ld l, a
ld a, [wTargetHSTable+1]
ld h, a
ld bc, HISCORE_ENTRY_COUNT*HISCORE_ENTRY_SIZE
jp UnsafeMemCopy
; Updates the pointers for the current hi score to point to the index in register A.
; HL will be left pointing at said memory.
GetHiScoreEntry::
ld [wWorkingIdx], a
ld a, [wTargetHSTable]
ld l, a
ld a, [wTargetHSTable+1]
ld h, a
ld bc, HISCORE_ENTRY_SIZE
ld a, [wWorkingIdx]
cp a, 0
jr z, .store
: add hl, bc
dec a
jr nz, :-
.store
ld a, l
ld [wWorkingPtr], a
ld a, h
ld [wWorkingPtr+1], a
ret ret
GetTargetHSTable: ; Initializes all the pointers to point to the very first score in the table for the game mode passed in
; register A.
InitTargetHSTable::
ld b, a
add a, b
add a, b
ld c, a
ld b, 0
ld hl, .jumps
add hl, bc
jp hl
.jumps
jp .dmgt
jp .tgm1
jp .tgm3
jp .deat
jp .shir
jp .chil
jp .myco
.dmgt
ld hl, rScoreTableDMGT
jr .store
.tgm1
ld hl, rScoreTableTGM1
jr .store
.tgm3
ld hl, rScoreTableTGM3
jr .store
.deat
ld hl, rScoreTableDEAT
jr .store
.shir
ld hl, rScoreTableSHIR
jr .store
.chil
ld hl, rScoreTableCHIL
jr .store
.myco
ld hl, rScoreTableMYCO
.store
ld a, l
ld [wTargetHSTable], a
ld [wWorkingPtr], a
ld a, h
ld [wTargetHSTable+1], a
ld [wWorkingPtr+1], a
xor a, a
ld [wWorkingIdx], a
ret ret
ENDC ENDC