summaryrefslogtreecommitdiff
path: root/engine/menu/naming_screen.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/menu/naming_screen.asm')
-rwxr-xr-xengine/menu/naming_screen.asm42
1 files changed, 28 insertions, 14 deletions
diff --git a/engine/menu/naming_screen.asm b/engine/menu/naming_screen.asm
index 759be189..911c4e99 100755
--- a/engine/menu/naming_screen.asm
+++ b/engine/menu/naming_screen.asm
@@ -5,9 +5,8 @@ AskName:
ld a, [wIsInBattle]
dec a
coord hl, 0, 0
- ld b, 4
- ld c, 11
- call z, ClearScreenArea ; only if in wild batle
+ lb bc, 4, 11
+ call z, ClearScreenArea ; only if in wild battle
ld a, [wcf91]
ld [wd11e], a
call GetMonName
@@ -40,7 +39,7 @@ AskName:
pop af
ld [wUpdateSpritesEnabled], a
ld a, [wcf4b]
- cp $50
+ cp "@"
ret nz
.declinedNickname
ld d, h
@@ -49,7 +48,7 @@ AskName:
ld bc, NAME_LENGTH
jp CopyData
-DoYouWantToNicknameText: ; 0x6557
+DoYouWantToNicknameText:
TX_FAR _DoYouWantToNicknameText
db "@"
@@ -94,8 +93,7 @@ DisplayNamingScreen:
call LoadEDTile
callba LoadMonPartySpriteGfx
coord hl, 0, 4
- ld b, 9
- ld c, 18
+ lb bc, 9, 18
call TextBoxBorder
call PrintNamingText
ld a, 3
@@ -108,7 +106,7 @@ DisplayNamingScreen:
ld [wMenuWatchedKeys], a
ld a, 7
ld [wMaxMenuItem], a
- ld a, $50
+ ld a, "@"
ld [wcf4b], a
xor a
ld hl, wNamingScreenSubmitName
@@ -153,7 +151,7 @@ DisplayNamingScreen:
ld h, [hl]
ld l, a
push de
- jp [hl]
+ jp hl
.submitNickname
pop de
@@ -259,7 +257,7 @@ DisplayNamingScreen:
.addLetter
ld a, [wNamingScreenLetter]
ld [hli], a
- ld [hl], $50
+ ld [hl], "@"
ld a, SFX_PRESS_AB
call PlaySound
ret
@@ -324,12 +322,28 @@ DisplayNamingScreen:
jp EraseMenuCursor
LoadEDTile:
+; 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 bc, (ED_TileEnd - ED_Tile) / $8
- ; to fix the graphical bug on poor emulators
- ;lb bc, BANK(ED_Tile), (ED_TileEnd - ED_Tile) / $8
- jp CopyVideoDataDouble
+ ld c, $4 ; number of copies needed
+.waitForHBlankLoop
+ ld a, [rSTAT]
+ and %10 ; in HBlank?
+ jr nz, .waitForHBlankLoop
+ ld a, [de]
+ ld [hli], a
+ ld [hli], a
+ inc de
+ ld a, [de]
+ ld [hli], a
+ ld [hli], a
+ inc de
+ dec c
+ jr nz, .waitForHBlankLoop
+ ret
ED_Tile:
INCBIN "gfx/ED_tile.1bpp"