Add profile framework.

This commit is contained in:
Randy Thiemann 2023-11-10 10:29:40 +01:00
parent 3bc39d6e42
commit 21bafab8e1
7 changed files with 683 additions and 325 deletions

Binary file not shown.

View File

@ -364,125 +364,146 @@ ROM0 bank #0:
$2b92 = Next7Piece $2b92 = Next7Piece
$2b92 = !20 $2b92 = !20
$2b9c = NextByte $2b9c = NextByte
SECTION: $2bbc-$2d05 ($014a bytes) ["Progress Data"] SECTION: $2bbc-$2dd0 ($0215 bytes) ["SRAM Functions"]
$2bbc = sProgressData $2bbc = RestoreSRAM
SECTION: $2d06-$2de5 ($00e0 bytes) ["Score Functions"] $2c3e = RestoreSRAM.jumps
$2d06 = ScoreInit $2c56 = RestoreSRAM.dmgt
$2d2e = IncreaseScore $2c5c = RestoreSRAM.tgm1
$2d66 = IncreaseScore.doConvert $2c62 = RestoreSRAM.tgm3
$2d68 = !0 $2c68 = RestoreSRAM.deat
$2d7e = IncreaseScore.carry $2c6e = RestoreSRAM.shir
$2d80 = IncreaseScore.postConvert $2c74 = RestoreSRAM.chil
$2d8d = !1 $2c7a = RestoreSRAM.myco
$2d94 = IncreaseScore.preAddDigit $2c80 = RestoreSRAM.search
$2dbc = IncreaseScore.addDigit $2c92 = RestoreSRAM.notfound
$2dd2 = IncreaseScore.nextDigit $2c99 = RestoreSRAM.fallback
SECTION: $2de6-$2eb2 ($00cd bytes) ["Input Functions"] $2cb4 = InitializeSRAM
$2de6 = InputInit $2d5d = ChangeProfile
$2df8 = GetInput $2d5d = ChangeProfile.backup
$2df8 = GetInput.btns $2d70 = ChangeProfile.first
$2e05 = GetInput.readA $2d7e = ChangeProfile.second
$2e09 = GetInput.setA $2d8c = ChangeProfile.third
$2e14 = GetInput.clearA $2d9a = ChangeProfile.restore
$2e17 = GetInput.readB $2dad = ChangeProfile.lfirst
$2e1b = GetInput.setB $2db9 = ChangeProfile.lsecond
$2e26 = GetInput.clearB $2dc5 = ChangeProfile.lthird
$2e29 = GetInput.readSelect SECTION: $2dd1-$2f1a ($014a bytes) ["Progress Data"]
$2e2d = GetInput.setSelect $2dd1 = sProgressData
$2e38 = GetInput.clearSelect SECTION: $2f1b-$2ffa ($00e0 bytes) ["Score Functions"]
$2e3b = GetInput.readStart $2f1b = ScoreInit
$2e3f = GetInput.setStart $2f43 = IncreaseScore
$2e4a = GetInput.clearStart $2f7b = IncreaseScore.doConvert
$2e4d = GetInput.dpad $2f7d = !0
$2e5a = GetInput.readUp $2f93 = IncreaseScore.carry
$2e5e = GetInput.setUp $2f95 = IncreaseScore.postConvert
$2e69 = GetInput.clearUp $2fa2 = !1
$2e6c = GetInput.readDown $2fa9 = IncreaseScore.preAddDigit
$2e70 = GetInput.setDown $2fd1 = IncreaseScore.addDigit
$2e7b = GetInput.clearDown $2fe7 = IncreaseScore.nextDigit
$2e7e = GetInput.readLeft SECTION: $2ffb-$30c7 ($00cd bytes) ["Input Functions"]
$2e82 = GetInput.setLeft $2ffb = InputInit
$2e8d = GetInput.clearLeft $300d = GetInput
$2e90 = GetInput.readRight $300d = GetInput.btns
$2e94 = GetInput.setRight $301a = GetInput.readA
$2e9f = GetInput.clearRight $301e = GetInput.setA
$2ea2 = GetInput.priorities $3029 = GetInput.clearA
$2ead = GetInput.zero $302c = GetInput.readB
SECTION: $2eb3-$2f78 ($00c6 bytes) ["Time Functions"] $3030 = GetInput.setB
$2eb3 = TimeInit $303b = GetInput.clearB
$2ed3 = StartCountdown $303e = GetInput.readSelect
$2ee1 = ResetGameTime $3042 = GetInput.setSelect
$2eec = CheckTorikan $304d = GetInput.clearSelect
$2f03 = CheckTorikan.failure $3050 = GetInput.readStart
$2f05 = CheckTorikan.success $3054 = GetInput.setStart
$2f08 = HandleTimers $305f = GetInput.clearStart
$2f2e = HandleTimers.reduce $3062 = GetInput.dpad
$2f3b = HandleTimers.clock $306f = GetInput.readUp
$2f55 = HandleTimers.go $3073 = GetInput.setUp
SECTION: $2f79-$3035 ($00bd bytes) ["Title Function Trampolines"] $307e = GetInput.clearUp
$2f79 = SwitchToTitle $3081 = GetInput.readDown
$2f82 = TitleEventLoopHandler $3085 = GetInput.setDown
$2f8c = TitleVBlankHandler $3090 = GetInput.clearDown
$2f96 = DrawSpeedMain $3093 = GetInput.readLeft
$2fe6 = DrawSpeedSettings $3097 = GetInput.setLeft
SECTION: $3036-$30ec ($00b7 bytes) ["SRAM Functions"] $30a2 = GetInput.clearLeft
$3036 = RestoreSRAM $30a5 = GetInput.readRight
$308f = InitializeSRAM $30a9 = GetInput.setRight
SECTION: $30ed-$319e ($00b2 bytes) ["Progress Functions"] $30b4 = GetInput.clearRight
$30ed = SetProgress $30b7 = GetInput.priorities
$30f8 = SetProgress.loop $30c2 = GetInput.zero
$30fc = SetProgress.correct SECTION: $30c8-$3192 ($00cb bytes) ["Title Function Trampolines"]
$3123 = SetProgress.wvr_u1 $30c8 = SwitchToTitle
$312f = SetProgress.wvr_u2 $30d1 = TitleEventLoopHandler
$313d = SetProgress.wvr_u3 $30db = TitleVBlankHandler
$3149 = SetProgress.wvr_u4 $30e5 = PersistLevel
$3157 = SetProgress.wvr_u5 $30f3 = DrawSpeedMain
$3163 = SetProgress.wvr_u6 $3143 = DrawSpeedSettings
$3171 = SetProgress.wvr_u7 SECTION: $3193-$3258 ($00c6 bytes) ["Time Functions"]
$317d = SetProgress.wvr_u8 $3193 = TimeInit
$318b = SetProgress.wvr_u9 $31b3 = StartCountdown
$3197 = SetProgress.wvr_u10 $31c1 = ResetGameTime
SECTION: $319f-$3230 ($0092 bytes) ["Code Entry Point"] $31cc = CheckTorikan
$319f = Main $31e3 = CheckTorikan.failure
$31c8 = Main.notgbc $31e5 = CheckTorikan.success
$31ce = Main.wvr_u1 $31e8 = HandleTimers
$31f5 = EventLoop $320e = HandleTimers.reduce
$320b = EventLoop.eventloopjumps $321b = HandleTimers.clock
$3214 = EventLoopPostHandler $3235 = HandleTimers.go
$3216 = EventLoopPostHandler.wvb_u2 SECTION: $3259-$330a ($00b2 bytes) ["Progress Functions"]
$3228 = EventLoopPostHandler.vblankjumps $3259 = SetProgress
SECTION: $3231-$3282 ($0052 bytes) ["Tile Functions"] $3264 = SetProgress.loop
$3231 = LoadTitleTiles $3268 = SetProgress.correct
$324f = LoadGameplayTiles $328f = SetProgress.wvr_u1
$3265 = LoadGameplayTiles.gbc $329b = SetProgress.wvr_u2
$3274 = LoadGameplayTiles.dmg $32a9 = SetProgress.wvr_u3
SECTION: $3283-$32be ($003c bytes) ["Time Data"] $32b5 = SetProgress.wvr_u4
$3283 = sFramesToCS $32c3 = SetProgress.wvr_u5
SECTION: $32bf-$32ec ($002e bytes) ["Memory Functions"] $32cf = SetProgress.wvr_u6
$32bf = UnsafeMemCopy $32dd = SetProgress.wvr_u7
$32c8 = SafeMemCopy.wvr_u1 $32e9 = SetProgress.wvr_u8
$32c8 = SafeMemCopy $32f7 = SetProgress.wvr_u9
$32d7 = UnsafeMemSet $3303 = SetProgress.wvr_u10
$32df = SafeMemSet SECTION: $330b-$339c ($0092 bytes) ["Code Entry Point"]
$32df = SafeMemSet.wvr_u2 $330b = Main
SECTION: $32ed-$3312 ($0026 bytes) ["Gameplay Function Trampolines"] $3334 = Main.notgbc
$32ed = SwitchToGameplay $333a = Main.wvr_u1
$32f6 = SwitchToGameplayBig $3361 = EventLoop
$32ff = GamePlayEventLoopHandler $3377 = EventLoop.eventloopjumps
$3309 = GamePlayBigEventLoopHandler $3380 = EventLoopPostHandler
SECTION: $3313-$3337 ($0025 bytes) ["Interrupt Initialization Functions"] $3382 = EventLoopPostHandler.wvb_u2
$3313 = EnableScreenSquish $3394 = EventLoopPostHandler.vblankjumps
$332d = DisableScreenSquish SECTION: $339d-$33ee ($0052 bytes) ["Tile Functions"]
SECTION: $3338-$3359 ($0022 bytes) ["OAM Functions"] $339d = LoadTitleTiles
$3338 = CopyOAMHandler $33bb = LoadGameplayTiles
$3344 = ClearOAM $33d1 = LoadGameplayTiles.gbc
SECTION: $335a-$3368 ($000f bytes) ["Banking Functions"] $33e0 = LoadGameplayTiles.dmg
$335a = BankingInit SECTION: $33ef-$342a ($003c bytes) ["Time Data"]
SECTION: $3369-$3372 ($000a bytes) ["OAM DMA Code"] $33ef = sFramesToCS
$3369 = OAMDMA SECTION: $342b-$3458 ($002e bytes) ["Memory Functions"]
$3373 = OAMDMAEnd $342b = UnsafeMemCopy
EMPTY: $3373-$3fff ($0c8d bytes) $3434 = SafeMemCopy.wvr_u1
TOTAL EMPTY: $0c98 bytes $3434 = SafeMemCopy
$3443 = UnsafeMemSet
$344b = SafeMemSet
$344b = SafeMemSet.wvr_u2
SECTION: $3459-$347e ($0026 bytes) ["Gameplay Function Trampolines"]
$3459 = SwitchToGameplay
$3462 = SwitchToGameplayBig
$346b = GamePlayEventLoopHandler
$3475 = GamePlayBigEventLoopHandler
SECTION: $347f-$34a3 ($0025 bytes) ["Interrupt Initialization Functions"]
$347f = EnableScreenSquish
$3499 = DisableScreenSquish
SECTION: $34a4-$34c5 ($0022 bytes) ["OAM Functions"]
$34a4 = CopyOAMHandler
$34b0 = ClearOAM
SECTION: $34c6-$34d4 ($000f bytes) ["Banking Functions"]
$34c6 = BankingInit
SECTION: $34d5-$34de ($000a bytes) ["OAM DMA Code"]
$34d5 = OAMDMA
$34df = OAMDMAEnd
EMPTY: $34df-$3fff ($0b21 bytes)
TOTAL EMPTY: $0b2c 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"]
@ -611,7 +632,7 @@ ROMX bank #4:
$4550 = sTitleScreenSettingsMap $4550 = sTitleScreenSettingsMap
$4550 = sTitleScreenMainMapEnd $4550 = sTitleScreenMainMapEnd
$47f0 = sTitleScreenSettingsMapEnd $47f0 = sTitleScreenSettingsMapEnd
SECTION: $47f0-$4f77 ($0788 bytes) ["Title Functions Banked"] SECTION: $47f0-$4f67 ($0778 bytes) ["Title Functions Banked"]
$47f0 = SwitchToTitleB $47f0 = SwitchToTitleB
$47f6 = SwitchToTitleB.wvr_u1 $47f6 = SwitchToTitleB.wvr_u1
$47ff = !0 $47ff = !0
@ -738,27 +759,27 @@ ROMX bank #4:
$4e6e = SettingsHandleRight.hig $4e6e = SettingsHandleRight.hig
$4e7d = !18 $4e7d = !18
$4e85 = DecrementLevel $4e85 = DecrementLevel
$4e9e = IncrementLevel $4e9b = IncrementLevel
$4eb7 = InitSpeedCurve $4eb1 = InitSpeedCurve
$4eca = GetEnd $4ec0 = GetEnd
$4ed5 = !19 $4ecb = !19
$4edd = !20 $4ed3 = !20
$4ee5 = !21 $4edb = !21
$4eed = !22 $4ee3 = !22
$4ef5 = !23 $4eeb = !23
$4efd = !24 $4ef3 = !24
$4f01 = GetStart $4ef7 = GetStart
$4f0c = !25 $4f02 = !25
$4f14 = !26 $4f0a = !26
$4f1c = !27 $4f12 = !27
$4f24 = !28 $4f1a = !28
$4f2c = !29 $4f22 = !29
$4f34 = !30 $4f2a = !30
$4f38 = CheckLevelRange $4f2e = CheckLevelRange
$4f54 = CheckLevelRange.notatend $4f47 = CheckLevelRange.notatend
$4f77 = CheckLevelRange.notatstart $4f67 = CheckLevelRange.notatstart
EMPTY: $4f78-$7fff ($3088 bytes) EMPTY: $4f68-$7fff ($3098 bytes)
TOTAL EMPTY: $3088 bytes TOTAL EMPTY: $3098 bytes
ROMX bank #5: ROMX bank #5:
SECTION: $4000-$4007 ($0008 bytes) ["Bank ID BANK_GAMEPLAY"] SECTION: $4000-$4007 ($0008 bytes) ["Bank ID BANK_GAMEPLAY"]
@ -2422,17 +2443,51 @@ ROMX bank #6:
TOTAL EMPTY: $1211 bytes TOTAL EMPTY: $1211 bytes
SRAM bank #0: SRAM bank #0:
SECTION: $a000-$a00d ($000e bytes) ["Persistent Globals"] SECTION: $a000-$a106 ($0107 bytes) ["Persistent Globals"]
$a000 = rCheck $a000 = rCheck
$a006 = rSwapABState $a006 = rLastProfile
$a007 = rRNGModeState $a007 = rProfileName
$a008 = rRotModeState $a007 = rProfileData
$a009 = rDropModeState $a00a = rSwapABState
$a00a = rSpeedCurveState $a00b = rRNGModeState
$a00b = rAlways20GState $a00c = rRotModeState
$a00c = rSelectedStartLevel $a00d = rDropModeState
EMPTY: $a00e-$bfff ($1ff2 bytes) $a00e = rSpeedCurveState
TOTAL EMPTY: $1ff2 bytes $a00f = rAlways20GState
$a010 = rSelectedStartLevel
$a012 = rUnused
$a047 = rProfileData0
$a047 = rProfileName0
$a04a = rSwapABState0
$a04b = rRNGModeState0
$a04c = rRotModeState0
$a04d = rDropModeState0
$a04e = rSpeedCurveState0
$a04f = rAlways20GState0
$a050 = rSelectedStartLevel0
$a052 = rUnused0
$a087 = rProfileData1
$a087 = rProfileName1
$a08a = rSwapABState1
$a08b = rRNGModeState1
$a08c = rRotModeState1
$a08d = rDropModeState1
$a08e = rSpeedCurveState1
$a08f = rAlways20GState1
$a090 = rSelectedStartLevel1
$a092 = rUnused1
$a0c7 = rProfileData2
$a0c7 = rProfileName2
$a0ca = rSwapABState2
$a0cb = rRNGModeState2
$a0cc = rRotModeState2
$a0cd = rDropModeState2
$a0ce = rSpeedCurveState2
$a0cf = rAlways20GState2
$a0d0 = rSelectedStartLevel2
$a0d2 = rUnused2
EMPTY: $a107-$bfff ($1ef9 bytes)
TOTAL EMPTY: $1ef9 bytes
WRAM0 bank #0: WRAM0 bank #0:
SECTION: $c000-$c3ff ($0400 bytes) ["GBC Shadow Tilemap"] SECTION: $c000-$c3ff ($0400 bytes) ["GBC Shadow Tilemap"]
@ -2558,21 +2613,24 @@ WRAM0 bank #0:
$cdc5 = wFrames $cdc5 = wFrames
$cdc6 = wCountDown $cdc6 = wCountDown
$cdc8 = wCountDownZero $cdc8 = wCountDownZero
SECTION: $cdc9-$cdcc ($0004 bytes) ["Banking Variables"] SECTION: $cdc9-$cdcd ($0005 bytes) ["Title Variables"]
$cdc9 = wBankBackup $cdc9 = wSelected
SECTION: $cdcd-$cdcf ($0003 bytes) ["GBC Variables"] $cdca = wTitleMode
$cdcd = wOuterReps $cdcb = wProfileName
$cdce = wInnerReps SECTION: $cdce-$cdd1 ($0004 bytes) ["Banking Variables"]
$cdcf = wTitlePal $cdce = wBankBackup
SECTION: $cdd0-$cdd2 ($0003 bytes) ["Gameplay Variables"] SECTION: $cdd2-$cdd4 ($0003 bytes) ["GBC Variables"]
$cdd0 = wRollLine $cdd2 = wOuterReps
$cdd1 = wInStaffRoll $cdd3 = wInnerReps
$cdd2 = wBigModeTransfered $cdd4 = wTitlePal
SECTION: $cdd3-$cdd4 ($0002 bytes) ["Title Variables"] SECTION: $cdd5-$cdd7 ($0003 bytes) ["Gameplay Variables"]
$cdd3 = wSelected $cdd5 = wRollLine
$cdd4 = wTitleMode $cdd6 = wInStaffRoll
EMPTY: $cdd5-$cfff ($022b bytes) $cdd7 = wBigModeTransfered
TOTAL EMPTY: $022b bytes SECTION: $cdd8-$cdd8 ($0001 byte) ["SRAM Variables"]
$cdd8 = wTarget
EMPTY: $cdd9-$cfff ($0227 bytes)
TOTAL EMPTY: $0227 bytes
HRAM bank #0: HRAM bank #0:
SECTION: $ff80-$ff9a ($001b bytes) ["High Field Variables"] SECTION: $ff80-$ff9a ($001b bytes) ["High Field Variables"]
@ -2663,8 +2721,8 @@ HRAM bank #0:
TOTAL EMPTY: $0003 bytes TOTAL EMPTY: $0003 bytes
SUMMARY: SUMMARY:
ROM0: 13160 bytes used / 3224 free ROM0: 13524 bytes used / 2860 free
ROMX: 62056 bytes used / 36248 free in 6 banks ROMX: 62040 bytes used / 36264 free in 6 banks
SRAM: 14 bytes used / 8178 free in 1 bank SRAM: 263 bytes used / 7929 free in 1 bank
WRAM0: 3541 bytes used / 555 free WRAM0: 3545 bytes used / 551 free
HRAM: 124 bytes used / 3 free HRAM: 124 bytes used / 3 free

