From c3e2e902af887020815c6f8f3e336c7a18172be3 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 16 Oct 2022 21:35:25 -0500 Subject: [PATCH] prepare for possible DualPCM and MSM6258 VGM xprt --- src/engine/dispatch.h | 13 +++++++++++++ src/engine/platform/abstract.cpp | 3 +++ 2 files changed, 16 insertions(+) diff --git a/src/engine/dispatch.h b/src/engine/dispatch.h index 9484054b1..6963dfb87 100644 --- a/src/engine/dispatch.h +++ b/src/engine/dispatch.h @@ -261,6 +261,11 @@ struct DivRegWrite { addr(a), val(v) {} }; +struct DivDelayedWrite { + int time; + DivRegWrite write; +}; + struct DivDispatchOscBuffer { bool follow; unsigned int rate; @@ -313,6 +318,14 @@ class DivDispatch { */ virtual void acquire(short* bufL, short* bufR, size_t start, size_t len); + /** + * fill a write stream with data (e.g. for software-mixed PCM). + * @param stream the write stream. + * @param rate stream rate (e.g. 44100 for VGM). + * @param len number of samples. + */ + virtual void fillStream(std::vector& stream, int rate, size_t len); + /** * send a command to this dispatch. * @param c a DivCommand. diff --git a/src/engine/platform/abstract.cpp b/src/engine/platform/abstract.cpp index 746e8e80f..cdff34f3a 100644 --- a/src/engine/platform/abstract.cpp +++ b/src/engine/platform/abstract.cpp @@ -22,6 +22,9 @@ void DivDispatch::acquire(short* bufL, short* bufR, size_t start, size_t len) { } +void DivDispatch::fillStream(std::vector& stream, int rate, size_t len) { +} + void DivDispatch::tick(bool sysTick) { }