It is currently Sun Nov 19, 2017 3:43 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: Sun Sep 10, 2017 3:42 pm 
Offline

Joined: Fri Jun 19, 2015 2:48 pm
Posts: 5
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!


Top
 Profile  
 
PostPosted: Sun Sep 10, 2017 4:00 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6442
Location: UK (temporarily)
pulse channels 1 and 2 are one channel.
Triangle, noise, and DPCM are the other.

viewtopic.php?p=72984#p72984


Top
 Profile  
 
PostPosted: Sun Sep 10, 2017 5:11 pm 
Offline
User avatar

Joined: Sat Jul 04, 2015 9:58 am
Posts: 564
Location: -29.794229 -55.795374
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?


Top
 Profile  
 
PostPosted: Sun Sep 10, 2017 5:13 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6442
Location: UK (temporarily)
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.


Top
 Profile  
 
PostPosted: Sun Sep 10, 2017 5:31 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3483
Location: Indianapolis
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.


Top
 Profile  
 
PostPosted: Sun Sep 10, 2017 5:47 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5822
Location: Canada
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.

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?

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.


Top
 Profile  
 
PostPosted: Sun Sep 10, 2017 6:04 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3483
Location: Indianapolis
rainwarrior wrote:
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.

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?


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).


Top
 Profile  
 
PostPosted: Sun Sep 10, 2017 6:51 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5822
Location: Canada
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.


Top
 Profile  
 
PostPosted: Mon Sep 11, 2017 3:25 pm 
Offline
User avatar

Joined: Sat Jul 04, 2015 9:58 am
Posts: 564
Location: -29.794229 -55.795374
This is great!
Altough very complicated to do!!


Top
 Profile  
 
PostPosted: Mon Sep 11, 2017 4:26 pm 
Offline

Joined: Fri Jun 19, 2015 2:48 pm
Posts: 5
wow, thanks for the input everyone!

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 didnt know that they were bunched in 2 channels. can a mod be installed just to enable/disable those groupings, then?

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.


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?


Top
 Profile  
 
PostPosted: Mon Sep 11, 2017 4:44 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6442
Location: UK (temporarily)
pikasurf wrote:
i didnt know that they were bunched in 2 channels. can a mod be installed just to enable/disable those groupings, then?
Sure? If I understand you correctly?

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.


Top
 Profile  
 
PostPosted: Mon Sep 11, 2017 5:09 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3483
Location: Indianapolis
pikasurf wrote:
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.


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?


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.

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.


Top
 Profile  
 
PostPosted: Mon Sep 11, 2017 6:48 pm 
Offline

Joined: Fri Jun 19, 2015 2:48 pm
Posts: 5
lidnariq wrote:
pikasurf wrote:
i didnt know that they were bunched in 2 channels. can a mod be installed just to enable/disable those groupings, then?
Sure? If I understand you correctly?

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.


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 them

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group