+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Cartographer
Pages: 1 2 3 [4] 5 6
Author Topic: Cartographer  (Read 3 times)
Nightcrawler
Guest
« Reply #45 on: November 23, 2009, 11:36:53 am »

Ok. Two developments.

1 Cartographer apparently requires commands to be in a specific order or it complains.
2. It now dumps the whole desired range, but doesn't output any line breaks or line controls or anything. I just get a raw dump of the range. It's my understanding from the documentation it should stick line breaks in there or at least print (LINE). I've even tried the #LINE CTRL command. No difference.

Any ideas?

Code:
#GAME NAME: Tenshi No Uta (SNES)

#BLOCK NAME: Magic Names (RAW)
#TYPE: FIXED_STRING && FIXED_LINE
#STRING LENGTH: 6
#STRING END: No
#LINE LENGTH: 6
#LINE END: Yes
#LINE CTRL: 41
#METHOD: RAW
#SCRIPT START: $d6f00
#SCRIPT STOP: $d7640
#TABLE: tenshi8x16j.tbl
#COMMENTS: Yes //start first line with //
#END BLOCK //remainder of comment placement
//is handled by control codes
RedComet
Guest
« Reply #46 on: November 23, 2009, 05:40:53 pm »

How is the data stored? Something like this:

A name
B name
C name
(Each of these is a separate 6 character long string.)

And in ROM it looks like this:

A nameB nameC name

In other words, there's no end of string control code, right?
Nightcrawler
Guest
« Reply #47 on: November 24, 2009, 08:22:06 am »

Right. Man oh man, if we can't sort this out soon, I could have coded my own generic dumper by now! Tongue

In game:
AAAAAA
BBBBBB
CCCCCC
DDDDDD
EEEEEE
FFFFFF

In ROM:
AAAAAABBBBBBCCCCCCDDDDDDEEEEEEFFFFFF

Current Cartographer Output:
AAAAAABBBBBBCCCCCCDDDDDDEEEEEEFFFFFF

Desired Cartographer Output:
AAAAAA
BBBBBB
CCCCCC
DDDDDD
EEEEEE
FFFFFF
RedComet
Guest
« Reply #48 on: November 24, 2009, 09:29:12 am »

Code:
#GAME NAME: Tenshi No Uta (SNES)

#BLOCK NAME: Magic Names (RAW)
#TYPE: FIXED_STRING
#STRING LENGTH: 6
#STRING END: Yes
#END CTRL: [END]                //you can change this to whatever
#METHOD: RAW
#SCRIPT START: $d6f00
#SCRIPT STOP: $d7640
#TABLE: tenshi8x16j.tbl
#COMMENTS: Yes //start first line with //
#END BLOCK //remainder of comment placement
//is handled by control codes

Try that. The #END CTRL specifies a little string of text that you want output at the end of each string. This isn't an actual control code in the game. Rather it's just something I added that would end up in the script to make it easier to determine where individual strings end.

With the above your example should output like this:

AAAAAA[END]

BBBBBB[END]

CCCCCC[END]

DDDDDD[END]

EEEEEE[END]

FFFFFF[END]


The FIXED_LINE thing is really for Genesis games that don't specify line breaks instead leaving it up to the tilemap to insert them. Bare Knuckle 3 did this. It would stick all of the tiles in VRAM right after one another and the tilemap was changed separately.

Here's an example:

Code:
#GAME NAME: Tenshi No Uta (SNES)

#BLOCK NAME: Magic Names (RAW)
#TYPE: FIXED_STRING && FIXED_LINE
#STRING LENGTH: 12
#STRING END: Yes
#END CTRL: [END]                //you can change this to whatever
#LINE LENGTH:      6
#LINE END:         Yes
#LINE CTRL:         [LINE]                  //this can be whatever you want too
#METHOD: RAW
#SCRIPT START: $d6f00
#SCRIPT STOP: $d7640
#TABLE: tenshi8x16j.tbl
#COMMENTS: Yes //start first line with //
#END BLOCK //remainder of comment placement
//is handled by control codes

In ROM:
AAAAAABBBBBBCCCCCCDDDDDDEEEEEEFFFFFF

Output:

AAAAAA[LINE]
BBBBBB[END]

CCCCCC[LINE]
DDDDDD[END]

EEEEEE[LINE]
FFFFFFF[END]

Hope that clears things up.
Nightcrawler
Guest
« Reply #49 on: November 24, 2009, 04:01:53 pm »

Now I'm about right back to where I started. I tried your code. It only outputs 6 characters or 1 item again. It prints [END], however it doesn't bother dumping past the first item. Your program is as lazy as you are Red!  :laugh:

Output:
AAAAAA[END]

