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)
This commit is contained in:
cam900 2022-03-17 10:11:48 +09:00
parent d09aa778d9
commit 234c5e9295
14 changed files with 63 additions and 61 deletions

View file

@ -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");

View file

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "k005289.h"
#include "bubsyswsg.h"
#include "../engine.h"
#include <math.h>
@ -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; h<start+len; h++) {
signed int out=0;
// K005289 part
@ -69,7 +69,7 @@ void DivPlatformK005289::acquire(short* bufL, short* bufR, size_t start, size_t
}
}
void DivPlatformK005289::updateWave(int ch) {
void DivPlatformBubSysWSG::updateWave(int ch) {
DivWavetable* wt=parent->getWave(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<DivRegWrite>& wlist) {
void DivPlatformBubSysWSG::poke(std::vector<DivRegWrite>& 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() {
}

View file

@ -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

View file

@ -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));

View file

@ -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 {

View file

@ -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;
}

View file

@ -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
}

View file

@ -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",