ref: d554b997c590825f030bd1be71989653b16a2ae0
parent: ab7025a144605de609fed4ca67a281fb4cde8705
author: Remy Oukaour <remy.oukaour@gmail.com>
date: Sat Dec 9 19:18:29 EST 2017
Use correct WRAM labels for intro/title scenes Remove outdated WRAM alias comments
--- a/engine/billspc.asm
+++ b/engine/billspc.asm
@@ -1783,7 +1783,7 @@
call CopyNicknameToTemp
ld hl, PartyMonOT
call CopyOTNameToTemp
- ld hl, PartyMons ; wdcdf (aliases: PartyMon1, PartyMon1Species)
+ ld hl, PartyMon1
ld bc, PARTYMON_STRUCT_LENGTH
ld a, [CurPartyMon]
call AddNTimes
--- a/engine/breeding/egg.asm
+++ b/engine/breeding/egg.asm
@@ -234,7 +234,7 @@
callba SetEggMonCaughtData
callba TrainerRankings_EggsHatched
ld a, [CurPartyMon]
- ld hl, PartyMons ; wdcdf (aliases: PartyMon1, PartyMon1Species)
+ ld hl, PartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld a, [hl]
@@ -263,7 +263,7 @@
ld [wd26b], a
call GetBaseData
ld a, [CurPartyMon]
- ld hl, PartyMons ; wdcdf (aliases: PartyMon1, PartyMon1Species)
+ ld hl, PartyMon1
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
push hl
@@ -309,7 +309,7 @@
ld a, [PlayerID + 1]
ld [hl], a
ld a, [CurPartyMon]
- ld hl, PartyMonOT ; wddff (aliases: PartyMonOT)
+ ld hl, PartyMonOT
ld bc, NAME_LENGTH
call AddNTimes
ld d, h
--- a/engine/intro_menu.asm
+++ b/engine/intro_menu.asm
@@ -1051,7 +1051,7 @@
ld b, SCGB_DIPLOMA
call GetSGBLayout
call UpdateTimePals
- ld a, [wcf64]
+ ld a, [wIntroSceneFrameCounter]
cp $5
jr c, .ok
xor a
@@ -1191,7 +1191,7 @@
inc [hl]
; Start a timer
- ld hl, wcf65
+ ld hl, wTitleScreenTimer
ld de, 73 * 60 + 36
ld [hl], e
inc hl
@@ -1202,7 +1202,7 @@
TitleScreenMain: ; 6304
; Run the timer down.
- ld hl, wcf65
+ ld hl, wTitleScreenTimer
ld e, [hl]
inc hl
ld d, [hl]
@@ -1268,7 +1268,7 @@
ld a, 1
.done
- ld [wcf64], a
+ ld [wIntroSceneFrameCounter], a
; Return to the intro sequence.
ld hl, wJumptableIndex
@@ -1287,13 +1287,13 @@
ld hl, MusicFade
ld [hl], 8 ; 1 second
- ld hl, wcf65
+ ld hl, wTitleScreenTimer
inc [hl]
ret
.clock_reset
ld a, 4
- ld [wcf64], a
+ ld [wIntroSceneFrameCounter], a
; Return to the intro sequence.
ld hl, wJumptableIndex
@@ -1305,7 +1305,7 @@
; Wait until the music is done fading.
- ld hl, wcf65
+ ld hl, wTitleScreenTimer
inc [hl]
ld a, [MusicFade]
@@ -1313,7 +1313,7 @@
ret nz
ld a, 2
- ld [wcf64], a
+ ld [wIntroSceneFrameCounter], a
; Back to the intro.
ld hl, wJumptableIndex
@@ -1332,8 +1332,8 @@
; 639b
Function639b: ; unreferenced
- ; If bit 0 or 1 of [wcf65] is set, we don't need to be here.
- ld a, [wcf65]
+ ; If bit 0 or 1 of [wTitleScreenTimer] is set, we don't need to be here.
+ ld a, [wTitleScreenTimer]
and $3
ret nz
ld bc, SpriteAnim10
@@ -1345,8 +1345,8 @@
add hl, hl
ld de, Data63ca
add hl, de
- ; If bit 2 of [wcf65] is set, get the second dw; else, get the first dw
- ld a, [wcf65]
+ ; If bit 2 of [wTitleScreenTimer] is set, get the second dw; else, get the first dw
+ ld a, [wTitleScreenTimer]
and %00000100
srl a
srl a
--- a/engine/mon_icons.asm
+++ b/engine/mon_icons.asm
@@ -240,7 +240,7 @@
ld [CurIcon], a
xor a
call GetIconGFX
- ld d, 3 * 8 + 2
+ ld d, 3 * 8 + 2 ; depixel 3, 4, 2, 4
ld e, 4 * 8 + 4
ld a, SPRITE_ANIM_INDEX_PARTY_MON
call InitSpriteAnimStruct
--- a/engine/mysterygift.asm
+++ b/engine/mysterygift.asm
@@ -815,7 +815,7 @@
ld c, rRP % $100
ld d, $3d
call Function104dd1
- ld hl, hPrintNum2 ; $ffb4 (aliases: hMultiplicand)
+ ld hl, hPrintNum2
ld a, $5a
ld [hli], a
ld [hl], b
@@ -830,7 +830,7 @@
ld a, [hPrintNum6]
ld [hPrintNum3], a
push hl
- ld hl, hPrintNum2 ; $ffb4 (aliases: hMultiplicand)
+ ld hl, hPrintNum2
ld b, $2
call Function104ed6
ld hl, hMGStatusFlags
@@ -934,7 +934,7 @@
ld [hPrintNum6], a
push bc
push hl
- ld hl, hPrintNum2 ; $ffb4 (aliases: hMultiplicand)
+ ld hl, hPrintNum2
ld b, $2
call Function104faf
ld a, [hPrintNum3]
@@ -954,11 +954,11 @@
ld e, a
push hl
push de
- ld hl, hPrintNum2 ; $ffb4 (aliases: hMultiplicand)
+ ld hl, hPrintNum2
ld b, $2
call Function104faf
pop de
- ld hl, hPrintNum2 ; $ffb4 (aliases: hMultiplicand)
+ ld hl, hPrintNum2
ld a, [hli]
xor d
ld b, a
--- a/engine/phone.asm
+++ b/engine/phone.asm
@@ -203,7 +203,7 @@
GetAvailableCallers: ; 900de (24:40de)
callba CheckTime
ld a, c
- ld [EngineBuffer1], a ; wd03e (aliases: MenuItemsList, CurFruitTree, CurInput)
+ ld [EngineBuffer1], a
ld hl, EngineBuffer3
ld bc, 11
xor a
@@ -219,7 +219,7 @@
ld hl, PhoneContacts + PHONE_CONTACT_SCRIPT2_TIME
ld bc, PHONE_TABLE_WIDTH
call AddNTimes
- ld a, [EngineBuffer1] ; wd03e (aliases: MenuItemsList, CurFruitTree, CurInput)
+ ld a, [EngineBuffer1]
and [hl]
jr z, .not_good_for_call
ld bc, PHONE_CONTACT_MAP_GROUP - PHONE_CONTACT_SCRIPT2_TIME
--- a/engine/stats_screen.asm
+++ b/engine/stats_screen.asm
@@ -3,7 +3,7 @@
cp LINK_MOBILE
jr nz, StatsScreenInit
- ld a, [wBattleMode] ; wd22d (aliases: EnemyMonEnd)
+ ld a, [wBattleMode]
and a
jr z, StatsScreenInit
jr _MobileStatsScreenInit
@@ -377,7 +377,7 @@
call .PlaceHPBar
xor a
ld [hBGMapMode], a
- ld a, [CurBaseData] ; wd236 (aliases: BaseDexNo)
+ ld a, [CurBaseData]
ld [wd265], a
ld [CurSpecies], a
hlcoord 8, 0
@@ -401,7 +401,7 @@
hlcoord 9, 4
ld a, "/"
ld [hli], a
- ld a, [CurBaseData] ; wd236 (aliases: BaseDexNo)
+ ld a, [CurBaseData]
ld [wd265], a
call GetPokemonName
call PlaceString
@@ -487,7 +487,7 @@
ret
StatsScreen_LoadGFX: ; 4dfb6 (13:5fb6)
- ld a, [BaseDexNo] ; wd236 (aliases: BaseDexNo)
+ ld a, [BaseDexNo]
ld [wd265], a
ld [CurSpecies], a
xor a
@@ -891,7 +891,7 @@
.PartyMon: ; 4e2bf (13:62bf)
ld a, [CurPartyMon]
- ld hl, PartyMons ; wdcdf (aliases: PartyMon1, PartyMon1Species)
+ ld hl, PartyMon1
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld b, h
@@ -918,7 +918,7 @@
ret
.Tempmon: ; 4e2ed (13:62ed)
- ld bc, TempMonSpecies ; wd10e (aliases: TempMon)
+ ld bc, TempMonSpecies
jr .CheckEggFaintedFrzSlp ; utterly pointless
.CheckEggFaintedFrzSlp: ; 4e2f2 (13:62f2)
--- a/engine/title.asm
+++ b/engine/title.asm
@@ -10,10 +10,10 @@
; Reset timing variables
ld hl, wJumptableIndex
- ld [hli], a ; cf63 ; Scene?
- ld [hli], a ; cf64
- ld [hli], a ; cf65 ; Timer lo
- ld [hl], a ; cf66 ; Timer hi
+ ld [hli], a ; wJumptableIndex
+ ld [hli], a ; wIntroSceneFrameCounter
+ ld [hli], a ; wTitleScreenTimer
+ ld [hl], a ; wTitleScreenTimer + 1
; Turn LCD off
call DisableLCD
@@ -145,12 +145,12 @@
; Update palette colors
ld hl, TitleScreenPalettes
ld de, UnknBGPals
- ld bc, 4 * 32
+ ld bc, 16 palettes
call CopyBytes
ld hl, TitleScreenPalettes
ld de, BGPals
- ld bc, 4 * 32
+ ld bc, 16 palettes
call CopyBytes
; Restore WRAM bank
--- a/main.asm
+++ b/main.asm
@@ -492,7 +492,7 @@
db "@"
SetMemEvent: ; 1364f
- ld hl, EngineBuffer1 ; wd03e (aliases: MenuItemsList, CurFruitTree, CurInput)
+ ld hl, EngineBuffer1
ld a, [hli]
ld d, [hl]
ld e, a
@@ -4565,7 +4565,7 @@
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
ld a, [Buffer3]
- ld hl, PartyMons ; wdcdf (aliases: PartyMon1, PartyMon1Species)
+ ld hl, PartyMon1
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
pop de
--- a/misc/battle_tower_5c.asm
+++ b/misc/battle_tower_5c.asm
@@ -1361,7 +1361,7 @@
cp EGG
jr nz, .not_egg
push hl
- ld hl, PartyMonOT ; wddff (aliases: PartyMonOT)
+ ld hl, PartyMonOT
ld de, $6 ; NAME_LENGTH
ld a, b
and a