logo
 drop

Main

Community

Submissions

Help

80577098 visitors

Author Topic: Which do you recommend?  (Read 2860 times)

justin3009

  • Hero Member
  • *****
  • Posts: 992
  • Location: Wisconsin
  • Welp
    • View Profile
Re: Which do you recommend?
« Reply #20 on: July 09, 2012, 05:19:26 pm »
This is going to be slightly confusing then.  The pointers that are used in X3 are consecutive but the text is literally out of order.  The first pointer loads text for basically the last string of the game and the middle of the pointers loads text for the beginning of the game.  But when the text is first readable, it's the first string in the entire game to be used.  Everything is COMPLETELY out of order so I'm not sure how Atlas will handle all of that, honestly, nor the game itself.  I have a feeling it may end up completely loading the wrong strings for mostly anything.

Edit: So basically telling Atlas to start writing text at a certain location just may not work since the text is completely out of order.
« Last Edit: July 09, 2012, 05:25:35 pm by justin3009 »
'We have to find some way to incorporate the general civilians in the plot'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

Gideon Zhi

  • IRC Staff
  • Hero Member
  • *****
  • Posts: 3060
  • Location: Seattle
    • View Profile
    • Aeon Genesis
Re: Which do you recommend?
« Reply #21 on: July 09, 2012, 05:35:38 pm »
Then what you need to do is dump the ENTIRE script, and go through tagging each string (even though it's out of order) with the proper pointer address in your #W16 command. It'll be somewhat time-consuming but you only have to do it once.

One thing you'll find is that the pointers and the strings are probably in roughly the same order, even if the text itself appears to be out of order. As a possibly more familiar example...

Quote
//[$03A8B7]
#W24($737A)
<$02><$04><$01><$20><$0A><$A6><$00><$10><$63>
King:<line>
It would be simple<line>
to kill you right<line>
here and now, but I<line>
am afraid I must see<line>
to assembling my<line>
great King Army!<pause2>

<$15><$14><$86><$00><$14><$C6><$00><$14><$06><$01><$14><$46><$01>
I shall let my Green<line>
Devil take care of<line>
you!<pause1>

<$14><$86><$00><$14><$C6><$00><end>

//[$03A937]
#W24($737D)
<$02><$04><$01><$20><$0A><$A6><$00><$10><$63>
King:<line>
Hehhehheh.<line>
Congratulations on<line>
making it this far!<line>
It would appear that<line>
I've underestimated<line>
you.<pause2>

<$15><$14><$86><$00><$14><$C6><$00><$14><$06><$01><$14><$46><$01>
But your battle ends<line>
here. Consider it an<line>
honor to be<line>
destroyed at the<line>
hands of the King<line>
himself!<pause1>

<$14><$86><$00><$14><$C6><$00><$14><$06><$01><$14><$46><$01><end>

//[$03A9D0]
#W24($7380)
<$02><$04><$01><$20><$0A><$A6><$00><$10><$61>
Blues:<line>
No, you're gonna<line>
face me, first!<pause1>

<$14><$86><$00><$14><$C6><$00><end>

You'll notice that the middle string is from the end of the game, while the strings around it are from the beginning. This is okay. So long as each string has the correct corresponding pointer write command, they can be in any order you want. I can rearrange this as...

Quote
//[$03A8B7]
#W24($737A)
<$02><$04><$01><$20><$0A><$A6><$00><$10><$63>
King:<line>
It would be simple<line>
to kill you right<line>
here and now, but I<line>
am afraid I must see<line>
to assembling my<line>
great King Army!<pause2>

<$15><$14><$86><$00><$14><$C6><$00><$14><$06><$01><$14><$46><$01>
I shall let my Green<line>
Devil take care of<line>
you!<pause1>

<$14><$86><$00><$14><$C6><$00><end>

//[$03A9D0]
#W24($7380)
<$02><$04><$01><$20><$0A><$A6><$00><$10><$61>
Blues:<line>
No, you're gonna<line>
face me, first!<pause1>

<$14><$86><$00><$14><$C6><$00><end>

//[$03A937]
#W24($737D)
<$02><$04><$01><$20><$0A><$A6><$00><$10><$63>
King:<line>
Hehhehheh.<line>
Congratulations on<line>
making it this far!<line>
It would appear that<line>
I've underestimated<line>
you.<pause2>

<$15><$14><$86><$00><$14><$C6><$00><$14><$06><$01><$14><$46><$01>
But your battle ends<line>
here. Consider it an<line>
honor to be<line>
destroyed at the<line>
hands of the King<line>
himself!<pause1>

<$14><$86><$00><$14><$C6><$00><$14><$06><$01><$14><$46><$01><end>

I could even rearrange it as...

Quote
//[$03A9D0]
#W24($7380)
<$02><$04><$01><$20><$0A><$A6><$00><$10><$61>
Blues:<line>
No, you're gonna<line>
face me, first!<pause1>

<$14><$86><$00><$14><$C6><$00><end>

//[$03A8B7]
#W24($737A)
<$02><$04><$01><$20><$0A><$A6><$00><$10><$63>
King:<line>
It would be simple<line>
to kill you right<line>
here and now, but I<line>
am afraid I must see<line>
to assembling my<line>
great King Army!<pause2>

<$15><$14><$86><$00><$14><$C6><$00><$14><$06><$01><$14><$46><$01>
I shall let my Green<line>
Devil take care of<line>
you!<pause1>

<$14><$86><$00><$14><$C6><$00><end>

//[$03A937]
#W24($737D)
<$02><$04><$01><$20><$0A><$A6><$00><$10><$63>
King:<line>
Hehhehheh.<line>
Congratulations on<line>
making it this far!<line>
It would appear that<line>
I've underestimated<line>
you.<pause2>

<$15><$14><$86><$00><$14><$C6><$00><$14><$06><$01><$14><$46><$01>
But your battle ends<line>
here. Consider it an<line>
honor to be<line>
destroyed at the<line>
hands of the King<line>
himself!<pause1>

<$14><$86><$00><$14><$C6><$00><$14><$06><$01><$14><$46><$01><end>

It doesn't really matter, so long as the #W24s are assigned for the correct strings.

justin3009

  • Hero Member
  • *****
  • Posts: 992
  • Location: Wisconsin
  • Welp
    • View Profile
Re: Which do you recommend?
« Reply #22 on: July 09, 2012, 05:42:34 pm »
Quote
#W16($1CC1BC)
[START]E<$08><$88><$04><$C1><$8B><$03>(Sigma)[LINE]
[LINE]
Garrrrr![LINE]
[LINE]
You're... Zero...[LINE]
[LINE]
<$81>[LINE]
<$86><$07><$87><$1E>It's you... again...[LINE]
[LINE]
<$81>[LINE]
<$86><$03><$87><$1E><$C2><$8B><$01>(ZERO)[LINE]
[LINE]
How do you like[LINE]
[LINE]
that, Sigma?[LINE]
[LINE]
<$81>[LINE]
<$86><$07><$87><$1E>I picked up a Anti-[LINE]
[LINE]
Sigma virus program[LINE]
[LINE]
from Doppler and[LINE]
[LINE]
<$81>[LINE]
<$86><$07><$87><$1E>used it on my Beam[LINE]
[LINE]
Sabre!![LINE]
[LINE]
<$81>[LINE]
<$86><$05><$87><$1E>Sorry about[LINE]
[LINE]
the delay X.[LINE]
[LINE]
<$81>[LINE]
<$86><$05><$87><$1E>I thought the[LINE]
[LINE]
program might[LINE]
[LINE]
be the only thing[LINE]
[LINE]
<$81><$86><$04>that would work[LINE]
[LINE]
against Sigma.[LINE]
[LINE]
<$81>[LINE]
<$86><$07><$87><$1E><$C1><$8B><$03>(SIGMA)[LINE]
[LINE]
My program... is...[LINE]
[LINE]
disappearing...[LINE]
[LINE]
<$81>[LINE]
<$86><$07><$87><$1E>But... someday...[LINE]
[LINE]
I... will...[LINE]
[LINE]
<$81>[LINE]

I'll have to alter that [LINE] junk as it's seriously annoying.  But yes, the pointers are perfectly fine from what I'm seeing.  So maybe it will be okay then.  The pointers ARE in the correct order from what I see.  Hm, I'll see if I can take a test run
'We have to find some way to incorporate the general civilians in the plot'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

Gideon Zhi

  • IRC Staff
  • Hero Member
  • *****
  • Posts: 3060
  • Location: Seattle
    • View Profile
    • Aeon Genesis
Re: Which do you recommend?
« Reply #23 on: July 09, 2012, 05:54:42 pm »
Don't feel bad if you don't quiet "get it" at first :) Atlas is an incredibly powerful program, and was written specifically to be able to handle two extremely nasty scripts: Front Mission: Gun Hazard (which has flags and jumps all over the place, ASM pointers, and actual 65816 code embedded directly in dialog strings) and Mystic Ark (which has flags and jumps all over the place, and ASM pointers.) Click here for an example of what it was built to be able to handle. Each one of those EMBSETs is a pointer embedded in a string, and each corresponding EMBWRITE writes the pointer back into the string. Really nasty stuff.

