News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Cartographer  (Read 33265 times)

BRPXQZME

  • Hero Member
  • *****
  • Posts: 4572
  • じー
    • View Profile
    • The BRPXQZME Network
Re: Cartographer
« Reply #40 on: November 09, 2009, 02:32:59 pm »
He will always be the Accidental Destroyer of Threads.
we are in a horrible and deadly danger

RedComet

  • Hero Member
  • *****
  • Posts: 3163
    • View Profile
    • Twilight Translations
Re: Cartographer
« Reply #41 on: November 10, 2009, 12:15:10 am »
He will always be the Accidental Destroyer of Threads.

I do it better when I'm drunk and have mod powers. :P
Twilight Translations - More than just Dragonball Z. :P

Lilinda

  • Hero Member
  • *****
  • Posts: 4539
    • View Profile
Re: Cartographer
« Reply #42 on: November 10, 2009, 12:16:32 am »
There's still a report to moderator button...
Retired moderator/staff member as of July 14th 2016

Nightcrawler

  • Hero Member
  • *****
  • Posts: 5755
    • View Profile
    • Nightcrawler's Translation Corporation
Re: Cartographer
« Reply #43 on: November 20, 2009, 03:42:50 pm »
I decided to play around with Cartographer since I don't have a robust generic dumper utility. First thing I tried to make it do is fixed length item list dumping. Apparently, it doesn't seem to want to dump more than the first item.

Commands:

#GAME NAME:      Tenshi No Uta (SNES)

#BLOCK NAME:   Magic Names (RAW)
#TYPE:         FIXED_STRING
#STRING LENGTH:   6
#STRING END:      No
#METHOD:      RAW
#SCRIPT START:   $d6f00
#SCRIPT STOP:   $d7640
#TABLE:         tenshi8x16j.tbl
#COMMENTS:      Yes      //start first line with //
#END BLOCK            //remainder of comment placement

It dumps the first 6 bytes and that's it. What am I doing wrong? Or can't Cartographer do something like this?
TransCorp - Over 20 years of community dedication.
Dual Orb 2, Wozz, Emerald Dragon, Tenshi No Uta, Glory of Heracles IV SFC/SNES Translations

Dragonsbrethren

  • Hero Member
  • *****
  • Posts: 1414
    • View Profile
    • Dragonsbrethren Industries
Re: Cartographer
« Reply #44 on: November 20, 2009, 05:15:52 pm »
I think you need to do both FIXED_STRING and FIXED_LINE, at least that's what I did:

Code: [Select]
#BLOCK NAME: Status effect names
#TYPE: FIXED_STRING && FIXED_LINE
#STRING LENGTH: 10
#STRING END: No
#LINE LENGTH: 10
#LINE END: Yes
#METHOD: RAW
#SCRIPT START: $2AFE1
#SCRIPT STOP: $2B121
#TABLE: ff6_snes_menu_a.tbl
#COMMENTS: No
#END BLOCK

I can't remember why I did it this way anymore, but there must've been a reason. You also need to have LINE END set to Yes or you'll get an error about it.

Nightcrawler

  • Hero Member
  • *****
  • Posts: 5755
    • View Profile
    • Nightcrawler's Translation Corporation
Re: Cartographer
« 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: [Select]
#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
TransCorp - Over 20 years of community dedication.
Dual Orb 2, Wozz, Emerald Dragon, Tenshi No Uta, Glory of Heracles IV SFC/SNES Translations

RedComet

  • Hero Member
  • *****
  • Posts: 3163
    • View Profile
    • Twilight Translations
Re: Cartographer
« 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?
Twilight Translations - More than just Dragonball Z. :P

Nightcrawler

  • Hero Member
  • *****
  • Posts: 5755
    • View Profile
    • Nightcrawler's Translation Corporation
Re: Cartographer
« 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! :P

In game:
AAAAAA
BBBBBB
CCCCCC
DDDDDD
EEEEEE
FFFFFF

In ROM:
AAAAAABBBBBBCCCCCCDDDDDDEEEEEEFFFFFF

Current Cartographer Output:
AAAAAABBBBBBCCCCCCDDDDDDEEEEEEFFFFFF

