\r
PICO_INTERNAL void PsndReset(void)\r
{\r
- void *ym2612_regs;\r
-\r
- // also clear the internal registers+addr line\r
- ym2612_regs = YM2612GetRegs();\r
- memset(ym2612_regs, 0, 0x200+4);\r
- timers_reset();\r
-\r
+ // PsndRerate calls YM2612Init, which also resets\r
PsndRerate(0);\r
+ timers_reset();\r
}\r
\r
\r
cdda_raw_update(buf32, length);\r
}\r
\r
+ if ((PicoAHW & PAHW_32X) && (PicoOpt & POPT_EN_PWM))\r
+ p32x_pwm_update(buf32, length, stereo);\r
+\r
// convert + limit to normal 16bit output\r
PsndMix_32_to_16l(PsndOut+offset, buf32, length);\r
\r
#endif\r
}\r
\r
+PICO_INTERNAL void PsndGetSamplesMS(void)\r
+{\r
+ int stereo = (PicoOpt & 8) >> 3;\r
+ int length = PsndLen;\r
+\r
+#if !SIMPLE_WRITE_SOUND\r
+ // compensate for float part of PsndLen\r
+ PsndLen_exc_cnt += PsndLen_exc_add;\r
+ if (PsndLen_exc_cnt >= 0x10000) {\r
+ PsndLen_exc_cnt -= 0x10000;\r
+ length++;\r
+ }\r
+#endif\r
+\r
+ // PSG\r
+ if (PicoOpt & POPT_EN_PSG)\r
+ SN76496Update(PsndOut, length, stereo);\r
+\r
+ // upmix to "stereo" if needed\r
+ if (stereo) {\r
+ int i, *p;\r
+ for (i = length, p = (void *)PsndOut; i > 0; i--, p++)\r
+ *p |= *p << 16;\r
+ }\r
+\r
+ if (PicoWriteSound != NULL)\r
+ PicoWriteSound(length);\r
+ PsndClear();\r
+}\r
+\r