Here are some selected examples from Gun Hazard...

Quote
//[00051F1D]
#W16($51E18)
<$06>
#EMBSET(0001)
<$AF><$62><$75><$7E><$29><$FF><$00><$C9><$22><$00><$B0><$05><$A9><$66><$1C><$85><$B1><$6B>
#EMBWRITE(0001)
<$16><$28>
#EMBSET(0260)
<$04><$35>
Aren't you <name>?<sect>
C'mere a sec...<sect>
See, I recently<line>
managed to get my<line>
hands on a Society<sect>
Wanzer prototype.<line>
If I don't unload<line>
it soon, I'll be<sect>
in real trouble...<line>
Interested? It'll<line>
cost you, but...<sect>
This new "Dragoon"<line>
should be right up<line>
your alley!<$14><$28><END>

//[0005075D]:
#W16($6F64)
<$04><$00>
<$06>
#EMBSET(0037)
<$AE><$E0><$1C><$BF><$3C><$54><$C2><$8D><$E0><$1C><$BF><$3E><$54><$C2><$8D><$E2><$1C><$6B>
#EMBWRITE(0037)

//$AE$E0$1C      LDX $1CE0
//$BF$3C$54$C2   LDA $543C,$C2
//$8D$E0$1C      STA $1CE0
//$BF$3E$54$C2   LDA $543E,$C2
//$8D$E2$1C      STA $1CE2
//$6B            RTL
All right!<line>
<$01><$04><$E0><$1C> dollars!<END>

