News:

11 March 2016 - Forum Rules

Main Menu

Text/Name Entry Troubles

Started by Polinym, February 26, 2020, 10:50:40 PM

Previous topic - Next topic

Polinym

I've started working with Dragon Quest III for the Famicom (Rev. B), and I've run into two major roadblocks.

For one, I can't seem to locate where the game maps out which character bytes are assigned to which cursor positions. With Dragon Quest I, it seemed simple, as the character layout was determined by strings like ordinary text or menus, and all the characters came ordered in one long string. With DQIII, I found where the characters are stored visually, but I have no idea where I can change the actual character assignment.


My second issue is that I can't find any text strings other than a few menus. I've tried searching a bunch of character combinations, and scrolling through the ROM, but to no avail. There's a good chance this game uses a dictionary like I and II, but I haven't found it.


As I recently found out, this game uses a "1BBP" font, but I don't know if that'll make it any different than an "ordinary" game. Anyone have any ideas on what I could try?
"Where are you going, soldier? Get back to the battle!" - Some Battlefront Clone
My YouTube Channel: https://www.youtube.com/channel/UCJqSB4xw29TTKlia5E0NYtQ

Cyneprepou4uk

How exactly did you try to find characters and text?

Polinym

I searched for different character cpmbinations, which like in the 2nd screenshot, would be things like "mFM", "coMi". The ones I tried didn't appear anywhere in the ROM, but the text has to be somewhere! Maybe is there some dual-tile encoding going on?
"Where are you going, soldier? Get back to the battle!" - Some Battlefront Clone
My YouTube Channel: https://www.youtube.com/channel/UCJqSB4xw29TTKlia5E0NYtQ

Psyklax

I can guess that you don't have experience with assembly, given that you're feeling around in the dark trying to find the text. :) I don't know how DQ3 works (and why are you trying to hack it when there is DW3?) but if it's an 8-bit game with a lot of text, chances are that it's using compression. You're unlikely to figure it out without doing some reverse engineering, which requires assembly knowledge. I should take a look...

And again, why translate DQ3? If you don't like DW3's script, it'd be a lot easier to hack that one than the Japanese version.

Cyneprepou4uk

@Polinym, try to use code/data logger window for a short periond of time, for example start logger when you are about to the screen with name select (or password, or whatever this is), then pause logger when screen loads, corrupt blue bytes in rom file, reload screen and check for results.

Same for dialogue - prepare to activate dialogue, start logger, activate dialogue, pause logger, corrupt bytes, check for result. Also make a table file and search for text with it.

Messing with debugger would be much more precise for searching, but I guess you've tried that already if you knew how.

Psyklax

So I did some digging and the game appears to use a dictionary. The first word in the game comes from $28D5D, so if you load your table file and look there, you should see lots of words. I haven't gone any further (as in, I haven't found where the actual script that references these words is) but it's a start. ;)

Polinym

Thank you guys for your help! :D

I started messing around with the dictionary, and it's more confusing than the one in DQI. After some playing around, I've reached the conclusion that the game thankfully doesn't use pointers to tell where the entries are. I'm just not sure why the dictionary seems to use two different symbols to separate entries. It alternates between the symbols FE  '' and F7 [END2] to both add Tenden and end an entry. This makes it much more confusing to try and figure out how many entries there are. As soon as I can figure that out, I can start laying out all the entries in a text file and go from there to find the script. I'll probably be able to figure out the order by relative searching or by figuring out what's not in the dictionary.

This shows what I mean about '' and [END2] for both Tenden and end bytes:


Any thoughts on why it alternates the purpose of symbols? I have no idea right now and it'd be nice to save some hours of random guess and check if I can. :)
"Where are you going, soldier? Get back to the battle!" - Some Battlefront Clone
My YouTube Channel: https://www.youtube.com/channel/UCJqSB4xw29TTKlia5E0NYtQ

Raeven0

What does the text parsing code do differently when it loads $FE vs. $F7 vs. any other byte?

abw

As it happens, I took a brief look at Dragon Quest III's text encoding a few months ago:
Quote from: abw on October 09, 2019, 08:41:44 PM
DQ3's text encoding appears to be quite similar to DQ4's from a structural point of view. It's a 6-bit encoding with hiragana <=> katakana switches on a $3C (a.k.a. %111100) and dictionary switches on $3D/3E/3F. The major obvious difference between the two encodings is the dictionary contents and some of the kana being different/reordered. For table file building, you can use the DQ4 example that ships with abcde as a basis; DQ3's 6-bit -> 8-bit hiragana lookup table starts at 0x3BB8A, its katakana lookup table starts at 0x3BBC6 (these two mostly follow the order of tiles in the PPU, but not exactly), and the 6 dictionary pointers are at 0x3BC74, pointing to $FE-terminated dictionary entries in ROM bank $10 (i.e. starting at 0x28B4B). Once you've got that sorted out, it looks like the main script pointer table starts at 0x3BC02.