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

Author Topic: Text/Name Entry Troubles  (Read 960 times)

Polinym

  • Jr. Member
  • **
  • Posts: 23
    • View Profile
Text/Name Entry Troubles
« on: February 26, 2020, 10:50:40 pm »
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

  • Sr. Member
  • ****
  • Posts: 334
  • I am the baldest romhacker
    • View Profile
Re: Text/Name Entry Troubles
« Reply #1 on: February 27, 2020, 07:52:40 am »
How exactly did you try to find characters and text?
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension

Polinym

  • Jr. Member
  • **
  • Posts: 23
    • View Profile
Re: Text/Name Entry Troubles
« Reply #2 on: February 27, 2020, 09:32:53 am »
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

  • Hero Member
  • *****
  • Posts: 1107
    • View Profile
    • Psyklax Translations
Re: Text/Name Entry Troubles
« Reply #3 on: February 27, 2020, 11:26:42 am »
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

  • Sr. Member
  • ****
  • Posts: 334
  • I am the baldest romhacker
    • View Profile
Re: Text/Name Entry Troubles
« Reply #4 on: February 27, 2020, 11:41:59 am »
@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.
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension

Psyklax

  • Hero Member
  • *****
  • Posts: 1107
    • View Profile
    • Psyklax Translations
Re: Text/Name Entry Troubles
« Reply #5 on: February 28, 2020, 04:07:50 pm »
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

  • Jr. Member
  • **
  • Posts: 23
    • View Profile
Re: Text/Name Entry Troubles
« Reply #6 on: February 29, 2020, 01:51:16 am »
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

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Text/Name Entry Troubles
« Reply #7 on: February 29, 2020, 03:45:15 pm »
What does the text parsing code do differently when it loads $FE vs. $F7 vs. any other byte?

abw

  • Sr. Member
  • ****
  • Posts: 372
    • View Profile
Re: Text/Name Entry Troubles
« Reply #8 on: February 29, 2020, 06:46:25 pm »
As it happens, I took a brief look at Dragon Quest III's text encoding a few months ago:
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.