What's new

Koston

Student
Joined
Aug 20, 2017
Messages
62
Reaction score
52
Location
Helsinki, Finland
Hi there,

I've had a long-standing plan to listen to metal (and drink beer) while playing Metal Slug 2, but the in-game music is in the way. Since I don't want to mute the whole game, I've taken first steps to selectively silence only the stage background music from the game.

What I've done so far is modify the sound driver to selectively skip playing samples when their ID matches those of the background music tracks. I've never done any romhacking before nor written Z80 assembly, so this was also a nice learning experience. I'm documenting it briefly here, and asking guidance how to proceed getting the modified binary to an actual cart (mainly, which EEPROM to use).

In short, NeoGeo sound system has a Z80 CPU with a sound driver that the m68k sends sound IDs to play. Understanding and modifying the m68k code seemed daunting, and I was also unable to find tools to successfully reassemble the disassembled Z80 sound driver, so I ended up first making code changes to the disassembled version and then using a hex editor to duplicate them directly into the original binary.

The change adds code that checks if the currently requested sound ID matches a range that corresponds to the background music tracks. I found the IDs using UniBIOS Jukebox feature. Since there was no room in the input code for this, I put the code where some NOPs used to be and added appropriate jumps. Tools used for this were MAME debugger, unidasm disassembler and a hex editor.

Relevant parts of the patch to disassembled 241-m1.m1 below, first the added code and then modified original input code.

+ ld a,a ; 00000040: 7F ; For explicity sake
+ cp $01 ; 00000041: FE 01 ; Moved from $1EE8 to make room for the JP here
+ jp z,$1F10 ; 00000043: CA 10 1F
+ cp $20 ; 00000046: FE 20 ; If a is smaller than 20, continue input loop
+ jp c,$1EEB ; 00000048: DA EB 1E
+ cp $31 ; 0000004B: FE 31 ; If a is smaller than 31, JP to end of input loop
+ jp c,$0053 ; 0000004D: DA 53 00
+ jp $1EEB ; 00000050: C3 EB 1E ; Continue input loop normally
+ jp $1F06 ; 00000053: C3 06 1F


in a,($00) ; 00001EE6: DB 00
- cp $01 ; 00001EE8: FE 01
- jp z,$1F10 ; 00001EEA: CA 10 1F
+ jp $0040 ; 00001EE8: C3 40 00 ; Jump to section to conditionally bypass playing music
+ nop ; 00001EEB: 00
+ nop ; 00001EEC: 00


Can anyone help with finding a suitable EEPROM chip to replace the original with? The binary is 128K in size.

Note: I can't legally distribute the binary or ROM image on the open Internet, but if you own the game and want the ROM, drop me a message or email. It's not yet fully tested, though.
 
Last edited:
You can use a 27c1001 or 27c010 chip to burn your modded M1 rom.

I'd personally socket the chip so if you need to re-burn it, it will be easy to remove and replace.

Note that with an original MVS cart shell you may have to mod it a bit for a socketed ROM to still fit under the vents.
 
You can use a 27c1001 or 27c010 chip to burn your modded M1 rom.

I'd personally socket the chip so if you need to re-burn it, it will be easy to remove and replace.

Note that with an original MVS cart shell you may have to mod it a bit for a socketed ROM to still fit under the vents.
Thanks, that was fast!

I don't have an EEPROM programmer, so I need to either find a chip seller with programming service, or find a local programming option here. Considering this and the trouble to cut a cart to fit a socket, I won't bother socketing it unless it doesn't work on first attempt. Plus, I need a second cart for this project. Thankfully back when I did the Turbo patch on my MS2 cart, I got two EEPROMs so I can do that mod on the other one too.
 
Wow! That is a real Arcade project. Thumbs UP! :thumbsup:

Please updat your location so people close to you can help you with your eprom programming
 
Wow. Thanks a lot, frankly I'm quite amazed how active and helpful this forum is turning out to be!

I will be contacting you nem once I have acquired a second MS2 cart, suitable EEPROM chip and finished testing the patch. And I'm always up for beer and/or video games (Sugoi?) regardless :D
 
I will be contacting you nem once I have acquired a second MS2 cart, suitable EEPROM chip and finished testing the patch. And I'm always up for beer and/or video games (Sugoi?) regardless :D
Sure. You'll find me behind the counter ;)

I just checked, I have the needed chip here for you too.
 
I will be contacting you nem once I have acquired a second MS2 cart, suitable EEPROM chip and finished testing the patch. And I'm always up for beer and/or video games (Sugoi?) regardless :D
Sure. You'll find me behind the counter ;)

I just checked, I have the needed chip here for you too.
This is what makes this a great community :thumbup:
 
I wonder what format the music was programmed in, and if you could track some new music entirely right onto the chip.
 
I wonder what format the music was programmed in, and if you could track some new music entirely right onto the chip.
I didn't look too closely into replacing the music as it's ultimately not what I want, but from what I've read, it wouldn't be trivial. The music is (I think?) a combination of ADPCM samples and FM synth, and replacing would require much more involved changed to the Z80 driver code. I wouldn't attempt this without at least first finding a way to reassemble the disassembled driver, or alternatively ripping all samples from the V-ROMs and attempting to replace the sound driver entirely, possibly by using Neobitz' Neo Sound Builder.
 
I will be contacting you nem once I have acquired a second MS2 cart, suitable EEPROM chip and finished testing the patch. And I'm always up for beer and/or video games (Sugoi?) regardless :D
Sure. You'll find me behind the counter ;)

I just checked, I have the needed chip here for you too.
Oh, awesome. I'll come and check out your place!
 
Back
Top