aboutsummaryrefslogtreecommitdiff
path: root/src/dbopl.cpp
diff options
context:
space:
mode:
authorWohlstand <admin@wohlnet.ru>2016-12-07 17:41:47 +0300
committerWohlstand <admin@wohlnet.ru>2016-12-07 17:41:47 +0300
commitbba6c868211b1e88180365a339b5bf59a6fb2637 (patch)
tree9c42362484f17e8be772f53e1e9b078c992706dd /src/dbopl.cpp
parentbd044bbb9d57f0b1a32c4e693dc14378b33e05ef (diff)
downloadlibADLMIDI-bba6c868211b1e88180365a339b5bf59a6fb2637.tar.gz
libADLMIDI-bba6c868211b1e88180365a339b5bf59a6fb2637.tar.bz2
libADLMIDI-bba6c868211b1e88180365a339b5bf59a6fb2637.zip
Little refactoring of adl_play() function to fix return size value
Diffstat (limited to 'src/dbopl.cpp')
-rw-r--r--src/dbopl.cpp11
1 files changed, 11 insertions, 0 deletions
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<Bitu>(*samples), out);
+ else
+ chip.GenerateBlock3(static_cast<Bitu>(*samples), out);
+ }
+
void Handler::Init(Bitu rate)
{
InitTables();