+  RHDN Forum Archive
|-+  Romhacking
| |-+  Translation Hacking
| | |-+  creating tables for compressed roms.
Pages: [1] 2
Author Topic: creating tables for compressed roms.  (Read 1068 times)
g00gy
Guest
« on: January 31, 2007, 03:07:08 am »

hey guys,
Im new to romhacking. And I am still learning. so far ive hacked dragon warrior 1, was able to change abit of the text. Now as im still learning I am trying to change a little text in chrono trigger. But i cant make a table for a rom with compression. Can anyone help and show me what to do. I want to learn how to hack roms of this calbur independantly.

Ive been searching for an answer to this question for a very long time please help.
Ryusui
Guest
« Reply #1 on: January 31, 2007, 03:42:24 am »

It depends on what kind of compression you're dealing with.

If it's simple compression of the dictionary or DTE (Dual Tile Encoding) variety, then single byte values come out to two or more characters: there should be a table somewhere in the ROM itself of what each compression code comes out to, in order.

If it's something crazier, like LZ or Huffman, then you'll need some programming knowhow. Namely, some ASM knowledge to decipher the game's decompression routine, and then some understanding of another language to code utilities for compressing and decompressing script data.
g00gy
Guest
« Reply #2 on: January 31, 2007, 07:45:22 am »

And how do i detect the compression types within roms.
RedComet
Guest
« Reply #3 on: January 31, 2007, 08:05:45 am »

That's gonna require some tracing with and a debugging capable emulator. If you're really familiar with a given scheme, it's possible to figure it out without it, but it doesn't sound like this is gonna be a viable option for you at this time.
g00gy
Guest
« Reply #4 on: January 31, 2007, 08:27:55 am »

Im sorry im really confused i know nothing about programming or C++.
There is no tutorial I have found so far that helps me with any of this. All i wanted to do is create a table for earthbound or chrono trigger for the snes. I used relative search and i get inconsisstent and a very variable hex results. so i was told they have compression.

Im new to all this and want to be good at translating, i was told compression is easy to deal with yet i have found nothing about it and ive been searching and googling for a long time.

EDIT:well i have found a document on DTE and dictionary compression but i still have no idea how to detect the kind of compression roms have.
« Last Edit: January 31, 2007, 08:47:50 am by g00gy »
Nightcrawler
Guest
« Reply #5 on: January 31, 2007, 10:22:34 am »

Whoever told you compression was easy was full of it. It's NOT for new people like yourself. It's only easy if you understand some programming and can grasp the concepts of data compression.

You will have to look through the game code to decipher what compression the game uses in most cases. That means using an emulator and dumping a trace file and/or using the debugger. That means you will need to learn some programming.

Chrono Trigger probably uses an LZ variant like most SNES games. We have a few compression documents in our database to cover this. Jay's compression tutorial is my favorite.

You should be able to find SOME text with a relative search. Take the first word of the first line in the game and see if you can find that. If you can, you change the values there and build your table without deciphering the compression, but you won't be able to progress beyond that until you learn more. All compression streams must start with some uncompressed data by nature. So, there will be some text to be found via relative searching at the very start of a block.
g00gy
Guest
« Reply #6 on: January 31, 2007, 11:54:49 am »

So its nothing like nes. Thanx alot for that helpful information. Definatly DTE and dictionary dont seem like a problem, but you said nearly all snes games deal in LZ which is difficult and i know nothing about.

I tried what you said i used relative search, however when i put a space between the words or even when i put a (asterix) * it never detects anything, and when i put only one word it detects alot but some use diffrent hex combinations. Not only for this rom but others too. How can i add spaces between files for relative search. Ive read alot of tutorials and followed them exactly. Maybe its becuase im using windhex.

As for programming is it alot i must learn i dont mind incoporating this study within this new hobby. Please help becuase i want to be a rom translator lol.

Quote
That means using an emulator and dumping a trace file and/or using the debugger
is there a tutorial that shows me how to do this?
« Last Edit: January 31, 2007, 12:05:34 pm by g00gy »
DaMarsMan
Guest
« Reply #7 on: January 31, 2007, 12:23:05 pm »

