-
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
Note that if you're doing this for Pokeyellow, this file looks slightly different and you will have to make a few additional changes because Yellow version has one more item in this section: "DATA CRY AREA PRINT EXIT". Pokered does not have the PRINT function. This tutorial is based off pokered.
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, .getPokedexPokemonName ; 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
-.getPokemonName
+.getPokedexPokemonName
call PokedexToIndex
- call GetMonName loads normal pokemon name into the pokedex main page
+ call GetPokedexMonName ; 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 (Main Folder) > 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 getting pokemon name vs pokedex index 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
Go to: home/names.asm
Copy-paste the code from "GetMonName::" to "ret". We are creating a duplicate so we end up referring to the new pokedex names only on the pokedex screen.
-GetMonName:: ; label this piece of code so we can tell the computer to find and run it when we're in another file or another area of this file
+GetPokedexMonName::
push hl ; Save the current memory address we're looking at in a safe place
ldh a, [hLoadedROMBank] ; Load the current ROM bank number into register A (a small storage space in the CPU, used for math and data transfer)
push af ; Save the contents of register A and some CPU flags for later use (CPU flags = used by the Central Processing Unit to store the results of operations or the state of the processor)
- ld a, BANK(MonsterNames) ; Find out which ROM bank (labelled part of sectioned-off storage in another file) is called MonsterNames (it holds the normal Pokémon names) and put that number in register A to prepare for calculations or data transfer
+ ld a, BANK(PokedexMonsterNames) ; gets the list named "PokedexMonsterNames"
ldh [hLoadedROMBank], a ; Tell the system to switch to the ROM bank where Pokémon names are stored
ld [MBC1RomBank], a ; Make a note in a special memory area about this ROM bank switch
ld a, [wd11e] ; Load the number that indicates which Pokémon's name we want into register A
dec a ; Decrease this number by 1 because a list in a computer starts from 0, not 1
- ld hl, MonsterNames ; Load the starting address of the MonsterNames list into register pair H & L
+ ld hl, PokedexMonsterNames
- ld c, 10 ; tell the computer that each pokemon name is 10 characters, by setting C to 10
+ ld c, 12 ; Set C to 12 (enlarged size of the pokedex pokemon name to copy)
ld b, 0 ; Clear register B; registers B & C together as a pair now hold the length 12
call AddNTimes ; Calculate the exact memory address of the Pokémon's name
ld de, wcd6d ; Load a specific memory address into register pair DE, where we'll copy the name
push de ; Save this address on the stack (another safe place)
- ld bc, 10 ; Put the number 10 into B & C, indicating how many characters to copy
+ ld bc, 12 ; change 10 to 12 again, to reflect longer pokedex names
call CopyData ; Copy the Pokémon's name from its original place to the new one
- ld hl, wcd6d + 10 ; Knowing a name is 10 characters, move to the end of where we just copied the name
+ ld hl, wcd6d + 12 ; enlarge 10 to 12 again
ld [hl], "@" ; Put a special '@' character here to mark the end of the name
pop de ; Get back the memory address we saved earlier
pop af ; Restore the original contents of register A and the CPU flags we saved
ldh [hLoadedROMBank], a ; Switch back to the original ROM bank we were using
ld [MBC1RomBank], a ; Update the special memory area to indicate we switched back
pop hl ; Go back to the original memory address we were looking at before all this
ret ; Finish this operation and return to what we were doing before this piece of code all started
Now we need to create the actual list of names that PokedexMonsterNames refers to. 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
Here is an English pokemon name list you can copy-paste, which contains the two new @ signs (you will need to insert the LFs yourself, you can ask chatgpt to insert one after the first syllable of each name or something). Please, someone edit this so the pokemon list is collapsible!:
; specialized pokemon name list which only appears on main pokedex screen
PokedexMonsterNames::
table_width POKEDEX_NAME_LENGTH - 1, PokedexMonsterNames
db "RHYDON@@@@@@"
db "KANGASKHAN@@"
db "NIDORAN♂@@@@"
db "CLEFAIRY@@@@"
db "SPEAROW@@@@@"
db "VOLTORB@@@@@"
db "NIDOKING@@@@"
db "SLOWBRO@@@@@"
db "IVYSAUR@@@@@"
db "EXEGGUTOR@@@"
db "LICKITUNG@@@"
db "EXEGGCUTE@@@"
db "GRIMER@@@@@@"
db "GENGAR@@@@@@"
db "NIDORAN♀@@@@"
db "NIDOQUEEN@@@"
db "CUBONE@@@@@@"
db "RHYHORN@@@@@"
db "LAPRAS@@@@@@"
db "ARCANINE@@@@"
db "MEW@@@@@@@@@"
db "GYARADOS@@@@"
db "SHELLDER@@@@"
db "TENTACOOL@@@"
db "GASTLY@@@@@@"
db "SCYTHER@@@@@"
db "STARYU@@@@@@"
db "BLASTOISE@@@"
db "PINSIR@@@@@@"
db "TANGELA@@@@@"
db "MISSINGNO.@@"
db "MISSINGNO.@@"
db "GROWLITHE@@@"
db "ONIX@@@@@@@@"
db "FEAROW@@@@@@"
db "PIDGEY@@@@@@"
db "SLOWPOKE@@@@"
db "KADABRA@@@@@"
db "GRAVELER@@@@"
db "CHANSEY@@@@@"
db "MACHOKE@@@@@"
db "MR.MIME@@@@@"
db "HITMONLEE@@@"
db "HITMONCHAN@@"
db "ARBOK@@@@@@@"
db "PARASECT@@@@"
db "PSYDUCK@@@@@"
db "DROWZEE@@@@@"
db "GOLEM@@@@@@@"
db "MISSINGNO.@@"
db "MAGMAR@@@@@@"
db "MISSINGNO.@@"
db "ELECTABUZZ@@"
db "MAGNETON@@@@"
db "KOFFING@@@@@"
db "MISSINGNO.@@"
db "MANKEY@@@@@@"
db "SEEL@@@@@@@@"
db "DIGLETT@@@@@"
db "TAUROS@@@@@@"
db "MISSINGNO.@@"
db "MISSINGNO.@@"
db "MISSINGNO.@@"
db "FARFETCH'D@@"
db "VENONAT@@@@@"
db "DRAGONITE@@@"
db "MISSINGNO.@@"
db "MISSINGNO.@@"
db "MISSINGNO.@@"
db "DODUO@@@@@@@"
db "POLIWAG@@@@@"
db "JYNX@@@@@@@@"
db "MOLTRES@@@@@"
db "ARTICUNO@@@@"
db "ZAPDOS@@@@@@"
db "DITTO@@@@@@@"
db "MEOWTH@@@@@@"
db "KRABBY@@@@@@"
db "MISSINGNO.@@"
db "MISSINGNO.@@"
db "MISSINGNO.@@"
db "VULPIX@@@@@@"
db "NINETALES@@@"
db "PIKACHU@@@@@"
db "RAICHU@@@@@@"
db "MISSINGNO.@@"
db "MISSINGNO.@@"
db "DRATINI@@@@@"
db "DRAGONAIR@@@"
db "KABUTO@@@@@@"
db "KABUTOPS@@@@"
db "HORSEA@@@@@@"
db "SEADRA@@@@@@"
db "MISSINGNO.@@"
db "MISSINGNO.@@"
db "SANDSHREW@@@"
db "SANDSLASH@@@"
db "OMANYTE@@@@@"
db "OMASTAR@@@@@"
db "JIGGLYPUFF@@"
db "WIGGLYTUFF@@"
db "EEVEE@@@@@@@"
db "FLAREON@@@@@"
db "JOLTEON@@@@@"
db "VAPOREON@@@@"
db "MACHOP@@@@@@"
db "ZUBAT@@@@@@@"
db "EKANS@@@@@@@"
db "PARAS@@@@@@@"
db "POLIWHIRL@@@"
db "POLIWRATH@@@"
db "WEEDLE@@@@@@"
db "KAKUNA@@@@@@"
db "BEEDRILL@@@@"
db "MISSINGNO.@@"
db "DODRIO@@@@@@"
db "PRIMEAPE@@@@"
db "DUGTRIO@@@@@"
db "VENOMOTH@@@@"
db "DEWGONG@@@@@"
db "MISSINGNO.@@"
db "MISSINGNO.@@"
db "CATERPIE@@@@"
db "METAPOD@@@@@"
db "BUTTERFREE@@"
db "MACHAMP@@@@@"
db "MISSINGNO.@@"
db "GOLDUCK@@@@@"
db "HYPNO@@@@@@@"
db "GOLBAT@@@@@@"
db "MEWTWO@@@@@@"
db "SNORLAX@@@@@"
db "MAGIKARP@@@@"
db "MISSINGNO.@@"
db "MISSINGNO.@@"
db "MUK@@@@@@@@@"
db "MISSINGNO.@@"
db "KINGLER@@@@@"
db "CLOYSTER@@@@"
db "MISSINGNO.@@"
db "ELECTRODE@@@"
db "CLEFABLE@@@@"
db "WEEZING@@@@@"
db "PERSIAN@@@@@"
db "MAROWAK@@@@@"
db "MISSINGNO.@@"
db "HAUNTER@@@@@"
db "ABRA@@@@@@@@"
db "ALAKAZAM@@@@"
db "PIDGEOTTO@@@"
db "PIDGEOT@@@@@"
db "STARMIE@@@@@"
db "BULBASAUR@@@"
db "VENUSAUR@@@@"
db "TENTACRUEL@@"
db "MISSINGNO.@@"
db "GOLDEEN@@@@@"
db "SEAKING@@@@@"
db "MISSINGNO.@@"
db "MISSINGNO.@@"
db "MISSINGNO.@@"
db "MISSINGNO.@@"
db "PONYTA@@@@@@"
db "RAPIDASH@@@@"
db "RATTATA@@@@@"
db "RATICATE@@@@"
db "NIDORINO@@@@"
db "NIDORINA@@@@"
db "GEODUDE@@@@@"
db "PORYGON@@@@@"
db "AERODACTYL@@"
db "MISSINGNO.@@"
db "MAGNEMITE@@@"
db "MISSINGNO.@@"
db "MISSINGNO.@@"
db "CHARMANDER@@"
db "SQUIRTLE@@@@"
db "CHARMELEON@@"
db "WARTORTLE@@@"
db "CHARIZARD@@@"
db "MISSINGNO.@@"
db "MISSINGNO.@@"
db "MISSINGNO.@@"
db "MISSINGNO.@@"
db "ODDISH@@@@@@"
db "GLOOM@@@@@@@"
db "VILEPLUME@@@"
db "BELLSPROUT@@"
db "WEEPINBELL@@"
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!