About MMC5's 2 square channels

Discuss NSF files, FamiTracker, MML tools, or anything else related to NES music.

Moderator: Moderators

User avatar
Ben Boldt
Posts: 754
Joined: Tue Mar 22, 2016 8:27 pm
Location: Minnesota, USA

Re: About MMC5's 2 square channels

Post by Ben Boldt » Thu Dec 24, 2020 4:13 pm

rainwarrior wrote:
Thu Dec 24, 2020 3:28 pm
Yes, the MMC5 resets phase with the register that writes the high bits of period. This is explicitly mentioned on the wiki.

No, there's no sweep workaround with no sweep unit available.
Why so rude rainwarrior. I am asking if anyone knows "for sure" that the MMC5 resets the phase. We can't rely on the wiki to be accurate. Someone may have done a really good job making that part of the wiki accurate, or someone like me might have slid it in there and nobody double-checked. I am asking how sure we are, which is a very legitimate thing to ask. Maybe MMC5 and MMC5A are different in this way; I doubt anyone checked that.

Of course it does not have a sweep unit, I said that myself. That doesn't mean there can't be a workaround. I really don't like it when I make a reasonable post and then you pipe back with such abrupt superiority-driven responses. It really rubs me the wrong way and that's too bad because you're really knowledgeable and I would like to be able to work with you. Unfortunately I have to avoid you because I know I will be bitten.

kuja killer
Posts: 112
Joined: Mon May 25, 2009 2:20 pm

Re: About MMC5's 2 square channels

Post by kuja killer » Thu Dec 24, 2020 5:29 pm

Hmm, i guess it's cause of those things about the reverse ..thing, and no sweep how things sound slightly different too huh ? I dont know what it is exactly cause im not knowledgeable whatsoever about music stuff, but i've heard my song sound a tiny bit different on the MMC5's squares, compared to the regular squares.

"not" referring to volume this time, but just those other facts about from the wiki page.

I even once tested out playing the same square 1/2 on both the regular and mmc5 at the same time just to see what happens. about when lidnariq said
"Means that if you play the same pitch at the same time, at the same volume, and the same duty %, on both an internal and external pulse channel, that it will mysteriously be very quiet instead."

There was defintely something just the tiniest bit different sounding about it, but i could also tell anyways just swappinng back and forth between only regular squares, or mmc5 squares.

User avatar
rainwarrior
Posts: 8006
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: About MMC5's 2 square channels

Post by rainwarrior » Thu Dec 24, 2020 6:01 pm

Ben Boldt wrote:
Thu Dec 24, 2020 4:13 pm
rainwarrior wrote:
Thu Dec 24, 2020 3:28 pm
Yes, the MMC5 resets phase with the register that writes the high bits of period. This is explicitly mentioned on the wiki.

No, there's no sweep workaround with no sweep unit available.
Why so rude rainwarrior. I am asking if anyone knows "for sure" that the MMC5 resets the phase. We can't rely on the wiki to be accurate. Someone may have done a really good job making that part of the wiki accurate, or someone like me might have slid it in there and nobody double-checked. I am asking how sure we are, which is a very legitimate thing to ask. Maybe MMC5 and MMC5A are different in this way; I doubt anyone checked that.

Of course it does not have a sweep unit, I said that myself. That doesn't mean there can't be a workaround. I really don't like it when I make a reasonable post and then you pipe back with such abrupt superiority-driven responses. It really rubs me the wrong way and that's too bad because you're really knowledgeable and I would like to be able to work with you. Unfortunately I have to avoid you because I know I will be bitten.
This is an entirely unexpected response. I confirmed exactly what you asked, and you wanna tear my head off for doing so. Not sure why you think I'm trying to assert superiority, or whatever this is about, but good grief. Please try to assume good faith here. If you think it's insulting to confirm the thing you asked for confirmation about, then I'm sorry, but I don't understand why I deserved this, at all.

I don't know anything about MMC5 vs MMC5A. If you have the hardware and you're interested, please go ahead and test it yourself. Normally I'd dig up a link to the actual test ROMs I used to do so before to offer you, but I'm a bit short of time and energy right now and your response hasn't helped this situation. I don't know if you'd consider being handed the actual test ROM insulting or posturing or something?

Maybe my confirmation was short, but it's only a function of how much time I have to spend on reading NESdev today, not about whatever you seem to think it was.

