News:

11 March 2016 - Forum Rules

Main Menu

Mega Man - Refill Weapon Energy after Death

Started by Thirteen 1355, September 13, 2019, 09:01:18 AM

Previous topic - Next topic

Thirteen 1355

Okay, so, Mega Man 1 and 2 should be all good. Tested them quite a bit and they seem to work. However, with Mega Man 3, I start off with all weapons without having defeated any Robot Master. The weapons refill after death like they should, though. Does this problem have to do with Mega Man 3 having more banks to load than the earlier games? Also, when I get hit my health goes to 6 immediately, when I use a weapon, its energy gets reduced to 6 as well.
Helicoptering about till I find some ROM hacking treasure.

Cyneprepou4uk

QuoteMega Man 3, I start off with all weapons without having defeated any Robot Master
This will be harder. You need to find some flags in RAM that tell the game if player has a particular weapon or not (it can be a single address if you are unlucky). Then use these addresses to check for necessity of refilling those weapons, one by one. Creating a loop would be nice.

QuoteDoes this problem have to do with Mega Man 3 having more banks to load than the earlier games?
Nope. It's how game code works, not how many banks or whatever.

QuoteAlso, when I get hit my health goes to 6 immediately, when I use a weapon, its energy gets reduced to 6 as well
I can't tell from here, I need to see original and your code to say what can be wrong. Obviously original game works fine, then it must be something that you've done.

DarkSamus993

Quote from: Thirteen 1355 on September 14, 2019, 09:37:46 AM
Now, I looked a little bit into doing this for MM7 and the X games, and it seems like a ten times bigger job.
Here's the patch files and source code I made for weapon refilling for MM7 and MMX1-3: https://drive.google.com/open?id=10w5bmcswE8VmJdBkLV4w9jfXn_JgI6YK

The process was simple:
1) find the subroutine for filling weapon energy when a stage is loaded.
2) find when the life counter is decreased (player died) and hijack it to also run the 'refill weapon energy' subroutine.

The 'refill weapon energy' subroutine checks if the boss is beaten by seeing if the proper bit is set in the weapon energy RAM value. This results in circular checks:
- you beat the boss so you have the weapon (when starting a stage).
- you earned the weapon so you beat the boss (when going through the boss doors).

Thirteen 1355

#23
Quote from: DarkSamus993 on September 15, 2019, 12:35:47 AM
Here's the patch files and source code I made for weapon refilling for MM7 and MMX1-3: https://drive.google.com/open?id=10w5bmcswE8VmJdBkLV4w9jfXn_JgI6YK

The process was simple:
1) find the subroutine for filling weapon energy when a stage is loaded.
2) find when the life counter is decreased (player died) and hijack it to also run the 'refill weapon energy' subroutine.

The 'refill weapon energy' subroutine checks if the boss is beaten by seeing if the proper bit is set in the weapon energy RAM value. This results in circular checks:
- you beat the boss so you have the weapon (when starting a stage).
- you earned the weapon so you beat the boss (when going through the boss doors).

Great job as always. Thanks a load!
After all these I plan to give Mega Man V for the Game Boy a try, and if I'm able to, Wily Wars for Genesis (though that one I can see some roadblocks for).

September 15, 2019, 09:10:58 AM - (Auto Merged - Double Posts are not allowed before 7 days.)

Fiddled around with flags for MM3, and I think I found a way to help this all.

September 16, 2019, 03:20:02 PM - (Auto Merged - Double Posts are not allowed before 7 days.)

With some help from DarkSamus, Mega Man 3 now has a working health refill edit!

4, 5 and 6 should follow suit!

September 19, 2019, 03:32:00 PM - (Auto Merged - Double Posts are not allowed before 7 days.)

