mod nes apu to disable sound channels
Moderator: Moderators
mod nes apu to disable sound channels
hello all,
i wasn't sure whether to put this in the music section or here, but sided with here because it involves real hardware.
i was wondering if the nes apu/cpu could be modded to disable/enable specific sound channels (p1, p2, t, n, and dmc). i realize that emulators can already do this, but i'd love to be able to do it on a real nes. im not talking about the hi-def mod feature either, because that is only possible for the emulated audio sent through hdmi. anybody know if this is possible through a hardware modification?
edit: whoops, i accidentally posted it in the music section!
i wasn't sure whether to put this in the music section or here, but sided with here because it involves real hardware.
i was wondering if the nes apu/cpu could be modded to disable/enable specific sound channels (p1, p2, t, n, and dmc). i realize that emulators can already do this, but i'd love to be able to do it on a real nes. im not talking about the hi-def mod feature either, because that is only possible for the emulated audio sent through hdmi. anybody know if this is possible through a hardware modification?
edit: whoops, i accidentally posted it in the music section!
Re: mod nes apu to disable sound channels
pulse channels 1 and 2 are one channel.
Triangle, noise, and DPCM are the other.
https://forums.nesdev.com/viewtopic.php?p=72984#p72984
Triangle, noise, and DPCM are the other.
https://forums.nesdev.com/viewtopic.php?p=72984#p72984
Re: mod nes apu to disable sound channels
Interesting...
Can 2 NES CPU's be tied together and make one play only p1 and triangle while the other plays p2, noise and DMC?
Can 2 NES CPU's be tied together and make one play only p1 and triangle while the other plays p2, noise and DMC?
Re: mod nes apu to disable sound channels
No, there's no way to selectively disable channels on one CPU other than by changing the code that is executed.
I'm not certain if any of the rest of that's possible either, but the above is an obvious very-difficult-to-bypass thing.
I'm not certain if any of the rest of that's possible either, but the above is an obvious very-difficult-to-bypass thing.
Re: mod nes apu to disable sound channels
I seem to remember when ripping NSFs, that many games often wrote $0F to $4015 during the init and never touch it again (unless they are using DPCM). In that case it should be possible to use a Game Genie code to disable channels. Change the $0F byte to mask out whatever channels you want. Won't work for everything.
- rainwarrior
- Posts: 8732
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: mod nes apu to disable sound channels
Shouldn't it work for everything? Reset silences all channels, and $4015 is the only way to re-enable them. Masking writes to $4015 should be enough... I think?Memblers wrote:I seem to remember when ripping NSFs, that many games often wrote $0F to $4015 during the init and never touch it again (unless they are using DPCM). In that case it should be possible to use a Game Genie code to disable channels. Change the $0F byte to mask out whatever channels you want. Won't work for everything.
The only thing I think you're missing is the nonlinear mix from shared channels, but that's a pretty subtle thing, acceptable to ignore in most cases.
Re: mod nes apu to disable sound channels
Yeah, what I was thinking is that some games might do wacky stuff and write to $4015 all over the place even if they didn't need to, then you'd just run out of GG codes. So probably better to say it should work for almost everything. Actually this would probably work with DPCM games as well, you might look for them writing $0F as well as $1F to $4015 and possibly need 2 codes (assuming again that they only have one bit of code that handles this write).rainwarrior wrote:Shouldn't it work for everything? Reset silences all channels, and $4015 is the only way to re-enable them. Masking writes to $4015 should be enough... I think?Memblers wrote:I seem to remember when ripping NSFs, that many games often wrote $0F to $4015 during the init and never touch it again (unless they are using DPCM). In that case it should be possible to use a Game Genie code to disable channels. Change the $0F byte to mask out whatever channels you want. Won't work for everything.
- rainwarrior
- Posts: 8732
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: mod nes apu to disable sound channels
Oh, I didn't realize you meant actually doing it with a game genie. I just presumed were were talking about theoretically building a board with two NES CPUs on it, and just masking $4015 writes for them both.
Re: mod nes apu to disable sound channels
This is great!
Altough very complicated to do!!
Altough very complicated to do!!
Re: mod nes apu to disable sound channels
wow, thanks for the input everyone!
i didnt know that they were bunched in 2 channels. can a mod be installed just to enable/disable those groupings, then?lidnariq wrote:pulse channels 1 and 2 are one channel.
Triangle, noise, and DPCM are the other.
https://forums.nesdev.com/viewtopic.php?p=72984#p72984
i dont really have any experience with game genie codes, but this sounds cool. i have an everdrive for nes. what is the $0F byte and how do i change it? does this involve looking at game code?Memblers wrote:I seem to remember when ripping NSFs, that many games often wrote $0F to $4015 during the init and never touch it again (unless they are using DPCM). In that case it should be possible to use a Game Genie code to disable channels. Change the $0F byte to mask out whatever channels you want. Won't work for everything.
Re: mod nes apu to disable sound channels
Sure? If I understand you correctly?pikasurf wrote:i didnt know that they were bunched in 2 channels. can a mod be installed just to enable/disable those groupings, then?
Just search the internet for "nes stereo mod". It's a bit of a misnomer, because the voices were never intended to be separated L and R, but whatever.
Re: mod nes apu to disable sound channels
Yeah, you'll have to look at the game code, but using a debug tool such as the breakpoint feature in FCEUX will take you straight to the part you want. You can set a breakpoint on writes to $4015, then the emulation will stop (very likely on a STA $4015 instruction). Then you can look at the code, and the instruction right before that will probably be LDA #$0F. When a game starts up it will usually write zero to $4015 (to disable audio when the player hits the reset button), in that case just press "run" to skip over that one. You'll be able to see the address of that LDA #$0F instruction in memory (in hexadecimal). Add 1 to it (to skip over the LDA), now you've got the address for that $0F byte. FCEUX has a Game Genie encoder/decoder built in (under the debug stuff). Enter that address, put in 0F as the compare byte, and the value you want as the value byte. And it will give you the GG code.pikasurf wrote:i dont really have any experience with game genie codes, but this sounds cool. i have an everdrive for nes. what is the $0F byte and how do i change it? does this involve looking at game code?Memblers wrote:I seem to remember when ripping NSFs, that many games often wrote $0F to $4015 during the init and never touch it again (unless they are using DPCM). In that case it should be possible to use a Game Genie code to disable channels. Change the $0F byte to mask out whatever channels you want. Won't work for everything.
The value you replace 0F with, the lower 4 bits will enable each channel if set, disable if cleared. If you're not familiar with binary and hex notation, you can simply use 1, 2, 4, or 8 and that will enable 1 channel at at time (square 1, square 2, triangle, noise, respectively). Add those numbers together to enable multiple channels (e.g. 3 would be both square channels enabled).
Since you're using an Everdrive it might be easier just to modify the ROM in a hex editor. I'd recommend HxD - https://mh-nexus.de/en/hxd/
1- open ROM, choose Search, then Replace
2- in "search for" field, enter "a9 0f 8d 15 40"
3- in "replace with" field, enter "a9 01 8d 15 40" (the 01 will enable square #1 only)
3- change datatype to "hex-values"
4- hit replace all, if it doesn't find any matches, then the game is doing something differently and it might not be so easy. I took a peek at Alien 3 first and it won't work in that one, I'd guess it's going to work in 80% of games though.
Re: mod nes apu to disable sound channels
twas unclear. i meant enable/disable each of the two channels you described. the stereo mod looks like it would do the trick, as it separates themlidnariq wrote:Sure? If I understand you correctly?pikasurf wrote:i didnt know that they were bunched in 2 channels. can a mod be installed just to enable/disable those groupings, then?
Just search the internet for "nes stereo mod". It's a bit of a misnomer, because the voices were never intended to be separated L and R, but whatever.
Memblers, thank you for that awesome walkthrough^^. im going to attempt this!
i don't have a real purpose for this, but i got the idea from the pause screen for SMB2 (USA). i like enabling/disabling the pulse channels in the background music for some reason