justin3009

  • Hero Member
  • *****
  • Posts: 992
  • Location: Wisconsin
  • Welp
    • View Profile
Re: Which do you recommend?
« Reply #24 on: July 09, 2012, 06:08:08 pm »
What in God's name ._.  That's really.. ack to deal with.  Now I see why Atlas is incredibly useful.  Dealing with that by hand would be suicide in general.  I think Tales of Phantasia may have had something similar, if not, I know it has some really ugly text handling from what I recall.

I'm trying another whack with Atlas.

Quote
#SMA("LOROM80")
#VAR(dialogue,TABLE)
#ADDTBL("MMX3.tbl", dialogue)

#ACTIVETBL(dialogue)

#JMP($1CC1BC,$1CFFFF)


//POINTER #0 @ $1CC1BC - STRING #0 @ $1CFDAD

#W16($1CC1BC)
<$89>E<$08><$88><$04><$C1><$8B><$03>(Sigma)<line>
<line>
Garrrrr!<line>
<line>
You're... Zero...<line>
<line>

This time I was trying to mimic what you did as it seems like it'd be the easiest way in general anyhow.

1CC1BC is where the pointers start.

It says now:



But nothing has been written.  3:
1CC2B0 is where the actual text starts.

The file data ends at 1CFFFF and I made sure of that.
'We have to find some way to incorporate the general civilians in the plot'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

Gideon Zhi

  • IRC Staff
  • Hero Member
  • *****
  • Posts: 3060
  • Location: Seattle
    • View Profile
    • Aeon Genesis
Re: Which do you recommend?
« Reply #25 on: July 09, 2012, 06:12:28 pm »
If 1CC2B0 is where the actual text starts, you should be #JMPing to that. If you start writing text at 1CC1BC then start writing pointers to 1CC1BC, 1CC1BE, 1CC1C0, etc, the pointers will overwrite your text. Your output is telling me that the script got written though, so I'm not sure why you're not seeing the changes.

Ryusui

  • Hero Member
  • *****
  • Posts: 4977
  • Location: In the third dimension!
  • IT'S LIKE I CAN TOUCH YOU!!!
    • View Profile
    • Homepage and DevBlog
Re: Which do you recommend?
« Reply #26 on: July 09, 2012, 06:16:10 pm »
The pointers that are used in X3 are consecutive but the text is literally out of order.  The first pointer loads text for basically the last string of the game and the middle of the pointers loads text for the beginning of the game.  But when the text is first readable, it's the first string in the entire game to be used.  Everything is COMPLETELY out of order so I'm not sure how Atlas will handle all of that, honestly, nor the game itself.  I have a feeling it may end up completely loading the wrong strings for mostly anything.

That's what Cartographer is good for.

The bad news is that the script lines will be dumped in the same order as the pointers that point to them. The good news is...the script lines will be dumped in the same order as the pointers that point to them. In the long run, it shouldn't matter what order the script is stored in as long as the pointers are pointing to the right ones. And if you configure it properly, Cartographer will automatically format the script to insert pointers in the right place.
Chiriyuku polaroid, atsumete paranoia...tsugi wa dare no ban da oshiete hoshii...

