Ugh, IDA, why are you ignoring the data bank register in this disassembly?? Maybe half the memory references in my disassembly are completely bogus because IDA "helpfully" mapped them into memory, but in the completely wrong place...

This is completely wrong! "word_7Fxxxx" should be "word_00xxxx" (or "word_7Exxxx", since memory is mirrored there for the first 0x8000 bytes).

I don't look forward to fixing all these auto-generated references...

awoo.space/media/FKxqWOjNoopvG

I gave up and split the auto-generated WRAM segment from $7E0000-$7FFFFF into two segments from $7E0000-$7EFFFF and $7F0000-$7FFFFF. This way I can automatically fix references into the second bank instead of rewriting them all manually, and IDA will even keep track of the RAM address's name if/when I name them.

I also figured out that I can manually rewrite code instructions, so I can turn all the one-byte BRK instructions into actual BRK instructions!...that aren't actually marked as code. >.>;; Oh well, at least it will be less ugly this way...

aaaaa IDA doesn't support Unicode comments ;~; I can't just type out the Japanese text into my database as comments...

I'm stuck... in subroutine hell... x.x
I've been tracing out one function for two hours and haven't even come close to finding the end of it... x.x
I think... I'm going to bed now... and then I'll start again in the morning... x.x

I just spent a few hours adding the district and shop names to our translation spreadsheet.

I feel accomplished. ^.^

I also threw together a small tool for testing how dialogue will look before inserting it in-game!

You can play around with it here, if you'd like:
raspberry.rosenthalcastle.org/

Ack, our translation spreadsheet is so huge that I can't open it on my phone anymore... >.>;;;;;

Well, I found which memory address is used for indexing which dialogue line is spoken by AI players.

Unfortunately, because I didn't finish tagging things in my disassembly, I can't cross-reference where the breakpoint I set fired with it, because that section of code is untagged...

I guess I know what I'll be doing today.

Yeesh, this is... a lot of references to this memory address. >.>;;;

I certainly have lots of work left figuring things out...

Oh wow, this is neat.

So, when choosing AI characters you can play against, there are actually two different lines that can appear! I didn't notice that there were multiple lines until I was reading through what @WTCGames@twitter.com had translated so far.

If you choose most characters, you get the first line ("Player # will be ____, right?")... but if you choose Konomi, you get the second ("I'll join as player #, alright?")

I guess Konomi really does host the whole game!

Writing a system for dynamically inserting text and automatically updating text pointers.

Using a disassembly would probably be easier, but... that requires a fully reassemblable disassembly...

I probably won't have much new to show on the IS2 project until this is working though. Sorry...! ^^;;;

Hmmm.... That's better, but... if what's causing this problem is what I think it is, I'll be very, very annoyed...

When IS2 draws a dialogue box on screen, it uses a particular 3-byte memory address for loading the window parameters from; and since all window parameters are in the same bank, it never updates the bank byte in that address.

I've moved all my custom code out into a new bank, though, including window parameters, so I have a hack in place that saves, replaces, and restores that bank byte when it loads custom text...

Except... the continue arrow also references those parameters, but the bank has already been restored when it tries drawing it, so it's using incorrect/invalid data when determining where it should draw that arrow.

I'll probably just have to find the continue arrow code and hook it somehow, just like my custom text code...

Yep, there's our culprit, just like I thought. That "func_SearchDialogDefinitionForA" call ends up going off into outer space instead of where it should be looking.

Hopefully copying and modifying this function won't be too hard...?

After two months of severe depression and no work on this project, I've finally gotten back working on the patcher.

I hate writing text parsers. x.x

I finished enough yesterday on stream that I can get a (mostly) working ROM using this! ^w^

Next will be adding additional definitions for all ... 2200+ ... dialogue lines... x.x

(If I was actually a decent coder, I would automate this. I am not, so I am doing it by hand. This is a terrible idea.)

Okay there is no way I'm doing this by hand. My wrists already hate me x.x

I'll ask @Xkeeper if they could do it for me instead with a PHP script or something...

Follow

Oh, bleh. A realization about character dialogue hit me...

