- Right now, I didn't any deep debugging or tracing to figure what's going on. Anyway, here's the scenery: register 4011 is being written, even if the game doesn't use RAW DMC. This way, the value written is being sent to the DAC, causing the wave to generate an high value, or a "pop" during the playback. If I don't send such write to the DAC, the output is perfect, but games that uses RAW DMC doesn't play, like Battletoads.
- What am I missing???
Shouldn't the value stick, and keep outputting the same DAC level? Then you'd get one pop, and nothing after that. What are you initializing the counter to?
Is your goal to emulate a NES, or eliminate pops even if the NES pops with that game? I know Disch did some of the latter in his NSF player.
Dwedit wrote:
Shouldn't the value stick, and keep outputting the same DAC level? Then you'd get one pop, and nothing after that. What are you initializing the counter to?
- It breaks RAW DMC.
- Well, if the NES does that, it's okay. The game is Ninja Gaiden 3.
Yeah, if the game is broken you shouldn't worry about breaking your emulator to correct it.
- Not that. I mean the RAW DMC output method clashes with the "normal" DMC. In other words, Ninja Gaiden 3 uses the "normal" DMC only - it writes to 4011 for an initial value. At same time, this value is sent to the DAC as RAW DMC, causing an high value, hence a pop.
- I didn't know the NES does such thing, so... it's ok then.
EDIT: I used the Dwedit suggestion and it worked nicely. Since I work with deltas (difference between previous and current samples), nothing is sent to the DAC if 4011 is uninitialized, or zero.