Romhacking => ROM Hacking Discussion => Topic started by: filler on November 21, 2018, 04:41:31 pm

Title: Artelius' Weird Dictionary
Post by: filler on November 21, 2018, 04:41:31 pm
Would someone give me a hand dumping the script for Artelius on the Famicom? Here's what I'm running into.

The first line of dialog in the game is the following.
( (121).png)

It's preceded by "05", and followed by "04" after the ending byte "01" (which is really a "wait for user input" code) like this, "05めざめよ........0104".

Once the user presses a button, the line "めざめよ........" is repeated, though it only appears once in the script.

Next, is this line.
( (123).png)

It starts with "04" which I think is what repeats the previous "めざめよ........" line. Then it continues with "いま " and then another "04". As you can see from the screenshot, this time the "04" inserts "あなた".

"04" continues to stand for "あなた" until we get here.
( (125).png)

Here "04" brackets the phrase like this, "04くるったうちゅう04". However, it's not expressed in the printed text.

The very next instance of "04" is expressed on the screen as "あなた".
( (127).png)

The next instances of "04" occur here where it brackets the word, "04サーベラー04", and is again not expressed in the displayed text.
( (129).png)

The next instance of "04" is expressed to the screen as "サーベラー" as seen here.
( (131).png)

So my conclusions are as follows. "04" is some kind of control byte for a dictionary style compression. It's not expressed as a word on the screen if it brackets a word, but it does if it appears on its own. Words that it brackets can be displayed using "04", though in the case of the first repeated line, it was bracketed by "05...04". Some pointers or something determine the way that "04" is expressed. Also, just because a word was bracketed by "04", does not mean it will be the next word expressed by "04".

I'm letting you know that this is much beyond my ability to dump taking this scheme into account. If it were simpler like a single block that contained all the words in order that would be one thing, but I'm barely able to follow how "04" is used here.

Would someone give me a hand dumping this script?

The video I'm using for reference is here:
The table file for Artelius is here: (Note: use the main table)
Title: Re: Artelius' Weird Dictionary
Post by: Pluvius on November 23, 2018, 05:24:00 am
Artelius' way of using a dictionary is very crude and inefficient to my eyes.  $04 is actually a quasi-end-token that tells the game to immediately go to the next pointer in the pointer table.  Thus, the pointer table itself tells the game what dictionary entry to grab.  $05 is the actual end token, while $01 is a page break.  So the text in the game looks something like this:

Code: [Select]
(Text 1)
the <$04>

(Text 2)
more <$04>

(Text 3)
you <$04>

(Text 4)
give, <$04>

(Text 5)

So if the pointer table looks like this:

Code: [Select]
(Text 1)(Text 2)(Text 3)(Text 4)(Text 1)(Text 2)(Text 3)(Text 5)
you get

Code: [Select]
the more you give, the more you get.
At any rate, here ( is a dump of most if not all of the Japanese text in the game.
Title: Re: Artelius' Weird Dictionary
Post by: filler on November 23, 2018, 02:22:56 pm
Thank you for the script dump! That explains the behavior I was seeing much better.