There is a function used during character dialogue in-game that copies data from a temporary buffer into a particular location, which is read later when drawing character dialogue on-screen. This function only copies 64 bytes of data. (There might only even be 64 bytes of free space available in this location; I don't know for sure.)

That means that, unless all dialogue in our translation takes less than 64 bytes, I'll be rewriting this function call, and possibly be looking for extra empty space in RAM I can use for a text buffer instead of where IS2 usually reads from. :S

Annoying, but doable...

This ... took way longer than it should have, but it's done enough that I can rebuild all the changes I wrote by hand using this patcher program. ^w^

I feel like adding new bits will go much faster now!

It was as if all of Itadaki Street was screaming in unison, in horror of what had happened to their game.

Then, calmly, everything returned to normal, almost like nothing out of the ordinary had ever happened.

Poking through system menu dialogue for Itadaki Street 2 tonight. This game does ... weird things sometimes... but at least I'm understanding better how its code is structured.

I don't even understand how I made this work, but I made it work...!

I can't do math today. 0x649F + 1 is not 0x649A... >.>;;;;;

Well... I have some things working that weren't before, now! ^w^ Almost all menu dialogue has been formatted and inserted, and things look pretty good!

flashing, glitchy graphics 

And some other things, well... ... ... >.>;;;;;;;;

I still have lots of work left, I guess...

I've already fixed one of those bugs (extra spaces in names), which was caused because I didn't bugtest my code when I originally wrote my variable-width font code, and a register got clobbered. ^^;;;

The dialog boxes that I didn't recognize are actually character-specific dialogue that is in a different format from what the game expects there, so that's why they are completely broken. I'll look for those code references later, I guess...

And that flashy, glitch mess at the end... is probably caused by a bank value being wrong, and incorrectly-formatted, unterminated text being drawn, which overflows the tilemap into other parts of RAM, and eventually consumes the entire game...

I don't know exactly how I'll tackle that yet. .-.;;; It's part of a few lines that required extra work, so I left them out when formatting the rest of the menu text...

Well, I fixed what caused everything to break yesterday, and ran into a different, very annoying and also very strange bug:

When playing any game with an AI opponent, after that AI player says anything, the game clears completely wrong memory addresses when removing their dialogue box. This causes all sorts of problems, like corrupt tiles overwriting the map, the HUD disappearing, or the game soft-locking after displaying that dialogue box...

Nothing I added recently directly caused this; it is either a byproduct of something I added in my very first patcher build, or something related to how my patcher itself builds everything into the ROM.

My hand-patched build from months ago doesn't exhibit this bug, so I have no idea what is wrong...

Oh no... I isolated what is wrong here, and I am not happy at all...

It's another instance of this game always expecting its text to be in a very specific bank. It never, ever updates what bank it searches for dialog boxes in, only what address within that bank is being currently used.

That causes problems like this, where another function is looking for where it should draw (or, in this case, clear) a dialog box, but it runs off into who-knows-where and trashes memory...

It didn't happen in my hand-patched build because I hadn't moved any dialog boxes that called this function into expanded ROM space, and my code that handled AI dialogue used the original dialog box definition.

This is so frustrating...

I'm glad I documented what I was doing last here, because I hadn't marked down what needed changing anywhere else...

I'm exhausted today already, but I will try working on this later...

I finished fixing all the code that was calling the SearchDialogDefinition function last night, so ... now I have to go back through each dialog box call, and check the surrounding code for any of the old functions I just replaced, and repoint them properly...

... weh. Tedium. x.x;;

Awesome, rewriting everything that touched SearchDialogDefinitionForA fixed the corruption bug that was crashing games when AI characters said anything! ^w^

... aaaand I immediately found another corruption bug in a dialog window I didn't touch yet. >.<;;;

I don't even know how Konomi's face got corrupted...

Show newer

@Raspberryfloof when you're breaking down inside but need to keep up the facade everything's alright

Sign in to participate in the conversation
Awoo Space

Awoo.space is a Mastodon instance where members can rely on a team of moderators to help resolve conflict, and limits federation with other instances using a specific access list to minimize abuse.

While mature content is allowed here, we strongly believe in being able to choose to engage with content on your own terms, so please make sure to put mature and potentially sensitive content behind the CW feature with enough description that people know what it's about.

Before signing up, please read our community guidelines. While it's a very broad swath of topics it covers, please do your best! We believe that as long as you're putting forth genuine effort to limit harm you might cause – even if you haven't read the document – you'll be okay!