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

Author Topic: General NES Hacking Questions  (Read 4591 times)

Chicken Knife

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: General NES Hacking Questions
« Reply #20 on: November 30, 2018, 02:54:28 am »
@ abw

Wow! Talk about a silver platter  :beer:

I've done all the steps you've outlined but I'm getting this message after inputting: (from within abcde.pl's directory)
perl abcde.pl - bin2text -cm abcde::Cartographer "Dragon Warrior II - Edit.nes" Cartographer.txt Cartographer_out -s

Message after inputting:

error UTF-8 "\x92" does not map to Unicode at C:/Perl164/lib/Encode.pm line 228, <TABLE> line 3
when reading C:\Rom Editing\dw2_script.tbl line 3

I don't think me using the altered name of my hacked rom file would matter. Let me know if it does.
As far as Perl, I downloaded the software today in order to get this going. ActivePerl 5.26.1.2601 MS Win32-x64-404865 is the version.

PS

As far as Yoshi's NES doc, I think it's written far more for someone like you than someone like me. The density of it loses me in the same way as most of what I try to read on the NES Dev site. Truth be told, your abcde faq is much easier to follow, though I'm far from understanding all of it and it definitely does assume I understand Atlas / Cartographer. As far as the Yoshi faq, I'll have to keep coming back to this and whatever else I find until I figure out how to do the graphical work I need to.
« Last Edit: November 30, 2018, 03:01:38 am by Chicken Knife »

abw

  • Full Member
  • ***
  • Posts: 170
    • View Profile
Re: General NES Hacking Questions
« Reply #21 on: November 30, 2018, 08:36:29 am »
@ abw

Wow! Talk about a silver platter  :beer:
Heh, I had it handy from earlier in the thread. I used that stuff to make the King of Moonbrooke say "Oh noes, not the flying purple people eaters!" during the intro scene in order to test inserts :P.

error UTF-8 "\x92" does not map to Unicode at C:/Perl164/lib/Encode.pm line 228, <TABLE> line 3
when reading C:\Rom Editing\dw2_script.tbl line 3
Ah, sorry, I forgot to mention that you'll need to save the files (particularly the table file) encoded as UTF-8. Any modern text editor should give you that option when you save a file; even Notepad can save as UTF-8!

As far as Yoshi's NES doc, I think it's written far more for someone like you than someone like me. The density of it loses me in the same way as most of what I try to read on the NES Dev site.
Yeah, there's definitely a lot to take in, but knowing what's going on at the hardware level, what the different sections of PPU RAM control, and what all those writes to $20xx are doing can be pretty helpful when you're trying to track down some graphics logic.

Truth be told, your abcde faq is much easier to follow
Huzzah, mission partially accomplished!

Chicken Knife

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: General NES Hacking Questions
« Reply #22 on: November 30, 2018, 07:33:03 pm »
@ abw

Worked like a charm.  :woot!:

I assume that a similar approach to how I edit text in hex editors would serve me well. I plan on working within the length of the existing strings, using blank entries at the end of lines of text if I happen to shorten in order to keep the length exactly the same. The thing that concerns me is the presence of so many control codes in DW2. As I go through the extraction document, I see the presence of plenty of those words in the script, but I don't see any indication that those words are produced by a control code in the document. I can keep Roge Fastfinger in mind easily enough, but with a ton of other common control code words like he, with, can, one, any etc. there is no way I'm going to be able to keep track of them all. Also, how do I know that the game consistently used control codes for those words instead of using them sporadically? It seems like it will be inevitable that I'll end up with a different data size and a considerable headache. Perhaps I could use the find command to highlight every instance of them in the text before I start editing in order to be wary of carefully maintaining string length. Any advice would be appreciated.

Also, going back again to Roge Fastfinger, I will be reverting his name to the Japanese Lagos. Is there any simple way to edit the control code words so I could swap out the name and use the same code? If not, I suppose I'd have to seriously abbreviate those lines to compensate.

Also, when reinsertion time arrives, does your system automatically note every control code word and insert them back into the game as the single byte control code instead of individual letter data? I'm curious.

Last question: I've heard on occasion that this kind of software automatically readjusts the text pointers and I could therefore enlarge some strings of text as long as the total amount of data is the same upon insertion. That seems too good to be true. Could it be?

Let me know your thoughts. I'm sure there is a lot I'm conceptually missing here.

abw

  • Full Member
  • ***
  • Posts: 170
    • View Profile
Re: General NES Hacking Questions
« Reply #23 on: December 01, 2018, 12:13:49 am »
Worked like a charm.  :woot!:
Whoo-hoo!

I assume that a similar approach to how I edit text in hex editors would serve me well.
I plan on working within the length of the existing strings, using blank entries at the end of lines of text if I happen to shorten in order to keep the length exactly the same.
It seems like it will be inevitable that I'll end up with a different data size and a considerable headache.
*shudders* Nope, nope, and... wait for it... nope :P.
The fastest way is probably just to try it and see, but basically when you use a (decent) script insertion utility, you don't have to worry too much about things like the binary it inserts or updating pointers, since the utility takes care of all of that for you. Like I mentioned earlier, you're still constrained by the total available space and text engine and stuff like that, but as long as you don't try to insert impossible (combinations of) characters or too much text, you can do more-or-less whatever you want.

Line lengths will change; that's okay and you don't need to care about it.
Some text will get encoded as single characters, some as multiple characters; that's okay and you don't need to care about it.
String addresses will change and pointers to those strings will get updated; that's okay and you don't need to care about it.

Last question: I've heard on occasion that this kind of software automatically readjusts the text pointers and I could therefore enlarge some strings of text as long as the total amount of data is the same upon insertion. That seems too good to be true. Could it be?
Automatically recalculating pointer values is just one of the many benefits of using a script insertion utility over hex editing :).

Also, going back again to Roge Fastfinger, I will be reverting his name to the Japanese Lagos. Is there any simple way to edit the control code words so I could swap out the name and use the same code?
Yup. It's not quite as simple for DW2 as it would be for a game with a less ornery text engine, but it's still not too hard. The dictionary lives at ROM 0xB44B-0xB686, with each nybble (1 nybble = half a byte) of 0xB44B-0xB49A giving the length of the corresponding dictionary entry in 0xB49B-0xB686. So you could change "Roge Fastfinger" to "Lagos" at 0xB655, shift the rest of 0xB664-0xB686 up to just after the end of "Lagos", and then change the length of the "Roge Fastfinger" dictionary entry from 15 to 5 at 0xB496 (i.e. 0xAF -> 0xA5), leaving you with 10 bytes of unused space at 0xB67D-0xB686. Just make sure to update your table file to match whatever changes you make to the game's text encoding, or you're going to get a nasty surprise when you try extracting or inserting text!

Also, when reinsertion time arrives, does your system automatically note every control code word and insert them back into the game as the single byte control code instead of individual letter data? I'm curious.
Based on the table file(s) you provide, abcde is aware of all the possible ways of translating your text into the binary that the game needs, and it will convert your text into the shortest possible binary that represents your text. How? Magic :angel:.

Chicken Knife

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: General NES Hacking Questions
« Reply #24 on: December 02, 2018, 04:10:31 pm »
@abw

Ok, I worked furiously throughout the weekend on my script. Having just completed it, I ran the insertion routine, loaded up the game, and found the text to be totally mangled. Everyone is saying something different than what they should be saying. I don't think my data overran the alotted space. In general a direct translation of the famicom is shorter than the US version. I assume I would have gotten some kind of error message if it did.

The other possibility in my mind is that I was supposed to totally sort out the control codes prior reworking the script, which I did not do. Is that what you would suspect is the issue or do you have another idea?

I have a frightening suspicion that if control codes are the issue, I would have saved myself tremendous work prior to extraction and reworking the script.

Also, there were some instructions in the Atlas data that you quoted me where I wasn't sure if they were written to me or the program. For example:

// auto-commands for when DW2 does a mid-string bankswap and resets its read address:

PS I don't know if this helps, but all of the dialogue from everyone seems to be various battle commands

*EDIT

If it helps at all, this is the Atlas file where I tried removing what looked like your instructions from me and added my game script underneath. Take a look.

https://www.dropbox.com/s/t06zcf8qmmfhsno/Atlas.txt?dl=0
« Last Edit: December 02, 2018, 07:48:09 pm by Chicken Knife »

abw

  • Full Member
  • ***
  • Posts: 170
    • View Profile
Re: General NES Hacking Questions
« Reply #25 on: December 02, 2018, 10:52:18 pm »
Ha, that's me skipping over important little details again :-[ (in my defence, they are documented). In my extract script, I set #COMMENTS: Yes, which makes every line of the script be output as a comment and thus ignored during insertion. So, since all the text is a comment, the only thing that actually changed would have been the pointers, and every pointer in the first block of pointers would point to the same first string starting at 0x14010, which happens to contain battle text. The second block of pointers would also point to the same RAM address ($8000), but with the wrong ROM bank visible in RAM, so I imagine any attempt to display one of those strings would end badly.

If you're only making a few changes to the script, you might prefer setting #COMMENTS: No instead and editing the text that way, or reformat the script dump using your text editor of choice (when translating, I like keeping the original text for reference and adding my new text just below); a simple regular expression search-and-replace operation or two should do the trick, or in the worst case you could manually delete the // before each line of script.

Also, there were some instructions in the Atlas data that you quoted me where I wasn't sure if they were written to me or the program. For example:

// auto-commands for when DW2 does a mid-string bankswap and resets its read address:
Any line in the extract or insert command files that starts with // is treated as a comment, so the ones I added are just notes to explain what's going on. In this case, DW2 has some code that says "when the current read address reaches $BFD7, swap in a different bank and keep reading from $B7B2", so the #AUTOCMDs are there to handle that during insertion.

Chicken Knife

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: General NES Hacking Questions
« Reply #26 on: December 02, 2018, 11:33:46 pm »
@abw

As far as leaving out that bit, you are my patron saint of hacking. No grievance shall ever be held against you.  :laugh:

Ok. So if comments would have been set to No, then all the lines of text would have inserted as intended I assume. If I understand correctly, leaving comments set to Yes would be convenient because I could write the legitimate lines of text underneath them without the // and insert the data back in the rom effectively even with the old script appearing as comments.

So in my case, I took the output document and totally changed 98 percent of the text based on various resources to reflect a literal but fluid version of the Japanese text in contemporary English. I haven't slept much lately--and my wife may want to divorce me but that's neither here nor there. :D

So what would you suggest I do now? I often don't mind doing things the slow and painful way. Lifelong RPG gamer after all  :laugh: I'm thinking to go through the document and delete every instance of the characters // and leave whatever text comes after them. Would that do the job for reinsertion or do I have to add anything in their place?

There is no way I'm starting over with a new extraction. Somehow or another, this document has to get formatted correctly.



December 04, 2018, 02:07:08 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Ok. That was a question I could really answer myself through a little experimentation. I ran another extraction and just confirmed which // characters to remove.

Having done so, I reinserted and about 3/4 of my text was inserted correctly! I'll consider that a small victory haha. The other 1/4 text is either the games original text or bugged.

The error message I got in command prompt when I did the insertion was:

unable to tokenize; best attempt failed at input position 513 at C:\Rom Editing/abcde/Table/Table.pm Line 421 <COMMAND_FILE> line 1707. in text string starting at Atlas.txt line 1665.

I immediately thought this was an issue with my insert text. I went to that line (with word wrap turned off) and found there is nothing unusual at all about it. Line 1665 reads:

[ ‘]This is a sewing shop[.’][line]
« Last Edit: December 04, 2018, 02:10:11 am by Chicken Knife »

abw

  • Full Member
  • ***
  • Posts: 170
    • View Profile
Re: General NES Hacking Questions
« Reply #27 on: December 04, 2018, 08:03:38 pm »
As far as leaving out that bit, you are my patron saint of hacking. No grievance shall ever be held against you.  :laugh:
Heh, be careful what you promise >:D

I haven't slept much lately--and my wife may want to divorce me but that's neither here nor there. :D
I'm not going to admit to knowing what that feels like :D.


I took a closer look at this and noticed a couple of things:
- The dictionary does not include uppercase Q, V, or X as displayable characters, so you can't use those anywhere in your script without changing the dictionary. That unreadable mess of garbage just before the final error message abcde gave is supposed to show you how far along abcde got in the problem string before it couldn't go any farther, and as it happens 514 characters into the string starting at line 1665 is a Q. (yeah, the error messages suck)
- Some of the dictionary entries display different visually identical tiles, but I made them the same in my table file. In my translation of DW1, I originally made the mistake of assuming that just because the graphics were identical, it didn't matter which of the different tile IDs I used; this led to a moment of intense dismay when I realized that I had managed to accidentally disable the "speech" text printing sound effect!
- You did indeed make a lot of changes - replacing all the "thee"s and "thou"s and changing some proper nouns meant that a lot of the original dictionary entries went unused during insertion, which resulted in your new script not compressing small enough to fit in the available space. A few ad hoc tweaks to the dictionary was enough to sort that out and leave you with 218 bytes to spare; if you end up needing more room, updating the dictionary based on a full frequency analysis should give you much better compression results than me just eyeballing things.

Here's a copy of the updated insert script and table file I used. I took the liberty of merging the original text into your new text as comments and fixing up a couple of typos that were breaking insertion; spell checking the new script is your responsibility :P. For the table file changes, you'll need to make the corresponding changes to the dictionary like I described a couple of posts ago.

Chicken Knife

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: General NES Hacking Questions
« Reply #28 on: December 05, 2018, 06:29:19 am »
@abw, you didn't need to do all this work for me! I'm extremely grateful but I really don't want to be a burden here (Although I imagine watching me flop around like a fish out of water can be equally burdensome)

I think you've given me everything I need to do this insertion and further improvements to my script--except for one thing that I need clarification for.

In order to update the rom's dictionary with the new words and nybble lengths as you instructed above, I need you to clarify how I actually locate where to plug in the nybble that corresponds to each dictionary entry. Either I missed it or you didn't provide the detail as to how you knew 0x0B496 corresponded to the entry for Roge Fastfinger / Lagos. I'm not sure if this uses a counting system like the item/monster/spell lists. Hopefully not since that would give me a big headache as the entries here seem all mashed up together.
« Last Edit: December 05, 2018, 06:35:42 am by Chicken Knife »

abw

  • Full Member
  • ***
  • Posts: 170
    • View Profile
Re: General NES Hacking Questions
« Reply #29 on: December 05, 2018, 07:35:57 pm »
@abw, you didn't need to do all this work for me! I'm extremely grateful but I really don't want to be a burden here (Although I imagine watching me flop around like a fish out of water can be equally burdensome)
If it makes you feel any better, only a little bit of that work was purely for you ;). I'm slowly puttering away at my own translation whenever the mood strikes me, so a lot of the issues you're encountering now are issues I would no doubt encounter myself at a later date. Might as well deal with them now so that we can both benefit (and judging from the read count on this topic, I suspect it's more than just you and I that are interested in this).

I think you've given me everything I need to do this insertion and further improvements to my script--except for one thing that I need clarification for.
The lengths of the dictionary entries are stored in nybbles at 0xB44B-0xB49A and the values are stored in bytes at 0xB49B-0xB686; the table file I provided lists the dictionary entries in the same order they appear in ROM, and the table file you were using to edit the item/monster/spell lists will also let you see the dictionary values correctly. An example from partway through the dictionary might be helpful to see what's going on:
Code: [Select]
...
0x00B45B|$02:$B44B:11                            ; length of "A", length of "B"
0x00B45C|$02:$B44C:21                            ; length of "Ca", length of "D"
0x00B45D|$02:$B44D:11                            ; length of "E", length of "F"
0x00B45E|$02:$B44E:11                            ; length of "G", length of "H"
0x00B45F|$02:$B44F:11                            ; length of "I", length of "J"
0x00B460|$02:$B450:41                            ; length of "King", length of "L"
0x00B461|$02:$B451:A1                            ; length of "Moonbrooke", length of "N"
...
0x00B4C1|$02:$B4B1:24                            ; A
0x00B4C2|$02:$B4B2:25                            ; B
0x00B4C3|$02:$B4B3:26 0A                         ; Ca
0x00B4C5|$02:$B4B5:27                            ; D
0x00B4C6|$02:$B4B6:28                            ; E
0x00B4C7|$02:$B4B7:29                            ; F
0x00B4C8|$02:$B4B8:2A                            ; G
0x00B4C9|$02:$B4B9:2B                            ; H
0x00B4CA|$02:$B4BA:2C                            ; I
0x00B4CB|$02:$B4BB:2D                            ; J
0x00B4CC|$02:$B4BC:2E 12 17 10                   ; King
0x00B4D0|$02:$B4C0:2F                            ; L
0x00B4D1|$02:$B4C1:30 18 18 17 0B 1B 18 18 14 0E ; Moonbrooke
0x00B4DB|$02:$B4CB:31                            ; N
...
So if you wanted to, say, change the dictionary entry for King to say Queen instead, you'd change the length stored at 0xB460 from 41 to 51, change King to Queen starting at 0xB4CC, and shift everything from 0xB4D0 down by one byte. The dictionary has a fixed length and is followed immediately by code though, so in a case like this where you added a byte, you would need to remove a byte from somewhere else in the dictionary (pick "Water Flying Cl", it's only used 4 times in the entire script!).

Chicken Knife

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: General NES Hacking Questions
« Reply #30 on: December 05, 2018, 08:04:54 pm »
@abw knowing that you tend to respond around this time I was in a big rush to message that I actually figured this out myself (well not really but still), finding that it was indeed a similar counting mechanism and making a little chart for myself just to make sure I understood it. Exhibit A: the little chart I was working on. hahaha

B490   piece(s) of gold   ???
B491   But[ ]         here
B492   can[ ]         ove
B493   hee         not
B494   for         one
B495   [ ]any         [ ]to[ ]
B496   Descendant       Lagos      
B497    all         thy      
B498   ?W         thank thee      
B499   [ ]it         [ ]thou      
B49A   [  ]the.      4

December 05, 2018, 08:07:19 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Now that I get the mechanics of this, I'm going to optimize the dictionary entries to match up to my translation trends as much as possible, which should allow me to expand text a little more as I go through the revision process should I desire.

I'm interested in what you are planning translation wise--more Latin for DW2? Also, now that we are discussing your translation, I'm curious what your textual basis was: the original US English translation or the Japanese?
« Last Edit: December 05, 2018, 08:11:51 pm by Chicken Knife »

abw

  • Full Member
  • ***
  • Posts: 170
    • View Profile
Re: General NES Hacking Questions
« Reply #31 on: December 07, 2018, 11:08:02 pm »
Exhibit A: the little chart I was working on. hahaha
Haha, I see that's a nice little chart you have there :thumbsup:.

I'm interested in what you are planning translation wise--more Latin for DW2? Also, now that we are discussing your translation, I'm curious what your textual basis was: the original US English translation or the Japanese?
Yup. It's a dirty job, but somebody's got to do it :P. I generally use the English version of whatever I'm translating as my base, but will consult other English versions or other languages if the need arises; this happens most often for made-up enemy/item names, but sometimes I come across a line or two of dialogue that I like to clarify because it's a little too vague or allows for multiple valid interpretations.

Chicken Knife

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: General NES Hacking Questions
« Reply #32 on: December 08, 2018, 11:13:07 pm »
Ok, I have a report that is pretty darned good. While I was initially having some problems achieving a successful insertion with the updated Atlas.txt and table file you provided, I was able to narrow down the issue to one small mistake I made as I heavily edited the dictionary where a character length was off by one. Once I fixed that, I was able to do an insert that is 99% bug free (at least according to the appx 30% of game text that I've tested so far.) Here is the bug that's jumping out at me. The King of Cannock/Samaltria has some bugged text prior to his normal text. See the two pics below. The text seems to be from Hargon's Temple after you use the Charm/Eye of Rubiss to dispel the illusion

https://www.dropbox.com/s/txzrjqisvzwumuc/Dragon%20Warrior%20II%20-%20Edit_002.png?dl=0
https://www.dropbox.com/s/syx9sowi42u3j03/Dragon%20Warrior%20II%20-%20Edit_003.png?dl=0

After those lines, again he returns to his normal text, allows you to save, and remarks about his son. Very peculiar and I hope you have an idea how to fix it because I have no idea. Let's see if I find anything else like this, but I'm relieved that everything else has pointed to the right text so far. Here are links to my relevant files if you want to look at them regarding this issue. FYI my Atlas.txt script is significantly revised since I last sent it.

https://www.dropbox.com/s/5qo09huap2a5y2t/dw2_script.tbl?dl=0
https://www.dropbox.com/s/yn3qj00b536dxqt/Atlas.txt?dl=0
https://www.dropbox.com/s/fns0v7z1o6i8nxm/dw2_delocalized_052.ips?dl=0

One other thing. Regarding your Latin Translation project, are you planning to include any kind of uncensoring element? If you were I would be most grateful to enlist your efforts on that front. As you can see if you look in my patch I restored the Japanese church crosses and sprite for the priest. Unfortunately however, the priest is assigned the color palette of Princess Moonbrooke instead of what should be the Prince Midenhall/Laurasia palette. And then there's the matter of replacing the ghosts with original coffins but let me know if you're even interested in this graphical stuff. I must say that your long deceased Roman audience probably wouldn't have approved much of censorship--though the Latin speaking clergy would have demanded it I'm sure.  :D

*** Update

After my newest round of updates, King Samaltria's Kee Kee text went away. :o This is after it stuck around through the last 3 updates or so. I don't get it! Seems more like a bug in the game itself than a bug from the insertion

« Last Edit: December 09, 2018, 06:09:53 am by Chicken Knife »

abw

  • Full Member
  • ***
  • Posts: 170
    • View Profile
Re: General NES Hacking Questions
« Reply #33 on: December 09, 2018, 01:58:13 pm »
The King of Cannock/Samaltria has some bugged text prior to his normal text. See the two pics below. The text seems to be from Hargon's Temple after you use the Charm/Eye of Rubiss to dispel the illusion
[...]
After my newest round of updates, King Samaltria's Kee Kee text went away. :o This is after it stuck around through the last 3 updates or so. I don't get it! Seems more like a bug in the game itself than a bug from the insertion
This turns out to be a little bit of column A, a little bit of column B.

On the insert side, the game has a hardcoded value that tells it which pointer within the pointer table at ROM 0xB762-0xB7C1 starts reading from ROM bank 2 instead of ROM bank 5, but the insert script didn't update that value, so the pointer at ROM 0xB7BE started reading text from the wrong ROM bank, which threw off the end token counting before the script reached RAM $BFD7 and resulted in the wrong string being displayed. This is easily fixable by adding a COUNTER variable and an AUTOCMD for writing the counter like in the Dragon Quest IV example that ships with abcde, except Dragon Warrior II's script is only spread across 2 ROM banks instead of 6, so it's easier for II than IV.
Code: [Select]
// add this near the top of the insert script:
#VAR(pointerNum, COUNTER) // create a COUNTER variable named pointerNum
#CREATECTR(pointerNum, 8, 0) // pointerNum is an 8-bit value initialized to 0
#AUTOCMD($17FE7, #WLB(pointerNum, $3FA90)) // update the code that controls which pointer starts the next bank

// and then after every #W16 line in the insert script, add:
#INC(pointerNum, 1)

On the game side, there is a bug where the game takes the pointer to the start of the desired group of 16 strings and reads the first 2 bytes from the pointer's target *before* it runs through the code for checking whether the current string address has reached RAM $BFD7, so if you're unlucky enough to have a pointer point to RAM $BFD6 or $BFD7 like happened with your linked insert script, the text for that pointer gets seriously screwed up. There's currently no way for abcde to handle that situation for you automatically, so unfortunately you're just going to have to keep an eye on the pointer values, and if you see $BFD6 or $BFD7 come up, you can knock the #AUTOCMD($17FE7, *) addresses back to $17FE5 or $17FE6 respectively to compensate. It means you lose 1 or 2 bytes of script space, but that's probably easier to deal with than making the ASM changes required to fix the bug in the original game.

Both of these issues only show up depending on where the dividing line between ROM banks 5 and 2 falls in your new script compared to the original script, which explains why they would come and go as you continue updating and re-inserting your script.

One other thing. Regarding your Latin Translation project, are you planning to include any kind of uncensoring element? If you were I would be most grateful to enlist your efforts on that front. As you can see if you look in my patch I restored the Japanese church crosses and sprite for the priest. Unfortunately however, the priest is assigned the color palette of Princess Moonbrooke instead of what should be the Prince Midenhall/Laurasia palette. And then there's the matter of replacing the ghosts with original coffins but let me know if you're even interested in this graphical stuff. I must say that your long deceased Roman audience probably wouldn't have approved much of censorship--though the Latin speaking clergy would have demanded it I'm sure.  :D
I generally try to stick pretty close to the source material for various reasons (e.g. nostalgia, insufficienct fluency in Japanese, etc.), so as a rule of thumb, if my source was censored, so is my translation; if my source was not censored, neither is my translation. I can do graphics hacking if I have to, but while I appreciate the results of other people's graphics hacks, making my own just doesn't have the same appeal as translating does.

As for the ancient Romans, well, they were no strangers to censorship ("censor" itself is a Latin word), but I think a bigger problem there would be the lack of hardware and compatible power sources to play the translation on :P.

Chicken Knife

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: General NES Hacking Questions
« Reply #34 on: December 09, 2018, 02:31:57 pm »
Thank you for looking at this!

While inserting the lines you quoted in my Atlas.txt are easy enough, if I am to undertand correctly, even with the COUNTER variable and AUTOCMD added, there is still a possibility of seeing these kinds of issues pop up. This leads me to the second fix:

if you see $BFD6 or $BFD7 come up, you can knock the #AUTOCMD($17FE7, *) addresses back to $17FE5 or $17FE6 respectively to compensate. It means you lose 1 or 2 bytes of script space, but that's probably easier to deal with than making the ASM changes required to fix the bug in the original game.

I don't exactly understand the above instructions. Could you explain to me a little more clearly what you mean by "knock the #AUTOCMD($17FE7, *) addresses back to $17FE5 or $17FE6"? First, how do I see when $BFD6 or $BFD7 come up and then how do I actually knock them back to the other addresses.

And finally, my attempt to rally you to the cause of graphics work went exactly as expected. I can't be blamed for trying though!
« Last Edit: December 09, 2018, 04:54:54 pm by Chicken Knife »

Choppasmith

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: General NES Hacking Questions
« Reply #35 on: December 09, 2018, 03:24:59 pm »
Hey guys, with me finishing DW1, it's time for me to throw my hat into the text editing ring as well. I've been following this thread and I should be all caught up as far as having all the stuff I need. Big thanks to you abw for your help :)

abw, I noticed your table says you haven't figured out those control codes, but there's one in particular that's bugging me. In the python script posted on the first script there's a standalone byte, F2, which is a special "s" byte. It's used in the "piece<s> of gold" dictionary entry. I would take a good guess that this is the same as the EF byte in DW1 that adds or omits an S based of the number value used in the string. I'd hope to use this to change the battle message "[name][’ ]s HP is reduced by [number]." into "[name] takes [number] point(s) of damage". Is there a way I can update the table to use this standalone byte?

abw

  • Full Member
  • ***
  • Posts: 170
    • View Profile
Re: General NES Hacking Questions
« Reply #36 on: December 09, 2018, 04:44:32 pm »
I don't exactly understand the above instructions. Could you explain to me a little more clearly what you mean by "knock the #AUTOCMD($17FE7, *) addresses back to $17FE5 or $17FE6"? First, how do I see when $BFD6 or $BFD7 come up and then how do I actually knock them back to the other addresses.
Oh, sorry, I meant you'll need to check the values of the pointers in the pointer table at ROM 0xB762-0xB7C1 (based on your current script size, 0xB7BE is the most likely culprit) following an insert to see if any of the values are $BFD6 or $BFD7 (a.k.a. D6 BF or D7 BF in little endian), and if so, then adjust the AUTOCMD commands in the insert script to fire when the insert point reaches $17FE5 or $17FE6 instead of $17FE7.

Basically, we need to make sure the game never tries to read script data at or after RAM $BFD7 / ROM 0x17FE7, and since the game unconditionally reads the first two bytes of the string based on the pointer value, pointer values of $BFD6 or $BFD7 are bad.

And finally, my attempt to rally you to the cause of graphics work went exactly as expected. I can't be blamed for trying though!
Based on your work from DW1, I think you'll be able to manage the graphics just fine without me :P.

Hey guys, with me finishing DW1, it's time for me to throw my hat into the text editing ring as well. I've been following this thread and I should be all caught up as far as having all the stuff I need. Big thanks to you abw for your help :)
Welcome to the party! (There's music for that in this game!) I figured you'd show up here sooner or later ;).

abw, I noticed your table says you haven't figured out those control codes, but there's one in particular that's bugging me.
I also assume the F2 code in DW2 works the same way as EF in DW1, so if you wanted to re-jig the dictionary to make that code available separately as opposed to being usable only as part of the "piece[(s)] of gold" entry, feel free. The process I described a couple of posts ago should work just as well for this dictionary update as for "King" -> "Queen".

The codes I haven't bothered to check out are the F9, FD, and FF codes. Based on its usage in the script, F9 is probably some sort of item ID, though it'll take some research to figure out if and how it differs from F7. Some light experimentation suggested that FD might be useless, and FF looks like it might be some kind of conditional end token, but again, I haven't really looked at them to find out, so those are just guesses.

Chicken Knife

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: General NES Hacking Questions
« Reply #37 on: December 09, 2018, 05:06:50 pm »
Based on your work from DW1, I think you'll be able to manage the graphics just fine without me :P.

Hah. I'm glad my DW1 work *looks* impressive but truthfully all of that was my very first foray into hacking and more a result of elbow grease than actual skill. Most of it was simply spamming tiles from the famicom version all over the tile grid with a ton of duplication. The in game engine is still having the sprites point left, right, up, down etc but all of those directional tiles were simply replaced with the front facing famicom tiles so that they would display appropriately. The issues were when the US game would use mirrored images of tiles and that would put me in a spot where the famicom sprites would inevitably get screwed up. I would have to do little tricks to make the sprites more symmetrical like change the old wizard guy's head so his cap no longer leans to one side, or remove the guards spear because his body had to by symmetrical, all to work around the fact I couldn't disable the mirroring or point the code to different tiles. The other issues were the palettes being wrong for several characters due to changed palette assignments in the US version. I think I made it look decent to someone who is only a little familiar with the look of the famicom game but its unfortunately pretty far off from replicating its look, which is the only thing that will satisfy me and the reason I haven't released it. Since it seems like there is a pretty vast difference in the required skill level for the work I did versus that which needs to be done, I think I'm going to post a help wanted ad for help finishing. Gotta be someone who enjoys editing graphics and wouldn't mind helping or teaching the process.
« Last Edit: December 09, 2018, 05:12:28 pm by Chicken Knife »