From bba6c868211b1e88180365a339b5bf59a6fb2637 Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Wed, 7 Dec 2016 17:41:47 +0300 Subject: Little refactoring of adl_play() function to fix return size value --- src/dbopl.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/dbopl.cpp') diff --git a/src/dbopl.cpp b/src/dbopl.cpp index e21fde0..40b2220 100644 --- a/src/dbopl.cpp +++ b/src/dbopl.cpp @@ -1927,6 +1927,17 @@ namespace DBOPL chip.GenerateBlock3(*samples, out); } + void Handler::GenerateArr(Bit32s *out, ssize_t *samples) + { + if(GCC_UNLIKELY(*samples > 512)) + *samples = 512; + + if(!chip.opl3Active) + chip.GenerateBlock2(static_cast(*samples), out); + else + chip.GenerateBlock3(static_cast(*samples), out); + } + void Handler::Init(Bitu rate) { InitTables(); -- cgit v1.2.3