summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rwxr-xr-xengine/billspc.asm30
-rwxr-xr-xengine/link.asm14
-rw-r--r--engine/map_objects.asm4
-rwxr-xr-xengine/menu.asm2
-rw-r--r--engine/pokedex.asm2
-rwxr-xr-xengine/pokegear.asm4
-rw-r--r--engine/radio.asm2
-rw-r--r--engine/save.asm36
-rwxr-xr-xengine/startmenu.asm2
-rwxr-xr-xengine/stats_screen.asm13
-rwxr-xr-xengine/timeset.asm6
11 files changed, 57 insertions, 58 deletions
diff --git a/engine/billspc.asm b/engine/billspc.asm
index 3c8f7fc83..c94f5d50d 100755
--- a/engine/billspc.asm
+++ b/engine/billspc.asm
@@ -1159,10 +1159,10 @@ BillsPC_LoadMonStats: ; e2b6d (38:6b6d)
add [hl]
ld e, a
ld d, $0
- ld hl, wBillsPCPokemonList + 1
-rept 3
+ ld hl, wBillsPCPokemonList + 1 ; box number
+ add hl, de
+ add hl, de
add hl, de
-endr
ld a, [hl]
and a
jr z, .party
@@ -1274,9 +1274,9 @@ BillsPC_RefreshTextboxes: ; e2c2c (38:6c2c)
ld e, a
ld d, 0
ld hl, wBillsPCPokemonList
-rept 3
add hl, de
-endr
+ add hl, de
+ add hl, de
ld e, l
ld d, h
hlcoord 9, 4
@@ -1290,9 +1290,9 @@ endr
ld de, 2 * SCREEN_WIDTH
add hl, de
pop de
-rept 3
inc de
-endr
+ inc de
+ inc de
pop af
dec a
jr nz, .loop
@@ -1493,9 +1493,9 @@ BillsPC_GetSelectedPokemonSpecies: ; e2def (38:6def)
ld e, a
ld d, $0
ld hl, wBillsPCPokemonList
-rept 3
add hl, de
-endr
+ add hl, de
+ add hl, de
ld a, [hl]
ret
@@ -2055,10 +2055,10 @@ MovePKMNWitoutMail_InsertMon: ; e31e7
.PartyToBox: ; e3267
call .CopyFromParty
ld a, $1
- ld [wc2cd], a
+ ld [wGameLogicPaused], a
callba SaveGameData
xor a
- ld [wc2cd], a
+ ld [wGameLogicPaused], a
call .CopyToBox
ret
; e327d
@@ -2211,9 +2211,9 @@ GetBoxPointer: ; e3396 (38:7396)
ld c, b
ld b, 0
ld hl, .boxes
-rept 3
add hl, bc
-endr
+ add hl, bc
+ add hl, bc
ld a, [hli]
ld b, a
ld a, [hli]
@@ -2429,9 +2429,9 @@ GetBoxCount: ; e366c (38:766c)
ld c, a
ld b, 0
ld hl, .boxbanks
-rept 3
add hl, bc
-endr
+ add hl, bc
+ add hl, bc
ld a, [hli]
ld b, a
call GetSRAMBank
diff --git a/engine/link.asm b/engine/link.asm
index 6826d0993..03148abe7 100755
--- a/engine/link.asm
+++ b/engine/link.asm
@@ -495,7 +495,7 @@ LinkTimeout: ; 283b2
pop de
pop hl
bccoord 1, 14
- call PlaceWholeStringInBoxAtOnce
+ call PlaceHLTextAtBC
call RotateThreePalettesRight
call ClearScreen
ld b, SCGB_08
@@ -1255,7 +1255,7 @@ LinkTradeOTPartymonMenuLoop: ; 28835
jr z, .not_a_button
ld a, $1
ld [wd263], a
- callab Function50db9
+ callab LoadAddrsForLinkMonStatsScreen
ld hl, OTPartyMon1Species
callba LinkMonStatsScreen
jp LinkTradePartiesMenuMasterLoop
@@ -1448,7 +1448,7 @@ Function28926: ; 28926
ld [wMenuCursorY], a
ld a, $4
ld [wd263], a
- callab Function50db9
+ callab LoadAddrsForLinkMonStatsScreen
callba LinkMonStatsScreen
call Call_LoadTempTileMapToTileMap
hlcoord 6, 1
@@ -1490,7 +1490,7 @@ Function28926: ; 28926
callba Link_WaitBGMap
ld hl, .Text_CantTradeLastMon
bccoord 1, 14
- call PlaceWholeStringInBoxAtOnce
+ call PlaceHLTextAtBC
jr .cancel_trade
.abnormal
@@ -1512,7 +1512,7 @@ Function28926: ; 28926
callba Link_WaitBGMap
ld hl, .Text_Abnormal
bccoord 1, 14
- call PlaceWholeStringInBoxAtOnce
+ call PlaceHLTextAtBC
.cancel_trade
hlcoord 0, 12
@@ -1688,7 +1688,7 @@ LinkTrade: ; 28b87
call GetPokemonName
ld hl, UnknownText_0x28eb8
bccoord 1, 14
- call PlaceWholeStringInBoxAtOnce
+ call PlaceHLTextAtBC
call LoadStandardMenuDataHeader
hlcoord 10, 7
ld b, 3
@@ -2030,7 +2030,7 @@ LoadTradeScreenBorder: ; 28ef8
; 28eff
Function28eff: ; 28eff
- callba Function16d6a7
+ callba Function16d6a7 ; just a nested farcall; so wasteful
call SetPalettes
ret
; 28f09
diff --git a/engine/map_objects.asm b/engine/map_objects.asm
index 55ba12811..629e87fc7 100644
--- a/engine/map_objects.asm
+++ b/engine/map_objects.asm
@@ -137,7 +137,7 @@ Function437b: ; 437b
cp STEP_TYPE_SLEEP
ret z
.ok3
- ld hl, Pointers4b45
+ ld hl, StepTypesJumptable
rst JumpTable
ret
@@ -1084,7 +1084,7 @@ SetRandomStepDuration: ; 4b2d
ret
; 4b45
-Pointers4b45: ; 4b45
+StepTypesJumptable: ; 4b45
; These pointers use OBJECT_STEP_TYPE. See constants/sprite_constants.asm
dw ObjectMovementReset ; 00
dw MapObjectMovementPattern ; unused
diff --git a/engine/menu.asm b/engine/menu.asm
index fa16fb80a..11c5098e8 100755
--- a/engine/menu.asm
+++ b/engine/menu.asm
@@ -319,7 +319,7 @@ Function241d5: ; 241d5
ret c
ld c, 1
ld b, 3
- call Function10062d ; BUG: This function is in another bank.
+ call AdvanceMobileInactivityTimerAndCheckExpired ; BUG: This function is in another bank.
; Pointer in current bank (9) is bogus.
ret c
callba Function100337
diff --git a/engine/pokedex.asm b/engine/pokedex.asm
index 95536a970..4d8b22ef4 100644
--- a/engine/pokedex.asm
+++ b/engine/pokedex.asm
@@ -823,7 +823,7 @@ Pokedex_UpdateUnownMode: ; 405df (10:45df)
call DelayFrame
call Pokedex_CheckSGB
jr nz, .decompress
- callba Function1ddf26
+ callba LoadSGBPokedexGFX2
jr .done
.decompress
diff --git a/engine/pokegear.asm b/engine/pokegear.asm
index c2e73180a..d180ee875 100755
--- a/engine/pokegear.asm
+++ b/engine/pokegear.asm
@@ -516,7 +516,7 @@ Pokegear_UpdateClock: ; 90f86 (24:4f86)
callba PrintHoursMins
ld hl, .DayText
bccoord 6, 6
- call PlaceWholeStringInBoxAtOnce
+ call PlaceHLTextAtBC
ret
; 90fa8 (24:4fa8)
@@ -711,7 +711,7 @@ PokegearMap_UpdateLandmarkName: ; 910b4
push de
callba GetLandmarkName
pop de
- callba Function1de2c5
+ callba TownMap_ConvertLineBreakCharacters
hlcoord 8, 0
ld [hl], $34
ret
diff --git a/engine/radio.asm b/engine/radio.asm
index 678fc05d5..8e0286271 100644
--- a/engine/radio.asm
+++ b/engine/radio.asm
@@ -139,7 +139,7 @@ PrintRadioLine:
cp 2
jr nz, .print
bccoord 1, 16
- call PlaceWholeStringInBoxAtOnce
+ call PlaceHLTextAtBC
jr .skip
.print
call PrintTextBoxText
diff --git a/engine/save.asm b/engine/save.asm
index f2f3a79bd..71dde7a88 100644
--- a/engine/save.asm
+++ b/engine/save.asm
@@ -9,9 +9,9 @@ SaveMenu: ; 14a1a
jr nz, .refused
call AskOverwriteSaveFile
jr c, .refused
- call SetWRAMStateForSave
+ call PauseGameLogic
call _SavingDontTurnOffThePower
- call ClearWRAMStateAfterSave
+ call ResumeGameLogic
call ExitMenu
and a
ret
@@ -24,7 +24,7 @@ SaveMenu: ; 14a1a
ret
Function14a58: ; 14a58
- call SetWRAMStateForSave
+ call PauseGameLogic
callba StageRTCTimeForSave
callba BackupMysteryGift
call SavePokemonData
@@ -33,7 +33,7 @@ Function14a58: ; 14a58
call SaveBackupChecksum
callba BackupPartyMonMail
callba SaveRTC
- call ClearWRAMStateAfterSave
+ call ResumeGameLogic
ret
; 14a83
@@ -47,7 +47,7 @@ ChangeBoxSaveGame: ; 14a83 (5:4a83)
jr c, .refused
call AskOverwriteSaveFile
jr c, .refused
- call SetWRAMStateForSave
+ call PauseGameLogic
call SavingDontTurnOffThePower
call SaveBox
pop de
@@ -55,7 +55,7 @@ ChangeBoxSaveGame: ; 14a83 (5:4a83)
ld [wCurBox], a
call LoadBox
call SavedTheGame
- call ClearWRAMStateAfterSave
+ call ResumeGameLogic
and a
ret
.refused
@@ -65,9 +65,9 @@ ChangeBoxSaveGame: ; 14a83 (5:4a83)
Link_SaveGame: ; 14ab2
call AskOverwriteSaveFile
jr c, .refused
- call SetWRAMStateForSave
+ call PauseGameLogic
call _SavingDontTurnOffThePower
- call ClearWRAMStateAfterSave
+ call ResumeGameLogic
and a
.refused
@@ -75,19 +75,19 @@ Link_SaveGame: ; 14ab2
; 14ac2
MovePkmnWOMail_SaveGame: ; 14ac2
- call SetWRAMStateForSave
+ call PauseGameLogic
push de
call SaveBox
pop de
ld a, e
ld [wCurBox], a
call LoadBox
- call ClearWRAMStateAfterSave
+ call ResumeGameLogic
ret
; 14ad5
Function14ad5: ; 14ad5
- call SetWRAMStateForSave
+ call PauseGameLogic
push de
call SaveBox
pop de
@@ -111,7 +111,7 @@ Function14ad5: ; 14ad5
callba BackupMobileEventIndex
callba SaveRTC
call LoadBox
- call ClearWRAMStateAfterSave
+ call ResumeGameLogic
ld de, SFX_SAVE
call PlaySFX
ld c, 24
@@ -127,9 +127,9 @@ StartMovePkmnWOMail_SaveGame: ; 14b34
jr c, .refused
call AskOverwriteSaveFile
jr c, .refused
- call SetWRAMStateForSave
+ call PauseGameLogic
call _SavingDontTurnOffThePower
- call ClearWRAMStateAfterSave
+ call ResumeGameLogic
and a
ret
@@ -138,15 +138,15 @@ StartMovePkmnWOMail_SaveGame: ; 14b34
ret
; 14b54
-SetWRAMStateForSave: ; 14b54
+PauseGameLogic: ; 14b54
ld a, $1
- ld [wc2cd], a
+ ld [wGameLogicPaused], a
ret
; 14b5a
-ClearWRAMStateAfterSave: ; 14b5a
+ResumeGameLogic: ; 14b5a
xor a
- ld [wc2cd], a
+ ld [wGameLogicPaused], a
ret
; 14b5f
diff --git a/engine/startmenu.asm b/engine/startmenu.asm
index 7afeceff7..68ac65e12 100755
--- a/engine/startmenu.asm
+++ b/engine/startmenu.asm
@@ -1762,7 +1762,7 @@ SetUpMoveScreenBG: ; 13172
call ClearSprites
xor a
ld [hBGMapMode], a
- callba Functionfb571
+ callba LoadStatsScreenPageTilesGFX
callba ClearSpriteAnims2
ld a, [CurPartyMon]
ld e, a
diff --git a/engine/stats_screen.asm b/engine/stats_screen.asm
index 81ddda164..96f6a78ee 100755
--- a/engine/stats_screen.asm
+++ b/engine/stats_screen.asm
@@ -6,14 +6,14 @@ BattleStatsScreenInit: ; 4dc7b (13:5c7b)
ld a, [wBattleMode] ; wd22d (aliases: EnemyMonEnd)
and a
jr z, StatsScreenInit
- jr _BattleStatsScreenInit
+ jr _MobileStatsScreenInit
StatsScreenInit: ; 4dc8a
ld hl, StatsScreenMain
jr StatsScreenInit_gotaddress
-_BattleStatsScreenInit: ; 4dc8f
- ld hl, StatsScreenBattle
+_MobileStatsScreenInit: ; 4dc8f
+ ld hl, StatsScreenMobile
jr StatsScreenInit_gotaddress
StatsScreenInit_gotaddress: ; 4dc94
@@ -33,7 +33,7 @@ StatsScreenInit_gotaddress: ; 4dc94
call ClearBGPalettes
call ClearTileMap
call UpdateSprites
- callba Functionfb53e
+ callba StatsScreen_LoadFont
pop hl
call _hl_
call ClearBGPalettes
@@ -73,7 +73,7 @@ StatsScreenMain: ; 0x4dcd2
ret
; 0x4dcf7
-StatsScreenBattle: ; 4dcf7
+StatsScreenMobile: ; 4dcf7
xor a
ld [wJumptableIndex], a
; stupid interns
@@ -89,7 +89,7 @@ StatsScreenBattle: ; 4dcf7
ld hl, StatsScreenPointerTable
rst JumpTable
call StatsScreen_WaitAnim
- callba Function100dfd
+ callba MobileComms_CheckInactivityTimer
jr c, .exit
ld a, [wJumptableIndex]
bit 7, a
@@ -100,7 +100,6 @@ StatsScreenBattle: ; 4dcf7
; 4dd2a
StatsScreenPointerTable: ; 4dd2a
-
dw MonStatsInit ; regular pokémon
dw EggStatsInit ; egg
dw StatsScreenWaitCry
diff --git a/engine/timeset.asm b/engine/timeset.asm
index 65bd6aac9..b21e62ea1 100755
--- a/engine/timeset.asm
+++ b/engine/timeset.asm
@@ -577,7 +577,7 @@ Special_InitialSetDSTFlag: ; 90a54
lb bc, 3, 18
call ClearBox
ld hl, .Text
- call PlaceWholeStringInBoxAtOnce
+ call PlaceHLTextAtBC
ret
; 90a6c
@@ -608,7 +608,7 @@ Special_InitialClearDSTFlag: ; 90a88
lb bc, 3, 18
call ClearBox
ld hl, .Text
- call PlaceWholeStringInBoxAtOnce
+ call PlaceHLTextAtBC
ret
; 90aa0
@@ -636,7 +636,7 @@ DebugDisplayTime: ; 90abc
lb bc, 3, SCREEN_WIDTH - 2
call ClearBox
ld hl, .Text
- call PlaceWholeStringInBoxAtOnce
+ call PlaceHLTextAtBC
ret
; 90acc