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

Author Topic: Help editing Item Names (and other text) in Dragon Warrior (NES)  (Read 3387 times)

Choppasmith

  • Jr. Member
  • **
  • Posts: 42
    • View Profile
So I recently was able to rip the script from DQ I-III mobile and I wanted to try to update the DW games with it. Obviously I know it can't be 1:1 but I wanted to edit item names and the script and get it as close to "Modern DQ" as much as possible.

The thing that's really stumping me are item names. Yeah I read Silver X's document and understand that the game doesn't use standard pointers but rather a long string separated by FF hex and then split into two sections 

Code: [Select]
Bamboo{FF}Club{FF}Copper{FF}Hand{FF}Broad{FF}Flame{FF}Erdrick's{FF}Clothes{FF}Leather{FF}Chain{FF}Half{FF}Full{FF}Magic{FF}Erdrick's{FF}Small{FF}Large{FF}Silver{FF}Herb{FF}Torch{FF}Dragon's{FF}Wings{FF}Magic{FF}Fairy{FF}Ball of{FF}Tablet{FF}Fairy{FF}Silver{FF}Staff of{FF}Stones of{FF}Gwaelin's{FF}Rainbow{FF}Cursed{FF}Death{FF}Fighter's{FF}Erdrick's{FF}Secret{FF}

Pole{FF}{FF}Sword{FF}Axe{FF}Sword{FF}Sword{FF}Sword{FF}{FF}Armor{FF}Mail{FF}Plate{FF}Plate{FF}Armor{FF}Armor{FF}Shield{FF}Shield{FF}Shield{FF}{FF}{FF}Scale{FF}{FF}Key{FF}Water{FF}Light{FF}{FF}Flute{FF}Harp{FF}Rain{FF}Sunlight{FF}Love{FF}Drop{FF}Belt{FF}Necklace{FF}Ring{FF}Token{FF}Passage{FF}

I figured both sections go in order. But when I try to edit them it seems like the order is completely mixed up.