Fukanzen na jittai ni yorisoi nemureba...understand mieru darou!

justin3009

  • Hero Member
  • *****
  • Posts: 992
  • Location: Wisconsin
  • Welp
    • View Profile
Re: Which do you recommend?
« Reply #27 on: July 09, 2012, 06:18:48 pm »
YES!  It's working now!  I'll probably have to take a check through the game to be sure but the introduction checked FINALLY changed without any issues!

Edit: Okay, Atlas for sure is working now.  But for some reason, Cartographer is literally skipping a few chunks of lines for some uncertain reason.  I honestly don't know why or how, but it is.

Edit 2: Alright, think I fixed it.  I had to write another special case for 8982 so it'd think it's a continuation of text instead of ending.  NOW it dumped the entire script!

Edit 3: And VOILA!  Atlas is now working perfectly with insertion and I've got a good working Cartographer dumping look now too!  Thank you all very much for the help :D  This is seriously going to save me HOURS of work.

Edit 4: Perfect!  I just edited the script file and bumped all the pointers to start at 210000.  Edited each one manually and inserted :)  Text is loading flawlessly from banks 21 for X now with PLENTY of room left over!
« Last Edit: July 09, 2012, 07:16:37 pm by justin3009 »
'We have to find some way to incorporate the general civilians in the plot'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

Klarth

  • Sr. Member
  • ****
  • Posts: 423
  • Location: Pittsburgh
    • View Profile
Re: Which do you recommend?
« Reply #28 on: July 10, 2012, 03:40:01 am »
Next time you'll save even more hours of work because the initial learning curve is mostly gone.

I really should work on more time-saving romhacking tools someday.

Ryusui

  • Hero Member
  • *****
  • Posts: 4977
  • Location: In the third dimension!
  • IT'S LIKE I CAN TOUCH YOU!!!
    • View Profile
    • Homepage and DevBlog
Re: Which do you recommend?
« Reply #29 on: July 10, 2012, 04:18:08 am »
Say, come to think of it, are embedded pointer tables a new feature? Because I remember hacking pretty much that exact same function into Atlas when I worked on Sylvanian Families (circa early 2006). With that in mind, here's a future feature suggestion: relative embedded pointer support.
Chiriyuku polaroid, atsumete paranoia...tsugi wa dare no ban da oshiete hoshii...

Fukanzen na jittai ni yorisoi nemureba...understand mieru darou!

Klarth

  • Sr. Member
  • ****
  • Posts: 423
  • Location: Pittsburgh
    • View Profile
Re: Which do you recommend?
« Reply #30 on: July 10, 2012, 04:46:45 am »
Embedded pointers were in way before the first public release, though they were slightly revamped.  And yes, I do need to make a "RELATIVE" pointer mode.  "LINEAR" with a constant add/subtract value doesn't cut it in this situation.

Ryusui

  • Hero Member
  • *****
  • Posts: 4977
  • Location: In the third dimension!
  • IT'S LIKE I CAN TOUCH YOU!!!
    • View Profile
    • Homepage and DevBlog
Re: Which do you recommend?
« Reply #31 on: July 10, 2012, 05:20:22 am »
The version I used had embedded pointers; I'm talking about embedded pointer tables, like when you need to set up an enormous block of embedded pointers (per example 5 from the PDF).
Chiriyuku polaroid, atsumete paranoia...tsugi wa dare no ban da oshiete hoshii...

Fukanzen na jittai ni yorisoi nemureba...understand mieru darou!

Klarth

  • Sr. Member
  • ****
  • Posts: 423
  • Location: Pittsburgh
    • View Profile
Re: Which do you recommend?
« Reply #32 on: July 10, 2012, 07:19:12 am »
The version I used had embedded pointers; I'm talking about embedded pointer tables, like when you need to set up an enormous block of embedded pointers (per example 5 from the PDF).
Oh.  That came much later, 1.1 I think.

Nightcrawler

  • Hero Member
  • *****
  • Posts: 5808
    • View Profile
    • Nightcrawler's Translation Corporation
Re: Which do you recommend?
« Reply #33 on: July 10, 2012, 08:23:20 am »
Don't feel bad if you don't quiet "get it" at first :) Atlas is an incredibly powerful program, and was written specifically to be able to handle two extremely nasty scripts: Front Mission: Gun Hazard (which has flags and jumps all over the place, ASM pointers, and actual 65816 code embedded directly in dialog strings) and Mystic Ark (which has flags and jumps all over the place, and ASM pointers.) Click here for an example of what it was built to be able to handle. Each one of those EMBSETs is a pointer embedded in a string, and each corresponding EMBWRITE writes the pointer back into the string. Really nasty stuff.

