JoseJX / analogue-pocket-patches

IPS Patches for the Analogue Pocket
80 stars 2 forks source link

Missing combat menu on both Heracles no Eikou #65

Closed megane72GH closed 1 year ago

megane72GH commented 1 year ago

Hi JoseJX, I was porting your patch to the newer translation of Heracles no Eikou (https://www.romhacking.net/translations/3365/) also for practicing (here my page https://github.com/megane72GH/analogue-pocket-patches) and I discovered that after patching the new translation the combat menu is missing. Thinking was my fault i checked both your previous patches and the problem is present in both:

https://github.com/JoseJX/analogue-pocket-patches/blob/main/README.md#heracles-no-eikou---ugokidashita-kamigami https://github.com/JoseJX/analogue-pocket-patches/blob/main/README.md#heracles-no-eikou---ugokidashita-kamigami-english-translation

So I checked both original .gb roms and the problem is not there, so it is something added in the .pocket transformation.

Here the correct expected screen:

image

and here what can be seen:

image

Seems that the missing menu is flashing and then is hidden

You can test it in the first random fight (some minutes in the game) and is present in every fight

Unluckly I did not yet have the proficiency to backtrack the problem in the assembly, I'm a noob and this rom has a lot of tricks that are not yet clear to me.

If you can find the problem and correct it I can port it on my new translation conversion: https://www.romhacking.net/translations/3365/

Thank you in advance.

JoseJX commented 1 year ago

Hi! Thanks for testing, and reporting the issue, I definitely didn't get to testing everything I patched.

I remember patching this one, it was pretty annoying and I ended up writing a C program to catch all the tables. I guess I missed one or there's a bug in my code, I'll review and see if I can fix it.

Thanks!

JoseJX commented 1 year ago

I can confirm that I can reproduce the issue. I'll give you the short version of what's going on, since you're working on patches as well. You should send the retropatcher a link to your patches as well and get them added!

So, in this game, there's sort of a state machine that takes in a request and then sets a few video related registers depending on the flags that are set in the request. At 0xB6E, there's a function that reads from an address stored in [0xCC04-0xCC05]. Reading from the address specified tells us which registers to set based on a bit field. The values that follow this instruction byte are only present if the bit for that register is set. The flags are:

; 0 - LCDC ; 1 - SCY ; 2 - SCX ; 3 - WY ; 4 - WX ; 5 - Restore from ffab+ instead of hl

So, I wrote a program that goes through the tables of addresses that I found and parses to see if there's an LCDC register, and if so, change the value. I suspect that I missed some of the tables, so I'll go back and inspect to see where it's getting caught. Hope that helps and thanks again for reporting!

megane72GH commented 1 year ago

Yes, the first thing I did was connect my patches to Jon's Retropatcher.

I also followed Trey Turner's excellent guide to learn how to patch Pocket roms.

I immediately understood how to convert similar roms from different languages ​​to Italian (mine) and it seems to work perfectly. Then I tried to convert an original rom without any source (Urusei Yatsura: Miss Tomobiki or sagase!) to copy from... and since it was very simple (.gb) and with a great stroke of luck, I managed to convert it.

But I only have very limited expertise in assembly so for now a job like yours in understanding the logic of the rom (game) is prohibitive for me.

I certainly don't want to waste your time tutoring me, so first I'll try to bang my head around the code and then in the future maybe for specific problems I'll try to ask you for suggestions or tricks to apply.

But if I encounter other bugs in the patch copying process I will definitely report them to you.

If you manage to fix the bug in this rom (and I'm sure you will succeed given the amount of work you've done so far) I will also include the fix in the new version of Heracles.

JoseJX commented 1 year ago

I've created an updated patch for both the JP and EN versions that were previously provided, along with a patch that applies to the alternative translation you mentioned above. These games are definitely much harder to patch than most, so please, let me know if you run into any further issues with them!

Thanks again for reporting the issue!