Desired Cartographer Output:
AAAAAA
BBBBBB
CCCCCC
DDDDDD
EEEEEE
FFFFFF
TransCorp - Over 20 years of community dedication.
Dual Orb 2, Wozz, Emerald Dragon, Tenshi No Uta, Glory of Heracles IV SFC/SNES Translations

RedComet

  • Hero Member
  • *****
  • Posts: 3163
    • View Profile
    • Twilight Translations
Re: Cartographer
« Reply #48 on: November 24, 2009, 09:29:12 am »
Code: [Select]
#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: [Select]
#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.
Twilight Translations - More than just Dragonball Z. :P

Nightcrawler

  • Hero Member
  • *****
  • Posts: 5755
    • View Profile
    • Nightcrawler's Translation Corporation
Re: Cartographer
« 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?
TransCorp - Over 20 years of community dedication.
Dual Orb 2, Wozz, Emerald Dragon, Tenshi No Uta, Glory of Heracles IV SFC/SNES Translations

RedComet

  • Hero Member
  • *****
  • Posts: 3163
    • View Profile
    • Twilight Translations
Re: Cartographer
« 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:
Twilight Translations - More than just Dragonball Z. :P

C_CliFF

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
    • General CoolNES Translations
Re: Cartographer
« Reply #51 on: April 03, 2011, 01: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: [Select]
// 270200 - 270862

#BLOCK NAME: Location Names (POINTER_RELATIVE)
#TYPE: NORMAL
#METHOD: POINTER_RELATIVE
#POINTER ENDIAN: LITTLE
#POINTER TABLE START: $107200
#POINTER TABLE STOP: $107344
#POINTER SIZE: $02
#POINTER SPACE: $00
#ATLAS PTRS: Yes
#BASE POINTER: -$FFD8FE00 // 0000 - 270200 = FFD8FE00, 0000 - FFD8FE00 = 270200
#TABLE: ff5_ptr.tbl
#COMMENTS: Yes
#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

  • Hero Member
  • *****
  • Posts: 3163
    • View Profile
    • Twilight Translations
Re: Cartographer
« Reply #52 on: April 03, 2011, 06:28:15 pm »
No. I didn't realize such a scheme existed, so I didn't add it.
Twilight Translations - More than just Dragonball Z. :P

Gideon Zhi

  • IRC Staff
  • Hero Member
  • *****
  • Posts: 3502
    • View Profile
    • Aeon Genesis
Re: Cartographer
« Reply #53 on: April 03, 2011, 07: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 :)

RedComet

  • Hero Member
  • *****
  • Posts: 3163
    • View Profile
    • Twilight Translations
Re: Cartographer
« Reply #54 on: April 03, 2011, 08:10:09 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 :)

I am HURT. :P
Twilight Translations - More than just Dragonball Z. :P

Gideon Zhi

  • IRC Staff
  • Hero Member
  • *****
  • Posts: 3502
    • View Profile
    • Aeon Genesis
Re: Cartographer
« Reply #55 on: April 03, 2011, 08:45:47 pm »
Hey, Cartographer wasn't even a glimmer in your left testicle when RS2's script got dumped ;)

Nightcrawler

  • Hero Member
  • *****
  • Posts: 5755
    • View Profile
    • Nightcrawler's Translation Corporation
Re: Cartographer
« Reply #56 on: April 04, 2011, 10: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.
TransCorp - Over 20 years of community dedication.
Dual Orb 2, Wozz, Emerald Dragon, Tenshi No Uta, Glory of Heracles IV SFC/SNES Translations

Gideon Zhi

  • IRC Staff
  • Hero Member
  • *****
  • Posts: 3502
    • View Profile
    • Aeon Genesis
Re: Cartographer
« Reply #57 on: April 04, 2011, 02:23:20 pm »
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

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
    • General CoolNES Translations
Re: Cartographer
« Reply #58 on: April 04, 2011, 03: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

  • Hero Member
  • *****
  • Posts: 3163
    • View Profile
    • Twilight Translations
Re: Cartographer
« Reply #59 on: April 04, 2011, 06: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.
Twilight Translations - More than just Dragonball Z. :P