src/emu/sound/sn76496.c
| r6377 | r6378 | |
| 47 | 47 | |
| 48 | 48 | 14/11/2009 : Lord Nightmare |
| 49 | 49 | Removed STEP mess, vastly simplifying the code. Made output bipolar rather |
| 50 | | than always above the 0 line. |
| 50 | than always above the 0 line, but disabled that code due to pending issues. |
| 51 | 51 | |
| 52 | 52 | TODO: * Implement a function for setting stereo regs for the game gear. |
| 53 | 53 | Requires making the core support both mono and stereo, and have |
| r6377 | r6378 | |
| 69 | 69 | #include "sn76496.h" |
| 70 | 70 | |
| 71 | 71 | |
| 72 | | #define MAX_OUTPUT 0x3fff |
| 72 | #define MAX_OUTPUT 0x7fff |
| 73 | // make the above 0x3fff if using bipolar output |
| 73 | 74 | #define NOISEMODE (R->Register[6]&4)?1:0 |
| 74 | 75 | |
| 75 | 76 | |
| r6377 | r6378 | |
| 241 | 242 | R->OldNoise = R->RNG & 1; |
| 242 | 243 | R->Count[3] = R->Period[3]; |
| 243 | 244 | } |
| 244 | | |
| 245 | /* //bipolar output, doesn't seem to work right with sonic 2 on gamegear at least |
| 245 | 246 | out = (R->Output[0]?R->Volume[0]:(0-R->Volume[0])) |
| 246 | 247 | +(R->Output[1]?R->Volume[1]:(0-R->Volume[1])) |
| 247 | 248 | +(R->Output[2]?R->Volume[2]:(0-R->Volume[2])) |
| 248 | 249 | +(R->Output[3]?R->Volume[3]:(0-R->Volume[3])); |
| 250 | */ |
| 251 | out = (R->Output[0]?R->Volume[0]:0) |
| 252 | +(R->Output[1]?R->Volume[1]:0) |
| 253 | +(R->Output[2]?R->Volume[2]:0) |
| 254 | +(R->Output[3]?R->Volume[3]:0); |
| 249 | 255 | |
| 250 | 256 | *(buffer++) = out; |
| 251 | 257 | |