+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Write offsets in script?
Pages: [1]
Author Topic: Write offsets in script?  (Read 690 times)
Zeef
Guest
« on: October 05, 2007, 06:03:03 pm »

Romjuice does almost everything I want, but there is one thing missing that I would like.

The script is stored in the rom in several chunks, which I've identified - however, I'd love for romjuice to be able to add the address/offset (in the rom) of each paragraph/string when extracting. The reason for this is that I intend to make a wiki translation table with a seperate row for every paragraph and would really love to have the offset listed for every one. Why, you ask? Because this will make testing 100 times easier in terms of reinserting individual strings, and will also make searching for text pointers a breeze.

All it'd take would be a code, similar to the ones that are already implemented, that I could insert after whatever I have for my string/paragraph end.
\\o for offset perhaps Tongue?

I don't know if there is another extracter that can do this already, but if someone could point me in the right direction, or knows how to modify the source (I'm not a programmer, but the .c file is included in the zip) of romjuice so it can achieve this, it'd be very very much appreciated.
Gideon Zhi
Guest
« Reply #1 on: October 05, 2007, 08:48:12 pm »

I actually did that. I added \\@ to romjuice, but I haven't released it because I added a few other features that broke things. It's really not all that difficult, but it's been some years since I did the mod...

I might throw something together tomorrow, an updated romjuice *just* with that new feature. We'll have to see.
Zeef
Guest
« Reply #2 on: October 05, 2007, 10:03:35 pm »

Quote from: Gideon Zhi on October 05, 2007, 08:48:12 pm
I actually did that. I added \\@ to romjuice, but I haven't released it because I added a few other features that broke things. It's really not all that difficult, but it's been some years since I did the mod...

I might throw something together tomorrow, an updated romjuice *just* with that new feature. We'll have to see.
You will be my hero if you do Smiley
hanhnn
Guest
« Reply #3 on: October 11, 2007, 01:47:31 pm »

Quote from: Gideon Zhi on October 05, 2007, 08:48:12 pm
I actually did that. I added \\@ to romjuice, but I haven't released it because I added a few other features that broke things. It's really not all that difficult, but it's been some years since I did the mod...

I might throw something together tomorrow, an updated romjuice *just* with that new feature. We'll have to see.
i cant find the new updated one
did you upload it
Gideon Zhi
Guest
« Reply #4 on: October 12, 2007, 09:58:12 pm »

No, I didn't. I tinkered with it for a bit last Sunday, but couldn't get it working without completely breaking kanji arrays. Closest I got had it displaying the address every two bytes, which is completely worthless because it didn't display any actual text.
Zeef
Guest
« Reply #5 on: October 13, 2007, 12:45:53 am »

Well, I had a programmer friend help me out, and I made a version (it doesn't work with the kanji stuff like you already mentioned, but I don't use that anyway) that more or less does what I want, with a few quirks.

So from absolutely 0/zilch/nada knowledge of C to successfully modifying a couple of functions and also inserting my own for flipping the offsets for standard GBA pointer format (of course I was guided through all this), I'm reasonably happy.

A custom command ("\\o") was implemented that I can insert in my 'string end' line which means it will put the offset/address for the next string just above it.

This was done:
-by modifying the "prints" method to accept another argument and then implementing the special command (and its output with the new variable)
-since the main loop does
Code:
cur+=(4-check)
on each iteration, I just passed the extra argument as
Code:
cur+(4-check)
so it does the address for the NEXT string rather than the CURRENT position.

Of course, my table file is complete for the game I'm working on, and I don't use any of the special bits and pieces, so only the
Code:
else if ( resolved->string )
block gets called, none of the others - this is why it's a bit of a dirty hack just to suit me.

There is still a quirk or two:
-since the special command only gets called at the 'end of string' indentifier, the very first offset doesn't appear - however this is trivial, especially since romjuice has its own little header thing anyway which tells you Tongue
-my entire script is divided up into lots of little parts, I use a batch file to run the app multiple times (so it processes all the blocks) and append each output to a text file. The thing that annoys me is the fact that my offset thingy will still be added on the last iteration of the main loop when there's no more strings to come (at least until the batch file runs the app again for the next block) - I just want that last one to disappear altogether because I'm trying to format the output script for easy conversion to a wiki table. I've tried to do this but failed and the programmer dude that helped me ran away somewhere Sad
« Last Edit: October 13, 2007, 12:52:04 am by Zeef »
Zeef
Guest
« Reply #6 on: October 20, 2007, 03:56:49 am »

Well, my many more hacky modifications have culminated into this: http://wiki.gbatemp.net/index.php?title=Rhythm_Tengoku_Translation

I know it's not exactly appropriate here, but anyone is free to help out if they wish - I just thought people might wanna see what I was up to.
Pages: [1]  


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