Reply 40 of 61, by superfury
I just took a little crack at trying to implement the PDM replacement for PWM. The output doesn't seem to match though(it might still have some basic signal processing problem).
byte WAVEFORM_OUTPUT[16][16] = { //PDM Waveforms for a selected output!
#ifndef PDM_OUTPUT
//PWM output?
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, //Volume 0
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, //Volume 1
{1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, //Volume 2
{1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0}, //Volume 3
{1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0}, //Volume 4
{1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0}, //Volume 5
{1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0}, //Volume 6
{1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0}, //Volume 7
{1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0}, //Volume 8
{1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0}, //Volume 9
{1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0}, //Volume A
{1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0}, //Volume B
{1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0}, //Volume C
{1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0}, //Volume D
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0}, //Volume E
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0} //Volume F
#else
//PDM output?
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, //Volume 0 Same as PWM
{0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0}, //Volume 1 TODO(+2)
{0,0,0,0,1,0,0,0,0,0,0,0,1,1,0,0}, //Volume 2 TODO(+3)
{0,0,0,0,1,1,0,0,0,0,0,0,1,1,1,0}, //Volume 3 TODO(+5)
{0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,0}, //Volume 4 TODO(+6)
{0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1}, //Volume 5 TODO(+7)
{0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1}, //Volume 6 TODO(+8)
{1,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1}, //Volume 7 1H 3L 4H 4L 4H confirmed(+9)
{1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0}, //Volume 8 4H 4L 4H 4L confirmed(+8)
{1,1,1,1,0,1,0,0,1,1,1,1,0,0,0,0}, //Volume 9 4H 4L 4H 4L(+9)
{1,1,1,1,0,1,0,0,1,1,1,1,0,1,0,0}, //Volume A TODO(+10)
{1,1,1,1,0,1,1,0,1,1,1,1,0,1,0,0}, //Volume B TODO(+11)
{1,1,1,1,0,1,1,0,1,1,1,1,0,1,1,0}, //Volume C TODO(+12)
{1,1,1,1,0,1,1,0,1,1,1,1,0,1,1,1}, //Volume D TODO(+13)
{1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1}, //Volume E TODO(+15)
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0} //Volume F Same as PWM
#endif
};
Have I done this correctly? Volume 8&7 are taken directly from your comments. The others I've tried to average roughly myself(I hope I did it correcly, trying to keep in mind to make the ones count a bit more than the zeroes)). Is this somewhat in the right direction?
Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io