Mega Man 4's doing a little strange, in that I got energy refilling working all right, except it's only working in the stage I triggered the breakpoint in (Bright Man's stage). Upon selecting another stage, the screen goes and stays black instead of loading the stage.

September 19, 2019, 06:46:34 PM - (Auto Merged - Double Posts are not allowed before 7 days.)

Another update no one will notice since my posts keep merging, but Mega Man 5's refill edit seems to work all good. Very strange considering MM4's situation.
Helicoptering about till I find some ROM hacking treasure.

Thirteen 1355

#24
The Mega Man 4 patch is all done! The Mega Man 1 and 2 refill patches have been uploaded to romhacking.net

Mega Man 5 is probably done but needs to be tested still. All that remains is the Mega Man 6 patch and maybe the Game Boy Mega Man games, and Mega Man & Bass but that one's being covered by DarkSamus993.

Right now I'd like to focus on the Game Boy Mega Man games. Anyone got any leads on that?
Helicoptering about till I find some ROM hacking treasure.

Cyneprepou4uk

#25
It's basically the same method for other platforms as well. Find addresses, find free space, write code and execute it. Or use existing refilling weapons routine if you've got the skills, like DarkSamus993.

I'm not a gameboy romhacker, so I can't help with that. I would start with googling for an emulator with debugger.

Thirteen 1355

#26
Yep, right now me and a friend are in the process of tackling all the GB games (maybe the Xtreme games as well). I found BGB, a GB emu with debugger. Finding the right values was easy. Now it's just a matter of understanding Game Boy coding. What helps is that finding free space in these games is way easier.

After that I have time to test the games, including MM4 and 5, whose patches I will upload once done with them. Then only MM6 remains.

October 03, 2019, 06:57:17 PM - (Auto Merged - Double Posts are not allowed before 7 days.)

EDIT
I managed to edit all the Game Boy Mega Man games (save for Xtreme, which will likely follow). Trying the weapons out in Wily Stages produces satisfactory results for each of the five games. Now I just need to play through all of them. If they are 100% alright, I will submit them shortly after.
Helicoptering about till I find some ROM hacking treasure.

Thirteen 1355

UPDATE:
Next week I will have a lot more time for testing and hacking Mega Man. The pace of uploading these patches will be picked up quite a bit. Mega Man 6 and all the GB games should be good, but I still want to play through all of them just to be sure (I found a small issue in MM5's ROM while testing, and there I also believed everything was perfect). Mega Man 9, 10 and Wily Wars are still the main focus of figuring out. Haven't had much time to look into these. I've done some research on Xtreme as well. Seems to work the same way as the other GB games except that, as usual in the X series, the max health value isn't always the same throughout the game. I will soon start thinking of ways to get around that tidbit.
Helicoptering about till I find some ROM hacking treasure.

Thirteen 1355

Editing the WAD files for Mega Man 9 and 10 seems to go nowhere. We finally could get into looking for free space but there's barely any in there. Focus will now go to Mega Man Xtreme, and I wanna look into the SNES games myself as well.
Helicoptering about till I find some ROM hacking treasure.

Thirteen 1355

I just submitted the refill patch files for Mega Man Xtreme 1 and 2. I do have patches of the SNES X games, but as of yet, I haven't had permission to upload them from DarkSamus.
Helicoptering about till I find some ROM hacking treasure.

Trumpster

Hey man. Do you have a link for the DarkSamus Megaman 7 one? Thanks for your hard work, God bless you!
Make the Blue Bumber Great Again



TheGershon

A patch for Xtreme 2 was recently released by ArcadeGamer1929 that adds a mapped Dash Button (https://www.romhacking.net/hacks/6233/). I find it quite transformative, but unfortunately it doesn't work when combined with the Refill patch (https://www.romhacking.net/hacks/4828/). Is there any interest in making the patches work together?

Thirteen 1355

Ooh interesting. Yeah, might take a good look at that! :banghead: :'( :angel: :happy: :angel: :-* :angel: :o
Helicoptering about till I find some ROM hacking treasure.

ElwinBran

Quote from: TheGershon on September 29, 2021, 03:39:16 AM
A patch for Xtreme 2 was recently released by ArcadeGamer1929 that adds a mapped Dash Button (https://www.romhacking.net/hacks/6233/). I find it quite transformative, but unfortunately it doesn't work when combined with the Refill patch (https://www.romhacking.net/hacks/4828/). Is there any interest in making the patches work together?
It took a while, but I got around to making my patch compatible, was a simple matter of the patches being on overlapping offsets. The new release should accepted in a day or so. :thumbsup:

EvilJagaGenius

Sorry for necrobumping.  I've been playing Wily Wars via the Retro-bit rerelease ROM, and adapting some features of the Classic Fluency and Flow hacks to the new ROM.  The slowdown fixes Retro-bit made are really nice.  Could I ask for an update to the Wily Wars refill patch to work with the Retro-bit version?

Many thanks for all your work!
My blog: The Jaga's Nest

TheGershon

Another necropost, but is there any interest from the hackers in making patches for the recently released Mega Man World V DX and Mega Man World GBC patches? Wily Wars Retro-bit release would also be nice.