Fix potential bug on GBC.

This commit is contained in:
Hana Nova 2025-03-02 16:59:52 +01:00
parent d6c92fc8ac
commit 0fe90e24c2
5 changed files with 76 additions and 74 deletions

Binary file not shown.

View File

@ -1,5 +1,5 @@
SUMMARY: SUMMARY:
ROM0: 14729 bytes used / 1655 free ROM0: 14733 bytes used / 1651 free
ROMX: 110971 bytes used / 36485 free in 9 banks ROMX: 110971 bytes used / 36485 free in 9 banks
SRAM: 2951 bytes used / 5241 free in 1 bank SRAM: 2951 bytes used / 5241 free in 1 bank
WRAM0: 3927 bytes used / 169 free WRAM0: 3927 bytes used / 169 free
@ -503,49 +503,49 @@ ROM0 bank #0:
$37cd = SetProgress.wvr_u8 $37cd = SetProgress.wvr_u8
$37db = SetProgress.wvr_u9 $37db = SetProgress.wvr_u9
$37e7 = SetProgress.wvr_u10 $37e7 = SetProgress.wvr_u10
SECTION: $37ef-$3895 ($00a7 bytes) ["Code Entry Point"] SECTION: $37ef-$3899 ($00ab bytes) ["Code Entry Point"]
$37ef = Main $37ef = Main
$3818 = Main.notgbc $381c = Main.notgbc
$3827 = Main.wvr_u1 $382b = Main.wvr_u1
$3857 = EventLoop $385b = EventLoop
$3870 = EventLoop.eventloopjumps $3874 = EventLoop.eventloopjumps
$3879 = EventLoopPostHandler $387d = EventLoopPostHandler
$387b = EventLoopPostHandler.wvb_u2 $387f = EventLoopPostHandler.wvb_u2
$388d = EventLoopPostHandler.vblankjumps $3891 = EventLoopPostHandler.vblankjumps
SECTION: $3896-$38cb ($0036 bytes) ["Grading Functions Unbanked"] SECTION: $389a-$38cf ($0036 bytes) ["Grading Functions Unbanked"]
$3896 = GradeInit $389a = GradeInit
$389f = UpdateGrade $38a3 = UpdateGrade
$38a8 = DecayGradeProcess $38ac = DecayGradeProcess
$38b1 = DecayGradeDelay $38b5 = DecayGradeDelay
$38ba = TGM3REGRETHandler $38be = TGM3REGRETHandler
$38c3 = TGM3COOLHandler $38c7 = TGM3COOLHandler
SECTION: $38cc-$38f9 ($002e bytes) ["Memory Functions"] SECTION: $38d0-$38fd ($002e bytes) ["Memory Functions"]
$38cc = UnsafeMemCopy $38d0 = UnsafeMemCopy
$38d5 = SafeMemCopy $38d9 = SafeMemCopy
$38d5 = SafeMemCopy.wvr_u1 $38d9 = SafeMemCopy.wvr_u1
$38e4 = UnsafeMemSet $38e8 = UnsafeMemSet
$38ec = SafeMemSet.wvr_u2 $38f0 = SafeMemSet.wvr_u2
$38ec = SafeMemSet $38f0 = SafeMemSet
SECTION: $38fa-$391f ($0026 bytes) ["Gameplay Function Trampolines"] SECTION: $38fe-$3923 ($0026 bytes) ["Gameplay Function Trampolines"]
$38fa = SwitchToGameplay $38fe = SwitchToGameplay
$3903 = SwitchToGameplayBig $3907 = SwitchToGameplayBig
$390c = GamePlayEventLoopHandler $3910 = GamePlayEventLoopHandler
$3916 = GamePlayBigEventLoopHandler $391a = GamePlayBigEventLoopHandler
SECTION: $3920-$3944 ($0025 bytes) ["Interrupt Initialization Functions"] SECTION: $3924-$3948 ($0025 bytes) ["Interrupt Initialization Functions"]
$3920 = EnableScreenSquish $3924 = EnableScreenSquish
$393a = DisableScreenSquish $393e = DisableScreenSquish
SECTION: $3945-$3966 ($0022 bytes) ["OAM Functions"] SECTION: $3949-$396a ($0022 bytes) ["OAM Functions"]
$3945 = CopyOAMHandler $3949 = CopyOAMHandler
$3951 = ClearOAM $3955 = ClearOAM
SECTION: $3967-$3977 ($0011 bytes) ["Intro Effect Trampoline"] SECTION: $396b-$397b ($0011 bytes) ["Intro Effect Trampoline"]
$3967 = DoIntroEffect $396b = DoIntroEffect
SECTION: $3978-$3986 ($000f bytes) ["Banking Functions"] SECTION: $397c-$398a ($000f bytes) ["Banking Functions"]
$3978 = BankingInit $397c = BankingInit
SECTION: $3987-$3990 ($000a bytes) ["OAM DMA Code"] SECTION: $398b-$3994 ($000a bytes) ["OAM DMA Code"]
$3987 = OAMDMA $398b = OAMDMA
$3991 = OAMDMAEnd $3995 = OAMDMAEnd
EMPTY: $3991-$3fff ($066f bytes) EMPTY: $3995-$3fff ($066b bytes)
TOTAL EMPTY: $0677 bytes TOTAL EMPTY: $0673 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"]