What really makes it complicated is trying to add a second line to previously 1 line items (Herb and Club -> Medicinal Herb and Oaken Club) and removing 1 line to 2 lined items (Stones of Sunlight -> Sunstone) Also for space, I tried removing the seemingly unused item Secret Passage (bare with me, while I've played DQ1 recently it's been many MANY years since I've played DW1). But I simply just removed the text and kept it as two FF bytes much like Club's second line. Unless it's just one of those weird things that just wasn't mean to work.

abw

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: Help editing Item Names (and other text) in Dragon Warrior (NES)
« Reply #1 on: August 19, 2018, 12:45:34 pm »
You might enjoy reading through some other forum posts about Dragon Warrior, particularly this thread.

Both sections do go in order, with the first section giving the first line of text and the second section giving the second line of text (if the second line isn't "", the game automatically prefixes the second line with a space; this also happens when both "lines" are displayed side-by-side, e.g. "Thou hast found the Magic Key.").

Each of the sub-strings is terminated by $FF, so "Bamboo" goes with "Pole", "Club" goes with "", "Copper" goes with "Sword", etc. If you want to switch between using one line and two lines, it's as easy as e.g.
Code: [Select]
Stick{FF}King of{FF}Copper{FF}...

{FF}Clubs{FF}Sword{FF}...
to get "Stick" instead of "Bamboo Pole" and "King of Clubs" instead of "Club".

One thing to watch out for is that those two sections are actually four sections - the game also keeps pointers to the start of "Cursed" and "Belt", so if you don't update those pointers too, the final five items (including "Secret Passage", which actually is used) will probably show up incorrectly.

Choppasmith

  • Jr. Member
  • **
  • Posts: 42
    • View Profile
Re: Help editing Item Names (and other text) in Dragon Warrior (NES)
« Reply #2 on: August 19, 2018, 12:59:44 pm »
Funny enough, you posted JUST before I was about to double post an update.

Good news is, I figured out how to match all the items and got it to work. Bad news is, the last two items after the two cursed items (Fighter's Ring (now Warrior's Ring) and Erdrick's Token (Now Mark of Erdrick) can't seem to load ANYTHING past the cursed items text (there's now nothing there as they're now one-lined items




Quote
One thing to watch out for is that those two sections are actually four sections - the game also keeps pointers to the start of "Cursed" and "Belt", so if you don't update those pointers too, the final five items (including "Secret Passage", which actually is used) will probably show up incorrectly.

Yeah I thought something was kinda fishy there as when I tried renaming the first Cursed item it, part of "Rainbow" (for Rainbow drop) was showing up. How do I adjust the pointers for that then? (sorry still a bit of a romhacking n00b here)

Also, thanks for letting me know about Secret Passage, I pretty much removed it for space, but I'll have to find a way to get something back in there.

abw

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: Help editing Item Names (and other text) in Dragon Warrior (NES)
« Reply #3 on: August 19, 2018, 04:33:58 pm »
Funny enough, you posted JUST before I was about to double post an update.
:P.

Good news is, I figured out how to match all the items and got it to work. Bad news is, the last two items after the two cursed items (Fighter's Ring (now Warrior's Ring) and Erdrick's Token (Now Mark of Erdrick) can't seem to load ANYTHING past the cursed items text (there's now nothing there as they're now one-lined items
Congratulations on figuring it out! For your bad news, though, I'm not sure exactly what you mean. Can you give an example?

Yeah I thought something was kinda fishy there as when I tried renaming the first Cursed item it, part of "Rainbow" (for Rainbow drop) was showing up. How do I adjust the pointers for that then? (sorry still a bit of a romhacking n00b here)

Also, thanks for letting me know about Secret Passage, I pretty much removed it for space, but I'll have to find a way to get something back in there.
The pointers you'll care about are at 0x6842-0x6851 (the text order is different from the pointer order, so I've sorted the pointers below by text address instead of pointer address), and you can update them the same way you'd update any other pointer (e.g. if "Item list part 2, line 1" originally started at 0x7B9F and you now need it to start at 0x7BA0 [+1 byte], then you'd change the value of the pointer at 0x6848 from 8F BB to 90 BB [+1 byte]).

Pointer Address   What it points to
0x6844Item list part 1, line 1
0x6848Item list part 2, line 1
0x6846Item list part 1, line 2
0x684AItem list part 2, line 2
0x684EMonster list, line 1
0x6850Monster list, line 2
0x684CPrice list
0x6842Spell list

There's also plenty of free space available in that area - you've got all the way down to 0x7FE7, which gives you 300+ extra bytes to work with, which ought to be more than enough for your purposes.
« Last Edit: August 21, 2018, 08:36:39 pm by abw »

Choppasmith

  • Jr. Member
  • **
  • Posts: 42
    • View Profile
Re: Help editing Item Names (and other text) in Dragon Warrior (NES)
« Reply #4 on: August 19, 2018, 06:39:58 pm »
:P.


Seriously, I hit reply and got the notification that someone replied XD

Quote
Congratulations on figuring it out! For your bad news, though, I'm not sure exactly what you mean. Can you give an example?

Yeah, just look at the top screenshot above. It should be Warrior's Ring and Mark of Erdrick but instead it's stuck loading Pledge and Drop, the last two words before the cursed items.


Quote
The pointers you'll care about are at 0x6842-0x6851 (the text order is different from the pointer order, so I've sorted the pointers below by text address instead of pointer address), and you can update them the same way you'd update any other pointer (e.g. if "Item list part 2, line 1" originally started at 0x7B9F and you now need it to start at 0x7BFA [+1 byte], then you'd change the value of the pointer at 0x6848 from 8F BB to 90 BB [+1 byte]).

Pointer Address   What it points to
0x6844Item list part 1, line 1
0x6848Item list part 2, line 1
0x6846Item list part 1, line 2
0x686AItem list part 2, line 2
0x686EMonster list, line 1
0x6850Monster list, line 2
0x684CPrice list
0x6842Spell list

There's also plenty of free space available in that area - you've got all the way down to 0x7FE7, which gives you 300+ extra bytes to work with, which ought to be more than enough for your purposes.

Oh WOW. Thanks for this, so I presume 3FF0 is the magic number to find pointers for NES (or at least this game) I was used to FFF80 from working in Fortune Street on PS2 kinda went in blind on what to expect and then Silver X's doc said the weren't really any pointers here so I got confused.

I'm wondering about Monsters since I plan to edit Monster Names next. How are those split? I see all the names huddled together but then after Dragonlord, there's stuff like RED with a bunch of padding with other short words. Are these for certain palette swap monsters like the Red Slime? Is it like the items and weapons where they go together? How does that work?

HUGE thanks for the help though. Don't think I could've figured out out on my own.
« Last Edit: August 19, 2018, 07:26:11 pm by Choppasmith »

abw

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: Help editing Item Names (and other text) in Dragon Warrior (NES)
« Reply #5 on: August 19, 2018, 08:27:14 pm »
Yeah, just look at the top screenshot above.
Ah, okay, I wasn't sure how much/which parts of that was working vs. not working. My first guess would be that the pointer for "Item list part 2, line 2" at 0x686A isn't pointing to the start of your new (Cursed) "Belt" text. Do your new versions of the Cursed Belt and Death Necklace items show up correctly?

Oh WOW. Thanks for this, so I presume 3FF0 is the magic number to find pointers for NES (or at least this game) I was used to FFF80 from working in Fortune Street on PS2 kinda went in blind on what to expect and then Silver X's doc said the weren't really any pointers here so I got confused.
You really should read through that Dragon Warrior 1 Spanish Translation thread, as it covers a lot of stuff you're going to want to know if you're planning to edit all of the text in this game. Among sundry other points, the topics covered include NES memory mapping (how to figure out that $3FF0 offset), what's going on with Dragon Warrior's pointers (there are pointers to some things, but after following a pointer the game starts counting end tokens to find the string it wants), and some examples of how to figure out where data is coming from and what pointers need to be updated (e.g. the item list). :beer:

[Are Monster Names] like the items and weapons where they go together?
Yup, monster names work just like item names - there's one section for the first line of text, and then a second section for the second line of text, so you'll have e.g.
Code: [Select]
...Warlock{FF}Metal{FF}Wolf{FF}...

...{FF}Scorpion{FF}{FF}...
where "Warlock" goes with "", "Metal" goes with "Scorpion", "Wolf" goes with "", etc.

HUGE thanks for the help though. Don't think I could've figured out out on my own.
No worries - I've done a bunch of work on this game recently, so it's still fairly fresh in my memory ;). You probably could have figured it out on your own, it would have just taken a bit longer!

P.S. I fixed a typo in my previous post; I wanted to say 0x7BA0 but my fingers typed 0x7BFA for some reason :o.

Choppasmith

  • Jr. Member
  • **
  • Posts: 42
    • View Profile
Re: Help editing Item Names (and other text) in Dragon Warrior (NES)
« Reply #6 on: August 21, 2018, 10:10:55 am »
Thank you so much, it's working great now





I had to get sort of creative with the prestidigitator (previously magician) I was worried having a name that long on one line would lead to overflow, so I just split it with presti - (with a space before the dash) on the first line and digitator on the second line.



Looks kinda funky, but at least it's not "messy". What do you think?


P.S. I fixed a typo in my previous post; I wanted to say 0x7BA0 but my fingers typed 0x7BFA for some reason :o.

You made another one in your post above I think you mean to put 4A and 4E in a couple of your pointers not 6A and 6E ;)

Now I'm going to start doing a lot of the menu and ui stuff and then dialog. The latter might be really tricky, it's kinda early to say but the official mobile script seems bigger for a lot of dialog. There's some interesting differences though. For one, there's a lot of text in DW for menu stuff with glorious Olde English messages when it's straightforward, plain English in DW Mobile. However a lot of the script for actual character dialog is more robust. I can try and describe, but better just to show you

Opening dialog with the King

Dragon Warrior:

Quote
Descendant of Erdrick, listen now to my words

It is told that in ages past Erdrick fought demons with a Ball of Light

Then came the Dragonlord who stole the precious globe and hid it in the darkness

Now, ь, thou must help us recover the Ball of Light and restore peace to our land

The Dragonlord must be defeated

Take now whatever thou may find in these Treasure Chests to aid thee in thy quest

Then speak with the guards, for they have much knowledge that may aid thee

May the light shine upon thee, ь


Dragon Quest Mobile (sorry a lot of messy formatting from my script rip)

Quote
King: <3F<07! Scion of the bloodline of Erdrick, hero of legend! Long have I awaited thy coming!<1A<0C
<11King: In days of yore, thy revered ancestor did receive of the Almighty Goddess the Sphere of Light.<1A<0C
<11King: By its power was our world rid of the menace which did beset it.<1A<0C
<11King: Yet, alas, some few years past, there did arise a new threat—the Dragonlord.<1A<0C
<11King: With his cunning, he did steal away the Sphere of Light from us, plunging the land into darkness once more.<1A<0C
<11King: Should this state of affairs be suffered to continue, the night must surely take unrelenting hold, and our realm perish.<1A<0C
<11King: So I say unto thee, <07 of the bloodline of heroes, vanquish the accursed Dragonlord, and reclaim the Sphere of Light!<1A<0C
<11King: In the chests o'er yonder wilt thou find items to aid thee on thy quest. Take what thou wilt, with my blessing.<1A<0C
<11King: Partake thee also of the wisdom of those loyal subjects gathered here in my throne room.<1A<0C
<11King: Doubt not but that their knowledge will serve thee as well as any shield.<1A<0C
<11King: May the Goddess guide thee to victory, and return thee unto us ere long, brave <07!<0C

I HAVE been reading that Spanish translation thread and if there's a way to get more space for dialog, I might have to look into that. Too early to say right now though.

BONUS FUN FACT! S-E actually programmed dialog for groups of monsters despite not being used.

werewolfslayr925

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Re: Help editing Item Names (and other text) in Dragon Warrior (NES)
« Reply #7 on: August 21, 2018, 03:08:50 pm »
Boy am I late to this thread.

Quote
Silver X's document

I looked through this as well, but, unfortunately, it didn't help me much either.

Choppasmith, I have some notes that may (or may not) help you. Hacking this game was a perpetual reminder that I suck at programming, and I tried to take notes as often as possible, especially once I got something working right. If you want, send me a PM and we can swap/compare notes. Maybe we can even get some updated documentation out there.

Regarding your translation, there's a program that Psyklax gave me that someone else (KingMike?) developed that may help you with the dialogue. I didn't need it because the Spanish translation is small enough to fit into the localized character count.

I stopped my hack after finally getting the $%^&ing enemy names and item names to agree with me. All I have left are translating menus, translating credits, and testing. After seeing abw publish a Latin translation (of all things) and you updating the text, I may as well get back into it and get a third translation out there.
« Last Edit: August 21, 2018, 03:19:04 pm by werewolfslayr925 »
As the harbor is welcome to the sailor, so is the last line to the scribe.

- complaint in the margin of a medieval manuscript

abw

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: Help editing Item Names (and other text) in Dragon Warrior (NES)
« Reply #8 on: August 21, 2018, 08:48:08 pm »
I had to get sort of creative with the prestidigitator (previously magician) I was worried having a name that long on one line would lead to overflow, so I just split it with presti - (with a space before the dash) on the first line and digitator on the second line.
It looks like monster names have a limit of 11 characters hardcoded at 0x78B8; changing that value to e.g. $0F doesn't appear to break anything immediately, but you'd want to do some more testing/analysis to be sure using that much extra space was safe. Assuming it doesn't start overwriting otherwise reserved memory, you might get some awkward line wraps, but monster names are only ever displayed inside the combat dialogue window, which is more than wide enough to fit a 15-character name without breaking the visual layout, so you should be okay.

You made another one in your post above I think you mean to put 4A and 4E in a couple of your pointers not 6A and 6E ;)
Dammit, I'm getting sloppy in my old age :banghead:. I've fixed those too - thanks for pointing them out!

Now I'm going to start doing a lot of the menu and ui stuff and then dialog. The latter might be really tricky, it's kinda early to say but the official mobile script seems bigger for a lot of dialog.
There's an Atlas insert script for the menus in the Spanish thread, so that should help. There's no extra space immediately after the existing main dialogue (the very next byte is code), but if the new script does end up being longer than the current script, you can find some tips on adding DTE elsewhere on the forum, which will likely get you a compression rate of somewhere between 30% - 40%. Hopefully that'll be enough; if not... well, cross that bridge if/when you get to it.

There's some interesting differences though.
Haha. I've never played any of the remakes, but that's some pretty awesome dialogue right there :D.

I stopped my hack after finally getting the $%^&ing enemy names and item names to agree with me. All I have left are translating menus, translating credits, and testing. After seeing abw publish a Latin translation (of all things) and you updating the text, I may as well get back into it and get a third translation out there.
Yeah, I was sort of wondering what had happened with your translation - it sounded like you were very close to being finished but were running out of steam. Hopefully you'll be able to polish it off without too many more hurdles!

Choppasmith

  • Jr. Member
  • **
  • Posts: 42
    • View Profile
Re: Help editing Item Names (and other text) in Dragon Warrior (NES)
« Reply #9 on: August 22, 2018, 01:26:04 pm »
It looks like monster names have a limit of 11 characters hardcoded at 0x78B8; changing that value to e.g. $0F doesn't appear to break anything immediately, but you'd want to do some more testing/analysis to be sure using that much extra space was safe. Assuming it doesn't start overwriting otherwise reserved memory, you might get some awkward line wraps, but monster names are only ever displayed inside the combat dialogue window, which is more than wide enough to fit a 15-character name without breaking the visual layout, so you should be okay.

Can confirm after a few battles, it does indeed work!



I didn't think the game would be good at automatically moving text to a new line.

Quote
Haha. I've never played any of the remakes, but that's some pretty awesome dialogue right there :D.

Yeah the richer dialog is definitely a reason I wanted to try this, it's pretty great. DQ Builders seems to use the mobile translation word for word, so I thought the consistency would be a good reason too.




Quick question about your Latin translation though, how did you make the new logo? I'm mostly curious in regards to font and such. I'd love to be able to be able to restore the original logo in there, but I read an old post by Psyklax about just how unfeasible it would be. And I thought why not just go the easy route and just replace the WARRIOR with QUEST. Only problem is I can't seem to find a font that looks anything like the Dragon Warrior title screen font that would look good. Yours looks great though, and I'm just curious what you did there.

Edit: If anything, right now I need to find out where the pointers for main text are. I thought maybe the way the text was organized in the DW1 text editor program would give me an idea of where certain pointers were but that doesn't seem to be the case. Unless it's ALL one pointer? But given the weird way items were done, I doubt it.
« Last Edit: August 22, 2018, 03:40:54 pm by Choppasmith »

abw

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: Help editing Item Names (and other text) in Dragon Warrior (NES)
« Reply #10 on: August 22, 2018, 06:28:09 pm »
Can confirm after a few battles, it does indeed work!
Yeah, I thought it looked like it works based on some casual testing, but you'll want to keep an eye on it - I didn't check through all of the relevant code to make sure that change was actually safe, so if you see weird stuff happening later on, keep this in mind as a possible cause.

I didn't think the game would be good at automatically moving text to a new line.
There is a control code for forcing a line break, but the game also automatically wraps text within the dialogue windows (not the menu windows, though). As long as you're not using a language that loves stringing really long words together (*cough*Latin*cough*), the existing line wrapping should be just fine.

[H]ow did you make the new logo? I'm mostly curious in regards to font and such.
The logo was pretty annoying to create, but I blame most of that on yy-chr obstinately refusing to maintain palette indices during copy/paste. For the font, basically I just started with the existing logo, kept the letters I could reuse, created the missing letters based on the existing letters (e.g. the new "m" is just the old "n" with a copy of the curvy part of the "n" pasted beside itself), and then started squishing letters horizontally until they fit in the available screen and CHR space (e.g. the old "D" was 16 pixels wide, but the new "D" is only 10 pixels wide, and the bottom half of the two "L"s are actually the same tile drawn twice). Glad you liked it!  :beer:

I'd love to be able to be able to restore the original logo in there, but I read an old post by Psyklax about just how unfeasible it would be.
The English logo uses all the tiles from $74 to $A8 (or up to $AC if you cannibalize the spackled background, or $AE if you also ditch the borders), the rest of that CHR bank appears to be in use for other things, and it looks like the Japanese logo uses a lot of tiles (112), so it probably would take a fair bit of work to transplant the Japanese logo directly. You could maybe try shrinking it, but I'm not sure how far you'd have to go before the entire logo fit.

Edit: If anything, right now I need to find out where the pointers for main text are.
The dialogue pointer system is also explained somewhere in one of the Spanish translation threads; a quick summary is that the pointer table is at 0x8012-0x8037 and each pointer points to a group of 16 strings, where each of the 16 strings is itself terminated by $FC.

Choppasmith

  • Jr. Member
  • **
  • Posts: 42
    • View Profile
Re: Help editing Item Names (and other text) in Dragon Warrior (NES)
« Reply #11 on: August 22, 2018, 07:47:59 pm »
The dialogue pointer system is also explained somewhere in one of the Spanish translation threads; a quick summary is that the pointer table is at 0x8012-0x8037 and each pointer points to a group of 16 strings, where each of the 16 strings is itself terminated by $FC.
Apologies, I looked through the thread earlier and didn’t see anything. I’ll look through it again thanks.

Edit: Though, now knowing where the pointers are, I can always go backwards and dump each set of dialog that way. 
« Last Edit: August 23, 2018, 01:02:18 am by Choppasmith »

abw

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: Help editing Item Names (and other text) in Dragon Warrior (NES)
« Reply #12 on: August 24, 2018, 08:28:46 am »
Apologies, I looked through the thread earlier and didn’t see anything. I’ll look through it again thanks.

Edit: Though, now knowing where the pointers are, I can always go backwards and dump each set of dialog that way.
No worries - there's plenty of info available, but it's spread out over many posts across several different threads and mixed in with a bunch of other stuff you likely wouldn't care about, so it's kind of annoying to track down and easy to miss little important parts. Somebody ought to pull it all together into a cohesive whole and put it somewhere, like in a document or on the wiki. I'll see if I can put some time into that next week.

I'm sure you'll notice this once you try dumping the dialogue, but one other thing to be aware of is that the final pointer only has 10 strings instead of the usual 16.

Choppasmith

  • Jr. Member
  • **
  • Posts: 42
    • View Profile
Re: Help editing Item Names (and other text) in Dragon Warrior (NES)
« Reply #13 on: August 24, 2018, 10:16:42 am »
No worries - there's plenty of info available, but it's spread out over many posts across several different threads and mixed in with a bunch of other stuff you likely wouldn't care about, so it's kind of annoying to track down and easy to miss little important parts. Somebody ought to pull it all together into a cohesive whole and put it somewhere, like in a document or on the wiki. I'll see if I can put some time into that next week.

I'm sure you'll notice this once you try dumping the dialogue, but one other thing to be aware of is that the final pointer only has 10 strings instead of the usual 16.

Speaking of dumping, I've decided to try the Pointer Tables program to rip the script for editing and then put it back in. I'm sort of baffled. I thought from the pointer locations I could simply reverse the bytes, subtract 3FF0 and that would be the address of the corresponding set of strings, but it didn't work. Yet I extracted the script just fine with pointer tables. Not a big deal, but I'm wondering what i did wrong there.

By chance though, do you know how long each individual string can be? I ran into some NPC dialog that's much MUCH longer with the official Mobile script.

