Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2013-02-11 17:26:04

tysonrss
Member
From: US, Ohio
Registered: 2011-08-27
Post 561/649

pointers to trainer pic

does anyone know the table or offsets that point to the trainer sprites?

i must have  accidentally overwrote some data with tilesets and so either agixp shows them glitched or not at all. i should have originally used manual offset insertion. but now im stuck, i cant repplace the sprites with agixp nor do i know where it stored these sprites. so my only chance is to repoint it myself to an empty space where i could insert it. thus the reason why i need to know where the pointers are.


Pokemon Blue DX is reborn!

Offline

#2 2013-02-11 18:06:36

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 2,297/3,455

Re: pointers to trainer pic

http://hax.iimarck.us/topic/173/

Mateo wrote:

Trainers

x518A6 - How many trainer groups
x80000 - Pointer table to trainer pictures
x3993E - Pointer table to where trainer data starts. 2 byte pointer for each trainer group in order, starting with Falkner
xE9027 - Table with which song plays when you are "seen" by a trainer
x27283 - Table that determines DVs for each trainer class. 2 bytes per trainer class.

With this, you can do a lot of neat things. You could repoint the trainer groups for gym leaders, allowing them to have multiple entries so you could script rematches with them, or if you wanted to change their name to be longer or give them more Pokemon than they had to begin with. Also handy for adding more trainers of a certain type, or if you wanted to give Professor Oak his own trainer data (by default, his data points to the same location as Elite Four Will)

x39562 - Table that determines how much money is given by each trainer

For calculating the given money of any battle, a value from that table is picked and is multiplied by (8 * [highest leveled pokemon of enemy]). For example, the third byte in the list (19) is used for given money for trainer group "Leader (Falkner)".
Following it are six bytes you don't have to worry about and another "19" used for given money for trainer group "Leader (Whitney)" and so on...
Basically, you can find the "given money" byte for each trainer with the following calculation:
0x39564 + ([Trainer Group] - 1) * 7

(Credit to Miksy91)

Offline

#3 2013-02-11 18:29:47

tysonrss
Member
From: US, Ohio
Registered: 2011-08-27
Post 562/649

Re: pointers to trainer pic

yyes thanks. i always find these things before given an answer..im just tired and out of it to look though i had a feeling i saw it before.


Pokemon Blue DX is reborn!

Offline

#4 2013-02-11 20:29:04

tysonrss
Member
From: US, Ohio
Registered: 2011-08-27
Post 563/649

Re: pointers to trainer pic

Is teh pointer 2 bytes or 3?


Pokemon Blue DX is reborn!

Offline

#5 2013-02-11 20:32:02

comet
Member
Registered: 2012-04-09
Post 125/672

Re: pointers to trainer pic

don't answer that

Offline

#6 2013-02-11 20:42:33

tysonrss
Member
From: US, Ohio
Registered: 2011-08-27
Post 564/649

Re: pointers to trainer pic

I've been in such a noobish mood lately :)


Pokemon Blue DX is reborn!

Offline

#7 2013-02-11 20:44:32

comet
Member
Registered: 2012-04-09
Post 126/672

Re: pointers to trainer pic

Usually pointer tables have a really obvious pattern. Also keep in mind where the trainer pics actually are.

Offline

#8 2013-02-11 20:48:23

tysonrss
Member
From: US, Ohio
Registered: 2011-08-27
Post 565/649

Re: pointers to trainer pic

The thing is I can never discern pointers unless I'm the one that worked with specific ones. The pointers already established, I don't know how to "reverse engineer" them.


Pokemon Blue DX is reborn!

Offline

#9 2013-02-11 20:50:40

comet
Member
Registered: 2012-04-09
Post 127/672

Re: pointers to trainer pic

Really obvious.

Offline

#10 2013-02-11 20:51:55

tysonrss
Member
From: US, Ohio
Registered: 2011-08-27
Post 567/649

Re: pointers to trainer pic

How. Instead of a short sighted answer why not just say it.


Pokemon Blue DX is reborn!

Offline

#11 2013-02-11 20:53:54

comet
Member
Registered: 2012-04-09
Post 128/672

Re: pointers to trainer pic

I want you to stare at the pointers for ten minutes and tell me you don't see a pattern.

Offline

#12 2013-02-11 20:55:34

tysonrss
Member
From: US, Ohio
Registered: 2011-08-27
Post 568/649

Re: pointers to trainer pic

Don't see it lol


Pokemon Blue DX is reborn!

Offline

#13 2013-02-11 20:57:24

Sanqui
Administrator
From: Prague, Czech Republic
Registered: 2011-07-18
Post 23/32
Website

Re: pointers to trainer pic

2013-02-11T22%3A04%3A31-WindHexforWindows-%220671-Pok%C3%A9monGold(U)(Oldskool).gbc%22.png2013-02-11T21%3A57%3A39-WindHexforWindows-%22Telefang.gbc%22.png
To the left are your trainer pic pointers, to the right are some text pointers from a random bank in a different game.
Guess which are two-byte and which are three-byte.

EDIT: fixed former pic

Offline

#14 2013-02-11 20:59:23

tysonrss
Member
From: US, Ohio
Registered: 2011-08-27
Post 569/649

Re: pointers to trainer pic

The left is 2 byte. But that doesn't explain how I find the orignal offset.


Pokemon Blue DX is reborn!

Offline

#15 2013-02-11 21:01:41

comet
Member
Registered: 2012-04-09
Post 129/672

Re: pointers to trainer pic

Sanky's pic is wrong.

Offline

#16 2013-02-11 21:03:48

tysonrss
Member
From: US, Ohio
Registered: 2011-08-27
Post 570/649

Re: pointers to trainer pic

Holy fuck I think I do see it. It's 3 bytes, the last byte must be the bank?


Pokemon Blue DX is reborn!

Offline

#17 2013-02-11 21:04:14

comet
Member
Registered: 2012-04-09
Post 130/672

Re: pointers to trainer pic

The first byte is the bank.

Offline

#18 2013-02-11 21:05:28

tysonrss
Member
From: US, Ohio
Registered: 2011-08-27
Post 571/649

Re: pointers to trainer pic

Why are they stretched out across many banks?


Pokemon Blue DX is reborn!

Offline

#19 2013-02-11 21:11:34

comet
Member
Registered: 2012-04-09
Post 131/672

Re: pointers to trainer pic

Here's the first line of bytes at $80000 in gold:

19 6e 44 1c 3b 50 19 e0 68 1b 34 79 1d 95 5e 1c

Now, if they were two bytes long they would look like:

19 6e  44 1c  3b 50  19 e0  68 1b  34 79  1d 95  5e 1c  ...
6e19   1c44   503b   e019   1b68   7934   951d   1c5e

If they were three bytes, it would look more like:

19 6e 44  1c 3b 50  19 e0 68  1b 34 79  1d 95 5e  1c ...
19:446e   1c:503b   19:68e0   1b:7934   1d:5e95

Since the only valid rom addresses are between $0000-$7fff, and we can assume that they're not in bank 0, we can write off the first option. There's no way the pointers are 2 bytes.


The trainer pics are mixed in with monster pics in an effort to fill up each bank as much as possible. Many banks are completely full, which usually never happens. This turns out to be totally useless here because there is plenty of free space. In crystal, the last pic bank was accidentally duplicated, which wasted more space than they saved.

Last edited by comet (2013-02-11 21:18:54)

Offline

#20 2013-02-12 04:21:44

stag019
Idea Killer
Registered: 2011-01-05
Post 327/630

Re: pointers to trainer pic

comet wrote:

This turns out to be totally useless here because there is plenty of free space.

How much? In Gold/Silver, not Crystal. Could an argument be made that potentially they were only given 1MB, which was later increased to 2MB?


You can try to hide yourself in this world of pretend; when the paper's crumpled up, it can't be perfect again.

Offline

Board footer

Powered by FluxBB