ref: d6dccb7df57b4afa86483ed8c68dca605125fbdb
parent: 02609940dbf50e1a4d7052646bedd67a2796136b
author: Remy Oukaour <remy.oukaour@gmail.com>
date: Thu Dec 21 06:56:33 EST 2017
Use NAME_LENGTH_JAPANESE more
--- a/mobile/battle_tower_5c.asm
+++ b/mobile/battle_tower_5c.asm
@@ -107,7 +107,7 @@
ld e, l
ld d, h
ld hl, PlayerName
- ld bc, 5 ; Japanese name length
+ ld bc, NAME_LENGTH_JAPANESE - 1
call CopyBytes
ld bc, PlayerID
ld de, PlayerGender
@@ -159,7 +159,7 @@
ld a, $5
call GetSRAMBank
ld hl, $a894
- ld bc, 6
+ ld bc, NAME_LENGTH_JAPANESE
call CopyBytes
ld hl, wMisc
ld de, $a948
@@ -879,7 +879,7 @@
ld de, wcd49
push bc
call PlaceString
- ld de, 6
+ ld de, NAME_LENGTH_JAPANESE
add hl, de
pop bc
pop af
@@ -1362,7 +1362,7 @@
jr nz, .not_egg
push hl
ld hl, PartyMonOT
- ld de, $6 ; NAME_LENGTH
+ ld de, NAME_LENGTH_JAPANESE
ld a, b
and a
jr z, .skip
@@ -1372,7 +1372,7 @@
jr nz, .loop2
.skip
ld de, String_1709a4
- ld a, $6 ; NAME_LENGTH
+ ld a, NAME_LENGTH_JAPANESE
.compare_loop
push af
ld a, [de]
--- a/mobile/fixed_words.asm
+++ b/mobile/fixed_words.asm
@@ -257,7 +257,7 @@
sla c
rl b
add hl, bc
- ld bc, 5 ; length of a string
+ ld bc, NAME_LENGTH_JAPANESE - 1
.copy_string
ld de, $c608
call CopyBytes
@@ -3236,7 +3236,7 @@
push hl
; skip to the attributes
- ld hl, 5 ; length of a string
+ ld hl, NAME_LENGTH_JAPANESE - 1
add hl, de
; get the number of words in the category
--- a/mobile/mobile_22.asm
+++ b/mobile/mobile_22.asm
@@ -381,7 +381,7 @@
; Sets carry if it does not find a nonspace character.
; Returns the location of the following character in hl.
push bc
- ld c, 5
+ ld c, NAME_LENGTH_JAPANESE - 1
.loop
ld a, [hli]
cp "@"
@@ -410,12 +410,12 @@
jr _incave
Function8934a: ; 8934a
- ld hl, 6
+ ld hl, NAME_LENGTH_JAPANESE
add hl, bc
_incave:
; Scans up to 5 characters starting at hl, looking for a nonspace character up to the next terminator. Sets carry if it does not find a nonspace character. Returns the location of the following character in hl.
push bc
- ld c, 5
+ ld c, NAME_LENGTH_JAPANESE - 1
.loop
ld a, [hli]
cp "@"
@@ -448,7 +448,7 @@
._incave
push de
- ld e, 6
+ ld e, NAME_LENGTH_JAPANESE
.loop
ld a, [hli]
cp -1
@@ -2394,7 +2394,7 @@
ld a, $5
ld [rSVBK], a
ld hl, Palette_89eb1
- ld de, UnknBGPals + 5 palettes
+ ld de, UnknBGPals palette 5
ld bc, 1 palettes
call CopyBytes
pop af
--- a/mobile/mobile_40.asm
+++ b/mobile/mobile_40.asm
@@ -2679,7 +2679,7 @@
.CopyThreeSpecies: ; 101145
; Load the 3 choices to the buffer
push de
- ld bc, StringBuffer2 + 6
+ ld bc, StringBuffer2 + NAME_LENGTH_JAPANESE
xor a
.party_loop
push af
@@ -2695,7 +2695,7 @@
ld a, 3
ld [de], a
inc de
- ld hl, StringBuffer2 + 6
+ ld hl, StringBuffer2 + NAME_LENGTH_JAPANESE
ld bc, 3
call CopyBytes
ld a, $ff
--- a/mobile/mobile_42.asm
+++ b/mobile/mobile_42.asm
@@ -947,7 +947,7 @@
ld de, SFX_GIVE_TRADEMON
call PlaySFX
ld c, 40
- ld hl, BGPals + 6 palettes
+ ld hl, BGPals palette 6
call Function1082f0
call Function108af4
.loop
@@ -1179,7 +1179,7 @@
MobileTradeAnim_GetTrademon3: ; 10890a
ld c, 40
- ld hl, BGPals + 6 palettes
+ ld hl, BGPals palette 6
call Function1082f0
call Function108af4
call GetMobileTradeAnimByte
@@ -1718,7 +1718,7 @@
; 108c9b
DebugMobileTrade: ; 108c9b
-; localization error: NAME_LENGTH (11) should be 6 here
+; localization error: NAME_LENGTH (11) should be NAME_LENGTH_JAPANESE (6) here
ld hl, .DebugTradeData
ld a, [hli]
--- a/mobile/mobile_45.asm
+++ b/mobile/mobile_45.asm
@@ -1895,7 +1895,7 @@
.asm_114b8c
pop hl
xor a
-rept 6
+rept NAME_LENGTH_JAPANESE
ld [hli], a
endr
jr .asm_114b82
--- a/mobile/mobile_45_sprite_engine.asm
+++ b/mobile/mobile_45_sprite_engine.asm
@@ -523,12 +523,12 @@
push af
ld a, $5
ld [rSVBK], a
- ld hl, UnknBGPals + 8 * 6
+ ld hl, UnknBGPals palette 6
ld de, $c320
ld bc, 2 palettes
call CopyBytes
ld hl, Palette_11734e
- ld de, UnknBGPals + 8 * 7
+ ld de, UnknBGPals palette 7
ld bc, 1 palettes
call CopyBytes
call SetPalettes
--- a/mobile/mobile_46.asm
+++ b/mobile/mobile_46.asm
@@ -7103,7 +7103,7 @@
Function11b483: ; 11b483
call .InitRAM
ld hl, PlayerName
- ld a, $5 ; Japanese Name Length
+ ld a, NAME_LENGTH_JAPANESE - 1
.loop1
push af
ld a, [hli]
--- a/mobile/mobile_5c.asm
+++ b/mobile/mobile_5c.asm
@@ -44,13 +44,13 @@
ld [wOTTrademonSpecies], a
ld hl, $a827
ld de, wOTTrademonSenderName
- ld bc, 5 ; Japanese Name Length
+ ld bc, NAME_LENGTH_JAPANESE - 1
call CopyBytes
ld a, "@"
ld [de], a
ld hl, $a85c
ld de, wOTTrademonOTName
- ld bc, 5 ; Japanese Name Length
+ ld bc, NAME_LENGTH_JAPANESE - 1
call CopyBytes
ld a, "@"
ld [de], a
--- a/mobile/mobile_menu.asm
+++ b/mobile/mobile_menu.asm
@@ -192,7 +192,7 @@
call GetSRAMBank
ld hl, sPlayerData + PlayerName - wPlayerData
ld de, PlayerName
- ld bc, 6 ; japanese name length
+ ld bc, NAME_LENGTH_JAPANESE
call CopyBytes
call CloseSRAM
callba _LoadData