Home › Forums › Destiny of an Emperor › Destiny of an Editor (permanent beta test mode active)
Tagged: Destiny of an Editor, Destiny of an Emperor, Huo Hu, Niahak, ROM Hacking, Xian Zhu Xuande, Zhuge Liang
- This topic has 1,129 replies, 26 voices, and was last updated 10 years, 12 months ago by
MiDKnighT.
-
AuthorPosts
-
August 3, 2012 at 1:20 am #27371
Niahak
ModeratorOK, looks like I've figured it out.
Not only was it a relevant issue, it was also something that should've been noticed and fixed a long time ago :oops: In fact, it might've been what was causing other "corruption" issues earlier.
Here is a revised version that will work with the IPS. It'll even only show the "4D" issue only once before it self-fixes (open and save). The 4D pop-up is sort of an artifact of the IPS/game combo and not something I can really control :( However if MiDKnighT wants to 'fix' it, it could be done by incrementing the pointer up by two for that last line before the new content.
Soooo on to the details, which I'm sure everyone wants to know.
DoaE is a fairly wordy game for its time, but lines are generally fairly short in length (~400 bytes at the most). So the following code was sufficient to handle any line in DoaE (and indeed in most ROMs):
Code:if(lineLength / 256 > 0)
{
linePageLength++;
}More experienced code monkeys (like myself now, not so much when I wrote this I suppose) will probably be banging their heads on the table at the sight of this; if a line is longer than 256 bytes, it correctly increments the 'page byte' (indicating how many increments of 256 it contains). However… if the line is longer than 512 bytes, it still only increments that page byte once (cutting off the line at an arbitrary point past 256, and shifting all lines up to compensate).
tl/dr; I screwed up your stuff. I'm sorry!
August 3, 2012 at 2:11 am #27372sonic.penguin
ModeratorNo problem, glad to be of help in you learning something new. Now we can sit back and enjoy a smoke pot as hopefully some major bug issues have now been resolved. :vap:
After a few trial and error with both the IPS and DOAEditor I was able to narrow it down relatively fast. I'll give it another whirl and let you know if I encounter anything new.
August 3, 2012 at 3:03 am #27373Niahak
ModeratorQuote:No problem, glad to be of help in you learning something new.That's sort of the unfortunate part of all this – it was code written probably three years ago (probably some of the first text editing code). I've learned this several times, but I hadn't gone over this code in a very long time.
Also, I finally got my act together and put Destiny of an Editor in a source control system.
In case anyone wants to take a look at any source code, it's available at
http://www.dev.niahak.org/DoaEditor/
Of course, it's difficult to read from a website. If anyone wants to seriously look at / help develop the code, I can get you set up with the SVN :)
August 3, 2012 at 3:25 am #27374sonic.penguin
ModeratorAtm, so far so good with just opening and exporting without doing anythingn w/ DOAEditor. However, I did do one attempt of editing text and screwed everything all up to heck. I will try again probably tomorrow and will let you know
August 3, 2012 at 1:33 pm #27375MiDKnighT
ModeratorQuote:Here is a revised version that will work with the IPS. It'll even only show the "4D" issue only once before it self-fixes (open and save). The 4D pop-up is sort of an artifact of the IPS/game combo and not something I can really control However if MiDKnighT wants to 'fix' it, it could be done by incrementing the pointer up by two for that last line before the new content.Hi Niahak, which pointer are you referring to? I obviously want to the IPS patch to play nicely with DoaEditor. I can fix the IPS patch if you show me what to fix.
August 3, 2012 at 2:06 pm #27376sonic.penguin
ModeratorSS of the garbled text that comes when I edit the text via DOAEditor. It only happens on the 'challenge' part sometimes. I'll email you two copies, borked and unborked Niahak so you can decipher what went wrong. Since it happens RARELY and only for one line of text, not sure which one but a challenge one, it might be referencing something wrong, maybe a typo midknight?
August 3, 2012 at 2:31 pm #27377MiDKnighT
ModeratorAlso Niahak, I'm thinking of expanding the ROM again and move all the portraits and sprites off of the original ROM for more coding room. If I do that would you be able to change DoaEditor to support a 1M ROM? I would obviously need to change my expanded portraits and sprites code.
August 3, 2012 at 9:19 pm #27378Niahak
ModeratorQuote:Hi Niahak, which pointer are you referring to? I obviously want to the IPS patch to play nicely with DoaEditor. I can fix the IPS patch if you show me what to fix.Actually, I'm not sure why the line in question doesn't already cause an issue with DoaEditor on a vanilla ROM. You can see it at 0x2f1ab in the ROM. I'll look into it after the weekend's over and update.
sonic – I took a look at the ROM and I don't see anything actually incorrect in the text. It looks like you changed the line normally filled with 0s to be much shorter (which makes sense – saves a lot of space). Best guess at this point is that it is something to do with the way the duel lines are referenced? I actually can't even find the line that it's grabbing the end from ("er[line] than you!").
Re: an even larger ROM, I can make DoaEditor can do that… but it will take some time to implement.
August 4, 2012 at 2:30 am #27379sonic.penguin
ModeratorQuote:Best guess at this point is that it is something to do with the way the duel lines are referenced? I actually can't even find the line that it's grabbing the end from ("er[line] than you!").My thoughts exactly, and somehow it changes between the application of the IPS patch and when I use DOAEditor.
August 7, 2012 at 6:11 pm #27381MiDKnighT
ModeratorQuote:The 4D pop-up is sort of an artifact of the IPS/game combo and not something I can really control However if MiDKnighT wants to 'fix' it, it could be done by incrementing the pointer up by two for that last line before the new content.Quote:Actually, I'm not sure why the line in question doesn't already cause an issue with DoaEditor on a vanilla ROM. You can see it at 0x2f1ab in the ROM. I'll look into it after the weekend's over and update.Unfortunately I can't fix the "4D" thing via the IPS patch. The reason is that the "4D" might not be in 0x2f1ab in everybody's ROM after they edited text. An IPS patch is just a hex replacement, it's not smart enough to know where the "4D" is in the text bank page.
More info that I put in another thread after sonic's text is getting garbled:
With IPS patch 1 I put the duel text at the bottom of page 0B. I put it at the bottom because everybody's text bank is a different size if they edited text so I stick it at the bottom of the page to avoid running over someone's text. Then I update the last 32 pointers of the text bank to look for my new text at the bottom of the page.
The way DoaEditor works is it puts the text sequentially in the page.
When you open the ROM after patching you get the key errors, etc… because it sees a big gap between the text 5F (the last text before duel text) and text 60. So then it corrects this by moving the duel text up to fit sequentially with the rest of the text. So if your text is getting garbled it must have something to do with the way DoaEditor is moving the text.<– EDIT: This is the way it worked before the latest DoaEditor.Unfortunately I have no idea how to do the patching differently. I can't try to put the duel text at the end of the text bank because I have no idea where everybody's text bank ends and IPS patching can't really address that because it doesn't intelligently search ROMs for different things.
Niahak, if you can think of a better way to add my new text (besides sticking it at the bottom of page 0B like I'm doing in the patch) let me know :)
August 7, 2012 at 6:23 pm #27382MiDKnighT
ModeratorQuote:Niahak, if you can think of a better way to add my new text (besides sticking it at the bottom of page 0B like I'm doing in the patch) let me knowPerhps one way is to just have DoaEditor add the next text with a fancy "Duel" page in DoaEditor where you can edit the taunts, edit the "Rare Duel List", edit the "No Kill List", the "Mismatch List", etc… :D
August 7, 2012 at 6:45 pm #27383sonic.penguin
ModeratorHere here FLEXX
August 7, 2012 at 7:14 pm #27384MiDKnighT
ModeratorOK in the latest DoaEditor it doesn't seem to be moving the Duel text but it's also not loading the last one. Niahak, can you check that? I think I know what's happening… Since the last line isn't loading editing other duel text is overwriting the last line?"
The last line should be: "Are you brave enough to fight [OFFICER]?"
August 7, 2012 at 7:43 pm #27385sonic.penguin
ModeratorI thought it was "I challenge thee, [OFFICER-2] to a duel!"
It sounds almost european hehe, but Are you brave enough I think is the 2nd to last one?
August 7, 2012 at 7:47 pm #27386MiDKnighT
ModeratorNope, last one is:
Are you brave
enough to fight
[OFFICER]? [>]
[END]
DoaEditor isn't loading that line for editing and that's the line that's borking in your ROM.
Probably just need to increase a value by one in the DoaEditor code…
-
AuthorPosts
- You must be logged in to reply to this topic.