Original:
Where oh where can I find Princess Gwaelin?

Mobile Script:
O Princess... Princess, where art thou...?<1A<0C
Could it be that the foul fiends who took thee have taken thy young life also...?<1A<0C
...Nay!<0D0F We cannot—we must not—surrender to despair!<1A<0C
Brave <07, I prithee—forget all that I said. Henceforth, hope, and hope alone, shall guide me!

I know I have to worry about the overall script length, but right now I'm just trying to find the corresponding strings (unlike items and monster names, the two versions are NOT in the same order) and figured i could always edit later if need be (in the above case just use the first sentence).

abw

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: Help editing Item Names (and other text) in Dragon Warrior (NES)
« Reply #14 on: August 27, 2018, 09:17:29 pm »
Speaking of dumping, I've decided to try the Pointer Tables program to rip the script for editing and then put it back in. I'm sort of baffled. I thought from the pointer locations I could simply reverse the bytes, subtract 3FF0 and that would be the address of the corresponding set of strings, but it didn't work. Yet I extracted the script just fine with pointer tables. Not a big deal, but I'm wondering what i did wrong there.
Yeah, Pointer Tables seems to do a decent job with this script. If you ever need to manually calculate the offset, just remember that the offset you need changes based on which ROM bank the data is stored in and which RAM bank it gets accessed from, so for data in ROM bank 1 (e.g. the item list) accessed from RAM bank 0, you have an offset of $4000 * ROM bank - $4000 * RAM bank - $8000 + $10 = $4000 * 1 - $4000 * 0 - $8000 + $10 = -$3FF0, but for data in ROM bank 2 (e.g. the main dialogue) accessed from RAM bank 0, you have an offset of $4000 * 2 - $4000 * 0 - $8000 + $10 = $10, assuming the game uses banks of size $4000 like Dragon Warrior does.

By chance though, do you know how long each individual string can be? I ran into some NPC dialog that's much MUCH longer with the official Mobile script.
A quick test shows that the game will quite happily spew the entire main dialogue out as a single string, so you don't need to worry much about individual string lengths, just the total script size.

[R]ight now I'm just trying to find the corresponding strings (unlike items and monster names, the two versions are NOT in the same order)
At least there are only 298 strings to match up here, so it's not so bad. Just imagine trying to do the same thing in DQVIII, for example *shudders*.

Choppasmith

  • Jr. Member
  • **
  • Posts: 42
    • View Profile
Re: Help editing Item Names (and other text) in Dragon Warrior (NES)
« Reply #15 on: September 11, 2018, 11:22:29 pm »
Well it's all done! It's about 15K larger than the original (going by text dump sizes), so yeah, might have to ask Psyklax about the DTE routine he made.

Quick question for you though abw, if you can. I'm modifying the 1.0 ROM and according to TCRF, the big difference between the 1.0 ROM and the revision 1.1 ROM is that when taking damage in battle the message says "Thy Hits decreased by #" it was later changed to Hit Points.

Now from reading the old Spanish translation thread there's a code used for experience (and hit points in the 1.1 version) where after the word there's an "F0" byte that prints either point or points based on the number. But for Hits, there's a code "EF" after "Hit" do you know if this could be an "add or omit an S based on number" code? I don't think it works the same way as the F0 byte used for Experience Points and later Hit Points. If it is a code for adding an S, I'd hope to use it for changing gold treasure chest to "Obtained # gold piece/s" and the Gwaelin's Love/Princess' Pledge Item to indicate pace or paces.

Edit: So I figured I'd just check it out myself really quick and yes, placing EF after a word DOES place an s depending on the number in the string. Praise be!




It was a quick and sloppy hex edit. Yes there ARE two spaces after pace<EF>.
« Last Edit: September 12, 2018, 12:06:55 am by Choppasmith »

