From fc2db92d4f5b94d76e6e2d1311ea76a75f53a1d4 Mon Sep 17 00:00:00 2001 From: Natt Akuma Date: Mon, 6 Mar 2023 00:58:27 +0700 Subject: [PATCH] Rename QT to QuadTone --- CMakeLists.txt | 2 +- src/engine/dispatchContainer.cpp | 6 +-- src/engine/fileOps.cpp | 2 +- .../{zxbeeperqt.cpp => zxbeeperquadtone.cpp} | 48 +++++++++---------- .../{zxbeeperqt.h => zxbeeperquadtone.h} | 8 ++-- src/engine/song.h | 2 +- src/engine/sysDef.cpp | 4 +- src/gui/guiConst.cpp | 4 +- 8 files changed, 38 insertions(+), 38 deletions(-) rename src/engine/platform/{zxbeeperqt.cpp => zxbeeperquadtone.cpp} (87%) rename src/engine/platform/{zxbeeperqt.h => zxbeeperquadtone.h} (93%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 46cdb6246..038cd389f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -528,7 +528,7 @@ src/engine/platform/t6w28.cpp src/engine/platform/vb.cpp src/engine/platform/vera.cpp src/engine/platform/zxbeeper.cpp -src/engine/platform/zxbeeperqt.cpp +src/engine/platform/zxbeeperquadtone.cpp src/engine/platform/bubsyswsg.cpp src/engine/platform/n163.cpp src/engine/platform/pet.cpp diff --git a/src/engine/dispatchContainer.cpp b/src/engine/dispatchContainer.cpp index 113f2c6de..9dbc4cc03 100644 --- a/src/engine/dispatchContainer.cpp +++ b/src/engine/dispatchContainer.cpp @@ -59,7 +59,7 @@ #include "platform/lynx.h" #include "platform/pokey.h" #include "platform/zxbeeper.h" -#include "platform/zxbeeperqt.h" +#include "platform/zxbeeperquadtone.h" #include "platform/bubsyswsg.h" #include "platform/n163.h" #include "platform/pet.h" @@ -389,8 +389,8 @@ void DivDispatchContainer::init(DivSystem sys, DivEngine* eng, int chanCount, do case DIV_SYSTEM_SFX_BEEPER: dispatch=new DivPlatformZXBeeper; break; - case DIV_SYSTEM_SFX_BEEPER_QT: - dispatch=new DivPlatformZXBeeperQT; + case DIV_SYSTEM_SFX_BEEPER_QUADTONE: + dispatch=new DivPlatformZXBeeperQuadTone; break; case DIV_SYSTEM_LYNX: dispatch=new DivPlatformLynx; diff --git a/src/engine/fileOps.cpp b/src/engine/fileOps.cpp index de7a5ad2b..c679019a1 100644 --- a/src/engine/fileOps.cpp +++ b/src/engine/fileOps.cpp @@ -1479,7 +1479,7 @@ void DivEngine::convertOldFlags(unsigned int oldFlags, DivConfig& newFlags, DivS } break; case DIV_SYSTEM_SFX_BEEPER: - case DIV_SYSTEM_SFX_BEEPER_QT: + case DIV_SYSTEM_SFX_BEEPER_QUADTONE: newFlags.set("clockSel",(int)(oldFlags&1)); break; case DIV_SYSTEM_SCC: diff --git a/src/engine/platform/zxbeeperqt.cpp b/src/engine/platform/zxbeeperquadtone.cpp similarity index 87% rename from src/engine/platform/zxbeeperqt.cpp rename to src/engine/platform/zxbeeperquadtone.cpp index fbd47757b..50082d042 100644 --- a/src/engine/platform/zxbeeperqt.cpp +++ b/src/engine/platform/zxbeeperquadtone.cpp @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "zxbeeperqt.h" +#include "zxbeeperquadtone.h" #include "../engine.h" #include @@ -25,11 +25,11 @@ #define CHIP_FREQBASE 2048*320 #define CHIP_DIVIDER 16*13 -const char** DivPlatformZXBeeperQT::getRegisterSheet() { +const char** DivPlatformZXBeeperQuadTone::getRegisterSheet() { return NULL; } -void DivPlatformZXBeeperQT::acquire(short** buf, size_t len) { +void DivPlatformZXBeeperQuadTone::acquire(short** buf, size_t len) { bool o=false; for (size_t h=0; h=0 && curSamplesong.sampleLen) { @@ -72,7 +72,7 @@ void DivPlatformZXBeeperQT::acquire(short** buf, size_t len) { } } -void DivPlatformZXBeeperQT::tick(bool sysTick) { +void DivPlatformZXBeeperQuadTone::tick(bool sysTick) { for (int i=0; i<4; i++) { chan[i].std.next(); if (chan[i].std.vol.had) { @@ -148,7 +148,7 @@ void DivPlatformZXBeeperQT::tick(bool sysTick) { } } -int DivPlatformZXBeeperQT::dispatch(DivCommand c) { +int DivPlatformZXBeeperQuadTone::dispatch(DivCommand c) { switch (c.cmd) { case DIV_CMD_NOTE_ON: { if (c.chan<4) { @@ -279,48 +279,48 @@ int DivPlatformZXBeeperQT::dispatch(DivCommand c) { return 1; } -void DivPlatformZXBeeperQT::writeOutVol(int ch) { +void DivPlatformZXBeeperQuadTone::writeOutVol(int ch) { if (ch>=4) return; unsigned char val=(chan[ch].outVol>=1)?((chan[ch].outVol>=2)?31:7):0; rWrite(3+ch*4,(!isMuted[ch]&&chan[ch].active)?val:0); } -void DivPlatformZXBeeperQT::muteChannel(int ch, bool mute) { +void DivPlatformZXBeeperQuadTone::muteChannel(int ch, bool mute) { isMuted[ch]=mute; writeOutVol(ch); } -void DivPlatformZXBeeperQT::forceIns() { +void DivPlatformZXBeeperQuadTone::forceIns() { for (int i=0; i<5; i++) { chan[i].insChanged=true; chan[i].freqChanged=true; } } -void* DivPlatformZXBeeperQT::getChanState(int ch) { +void* DivPlatformZXBeeperQuadTone::getChanState(int ch) { return &chan[ch]; } -DivMacroInt* DivPlatformZXBeeperQT::getChanMacroInt(int ch) { +DivMacroInt* DivPlatformZXBeeperQuadTone::getChanMacroInt(int ch) { return &chan[ch].std; } -DivDispatchOscBuffer* DivPlatformZXBeeperQT::getOscBuffer(int ch) { +DivDispatchOscBuffer* DivPlatformZXBeeperQuadTone::getOscBuffer(int ch) { return oscBuf[ch]; } -unsigned char* DivPlatformZXBeeperQT::getRegisterPool() { +unsigned char* DivPlatformZXBeeperQuadTone::getRegisterPool() { return regPool; } -int DivPlatformZXBeeperQT::getRegisterPoolSize() { +int DivPlatformZXBeeperQuadTone::getRegisterPoolSize() { return 16; } -void DivPlatformZXBeeperQT::reset() { +void DivPlatformZXBeeperQuadTone::reset() { memset(regPool,0,16); for (int i=0; i<5; i++) { - chan[i]=DivPlatformZXBeeperQT::Channel(); + chan[i]=DivPlatformZXBeeperQuadTone::Channel(); chan[i].std.setEngine(parent); if (i<4) rWrite(2+i*4,128); } @@ -334,20 +334,20 @@ void DivPlatformZXBeeperQT::reset() { outputClock=0; } -bool DivPlatformZXBeeperQT::keyOffAffectsArp(int ch) { +bool DivPlatformZXBeeperQuadTone::keyOffAffectsArp(int ch) { return true; } -void DivPlatformZXBeeperQT::notifyWaveChange(int wave) { +void DivPlatformZXBeeperQuadTone::notifyWaveChange(int wave) { } -void DivPlatformZXBeeperQT::notifyInsDeletion(void* ins) { +void DivPlatformZXBeeperQuadTone::notifyInsDeletion(void* ins) { for (int i=0; i<5; i++) { chan[i].std.notifyInsDeletion((DivInstrument*)ins); } } -void DivPlatformZXBeeperQT::setFlags(const DivConfig& flags) { +void DivPlatformZXBeeperQuadTone::setFlags(const DivConfig& flags) { if (flags.getInt("clockSel",0)) { chipClock=COLOR_PAL*4.0/5.0; } else { @@ -360,15 +360,15 @@ void DivPlatformZXBeeperQT::setFlags(const DivConfig& flags) { } } -void DivPlatformZXBeeperQT::poke(unsigned int addr, unsigned short val) { +void DivPlatformZXBeeperQuadTone::poke(unsigned int addr, unsigned short val) { rWrite(addr,val); } -void DivPlatformZXBeeperQT::poke(std::vector& wlist) { +void DivPlatformZXBeeperQuadTone::poke(std::vector& wlist) { for (DivRegWrite& i: wlist) rWrite(i.addr,i.val); } -int DivPlatformZXBeeperQT::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) { +int DivPlatformZXBeeperQuadTone::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) { parent=p; for (int i=0; i<5; i++) { isMuted[i]=false; @@ -379,11 +379,11 @@ int DivPlatformZXBeeperQT::init(DivEngine* p, int channels, int sugRate, const D return 5; } -void DivPlatformZXBeeperQT::quit() { +void DivPlatformZXBeeperQuadTone::quit() { for (int i=0; i<5; i++) { delete oscBuf[i]; } } -DivPlatformZXBeeperQT::~DivPlatformZXBeeperQT() { +DivPlatformZXBeeperQuadTone::~DivPlatformZXBeeperQuadTone() { } diff --git a/src/engine/platform/zxbeeperqt.h b/src/engine/platform/zxbeeperquadtone.h similarity index 93% rename from src/engine/platform/zxbeeperqt.h rename to src/engine/platform/zxbeeperquadtone.h index d13bc5ae1..7da58b1db 100644 --- a/src/engine/platform/zxbeeperqt.h +++ b/src/engine/platform/zxbeeperquadtone.h @@ -17,12 +17,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef _ZXBEEPERQT_H -#define _ZXBEEPERQT_H +#ifndef _ZXBEEPERQUADTONE_H +#define _ZXBEEPERQUADTONE_H #include "../dispatch.h" -class DivPlatformZXBeeperQT: public DivDispatch { +class DivPlatformZXBeeperQuadTone: public DivDispatch { struct Channel: public SharedChannel { unsigned short sPosition; unsigned char duty; @@ -65,7 +65,7 @@ class DivPlatformZXBeeperQT: public DivDispatch { const char** getRegisterSheet(); int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags); void quit(); - ~DivPlatformZXBeeperQT(); + ~DivPlatformZXBeeperQuadTone(); private: void writeOutVol(int ch); }; diff --git a/src/engine/song.h b/src/engine/song.h index 0697bbe8a..abcfa18b2 100644 --- a/src/engine/song.h +++ b/src/engine/song.h @@ -83,7 +83,7 @@ enum DivSystem { DIV_SYSTEM_VRC7, DIV_SYSTEM_YM2610B, DIV_SYSTEM_SFX_BEEPER, - DIV_SYSTEM_SFX_BEEPER_QT, + DIV_SYSTEM_SFX_BEEPER_QUADTONE, DIV_SYSTEM_YM2612_EXT, DIV_SYSTEM_SCC, DIV_SYSTEM_OPL_DRUMS, diff --git a/src/engine/sysDef.cpp b/src/engine/sysDef.cpp index e4044a084..f283e63ad 100644 --- a/src/engine/sysDef.cpp +++ b/src/engine/sysDef.cpp @@ -1833,8 +1833,8 @@ void DivEngine::registerSystems() { namcoEffectHandlerMap ); - sysDefs[DIV_SYSTEM_SFX_BEEPER_QT]=new DivSysDef( - "ZX Spectrum Beeper (QuadTone Engine)", NULL, 0xfe, 0, 5, false, true, 0, false, 1U<