Touched
Resident ASMAGICIAN
- 625
- Posts
- 10
- Years
- Age 123
- Seen Feb 1, 2018
Introduction
It came to my attention that some Gen VI items names are too long to fit into the 13 characters allocated by the Generation III games, Mega Stones in particular. So I thought, "Why not hack the limit?".
This basically works by having the first word of an item be 0xFFFFFFFF, and the next word being a pointer to the new, longer name. This makes it backwards compatible with the old item table (Only longer items need be repointed) and compatible with tools (They'll show a blank name due to the first character being 0xFF). This method should work for any other names I try to extend, but I'm kicking things off with items.
Table of Name Lengths
I tried to make this as accurate as possible. If you notice anything that is incorrect, please comment with an example name (and the new length). This will be used as a target for any adjustments.
Category
Current Limit
Gen VI Max
Gen VI Example
New Limit
Items
12
15
Weakness Policy
17
Pokemon
10
12
Nickname
-
Moves
12
16
Precipice Blades
-
Abilities
12
14
Primordial Sea
-
Longer Item Names
This hack just changes the code. The tilemap for the status screen needs to be altered to fit the code changes, but I'll just post offsets for the tiles and tilemap in the hope that some kind soul changes the tilemap and posts the hex for it here (hint hint).
Step 1: Insert and hook
Step 2: Fixing the bag strings
Put B2 00 94 1B E4 00 A4 1B at both 0x108450 and 0x10848E.
Step 3: Making the bag allocate more space
Write DD 03 00 00 at 0x108420
Step 4: Making the mart have larger strings (and malloc more)
Put 0x12 at 0x09B1DE, 0x09B1A4 and 0x09B1FA
Step 5: Changing the x position of the held item name in the status screen
Put 6 at 0x137056 (or whatever position you want, really).
Step 6: Fix Gender Issue
Write 1A 33 00 00 at 0x134540 and then assemble and hook:
The maximum name length is now technically 17, but 16 looks better imo. Here are some screens of what it looks like. See below for how "POTIONPOTIONPOTIO" (17 characters) ends up being right next to the "x" or the currency symbol, which looks strange.
The status screen looks terrible, because the tilemap is bad. The tilemap for the first page is at 0x135B34. I'll find the tiles later.
EDIT: Fixed last letter of long items overwriting the gender symbol.
It came to my attention that some Gen VI items names are too long to fit into the 13 characters allocated by the Generation III games, Mega Stones in particular. So I thought, "Why not hack the limit?".
This basically works by having the first word of an item be 0xFFFFFFFF, and the next word being a pointer to the new, longer name. This makes it backwards compatible with the old item table (Only longer items need be repointed) and compatible with tools (They'll show a blank name due to the first character being 0xFF). This method should work for any other names I try to extend, but I'm kicking things off with items.
Table of Name Lengths
I tried to make this as accurate as possible. If you notice anything that is incorrect, please comment with an example name (and the new length). This will be used as a target for any adjustments.
Category
Current Limit
Gen VI Max
Gen VI Example
New Limit
Items
12
15
Weakness Policy
17
Pokemon
10
12
Nickname
-
Moves
12
16
Precipice Blades
-
Abilities
12
14
Primordial Sea
-
Longer Item Names
This hack just changes the code. The tilemap for the status screen needs to be altered to fit the code changes, but I'll just post offsets for the tiles and tilemap in the hope that some kind soul changes the tilemap and posts the hex for it here (hint hint).
Spoiler:
Step 1: Insert and hook
Code:
.align 2
.thumb
@ 00 4A 10 47 XX + 1 XX XX 08 at 0x09A8D0 (0809A8D0 via r2)
hook_name:
add r0, r1
@ Item name is 14 bytes long, we can use this for other data
@ Check if first word is 0xFFFFFFFF
ldr r1, [r0]
add r1, #1
bcc return
@ First word was 0xFFFFFFFF, second word is therefore a pointer
@ to the real item name
ldr r0, [r0, #4]
return:
pop {pc}
Put B2 00 94 1B E4 00 A4 1B at both 0x108450 and 0x10848E.
Step 3: Making the bag allocate more space
Write DD 03 00 00 at 0x108420
Step 4: Making the mart have larger strings (and malloc more)
Put 0x12 at 0x09B1DE, 0x09B1A4 and 0x09B1FA
Step 5: Changing the x position of the held item name in the status screen
Put 6 at 0x137056 (or whatever position you want, really).
Step 6: Fix Gender Issue
Write 1A 33 00 00 at 0x134540 and then assemble and hook:
Code:
.align 2
.thumb
@ 00 4B 18 47 XX + 1 XX XX 08 at 0x13704C (0813704C via r3)
hook_name:
str r4, [sp, #0x4]
add r7, #0x8
ldr r3, =0x3308
add r1, r3
str r1, [sp, #0x8]
ldr r3, return
bx r3
.align 2
return: .word 0x08137054 + 1
![[PokeCommunity.com] Longer names [PokeCommunity.com] Longer names](https://i.imgur.com/kD4YaKa.png)
![[PokeCommunity.com] Longer names [PokeCommunity.com] Longer names](https://i.imgur.com/yPC50OQ.png)
![[PokeCommunity.com] Longer names [PokeCommunity.com] Longer names](https://i.imgur.com/7odVsDx.png)
![[PokeCommunity.com] Longer names [PokeCommunity.com] Longer names](https://i.imgur.com/7d6WLMe.png)
![[PokeCommunity.com] Longer names [PokeCommunity.com] Longer names](https://i.imgur.com/mpeg02V.png)
The status screen looks terrible, because the tilemap is bad. The tilemap for the first page is at 0x135B34. I'll find the tiles later.
EDIT: Fixed last letter of long items overwriting the gender symbol.
Last edited: