Zophar's Message Domain

Go Back   Zophar's Message Domain > Emulation Talk > Rom Hack

Reply
 
Thread Tools Display Modes
Old 11-09-2005, 07:15 PM   #1
Advent_Kirby
Junior Member
 
Join Date: Oct 2004
Posts: 18
Default Snes Pointers

For the record, I might add that I am quite familiar with Nes, Snes and GB-pointers. I have also inserted a Swedish translation of FF3 into the rom manually (meaning I re-wrote the text, then changed the corresponding pointer so that it pointed to the right place agin).

And if I'm not mistaken, it goes something like this:

* Take the last 4 digits of your hex-offset
* Subtract 200
* Split
* Swap place

32F7 > 30F7 > 30 F7 > F7 30

Now for my question: In FF3, things went very smoothly. Every text had a pointer, neatly located on it's pointertable and always in order. But in some games, I just can't find a single pointer/pointertable. Not even when it comes to the first text in the game, located at the top of the textblock. Searching on the net simply led me to a bunch of documents, all refering to the method described above.

Therefore I was wondering if there are any other ways of calculating Snes pointers (since there are many ways when it comes to Nes/GB)?

If not, is there any other ways to adjust the starting location of text, one that is even more efficient then pointers (I'm talking RPGs here)?
Advent_Kirby is offline   Reply With Quote
Old 11-09-2005, 08:12 PM   #2
JadussD
Senior Member
 
Join Date: Jan 2003
Posts: 2,100
Default Re: Snes Pointers

> If not, is there any other ways to adjust the starting
> location of text, one that is even more efficient then
> pointers (I'm talking RPGs here)?
>

This explanation assumes you don't have a $200 byte header in the ROM. If you do, substract this number before you do ANYTHING ELSE of course.

The thing with SNES is that if the game is less than 16mbit, it may be a LoROM game, which means that every $8000 bytes are a new bank which in which the first address is $8000 (keep in mind, $8000 is one half of $10000, the size (not counting from zero) of a 64kbit bank). Therefore, if your ROM address you're looking to find the pointers to's last 4 hex digits are above 8000, you add them in the manner you were talking about, but if the last digits are below 0000, you add $8000.

If you don't understand this concept, think of it this way:at the ROM address $0000 (on a ROM WITHOUT the $200 byte header), on a LoROM game, the SNES thinks of it as $8000. When the address bank gets past $7FFF (or $FFFF as the SNES thinks of it as), you have a new bank, which starts at $8000. This address will end in $8000 in both the ROM and the SNES's memory map. So you don't have to add anything on half the banks, and half the banks, you do.
JadussD is offline   Reply With Quote
Old 11-09-2005, 08:54 PM   #3
Advent_Kirby
Junior Member
 
Join Date: Oct 2004
Posts: 18
Default Re: Snes Pointers

Didn't get much of that, but I think I've read about it. Basically, if the four digits are below 8000 hex bytes, you add another 8000 before swapping.

I'll just take an example from one of the games: Secret of the Stars (Lo-Rom, 16Mbits)

Start of text located at: 265C5

265C5 > 65C5

65C5-200 = 63C5

63C5 is less then 8000, so I'll add 8000 > E3C5

E3C5 > E3 C5 > C5 E3

This gives me 2 hits when I search the rom, and none of them are pointers. Did I do something wrong?
Advent_Kirby is offline   Reply With Quote
Old 11-09-2005, 09:06 PM   #4
JadussD
Senior Member
 
Join Date: Jan 2003
Posts: 2,100
Default Re: Snes Pointers

> This gives me 2 hits when I search the rom, and none of them
> are pointers. Did I do something wrong?
>

It could be that the game uses a different format of pointers. I'll take a look at it and tell you what I find.
JadussD is offline   Reply With Quote
Old 11-09-2005, 10:36 PM   #5
KingMike
Regular Member
 
Join Date: Aug 2005
Posts: 41
Default Re: Snes Pointers

If the ROM has a header (quick way to tell, if the KB size is odd (ex. 1537KB), you have a header. If it's even (exactly 1536KB), you don't. If the ROM has a header: subtract 200, but do it BEFORE eliminating the ten thousands+ digits. Don't subtract 200 if it doesn't.
Also, SoS actually has the dialouge stored twice for some reason (maybe the original script was too difficult to change, so they just slapped the modified script on the end of the ROM). Dumb question, but does editing the text itself at 265C5 change the game?
KingMike is offline   Reply With Quote
Old 11-09-2005, 11:50 PM   #6
Reaper man
Member
 
Reaper man's Avatar
 
Join Date: Apr 2002
Location: Austin, TX
Posts: 5,409
Default Re: Snes Pointers

> This gives me 2 hits when I search the rom, and none of them
> are pointers. Did I do something wrong?

does the text format in the game have any headers? What I mean by that is say for instance x265C5 is where the text itseslf starts. with some game engines, there are one or more header bytes telling the engine to render the dialogue box on the top of the screen, bottom of the screen, so on and so forth. Anyway it might be somehting like x265C0 because there are header bytes to consider. I hope that made sense. I'm not very good at explaining things sometimes.
__________________
Reaper man is offline   Reply With Quote
Old 11-10-2005, 12:19 AM   #7
JadussD
Senior Member
 
Join Date: Jan 2003
Posts: 2,100
Default Re: Snes Pointers

> Also, SoS actually has the dialouge stored twice for some
> reason (maybe the original script was too difficult to
> change, so they just slapped the modified script on the end
> of the ROM).

I was wondering why I thought I'd found the pointer tables but changing them didn't do shit.
JadussD is offline   Reply With Quote
Old 11-10-2005, 01:16 AM   #8
JadussD
Senior Member
 
Join Date: Jan 2003
Posts: 2,100
Default Alright.

> This gives me 2 hits when I search the rom, and none of them
> are pointers. Did I do something wrong?

Okay, yeah, as was previously said this game has it's text in two locations, the first of which isn't used. Between that and the HORRENDOUS English translation, I have to conclude that the developers were either drunk or borderline retarded.

Anyways, you'll find the pointer table for the dialogue at the very beginning of the ROM bank that contains it. Just make sure the text data is actually used, heh (ROM banks in LoROM are split into $8000 byte segments, yadda yadda). I recommend you snip the first $200 bytes off the ROM so you don't have to deal with the header when calculating pointers, although some utilities require it. That way you know that the pointer table will be at the first location that starts with either $8000 or $0000 that you scroll up to.

I was looking at the text data, and there's another oddity that will surely be a source of anger for anyone who wants to hack this ROM. It seems that if there's a person you can talk to, and they say more than one thing if you talk to them twice, then after the text for the first thing they would say, there is a pointer to the other thing they would say. You'll see what I mean if you search for a pointer for text that is the "second" thing some person says.

Look for the pointer to the text your mother says the second time you talk to her a second time at the beginning of the game: "BE VERY CAREFUL! WE HAVE HAD MANY EARTHQUAKES [etc]" It's at $141F06 ($142106 if you have a header on your ROM)...the pointer bytes you'd search for would be $069F.

And...they're RIGHT THERE NEXT TO THE TEXT, right after the thing she says to you the first time. AND ALSO, right after the text for the "BE VERY CAREFUL [etc]" itself. I think these pointers, which are preceded by the byte $F8, tell the game what text to point to the next time you talk to the person. So the reason they're present before AND after the text, is that when the game goes through the first thing she says, it reads the pointer to the second item, and knows to point to it. Then after the second item is read, it reads the other pointer and knows to point back to the text that was just read.

You'll have to deal with this particular breed of pointer throughout the translation , and I assume it will be a bitch.
JadussD is offline   Reply With Quote
Old 11-13-2005, 07:42 AM   #9
Advent_Kirby
Junior Member
 
Join Date: Oct 2004
Posts: 18
Default Re: Snes Pointers

SoS continues to elude me, but here's something I (actually) found while playing around with Lufia 1 (pointers regarding equipment, found right above the text at &H55800).

(In order)
"Nothing" &H55A00 <-- Pointer= 00 02
"Knife" &H55A16 <-- Pointer= 16 02
"Club" &H55A32 <-- Pointer= 32 02 etc

The file is Lo-Rom and lacks a header (1024kb), so I'm kinda curious about what algorithm one must use in order to turn 5A into 02, since subtracting 58 doesn't seem quite right...

In case someone prefers to take a look him/herself, I have submitted the tablefile along with the post.

C:Serverxampphtdocszopharoldwwwthrea...mentslufia.zip
Advent_Kirby is offline   Reply With Quote
Old 11-13-2005, 08:26 AM   #10
JadussD
Senior Member
 
Join Date: Jan 2003
Posts: 2,100
Default Re: Snes Pointers

> SoS continues to elude me, but here's something I (actually)
> found while playing around with Lufia 1 (pointers regarding
> equipment, found right above the text at &H55800).
>

Without looking at the ROM, and just reading the data locations, the data, and the pointers, I'll venture an educated guess and say that the pointer represents how many bytes away from a certain static address the location of the data is. The difference from normal pointers is that when the game's code calculates where to load the data from using the pointer, it adds the static address to the pointer and loads from the real ROM address that is the result of this adding.

To find the static ROM address that is added to each pointer, do this:

X - Y = Z

where X is the last 4 hex digits of the address that is the start of the text data, Y is the value of the pointers, and Z is the static ROM address. So, when you want to calculate a pointer of text you put in a new location, calculate it like normal (but don't add $8000), and subtract Z from what you calculated.
JadussD is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:15 PM.

Contact Us - Zophar's Domain - Archive - Top

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.