-
Notifications
You must be signed in to change notification settings - Fork 1k
Restoring to the Japanese Pokedex Screen
This tutorial will change the English pokedex screen to the Japanese, without sacrificing pokemon name lengths or changing pokemon names in any other area of the game.
Japanese versus English:
By the end of this tutorial your pokedex page can look something like this, in order to keep the same layout without sacrificing name length (if you want it 100% matching to the Japanese, you can do that too by simply moving the x coordinates used in the tutorial to the left by 1):
We have all the same 16x16 pixel tiles in the English and Japanese, things have just moved location. Notice that the line above DATA CRY etc is actually only the top line of a text box, we will redraw that with a full text box as in the Japanese original.
The easiest way to find the coordinates is to just look at the screen and manually count the 16x16 pixel tiles (one alphabet letter = 1 tile). If you have a hard time counting just open up a screenshot in an image editor and draw lines or a grid like this.
For example: English spiral-bound notebook line position: 15 on the x-axis
Japanese: 11 on the x-axis
English “DATA” text: 17 on x-axis
Japanese: 14 on x-axis
Etc. Now we go change the positions of these things in the code. The following instructions are in order of top-bottom in the code file, not actually in order of what is most useful for learning. Note that MY code has the bookbinding one tile to the right compared to the Japanese original, which you should change if you want a 100% authentic remake.
Go to: pokered (main folder) > engine > menus > pokedex.asm
As we are moving the DATA TEXT CRY etc text to the left by 2, we also need to move the cursor for that to the left by 2. Change:
ld a, 10
ld [hli], a ; top menu item Y
- ld a, 15 ; english pokedex layout
+ ld a, 13 ; moves cursor in DATA CRY etc area 2 tiles LEFT to accommodate new list location
ld [hli], a ; top menu item X
The original English code manually draws a few tiles to make the top line of the text box. We are deleting that code, and replacing it with the normal “draw textbox” function.
Search for “handles the list of pokemon on the left of the pokedex screen“ on your github or the pokered github to find the correct file and spot, and change:
-; draw the horizontal line separating the seen and owned amounts from the menu
- hlcoord 15, 8
- ld a, "─"
- ld [hli], a
- ld [hli], a
- ld [hli], a
- ld [hli], a
- ld [hli], a
- hlcoord 14, 0 original English pokedex layout
+; hlcoord 10, 0 100% authentic japanese pokedex layout
+ hlcoord 11, 0 ; japanese-like layout for english pokemon names
ld [hl], $71 ; pokedex vertical line tile (spiral bound bookbinding)
- hlcoord 14, 1 English pokedex
+; hlcoord 10, 1 100% japanese
+ hlcoord 11, 1 ; Japanese-like
call DrawPokedexVerticalLine
- hlcoord 14, 9 english pokedex
+; hlcoord 10, 9 ; 100% japanese
+ hlcoord 11, 9 ; japanese-like
call DrawPokedexVerticalLine
ld hl, wPokedexSeen
ld b, wPokedexSeenEnd - wPokedexSeen
call CountSetBits
ld de, wNumSetBits
hlcoord 16, 3 ; x-y coordinates of digit of total "seen" pokemon on main pokedex, same in english and japanese
lb bc, 1, 3
call PrintNumber ; print number of seen pokemon
ld hl, wPokedexOwned
ld b, wPokedexOwnedEnd - wPokedexOwned
call CountSetBits
ld de, wNumSetBits
- hlcoord 16, 3 english layout x-y coordinates of "OWNED" pokemon text
+ hlcoord 16, 6 ; japanese layout
lb bc, 1, 3
call PrintNumber ; print number of owned pokemon
- hlcoord 16, 2 english layout
+ hlcoord 13, 2 ; japanese layout
ld de, PokedexSeenText
call PlaceString
- hlcoord 16, 5 english layout
+ hlcoord 13, 5 ; japanese layout
ld de, PokedexOwnText
call PlaceString
hlcoord 1, 1
ld de, PokedexContentsText
call PlaceString
+; draw text box border around DATA CRY etc in pokedex, which in the english version is missing except for the top line
- hlcoord 16, 10
+; hlcoord 11, 8 ; 100% japanese layout - x-y coordinates of start of text box borders around "data cry"
+ hlcoord 12, 8 ; japanese-like layout
+; lb bc, 9, 6 ; 100% japanese layout - dimensions of text box (width, height)
+ lb bc, 8, 6 ; japanese-like layout
+ call TextBoxBorder
+ hlcoord 14, 10 ; x-y coordinates of TEXT "data cry" etc
ld de, PokedexMenuItemsText
call PlaceString
....
.loop
xor a
ldh [hAutoBGTransferEnabled], a
hlcoord 4, 2
-; lb bc, 14, 10 ; english layout - makes it so white background from text lines doesn't overflow onto or cover up the graphics on the right side of pokedex screen
+; lb bc, 13, 5 ; 100% japanese layout? untested
+ lb bc, 14, 5 ; japanese-like layout
call ClearScreenArea
……
push de
push hl
- ld de, SCREEN_WIDTH ; Calculate two lines down
- add hl, de ; Move down two lines
ld de, wd11e
……
call IsPokemonBitSet
pop hl
- ld a, " "
+; code for moving "caught" pokeball symbol and pokemon name up one line, to fit on same line as pokedex number
+ ld de, -SCREEN_WIDTH ; Load negative SCREEN_WIDTH into register pair de
+ add hl, de ; Move up one line by adding negative SCREEN_WIDTH to hl
+ inc hl ; Move one tile to the right
jr z, .writeTile
ld a, $72 ; pokeball tile
.writeTile
ld [hl], a ; put a pokeball next to pokemon that the player has owned
push hl
ld hl, wPokedexSeen
call IsPokemonBitSet
- jr nz, .getPokemonName ; if the player has seen the pokemon - original list of pokemon names
+ jr nz, .getPokemonPokedexIndexName ; specialized list of names only appearing in pokedex main page, so we don't mess up any other part of the game
ld de, .dashedLine ; print a dashed line (defined below) in place of the name if the player hasn't seen the pokemon
jr .skipGettingName
.dashedLine ; show this for unseen pokemon in the list
- db "----------@" dashed line for the original english layout (10 letters 1 line)
+; db "-----<LF> @" ; 100% authentic japanese layout (5 letters 2 lines)
+ db "------<LF> @" ; japanese layout that fits full english pokemon names. blank spaces are necessary, otherwise it won't clear away the entire pokemon name when you scroll in the pokedex
.getPokemonPokedexIndexName
call PokedexToIndex
- call GetMonName loads normal pokemon name into the pokedex main page
+ call GetPokedexIndexMonName ; loads specialized list of pokemon names meant only for use in japanese pokedex layout
.skipGettingName
pop
The Japanese pokedex only shows 5 letters per pokemon name. This is not enough for most languages. You have several solutions, including:
-
Replace showing the Pokemon names with showing a unique image (sprite or headshot) like in this pokecrystal tutorial: https://github.com/pret/pokecrystal/wiki/Add-a-new-party-menu-icon
-
Permanently rename and shorten all the Pokemon names so they fit into 5 characters, like with these pre-release translated pokemon names: https://tcrf.net/Prerelease:Pok%C3%A9mon_Red_and_Blue/International_Localization#Localized_Pok.C3.A9mon_Names
-
Create a new list of shortened pokemon names that ONLY appear on the main pokedex page. Meaning, It will say “Pikac” and when you click on it to view the pokemon’s file, the full “Pikachu” will appear.
-
Using
<LF>
(line feed) as on the Town Map Tutorial (https://github.com/pret/pokered/wiki/Restore-Japanese-Town-Map) to create a special new list of pokemon names ONLY the pokedex main page, which are the full names split into two lines. For example “Pikachu” could become:Pika
chu
This guide assumes you are doing #3 or #4. We need to create a copy of the list of pokemon names, edit the names, and tell the computer to refer to that list ONLY when looking at the pokedex.
GetMonName and getPokemonName are the references in the code that pull the actual full-length pokemon name and prints it onto the screen. All we have to do is change this so it refers to a different list of pokemon names that we create. I already did this for you in the code above, we are just lacking the new pokemon names.
Go to: pokered MF > constants > text_constants.asm
The code will check the pokemon names against a number to see if the length is correct, as well as if it is going over a certain length. We can increase those below in order to be able to include <LF>
(which the code sees as 1 bit).
Change:
DEF NAME_LENGTH EQU 11
+ DEF POKEDEX_NAME_LENGTH EQU 13
DEF ITEM_NAME_LENGTH EQU 13
DEF NAME_BUFFER_LENGTH EQU 20
+ DEF POKEDEX_NAME_BUFFER_LENGTH EQU 22
If you want to go the route of shortening names instead of putting them on two lines in the pokedex, you don't have to change the above code.
Increasing to 13 means pokemon names in the pokedex page can be up to 12 16x16 pixel squares from font.png + one extra space for a <LF>
. I couldn’t figure out how to enable 14 characters or more, I kept getting compile errors. I hope someone else can edit this tutorial to post the solution to that, as then we could fit 2 lines of 6 visible letters each per pokemon name, or even more.
The game already treats pokemon names differently from item and TM names. Now we should tell it to additionally treat Pokemon Pokedex Index names differently.
Go to: pokered > home > names2.asm
NamePointers::
; entries correspond to *_NAME constants
dw MonsterNames
dw MoveNames
dw UnusedBadgeNames
dw ItemNames
dw wPartyMonOT ; player's OT names list
dw wEnemyMonOT ; enemy's OT names list
dw TrainerNames
+ dw PokedexMonsterNames ; this is number 8 in the list, so we reference which number it is later on in the code
The original code checks to see if it’s a pokemon name or something else. Now we also have a check for if it’s our special pokedex index name:
jr nz, .otherEntries
; 1 = MONSTER_NAME
call GetMonName
+ ; Check if we are getting a Pokedex monster name vs normal pokemon name
+ ld a, [wNameListType]
+ cp 8 ; PokedexMonsterNames is 8 in list, check if we want that
+ jr z, .usePokedexLength ; use special routine involving special length for pokedex names
ld hl, NAME_LENGTH ; Original code for normal names
+ jr .continue
+.usePokedexLength
+ ld hl, POKEDEX_NAME_LENGTH ; New code for Pokedex name length
+.continue
add hl, de
ld e, l
Now we need to create the actual list of names. Go to:
pokered MF > data > pokemon > names.asm
Copy-paste to duplicate the whole code. In your new second list, if you changed the maximum name length by 2 like I did, you also need to add 2 @ marks to the end of each pokemon name. You can ask chatgpt to do this for you much faster than doing it manually:
-MonsterNames::
+PokedexMonsterNames::
- table_width NAME_LENGTH - 1, MonsterNames
+ table_width POKEDEX_NAME_LENGTH - 1, PokedexMonsterNames
- db "RHYDON@@@@"
+ db "RHYDON@@@@@@"
….
- db "VICTREEBEL"
+ db "VICTREEBEL@@"
assert_table_length NUM_POKEMON_INDEXES
If I change POKEDEX_NAME_LENGTH - 1 to just POKEDEX_NAME_LENGTH and try to fit one extra character into each name, the ROM won’t compile. Hopefully someone else can update this tutorial to fix or explain that.
If you want a shorter pokemon name to 100% replicate the Japanese original, just replace any letter past 5 or 6 letters (depending on where you placed the x coordinates of the bookbinding line in the pokedex) with @. It will be invisible in the game. For example:
db "CHARM@@@@@@@"
db "SQUIR@@@@@@@"
If you want pokemon names on two lines like in my code, first create the <LF>
command from the Town Map Tutorial (https://github.com/pret/pokered/wiki/Restore-Japanese-Town-Map). Remove one @ and add somewhere. In the following screenshot Charmander and Squirtle are written like this in the pokedex name list:
db "CHARM-<LF>ANDER"
db "SQUIR-<LF>TLE@@@@"
Which appear like this in-game:
Your pokedex is now complete!