Binary file not shown.

View File

@ -387,37 +387,37 @@
00:37db SetProgress.wvr_u9 00:37db SetProgress.wvr_u9
00:37e7 SetProgress.wvr_u10 00:37e7 SetProgress.wvr_u10
00:37ef Main 00:37ef Main
00:3818 Main.notgbc 00:381c Main.notgbc
00:3827 Main.wvr_u1 00:382b Main.wvr_u1
00:3857 EventLoop 00:385b EventLoop
00:3870 EventLoop.eventloopjumps 00:3874 EventLoop.eventloopjumps
00:3879 EventLoopPostHandler 00:387d EventLoopPostHandler
00:387b EventLoopPostHandler.wvb_u2 00:387f EventLoopPostHandler.wvb_u2
00:388d EventLoopPostHandler.vblankjumps 00:3891 EventLoopPostHandler.vblankjumps
00:3896 GradeInit 00:389a GradeInit
00:389f UpdateGrade 00:38a3 UpdateGrade
00:38a8 DecayGradeProcess 00:38ac DecayGradeProcess
00:38b1 DecayGradeDelay 00:38b5 DecayGradeDelay
00:38ba TGM3REGRETHandler 00:38be TGM3REGRETHandler
00:38c3 TGM3COOLHandler 00:38c7 TGM3COOLHandler
00:38cc UnsafeMemCopy 00:38d0 UnsafeMemCopy
00:38d5 SafeMemCopy 00:38d9 SafeMemCopy
00:38d5 SafeMemCopy.wvr_u1 00:38d9 SafeMemCopy.wvr_u1
00:38e4 UnsafeMemSet 00:38e8 UnsafeMemSet
00:38ec SafeMemSet 00:38f0 SafeMemSet
00:38ec SafeMemSet.wvr_u2 00:38f0 SafeMemSet.wvr_u2
00:38fa SwitchToGameplay 00:38fe SwitchToGameplay
00:3903 SwitchToGameplayBig 00:3907 SwitchToGameplayBig
00:390c GamePlayEventLoopHandler 00:3910 GamePlayEventLoopHandler
00:3916 GamePlayBigEventLoopHandler 00:391a GamePlayBigEventLoopHandler
00:3920 EnableScreenSquish 00:3924 EnableScreenSquish
00:393a DisableScreenSquish 00:393e DisableScreenSquish
00:3945 CopyOAMHandler 00:3949 CopyOAMHandler
00:3951 ClearOAM 00:3955 ClearOAM
00:3967 DoIntroEffect 00:396b DoIntroEffect
00:3978 BankingInit 00:397c BankingInit
00:3987 OAMDMA 00:398b OAMDMA
00:3991 OAMDMAEnd 00:3995 OAMDMAEnd
01:4008 sDMGTSpeedCurve 01:4008 sDMGTSpeedCurve
01:4203 sDMGTSpeedCurveEnd 01:4203 sDMGTSpeedCurveEnd
01:4205 sDMGTSpeedCurveSpecialData 01:4205 sDMGTSpeedCurveSpecialData

View File

@ -71,6 +71,8 @@ Main::
ld a, [wInitialA] ld a, [wInitialA]
cp a, $11 cp a, $11
jr nz, .notgbc jr nz, .notgbc
ld a, P1F_GET_NONE
ldh [rP1], a
ld a, KEY1F_PREPARE ld a, KEY1F_PREPARE
ldh [rKEY1], a ldh [rKEY1], a
stop stop