As for why I said it says so on the wiki, is that I personally worked to make sure that stuff was up to date with everything I learned about the audio stuff. If you want to know what I know, it's on there. At this point the wiki is a better source of this information than I am personally, because I my memory fades over time.

It's okay to be skeptical of the wiki, but if when you ask "can we trust the wiki about XXX", can I not just say "yes" without you reading something entirely unwarranted in it?

You weren't asking about something that is unknown or unclear, and you weren't offering some suspicious game or some hardware test you'd done that might cast any doubt on it. You just straight up asked if the thing it says is correct. The answer is yes, to the best of my knowledge. What did you want besides that?
Ben Boldt wrote:
Thu Dec 24, 2020 4:13 pm
Of course it does not have a sweep unit, I said that myself. That doesn't mean there can't be a workaround.
There's always a possibility of something undiscovered, but I don't know of another workaround, so I can't offer such a thing. You specifically asked about the sweep workaround, so I confirmed that it doesn't exist. Please help me understand how this deserved the reaction I got, because I really don't get it.

User avatar
rainwarrior
Posts: 8006
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: About MMC5's 2 square channels

Post by rainwarrior » Thu Dec 24, 2020 6:42 pm

I remembered where I put them, and I'm hoping I can offer them in good faith without being accused of some sort of superiority complex, but here's the thread where I posted those MMC5 findings specifically, the test ROMs used, and recordings made using them. (See swap_tests.zip)

http://forums.nesdev.com/viewtopic.php?p=90245#p90245

If you've got MMC5/MMC5A variants you want to try them on, please feel free.

Fiskbit
Posts: 259
Joined: Sat Nov 18, 2017 9:15 pm

Re: About MMC5's 2 square channels

Post by Fiskbit » Thu Dec 24, 2020 6:43 pm

Keep in mind that it's really hard for the correct tone to come across with just text, which makes misunderstandings easy, unfortunately. Ben probably found the message a bit terse rather than concise and interpreted that as being rude despite that not being your intent.

kuja killer
Posts: 112
Joined: Mon May 25, 2009 2:20 pm

Re: About MMC5's 2 square channels

Post by kuja killer » Thu Jan 28, 2021 9:53 pm

Hey there, i have a question again about something, i don't feel i should have to start a new thread for a tiny thing, so. I have these lines in the music engine, and they are only run 1 time per init thing. Basically only once, when a new sound effect or song is played.

Code: Select all

lda #$08
sta $4001
sta $4005
lda #$0F	;enable NES channels
sta $4015
lda #$03	;enable MMC5 squares
sta $5015
My question about this -- is it safe to move this to like say, the RESET vector since all they do is just enable the channels ?? So i can save some CPU cycles in general with sound effects playing all the time in levels with enemies/bosses/etc.

I'm not sure because i read on the nesdev wiki pages that writing to those registers "reset" certain things like length counters and so on, so i really don't know. It's very confusing to me. :(
I dont know if there would be any side effects for ignoring those specific registers on every sound effect loaded. :|

User avatar
rainwarrior
Posts: 8006
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: About MMC5's 2 square channels

Post by rainwarrior » Thu Jan 28, 2021 10:29 pm

Yes, if you don't need to control DPCM, you could just turn those on and leave them on forever.

Setting those bits in $4015 to 0 also causes the length counters to be set to 0, so if you re-enable them later you also have to reload the length counter to get the channel active again, it's not just an independent mute.

kuja killer
Posts: 112
Joined: Mon May 25, 2009 2:20 pm

Re: About MMC5's 2 square channels

Post by kuja killer » Thu Jan 28, 2021 10:38 pm

wow really ? okay cool. :) yea i dont ever use "dpcm" - the NES megaman games never had that anyway -- and this is the only single instance of these registers anywhere in the ROM or music engine. just those only.

edit: uhhh, there is only 1 single time i've ever used dpcm in my game so far, and that was for the Zelda 1 "doop open" sound effect. which i use for doors in some levels. it does a 1F to 4015 (copied zelda's code) i accidently forgot about that one, until you mentioned the dpcm

there like "forced events" so you dont have controller input during the open animation/sound effect. I've heard all about the whole "controller input can get corrupted by dpcm" i dont have to worry about that though. (like boss gates before the robot master fights)

so maybe i'll just leave the 4015 alone there, but i moved the others to reset now.
https://i.imgur.com/Izil02I.png

Post Reply