News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

[SM] How difficult would it be to make MF/ZM missile selection hack?

Started by Fujisawa1, August 10, 2021, 05:37:23 AM

Previous topic - Next topic

Fujisawa1

I'd really like a hack that only changes the missile select, and was surprised I can't find one on the site. There are of course Control Freak and a few others that have this included, but you are then stuck with the other changes. All I want is the missile controls. I'm tempted to make it myself, I've done some programming, but never rom hacking, but I'm willing to give it a go for this simple control scheme.

I also want to go a step further and add it to Redesign Axiel Edition, which will probably be harder (if not impossible) because there is already a change added to Item Cancel (ball breaking).

Advice on the difficulty of accomplishing this (is it feasible for a beginner?), if its been done already and I can't find it?, and on what tool is best for modifying such controls (Smile maybe?) would be appreciated. Also, not sure if control scheme change falls under Engine Work?


Fujisawa1

GBA Style includes Control Freak and Project Base. If I could just yank the missile code right out of it, but I'd need the authors to help me out with that one.

Ideally, I'd want to make something that could be easily modified to patch over other hacks, like the Widescreen hack does.

Fujisawa1

Just found below a post on a guy working on an emulator that could possibly do this, which sounds like a much better idea. I'll run it by him and find out if it already does this, or if he's willing to add it. He already has controls added for beam/item hotkeys.

Note: Sadly, the emulator doesn't seem to work with Widescreen hacks, as I think those only work with bsnes hd.

Fujisawa1

Woah, Control Freak comes with its .asm code, so I could literally just edit it down to get what I want. This means this is feasible for me, thanks to Kejardon making his code available. This is no longer looking like an impossible task for someone with no assembly language experience.

Update: Looked at the code, done a lot of removing already. I have no idea what I'm doing, this is gonna be a lot of trial and error, and reading up on SM assembly code. My goals right now are to remove autorun menu option (just have it on by default) due to Redesign using that flag for its hint system, removing the spin jump adjustments (the hardest part) because lots of mods alter jump physics, and remove the special menu for Redesign (it has its own). Also being able to remove the button menu for mods that alter that, but it would requires me to put default button layout in the asm, and I think that's a rare situation. And then pray that none of this code is overwriting the other mods code...   which I can't do much about if it does, with my limited knowledge.

Fujisawa1

This would almost be fun if it weren't so nonsensical. I'm mostly stuck on understanding not asm, but the org command from xkas.

I run into things like:
org $809C55
   LDA $0A04   ;Use new value instead of 09D2

org $809C6C
   LDA $0A04
   
org $90C4EC
   LDA $0A04   ;Use new value instead of 09D2

So we're setting up an address to use, then loading a value...  and not doing a thing with it? Huh??? This happens a lot in this code, and I'm baffled...  I feel the org command must do more then just set aside memory to work in. This doesn't seem like the best place to post this, but I'm not sure where else to post it. I need to find an asm forum, I think. And yes, I've read lots of tutorials, none of them want to get into org commands.

Note: Okay, I have 2 theories...  there is another file that goes with this asm, and it calls the org, or the game itself calls them. That is the only thing that makes sense in my head.

Update: Think I'm onto something. Found a table of Metroid memory, and where he wrote org code for a power bomb, the address the org uses is related to morph ball. Eh, eh? Yeah, think this might be it.

Quick Update: I think I'm on the final piece of this puzzle. I think if you branch to a name, and that name is inside an org, it calls the org. If I'm correct, everything in this ASM makes sense...  it also means all the code I need to understand what he's doing is hidden in the game code, and I've got a big headache making sense of it all @.@

samsamcmoi

The org command just write the code (below the org line) to the corresponding address specified on the org line, on lorom format, to the rom.

For this example :

org $809C55
LDA $0A04


Means : at address $809C55 of the rom (adress 9C55 from the bank $80) write the following code (overwrite existing code by the following) :
LDA $0A04 (vanilla code was LDA $09D2)
load the value at $0A04 address from the ram to the accumulator (if you want to know what this code does).

You have to know the vanilla code on "org" addresses to figure out what is executed.
P.Jboy has disassembled the entire rom (or almost) and commented it.
Thanks to him it can be easily consulted on his website :

Bank 80

If you don't know the ASM language, it will be very painful to understand the code, unless you want to start learning it.

And last thing : addresses are on SNES lorom format.
To convert lorom to pc format, you have to use the tool "Lunar Address". After that, you will be able to open your rom with HxD for exemple (hexadecimal editor).

Fujisawa1

Thank you for the help Samsam, I was just looking to have another go at this project, and wasn't expecting any replies. You actually gave me really good info, enough to fill in holes I couldn't find elsewhere, so maybe now I can actually figure out .asm this time. I felt like I was close to getting it last time. I find it very difficult to find useful information on asm anywhere, and I know a lot of asm coders learned it all nearly on their own.