[Technical] [Mega Drive] Rockman Mega World - Remove Cooldown Loop From Fire Storm

Started by Josephine Lithius, October 28, 2022, 11:10:09 PM

Previous topic - Next topic

Josephine Lithius

I'm trying to make a code for that will let the player rapidly use Fire Storm's rotating "shield" or "satellite", like in Mega Man / Rockman, the NES / Famicom version.

In the NES version, Fire Storm's satellite has absolutely no bearing on whether or not a player can use the weapon again.  If they're next to the edge of a screen, for example, they can rapidly shoot Fire Storm off-screen and continually surround themselves with Fire Storm's satellite.  They can also summon another satellite if the main projectile is still on-screen while the satellite isn't.  This is very likely a bug, however, as the re-summoned satellite lasts for 255 frames.
In the Mega Drive version, however, the satellite affects the "weapon cooldown" value, located at $FFA427, by "decreasing" it from $00 all the way back to $FF, then decrementing down and repeating the process.  Or, it would if Fire Storm's satellite lasted for that long.  Once the satellite disappears after 24 frames, the code breaks the loop and sets the cooldown to a normal number, at which point the cooldown decrements down to $00, after which the player can attack, again.

Using the Exodus emulator, I've been able to set the "normal cooldown" (ROM address $02D356) of the weapon to $01 (it's normally $08), but despite my best efforts, I can't seem to isolate the code that causes the "infinite cooldown" when Fire Storm's satellite is up.  There's nothing in any of the code that gets executed in that frame which screams "this causes an endless loop", though $02030A to $02D314 seems to loop into itself for the frame where Fire Storm is used. (The line of code begins at $02D2AC, for the curious.)  I've also tried using the Sega CD Search/Patch Tool, but it turned up absolutely nothing.  So, yeah.  Bit of a head-scratcher for a "coding novice" like me.

I think I've done all I know how to, so maybe someone else can pick up my slack?  If anyone wants to give it a look-see, modifying the ROM with 013046:660A will give all the Rockman 1 weaponry right away.  01308A:661C gives the Rockman 2 weapons if anyone wants to investigate Item-2 or 3, too, as Thunder Beam (E), Item-2, and Item-3 do that "perpetual cooldown" thing a 'Beam or Item on screen.  They actually use the same "normal cooldown" value at $02D356 so they may use the same "perpetual cooldown" code.

Hoping to hear good news.  Thanks for any and all help.