summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/battle/get_trainer_name.asm2
-rwxr-xr-xengine/menu/naming_screen.asm6
-rwxr-xr-xengine/oak_speech.asm2
-rwxr-xr-xengine/oak_speech2.asm40
-rwxr-xr-xengine/titlescreen.asm2
-rw-r--r--home/text.asm2
-rwxr-xr-xwram.asm2
-rwxr-xr-xyellow/main.asm7
8 files changed, 32 insertions, 31 deletions
diff --git a/engine/battle/get_trainer_name.asm b/engine/battle/get_trainer_name.asm
index cf09ac66..16a94ec5 100644
--- a/engine/battle/get_trainer_name.asm
+++ b/engine/battle/get_trainer_name.asm
@@ -3,7 +3,7 @@ GetTrainerName_: ; f67a5 (3d:67a5)
ld a, [wLinkState]
and a
jr nz, .foundName
- ld hl, W_RIVALNAME
+ ld hl, wRivalName
ld a, [W_TRAINERCLASS]
cp SONY1
jr z, .foundName
diff --git a/engine/menu/naming_screen.asm b/engine/menu/naming_screen.asm
index b60de733..fd9a55af 100755
--- a/engine/menu/naming_screen.asm
+++ b/engine/menu/naming_screen.asm
@@ -322,8 +322,10 @@ DisplayNamingScreen: ; 6307 (1:6307)
jp EraseMenuCursor
LoadEDTile: ; 675b (1:675b)
-; Because yellow uses the MBC5, loading $0 into $2000 - $2fff range will load bank0 instead of bank1
-; instead of defining the correct bank, GameFreak decided to simply copy the ED_Tile in the function during HBlank
+; In Red/Blue, the bank for the ED_tile was defined incorrectly as bank0
+; Luckily, the MBC3 treats loading $0 into $2000-$2fff range as loading bank1 into $4000-$7fff range
+; Because Yellow uses the MBC5, loading $0 into $2000 - $2fff range will load bank0 instead of bank1 and thus incorrectly load the tile
+; Instead of defining the correct bank, GameFreak decided to simply copy the ED_Tile in the function during HBlank
ld de, ED_Tile
ld hl, vFont + $700
ld c, $4 ; number of copies needed
diff --git a/engine/oak_speech.asm b/engine/oak_speech.asm
index 5a36fe1f..045bbb68 100755
--- a/engine/oak_speech.asm
+++ b/engine/oak_speech.asm
@@ -35,7 +35,7 @@ SetDefaultNames: ; 5e27 (1:5e27)
ld bc, NAME_LENGTH
call CopyData
ld hl, SonyText
- ld de, W_RIVALNAME
+ ld de, wRivalName
ld bc, NAME_LENGTH
call CopyData ; rip optimizations
ret
diff --git a/engine/oak_speech2.asm b/engine/oak_speech2.asm
index c0349d2e..911a4ed0 100755
--- a/engine/oak_speech2.asm
+++ b/engine/oak_speech2.asm
@@ -1,4 +1,4 @@
-ChoosePlayerName: ; 695d (1:695d)
+ChoosePlayerName: ; 66db (1:66db)
call OakSpeechSlidePicRight
ld de, DefaultNamesPlayer
call DisplayIntroNameTextBox
@@ -27,11 +27,11 @@ ChoosePlayerName: ; 695d (1:695d)
ld hl, YourNameIsText
jp PrintText
-YourNameIsText: ; 699f (1:699f)
+YourNameIsText: ; 671d (1:671d)
TX_FAR _YourNameIsText
db "@"
-ChooseRivalName: ; 69a4 (1:69a4)
+ChooseRivalName: ; 6722 (1:6722)
call OakSpeechSlidePicRight
ld de, DefaultNamesRival
call DisplayIntroNameTextBox
@@ -40,11 +40,11 @@ ChooseRivalName: ; 69a4 (1:69a4)
jr z, .customName
ld hl, DefaultNamesRivalList
call GetDefaultName
- ld de, W_RIVALNAME
+ ld de, wRivalName
call OakSpeechSlidePicLeft
jr .done
.customName
- ld hl, W_RIVALNAME
+ ld hl, wRivalName
ld a, NAME_RIVAL_SCREEN
ld [wNamingScreenType], a
call DisplayNamingScreen
@@ -60,11 +60,11 @@ ChooseRivalName: ; 69a4 (1:69a4)
ld hl, HisNameIsText
jp PrintText
-HisNameIsText: ; 69e7 (1:69e7)
+HisNameIsText: ; 6765 (1:6765)
TX_FAR _HisNameIsText
db "@"
-OakSpeechSlidePicLeft: ; 69ec (1:69ec)
+OakSpeechSlidePicLeft: ; 676a (1:676a)
push de
coord hl, 0, 0
lb bc, 12, 11
@@ -81,12 +81,12 @@ OakSpeechSlidePicLeft: ; 69ec (1:69ec)
ld a, $ff
jr OakSpeechSlidePicCommon
-OakSpeechSlidePicRight: ; 6a12 (1:6a12)
+OakSpeechSlidePicRight: ; 6790 (1:6790)
coord hl, 5, 4
lb de, 6, 6 * SCREEN_WIDTH + 5
xor a
-OakSpeechSlidePicCommon: ; 6a19 (1:6a19)
+OakSpeechSlidePicCommon: ; 6797 (1:6797)
push hl
push de
push bc
@@ -108,6 +108,7 @@ OakSpeechSlidePicCommon: ; 6a19 (1:6a19)
.loop
xor a
ld [H_AUTOBGTRANSFERENABLED], a
+ ld [H_AUTOBGTRANSFERPORTION], a
ld a, [hSlideDirection]
and a
jr nz, .slideLeft
@@ -129,8 +130,8 @@ OakSpeechSlidePicCommon: ; 6a19 (1:6a19)
; If sliding left, we need to zero the last tile in the pic (there is no need
; to take a corresponding action when sliding right because hl initially points
; to a 0 tile in that case).
- xor a
dec hl
+ xor a
ld [hl], a
.next3
ld a, 1
@@ -159,11 +160,10 @@ OakSpeechSlidePicCommon: ; 6a19 (1:6a19)
pop hl
ret
-DisplayIntroNameTextBox: ; 6a6c (1:6a6c)
+DisplayIntroNameTextBox: ; 67ec (1:67ec)
push de
coord hl, 0, 0
- ld b, $a
- ld c, $9
+ lb bc, 10, 9
call TextBoxBorder
coord hl, 3, 0
ld de, .namestring
@@ -184,24 +184,24 @@ DisplayIntroNameTextBox: ; 6a6c (1:6a6c)
ld [wMaxMenuItem], a
jp HandleMenuInput
-.namestring ; 6aa3 (1:6aa3)
+.namestring ; 6822 (1:6822)
db "NAME@"
-DefaultNamesPlayer:
+DefaultNamesPlayer: ; 6827 (1:6827)
db "NEW NAME"
next "YELLOW"
next "ASH"
next "JACK"
db "@"
-DefaultNamesRival:
+DefaultNamesRival: ; 6840 (1:6840)
db "NEW NAME"
next "BLUE"
next "GARY"
next "JOHN"
db "@"
-GetDefaultName: ; 6ad6 (1:6ad6)
+GetDefaultName: ; 6858 (1:6858)
; a = name index
; hl = name list
ld b, a
@@ -225,10 +225,10 @@ GetDefaultName: ; 6ad6 (1:6ad6)
ld bc, $14
jp CopyData
-DefaultNamesPlayerList:
+DefaultNamesPlayerList: ; 687d (1:687d)
db "NEW NAME@YELLOW@ASH@JACK@"
-DefaultNamesRivalList:
+DefaultNamesRivalList: ; 688d (1:688d)
db "NEW NAME@BLUE@GARY@JOHN@"
-TextTerminator_6b20: ; 6b20 (1:6b20)
+TextTerminator_6b20: ; 68a5 (1:68a5)
db "@"
diff --git a/engine/titlescreen.asm b/engine/titlescreen.asm
index 244d9ff7..3928e49a 100755
--- a/engine/titlescreen.asm
+++ b/engine/titlescreen.asm
@@ -3,7 +3,7 @@ SetDefaultNamesBeforeTitlescreen: ; 414b (1:414b)
ld de, wPlayerName
call CopyFixedLengthText
ld hl, SonyText
- ld de, W_RIVALNAME
+ ld de, wRivalName
call CopyFixedLengthText
xor a
ld [hWY], a
diff --git a/home/text.asm b/home/text.asm
index fcb1d439..da20a833 100644
--- a/home/text.asm
+++ b/home/text.asm
@@ -146,7 +146,7 @@ Char52:: ; 17c7 (0:17c7) ; player’s name
Char53:: ; 17cd (0:17cd) ; rival’s name
push de
- ld de,W_RIVALNAME
+ ld de,wRivalName
jr FinishDTE
Char5D:: ; 17d3 (0:17d3) ; TRAINER
diff --git a/wram.asm b/wram.asm
index 5ceb135d..5922f27c 100755
--- a/wram.asm
+++ b/wram.asm
@@ -2280,7 +2280,7 @@ wBagItems:: ; d31e
wPlayerMoney:: ; d347
ds 3 ; BCD
-W_RIVALNAME:: ; d34a
+wRivalName:: ; d34a
ds NAME_LENGTH
wOptions:: ; d355
diff --git a/yellow/main.asm b/yellow/main.asm
index ecd0b5d9..7c752a69 100755
--- a/yellow/main.asm
+++ b/yellow/main.asm
@@ -718,10 +718,9 @@ EmptyFunc: ; 64ea (1:64ea)
ret
INCLUDE "engine/menu/naming_screen.asm"
-ChoosePlayerName: ; 66db (1:66db)
- dr $66db,$6722
-ChooseRivalName: ; 6722 (1:6722)
- dr $6722,$68a6
+
+INCLUDE "engine/oak_speech2.asm"
+
SubtractAmountPaidFromMoney_: ; 68a6 (1:68a6)
dr $68a6,$68c9
HandleItemListSwapping: ; 68c9 (1:68c9)