Documentation (Overworld loop)

This commit is contained in:
xCrystal
2023-09-15 20:04:16 +02:00
parent 674e838460
commit c11c53e0d7
5 changed files with 278 additions and 28 deletions

View File

@@ -20,7 +20,7 @@ MomTriesToBuySomething::
ret nc
ld b, BANK(.Script)
ld de, .Script
farcall LoadScriptBDE
farcall LoadMemScript
scf
ret

View File

@@ -30,7 +30,7 @@ EnableEvents::
ld [wScriptFlags2], a
ret
CheckBit5_ScriptFlags2:
CheckBit5_ScriptFlags2: ; unreferenced
ld hl, wScriptFlags2
bit 5, [hl]
ret
@@ -132,15 +132,10 @@ EnterMap:
ld [wMapStatus], a
ret
UnusedWait30Frames: ; unreferenced
ld c, 30
call DelayFrames
ret
HandleMap:
call ResetOverworldDelay
call HandleMapTimeAndJoypad
farcall HandleCmdQueue ; no need to farcall
call HandleCmdQueue
call MapEvents
; Not immediately entering a connected map will cause problems.
@@ -275,8 +270,6 @@ PlayerEvents:
ret
CheckTrainerBattle_GetPlayerEvent:
nop
nop
call CheckTrainerBattle
jr nc, .nope
@@ -320,7 +313,6 @@ CheckTileEvent:
call RandomEncounter
ret c
jr .ok ; pointless
.ok
xor a
@@ -368,9 +360,7 @@ SetUpFiveStepWildEncounterCooldown:
ld [wWildEncounterCooldown], a
ret
SetMinTwoStepWildEncounterCooldown:
; dummied out
ret
SetMinTwoStepWildEncounterCooldown: ; unreferenced
ld a, [wWildEncounterCooldown]
cp 2
ret nc
@@ -752,7 +742,6 @@ PlayerMovementPointers:
ret
.jump:
call SetMinTwoStepWildEncounterCooldown
xor a
ld c, a
ret
@@ -967,9 +956,6 @@ PlayerEventScriptPointers:
InvalidEventScript:
end
UnusedPlayerEventScript: ; unreferenced
end
HatchEggScript:
callasm OverworldHatchEgg
end
@@ -1033,7 +1019,7 @@ RunMemScript::
pop af
ret
LoadScriptBDE::
LoadMemScript::
; If there's already a script here, don't overwrite.
ld hl, wMapReentryScriptQueueFlag
ld a, [hl]

View File

@@ -309,10 +309,6 @@ DoPlayerMovement::
scf
ret
.unused ; unreferenced
xor a
ret
.bump
xor a
ret

View File

@@ -1198,7 +1198,7 @@ Script_reloadmapafterbattle:
jr z, .done
ld b, BANK(Script_SpecialBillCall)
ld de, Script_SpecialBillCall
farcall LoadScriptBDE
farcall LoadMemScript
.done
jp Script_reloadmap
@@ -2266,8 +2266,6 @@ Script_end:
Script_endcallback:
call ExitScriptSubroutine
jr c, .dummy
.dummy
ld hl, wScriptFlags
res 0, [hl]
call StopScript