Is this a bug in your program?
RedComet
Guest
« Reply #50 on: November 24, 2009, 07:03:40 pm »

Yeah, that must be a bug. I dunno what the hell the deal is.  :huh:
C_CliFF
Guest
« Reply #51 on: April 03, 2011, 12:46:58 pm »

This was the only related topic I could find for a problem I stumbled upon.

Is it possible for Cartographer to dump text that uses a sandwich format?

This is a 11 year old project I had, again FF5.

This is how it looks:



And this is where the pointer are:



This is a 200h rom.

As you can see, this one doesn't have an end byte to it. This is also not fixed strings.

And this is my settings:

Code:
// 270200 - 270862

#BLOCK NAME:\t\tLocation Names (POINTER_RELATIVE)
#TYPE:\t\t\tNORMAL
#METHOD:\t\tPOINTER_RELATIVE
#POINTER ENDIAN:\tLITTLE
#POINTER TABLE START:\t$107200
#POINTER TABLE STOP:\t$107344
#POINTER SIZE:\t\t$02
#POINTER SPACE:\t\t$00
#ATLAS PTRS:\t\tYes
#BASE POINTER:\t\t-$FFD8FE00\t\t// 0000 - 270200 = FFD8FE00, 0000 - FFD8FE00 = 270200
#TABLE:\t\t\tff5_ptr.tbl
#COMMENTS:\t\tYes
#END BLOCK

The output from this was a mess, with this text in a big chunk, since the text block doesen't specify an end-byte.

So, is it possible for Cartographer to dump text that doesn't have an end byte value?

-C_CliFF
RedComet
Guest
« Reply #52 on: April 03, 2011, 05:28:15 pm »

No. I didn't realize such a scheme existed, so I didn't add it.
Gideon Zhi
Guest
« Reply #53 on: April 03, 2011, 06:00:36 pm »

Only game I've seen that does this is Romancing SaGa 2. It had a few unused bytes in its data set though, so when initially dumping it I hijacked one of those and wrote a small program to rip the text to a new binary file and insert the dummy byte after each string as a placeholder end-of-string command. Course, this mucked up the data offsets for the pointers, but then, I wasn't using cartographer for it Smiley
RedComet
Guest
« Reply #54 on: April 03, 2011, 07:10:09 pm »

Quote from: Gideon Zhi on April 03, 2011, 06:00:36 pm
Only game I've seen that does this is Romancing SaGa 2. It had a few unused bytes in its data set though, so when initially dumping it I hijacked one of those and wrote a small program to rip the text to a new binary file and insert the dummy byte after each string as a placeholder end-of-string command. Course, this mucked up the data offsets for the pointers, but then, I wasn't using cartographer for it Smiley

I am HURT. Tongue
Gideon Zhi
Guest
« Reply #55 on: April 03, 2011, 07:45:47 pm »

Hey, Cartographer wasn't even a glimmer in your left testicle when RS2's script got dumped Wink
Nightcrawler
Guest
« Reply #56 on: April 04, 2011, 09:48:00 am »

This is a method of storage I have omitted from my WIP utility as well.  String Types  are C-Style (end terminated), Pascal (string length in the beginning), and Fixed. This is a bastardization. I do support a pointer table to fixed length strings no problem. However, we have variable length here with no length or end indication. Length can only be inferred from pointer math. Perhaps a 'Fixed Length by Next Pointer' option extension to Fixed Length string types. Something to that effect.

However, one big issue is what about the last string? How do you know how long the last string is? How does the game know in this case? This gets a little ugly and may turn into something very game specific.
Gideon Zhi
Guest
« Reply #57 on: April 04, 2011, 01:23:20 pm »

Quote from: Nightcrawler on April 04, 2011, 09:48:00 am
However, one big issue is what about the last string? How do you know how long the last string is? How does the game know in this case? This gets a little ugly and may turn into something very game specific.

At least in RS2's case, if there are n strings there are n+1 pointers.
C_CliFF
Guest
« Reply #58 on: April 04, 2011, 02:14:05 pm »

It's the same for the last string. Doesn't end with an end byte. The script ends when it hits an end byte value, which in this case passes beyond this script block, the monster names and spells. The monster and spell names are fixed strings, though.

The last string is supposed to end at $270862 but ends at $272962. The whole block, with the available space included, is between $270200 and $270AFF, so the extraction gets quite far before it hits the end.

This is the only block in the game that has this kind of format, so fortunately, it's not a real biggie. But maybe this applies to other games besides this and RS2.

-C_CliFF
RedComet
Guest
« Reply #59 on: April 04, 2011, 05:30:31 pm »

So the last string ends with an end control code or it doesn't end with an end control code? Your post is confusing.
Pages: 1 2 3 [4] 5 6  


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