aboutsummaryrefslogtreecommitdiffstats
path: root/home
diff options
context:
space:
mode:
authorNarishma-gb <194818981+Narishma-gb@users.noreply.github.com>2025-09-03 17:56:09 +0200
committerGitHub <noreply@github.com>2025-09-03 11:56:09 -0400
commit4d2594cb24b7e67cde4e1373c9a2b5e0ae7ff473 (patch)
tree5bd4fce0a314171b46b3962a5db5df6eb5154ee2 /home
parentDocument where badge and elevator floor "items" are used (diff)
downloadpokeyellow-4d2594cb24b7e67cde4e1373c9a2b5e0ae7ff473.tar.gz
pokeyellow-4d2594cb24b7e67cde4e1373c9a2b5e0ae7ff473.tar.xz
pokeyellow-4d2594cb24b7e67cde4e1373c9a2b5e0ae7ff473.zip
Label and constant cleanup (#528)
* Label cleanup, add some constants instead of raw numbers * Rename load/save game functions to be more explicit
Diffstat (limited to 'home')
-rw-r--r--home/init.asm13
-rw-r--r--home/map_objects.asm10
-rw-r--r--home/overworld.asm2
-rw-r--r--home/text_script.asm4
-rw-r--r--home/vcopy.asm4
5 files changed, 10 insertions, 23 deletions
diff --git a/home/init.asm b/home/init.asm
index 67fa3ab1..2ed200b4 100644
--- a/home/init.asm
+++ b/home/init.asm
@@ -7,17 +7,6 @@ SoftReset::
Init::
; Program init.
-
-; * LCD enabled
-; * Window tile map at $9C00
-; * Window display enabled
-; * BG and window tile data at $8800
-; * BG tile map at $9800
-; * 8x8 OBJ size
-; * OBJ display enabled
-; * BG display enabled
-DEF LCDC_DEFAULT EQU LCDC_ON | LCDC_WIN_9C00 | LCDC_WIN_ON | LCDC_BLOCK21 | LCDC_BG_9800 | LCDC_OBJ_8 | LCDC_OBJ_ON | LCDC_BG_ON
-
di
xor a
@@ -100,7 +89,7 @@ DEF LCDC_DEFAULT EQU LCDC_ON | LCDC_WIN_9C00 | LCDC_WIN_ON | LCDC_BLOCK21 | LCDC
ld a, BANK(SFX_Shooting_Star)
ld [wAudioROMBank], a
ld [wAudioSavedROMBank], a
- ld a, $9c
+ ld a, HIGH(vBGMap1)
ldh [hAutoBGTransferDest + 1], a
xor a
ldh [hAutoBGTransferDest], a
diff --git a/home/map_objects.asm b/home/map_objects.asm
index e0d9b6a5..44b012e6 100644
--- a/home/map_objects.asm
+++ b/home/map_objects.asm
@@ -30,27 +30,25 @@ TextScript_ItemStoragePC::
call SaveScreenTilesToBuffer2
ld b, BANK(PlayerPC)
ld hl, PlayerPC
- jr bankswitchAndContinue
+ jr BankswitchAndContinue
TextScript_BillsPC::
call SaveScreenTilesToBuffer2
ld b, BANK(BillsPC_)
ld hl, BillsPC_
- jr bankswitchAndContinue
+ jr BankswitchAndContinue
TextScript_GameCornerPrizeMenu::
-; XXX find a better name for this function
-; special_F7
ld b, BANK(CeladonPrizeMenu)
ld hl, CeladonPrizeMenu
-bankswitchAndContinue::
+BankswitchAndContinue::
call Bankswitch
jp HoldTextDisplayOpen ; continue to main text-engine function
TextScript_PokemonCenterPC::
ld b, BANK(ActivatePC)
ld hl, ActivatePC
- jr bankswitchAndContinue
+ jr BankswitchAndContinue
StartSimulatingJoypadStates::
xor a
diff --git a/home/overworld.asm b/home/overworld.asm
index 8c79d6e7..5af527c0 100644
--- a/home/overworld.asm
+++ b/home/overworld.asm
@@ -114,7 +114,7 @@ OverworldLoopLessDelay::
ld [wEnteringCableClub], a
jr z, .changeMap
; XXX can this code be reached?
- predef LoadSAV
+ predef TryLoadSaveFile
ld a, [wCurMap]
ld [wDestinationMap], a
call PrepareForSpecialWarp
diff --git a/home/text_script.asm b/home/text_script.asm
index 35dd955b..389f2499 100644
--- a/home/text_script.asm
+++ b/home/text_script.asm
@@ -84,7 +84,7 @@ ENDM
dict TX_SCRIPT_PRIZE_VENDOR, TextScript_GameCornerPrizeMenu
dict2 TX_SCRIPT_CABLE_CLUB_RECEPTIONIST, callfar CableClubNPC
- call PrintText_NoCreatingTextBox ; display the text
+ call PrintText_NoCreatingTextBox
ld a, [wDoNotWaitForButtonPressAfterDisplayingText]
and a
jr nz, HoldTextDisplayOpen
@@ -93,7 +93,7 @@ AfterDisplayingTextID::
ld a, [wEnteringCableClub]
and a
jr nz, HoldTextDisplayOpen
- call WaitForTextScrollButtonPress ; wait for a button press after displaying all the text
+ call WaitForTextScrollButtonPress
; loop to hold the dialogue box open as long as the player keeps holding down the A button
HoldTextDisplayOpen::
diff --git a/home/vcopy.asm b/home/vcopy.asm
index 92c78a88..e4ba2cdb 100644
--- a/home/vcopy.asm
+++ b/home/vcopy.asm
@@ -140,7 +140,7 @@ AutoBgMapTransfer::
ld h, a
ldh a, [hAutoBGTransferDest]
ld l, a
- ld de, 12 * 32
+ ld de, 12 * TILEMAP_WIDTH
add hl, de
xor a ; TRANSFERTOP
jr .doTransfer
@@ -160,7 +160,7 @@ AutoBgMapTransfer::
ld h, a
ldh a, [hAutoBGTransferDest]
ld l, a
- ld de, 6 * 32
+ ld de, 6 * TILEMAP_WIDTH
add hl, de
ld a, TRANSFERBOTTOM
.doTransfer