MMDS: Adding Support for Mega Man ZX & ZX Advent. (Got the RAM Watch List & States, just need to fix this issue)
Extremezero opened this issue · 3 comments
Hey there. I've done some work in getting Mega Man ZX (or rather Rockman ZX) to work with the damage shuffler.
The problem facing right now is that the generic swap won't work with the game when taking damage since the value for the health is up in huge 4 byte integer value while the address for setting the max hp is in a 1 byte integer which is why the game won't swap.
The starting health value is at 1050000 with the address that counts the max hp is at 16. Each time you pick up a health upgrade (just like in Mega Man X) the max hp value goes up by 4 which will increase the current health capacity by 200000 as a result. There are a total of four health upgrades so each process in getting a health upgrade is 16 = 1050000, 20 = 1250000, 24 = 1450000, 28 = 1650000 & 32 = 1850000.
A suggestion is maybe having variable maxhp be assigned a set value of 1050000 that would go up by 200000 when the address that corresponds to the health up pickups is increased by 4 in it's value. Therefor the current health will never go above the max hp and hopefully work just like the rest of the generic_swap games. Don't know LUA enough to do that myself however.
The game will swap when you die though since the current health value goes to 0 if just using the generic_swap since the max hp is minimum 16.
Here are the addresses I found and what I think they do
14F764 (Position of Player)
14F7B0 (Health Bar)
14FE70 (Graphic of Health & Energy Bars, changing models affects this as well)
14F7B4 (The max HP or rather the address is connected to increasing your maximum health through the health up upgrades)
14F874 (Appears to be what state the player is in with regards to health and model change)
14F86C (Lives)
I'm using the Japanese Version of Mega Man ZX with the undub romhack that not only puts in English text to keep the Voice Acting that was disabled in the overseas versions but also includes a patch that enables the Zero 3/4 bosses that can only be accessed with having Zero 3 or 4 in the GBA slot in the DS.
I checked a clean rom of the Japanese version and the ram map isn't changed between the two so the RAM Watch and states will load fine. The states will have the max health changes from each pickup. (The game will black screen if you leave an area or die if you loaded a state however, but that's expected when you swap between a modded and unmodded version. The states will still have everything you need regardless if you use the clean or romhacked version)
The RAM watch list and states are in the zip folder.
Rockman ZX States and Watch List.zip
And the undub patch if you are interested in it. https://gbatemp.net/threads/rockman-zx-mega-man-zx-full-undub.492408/
I will find the addresses and values for the western versions after this is sorted since it will be no problem getting them again.
Are you sure you're not just looking at a too large integer? Try incrementing the health address by 2 and change it to a 2 byte integer.
I checked the RAM Search again with the 2 byte integer and found the actual address that holds the health which is two digits further from the address I originally thought was the health (14F7B2).
That's why I was confused as to why the health was so big. I'm not sure why there is two addresses related to the Health that the value goes up and down apon damage and healing. It's why I thought I originally found the address. I should of known Bizhawk shenanigans were in play.
I'll check and see if the generic swap works with the address I found. If so than I'll check the addresses of lives for the same thing
It's done. Both Megaman ZX & ZX Advent can now work with the shuffler properly.
I've added not only the USA, PAL & JP versions but also all the hacks that are available for those games. Plug-in description has also been updated. All that's left is to update support for these games on the github page.
MMDS Plugin updated with Megaman ZX & ZX Advent.zip