News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Help hacking Minish Cap Audio Sound FX  (Read 338 times)

Pickleguy

  • Newbie
  • *
  • Posts: 2
    • View Profile
Help hacking Minish Cap Audio Sound FX
« on: October 14, 2019, 04:15:24 pm »
Hey! I want to remove sound effects from Minish Cap (Link's voice) but I don't even know where to begin with learning how to do that, or even what the best approach would be. Would anyone be kind enough to point me down the correct path? Thank you!

FAST6191

  • Hero Member
  • *****
  • Posts: 2611
    • View Profile
Re: Help hacking Minish Cap Audio Sound FX
« Reply #1 on: October 15, 2019, 07:05:01 am »
Being on the GBA and being a Nintendo game then chances are you will be looking at the Sappy audio format. http://www.romhacking.net/documents/462/ and a whole bunch of tools exist for this one.

Four main approaches then being (almost regardless of system or format within it but do try the sappy stuff first)
1) Such things often have a software set volume level. Set this to 0 and while it is still technically playing there will be nothing coming out of the speakers.
2) If you know the format and can overwrite it then overwrite it with silence. Again something will still technically be playing but if it is actually just silence...
3) More for music but could work here. There will tend to be a loop command somewhere in there. Make it look the silence at the start of it a few thousand times or just jump back to the start of the silence.
4) Disable the call within the game for the audio in question. Normally we play with hit detection type things to increase damage, decrease damage, change game effects and so forth but one part of the list of things that happen upon the player doing an action will be a call for a sound effect to play. Hunting these down can be a bit tedious and will probably need more skills than the things above but it is not some kind of crazy hack that will see you steeped in insane maths and contemplating programming at the lowest levels.


The lazy man's version of this is the GBA only has a few audio channels with fairly specific tasks and voice/wave playback is but one of those. If it was on the DS it might be even easier as there are 16 channels there but that is a different matter.

Pickleguy

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Help hacking Minish Cap Audio Sound FX
« Reply #2 on: October 17, 2019, 02:17:45 am »
Hey FAST6191! I appreciate your very generous reply. It gives me several avenues to pursue with the simpler options being a good place to start. Though #4 when you suggest to disable the calls within the game -- can gba games be decompiled or would I accomplish something like that through hex? Thanks so much!

Jorpho

  • Hero Member
  • *****
  • Posts: 4180
  • The cat screams with the voice of a man.
    • View Profile
Re: Help hacking Minish Cap Audio Sound FX
« Reply #3 on: October 17, 2019, 09:24:20 am »
can gba games be decompiled or would I accomplish something like that through hex?
Pretty much nothing can be "decompiled".  You will occasionally read about games being "disassembled", but it is an extremely difficult and tedious process to produce a useful, annotated disassembly of a game and I don't think anyone has done it with a GBA game before.  Technically everything is done "through hex".

"Disabling the call" would be a matter of using a debugger to find out what instruction the game uses to play the sounds, and then finding where in the ROM that instruction is initially loaded from.
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

FAST6191

  • Hero Member
  • *****
  • Posts: 2611
    • View Profile
Re: Help hacking Minish Cap Audio Sound FX
« Reply #4 on: October 17, 2019, 04:43:20 pm »
Decompiled as in turned back into a high level language? Maybe in theory (though a lot of games still used inline assembly) but nothing in practice. X86 family machines being the main thing being looked at there, though I suppose we did recently see Mario 64 done.

Decompiled as in like games on CD/DVD or newer cart systems where you fire it through a program and it breaks it down into constituent files? No. Some GBA homebrew has such functionality but commercial games did not. The sappy audio format mentioned at the top is enough pointers and detectable format that you might get a program resembling it, and there are a few games that people did put the effort into (surprisingly though Zelda Minish Cap is not one of those -- Zelda games are usually some of the more noted so no idea what goes here, guess those kinstones really spoiled it for people). Granted this would mostly be useful for 1 through 3 on that list of things I suggested.

Jorpho mentioned disassembly, or a fully commented disassembly as some would term it. For the GBA I think we are still looking at just a couple of pokemon titles that got this kind of treatment ( https://github.com/pret/pokeruby ) and even then it is nothing like the older titles there in what you have to play with.

As Jorpho also mentioned your job would be to follow the GBA's efforts as it produces the sound. You could try going backwards from the sound itself -- sound itself is its own hardware/memory section after a fashion ( http://belogic.com/gba/ ) so it will eventually tickle that. Find what does it and work backwards from there.
Myself for this I would probably go forwards. Find the actions that cause the voice effects (be it a button press, triggering a cutscene, reaching a location, idling if there is an idle animation...) and go from there -- in among it all will be hit detection, animations, damage calculations and on and on and on but in there will be the sound call. You don't have to understand everything it does during this, indeed you will probably wait for something to play with the sound memory area and look more closely at that, and only need to worry about the sound. How you will stop it once you get there I don't know as it will probably vary between games but the main one would be NOPing the sound call and seeing what happens, of looking what happens at the end of it and jumping directly to that location.

As for accomplishing through hex then technically speaking as you can edit any part of the ROM you can do any hack with it, but from a practical perspective you don't do that.