Improve some innacurate function names, labels, and comments (#1078)

[https://github.com/pret/pokecrystal/issues/1078#issuecomment-1872396250]
This commit is contained in:
xCrystal 2024-01-07 13:27:26 +01:00 committed by mid-kid
parent c0812ca008
commit aac0d97362
11 changed files with 57 additions and 57 deletions

View File

@ -22,7 +22,7 @@ DEF AUTO_INPUT EQU $ff
const WILDMON ; 4
; wGameTimerPaused::
DEF GAME_TIMER_PAUSED_F EQU 0
DEF GAME_TIMER_COUNTING_F EQU 0
; wJoypadDisable::
DEF JOYPAD_DISABLE_MON_FAINT_F EQU 6

View File

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

View File

@ -1343,7 +1343,7 @@ RockSmashScript:
playsound SFX_STRENGTH
earthquake 84
applymovementlasttalked MovementData_RockSmash
disappear -2
disappear LAST_TALKED
callasm RockMonEncounter
readmem wTempWildMonSpecies

View File

@ -345,7 +345,7 @@ FinishContinueFunction:
xor a
ld [wDontPlayMapMusicOnReload], a
ld hl, wGameTimerPaused
set GAME_TIMER_PAUSED_F, [hl]
set GAME_TIMER_COUNTING_F, [hl]
farcall OverworldLoop
ld a, [wSpawnAfterChampion]
cp SPAWN_RED

View File

@ -29,7 +29,7 @@ MainMenu:
ld b, SCGB_DIPLOMA
call GetSGBLayout
ld hl, wGameTimerPaused
res GAME_TIMER_PAUSED_F, [hl]
res GAME_TIMER_COUNTING_F, [hl]
call MainMenu_GetWhichMenu
ld [wWhichIndexSet], a
call MainMenu_PrintCurrentTimeAndDay

View File

@ -22,76 +22,76 @@ OverworldLoop::
DisableEvents:
xor a
ld [wScriptFlags2], a
ld [wEnabledPlayerEvents], a
ret
EnableEvents::
ld a, $ff
ld [wScriptFlags2], a
ld [wEnabledPlayerEvents], a
ret
CheckBit5_ScriptFlags2:
ld hl, wScriptFlags2
CheckEnabledMapEventsBit5:
ld hl, wEnabledPlayerEvents
bit 5, [hl]
ret
DisableWarpsConnxns: ; unreferenced
ld hl, wScriptFlags2
DisableWarpsConnections: ; unreferenced
ld hl, wEnabledPlayerEvents
res 2, [hl]
ret
DisableCoordEvents: ; unreferenced
ld hl, wScriptFlags2
ld hl, wEnabledPlayerEvents
res 1, [hl]
ret
DisableStepCount: ; unreferenced
ld hl, wScriptFlags2
ld hl, wEnabledPlayerEvents
res 0, [hl]
ret
DisableWildEncounters: ; unreferenced
ld hl, wScriptFlags2
ld hl, wEnabledPlayerEvents
res 4, [hl]
ret
EnableWarpsConnxns: ; unreferenced
ld hl, wScriptFlags2
EnableWarpsConnections: ; unreferenced
ld hl, wEnabledPlayerEvents
set 2, [hl]
ret
EnableCoordEvents: ; unreferenced
ld hl, wScriptFlags2
ld hl, wEnabledPlayerEvents
set 1, [hl]
ret
EnableStepCount: ; unreferenced
ld hl, wScriptFlags2
ld hl, wEnabledPlayerEvents
set 0, [hl]
ret
EnableWildEncounters:
ld hl, wScriptFlags2
ld hl, wEnabledPlayerEvents
set 4, [hl]
ret
CheckWarpConnxnScriptFlag:
ld hl, wScriptFlags2
CheckWarpConnectionsEnabled:
ld hl, wEnabledPlayerEvents
bit 2, [hl]
ret
CheckCoordEventScriptFlag:
ld hl, wScriptFlags2
CheckCoordEventsEnabled:
ld hl, wEnabledPlayerEvents
bit 1, [hl]
ret
CheckStepCountScriptFlag:
ld hl, wScriptFlags2
CheckStepCountEnabled:
ld hl, wEnabledPlayerEvents
bit 0, [hl]
ret
CheckWildEncountersScriptFlag:
ld hl, wScriptFlags2
CheckWildEncountersEnabled:
ld hl, wEnabledPlayerEvents
bit 4, [hl]
ret
@ -242,9 +242,9 @@ PlayerEvents:
and a
ret nz
call Dummy_CheckScriptFlags2Bit5 ; This is a waste of time
call Dummy_CheckEnabledMapEventsBit5 ; This is a waste of time
call CheckTrainerBattle_GetPlayerEvent
call CheckTrainerEvent
jr c, .ok
call CheckTileEvent
@ -275,7 +275,7 @@ PlayerEvents:
scf
ret
CheckTrainerBattle_GetPlayerEvent:
CheckTrainerEvent:
nop
nop
call CheckTrainerBattle
@ -292,7 +292,7 @@ CheckTrainerBattle_GetPlayerEvent:
CheckTileEvent:
; Check for warps, coord events, or wild battles.
call CheckWarpConnxnScriptFlag
call CheckWarpConnectionsEnabled
jr z, .connections_disabled
call CheckMovingOffEdgeOfMap
@ -302,21 +302,21 @@ CheckTileEvent:
jr c, .warp_tile
.connections_disabled
call CheckCoordEventScriptFlag
call CheckCoordEventsEnabled
jr z, .coord_events_disabled
call CheckCurrentMapCoordEvents
jr c, .coord_event
.coord_events_disabled
call CheckStepCountScriptFlag
call CheckStepCountEnabled
jr z, .step_count_disabled
call CountStep
ret c
.step_count_disabled
call CheckWildEncountersScriptFlag
call CheckWildEncountersEnabled
jr z, .ok
call RandomEncounter
@ -379,8 +379,8 @@ SetMinTwoStepWildEncounterCooldown:
ld [wWildEncounterCooldown], a
ret
Dummy_CheckScriptFlags2Bit5:
call CheckBit5_ScriptFlags2
Dummy_CheckEnabledMapEventsBit5:
call CheckEnabledMapEventsBit5
ret z
call SetXYCompareFlags
ret
@ -1047,7 +1047,7 @@ RunMemScript::
pop af
ret
LoadScriptBDE::
LoadMemScript::
; If there's already a script here, don't overwrite.
ld hl, wMapReentryScriptQueueFlag
ld a, [hl]
@ -1114,7 +1114,7 @@ TryTileCollisionEvent::
.done
call PlayClickSFX
ld a, $ff
ld a, PLAYEREVENT_MAPSCRIPT
scf
ret

View File

@ -1101,7 +1101,7 @@ Script_reloadmapafterbattle:
jr z, .done
ld b, BANK(Script_SpecialBillCall)
ld de, Script_SpecialBillCall
farcall LoadScriptBDE
farcall LoadMemScript
.done
jp Script_reloadmap
@ -2206,10 +2206,10 @@ Script_endall:
Script_halloffame:
ld hl, wGameTimerPaused
res GAME_TIMER_PAUSED_F, [hl]
res GAME_TIMER_COUNTING_F, [hl]
farcall HallOfFame
ld hl, wGameTimerPaused
set GAME_TIMER_PAUSED_F, [hl]
set GAME_TIMER_COUNTING_F, [hl]
jr ReturnFromCredits
Script_credits:

View File

@ -21,7 +21,7 @@ GameTimer::
; Is the timer paused?
ld hl, wGameTimerPaused
bit GAME_TIMER_PAUSED_F, [hl]
bit GAME_TIMER_COUNTING_F, [hl]
ret z
; Is the timer already capped?

View File

@ -550,12 +550,12 @@ GetDestinationWarpNumber::
ld a, [wPlayerMapX]
sub 4
ld d, a
ld a, [wCurMapWarpCount]
ld a, [wCurMapWarpEventCount]
and a
ret z
ld c, a
ld hl, wCurMapWarpsPointer
ld hl, wCurMapWarpEventsPointer
ld a, [hli]
ld h, [hl]
ld l, a
@ -588,7 +588,7 @@ GetDestinationWarpNumber::
call .IncreaseHLTwice
ret nc ; never encountered
ld a, [wCurMapWarpCount]
ld a, [wCurMapWarpEventCount]
inc a
sub c
ld c, a
@ -615,7 +615,7 @@ CopyWarpData::
.CopyWarpData:
push bc
ld hl, wCurMapWarpsPointer
ld hl, wCurMapWarpEventsPointer
ld a, [hli]
ld h, [hl]
ld l, a
@ -775,7 +775,7 @@ ReadMapEvents::
ld l, a
inc hl
inc hl
call ReadWarps
call ReadWarpEvents
call ReadCoordEvents
call ReadBGEvents
@ -885,14 +885,14 @@ ReadMapCallbacks::
call AddNTimes
ret
ReadWarps::
ReadWarpEvents::
ld a, [hli]
ld c, a
ld [wCurMapWarpCount], a
ld [wCurMapWarpEventCount], a
ld a, l
ld [wCurMapWarpsPointer], a
ld [wCurMapWarpEventsPointer], a
ld a, h
ld [wCurMapWarpsPointer + 1], a
ld [wCurMapWarpEventsPointer + 1], a
ld a, c
and a
ret z

View File

@ -56,11 +56,11 @@ HandleStoneQueue::
ret
.check_on_warp
ld hl, wCurMapWarpsPointer
ld hl, wCurMapWarpEventsPointer
ld a, [hli]
ld h, [hl]
ld l, a
ld a, [wCurMapWarpCount]
ld a, [wCurMapWarpEventCount]
and a
jr z, .nope2
@ -94,7 +94,7 @@ HandleStoneQueue::
.found_warp
pop af
ld d, a
ld a, [wCurMapWarpCount]
ld a, [wCurMapWarpEventCount]
sub d
inc a
scf

View File

@ -2215,7 +2215,7 @@ wScriptFlags::
; bit 3: run deferred script
db
ds 1
wScriptFlags2::
wEnabledPlayerEvents::
; bit 0: count steps
; bit 1: coord events
; bit 2: warps and connections
@ -2559,8 +2559,8 @@ wBikeFlags::
wCurMapSceneScriptPointer:: dw
wCurCaller:: dw
wCurMapWarpCount:: db
wCurMapWarpsPointer:: dw
wCurMapWarpEventCount:: db
wCurMapWarpEventsPointer:: dw
wCurMapCoordEventCount:: db
wCurMapCoordEventsPointer:: dw
wCurMapBGEventCount:: db