Metal Slug 2 NoBGM patch ======================== Simply removes background music from Metal Slug 2. Applies on Metal Slug 2 and Metal Slug 2 Turbo. To apply the patch, extract mslug2.zip/mslug2t.zip and patch the file `241-m1.m1` with the included IPS patch, then repack the zip. Technical explanation ===================== (A copy of the original post to arcade-projects.com forums on Sep 18th, 2017) 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