+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Expanding the script
Pages: 1 [2]
Poll
Question:
Total Voters:

Author Topic: Expanding the script  (Read 1 times)
RedComet
Guest
« Reply #15 on: January 19, 2011, 08:57:20 am »

Quote from: Normmatt on January 19, 2011, 01:38:24 am
Quote from: RedComet on January 18, 2011, 03:23:53 pm
Just put -$4000. The sample command files demonstrate this ability. Roll Eyes

Not in the current build in the Utilities section its not. Using minus in that version didn't work for me either hence my ugly work around.

That's weird. Maybe the build I released was older than the one I'm using. :S I'm gonna hopefully look into fixing the bugs I know about in Cartographer soon. In the mean time, here's an example:

Code:
#BLOCK NAME:\t\tCard Descriptions
#TYPE:\t\t\tNORMAL
#METHOD:\t\tPOINTER_RELATIVE
#POINTER ENDIAN:\tLITTLE
#POINTER TABLE START:\t$6DB2\t\t\t//Bank 01
#POINTER TABLE STOP:\t$6DF4
#POINTER SIZE:\t\t$02
#POINTER SPACE:\t\t$00
#ATLAS PTRS:\t\tYes
#BASE POINTER:\t\t-$3FF0\t\t\t//Script begins before $8000
#TABLE:\t\t\tdbz2.tbl
#COMMENTS:\t\tYes
#END BLOCK
Normmatt
Guest
« Reply #16 on: January 19, 2011, 08:02:52 pm »

I just had a look into the game and it uses relative pointers for the main dialogue not standard GBA type pointers. The pointer table starts at 08051070 and by the looks of the text at 08756A08

It calculates it by doing this:
Code:
//R3 is string id?
LDR     R1, =unk_8051070
LSLS    R0, R3, #2
ADDS    R0, R0, R1
LDR     R0, [R0]
LDR     R1, =unk_8756A08
ADDS    R0, R0, R1

Which basically means read 32bits from (stringID*2 + 08051070) then add that to 08756A08 to get the final string location.

I haven't found any way of switching between the english and japanese text yet and it doesnt look like it was ever programmed in so you'll probably need to extract the english dialogue and replace the japanese dialogue.
DeGamer
Guest
« Reply #17 on: January 20, 2011, 03:09:05 pm »

Quote from: Normmatt on January 19, 2011, 08:02:52 pm
I haven't found any way of switching between the english and japanese text yet and it doesnt look like it was ever programmed in so you'll probably need to extract the english dialogue and replace the japanese dialogue.

That would be a shame if the game wasn't programmed for both languages despite the script being there.  However, even if Arcadia453 changed each pointer from the Japanese dialogs to the English counterparts (which is probably what he'll have to do), this wouldn't necessarily change how the font's width of the Japanese characters are displayed to how the English font width should be displayed would it? Meaning, the game also may not be programmed to display a VWF, right?


Quote from: Normmatt on January 19, 2011, 01:38:24 am
Quote from: RedComet on January 18, 2011, 03:23:53 pm
Just put -$4000. The sample command files demonstrate this ability. Roll Eyes

Not in the current build in the Utilities section its not. Using minus in that version didn't work for me either hence my ugly work around.


So it's not just me.  :huh:


Quote from: Ryusui on January 18, 2011, 09:07:35 pm
Just make a copy of the ROM and test to see if negative offsets work properly.

No dice. It just outputs other non-text data which is not part of the script or crashes the program. Unless I'm doing this wrong, which I think I am (and I've never used Cartographer before but I think I understand all the commands as I can get a script dump of my game, just not with the POINTER_RELATIVE method).

Here's what I'm doing:

Code:
#BLOCK NAME:\t\tNavi Hints 1 (POINTER_RELATIVE)
#TYPE:\t\t\tNORMAL
#METHOD:\t\tPOINTER_RELATIVE
#POINTER TABLE START:\t$1AC830
#POINTER TABLE STOP:\t$1AC859
#POINTER SIZE:\t\t$04
#POINTER SPACE:\t\t$04
#POINTER ENDIAN:\tLITTLE
#ATLAS PTRS:\t\tYES
#BASE POINTER:\t\t-$3FE7F080\t\t//subtract $3FE7F080 to each pointer to get
#TABLE:\t\t\tNavi Hints.tbl\t\t//the string address
#COMMENTS:\t\tYES
#END BLOCK

This is just a small section of the table I was using as a test to see if I could get a dump of what I need this way. The pointers are 32bit (which is probably the part confusing me) and there are 4 bytes of code between each pointer. The first pointer located at address 001AC830 has a value of 4C D5 06 80 which points to a string at address 0016ED0C.

If I take the string address' last two bytes ED 0C and reverse them, 0C ED and add 3FE8 it gives me the first two bytes of the pointer 4C D5. If I take the string address' first two bytes 00 16, and reverse them, 16 00 and add F080 it gives me the last two bytes of the pointer 06 80.

Now if I take the whole string address (00 16 ED 0C)  and reverse it (0C ED 16 00) and add 3F E7 F0 80, it gives me the whole pointer value of 4C D5 06 80 (which is the correct pointer but in the amount I was adding, I had to subtract 1 from the second byte based on what I wrote above). This is what I understand based on all the documents I've read here which did help me find these type of pointers.

So wouldn't that mean that taking the pointer value 4C D5 06 80 and subtracting 3F E7 F0 80 give me the string address of 0016ED0C (but reversed)?  In my scenario, shouldn't -$3FE7F080 be my BASE POINTER? I also tried -$F0803FE7 but both of those crashes the program (out of range?). Maybe I'm not understanding this right or I'm looking at it wrong.   Undecided\
Pages: 1 [2]  


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