Here are some selected examples from Gun Hazard...

I handle this in an entirely different way. Most of my projects have annoying systems just like that. I find it far easier to completely ignore all of the pointers and embedded hex data. I don't even dump it. I dump only the relevant text. It's much cleaner. Then, when I insert, I insert a new redirection control code w/ pointer in the original string's spot pointing to the new location. A small hack to the text system for the new control code and it becomes a beautiful thing. :)
TransCorp - Over 15 years of community dedication.
Dual Orb 2, Wozz, Emerald Dragon, Tenshi No Uta, Herakles IV SFC/SNES Translations

Ryusui

  • Hero Member
  • *****
  • Posts: 4977
  • Location: In the third dimension!
  • IT'S LIKE I CAN TOUCH YOU!!!
    • View Profile
    • Homepage and DevBlog
Re: Which do you recommend?
« Reply #34 on: July 10, 2012, 10:10:17 am »
I handle this in an entirely different way. Most of my projects have annoying systems just like that. I find it far easier to completely ignore all of the pointers and embedded hex data. I don't even dump it. I dump only the relevant text. It's much cleaner. Then, when I insert, I insert a new redirection control code w/ pointer in the original string's spot pointing to the new location. A small hack to the text system for the new control code and it becomes a beautiful thing. :)

How do you handle returns?
Chiriyuku polaroid, atsumete paranoia...tsugi wa dare no ban da oshiete hoshii...

Fukanzen na jittai ni yorisoi nemureba...understand mieru darou!

Nightcrawler

  • Hero Member
  • *****
  • Posts: 5808
    • View Profile
    • Nightcrawler's Translation Corporation
Re: Which do you recommend?
« Reply #35 on: July 10, 2012, 02:41:09 pm »
Depends on the game engine. Most of the time return handling was't needed as after it hits string end, it will continue as if it had hit the original string's end. On some games it has been necessary to return to the original location and seek (or add new relative offset from insertion) to original string end. But that has only been necessary when I am forced to hijack the original variables and the engine heavily relies on byte counting during the whole process. Usually, I am able to inject the new jump, use new variables, and return control as if I was never there and the original string executed as planned.

The details vary a tiny bit depending on game, but the idea is the same. Ninja stealth attack. The game happily executes all of the original jumps and pointers thinking nothing has happened. In essence, creating new redirect pointers can be easier than successfully updating all the old ones. :)

The only time I've gotten myself in trouble with the methodology described above is when I needed to use several bytes for the new pointers, and a return offset, and found the game had some strings that were only 1, 2, or 3 characters. Not enough to fit my information in. What I did for those was simply provide them a single byte string index to a special area containing such strings. That's another idea actually. I could have done that for the entire game. One can use string indexes rather than new pointers if the code knew where new text blocks were statically stored.

That's the joy of ROM hacking. There's always more than one way to do things. Creativity is your weapon. :)
TransCorp - Over 15 years of community dedication.
Dual Orb 2, Wozz, Emerald Dragon, Tenshi No Uta, Herakles IV SFC/SNES Translations

Klarth

  • Sr. Member
  • ****
  • Posts: 423
  • Location: Pittsburgh
    • View Profile
Re: Which do you recommend?
« Reply #36 on: July 11, 2012, 07:15:32 pm »
That's the joy of ROM hacking. There's always more than one way to do things. Creativity is your weapon. :)
For the most part, I enjoy the challenge of putting Humpty Dumpty back together again.

Gideon Zhi

  • IRC Staff
  • Hero Member
  • *****
  • Posts: 3060
  • Location: Seattle
    • View Profile
    • Aeon Genesis
Re: Which do you recommend?
« Reply #37 on: July 11, 2012, 10:39:05 pm »
For the most part, I enjoy the challenge of putting Humpty Dumpty back together again.

It's good fun. But we wouldn't need to put Humpty Dumpty back together again if we weren't the ones pushing him off the wall in the first place.

Ryusui

  • Hero Member
  • *****
  • Posts: 4977
  • Location: In the third dimension!
  • IT'S LIKE I CAN TOUCH YOU!!!
    • View Profile
    • Homepage and DevBlog
Re: Which do you recommend?
« Reply #38 on: July 11, 2012, 10:47:02 pm »
Well, you know what they say about omelets...
Chiriyuku polaroid, atsumete paranoia...tsugi wa dare no ban da oshiete hoshii...

Fukanzen na jittai ni yorisoi nemureba...understand mieru darou!