Jump to content

Unterminated name glitch item: Difference between revisions

m
Minor grammar
m (Further clarification on reason why it doesn't work for glitch item 0x00)
m (Minor grammar)
Line 38:
When the player selects the item in the item list using the A button, the game fetches the name of the item to be later copied to the internal buffer at [[memory address]] CF4B. For this, the game uses a routine called GetName, which is used not only for item names but also for names of Pokémon, moves and trainers. This routine uses a variable called wNameListType to distinguish which kind of name should be fetched (where valid values range from 1 to 7 - some values are unused).
 
It turns out that in this case, however, that the game does not set the value of this variable before calling this function, because it would have already been set to the correct value when reading item names to draw to the screen when showing the item list. By having the CANCEL button at the beginning of the item list, however, no actual item names are drawn to the screen and this variable is left uninitialized, containing whatever value it had before the item list was brought up. After a reset, it holds the value 0, which is invalid and leads to the game trying to read item names from an invalid location, reading garbage data which results in the names copied afterwards being unterminated.
 
If the method is performed without first saving and resetting, but right after a battle, names of moves will be used. If the item below the CANCEL button is [[ItemDex/RB:000|item 0x00]], the move ID used will be for [[Move 0x00 corruption (Generation I)|move 0x00]], which will also cause the unterminated name effects.{{clr}}
20

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.