From b48b7c8bc5979b140d4e4e713653c9e6f9d5446b Mon Sep 17 00:00:00 2001 From: cam900 Date: Sun, 24 Jul 2022 12:23:38 +0900 Subject: [PATCH 1/2] Apply loop end position for generic DAC --- src/engine/platform/pcmdac.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/engine/platform/pcmdac.cpp b/src/engine/platform/pcmdac.cpp index 314ba7dd1..213cb85a3 100644 --- a/src/engine/platform/pcmdac.cpp +++ b/src/engine/platform/pcmdac.cpp @@ -50,12 +50,10 @@ void DivPlatformPCMDAC::acquire(short* bufL, short* bufR, size_t start, size_t l } else { DivSample* s=parent->getSample(chan.sample); if (s->samples>0) { - if (chan.audPos>=s->samples) { - if (s->loopStart>=0 && s->loopStart<(int)s->samples) { - chan.audPos=s->loopStart; - } else { - chan.sample=-1; - } + if (s->isLoopable() && chan.audPos>=s->getEndPosition()) { + chan.audPos=s->loopStart; + } else if (chan.audPos>=s->samples) { + chan.sample=-1; } if (chan.audPossamples) { output=s->data16[chan.audPos]; From 6697be4d9555fbef2433a6eb3d8cadc6cf1916d1 Mon Sep 17 00:00:00 2001 From: cam900 Date: Sun, 24 Jul 2022 13:28:26 +0900 Subject: [PATCH 2/2] Add/Update more presets Williams/Midway ADPCM Sound board Used for conjunction with their Y/T unit, it has ordinary de facto standard OPM+MSM6295 on this era with software controlled DAC from predecessors. Konami Battlantis Used at Battlantis arcade hardware, It is early SB Pro but mono configuration. Sega System 24 This Sega's early arcade system featured to floppy disk and high resolution graphics. Sound hardware is similar as their System 16, but ADPCM is replaced to software controlled DAC. Namco System 86 Predecessor of System 1(a.k.a. System 87), It features similar sound hardware and optional ROM and DAC expansion. Namco Thunder Ceptor Used at Thunder Ceptor, their Front view arcade machine. Namco system 86 and System 1 sound system is directly derived from this machine's sound system. Irem M72 Irem's first arcade system with FM sound system, All released game except R-Type is featured also LOUD software controlled DAC, inherited from their predecessors sound system. --- src/gui/presets.cpp | 76 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 72 insertions(+), 4 deletions(-) diff --git a/src/gui/presets.cpp b/src/gui/presets.cpp index 3774f232c..ef2236223 100644 --- a/src/gui/presets.cpp +++ b/src/gui/presets.cpp @@ -1241,6 +1241,15 @@ void FurnaceGUI::initSystemPresets() { 0 } )); + cat.systems.push_back(FurnaceGUISysDef( + "Williams/Midway Y/T unit w/ADPCM sound board", { + // ADPCM sound board + DIV_SYSTEM_YM2151, 64, 0, 0, + DIV_SYSTEM_PCM_DAC, 64, 0, 15624|(7<<16), // variable via OPM timer? + DIV_SYSTEM_MSM6295, 64, 0, 0, + 0 + } + )); cat.systems.push_back(FurnaceGUISysDef( "Konami Gyruss", { DIV_SYSTEM_AY8910, 64, 0, 0, @@ -1261,6 +1270,34 @@ void FurnaceGUI::initSystemPresets() { 0 } )); + cat.systems.push_back(FurnaceGUISysDef( + "Konami Battlantis", { + DIV_SYSTEM_OPL2, 64, 0, 3, // 3MHz + DIV_SYSTEM_OPL2, 64, 0, 3, // "" + 0 + } + )); + cat.systems.push_back(FurnaceGUISysDef( + "Konami Battlantis (drums mode on first OPL2)", { + DIV_SYSTEM_OPL2_DRUMS, 64, 0, 3, // 3MHz + DIV_SYSTEM_OPL2, 64, 0, 3, // "" + 0 + } + )); + cat.systems.push_back(FurnaceGUISysDef( + "Konami Battlantis (drums mode on second OPL2)", { + DIV_SYSTEM_OPL2, 64, 0, 3, // 3MHz + DIV_SYSTEM_OPL2_DRUMS, 64, 0, 3, // "" + 0 + } + )); + cat.systems.push_back(FurnaceGUISysDef( + "Konami Battlantis (drums mode on both OPL2s)", { + DIV_SYSTEM_OPL2_DRUMS, 64, 0, 3, // 3MHz + DIV_SYSTEM_OPL2_DRUMS, 64, 0, 3, // "" + 0 + } + )); cat.systems.push_back(FurnaceGUISysDef( "Konami Hexion", { DIV_SYSTEM_SCC, 64, 0, 2, // 1.5MHz (3MHz input) @@ -1326,6 +1363,13 @@ void FurnaceGUI::initSystemPresets() { 0 } )); + cat.systems.push_back(FurnaceGUISysDef( + "Sega System 24", { + DIV_SYSTEM_YM2151, 64, 0, 2, // 4MHz + DIV_SYSTEM_PCM_DAC, 64, 0, 61499|(7<<16), // software controlled, variable rate via configurable timers + 0 + } + )); cat.systems.push_back(FurnaceGUISysDef( "Sega System 18", { DIV_SYSTEM_YM2612, 64, 0, 2, // discrete 8MHz YM3438 @@ -1863,7 +1907,7 @@ void FurnaceGUI::initSystemPresets() { "Alpha denshi Alpha-68K", { DIV_SYSTEM_OPN, 64, 0, 3, // 3MHz DIV_SYSTEM_OPLL, 64, 0, 0, // 3.58MHz - // software controlled 8 bit DAC + DIV_SYSTEM_PCM_DAC, 64, 0, 7613|(7<<16), // software controlled 8 bit DAC 0 } )); @@ -1871,7 +1915,7 @@ void FurnaceGUI::initSystemPresets() { "Alpha denshi Alpha-68K (extended channel 3)", { DIV_SYSTEM_OPN_EXT, 64, 0, 3, // 3MHz DIV_SYSTEM_OPLL, 64, 0, 0, // 3.58MHz - // software controlled 8 bit DAC + DIV_SYSTEM_PCM_DAC, 64, 0, 7613|(7<<16), // software controlled 8 bit DAC 0 } )); @@ -1879,7 +1923,7 @@ void FurnaceGUI::initSystemPresets() { "Alpha denshi Alpha-68K (drums mode)", { DIV_SYSTEM_OPN, 64, 0, 3, // 3MHz DIV_SYSTEM_OPLL_DRUMS, 64, 0, 0, // 3.58MHz - // software controlled 8 bit DAC + DIV_SYSTEM_PCM_DAC, 64, 0, 7613|(7<<16), // software controlled 8 bit DAC 0 } )); @@ -1887,7 +1931,7 @@ void FurnaceGUI::initSystemPresets() { "Alpha denshi Alpha-68K (extended channel 3; drums mode)", { DIV_SYSTEM_OPN_EXT, 64, 0, 3, // 3MHz DIV_SYSTEM_OPLL_DRUMS, 64, 0, 0, // 3.58MHz - // software controlled 8 bit DAC + DIV_SYSTEM_PCM_DAC, 64, 0, 7613|(7<<16), // software controlled 8 bit DAC 0 } )); @@ -1929,10 +1973,27 @@ void FurnaceGUI::initSystemPresets() { 0 } )); + cat.systems.push_back(FurnaceGUISysDef( + "Namco System 86", { // without expansion board case; Hopping Mappy, etc + DIV_SYSTEM_YM2151, 64, 0, 0, + DIV_SYSTEM_NAMCO_CUS30, 64, 0, 0 + 0 + } + )); + cat.systems.push_back(FurnaceGUISysDef( + "Namco Thunder Ceptor", { + DIV_SYSTEM_YM2151, 64, 0, 0, + DIV_SYSTEM_NAMCO_CUS30, 64, 0, 0, + DIV_SYSTEM_PCM_DAC, 64, 0, 7999|(7<<16), // M65C02 software driven, correct sample rate? + 0 + } + )); cat.systems.push_back(FurnaceGUISysDef( "Namco System 1", { DIV_SYSTEM_YM2151, 64, 0, 0, DIV_SYSTEM_NAMCO_CUS30, 64, 0, 0, + DIV_SYSTEM_PCM_DAC, 64, 0, 5999|(7<<16), // sample rate verified from https://github.com/mamedev/mame/blob/master/src/devices/sound/n63701x.cpp + DIV_SYSTEM_PCM_DAC, 64, 0, 5999|(7<<16), // "" 0 } )); @@ -2045,6 +2106,13 @@ void FurnaceGUI::initSystemPresets() { 0 } )); + cat.systems.push_back(FurnaceGUISysDef( + "Irem M72", { + DIV_SYSTEM_YM2151, 64, 0, 0, + DIV_SYSTEM_PCM_DAC, 64, 0, 7811|(7<<16), + 0 + } + )); sysCategories.push_back(cat); cat=FurnaceGUISysCategory("DefleMask-compatible","these configurations are compatible with DefleMask.\nselect this if you need to save as .dmf or work with that program.");