APU mixer output?

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
User avatar
Zepper
Formerly Fx3
Posts: 3262
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

APU mixer output?

Post by Zepper »

Example: the 16-bit output of the square wave (with volume $0F) would be $0F00 (unsigned).
Now, using the formula from the wiki, what's the 16-bit output value? If both square waves produces volume $0F, the mixer returns a value of 0.25.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: APU mixer output?

Post by tepples »

The wiki page states that the output range is from 0.0 to 1.0. You could scale this to +0 to +32000, leaving enough headroom for a first-order high-pass to block DC. Keep in mind, however, that some now-obscure audio APIs expect unsigned audio in the range 0 to 65535 instead of the more common signed audio in the range -32768 to 32767. In this case, you could scale from 0.0 to 1.0 out of the formula to 32768 to 64768.
User avatar
Zepper
Formerly Fx3
Posts: 3262
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Re: APU mixer output?

Post by Zepper »

I still use Allegro, and yes, it requires unsigned samples.
Thank you.
Post Reply