From 234c5e9295f95697ec3bb012f998bff17a782bca Mon Sep 17 00:00:00 2001 From: cam900 Date: Thu, 17 Mar 2022 10:11:48 +0900 Subject: [PATCH] Reduce naming confusion in Bubble System Wavetable Sound It means Custom wavetable sound generator logic on Bubble System. It's wavetable select and volume is controlled by single AY-3-8910 IO for both channels, Another AY-3-8910 IO is used for reading sound status. Schematics: http://pdf.textfiles.com/manuals/ARCADE/K-R/Nemesis%20[Schematics]%20[English].pdf (Nemesis, derivative of Bubble system) --- CMakeLists.txt | 2 +- papers/doc/4-instrument/README.md | 2 +- papers/doc/4-instrument/scc.md | 4 +- papers/doc/7-systems/README.md | 2 +- papers/doc/7-systems/bubblesystem.md | 6 +- papers/format.md | 2 +- src/engine/dispatchContainer.cpp | 6 +- .../platform/{k005289.cpp => bubsyswsg.cpp} | 56 +++++++++---------- .../platform/{k005289.h => bubsyswsg.h} | 4 +- src/engine/playback.cpp | 2 +- src/engine/song.h | 2 +- src/engine/sysDef.cpp | 26 ++++----- src/gui/gui.cpp | 8 +-- src/gui/guiConst.cpp | 2 +- 14 files changed, 63 insertions(+), 61 deletions(-) rename src/engine/platform/{k005289.cpp => bubsyswsg.cpp} (84%) rename src/engine/platform/{k005289.h => bubsyswsg.h} (97%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 914a1fe0..dd63fec2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -318,7 +318,7 @@ src/engine/platform/x1_010.cpp src/engine/platform/lynx.cpp src/engine/platform/swan.cpp src/engine/platform/vera.cpp -src/engine/platform/k005289.cpp +src/engine/platform/bubsyswsg.cpp src/engine/platform/dummy.cpp ) diff --git a/papers/doc/4-instrument/README.md b/papers/doc/4-instrument/README.md index 577e18eb..ab03e836 100644 --- a/papers/doc/4-instrument/README.md +++ b/papers/doc/4-instrument/README.md @@ -26,7 +26,7 @@ depending on the instrument type, there are currently 13 different types of an i - [Atari Lynx](lynx.md) - for use with Atari Lynx handheld console. - [VERA](vera.md) - for use with Commander X16 VERA. - [Seta/Allumer X1-010](x1_010.md) - for use with Wavetable portion in Seta/Allumer X1-010. -- [Konami SCC/Bubble System](scc.md) - for use with Konami SCC and Wavetable portion in Bubble System's sound hardware. +- [Konami SCC/Bubble System WSG](scc.md) - for use with Konami SCC and Wavetable portion in Bubble System's sound hardware. # macros diff --git a/papers/doc/4-instrument/scc.md b/papers/doc/4-instrument/scc.md index 86e8c11b..2650e0a3 100644 --- a/papers/doc/4-instrument/scc.md +++ b/papers/doc/4-instrument/scc.md @@ -1,6 +1,6 @@ -# Konami SCC/Bubble System instrument editor +# Konami SCC/Bubble System WSG instrument editor -SCC/Bubble System instrument editor consists of only three macros: +SCC/Bubble System WSG instrument editor consists of only three macros: - [Volume] - volume sequence - [Arpeggio] - pitch sequence diff --git a/papers/doc/7-systems/README.md b/papers/doc/7-systems/README.md index 405d0563..5413b0b5 100644 --- a/papers/doc/7-systems/README.md +++ b/papers/doc/7-systems/README.md @@ -20,6 +20,6 @@ this is a list of systems that Furnace supports, including each system's effects - [Microchip AY8930](ay8930.md) - [Seta/Allumer X1-010](x1_010.md) - [WonderSwan](wonderswan.md) -- [Bubble System/K005289](bubblesystem.md) +- [Bubble System WSG](bubblesystem.md) Furnace also reads .dmf files with the [Yamaha YMU759](ymu759.md) system, but does not emulate the chip at all. diff --git a/papers/doc/7-systems/bubblesystem.md b/papers/doc/7-systems/bubblesystem.md index 1dc18cab..835fd622 100644 --- a/papers/doc/7-systems/bubblesystem.md +++ b/papers/doc/7-systems/bubblesystem.md @@ -1,10 +1,12 @@ -# Bubble System/K005289 +# Bubble System WSG a Konami's 2 channel wavetable sound generator logic used at their arcade hardware Bubble System. It's configured with K005289, 4 bit PROM and DAC. -Also known as K005289, but that's just part of the logic used for pitch and wavetable ROM address. Waveform select and Volume control are tied with AY-3-8910 port. +Also known as K005289, but that's just part of the logic used for pitch and wavetable ROM address. +Waveform select and Volume control are tied with single AY-3-8910 IO for both channels. +Another AY-3-8910 IO is used for reading sound hardware status. furnace emulates this configurations as single system, waveform format is 15 level and 32 width. diff --git a/papers/format.md b/papers/format.md index 9afa4b47..c7b55085 100644 --- a/papers/format.md +++ b/papers/format.md @@ -177,7 +177,7 @@ size | description | - 0xaa: MSM6295 - 4 channels | - 0xab: MSM6258 - 1 channel | - 0xac: Commander X16 (VERA) - 17 channels - | - 0xad: Bubble System - 2 channels + | - 0xad: Bubble System WSG - 2 channels | - 0xb0: Seta/Allumer X1-010 - 16 channels | - 0xde: YM2610B extended - 19 channels | - 0xe0: QSound - 19 channels diff --git a/src/engine/dispatchContainer.cpp b/src/engine/dispatchContainer.cpp index 62daaafe..f80ed13b 100644 --- a/src/engine/dispatchContainer.cpp +++ b/src/engine/dispatchContainer.cpp @@ -45,7 +45,7 @@ #include "platform/x1_010.h" #include "platform/swan.h" #include "platform/lynx.h" -#include "platform/k005289.h" +#include "platform/bubsyswsg.h" #include "platform/dummy.h" #include "../ta-log.h" #include "song.h" @@ -272,8 +272,8 @@ void DivDispatchContainer::init(DivSystem sys, DivEngine* eng, int chanCount, do case DIV_SYSTEM_VERA: dispatch=new DivPlatformVERA; break; - case DIV_SYSTEM_K005289: - dispatch=new DivPlatformK005289; + case DIV_SYSTEM_BUBSYS_WSG: + dispatch=new DivPlatformBubSysWSG; break; default: logW("this system is not supported yet! using dummy platform.\n"); diff --git a/src/engine/platform/k005289.cpp b/src/engine/platform/bubsyswsg.cpp similarity index 84% rename from src/engine/platform/k005289.cpp rename to src/engine/platform/bubsyswsg.cpp index b50a76af..450f4530 100644 --- a/src/engine/platform/k005289.cpp +++ b/src/engine/platform/bubsyswsg.cpp @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "k005289.h" +#include "bubsyswsg.h" #include "../engine.h" #include @@ -25,8 +25,8 @@ #define rWrite(a,v) {if(!skipRegisterWrites) {regPool[a]=v; if(dumpWrites) addWrite(a,v); }} -const char* regCheatSheetK005289[]={ - // K005289 +const char* regCheatSheetBubSysWSG[]={ + // K005289 timer "Freq_A", "0", "Freq_B", "1", // PROM, DAC control from External logic (Connected to AY PSG ports on Bubble System) @@ -35,11 +35,11 @@ const char* regCheatSheetK005289[]={ NULL }; -const char** DivPlatformK005289::getRegisterSheet() { - return regCheatSheetK005289; +const char** DivPlatformBubSysWSG::getRegisterSheet() { + return regCheatSheetBubSysWSG; } -const char* DivPlatformK005289::getEffectName(unsigned char effect) { +const char* DivPlatformBubSysWSG::getEffectName(unsigned char effect) { switch (effect) { case 0x10: return "10xx: Change waveform"; @@ -48,7 +48,7 @@ const char* DivPlatformK005289::getEffectName(unsigned char effect) { return NULL; } -void DivPlatformK005289::acquire(short* bufL, short* bufR, size_t start, size_t len) { +void DivPlatformBubSysWSG::acquire(short* bufL, short* bufR, size_t start, size_t len) { for (size_t h=start; hgetWave(chan[ch].wave); for (int i=0; i<32; i++) { if (wt->max>0 && wt->len>0) { @@ -84,7 +84,7 @@ void DivPlatformK005289::updateWave(int ch) { } } -void DivPlatformK005289::tick() { +void DivPlatformBubSysWSG::tick() { for (int i=0; i<2; i++) { chan[i].std.next(); if (chan[i].std.hadVol) { @@ -139,7 +139,7 @@ void DivPlatformK005289::tick() { } } -int DivPlatformK005289::dispatch(DivCommand c) { +int DivPlatformBubSysWSG::dispatch(DivCommand c) { switch (c.cmd) { case DIV_CMD_NOTE_ON: { DivInstrument* ins=parent->getIns(chan[c.chan].ins); @@ -238,12 +238,12 @@ int DivPlatformK005289::dispatch(DivCommand c) { return 1; } -void DivPlatformK005289::muteChannel(int ch, bool mute) { +void DivPlatformBubSysWSG::muteChannel(int ch, bool mute) { isMuted[ch]=mute; rWrite(2+ch,(chan[ch].wave<<5)|((chan[ch].active && isMuted[ch])?0:chan[ch].outVol)); } -void DivPlatformK005289::forceIns() { +void DivPlatformBubSysWSG::forceIns() { for (int i=0; i<2; i++) { chan[i].insChanged=true; chan[i].freqChanged=true; @@ -251,26 +251,26 @@ void DivPlatformK005289::forceIns() { } } -void* DivPlatformK005289::getChanState(int ch) { +void* DivPlatformBubSysWSG::getChanState(int ch) { return &chan[ch]; } -unsigned char* DivPlatformK005289::getRegisterPool() { +unsigned char* DivPlatformBubSysWSG::getRegisterPool() { return (unsigned char*)regPool; } -int DivPlatformK005289::getRegisterPoolSize() { +int DivPlatformBubSysWSG::getRegisterPoolSize() { return 4; } -int DivPlatformK005289::getRegisterPoolDepth() { +int DivPlatformBubSysWSG::getRegisterPoolDepth() { return 16; } -void DivPlatformK005289::reset() { +void DivPlatformBubSysWSG::reset() { memset(regPool,0,4*2); for (int i=0; i<2; i++) { - chan[i]=DivPlatformK005289::Channel(); + chan[i]=DivPlatformBubSysWSG::Channel(); } if (dumpWrites) { addWrite(0xffffffff,0); @@ -278,15 +278,15 @@ void DivPlatformK005289::reset() { k005289->reset(); } -bool DivPlatformK005289::isStereo() { +bool DivPlatformBubSysWSG::isStereo() { return false; } -bool DivPlatformK005289::keyOffAffectsArp(int ch) { +bool DivPlatformBubSysWSG::keyOffAffectsArp(int ch) { return true; } -void DivPlatformK005289::notifyWaveChange(int wave) { +void DivPlatformBubSysWSG::notifyWaveChange(int wave) { for (int i=0; i<2; i++) { if (chan[i].wave==wave) { updateWave(i); @@ -294,26 +294,26 @@ void DivPlatformK005289::notifyWaveChange(int wave) { } } -void DivPlatformK005289::notifyInsDeletion(void* ins) { +void DivPlatformBubSysWSG::notifyInsDeletion(void* ins) { for (int i=0; i<2; i++) { chan[i].std.notifyInsDeletion((DivInstrument*)ins); } } -void DivPlatformK005289::setFlags(unsigned int flags) { +void DivPlatformBubSysWSG::setFlags(unsigned int flags) { chipClock=COLOR_NTSC; rate=chipClock; } -void DivPlatformK005289::poke(unsigned int addr, unsigned short val) { +void DivPlatformBubSysWSG::poke(unsigned int addr, unsigned short val) { rWrite(addr,val); } -void DivPlatformK005289::poke(std::vector& wlist) { +void DivPlatformBubSysWSG::poke(std::vector& wlist) { for (DivRegWrite& i: wlist) rWrite(i.addr,i.val); } -int DivPlatformK005289::init(DivEngine* p, int channels, int sugRate, unsigned int flags) { +int DivPlatformBubSysWSG::init(DivEngine* p, int channels, int sugRate, unsigned int flags) { parent=p; dumpWrites=false; skipRegisterWrites=false; @@ -326,9 +326,9 @@ int DivPlatformK005289::init(DivEngine* p, int channels, int sugRate, unsigned i return 2; } -void DivPlatformK005289::quit() { +void DivPlatformBubSysWSG::quit() { delete k005289; } -DivPlatformK005289::~DivPlatformK005289() { +DivPlatformBubSysWSG::~DivPlatformBubSysWSG() { } diff --git a/src/engine/platform/k005289.h b/src/engine/platform/bubsyswsg.h similarity index 97% rename from src/engine/platform/k005289.h rename to src/engine/platform/bubsyswsg.h index d8818fe4..5fda0fd9 100644 --- a/src/engine/platform/k005289.h +++ b/src/engine/platform/bubsyswsg.h @@ -25,7 +25,7 @@ #include "../macroInt.h" #include "sound/k005289/k005289.hpp" -class DivPlatformK005289: public DivDispatch { +class DivPlatformBubSysWSG: public DivDispatch { struct Channel { int freq, baseFreq, pitch, note; unsigned char ins; @@ -78,7 +78,7 @@ class DivPlatformK005289: public DivDispatch { const char* getEffectName(unsigned char effect); int init(DivEngine* parent, int channels, int sugRate, unsigned int flags); void quit(); - ~DivPlatformK005289(); + ~DivPlatformBubSysWSG(); }; #endif diff --git a/src/engine/playback.cpp b/src/engine/playback.cpp index 965f2853..e2fad160 100644 --- a/src/engine/playback.cpp +++ b/src/engine/playback.cpp @@ -313,7 +313,7 @@ bool DivEngine::perSystemEffect(int ch, unsigned char effect, unsigned char effe return false; } break; - case DIV_SYSTEM_K005289: + case DIV_SYSTEM_BUBSYS_WSG: switch (effect) { case 0x10: // select waveform dispatchCmd(DivCommand(DIV_CMD_WAVE,ch,effectVal)); diff --git a/src/engine/song.h b/src/engine/song.h index 6799909d..c271033e 100644 --- a/src/engine/song.h +++ b/src/engine/song.h @@ -94,7 +94,7 @@ enum DivSystem { DIV_SYSTEM_YM2610B_EXT, DIV_SYSTEM_SEGAPCM_COMPAT, DIV_SYSTEM_X1_010, - DIV_SYSTEM_K005289 + DIV_SYSTEM_BUBSYS_WSG }; struct DivSong { diff --git a/src/engine/sysDef.cpp b/src/engine/sysDef.cpp index d4aaa353..95e1a7b0 100644 --- a/src/engine/sysDef.cpp +++ b/src/engine/sysDef.cpp @@ -138,7 +138,7 @@ DivSystem DivEngine::systemFromFile(unsigned char val) { case 0xac: return DIV_SYSTEM_VERA; case 0xad: - return DIV_SYSTEM_K005289; + return DIV_SYSTEM_BUBSYS_WSG; case 0xb0: return DIV_SYSTEM_X1_010; case 0xde: @@ -266,7 +266,7 @@ unsigned char DivEngine::systemToFile(DivSystem val) { return 0xa9; case DIV_SYSTEM_VERA: return 0xac; - case DIV_SYSTEM_K005289: + case DIV_SYSTEM_BUBSYS_WSG: return 0xad; case DIV_SYSTEM_X1_010: return 0xb0; @@ -398,7 +398,7 @@ int DivEngine::getChannelCount(DivSystem sys) { return 19; case DIV_SYSTEM_VERA: return 17; - case DIV_SYSTEM_K005289: + case DIV_SYSTEM_BUBSYS_WSG: return 2; } return 0; @@ -548,7 +548,7 @@ const char* DivEngine::getSongSystemName() { } break; case 3: - if (song.system[0]==DIV_SYSTEM_AY8910 && song.system[1]==DIV_SYSTEM_AY8910 && song.system[2]==DIV_SYSTEM_K005289) { + if (song.system[0]==DIV_SYSTEM_AY8910 && song.system[1]==DIV_SYSTEM_AY8910 && song.system[2]==DIV_SYSTEM_BUBSYS_WSG) { return "Konami Bubble System"; } break; @@ -681,8 +681,8 @@ const char* DivEngine::getSystemName(DivSystem sys) { return "VERA"; case DIV_SYSTEM_X1_010: return "Seta/Allumer X1-010"; - case DIV_SYSTEM_K005289: - return "Konami Bubble System Sound"; + case DIV_SYSTEM_BUBSYS_WSG: + return "Konami Bubble System WSG"; } return "Unknown"; } @@ -812,8 +812,8 @@ const char* DivEngine::getSystemChips(DivSystem sys) { return "VERA"; case DIV_SYSTEM_X1_010: return "Seta/Allumer X1-010"; - case DIV_SYSTEM_K005289: - return "Konami K005289"; + case DIV_SYSTEM_BUBSYS_WSG: + return "Konami Bubble System WSG"; } return "Unknown"; } @@ -1071,7 +1071,7 @@ const DivInstrumentType chanPrefType[47][28]={ {DIV_INS_FM, DIV_INS_FM, DIV_INS_FM, DIV_INS_FM, DIV_INS_FM, DIV_INS_FM, DIV_INS_FM, DIV_INS_FM, DIV_INS_FM, DIV_INS_AY, DIV_INS_AY, DIV_INS_AY, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA}, // YM2610B (extended channel 3) {DIV_INS_VERA, DIV_INS_VERA, DIV_INS_VERA, DIV_INS_VERA, DIV_INS_VERA, DIV_INS_VERA, DIV_INS_VERA, DIV_INS_VERA, DIV_INS_VERA, DIV_INS_VERA, DIV_INS_VERA, DIV_INS_VERA, DIV_INS_VERA, DIV_INS_VERA, DIV_INS_VERA, DIV_INS_VERA, DIV_INS_AMIGA}, // VERA {DIV_INS_X1_010, DIV_INS_X1_010, DIV_INS_X1_010, DIV_INS_X1_010, DIV_INS_X1_010, DIV_INS_X1_010, DIV_INS_X1_010, DIV_INS_X1_010, DIV_INS_X1_010, DIV_INS_X1_010, DIV_INS_X1_010, DIV_INS_X1_010, DIV_INS_X1_010, DIV_INS_X1_010, DIV_INS_X1_010, DIV_INS_X1_010}, // X1-010 - {DIV_INS_SCC, DIV_INS_SCC}, // K005289 + {DIV_INS_SCC, DIV_INS_SCC}, // Bubble System WSG }; const char* DivEngine::getChannelName(int chan) { @@ -1100,7 +1100,7 @@ const char* DivEngine::getChannelName(int chan) { break; case DIV_SYSTEM_PCE: case DIV_SYSTEM_SFX_BEEPER: - case DIV_SYSTEM_K005289: + case DIV_SYSTEM_BUBSYS_WSG: return chanNames[5][dispatchChanOfChan[chan]]; break; case DIV_SYSTEM_NES: @@ -1246,7 +1246,7 @@ const char* DivEngine::getChannelShortName(int chan) { break; case DIV_SYSTEM_PCE: case DIV_SYSTEM_SFX_BEEPER: - case DIV_SYSTEM_K005289: + case DIV_SYSTEM_BUBSYS_WSG: return chanShortNames[5][dispatchChanOfChan[chan]]; break; case DIV_SYSTEM_NES: @@ -1388,7 +1388,7 @@ int DivEngine::getChannelType(int chan) { break; case DIV_SYSTEM_PCE: case DIV_SYSTEM_SFX_BEEPER: - case DIV_SYSTEM_K005289: + case DIV_SYSTEM_BUBSYS_WSG: return chanTypes[5][dispatchChanOfChan[chan]]; break; case DIV_SYSTEM_NES: @@ -1662,7 +1662,7 @@ DivInstrumentType DivEngine::getPreferInsType(int chan) { case DIV_SYSTEM_X1_010: return chanPrefType[45][dispatchChanOfChan[chan]]; break; - case DIV_SYSTEM_K005289: + case DIV_SYSTEM_BUBSYS_WSG: return chanPrefType[46][dispatchChanOfChan[chan]]; break; } diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index d48a20c9..694f57b9 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -5512,7 +5512,7 @@ bool FurnaceGUI::loop() { sysAddOption(DIV_SYSTEM_X1_010); sysAddOption(DIV_SYSTEM_SWAN); sysAddOption(DIV_SYSTEM_VERA); - sysAddOption(DIV_SYSTEM_K005289); + sysAddOption(DIV_SYSTEM_BUBSYS_WSG); ImGui::EndMenu(); } if (ImGui::BeginMenu("configure system...")) { @@ -5848,7 +5848,7 @@ bool FurnaceGUI::loop() { case DIV_SYSTEM_GB: case DIV_SYSTEM_SWAN: case DIV_SYSTEM_VERA: - case DIV_SYSTEM_K005289: + case DIV_SYSTEM_BUBSYS_WSG: case DIV_SYSTEM_YM2610: case DIV_SYSTEM_YM2610_EXT: case DIV_SYSTEM_YM2610_FULL: @@ -5910,7 +5910,7 @@ bool FurnaceGUI::loop() { sysChangeOption(i,DIV_SYSTEM_X1_010); sysChangeOption(i,DIV_SYSTEM_SWAN); sysChangeOption(i,DIV_SYSTEM_VERA); - sysChangeOption(i,DIV_SYSTEM_K005289); + sysChangeOption(i,DIV_SYSTEM_BUBSYS_WSG); ImGui::EndMenu(); } } @@ -7678,7 +7678,7 @@ FurnaceGUI::FurnaceGUI(): "Konami Bubble System", { DIV_SYSTEM_AY8910, 64, 0, 0, DIV_SYSTEM_AY8910, 64, 0, 0, - DIV_SYSTEM_K005289, 64, 0, 0, + DIV_SYSTEM_BUBSYS_WSG, 64, 0, 0, // VLM5030 exists but not used for music at all 0 } diff --git a/src/gui/guiConst.cpp b/src/gui/guiConst.cpp index 04349809..ef761049 100644 --- a/src/gui/guiConst.cpp +++ b/src/gui/guiConst.cpp @@ -84,7 +84,7 @@ const char* insTypes[DIV_INS_MAX]={ "FDS", "Virtual Boy", "Namco 163", - "Konami SCC/Bubble System", + "Konami SCC/Bubble System WSG", "FM (OPZ)", "POKEY", "PC Beeper",