Improve some innacurate function names, labels, and comments (#1078)
[https://github.com/pret/pokecrystal/issues/1078#issuecomment-1872396250]
This commit is contained in:
@@ -22,8 +22,8 @@ DEF AUTO_INPUT EQU $ff
|
|||||||
const WILDMON ; 4
|
const WILDMON ; 4
|
||||||
|
|
||||||
; wGameTimerPaused::
|
; wGameTimerPaused::
|
||||||
DEF GAME_TIMER_PAUSED_F EQU 0
|
DEF GAME_TIMER_COUNTING_F EQU 0
|
||||||
DEF GAME_TIMER_MOBILE_F EQU 7
|
DEF GAME_TIMER_MOBILE_F EQU 7
|
||||||
|
|
||||||
; wJoypadDisable::
|
; wJoypadDisable::
|
||||||
DEF JOYPAD_DISABLE_MON_FAINT_F EQU 6
|
DEF JOYPAD_DISABLE_MON_FAINT_F EQU 6
|
||||||
|
@@ -20,7 +20,7 @@ MomTriesToBuySomething::
|
|||||||
ret nc
|
ret nc
|
||||||
ld b, BANK(.Script)
|
ld b, BANK(.Script)
|
||||||
ld de, .Script
|
ld de, .Script
|
||||||
farcall LoadScriptBDE
|
farcall LoadMemScript
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
@@ -1366,7 +1366,7 @@ RockSmashScript:
|
|||||||
playsound SFX_STRENGTH
|
playsound SFX_STRENGTH
|
||||||
earthquake 84
|
earthquake 84
|
||||||
applymovementlasttalked MovementData_RockSmash
|
applymovementlasttalked MovementData_RockSmash
|
||||||
disappear -2
|
disappear LAST_TALKED
|
||||||
|
|
||||||
callasm RockMonEncounter
|
callasm RockMonEncounter
|
||||||
readmem wTempWildMonSpecies
|
readmem wTempWildMonSpecies
|
||||||
|
@@ -462,7 +462,7 @@ FinishContinueFunction:
|
|||||||
ld [wDontPlayMapMusicOnReload], a
|
ld [wDontPlayMapMusicOnReload], a
|
||||||
ld [wLinkMode], a
|
ld [wLinkMode], a
|
||||||
ld hl, wGameTimerPaused
|
ld hl, wGameTimerPaused
|
||||||
set GAME_TIMER_PAUSED_F, [hl]
|
set GAME_TIMER_COUNTING_F, [hl]
|
||||||
res GAME_TIMER_MOBILE_F, [hl]
|
res GAME_TIMER_MOBILE_F, [hl]
|
||||||
ld hl, wEnteredMapFromContinue
|
ld hl, wEnteredMapFromContinue
|
||||||
set 1, [hl]
|
set 1, [hl]
|
||||||
|
@@ -32,7 +32,7 @@ MainMenu:
|
|||||||
call GetSGBLayout
|
call GetSGBLayout
|
||||||
call SetDefaultBGPAndOBP
|
call SetDefaultBGPAndOBP
|
||||||
ld hl, wGameTimerPaused
|
ld hl, wGameTimerPaused
|
||||||
res GAME_TIMER_PAUSED_F, [hl]
|
res GAME_TIMER_COUNTING_F, [hl]
|
||||||
call MainMenu_GetWhichMenu
|
call MainMenu_GetWhichMenu
|
||||||
ld [wWhichIndexSet], a
|
ld [wWhichIndexSet], a
|
||||||
call MainMenu_PrintCurrentTimeAndDay
|
call MainMenu_PrintCurrentTimeAndDay
|
||||||
|
@@ -22,76 +22,76 @@ OverworldLoop::
|
|||||||
|
|
||||||
DisableEvents:
|
DisableEvents:
|
||||||
xor a
|
xor a
|
||||||
ld [wScriptFlags2], a
|
ld [wEnabledPlayerEvents], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
EnableEvents::
|
EnableEvents::
|
||||||
ld a, $ff
|
ld a, $ff
|
||||||
ld [wScriptFlags2], a
|
ld [wEnabledPlayerEvents], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
CheckBit5_ScriptFlags2:
|
CheckEnabledMapEventsBit5:
|
||||||
ld hl, wScriptFlags2
|
ld hl, wEnabledPlayerEvents
|
||||||
bit 5, [hl]
|
bit 5, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
DisableWarpsConnxns: ; unreferenced
|
DisableWarpsConnections: ; unreferenced
|
||||||
ld hl, wScriptFlags2
|
ld hl, wEnabledPlayerEvents
|
||||||
res 2, [hl]
|
res 2, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
DisableCoordEvents: ; unreferenced
|
DisableCoordEvents: ; unreferenced
|
||||||
ld hl, wScriptFlags2
|
ld hl, wEnabledPlayerEvents
|
||||||
res 1, [hl]
|
res 1, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
DisableStepCount: ; unreferenced
|
DisableStepCount: ; unreferenced
|
||||||
ld hl, wScriptFlags2
|
ld hl, wEnabledPlayerEvents
|
||||||
res 0, [hl]
|
res 0, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
DisableWildEncounters: ; unreferenced
|
DisableWildEncounters: ; unreferenced
|
||||||
ld hl, wScriptFlags2
|
ld hl, wEnabledPlayerEvents
|
||||||
res 4, [hl]
|
res 4, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
EnableWarpsConnxns: ; unreferenced
|
EnableWarpsConnections: ; unreferenced
|
||||||
ld hl, wScriptFlags2
|
ld hl, wEnabledPlayerEvents
|
||||||
set 2, [hl]
|
set 2, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
EnableCoordEvents: ; unreferenced
|
EnableCoordEvents: ; unreferenced
|
||||||
ld hl, wScriptFlags2
|
ld hl, wEnabledPlayerEvents
|
||||||
set 1, [hl]
|
set 1, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
EnableStepCount: ; unreferenced
|
EnableStepCount: ; unreferenced
|
||||||
ld hl, wScriptFlags2
|
ld hl, wEnabledPlayerEvents
|
||||||
set 0, [hl]
|
set 0, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
EnableWildEncounters:
|
EnableWildEncounters:
|
||||||
ld hl, wScriptFlags2
|
ld hl, wEnabledPlayerEvents
|
||||||
set 4, [hl]
|
set 4, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
CheckWarpConnxnScriptFlag:
|
CheckWarpConnectionsEnabled:
|
||||||
ld hl, wScriptFlags2
|
ld hl, wEnabledPlayerEvents
|
||||||
bit 2, [hl]
|
bit 2, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
CheckCoordEventScriptFlag:
|
CheckCoordEventsEnabled:
|
||||||
ld hl, wScriptFlags2
|
ld hl, wEnabledPlayerEvents
|
||||||
bit 1, [hl]
|
bit 1, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
CheckStepCountScriptFlag:
|
CheckStepCountEnabled:
|
||||||
ld hl, wScriptFlags2
|
ld hl, wEnabledPlayerEvents
|
||||||
bit 0, [hl]
|
bit 0, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
CheckWildEncountersScriptFlag:
|
CheckWildEncountersEnabled:
|
||||||
ld hl, wScriptFlags2
|
ld hl, wEnabledPlayerEvents
|
||||||
bit 4, [hl]
|
bit 4, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@@ -245,9 +245,9 @@ PlayerEvents:
|
|||||||
and a
|
and a
|
||||||
ret nz
|
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
|
jr c, .ok
|
||||||
|
|
||||||
call CheckTileEvent
|
call CheckTileEvent
|
||||||
@@ -288,7 +288,7 @@ PlayerEvents:
|
|||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
|
|
||||||
CheckTrainerBattle_GetPlayerEvent:
|
CheckTrainerEvent:
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
call CheckTrainerBattle
|
call CheckTrainerBattle
|
||||||
@@ -305,7 +305,7 @@ CheckTrainerBattle_GetPlayerEvent:
|
|||||||
CheckTileEvent:
|
CheckTileEvent:
|
||||||
; Check for warps, coord events, or wild battles.
|
; Check for warps, coord events, or wild battles.
|
||||||
|
|
||||||
call CheckWarpConnxnScriptFlag
|
call CheckWarpConnectionsEnabled
|
||||||
jr z, .connections_disabled
|
jr z, .connections_disabled
|
||||||
|
|
||||||
farcall CheckMovingOffEdgeOfMap
|
farcall CheckMovingOffEdgeOfMap
|
||||||
@@ -315,21 +315,21 @@ CheckTileEvent:
|
|||||||
jr c, .warp_tile
|
jr c, .warp_tile
|
||||||
|
|
||||||
.connections_disabled
|
.connections_disabled
|
||||||
call CheckCoordEventScriptFlag
|
call CheckCoordEventsEnabled
|
||||||
jr z, .coord_events_disabled
|
jr z, .coord_events_disabled
|
||||||
|
|
||||||
call CheckCurrentMapCoordEvents
|
call CheckCurrentMapCoordEvents
|
||||||
jr c, .coord_event
|
jr c, .coord_event
|
||||||
|
|
||||||
.coord_events_disabled
|
.coord_events_disabled
|
||||||
call CheckStepCountScriptFlag
|
call CheckStepCountEnabled
|
||||||
jr z, .step_count_disabled
|
jr z, .step_count_disabled
|
||||||
|
|
||||||
call CountStep
|
call CountStep
|
||||||
ret c
|
ret c
|
||||||
|
|
||||||
.step_count_disabled
|
.step_count_disabled
|
||||||
call CheckWildEncountersScriptFlag
|
call CheckWildEncountersEnabled
|
||||||
jr z, .ok
|
jr z, .ok
|
||||||
|
|
||||||
call RandomEncounter
|
call RandomEncounter
|
||||||
@@ -392,8 +392,8 @@ SetMinTwoStepWildEncounterCooldown:
|
|||||||
ld [wWildEncounterCooldown], a
|
ld [wWildEncounterCooldown], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Dummy_CheckScriptFlags2Bit5:
|
Dummy_CheckEnabledMapEventsBit5:
|
||||||
call CheckBit5_ScriptFlags2
|
call CheckEnabledMapEventsBit5
|
||||||
ret z
|
ret z
|
||||||
call SetXYCompareFlags
|
call SetXYCompareFlags
|
||||||
ret
|
ret
|
||||||
@@ -1059,7 +1059,7 @@ RunMemScript::
|
|||||||
pop af
|
pop af
|
||||||
ret
|
ret
|
||||||
|
|
||||||
LoadScriptBDE::
|
LoadMemScript::
|
||||||
; If there's already a script here, don't overwrite.
|
; If there's already a script here, don't overwrite.
|
||||||
ld hl, wMapReentryScriptQueueFlag
|
ld hl, wMapReentryScriptQueueFlag
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
@@ -1126,7 +1126,7 @@ TryTileCollisionEvent::
|
|||||||
|
|
||||||
.done
|
.done
|
||||||
call PlayClickSFX
|
call PlayClickSFX
|
||||||
ld a, $ff
|
ld a, PLAYEREVENT_MAPSCRIPT
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
@@ -1195,7 +1195,7 @@ Script_reloadmapafterbattle:
|
|||||||
jr z, .done
|
jr z, .done
|
||||||
ld b, BANK(Script_SpecialBillCall)
|
ld b, BANK(Script_SpecialBillCall)
|
||||||
ld de, Script_SpecialBillCall
|
ld de, Script_SpecialBillCall
|
||||||
farcall LoadScriptBDE
|
farcall LoadMemScript
|
||||||
.done
|
.done
|
||||||
jp Script_reloadmap
|
jp Script_reloadmap
|
||||||
|
|
||||||
@@ -2316,12 +2316,12 @@ Script_endall:
|
|||||||
|
|
||||||
Script_halloffame:
|
Script_halloffame:
|
||||||
ld hl, wGameTimerPaused
|
ld hl, wGameTimerPaused
|
||||||
res GAME_TIMER_PAUSED_F, [hl]
|
res GAME_TIMER_COUNTING_F, [hl]
|
||||||
farcall StubbedTrainerRankings_HallOfFame
|
farcall StubbedTrainerRankings_HallOfFame
|
||||||
farcall StubbedTrainerRankings_HallOfFame2
|
farcall StubbedTrainerRankings_HallOfFame2
|
||||||
farcall HallOfFame
|
farcall HallOfFame
|
||||||
ld hl, wGameTimerPaused
|
ld hl, wGameTimerPaused
|
||||||
set GAME_TIMER_PAUSED_F, [hl]
|
set GAME_TIMER_COUNTING_F, [hl]
|
||||||
jr ReturnFromCredits
|
jr ReturnFromCredits
|
||||||
|
|
||||||
Script_credits:
|
Script_credits:
|
||||||
|
@@ -33,7 +33,7 @@ GameTimer::
|
|||||||
|
|
||||||
; Is the timer paused?
|
; Is the timer paused?
|
||||||
ld hl, wGameTimerPaused
|
ld hl, wGameTimerPaused
|
||||||
bit GAME_TIMER_PAUSED_F, [hl]
|
bit GAME_TIMER_COUNTING_F, [hl]
|
||||||
ret z
|
ret z
|
||||||
|
|
||||||
; Is the timer already capped?
|
; Is the timer already capped?
|
||||||
|
18
home/map.asm
18
home/map.asm
@@ -252,12 +252,12 @@ GetDestinationWarpNumber::
|
|||||||
ld a, [wPlayerMapX]
|
ld a, [wPlayerMapX]
|
||||||
sub 4
|
sub 4
|
||||||
ld d, a
|
ld d, a
|
||||||
ld a, [wCurMapWarpCount]
|
ld a, [wCurMapWarpEventCount]
|
||||||
and a
|
and a
|
||||||
ret z
|
ret z
|
||||||
|
|
||||||
ld c, a
|
ld c, a
|
||||||
ld hl, wCurMapWarpsPointer
|
ld hl, wCurMapWarpEventsPointer
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld h, [hl]
|
ld h, [hl]
|
||||||
ld l, a
|
ld l, a
|
||||||
@@ -290,7 +290,7 @@ GetDestinationWarpNumber::
|
|||||||
call .IncreaseHLTwice
|
call .IncreaseHLTwice
|
||||||
ret nc ; never encountered
|
ret nc ; never encountered
|
||||||
|
|
||||||
ld a, [wCurMapWarpCount]
|
ld a, [wCurMapWarpEventCount]
|
||||||
inc a
|
inc a
|
||||||
sub c
|
sub c
|
||||||
ld c, a
|
ld c, a
|
||||||
@@ -317,7 +317,7 @@ CopyWarpData::
|
|||||||
|
|
||||||
.CopyWarpData:
|
.CopyWarpData:
|
||||||
push bc
|
push bc
|
||||||
ld hl, wCurMapWarpsPointer
|
ld hl, wCurMapWarpEventsPointer
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld h, [hl]
|
ld h, [hl]
|
||||||
ld l, a
|
ld l, a
|
||||||
@@ -406,7 +406,7 @@ ReadMapEvents::
|
|||||||
ld l, a
|
ld l, a
|
||||||
inc hl
|
inc hl
|
||||||
inc hl
|
inc hl
|
||||||
call ReadWarps
|
call ReadWarpEvents
|
||||||
call ReadCoordEvents
|
call ReadCoordEvents
|
||||||
call ReadBGEvents
|
call ReadBGEvents
|
||||||
|
|
||||||
@@ -516,14 +516,14 @@ ReadMapCallbacks::
|
|||||||
call AddNTimes
|
call AddNTimes
|
||||||
ret
|
ret
|
||||||
|
|
||||||
ReadWarps::
|
ReadWarpEvents::
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld c, a
|
ld c, a
|
||||||
ld [wCurMapWarpCount], a
|
ld [wCurMapWarpEventCount], a
|
||||||
ld a, l
|
ld a, l
|
||||||
ld [wCurMapWarpsPointer], a
|
ld [wCurMapWarpEventsPointer], a
|
||||||
ld a, h
|
ld a, h
|
||||||
ld [wCurMapWarpsPointer + 1], a
|
ld [wCurMapWarpEventsPointer + 1], a
|
||||||
ld a, c
|
ld a, c
|
||||||
and a
|
and a
|
||||||
ret z
|
ret z
|
||||||
|
@@ -56,11 +56,11 @@ HandleStoneQueue::
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
.check_on_warp
|
.check_on_warp
|
||||||
ld hl, wCurMapWarpsPointer
|
ld hl, wCurMapWarpEventsPointer
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld h, [hl]
|
ld h, [hl]
|
||||||
ld l, a
|
ld l, a
|
||||||
ld a, [wCurMapWarpCount]
|
ld a, [wCurMapWarpEventCount]
|
||||||
and a
|
and a
|
||||||
jr z, .nope2
|
jr z, .nope2
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ HandleStoneQueue::
|
|||||||
.found_warp
|
.found_warp
|
||||||
pop af
|
pop af
|
||||||
ld d, a
|
ld d, a
|
||||||
ld a, [wCurMapWarpCount]
|
ld a, [wCurMapWarpEventCount]
|
||||||
sub d
|
sub d
|
||||||
inc a
|
inc a
|
||||||
scf
|
scf
|
||||||
|
@@ -2807,7 +2807,7 @@ wScriptFlags::
|
|||||||
; bit 3: run deferred script
|
; bit 3: run deferred script
|
||||||
db
|
db
|
||||||
ds 1
|
ds 1
|
||||||
wScriptFlags2::
|
wEnabledPlayerEvents::
|
||||||
; bit 0: count steps
|
; bit 0: count steps
|
||||||
; bit 1: coord events
|
; bit 1: coord events
|
||||||
; bit 2: warps and connections
|
; bit 2: warps and connections
|
||||||
@@ -3179,8 +3179,8 @@ wBikeFlags::
|
|||||||
wCurMapSceneScriptPointer:: dw
|
wCurMapSceneScriptPointer:: dw
|
||||||
|
|
||||||
wCurCaller:: dw
|
wCurCaller:: dw
|
||||||
wCurMapWarpCount:: db
|
wCurMapWarpEventCount:: db
|
||||||
wCurMapWarpsPointer:: dw
|
wCurMapWarpEventsPointer:: dw
|
||||||
wCurMapCoordEventCount:: db
|
wCurMapCoordEventCount:: db
|
||||||
wCurMapCoordEventsPointer:: dw
|
wCurMapCoordEventsPointer:: dw
|
||||||
wCurMapBGEventCount:: db
|
wCurMapBGEventCount:: db
|
||||||
|
Reference in New Issue
Block a user