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