abw

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: Help editing Item Names (and other text) in Dragon Warrior (NES)
« Reply #16 on: September 23, 2018, 02:02:25 pm »
Somebody ought to pull [the useful info spread out over recent Dragon Warrior threads] all together into a cohesive whole and put it somewhere, like in a document or on the wiki.
FYI, I went through a bunch of those posts, pulled out some stuff that looked interesting/relevant, added a few other things I've learned, and updated the wiki's ROM map page with the results. Feel free to add anything I overlooked :beer:!

Edit: fixed link (apparently BBCode hates protocol-relative links :().
« Last Edit: September 24, 2018, 09:42:38 pm by abw »

Choppasmith

  • Jr. Member
  • **
  • Posts: 42
    • View Profile
Re: Help editing Item Names (and other text) in Dragon Warrior (NES)
« Reply #17 on: September 23, 2018, 02:48:46 pm »
FYI, I went through a bunch of those posts, pulled out some stuff that looked interesting/relevant, added a few other things I've learned, and updated the wiki's ROM map page with the results. Feel free to add anything I overlooked :beer:!

Oh neat, I didn't realize there was a byte for adding quick pauses for dialog. Considering the mobile script has them and thinking the NES game didn't I just used the Line Break/Wait for player input byte to simulate a pause... I'll have to go over my script again and try adding a few.

Also, you missed my EF byte above (adding or omitting an S based on number value in a string).

BTW, while you're here. I got the IPS patch from Psyklax to add DTE compression, but I couldn't find anything (unless I stupidly missed it in the Spanish translation thread) on how to make changes in the ROM to actually use it? I used DTE OPT to find my most common combinations, but I guess there's a table added in to the ROM I have to update?

Psyklax

  • Hero Member
  • *****
  • Posts: 717
    • View Profile
    • Psyklax Translations
Re: Help editing Item Names (and other text) in Dragon Warrior (NES)
« Reply #18 on: September 24, 2018, 02:33:26 am »
BTW, while you're here. I got the IPS patch from Psyklax to add DTE compression, but I couldn't find anything (unless I stupidly missed it in the Spanish translation thread) on how to make changes in the ROM to actually use it? I used DTE OPT to find my most common combinations, but I guess there's a table added in to the ROM I have to update?

Sorry, I didn't see your new PM. I wrote the DTE thing a few months ago, so I'll need to look at it again later today. Basically, DTE-Opt (thanks KingMike for such a simple yet useful tool) gives you a list of the most common combos in order of occurrence (the text file you sent in the PM is not what you use). I think it just appears in the command prompt when you run it, so I use a batch file and capture the output to a text file.

Anyway, once you know your pairs, you can put them in your table file, then use something like Pointer Tables to insert your text into the ROM. Of course, you then need to insert your list of pairs into the ROM so that the game knows what they are.

I can't actually remember where to put the table, but the easiest thing is to just give me your new text and I'll try to insert it. I picked a part of the ROM that shouldn't be used by anything else. Later today I'll be able to look at my files and figure it out.

I admit that I didn't provide much documentation on what I did, but it's because I didn't really think about it being used much by people. Maybe I should make a formal version with documentation and put it in the Utilities section? :huh:

abw

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: Help editing Item Names (and other text) in Dragon Warrior (NES)
« Reply #19 on: September 24, 2018, 09:46:48 pm »
Also, you missed my EF byte above (adding or omitting an S based on number value in a string).
Ah, yes, I didn't update any of the text table stuff.

BTW, while you're here. I got the IPS patch from Psyklax to add DTE compression, but I couldn't find anything (unless I stupidly missed it in the Spanish translation thread) on how to make changes in the ROM to actually use it? I used DTE OPT to find my most common combinations, but I guess there's a table added in to the ROM I have to update?
Psyklax can confirm this, but if you're looking at the DTE code Psyklax posted in the Dragon Warrior 1 in Spanish thread, that code goes looking for the DTE table starting at RAM $BEF0 (ROM 0x7F00) and wants the entries arranged as "entry 1 byte 1, entry 1 byte 2, entry 2 byte 1, entry 2 byte 2, etc.", with DTE entries starting at 80 in your table file. The original script compressed by about 40%, so it might just be enough to fit your larger script in!