Binary file not shown.

View File

@ -268,105 +268,126 @@
00:2b88 Next35Piece 00:2b88 Next35Piece
00:2b92 Next7Piece 00:2b92 Next7Piece
00:2b9c NextByte 00:2b9c NextByte
00:2bbc sProgressData 00:2bbc RestoreSRAM
00:2d06 ScoreInit 00:2c3e RestoreSRAM.jumps
00:2d2e IncreaseScore 00:2c56 RestoreSRAM.dmgt
00:2d66 IncreaseScore.doConvert 00:2c5c RestoreSRAM.tgm1
00:2d7e IncreaseScore.carry 00:2c62 RestoreSRAM.tgm3
00:2d80 IncreaseScore.postConvert 00:2c68 RestoreSRAM.deat
00:2d94 IncreaseScore.preAddDigit 00:2c6e RestoreSRAM.shir
00:2dbc IncreaseScore.addDigit 00:2c74 RestoreSRAM.chil
00:2dd2 IncreaseScore.nextDigit 00:2c7a RestoreSRAM.myco
00:2de6 InputInit 00:2c80 RestoreSRAM.search
00:2df8 GetInput 00:2c92 RestoreSRAM.notfound
00:2df8 GetInput.btns 00:2c99 RestoreSRAM.fallback
00:2e05 GetInput.readA 00:2cb4 InitializeSRAM
00:2e09 GetInput.setA 00:2d5d ChangeProfile
00:2e14 GetInput.clearA 00:2d5d ChangeProfile.backup
00:2e17 GetInput.readB 00:2d70 ChangeProfile.first
00:2e1b GetInput.setB 00:2d7e ChangeProfile.second
00:2e26 GetInput.clearB 00:2d8c ChangeProfile.third
00:2e29 GetInput.readSelect 00:2d9a ChangeProfile.restore
00:2e2d GetInput.setSelect 00:2dad ChangeProfile.lfirst
00:2e38 GetInput.clearSelect 00:2db9 ChangeProfile.lsecond
00:2e3b GetInput.readStart 00:2dc5 ChangeProfile.lthird
00:2e3f GetInput.setStart 00:2dd1 sProgressData
00:2e4a GetInput.clearStart 00:2f1b ScoreInit
00:2e4d GetInput.dpad 00:2f43 IncreaseScore
00:2e5a GetInput.readUp 00:2f7b IncreaseScore.doConvert
00:2e5e GetInput.setUp 00:2f93 IncreaseScore.carry
00:2e69 GetInput.clearUp 00:2f95 IncreaseScore.postConvert
00:2e6c GetInput.readDown 00:2fa9 IncreaseScore.preAddDigit
00:2e70 GetInput.setDown 00:2fd1 IncreaseScore.addDigit
00:2e7b GetInput.clearDown 00:2fe7 IncreaseScore.nextDigit
00:2e7e GetInput.readLeft 00:2ffb InputInit
00:2e82 GetInput.setLeft 00:300d GetInput
00:2e8d GetInput.clearLeft 00:300d GetInput.btns
00:2e90 GetInput.readRight 00:301a GetInput.readA
00:2e94 GetInput.setRight 00:301e GetInput.setA
00:2e9f GetInput.clearRight 00:3029 GetInput.clearA
00:2ea2 GetInput.priorities 00:302c GetInput.readB
00:2ead GetInput.zero 00:3030 GetInput.setB
00:2eb3 TimeInit 00:303b GetInput.clearB
00:2ed3 StartCountdown 00:303e GetInput.readSelect
00:2ee1 ResetGameTime 00:3042 GetInput.setSelect
00:2eec CheckTorikan 00:304d GetInput.clearSelect
00:2f03 CheckTorikan.failure 00:3050 GetInput.readStart
00:2f05 CheckTorikan.success 00:3054 GetInput.setStart
00:2f08 HandleTimers 00:305f GetInput.clearStart
00:2f2e HandleTimers.reduce 00:3062 GetInput.dpad
00:2f3b HandleTimers.clock 00:306f GetInput.readUp
00:2f55 HandleTimers.go 00:3073 GetInput.setUp
00:2f79 SwitchToTitle 00:307e GetInput.clearUp
00:2f82 TitleEventLoopHandler 00:3081 GetInput.readDown
00:2f8c TitleVBlankHandler 00:3085 GetInput.setDown
00:2f96 DrawSpeedMain 00:3090 GetInput.clearDown
00:2fe6 DrawSpeedSettings 00:3093 GetInput.readLeft
00:3036 RestoreSRAM 00:3097 GetInput.setLeft
00:308f InitializeSRAM 00:30a2 GetInput.clearLeft
00:30ed SetProgress 00:30a5 GetInput.readRight
00:30f8 SetProgress.loop 00:30a9 GetInput.setRight
00:30fc SetProgress.correct 00:30b4 GetInput.clearRight
00:3123 SetProgress.wvr_u1 00:30b7 GetInput.priorities
00:312f SetProgress.wvr_u2 00:30c2 GetInput.zero
00:313d SetProgress.wvr_u3 00:30c8 SwitchToTitle
00:3149 SetProgress.wvr_u4 00:30d1 TitleEventLoopHandler
00:3157 SetProgress.wvr_u5 00:30db TitleVBlankHandler
00:3163 SetProgress.wvr_u6 00:30e5 PersistLevel
00:3171 SetProgress.wvr_u7 00:30f3 DrawSpeedMain
00:317d SetProgress.wvr_u8 00:3143 DrawSpeedSettings
00:318b SetProgress.wvr_u9 00:3193 TimeInit
00:3197 SetProgress.wvr_u10 00:31b3 StartCountdown
00:319f Main 00:31c1 ResetGameTime
00:31c8 Main.notgbc 00:31cc CheckTorikan
00:31ce Main.wvr_u1 00:31e3 CheckTorikan.failure
00:31f5 EventLoop 00:31e5 CheckTorikan.success
00:320b EventLoop.eventloopjumps 00:31e8 HandleTimers
00:3214 EventLoopPostHandler 00:320e HandleTimers.reduce
00:3216 EventLoopPostHandler.wvb_u2 00:321b HandleTimers.clock
00:3228 EventLoopPostHandler.vblankjumps 00:3235 HandleTimers.go
00:3231 LoadTitleTiles 00:3259 SetProgress
00:324f LoadGameplayTiles 00:3264 SetProgress.loop
00:3265 LoadGameplayTiles.gbc 00:3268 SetProgress.correct
00:3274 LoadGameplayTiles.dmg 00:328f SetProgress.wvr_u1
00:3283 sFramesToCS 00:329b SetProgress.wvr_u2
00:32bf UnsafeMemCopy 00:32a9 SetProgress.wvr_u3
00:32c8 SafeMemCopy.wvr_u1 00:32b5 SetProgress.wvr_u4
00:32c8 SafeMemCopy 00:32c3 SetProgress.wvr_u5
00:32d7 UnsafeMemSet 00:32cf SetProgress.wvr_u6
00:32df SafeMemSet 00:32dd SetProgress.wvr_u7
00:32df SafeMemSet.wvr_u2 00:32e9 SetProgress.wvr_u8
00:32ed SwitchToGameplay 00:32f7 SetProgress.wvr_u9
00:32f6 SwitchToGameplayBig 00:3303 SetProgress.wvr_u10
00:32ff GamePlayEventLoopHandler 00:330b Main
00:3309 GamePlayBigEventLoopHandler 00:3334 Main.notgbc
00:3313 EnableScreenSquish 00:333a Main.wvr_u1
00:332d DisableScreenSquish 00:3361 EventLoop
00:3338 CopyOAMHandler 00:3377 EventLoop.eventloopjumps
00:3344 ClearOAM 00:3380 EventLoopPostHandler
00:335a BankingInit 00:3382 EventLoopPostHandler.wvb_u2
00:3369 OAMDMA 00:3394 EventLoopPostHandler.vblankjumps
00:3373 OAMDMAEnd 00:339d LoadTitleTiles
00:33bb LoadGameplayTiles
00:33d1 LoadGameplayTiles.gbc
00:33e0 LoadGameplayTiles.dmg
00:33ef sFramesToCS
00:342b UnsafeMemCopy
00:3434 SafeMemCopy.wvr_u1
00:3434 SafeMemCopy
00:3443 UnsafeMemSet
00:344b SafeMemSet
00:344b SafeMemSet.wvr_u2
00:3459 SwitchToGameplay
00:3462 SwitchToGameplayBig
00:346b GamePlayEventLoopHandler
00:3475 GamePlayBigEventLoopHandler
00:347f EnableScreenSquish
00:3499 DisableScreenSquish
00:34a4 CopyOAMHandler
00:34b0 ClearOAM
00:34c6 BankingInit
00:34d5 OAMDMA
00:34df OAMDMAEnd
01:4008 sDMGTSpeedCurve 01:4008 sDMGTSpeedCurve
01:4203 sDMGTSpeedCurveEnd 01:4203 sDMGTSpeedCurveEnd
01:4205 sDMGTSpeedCurveSpecialData 01:4205 sDMGTSpeedCurveSpecialData
@ -580,13 +601,13 @@
04:4e51 SettingsHandleRight.curve 04:4e51 SettingsHandleRight.curve
04:4e6e SettingsHandleRight.hig 04:4e6e SettingsHandleRight.hig
04:4e85 DecrementLevel 04:4e85 DecrementLevel
04:4e9e IncrementLevel 04:4e9b IncrementLevel
04:4eb7 InitSpeedCurve 04:4eb1 InitSpeedCurve
04:4eca GetEnd 04:4ec0 GetEnd
04:4f01 GetStart 04:4ef7 GetStart
04:4f38 CheckLevelRange 04:4f2e CheckLevelRange
04:4f54 CheckLevelRange.notatend 04:4f47 CheckLevelRange.notatend
04:4f77 CheckLevelRange.notatstart 04:4f67 CheckLevelRange.notatstart
05:4008 FieldInit 05:4008 FieldInit
05:403e FieldClear 05:403e FieldClear
05:4049 ToBackupField 05:4049 ToBackupField
@ -2110,13 +2131,47 @@
06:6b4f sBigGameplayTileMapEnd 06:6b4f sBigGameplayTileMapEnd
06:6def sBigGameplayUngradedTileMapEnd 06:6def sBigGameplayUngradedTileMapEnd
00:a000 rCheck 00:a000 rCheck
00:a006 rSwapABState 00:a006 rLastProfile
00:a007 rRNGModeState 00:a007 rProfileName
00:a008 rRotModeState 00:a007 rProfileData
00:a009 rDropModeState 00:a00a rSwapABState
00:a00a rSpeedCurveState 00:a00b rRNGModeState
00:a00b rAlways20GState 00:a00c rRotModeState
00:a00c rSelectedStartLevel 00:a00d rDropModeState
00:a00e rSpeedCurveState
00:a00f rAlways20GState
00:a010 rSelectedStartLevel
00:a012 rUnused
00:a047 rProfileData0
00:a047 rProfileName0
00:a04a rSwapABState0
00:a04b rRNGModeState0
00:a04c rRotModeState0
00:a04d rDropModeState0
00:a04e rSpeedCurveState0
00:a04f rAlways20GState0
00:a050 rSelectedStartLevel0
00:a052 rUnused0
00:a087 rProfileData1
00:a087 rProfileName1
00:a08a rSwapABState1
00:a08b rRNGModeState1
00:a08c rRotModeState1
00:a08d rDropModeState1
00:a08e rSpeedCurveState1
00:a08f rAlways20GState1
00:a090 rSelectedStartLevel1
00:a092 rUnused1
00:a0c7 rProfileData2
00:a0c7 rProfileName2
00:a0ca rSwapABState2
00:a0cb rRNGModeState2
00:a0cc rRotModeState2
00:a0cd rDropModeState2
00:a0ce rSpeedCurveState2
00:a0cf rAlways20GState2
00:a0d0 rSelectedStartLevel2
00:a0d2 rUnused2
00:c000 wShadowTilemap 00:c000 wShadowTilemap
00:c400 wShadowTileAttrs 00:c400 wShadowTileAttrs
00:c800 wShadowOAM 00:c800 wShadowOAM
@ -2229,15 +2284,17 @@
00:cdc5 wFrames 00:cdc5 wFrames
00:cdc6 wCountDown 00:cdc6 wCountDown
00:cdc8 wCountDownZero 00:cdc8 wCountDownZero
00:cdc9 wBankBackup 00:cdc9 wSelected
00:cdcd wOuterReps 00:cdca wTitleMode
00:cdce wInnerReps 00:cdcb wProfileName
00:cdcf wTitlePal 00:cdce wBankBackup
00:cdd0 wRollLine 00:cdd2 wOuterReps
00:cdd1 wInStaffRoll 00:cdd3 wInnerReps
00:cdd2 wBigModeTransfered 00:cdd4 wTitlePal
00:cdd3 wSelected 00:cdd5 wRollLine
00:cdd4 wTitleMode 00:cdd6 wInStaffRoll
00:cdd7 wBigModeTransfered
00:cdd8 wTarget
00:ff80 hPieceDataBase 00:ff80 hPieceDataBase
00:ff82 hPieceDataBaseFast 00:ff82 hPieceDataBaseFast
00:ff84 hPieceDataOffset 00:ff84 hPieceDataOffset

