I was working with SF2CE recently and realized that the mutecodes for the CPS1 games that I found earlier aren't very good. If you activate them during a match, the tones take forever to fade away. Plus, the music changes when someone gets near KO, so there is sometimes an odd tone when that happens, even if you activate before. This is really not much better than the old way.
There may not be a perfect solution possible from just zeroing out memory addresses. The way to get the job done precisely is with breakpoints. (Here I go again.) There are two objectives: execute the routine that makes the music stop, and prevent the routine that loads new tracks from being executed. These two lines accomplish exactly that, and they work for WW, CE and HF:
bp 00C0,audiocpu.rb@D7E1>0,{pc=006A;g}
bp 025A,1,{pc=030F;g}
You need to run MAME with the -debug command line option, then the debugger will steal focus when the game is loaded. Press F6 to switch to the audio CPU, otherwise it'll mess with the wrong CPU and won't work. Then enter those lines separately in the console. (Or as a single line with a semicolon between.) Press F5 to make the debugger return control to the main program, and click in the game window to get on with the game.
The first one instantly kills any music found to be playing, so it'll work even if you load a savestate into the middle of a round. The second one watches for when a new track is about to be loaded and skips to the end of the routine without letting it happen, so the near-death change and any other change won't occur. There shouldn't be any side effects.
That's nice, so how about making it a cheat code so it'll be easier to use? Problem is the MAME cheat engine doesn't support breakpoints. So that's as good as it gets for now. Oh, and if you are doing this with MAME-rr, be sure to type bpclear in the console before quitting or loading another ROM. Any breakpoints or watchpoints active during ROM closure crashes it.
On a side note, my experience so far with the debugger has been reading assembler code for 68000 CPUs. But the audio CPU is a Z80, and the assembler language is not the same. I found this sloppy but adequate introduction that got me up to speed.
Can't you write cheats that patch the ROM?
Something like changing the CALL to these music subroutines to a NOP...
Posted by: mz | 04/09/2011 at 06:27 PM
Excellent idea. This seems to do it:
<cheat desc="No Background Music">
<script state="on">
<action>temp0=audiocpu.rd@00AA</action>
<action>temp1=audiocpu.rd@025A</action>
</script>
<script state="run">
<action condition="audiocpu.rb@D048 gt 0">audiocpu.od@00AA=00006AC3</action>
<action condition="audiocpu.rb@D048 eq 0">audiocpu.od@00AA=temp0</action>
<action>audiocpu.od@025A=00030FC3</action>
</script>
<script state="off">
<action>audiocpu.od@00AA=temp0</action>
<action>audiocpu.od@025A=temp1</action>
</script>
</cheat>
(Found the bytecode here.)
Posted by: dammit | 04/10/2011 at 12:24 AM
Nice, it went in just in time for 1.42.
http://www.mamecheat.co.uk/forums/viewtopic.php?f=10&t=4057
Posted by: dammit | 04/10/2011 at 11:34 AM
:D
Posted by: mz | 04/10/2011 at 08:19 PM