Glitch City Laboratories Archives

Glitch City Laboratories closed on 1 September 2020 (announcement). This is an archived copy of a thread from Glitch City Laboratories Forums.

You can join Glitch City Research Institute to ask questions or discuss current developments.

You may also download the archive of this forum in .tar.gz, .sql.gz, or .sqlite.gz formats.

Generation I Glitch Discussion

Red/Blue glitch stat data (StatDex) (work in progress) - Page 1

Red/Blue glitch stat data (StatDex) (work in progress)

Posted by: Torchickens
Date: 2017-12-19 19:47:18
(Top post: Introduction and how to find glitch stats)

As has been done countless times over the years here on Glitch City Labs, here is the start of another Dex project. :)

I'm unsure how to check the addresses for the user and foe stat modifiers for the relevant glitch stat, (an educated guess would say it is at CD19+(ID) for player stat mods and CD2D+(ID) for foe stat mods) though, nor where the stat is actually stored, so due to those complications I decided to simply look for methods of changing the stat name.

There are three different stat name databases in Red/Blue, as such:

1. [SOURCE: OFFSET $DF2E (03:5F2E). Used for vitamins like HP Up.]

HEALTH [0x50]
ATTACK [0x50]
DEFENSE [0x50]
SPEED [0x50]
SPECIAL [0x50]

;How to research: Set a BGB breakpoint to 3:5E46, change the a register to your desired index number. (Health is ID 01).


2. [SOURCE: OFFSET $12B3A (04:6B3A). Used on the status screen.]

ATTACK [0x4E]
DEFENSE [0x4E]
SPEED [0x4E]
SPECIAL [0x4E]

3. [SOURCE: OFFSET $3F69F (0F:769F). Used for X (STAT) items.]

ATTACK [0x50]
DEFENSE [0x50]
SPEED [0x50]
SPECIAL [0x50]
ACCURACY [0x50]
EVADE [0x50]

These allow for two different groups of glitch stat names. I don't know about source 2 though as it is just plain text stored one after the other.

How to look up the names for list 3 can be found here.


Set a breakpoint to 0F:768B and use the X item.

Register b will be equal to essentially the index number of the string in the third database (for example ATTACK is 01), and hl will be initially set to 769F (as the ATTACK string can be found at 0F:769F or offset $3F69F). In order to look up the stat name, it seems the game searches through the database until it finds a 0x50 character, decreasing register b by 1 each time until hl lands on the name of the string.

For example, the Defense stat is located at $3F6A6. By the time the game moves on to other tasks, hl is equal to 76A6 hence the game prints it and this is stored in buffer CF4B.

If you modify register b, you can look up the names for glitch stats.

Re: Red/Blue glitch stat data (StatDex) (work in progress)

Posted by: Torchickens
Date: 2017-12-19 20:24:08
Database 1 stats:

(will be edited)

0x00: Random name
0x01: HEALTH
0x02: ATTACK
0x03: DEFENSE
0x04: SPEED
0x05: SPECIAL
0x06: (blank)
0x07: # ##
0x08: (blank)
0x09: ####
0x0A: ######4
0x0B: #u# B##F##
0x0C:  ##h #  G#
0x0D: #B##
0x0E: 4 (hidden and blanked out later)
0x0F: #####(new line)#p

Re: Red/Blue glitch stat data (StatDex) (work in progress)

Posted by: Torchickens
Date: 2017-12-19 20:34:30
Database 3 stats:

(will be edited)

0x00: Random name
0x01: ATTACK
0x02: DEFENSE
0x03: SPEED
0x04: SPECIAL
0x05: ACCURACY
0x06: EVADE
0x07: ## ### # #
0x08: #'m
0x09: #3
0x0A: ## ## 
0x0B: #
0x0C: #
0x0D: # (new line)
0x0E: #(PLAYER's POKéMON)
0x0F: ##

Re: Red/Blue glitch stat data (StatDex) (work in progress)

Posted by: Spoink
Date: 2017-12-19 20:57:33
I'm reposting my post from the other thread , this is 'database 3' about 1/3 complete

I've collected a couple of the stat names, I couldn't see which addresses were effected ,sorry ;~; . it seemed to trigger the breakpoint after decreasing the stat, not before

00 seems to steal the names of hexes $0E, $0F, $10, or $11, for some reason.

I'll do the rest ($56-$FF) tomorrow unless someone claims it.

07 - =====
08 - 'm
09 - 3
0A - = $
0B -
0C -
0D - {NewLine}
0E - {YourPkMn}
0F - =
10 - = $/h
11 - 8{NewLine} {NewLine}
12 - j i
13 - y d
14 - {NewLine}{NewLine}
15 - 4, h Enemy {EnemyPkMn} {NewLine}
16 - ={NewLine}!
17 - 5
18 - {NewLine}{NewLine}
19 - 'm= $/h
1A - {NewLine}{NewLine}
1B - 999 9-'v
1C - 999
1D - 999 999
1E - 9999C.9
1F - 999toto
20 - 9999(V =9
21 -
22 - POKé9{NewLine}7
23 - {None}
24 - {None}
25 - {None}
26 - {None}
27 - {None}
28 - to
29 - {None}
2A - {None}
2B - {None}
2C - {None}
2D - X DEFEND
2E - {None}
2F - {None}
30 - {None}
31 - {None}
32 - GARY
33 - GARY
34 - {None}
35 - JAC 9
36 - ASH
37 - JAC
38 - {None}
39 - GARY
3A - {None}
3B - J
3C - {None}
3D - J
3E - ASH
3F - JAC
40 - JAC
41 - =to
42 -
43 - {None}
44 - {None}
45 - {None}
46 - =to
47 -
48 - {None}
49 -
4A - to
4B - {None}
4C - {None}
4D - {None}
4E - {None}
4F - {None}
50 - {None}
51 - {None}
52 - GARY
53 - {None}
54 - ASH
55 - ASH

Re: Red/Blue glitch stat data (StatDex) (work in progress)

Posted by: Torchickens
Date: 2017-12-19 21:20:02
Wow, that was quick. Thanks danny! :)

Yeah I suspect IDs like 0x00 may depend on the contents of the RAM and how many 0x50 are there, and are (relatively) random much like the internal name of move 0x00. Possibly the game searches beyond the end of ROM bank 0F and into the writable memory.