Binary file not shown.

View File

@ -24,6 +24,11 @@ INCLUDE "globals.asm"
SECTION "Persistent Globals", SRAM SECTION "Persistent Globals", SRAM
rCheck:: ds 6 rCheck:: ds 6
rLastProfile:: ds 1
UNION
rProfileData:: ds 64
NEXTU
rProfileName:: ds 3
rSwapABState:: ds 1 rSwapABState:: ds 1
rRNGModeState:: ds 1 rRNGModeState:: ds 1
rRotModeState:: ds 1 rRotModeState:: ds 1
@ -31,6 +36,50 @@ rDropModeState:: ds 1
rSpeedCurveState:: ds 1 rSpeedCurveState:: ds 1
rAlways20GState:: ds 1 rAlways20GState:: ds 1
rSelectedStartLevel:: ds 2 rSelectedStartLevel:: ds 2
rUnused:: ds (64-11)
ENDU
UNION
rProfileData0:: ds 64
NEXTU
rProfileName0:: ds 3
rSwapABState0:: ds 1
rRNGModeState0:: ds 1
rRotModeState0:: ds 1
rDropModeState0:: ds 1
rSpeedCurveState0:: ds 1
rAlways20GState0:: ds 1
rSelectedStartLevel0:: ds 2
rUnused0:: ds (64-11)
ENDU
UNION
rProfileData1:: ds 64
NEXTU
rProfileName1:: ds 3
rSwapABState1:: ds 1
rRNGModeState1:: ds 1
rRotModeState1:: ds 1
rDropModeState1:: ds 1
rSpeedCurveState1:: ds 1
rAlways20GState1:: ds 1
rSelectedStartLevel1:: ds 2
rUnused1:: ds (64-11)
ENDU
UNION
rProfileData2:: ds 64
NEXTU
rProfileName2:: ds 3
rSwapABState2:: ds 1
rRNGModeState2:: ds 1
rRotModeState2:: ds 1
rDropModeState2:: ds 1
rSpeedCurveState2:: ds 1
rAlways20GState2:: ds 1
rSelectedStartLevel2:: ds 2
rUnused2:: ds (64-11)
ENDU
SECTION "SRAM Variables", WRAM0
wTarget:: ds 1
SECTION "SRAM Functions", ROM0 SECTION "SRAM Functions", ROM0
@ -38,23 +87,23 @@ SECTION "SRAM Functions", ROM0
; Restores it if so, otherwise initializes it. ; Restores it if so, otherwise initializes it.
RestoreSRAM:: RestoreSRAM::
ld a, [rCheck] ld a, [rCheck]
cp a, LOW(__UTC_YEAR__) cp a, "D"
jr nz, InitializeSRAM jp nz, InitializeSRAM
ld a, [rCheck+1] ld a, [rCheck+1]
cp a, __UTC_MONTH__ cp a, "M"
jr nz, InitializeSRAM jp nz, InitializeSRAM
ld a, [rCheck+2] ld a, [rCheck+2]
cp a, __UTC_DAY__ cp a, "G"
jr nz, InitializeSRAM jp nz, InitializeSRAM
ld a, [rCheck+3] ld a, [rCheck+3]
cp a, __UTC_HOUR__ cp a, "T"
jr nz, InitializeSRAM jp nz, InitializeSRAM
ld a, [rCheck+4] ld a, [rCheck+4]
cp a, __UTC_MINUTE__ cp a, 0
jr nz, InitializeSRAM jp nz, InitializeSRAM
ld a, [rCheck+5] ld a, [rCheck+5]
cp a, __UTC_SECOND__ cp a, 0
jr nz, InitializeSRAM jp nz, InitializeSRAM
; SRAM is initialized and for this build, so we can load the data. ; SRAM is initialized and for this build, so we can load the data.
ld a, [rSwapABState] ld a, [rSwapABState]
@ -69,30 +118,136 @@ RestoreSRAM::
ld [wSpeedCurveState], a ld [wSpeedCurveState], a
ld a, [rAlways20GState] ld a, [rAlways20GState]
ld [wAlways20GState], a ld [wAlways20GState], a
ld a, [rProfileName]
ld [wProfileName], a
ld a, [rProfileName+1]
ld [wProfileName+1], a
ld a, [rProfileName+2]
ld [wProfileName+2], a
; Restore the start level.
ld a, [rSelectedStartLevel] ld a, [rSelectedStartLevel]
ldh [hStartSpeed], a ld c, a
ld a, [rSelectedStartLevel+1] ld a, [rSelectedStartLevel+1]
ld b, a
ld b, BANK_OTHER
rst RSTSwitchBank
ld a, [rSpeedCurveState]
ld d, a
add a, d
add a, d
ld e, a
ld d, 0
ld hl, .jumps
add hl, de
ld de, SCURVE_ENTRY_SIZE
jp hl
.jumps
jp .dmgt
jp .tgm1
jp .tgm3
jp .deat
jp .shir
jp .chil
jp .myco
jp .fallback
.dmgt
ld hl, sDMGTSpeedCurve
jp .search
.tgm1
ld hl, sTGM1SpeedCurve
jp .search
.tgm3
ld hl, sTGM3SpeedCurve
jp .search
.deat
ld hl, sDEATSpeedCurve
jp .search
.shir
ld hl, sSHIRSpeedCurve
jp .search
.chil
ld hl, sCHILSpeedCurve
jp .search
.myco
ld hl, sMYCOSpeedCurve
jp .search
.search
; HL = Speed curve table
; BC = Start level
; DE = Speed curve entry size
ld a, [hl+]
cp a, c
jr nz, .notfound
ld a, [hl]
cp a, b
jr nz, .notfound
; Found it!
dec hl
ld a, l
ldh [hStartSpeed], a
ld a, h
ldh [hStartSpeed+1], a ldh [hStartSpeed+1], a
ret jp RSTRestoreBank
.notfound
dec hl
add hl, de
ld a, [hl]
cp a, $FF
jr nz, .search
.fallback
ld a, SCURVE_DMGT
ld [rSpeedCurveState], a
ld [wSpeedCurveState], a
ld hl, sDMGTSpeedCurve
ld a, l
ldh [hStartSpeed], a
ld a, h
ldh [hStartSpeed+1], a
xor a, a
ld [rSelectedStartLevel], a
ld [rSelectedStartLevel+1], a
jp RSTRestoreBank
; Initializes SRAM with default values. ; Initializes SRAM with default values.
InitializeSRAM: InitializeSRAM:
; Set the magic id. ; Set the magic id.
ld a, LOW(__UTC_YEAR__) ld a, "D"
ld [rCheck], a ld [rCheck], a
ld a, __UTC_MONTH__ ld a, "M"
ld [rCheck+1], a ld [rCheck+1], a
ld a, __UTC_DAY__ ld a, "G"
ld [rCheck+2], a ld [rCheck+2], a
ld a, __UTC_HOUR__ ld a, "T"
ld [rCheck+3], a ld [rCheck+3], a
ld a, __UTC_MINUTE__ ld a, 0
ld [rCheck+4], a ld [rCheck+4], a
ld a, __UTC_SECOND__ ld a, 0
ld [rCheck+5], a ld [rCheck+5], a
xor a, a
ld [rLastProfile], a
; Load defaults. ; Load defaults.
ld a, "P"
ld [rProfileName], a
ld [wProfileName], a
ld a, "R"
ld [rProfileName+1], a
ld [wProfileName+1], a
ld a, "0"
ld [rProfileName+2], a
ld [wProfileName+2], a
ld a, BUTTON_MODE_NORM ld a, BUTTON_MODE_NORM
ld [rSwapABState], a ld [rSwapABState], a
ld [wSwapABState], a ld [wSwapABState], a
@ -121,11 +276,95 @@ InitializeSRAM:
ld hl, sDMGTSpeedCurve ld hl, sDMGTSpeedCurve
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
xor a, a
ld [rSelectedStartLevel], a
ld [rSelectedStartLevel+1], a ld [rSelectedStartLevel+1], a
; Copy this profile to the other two.
ld hl, rProfileData0
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
ld hl, rProfileData1
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
ld hl, rProfileData2
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
ld a, "1"
ld [rProfileName1+2], a
ld a, "2"
ld [rProfileName2+2], a
ret ret
; Change to profile number in A.
ChangeProfile::
.backup
ld [wTarget], a
ld a, [rLastProfile]
cp a, 0
jr z, .first
cp a, 1
jr z, .second
cp a, 2
jr z, .third
ret
.first
ld hl, rProfileData0
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
jr .restore
.second
ld hl, rProfileData1
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
jr .restore
.third
ld hl, rProfileData2
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
jr .restore
.restore
ld a, [wTarget]
ld [rLastProfile], a
cp a, 0
jr z, .lfirst
cp a, 1
jr z, .lsecond
cp a, 2
jr z, .lthird
ret
.lfirst
ld hl, rProfileData
ld de, rProfileData0
ld bc, 64
jp UnsafeMemCopy
.lsecond
ld hl, rProfileData
ld de, rProfileData1
ld bc, 64
jp UnsafeMemCopy
.lthird
ld hl, rProfileData
ld de, rProfileData2
ld bc, 64
jp UnsafeMemCopy
ENDC ENDC