Your still not understanding what we are saying. The reason you don't find anything in a relative search is because the data is compressed. If you put a text file in a zip file and opened it up in a hex editor do you think you would be able to read all the text? Same deal here. Once you decompress the data you could use a relative searcher but even then it would be relatively pointless. I highly recommend never using relative searchers. With the tools we have now for tracing and memory viewing they are really obsolete. 99% of the times the table follows the same pattern of the tiles in VRAM so you can just take a savestate and view it in vSNES. I suggest you read Nemesis' LZSS Doc translated by me. That may give you an idea of how compression works. It's exactly the same as the nes. Some compressions may however make sense on SNES and not on the NES. But they are relatively the same thing. If your game uses dictionary it will be pretty easy. You will be able to find the table within the rom. The way to trace is to press the trace button in a tracing emulator while you are loading a message box. That way, you will see exactly the code that's running when the game does that. After figuring out the different parts of the trace you should be able to tell exactly where the game is getting the text from and exactly what compression was used.
DarknessSavior
Guest
« Reply #8 on: January 31, 2007, 01:48:28 pm »

Eh, I dunno if this will help, but I'll tell you how I made a table for Chrono Trigger.

First, you're going to want to open the rom in your favorite emulator (I used ZSNES, I assume SNES9X or BSNES would work), get to the point where you name Crono. Name him whatever you want, go out, save, and quit. Go copy the .srm file, and put it somewhere else. Now, do exactly the same (and I do mean EXACTLY) thing, but this time, name Crono the same name as before, except backwards (so, if you left his name as "Crono", you would name him "onorC"). Save and quit. Get the srm file again, name it something different, and throw it in the same folder as the other .srm.

Now, open your favorite Hex Editor (preferably Hex Workshop), and open the two .srm files. Then, going through the menu (I don't remember exactly where it is), there should be an option for "Compare Files". When you go through the files comparing it, Hex Workshop will point out the differences between the two files. In this case, the only differences should be the names. This means you should see five hex values, all in a row, that are the exact opposite of eachother. (For Example, lets say the first .srm had "02, 22, 20, 19, 20" the second .srm should have "20, 19, 20, 22 02").

Now bearing all this in mind, you should be able to make a table that says this (note: these are NOT the actual table values, I'm just making an example!)

02=C
19=n
20=o
22=r

Now, for other characters ("?", "!", etc...) you can do the same thing, just name Crono using those characters, and you should easily be able to figure out their table values.

Because the letters are in alphabetical order (as many roms are), you can fill in the rest of the table yourself. Now, for the DTE/Dictionary characters, this is a bit more tedious. You will have to know the CT Script VERY well in order to finish that part of the table. Basically, everything that isn't DTE/Dictionary (I'm unaware of what system CT uses) will show up in a romhacking hex editor when you load your table. Now, you'll see holes in the script, and you'll have to play guesswork to figure out what each missing hex value means.

Hopefully that makes sense, I'm basically out of my mind right now, so it may not. But I tried.

~DS
Kitsune Sniper
Guest
« Reply #9 on: January 31, 2007, 02:06:52 pm »

Quote from: Nightcrawler on January 31, 2007, 10:22:34 am
Chrono Trigger probably uses an LZ variant like most SNES games. We have a few compression documents in our database to cover this. Jay's compression tutorial is my favorite.
Nope, it uses good ol' DTE, just like the other Square games. Smiley
g00gy
Guest
« Reply #10 on: January 31, 2007, 02:27:22 pm »

->DarknessSavior
Wow   Grin sounds really good. Thanx for the info im gonna try it out.

->Kitsune Sniper
Well i know how DTE works. When a hex value represents two letters. I heard i have to use trial and error with this type of compression. But where do i begin lol seems difficult. do i use a hex editor or do i have to decompress?
DarknessSavior
Guest
« Reply #11 on: January 31, 2007, 02:30:03 pm »

Oh, and if you don't want to make one, you can just use the one included with the Chrono Trigger Text Editor. I was 95% finished when I found that. >.<

But, if you want to do it just to get experience in making tables for that, CT is good practice. I'd reccomend Final Fantasy - Mystic Quest if you want something easier. CT has TONS of extra hex values.

~DS
g00gy
Guest
« Reply #12 on: January 31, 2007, 03:13:12 pm »

well i tried it out and it doesnt work. do you have to save for the srm. if so then you have to go all the way to the other world castle to save. unless you are referring to savestate.

i also tried comparing them and it didnt work. both will apear on hexworkshop but it doesnt highlight or show you where there are diffrences

p.s. i want to do it for the experiance
DarknessSavior
Guest
« Reply #13 on: January 31, 2007, 03:17:15 pm »

Yes, you have to actually save the game. And no, you don't have to do anything to save, just go outside Crono's house, open the menu, and save.

~DS
g00gy
Guest
« Reply #14 on: January 31, 2007, 03:32:05 pm »

yep thanx its actually working.

but i still dont know how to detect what form of compression a rom has please someone answer me this question. how do i trace and what is a debugging capable emulator.

i can hack nes roms that have no compression but i just need someone to show me the way.
Pages: [1] 2  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC