From 508b321262d47c8ace631fcddaa114258ef5c52f Mon Sep 17 00:00:00 2001 From: bbbradsmith Date: Tue, 14 May 2024 23:46:06 -0400 Subject: [PATCH] probably should keep the stereo 16-bit render for convenience --- core/nsfplaycore.cpp | 13 ++++++++++++- include/nsfplaycore.h | 4 +++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/core/nsfplaycore.cpp b/core/nsfplaycore.cpp index 037f06b..1f71c71 100644 --- a/core/nsfplaycore.cpp +++ b/core/nsfplaycore.cpp @@ -292,7 +292,18 @@ uint64_t nsfplay_samples_played(const NSFCore* core) return 0; } -uint32_t nsfplay_render(NSFCore* core, uint32_t samples, int32_t* stereo_output) +uint32_t nsfplay_render32(NSFCore* core, uint32_t samples, int32_t* stereo_output) +{ + NSF_MUTEX_GUARD(); + if (!core) return 0; + NSF_UNUSED(core); + NSF_UNUSED(samples); + NSF_UNUSED(stereo_output); + // TODO + return 0; +} + +uint32_t nsfplay_render(NSFCore* core, uint32_t samples, int16_t* stereo_output) { NSF_MUTEX_GUARD(); if (!core) return 0; diff --git a/include/nsfplaycore.h b/include/nsfplaycore.h index 63baa24..930251b 100644 --- a/include/nsfplaycore.h +++ b/include/nsfplaycore.h @@ -249,7 +249,9 @@ uint64_t nsfplay_samples_played(const NSFCore* core); // samples since song_play // - stereo_output can be NULL if the output isn't needed // - returns number of samples rendered, may be less than samples if song is finished (will zero fill unused output samples) // - see shared/sound_convert.h for conversion examples to various formats -uint32_t nsfplay_render(NSFCore* core, uint32_t samples, int32_t* stereo_output); +uint32_t nsfplay_render32(NSFCore* core, uint32_t samples, int32_t* stereo_output); +// nsfplay_render32 with a conversion to the most common 16-bit stereo format for convenience +uint32_t nsfplay_render(NSFCore* core, uint32_t samples, int16_t* stereo_output); // manually trigger render buffer allocations if needed // call after the desired NSF is loaded and all settings have been made, but before the first render or emu_init/run