The repository can be found here:
https://github.com/michelgerritse/TritonCore
The last feature I need to implement is the channel mapping for the PWM sound channels (minus some SH2 DREQ and interrupt stuff which is not needed for a VGM player. Also the 3-step FIFO is missing for obvious reasons).
According to the official documentation, this is controlled by the PWM Control Register. The layout is as follows:
Code: Select all
| b15 | b14 | b13 | b12 | b11 | b10 | b09 | b08 | b07 | b06 | b05 | b04 | b03 | b02 | b01 | b00 |
+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
| --- | --- | --- | --- | TM3 | TM2 | TM1 | TM0 | RTP | --- | --- | --- | RMD0| RMD1| LMD0| LMD1|
| RMD0| RMD1| OUT | | LMD0| LMD1| OUT |
+-----+-----+-----+ +-----+-----+-----+
| 0 | 0 | OFF | | 0 | 0 | OFF |
| 0 | 1 | R | | 0 | 1 | L |
| 1 | 0 | L | | 1 | 0 | R |
| 1 | 1 | N/A | | 1 | 1 | N/A |
The obvious question is: what happens if you ignore the documentation and try anyway ? Will you get clipping / distortion when both PWM channels are mapped to L or R ? Will the device go silent ? Is only a single PWM channel audible (if so, which one) ?
Since I don't have the hardware anymore I'm not able to test, can anyone with the hardware confirm what the 32X does ?
Edit: I noticed some game (e.g Tempo and Knuckles' Chaotix) set both RMD and LMD to OFF. So my conclusion here is that if you disable both PWM channels, they will still output normally. I had already figured this out over 20 years ago in Xega :S