Codes to silence the music

Discuss NSF files, FamiTracker, MML tools, or anything else related to NES music.
User avatar
Dwedit
Posts: 5257
Joined: Fri Nov 19, 2004 7:35 pm

Post by Dwedit »

What about looking at an NSF for the init address, finding the corresponding address in the NES rom, and adding a check for certain values?
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
Ryan8bit
Posts: 2
Joined: Wed Feb 09, 2011 8:53 pm

Post by Ryan8bit »

Ok, I got Contra done. It was a little bit harder to do than Ninja Gaiden because of no sound test, plus the data isn't all in the same place. Ninja Gaiden has all the song and sound effects pointers in one nice, big block, whereas Contra's are spread all over.

Jedi QuestMaster, what methods are you using to find the music and silence it?

It's interesting to see other names around here I recognize like dwedit and Memblers. Maybe I should look around some more?

I'll be working on Mega Man 2 next.
User avatar
Jedi QuestMaster
Posts: 696
Joined: Thu Sep 07, 2006 1:08 pm
Location: United States

Post by Jedi QuestMaster »

I'll sometimes go off the NSFs to see if the order reflects the values on the rom using a cheat search.
User avatar
Optomon
Posts: 15
Joined: Fri Apr 02, 2010 2:18 am

Post by Optomon »

Ryan8bit wrote:Ok, I got Contra done. It was a little bit harder to do
It's interesting to see other names around here I recognize like dwedit and Memblers. Maybe I should look around some more?
The gets small quickly, doesn't it?

The easiest way I've found to silence the music is to just overwrite the music pointer addresses with ones that just point to a single FF byte, which typical indicate the end of a track. I've had to do this a few times in my projects. Sounds like that's what you're doing Mr. 8bit but I'm not sure..
User avatar
Jedi QuestMaster
Posts: 696
Joined: Thu Sep 07, 2006 1:08 pm
Location: United States

Post by Jedi QuestMaster »

I'm going to have to pass on Punch Out!! - I was only successful for these three:

01A530 (02) Title
01A4EB (03) Intro Sequence
01AD2E (1A) Password Screen

00 is silence
FF stops the music
tepples
Posts: 22993
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)

Post by tepples »

Super Mario Bros. (JU) (PRG 1)
9113:24,D81D:24
Game Genie: GZPPLP GZPSSA

First code disables level music; second code disables starman music.
efm
Posts: 1
Joined: Thu Sep 04, 2025 7:42 pm

Re:

Post by efm »

Ryan8bit wrote: Wed Feb 09, 2011 9:04 pm I just did Ninja Gaiden and was going to move my way down the list, but I'm currently not working on one.

NG was a lot easier to peg down because it has a sound test built in the game that even uses the on screen number as an offset for the pointer.

If one of you guys want to try doing one, go ahead and pick one and just post about it, and I'll just move onto another one and post about it.

EDIT: I have poked around a little bit with Contra, so that will probably be the one I do next.
Hi there,

Were you able to successfully remove the music from Contra? I know this is a very old forum post. Would be very interested in working this out. Thank you very much! - Evan
User avatar
segaloco
Posts: 913
Joined: Fri Aug 25, 2023 11:56 am

Re: Codes to silence the music

Post by segaloco »

Just a suggestion, could a generalized strategy be to add a DMC mute cycle to the end of NMI? That would cut the complexity, just find NMI, stick a DMC status cycle right before rti. Could that work? Maybe there would be problems with the gap of time between a timing value being set and the DMC status register being cycled.
User avatar
Ben Boldt
Posts: 1502
Joined: Tue Mar 22, 2016 8:27 pm
Location: Minnesota, USA

Re: Re:

Post by Ben Boldt »

efm wrote: Thu Sep 04, 2025 7:45 pm Were you able to successfully remove the music from Contra? I know this is a very old forum post. Would be very interested in working this out. Thank you very much! - Evan
AEXEYYTA
This one was very tricky to hack. I looked how the init code works in the NSF from Zophar. I found a spot in RAM where that code writes to. I put a breakpoint for writes to that address in the real game. I did a trace log and found the subroutine that writes it. I NOPped out the JSR to that subroutine, which took away all sound including sound effects. Restoring the subroutine mid-game restored the sound effects with the music still disabled. This confirmed the subroutine was in fact responsible for starting the music score. I selectively NOPped out different parts at the beginning of the subroutine to narrow down what was responsible, still without having any clue how it works. I started getting some sound effects and parts missing from the music as I added more NOPs until the music was gone. I then started trimming back, restoring original instructions where the music didn’t get restored. I got it narrowed down to 1 branch, and the Game Genie code changes the branch destination to +0, basically made it a “branch never”. So that was how I did it with 1 byte. No idea how it actually works on any higher level though so I can’t say with any confidence that it always works. Share a save state if you find an example that still starts music or plays a garbage score or something.
SMB2J-2Q
Posts: 267
Joined: Thu Jul 27, 2017 5:13 pm

Re:

Post by SMB2J-2Q »

tepples wrote: Sat May 14, 2011 4:34 pm Super Mario Bros. (JU) (PRG 1)
9113:24,D81D:24
Game Genie: GZPPLP GZPSSA

First code disables level music; second code disables starman music.
True, because the 24 you entered at address ID 0x1123 in the GetAreaMusic subroutine and then at ID 0x582D in the HandlePowerUpCollision subroutine is the opcode for a single-byte BIT instruction that skips over one byte (2C is similar but skips over two bytes). In both cases, this 24 tells the game to skip over the opcode for the area music queue (0xFB) and go straight to the ending RTS (0x60).

~Ben
User avatar
segaloco
Posts: 913
Joined: Fri Aug 25, 2023 11:56 am

Re: Codes to silence the music

Post by segaloco »

I see now that you're just trying to silence music not all sound. My bad.