static Int32* y8950Sync(void* ref, UInt32 count) { Y8950* y8950 = (Y8950*)ref; UInt32 i; for (i = 0; i < count; i++) { #if SAMPLERATE > AUDIO_SAMPLERATE y8950->off -= SAMPLERATE - AUDIO_SAMPLERATE; y8950->s1 = y8950->s2; y8950->s2 = Y8950UpdateOne(y8950->opl); if (y8950->off < 0) { y8950->off += AUDIO_SAMPLERATE; y8950->s1 = y8950->s2; y8950->s2 = Y8950UpdateOne(y8950->opl); } y8950->buffer[i] = (y8950->s1 * (y8950->off / 256) + y8950->s2 * ((SAMPLERATE - y8950->off) / 256)) / (SAMPLERATE / 256); #else y8950->buffer[i] = Y8950UpdateOne(y8950->opl); #endif } return y8950->buffer; }
static void Y8950Render(INT32 nSegmentLength) { #if defined FBA_DEBUG if (!DebugSnd_Y8950Initted) bprintf(PRINT_ERROR, _T("Y8950Render called without init\n")); #endif if (nY8950Position >= nSegmentLength) { return; } // bprintf(PRINT_NORMAL, _T(" Y8950 render %6i -> %6i\n", nY8950Position, nSegmentLength)); nSegmentLength -= nY8950Position; Y8950UpdateOne(0, pBuffer + 0 * 4096 + 4 + nY8950Position, nSegmentLength); nY8950Position += nSegmentLength; }
static void y8950_stream_update(void *param, stream_sample_t **inputs, stream_sample_t **buffer, int length) { struct y8950_info *info = param; Y8950UpdateOne(info->chip, buffer[0], length); }