View File

@ -26,6 +26,7 @@ INCLUDE "res/title_data.inc"
SECTION "Title Variables", WRAM0 SECTION "Title Variables", WRAM0
wSelected:: ds 1 wSelected:: ds 1
wTitleMode:: ds 1 wTitleMode:: ds 1
wProfileName:: ds 3
SECTION "Title Function Trampolines", ROM0 SECTION "Title Function Trampolines", ROM0
@ -52,6 +53,15 @@ TitleVBlankHandler::
rst RSTRestoreBank rst RSTRestoreBank
jp EventLoop jp EventLoop
PersistLevel:
ld b, BANK_OTHER
rst RSTSwitchBank
ld a, [hl+]
ld [rSelectedStartLevel], a
ld a, [hl]
ld [rSelectedStartLevel+1], a
jp RSTRestoreBank
DrawSpeedMain: DrawSpeedMain:
ld b, BANK_OTHER ld b, BANK_OTHER
rst RSTSwitchBank rst RSTSwitchBank
@ -584,7 +594,7 @@ TitleVBlankHandlerB:
; PROFILE name. ; PROFILE name.
.profile .profile
ld de, sDisabled ld de, wProfileName
ld hl, TITLE_MAIN_PROFILE ld hl, TITLE_MAIN_PROFILE
ld bc, 3 ld bc, 3
call UnsafeMemCopy call UnsafeMemCopy
@ -1051,10 +1061,9 @@ 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 call PersistLevel
jp CheckLevelRange jp CheckLevelRange
@ -1069,10 +1078,9 @@ 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 call PersistLevel
jp CheckLevelRange jp CheckLevelRange
@ -1082,11 +1090,9 @@ InitSpeedCurve:
call GetStart call GetStart
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 PersistLevel
ret
; Gets the end of a speed curve. ; Gets the end of a speed curve.
@ -1163,11 +1169,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
call PersistLevel
.notatend .notatend
ld de, -SCURVE_ENTRY_SIZE ld de, -SCURVE_ENTRY_SIZE
@ -1186,11 +1191,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
call PersistLevel
.notatstart .notatstart
ret ret