Improve some innacurate function names, labels, and comments (#1078)
[https://github.com/pret/pokecrystal/issues/1078#issuecomment-1872396250]
This commit is contained in:
@@ -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
|
||||
DEF GAME_TIMER_MOBILE_F EQU 7
|
||||
|
||||
; wJoypadDisable::
|
||||
|
@@ -20,7 +20,7 @@ MomTriesToBuySomething::
|
||||
ret nc
|
||||
ld b, BANK(.Script)
|
||||
ld de, .Script
|
||||
farcall LoadScriptBDE
|
||||
farcall LoadMemScript
|
||||
scf
|
||||
ret
|
||||
|
||||
|
@@ -1366,7 +1366,7 @@ RockSmashScript:
|
||||
playsound SFX_STRENGTH
|
||||
earthquake 84
|
||||
applymovementlasttalked MovementData_RockSmash
|
||||
disappear -2
|
||||
disappear LAST_TALKED
|
||||
|
||||
callasm RockMonEncounter
|
||||
readmem wTempWildMonSpecies
|
||||
|
@@ -462,7 +462,7 @@ FinishContinueFunction:
|
||||
ld [wDontPlayMapMusicOnReload], a
|
||||
ld [wLinkMode], a
|
||||
ld hl, wGameTimerPaused
|
||||
set GAME_TIMER_PAUSED_F, [hl]
|
||||
set GAME_TIMER_COUNTING_F, [hl]
|
||||
res GAME_TIMER_MOBILE_F, [hl]
|
||||
ld hl, wEnteredMapFromContinue
|
||||
set 1, [hl]
|
||||
|
@@ -32,7 +32,7 @@ MainMenu:
|
||||
call GetSGBLayout
|
||||
call SetDefaultBGPAndOBP
|
||||
ld hl, wGameTimerPaused
|
||||
res GAME_TIMER_PAUSED_F, [hl]
|
||||
res GAME_TIMER_COUNTING_F, [hl]
|
||||
call MainMenu_GetWhichMenu
|
||||
ld [wWhichIndexSet], a
|
||||
call MainMenu_PrintCurrentTimeAndDay
|
||||
|
@@ -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
|
||||
|
||||
@@ -245,9 +245,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
|
||||
@@ -288,7 +288,7 @@ PlayerEvents:
|
||||
scf
|
||||
ret
|
||||
|
||||
CheckTrainerBattle_GetPlayerEvent:
|
||||
CheckTrainerEvent:
|
||||
nop
|
||||
nop
|
||||
call CheckTrainerBattle
|
||||
@@ -305,7 +305,7 @@ CheckTrainerBattle_GetPlayerEvent:
|
||||
CheckTileEvent:
|
||||
; Check for warps, coord events, or wild battles.
|
||||
|
||||
call CheckWarpConnxnScriptFlag
|
||||
call CheckWarpConnectionsEnabled
|
||||
jr z, .connections_disabled
|
||||
|
||||
farcall CheckMovingOffEdgeOfMap
|
||||
@@ -315,21 +315,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
|
||||
@@ -392,8 +392,8 @@ SetMinTwoStepWildEncounterCooldown:
|
||||
ld [wWildEncounterCooldown], a
|
||||
ret
|
||||
|
||||
Dummy_CheckScriptFlags2Bit5:
|
||||
call CheckBit5_ScriptFlags2
|
||||
Dummy_CheckEnabledMapEventsBit5:
|
||||
call CheckEnabledMapEventsBit5
|
||||
ret z
|
||||
call SetXYCompareFlags
|
||||
ret
|
||||
@@ -1059,7 +1059,7 @@ RunMemScript::
|
||||
pop af
|
||||
ret
|
||||
|
||||
LoadScriptBDE::
|
||||
LoadMemScript::
|
||||
; If there's already a script here, don't overwrite.
|
||||
ld hl, wMapReentryScriptQueueFlag
|
||||
ld a, [hl]
|
||||
@@ -1126,7 +1126,7 @@ TryTileCollisionEvent::
|
||||
|
||||
.done
|
||||
call PlayClickSFX
|
||||
ld a, $ff
|
||||
ld a, PLAYEREVENT_MAPSCRIPT
|
||||
scf
|
||||
ret
|
||||
|
||||
|
@@ -1195,7 +1195,7 @@ Script_reloadmapafterbattle:
|
||||
jr z, .done
|
||||
ld b, BANK(Script_SpecialBillCall)
|
||||
ld de, Script_SpecialBillCall
|
||||
farcall LoadScriptBDE
|
||||
farcall LoadMemScript
|
||||
.done
|
||||
jp Script_reloadmap
|
||||
|
||||
@@ -2316,12 +2316,12 @@ Script_endall:
|
||||
|
||||
Script_halloffame:
|
||||
ld hl, wGameTimerPaused
|
||||
res GAME_TIMER_PAUSED_F, [hl]
|
||||
res GAME_TIMER_COUNTING_F, [hl]
|
||||
farcall StubbedTrainerRankings_HallOfFame
|
||||
farcall StubbedTrainerRankings_HallOfFame2
|
||||
farcall HallOfFame
|
||||
ld hl, wGameTimerPaused
|
||||
set GAME_TIMER_PAUSED_F, [hl]
|
||||
set GAME_TIMER_COUNTING_F, [hl]
|
||||
jr ReturnFromCredits
|
||||
|
||||
Script_credits:
|
||||
|
@@ -33,7 +33,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?
|
||||
|
18
home/map.asm
18
home/map.asm
@@ -252,12 +252,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
|
||||
@@ -290,7 +290,7 @@ GetDestinationWarpNumber::
|
||||
call .IncreaseHLTwice
|
||||
ret nc ; never encountered
|
||||
|
||||
ld a, [wCurMapWarpCount]
|
||||
ld a, [wCurMapWarpEventCount]
|
||||
inc a
|
||||
sub c
|
||||
ld c, a
|
||||
@@ -317,7 +317,7 @@ CopyWarpData::
|
||||
|
||||
.CopyWarpData:
|
||||
push bc
|
||||
ld hl, wCurMapWarpsPointer
|
||||
ld hl, wCurMapWarpEventsPointer
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
@@ -406,7 +406,7 @@ ReadMapEvents::
|
||||
ld l, a
|
||||
inc hl
|
||||
inc hl
|
||||
call ReadWarps
|
||||
call ReadWarpEvents
|
||||
call ReadCoordEvents
|
||||
call ReadBGEvents
|
||||
|
||||
@@ -516,14 +516,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
|
||||
|
@@ -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
|
||||
|
@@ -2807,7 +2807,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
|
||||
@@ -3179,8 +3179,8 @@ wBikeFlags::
|
||||
wCurMapSceneScriptPointer:: dw
|
||||
|
||||
wCurCaller:: dw
|
||||
wCurMapWarpCount:: db
|
||||
wCurMapWarpsPointer:: dw
|
||||
wCurMapWarpEventCount:: db
|
||||
wCurMapWarpEventsPointer:: dw
|
||||
wCurMapCoordEventCount:: db
|
||||
wCurMapCoordEventsPointer:: dw
|
||||
wCurMapBGEventCount:: db
|
||||
|
Reference in New Issue
Block a user