Merge branch 'master' of https://github.com/tildearrow/furnace into es5506_alt

This commit is contained in:
cam900 2022-12-14 14:11:33 +09:00
commit 105e863a53
63 changed files with 617 additions and 718 deletions

View file

@ -516,6 +516,7 @@ src/engine/platform/zxbeeper.cpp
src/engine/platform/bubsyswsg.cpp src/engine/platform/bubsyswsg.cpp
src/engine/platform/n163.cpp src/engine/platform/n163.cpp
src/engine/platform/pet.cpp src/engine/platform/pet.cpp
src/engine/platform/pokemini.cpp
src/engine/platform/pong.cpp src/engine/platform/pong.cpp
src/engine/platform/vic20.cpp src/engine/platform/vic20.cpp
src/engine/platform/vrc6.cpp src/engine/platform/vrc6.cpp

View file

@ -2,7 +2,9 @@
- POKEY - POKEY
- Pokémon Mini - Pokémon Mini
- register layout
- confirm emulation
- (maybe) YM2612 CSM (no DualPCM) - (maybe) YM2612 CSM (no DualPCM)
- port presets to new format - port op macro code to all other OPN chips
- bug fixes - bug fixes
- (maybe) advanced linear arpeggio? (run arp+slide simultaneously) - (maybe) advanced linear arpeggio? (run arp+slide simultaneously)

View file

@ -20,46 +20,40 @@
#ifndef _CHIP_UTILS_H #ifndef _CHIP_UTILS_H
#define _CHIP_UTILS_H #define _CHIP_UTILS_H
#include "macroInt.h"
// custom clock limits // custom clock limits
#define MIN_CUSTOM_CLOCK 100000 #define MIN_CUSTOM_CLOCK 100000
#define MAX_CUSTOM_CLOCK 40000000 #define MAX_CUSTOM_CLOCK 40000000
// common shared channel struct // common shared channel struct
struct SharedChannel { template<typename T> struct SharedChannel {
int ins;
int note;
bool active, insChanged, keyOn, keyOff;
SharedChannel():
ins(-1),
note(0),
active(false),
insChanged(true),
keyOn(false),
keyOff(false) {}
};
// common shared channel struct with frequency
struct SharedChannelFreq: public SharedChannel {
int freq, baseFreq, pitch, pitch2; int freq, baseFreq, pitch, pitch2;
bool freqChanged, inPorta, portaPause; int ins, note;
SharedChannelFreq(): bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, inPorta;
SharedChannel(), T vol, outVol;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
SharedChannel(T initVol):
freq(0), freq(0),
baseFreq(0), baseFreq(0),
pitch(0), pitch(0),
pitch2(0), pitch2(0),
ins(-1),
note(0),
active(false),
insChanged(true),
freqChanged(false), freqChanged(false),
keyOn(false),
keyOff(false),
portaPause(false),
inPorta(false), inPorta(false),
portaPause(false) {}
};
// common shared channel volume struct
template<typename T>
struct SharedChannelVolume {
T vol, outVol;
SharedChannelVolume(T initVol):
vol(initVol), vol(initVol),
outVol(initVol) {} outVol(initVol),
std() {}
}; };
#endif #endif

View file

@ -49,6 +49,7 @@
#include "platform/saa.h" #include "platform/saa.h"
#include "platform/amiga.h" #include "platform/amiga.h"
#include "platform/pcspkr.h" #include "platform/pcspkr.h"
#include "platform/pokemini.h"
#include "platform/segapcm.h" #include "platform/segapcm.h"
#include "platform/qsound.h" #include "platform/qsound.h"
#include "platform/vera.h" #include "platform/vera.h"
@ -327,6 +328,9 @@ void DivDispatchContainer::init(DivSystem sys, DivEngine* eng, int chanCount, do
case DIV_SYSTEM_PCSPKR: case DIV_SYSTEM_PCSPKR:
dispatch=new DivPlatformPCSpeaker; dispatch=new DivPlatformPCSpeaker;
break; break;
case DIV_SYSTEM_POKEMINI:
dispatch=new DivPlatformPokeMini;
break;
case DIV_SYSTEM_SFX_BEEPER: case DIV_SYSTEM_SFX_BEEPER:
dispatch=new DivPlatformZXBeeper; dispatch=new DivPlatformZXBeeper;
break; break;

View file

@ -22,11 +22,10 @@
#include "../dispatch.h" #include "../dispatch.h"
#include <queue> #include <queue>
#include "../macroInt.h"
#include "../waveSynth.h" #include "../waveSynth.h"
class DivPlatformAmiga: public DivDispatch { class DivPlatformAmiga: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<signed char> { struct Channel: public SharedChannel<signed char> {
unsigned int audLoc; unsigned int audLoc;
unsigned short audLen; unsigned short audLen;
unsigned int audPos; unsigned int audPos;
@ -35,15 +34,9 @@ class DivPlatformAmiga: public DivDispatch {
int sample, wave; int sample, wave;
int busClock; int busClock;
bool useWave, setPos, useV, useP; bool useWave, setPos, useV, useP;
DivMacroInt std;
DivWaveSynth ws; DivWaveSynth ws;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<signed char>(64),
SharedChannelVolume<signed char>(64),
audLoc(0), audLoc(0),
audLen(0), audLen(0),
audPos(0), audPos(0),

View file

@ -20,7 +20,6 @@
#ifndef _AY_H #ifndef _AY_H
#define _AY_H #define _AY_H
#include "../dispatch.h" #include "../dispatch.h"
#include "../macroInt.h"
#include <queue> #include <queue>
#include "sound/ay8910.h" #include "sound/ay8910.h"
@ -30,7 +29,7 @@ class DivPlatformAY8910: public DivDispatch {
0,4,1,5,2,6,9,8,11,12,13,3,7,10,14,15 0,4,1,5,2,6,9,8,11,12,13,3,7,10,14,15
}; };
inline unsigned char regRemap(unsigned char reg) { return intellivision?AY8914RegRemap[reg&0x0f]:reg&0x0f; } inline unsigned char regRemap(unsigned char reg) { return intellivision?AY8914RegRemap[reg&0x0f]:reg&0x0f; }
struct Channel: public SharedChannelFreq, public SharedChannelVolume<int> { struct Channel: public SharedChannel<int> {
struct PSGMode { struct PSGMode {
union { union {
struct { struct {
@ -75,14 +74,8 @@ class DivPlatformAY8910: public DivDispatch {
unsigned char autoEnvNum, autoEnvDen; unsigned char autoEnvNum, autoEnvDen;
signed char konCycles; signed char konCycles;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<int>(15),
SharedChannelVolume<int>(15),
curPSGMode(PSGMode(0)), curPSGMode(PSGMode(0)),
nextPSGMode(PSGMode(1)), nextPSGMode(PSGMode(1)),
dac(DAC()), dac(DAC()),

View file

@ -20,13 +20,12 @@
#ifndef _AY8930_H #ifndef _AY8930_H
#define _AY8930_H #define _AY8930_H
#include "../dispatch.h" #include "../dispatch.h"
#include "../macroInt.h"
#include <queue> #include <queue>
#include "sound/ay8910.h" #include "sound/ay8910.h"
class DivPlatformAY8930: public DivDispatch { class DivPlatformAY8930: public DivDispatch {
protected: protected:
struct Channel: public SharedChannelFreq, public SharedChannelVolume<int> { struct Channel: public SharedChannel<int> {
struct Envelope { struct Envelope {
unsigned char mode; unsigned char mode;
unsigned short period; unsigned short period;
@ -83,14 +82,8 @@ class DivPlatformAY8930: public DivDispatch {
unsigned char autoEnvNum, autoEnvDen, duty; unsigned char autoEnvNum, autoEnvDen, duty;
signed char konCycles; signed char konCycles;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<int>(31),
SharedChannelVolume<int>(31),
envelope(Envelope()), envelope(Envelope()),
curPSGMode(PSGMode(0)), curPSGMode(PSGMode(0)),
nextPSGMode(PSGMode(1)), nextPSGMode(PSGMode(1)),

View file

@ -22,23 +22,16 @@
#include "../dispatch.h" #include "../dispatch.h"
#include <queue> #include <queue>
#include "../macroInt.h"
#include "../waveSynth.h" #include "../waveSynth.h"
#include "vgsound_emu/src/k005289/k005289.hpp" #include "vgsound_emu/src/k005289/k005289.hpp"
class DivPlatformBubSysWSG: public DivDispatch { class DivPlatformBubSysWSG: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<signed char> { struct Channel: public SharedChannel<signed char> {
signed short wave; signed short wave;
signed char waveROM[32] = {0}; // 4 bit PROM per channel on bubble system signed char waveROM[32] = {0}; // 4 bit PROM per channel on bubble system
DivMacroInt std;
DivWaveSynth ws; DivWaveSynth ws;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<signed char>(15),
SharedChannelVolume<signed char>(15),
wave(-1) {} wave(-1) {}
}; };
Channel chan[2]; Channel chan[2];

View file

@ -22,25 +22,18 @@
#include "../dispatch.h" #include "../dispatch.h"
#include <queue> #include <queue>
#include "../macroInt.h"
#include "sound/c64/sid.h" #include "sound/c64/sid.h"
#include "sound/c64_fp/SID.h" #include "sound/c64_fp/SID.h"
class DivPlatformC64: public DivDispatch { class DivPlatformC64: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<signed char> { struct Channel: public SharedChannel<signed char> {
int prevFreq, testWhen; int prevFreq, testWhen;
unsigned char sweep, wave, attack, decay, sustain, release; unsigned char sweep, wave, attack, decay, sustain, release;
short duty; short duty;
bool sweepChanged, filter; bool sweepChanged, filter;
bool resetMask, resetFilter, resetDuty, ring, sync, test; bool resetMask, resetFilter, resetDuty, ring, sync, test;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<signed char>(15),
SharedChannelVolume<signed char>(15),
prevFreq(65535), prevFreq(65535),
testWhen(0), testWhen(0),
sweep(0), sweep(0),

View file

@ -21,26 +21,19 @@
#define _FDS_H #define _FDS_H
#include "../dispatch.h" #include "../dispatch.h"
#include "../macroInt.h"
#include "../waveSynth.h" #include "../waveSynth.h"
#include "sound/nes_nsfplay/nes_fds.h" #include "sound/nes_nsfplay/nes_fds.h"
class DivPlatformFDS: public DivDispatch { class DivPlatformFDS: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<signed char> { struct Channel: public SharedChannel<signed char> {
int prevFreq, modFreq; int prevFreq, modFreq;
unsigned char duty, sweep, modDepth, modPos; unsigned char duty, sweep, modDepth, modPos;
bool sweepChanged, modOn; bool sweepChanged, modOn;
signed short wave; signed short wave;
signed char modTable[32]; signed char modTable[32];
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<signed char>(32),
SharedChannelVolume<signed char>(32),
prevFreq(65535), prevFreq(65535),
modFreq(0), modFreq(0),
duty(0), duty(0),

View file

@ -123,19 +123,13 @@ class DivPlatformOPN: public DivPlatformFMBase {
pan(3) {} pan(3) {}
}; };
struct OPNOpChannel: public SharedChannelFreq, public SharedChannelVolume<int> { struct OPNOpChannel: public SharedChannel<int> {
DivMacroInt std;
unsigned char freqH, freqL; unsigned char freqH, freqL;
int portaPauseFreq; int portaPauseFreq;
signed char konCycles; signed char konCycles;
bool mask; bool mask;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
OPNOpChannel(): OPNOpChannel():
SharedChannelFreq(), SharedChannel<int>(0),
SharedChannelVolume<int>(0),
freqH(0), freqH(0),
freqL(0), freqL(0),
portaPauseFreq(0), portaPauseFreq(0),

View file

@ -22,7 +22,6 @@
#include "../dispatch.h" #include "../dispatch.h"
#include "../instrument.h" #include "../instrument.h"
#include "../macroInt.h"
#include <deque> #include <deque>
#define KVS(x,y) ((chan[x].state.op[y].kvs==2 && isOutput[chan[x].state.alg][y]) || chan[x].state.op[y].kvs==1) #define KVS(x,y) ((chan[x].state.op[y].kvs==2 && isOutput[chan[x].state.alg][y]) || chan[x].state.op[y].kvs==1)
@ -48,22 +47,16 @@ class DivPlatformFMBase: public DivDispatch {
0,2,1,3 0,2,1,3
}; };
struct FMChannel: public SharedChannelFreq, public SharedChannelVolume<int> { struct FMChannel: public SharedChannel<int> {
DivInstrumentFM state; DivInstrumentFM state;
DivMacroInt std;
unsigned char freqH, freqL; unsigned char freqH, freqL;
int portaPauseFreq; int portaPauseFreq;
unsigned char opMask; unsigned char opMask;
signed char konCycles; signed char konCycles;
bool hardReset, opMaskChanged; bool hardReset, opMaskChanged;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
FMChannel(): FMChannel():
SharedChannelFreq(), SharedChannel<int>(0),
SharedChannelVolume<int>(0),
freqH(0), freqH(0),
freqL(0), freqL(0),
portaPauseFreq(0), portaPauseFreq(0),
@ -125,8 +118,7 @@ class DivPlatformFMBase: public DivDispatch {
friend void putDispatchChan(void*,int,int); friend void putDispatchChan(void*,int,int);
DivPlatformFMBase(): DivPlatformFMBase():DivDispatch(),
DivDispatch(),
lastBusy(0), lastBusy(0),
delay(0) {} delay(0) {}
}; };

View file

@ -21,13 +21,12 @@
#define _GB_H #define _GB_H
#include "../dispatch.h" #include "../dispatch.h"
#include "../macroInt.h"
#include "../waveSynth.h" #include "../waveSynth.h"
#include "sound/gb/gb.h" #include "sound/gb/gb.h"
#include <queue> #include <queue>
class DivPlatformGB: public DivDispatch { class DivPlatformGB: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<signed char> { struct Channel: public SharedChannel<signed char> {
unsigned char duty, sweep; unsigned char duty, sweep;
bool sweepChanged, released, softEnv, killIt; bool sweepChanged, released, softEnv, killIt;
bool soManyHacksToMakeItDefleCompatible; bool soManyHacksToMakeItDefleCompatible;
@ -36,14 +35,8 @@ class DivPlatformGB: public DivDispatch {
unsigned char envVol, envDir, envLen, soundLen; unsigned char envVol, envDir, envLen, soundLen;
unsigned short hwSeqPos; unsigned short hwSeqPos;
short hwSeqDelay; short hwSeqDelay;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<signed char>(15),
SharedChannelVolume<signed char>(15),
duty(0), duty(0),
sweep(0), sweep(0),
sweepChanged(false), sweepChanged(false),

View file

@ -19,8 +19,8 @@
#ifndef _GENESIS_H #ifndef _GENESIS_H
#define _GENESIS_H #define _GENESIS_H
#include "fmshared_OPN.h" #include "fmshared_OPN.h"
#include "../macroInt.h"
#include "../../../extern/Nuked-OPN2/ym3438.h" #include "../../../extern/Nuked-OPN2/ym3438.h"
#include "sound/ymfm/ymfm_opn.h" #include "sound/ymfm/ymfm_opn.h"

View file

@ -17,6 +17,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#ifndef _GENESISEXT_H
#define _GENESISEXT_H
#include "../dispatch.h" #include "../dispatch.h"
#include "genesis.h" #include "genesis.h"
@ -43,3 +46,5 @@ class DivPlatformGenesisExt: public DivPlatformGenesis {
void quit(); void quit();
~DivPlatformGenesisExt(); ~DivPlatformGenesisExt();
}; };
#endif

View file

@ -21,7 +21,6 @@
#define _LYNX_H #define _LYNX_H
#include "../dispatch.h" #include "../dispatch.h"
#include "../macroInt.h"
#include "sound/lynx/Mikey.hpp" #include "sound/lynx/Mikey.hpp"
class DivPlatformLynx: public DivDispatch { class DivPlatformLynx: public DivDispatch {
@ -40,22 +39,15 @@ class DivPlatformLynx: public DivDispatch {
MikeyDuty(int duty); MikeyDuty(int duty);
}; };
struct Channel: public SharedChannelFreq, public SharedChannelVolume<signed char> { struct Channel: public SharedChannel<signed char> {
DivMacroInt std;
MikeyFreqDiv fd; MikeyFreqDiv fd;
MikeyDuty duty; MikeyDuty duty;
int actualNote, lfsr, sample, samplePos, sampleAccum, sampleBaseFreq, sampleFreq; int actualNote, lfsr, sample, samplePos, sampleAccum, sampleBaseFreq, sampleFreq;
unsigned char pan; unsigned char pan;
bool pcm; bool pcm;
int macroVolMul; int macroVolMul;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<signed char>(127),
SharedChannelVolume<signed char>(127),
std(),
fd(0), fd(0),
duty(0), duty(0),
actualNote(0), actualNote(0),

View file

@ -21,28 +21,19 @@
#define _MMC5_H #define _MMC5_H
#include "../dispatch.h" #include "../dispatch.h"
#include "../macroInt.h"
class DivPlatformMMC5: public DivDispatch { class DivPlatformMMC5: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<signed char> { struct Channel: public SharedChannel<signed char> {
int prevFreq; int prevFreq;
unsigned char duty, sweep; unsigned char duty, sweep;
bool sweepChanged, furnaceDac; bool sweepChanged, furnaceDac;
signed char wave;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<signed char>(15),
SharedChannelVolume<signed char>(15),
prevFreq(65535), prevFreq(65535),
duty(0), duty(0),
sweep(8), sweep(8),
sweepChanged(false), sweepChanged(false),
furnaceDac(false), furnaceDac(false) {}
wave(-1) {}
}; };
Channel chan[5]; Channel chan[5];
DivDispatchOscBuffer* oscBuf[3]; DivDispatchOscBuffer* oscBuf[3];

View file

@ -22,20 +22,13 @@
#include "../dispatch.h" #include "../dispatch.h"
#include <queue> #include <queue>
#include "../macroInt.h"
#include "sound/oki/msm5232.h" #include "sound/oki/msm5232.h"
class DivPlatformMSM5232: public DivDispatch { class DivPlatformMSM5232: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<signed char> { struct Channel: public SharedChannel<signed char> {
bool noise; bool noise;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<signed char>(127),
SharedChannelVolume<signed char>(127),
noise(false) {} noise(false) {}
}; };
Channel chan[8]; Channel chan[8];

View file

@ -19,24 +19,19 @@
#ifndef _MSM6258_H #ifndef _MSM6258_H
#define _MSM6258_H #define _MSM6258_H
#include "../dispatch.h" #include "../dispatch.h"
#include "../macroInt.h"
#include <queue> #include <queue>
#include "sound/oki/okim6258.h" #include "sound/oki/okim6258.h"
class DivPlatformMSM6258: public DivDispatch { class DivPlatformMSM6258: public DivDispatch {
protected: protected:
struct Channel: public SharedChannel, public SharedChannelVolume<int> { struct Channel: public SharedChannel<int> {
bool furnacePCM; bool furnacePCM;
int sample; int sample;
unsigned char pan; unsigned char pan;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
}
Channel(): Channel():
SharedChannel(), SharedChannel<int>(8),
SharedChannelVolume<int>(8),
furnacePCM(false), furnacePCM(false),
sample(-1), sample(-1),
pan(3) {} pan(3) {}

View file

@ -19,23 +19,18 @@
#ifndef _MSM6295_H #ifndef _MSM6295_H
#define _MSM6295_H #define _MSM6295_H
#include "../dispatch.h" #include "../dispatch.h"
#include "../macroInt.h"
#include <queue> #include <queue>
#include "vgsound_emu/src/msm6295/msm6295.hpp" #include "vgsound_emu/src/msm6295/msm6295.hpp"
class DivPlatformMSM6295: public DivDispatch, public vgsound_emu_mem_intf { class DivPlatformMSM6295: public DivDispatch, public vgsound_emu_mem_intf {
protected: protected:
struct Channel: public SharedChannel, public SharedChannelVolume<int> { struct Channel: public SharedChannel<int> {
bool furnacePCM; bool furnacePCM;
int sample; int sample;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
}
Channel(): Channel():
SharedChannel(), SharedChannel<int>(8),
SharedChannelVolume<int>(8),
furnacePCM(false), furnacePCM(false),
sample(-1) {} sample(-1) {}
}; };

View file

@ -22,12 +22,11 @@
#include "../dispatch.h" #include "../dispatch.h"
#include <queue> #include <queue>
#include "../macroInt.h"
#include "../waveSynth.h" #include "../waveSynth.h"
#include "vgsound_emu/src/n163/n163.hpp" #include "vgsound_emu/src/n163/n163.hpp"
class DivPlatformN163: public DivDispatch { class DivPlatformN163: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<signed char> { struct Channel: public SharedChannel<signed char> {
signed char resVol; signed char resVol;
short wave, wavePos, waveLen; short wave, wavePos, waveLen;
unsigned char waveMode; unsigned char waveMode;
@ -35,15 +34,9 @@ class DivPlatformN163: public DivDispatch {
unsigned char loadMode; unsigned char loadMode;
bool volumeChanged; bool volumeChanged;
bool waveChanged, waveUpdated; bool waveChanged, waveUpdated;
DivMacroInt std;
DivWaveSynth ws; DivWaveSynth ws;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<signed char>(15),
SharedChannelVolume<signed char>(15),
resVol(15), resVol(15),
wave(-1), wave(-1),
wavePos(0), wavePos(0),

View file

@ -22,24 +22,17 @@
#include "../dispatch.h" #include "../dispatch.h"
#include <queue> #include <queue>
#include "../macroInt.h"
#include "../waveSynth.h" #include "../waveSynth.h"
#include "sound/namco.h" #include "sound/namco.h"
class DivPlatformNamcoWSG: public DivDispatch { class DivPlatformNamcoWSG: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<signed char> { struct Channel: public SharedChannel<signed char> {
unsigned char pan; unsigned char pan;
bool noise; bool noise;
signed char wave; signed short wave;
DivMacroInt std;
DivWaveSynth ws; DivWaveSynth ws;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<signed char>(15),
SharedChannelVolume<signed char>(15),
pan(255), pan(255),
noise(false), noise(false),
wave(-1) {} wave(-1) {}

View file

@ -21,32 +21,23 @@
#define _NES_H #define _NES_H
#include "../dispatch.h" #include "../dispatch.h"
#include "../macroInt.h"
#include "sound/nes_nsfplay/nes_apu.h" #include "sound/nes_nsfplay/nes_apu.h"
class DivPlatformNES: public DivDispatch { class DivPlatformNES: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<signed char> { struct Channel: public SharedChannel<signed char> {
int prevFreq; int prevFreq;
unsigned char duty, sweep, envMode, len; unsigned char duty, sweep, envMode, len;
bool sweepChanged, furnaceDac; bool sweepChanged, furnaceDac;
signed char wave;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<signed char>(15),
SharedChannelVolume<signed char>(15),
prevFreq(65535), prevFreq(65535),
duty(0), duty(0),
sweep(8), sweep(8),
envMode(3), envMode(3),
len(0x1f), len(0x1f),
sweepChanged(false), sweepChanged(false),
furnaceDac(false), furnaceDac(false) {}
wave(-1) {}
}; };
Channel chan[5]; Channel chan[5];
DivDispatchOscBuffer* oscBuf[5]; DivDispatchOscBuffer* oscBuf[5];

View file

@ -19,8 +19,8 @@
#ifndef _OPL_H #ifndef _OPL_H
#define _OPL_H #define _OPL_H
#include "../dispatch.h" #include "../dispatch.h"
#include "../macroInt.h"
#include <queue> #include <queue>
#include "../../../extern/opl/opl3.h" #include "../../../extern/opl/opl3.h"
#include "sound/ymfm/ymfm_adpcm.h" #include "sound/ymfm/ymfm_adpcm.h"
@ -36,21 +36,15 @@ class DivOPLAInterface: public ymfm::ymfm_interface {
class DivPlatformOPL: public DivDispatch { class DivPlatformOPL: public DivDispatch {
protected: protected:
struct Channel: public SharedChannelFreq, public SharedChannelVolume<int> { struct Channel: public SharedChannel<int> {
DivInstrumentFM state; DivInstrumentFM state;
DivMacroInt std;
unsigned char freqH, freqL; unsigned char freqH, freqL;
int sample, fixedFreq; int sample, fixedFreq;
bool furnacePCM, fourOp, hardReset; bool furnacePCM, fourOp, hardReset;
unsigned char pan; unsigned char pan;
int macroVolMul; int macroVolMul;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<int>(0),
SharedChannelVolume<int>(0),
freqH(0), freqH(0),
freqL(0), freqL(0),
sample(-1), sample(-1),

View file

@ -19,8 +19,8 @@
#ifndef _OPLL_H #ifndef _OPLL_H
#define _OPLL_H #define _OPLL_H
#include "../dispatch.h" #include "../dispatch.h"
#include "../macroInt.h"
#include <queue> #include <queue>
extern "C" { extern "C" {
@ -29,20 +29,14 @@ extern "C" {
class DivPlatformOPLL: public DivDispatch { class DivPlatformOPLL: public DivDispatch {
protected: protected:
struct Channel: public SharedChannelFreq, public SharedChannelVolume<int> { struct Channel: public SharedChannel<int> {
DivInstrumentFM state; DivInstrumentFM state;
DivMacroInt std;
unsigned char freqH, freqL; unsigned char freqH, freqL;
int fixedFreq; int fixedFreq;
bool furnaceDac; bool furnaceDac;
unsigned char pan; unsigned char pan;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<int>(0),
SharedChannelVolume<int>(0),
freqH(0), freqH(0),
freqL(0), freqL(0),
fixedFreq(0), fixedFreq(0),

View file

@ -22,12 +22,11 @@
#include "../dispatch.h" #include "../dispatch.h"
#include <queue> #include <queue>
#include "../macroInt.h"
#include "../waveSynth.h" #include "../waveSynth.h"
#include "sound/pce_psg.h" #include "sound/pce_psg.h"
class DivPlatformPCE: public DivDispatch { class DivPlatformPCE: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<signed char> { struct Channel: public SharedChannel<signed char> {
int antiClickPeriodCount, antiClickWavePos; int antiClickPeriodCount, antiClickWavePos;
int dacPeriod, dacRate, dacOut; int dacPeriod, dacRate, dacOut;
unsigned int dacPos; unsigned int dacPos;
@ -36,15 +35,9 @@ class DivPlatformPCE: public DivDispatch {
bool noise, pcm, furnaceDac, deferredWaveUpdate; bool noise, pcm, furnaceDac, deferredWaveUpdate;
signed short wave; signed short wave;
int macroVolMul; int macroVolMul;
DivMacroInt std;
DivWaveSynth ws; DivWaveSynth ws;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<signed char>(31),
SharedChannelVolume<signed char>(31),
antiClickPeriodCount(0), antiClickPeriodCount(0),
antiClickWavePos(0), antiClickWavePos(0),
dacPeriod(0), dacPeriod(0),

View file

@ -22,11 +22,10 @@
#include "../dispatch.h" #include "../dispatch.h"
#include <queue> #include <queue>
#include "../macroInt.h"
#include "../waveSynth.h" #include "../waveSynth.h"
class DivPlatformPCMDAC: public DivDispatch { class DivPlatformPCMDAC: public DivDispatch {
struct Channel: public SharedChannelFreq { struct Channel: public SharedChannel<int> {
bool audDir; bool audDir;
unsigned int audLoc; unsigned int audLoc;
unsigned short audLen; unsigned short audLen;
@ -35,15 +34,10 @@ class DivPlatformPCMDAC: public DivDispatch {
int sample, wave; int sample, wave;
int panL, panR; int panL, panR;
bool useWave, setPos; bool useWave, setPos;
int vol, envVol; int envVol;
DivMacroInt std;
DivWaveSynth ws; DivWaveSynth ws;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<int>(255),
audDir(false), audDir(false),
audLoc(0), audLoc(0),
audLen(0), audLen(0),
@ -55,7 +49,6 @@ class DivPlatformPCMDAC: public DivDispatch {
panR(255), panR(255),
useWave(false), useWave(false),
setPos(false), setPos(false),
vol(255),
envVol(64) {} envVol(64) {}
}; };
Channel chan; Channel chan;

View file

@ -21,22 +21,15 @@
#define _PCSPKR_H #define _PCSPKR_H
#include "../dispatch.h" #include "../dispatch.h"
#include "../macroInt.h"
#include <queue> #include <queue>
#include <thread> #include <thread>
#include <mutex> #include <mutex>
#include <condition_variable> #include <condition_variable>
class DivPlatformPCSpeaker: public DivDispatch { class DivPlatformPCSpeaker: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<signed char> { struct Channel: public SharedChannel<signed char> {
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<signed char>(15) {}
SharedChannelVolume<signed char>(15) {}
}; };
Channel chan[1]; Channel chan[1];
DivDispatchOscBuffer* oscBuf; DivDispatchOscBuffer* oscBuf;

View file

@ -21,23 +21,16 @@
#define _PET_H #define _PET_H
#include "../dispatch.h" #include "../dispatch.h"
#include "../macroInt.h"
class DivPlatformPET: public DivDispatch { class DivPlatformPET: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<int> { struct Channel: public SharedChannel<int> {
bool enable; bool enable;
int wave; int wave;
unsigned char sreg; unsigned char sreg;
int cnt; int cnt;
short out; short out;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<int>(1),
SharedChannelVolume<int>(1),
enable(false), enable(false),
wave(0b00001111), wave(0b00001111),
sreg(0), sreg(0),

View file

@ -0,0 +1,315 @@
/**
* Furnace Tracker - multi-system chiptune tracker
* Copyright (C) 2021-2022 tildearrow and contributors
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "pokemini.h"
#include "../engine.h"
#include "../../ta-log.h"
#include <math.h>
#define PCSPKR_DIVIDER 16
#define CHIP_DIVIDER 1
const char* regCheatSheetPokeMini[]={
"Period", "0",
NULL
};
const short volTable[4]={
0, 16384, 16384, 32767
};
const short scaleTable[8]={
1, 7, 31, 63, 127, 255, 1023, 4095
};
const char** DivPlatformPokeMini::getRegisterSheet() {
return regCheatSheetPokeMini;
}
void DivPlatformPokeMini::acquire(short* bufL, short* bufR, size_t start, size_t len) {
int out=0;
for (size_t i=start; i<start+len; i++) {
for (int j=0; j<PCSPKR_DIVIDER; j++) {
elapsedMain++;
if (on) {
if ((elapsedMain&scaleTable[timerScale&7])==0) {
pos--;
if (pos<0) {
pos=preset;
}
}
}
}
if (on) {
out=(pos>=pivot && !isMuted[0])?volTable[vol&3]:0;
bufL[i]=out;
oscBuf->data[oscBuf->needle++]=out;
} else {
bufL[i]=0;
oscBuf->data[oscBuf->needle++]=0;
}
}
}
void DivPlatformPokeMini::tick(bool sysTick) {
for (int i=0; i<1; i++) {
chan[i].std.next();
if (chan[i].std.vol.had) {
chan[i].outVol=VOL_SCALE_LINEAR(chan[i].vol,chan[i].std.vol.val,3);
vol=(chan[i].outVol==2)?3:chan[i].outVol;
}
if (chan[i].std.arp.had) {
if (!chan[i].inPorta) {
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
}
chan[i].freqChanged=true;
}
if (chan[i].std.duty.had) {
chan[i].duty=chan[i].std.duty.val;
chan[i].freqChanged=true;
}
if (chan[i].std.pitch.had) {
if (chan[i].std.pitch.mode) {
chan[i].pitch2+=chan[i].std.pitch.val;
CLAMP_VAR(chan[i].pitch2,-32768,32767);
} else {
chan[i].pitch2=chan[i].std.pitch.val;
}
chan[i].freqChanged=true;
}
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,true,0,chan[i].pitch2,chipClock,CHIP_DIVIDER)-1;
if (chan[i].freq<0) chan[i].freq=0;
if (chan[i].freq>65535) chan[i].freq=65535;
if (chan[i].keyOn) {
on=true;
}
if (chan[i].keyOff) {
on=false;
}
preset=chan[i].freq;
pivot=(chan[i].duty*preset)>>8;
if (chan[i].keyOn) chan[i].keyOn=false;
if (chan[i].keyOff) chan[i].keyOff=false;
chan[i].freqChanged=false;
}
}
}
int DivPlatformPokeMini::dispatch(DivCommand c) {
switch (c.cmd) {
case DIV_CMD_NOTE_ON:
if (c.value!=DIV_NOTE_NULL) {
chan[c.chan].baseFreq=NOTE_PERIODIC(c.value);
chan[c.chan].freqChanged=true;
chan[c.chan].note=c.value;
}
vol=(chan[c.chan].outVol==2)?3:chan[c.chan].outVol;
chan[c.chan].active=true;
chan[c.chan].keyOn=true;
chan[c.chan].macroInit(parent->getIns(chan[c.chan].ins,DIV_INS_BEEPER));
if (!parent->song.brokenOutVol && !chan[c.chan].std.vol.will) {
chan[c.chan].outVol=chan[c.chan].vol;
}
break;
case DIV_CMD_NOTE_OFF:
chan[c.chan].active=false;
chan[c.chan].keyOff=true;
chan[c.chan].macroInit(NULL);
break;
case DIV_CMD_NOTE_OFF_ENV:
case DIV_CMD_ENV_RELEASE:
chan[c.chan].std.release();
break;
case DIV_CMD_INSTRUMENT:
if (chan[c.chan].ins!=c.value || c.value2==1) {
chan[c.chan].ins=c.value;
}
break;
case DIV_CMD_VOLUME:
if (chan[c.chan].vol!=c.value) {
chan[c.chan].vol=c.value;
if (!chan[c.chan].std.vol.has) {
chan[c.chan].outVol=c.value;
}
if (chan[c.chan].active) {
on=chan[c.chan].vol;
}
}
break;
case DIV_CMD_GET_VOLUME:
return chan[c.chan].vol;
break;
case DIV_CMD_PITCH:
chan[c.chan].pitch=c.value;
chan[c.chan].freqChanged=true;
break;
case DIV_CMD_NOTE_PORTA: {
int destFreq=NOTE_PERIODIC(c.value2);
bool return2=false;
if (destFreq>chan[c.chan].baseFreq) {
chan[c.chan].baseFreq+=c.value;
if (chan[c.chan].baseFreq>=destFreq) {
chan[c.chan].baseFreq=destFreq;
return2=true;
}
} else {
chan[c.chan].baseFreq-=c.value;
if (chan[c.chan].baseFreq<=destFreq) {
chan[c.chan].baseFreq=destFreq;
return2=true;
}
}
chan[c.chan].freqChanged=true;
if (return2) {
chan[c.chan].inPorta=false;
return 2;
}
break;
}
case DIV_CMD_LEGATO:
if (c.chan==3) break;
chan[c.chan].baseFreq=NOTE_PERIODIC(c.value+((chan[c.chan].std.arp.will && !chan[c.chan].std.arp.mode)?(chan[c.chan].std.arp.val):(0)));
chan[c.chan].freqChanged=true;
chan[c.chan].note=c.value;
break;
case DIV_CMD_PRE_PORTA:
if (chan[c.chan].active && c.value2) {
if (parent->song.resetMacroOnPorta) chan[c.chan].macroInit(parent->getIns(chan[c.chan].ins,DIV_INS_BEEPER));
}
if (!chan[c.chan].inPorta && c.value && !parent->song.brokenPortaArp && chan[c.chan].std.arp.will) chan[c.chan].baseFreq=NOTE_PERIODIC(chan[c.chan].note);
chan[c.chan].inPorta=c.value;
break;
case DIV_CMD_GET_VOLMAX:
return 2;
break;
case DIV_ALWAYS_SET_VOLUME:
return 1;
break;
default:
break;
}
return 1;
}
void DivPlatformPokeMini::muteChannel(int ch, bool mute) {
isMuted[ch]=mute;
}
void DivPlatformPokeMini::forceIns() {
for (int i=0; i<1; i++) {
chan[i].insChanged=true;
}
}
void* DivPlatformPokeMini::getChanState(int ch) {
return &chan[ch];
}
DivMacroInt* DivPlatformPokeMini::getChanMacroInt(int ch) {
return &chan[ch].std;
}
DivDispatchOscBuffer* DivPlatformPokeMini::getOscBuffer(int ch) {
return oscBuf;
}
unsigned char* DivPlatformPokeMini::getRegisterPool() {
if (on) {
regPool[0]=preset;
regPool[1]=preset>>8;
} else {
regPool[0]=0;
regPool[1]=0;
}
return regPool;
}
int DivPlatformPokeMini::getRegisterPoolSize() {
return 2;
}
void DivPlatformPokeMini::reset() {
for (int i=0; i<1; i++) {
chan[i]=DivPlatformPokeMini::Channel();
chan[i].std.setEngine(parent);
}
if (dumpWrites) {
addWrite(0xffffffff,0);
}
on=false;
preset=0;
pivot=0;
pos=0;
timerScale=0;
vol=0;
preset=0;
pivot=0;
elapsedMain=0;
memset(regPool,0,2);
}
bool DivPlatformPokeMini::keyOffAffectsArp(int ch) {
return true;
}
void DivPlatformPokeMini::setFlags(const DivConfig& flags) {
chipClock=4000000;
CHECK_CUSTOM_CLOCK;
rate=chipClock/PCSPKR_DIVIDER;
oscBuf->rate=rate;
}
void DivPlatformPokeMini::notifyInsDeletion(void* ins) {
for (int i=0; i<1; i++) {
chan[i].std.notifyInsDeletion((DivInstrument*)ins);
}
}
void DivPlatformPokeMini::poke(unsigned int addr, unsigned short val) {
// ???
}
void DivPlatformPokeMini::poke(std::vector<DivRegWrite>& wlist) {
// ???
}
int DivPlatformPokeMini::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
parent=p;
dumpWrites=false;
skipRegisterWrites=false;
for (int i=0; i<1; i++) {
isMuted[i]=false;
}
oscBuf=new DivDispatchOscBuffer;
setFlags(flags);
reset();
return 5;
}
void DivPlatformPokeMini::quit() {
delete oscBuf;
}
DivPlatformPokeMini::~DivPlatformPokeMini() {
}

View file

@ -0,0 +1,69 @@
/**
* Furnace Tracker - multi-system chiptune tracker
* Copyright (C) 2021-2022 tildearrow and contributors
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _POKEMINI_H
#define _POKEMINI_H
#include "../dispatch.h"
#include "../macroInt.h"
class DivPlatformPokeMini: public DivDispatch {
struct Channel: public SharedChannel<signed char> {
unsigned char duty;
Channel():
SharedChannel<signed char>(2),
duty(128) {}
};
Channel chan[1];
DivDispatchOscBuffer* oscBuf;
bool isMuted[1];
bool on;
int pos;
unsigned char timerScale, vol;
unsigned short preset, pivot;
unsigned char regPool[2];
unsigned short elapsedMain;
friend void putDispatchChip(void*,int);
friend void putDispatchChan(void*,int,int);
public:
void acquire(short* bufL, short* bufR, size_t start, size_t len);
int dispatch(DivCommand c);
void* getChanState(int chan);
DivMacroInt* getChanMacroInt(int ch);
DivDispatchOscBuffer* getOscBuffer(int chan);
unsigned char* getRegisterPool();
int getRegisterPoolSize();
void reset();
void forceIns();
void tick(bool sysTick=true);
void muteChannel(int ch, bool mute);
bool keyOffAffectsArp(int ch);
void setFlags(const DivConfig& flags);
void notifyInsDeletion(void* ins);
void poke(unsigned int addr, unsigned short val);
void poke(std::vector<DivRegWrite>& wlist);
const char** getRegisterSheet();
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
void quit();
~DivPlatformPokeMini();
};
#endif

View file

@ -21,18 +21,11 @@
#define _PONG_H #define _PONG_H
#include "../dispatch.h" #include "../dispatch.h"
#include "../macroInt.h"
class DivPlatformPong: public DivDispatch { class DivPlatformPong: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<signed char> { struct Channel: public SharedChannel<signed char> {
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<signed char>(1) {}
SharedChannelVolume<signed char>(1) {}
}; };
Channel chan[1]; Channel chan[1];
DivDispatchOscBuffer* oscBuf; DivDispatchOscBuffer* oscBuf;

View file

@ -22,24 +22,17 @@
#include "../dispatch.h" #include "../dispatch.h"
#include <queue> #include <queue>
#include "../macroInt.h"
#include "sound/qsound.h" #include "sound/qsound.h"
class DivPlatformQSound: public DivDispatch { class DivPlatformQSound: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<int> { struct Channel: public SharedChannel<int> {
int resVol; int resVol;
int sample, wave; int sample, wave;
int panning; int panning;
int echo; int echo;
bool useWave, surround, isNewQSound; bool useWave, surround, isNewQSound;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<int>(255),
SharedChannelVolume<int>(255),
resVol(4095), resVol(4095),
sample(-1), sample(-1),
panning(0x10), panning(0x10),

View file

@ -22,24 +22,17 @@
#include "../dispatch.h" #include "../dispatch.h"
#include <queue> #include <queue>
#include "../macroInt.h"
#include "sound/rf5c68.h" #include "sound/rf5c68.h"
class DivPlatformRF5C68: public DivDispatch { class DivPlatformRF5C68: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<int> { struct Channel: public SharedChannel<int> {
unsigned int audPos; unsigned int audPos;
int sample, wave; int sample, wave;
int panning; int panning;
bool setPos; bool setPos;
int macroVolMul; int macroVolMul;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<int>(255),
SharedChannelVolume<int>(255),
audPos(0), audPos(0),
sample(-1), sample(-1),
panning(255), panning(255),

View file

@ -19,25 +19,19 @@
#ifndef _SAA_H #ifndef _SAA_H
#define _SAA_H #define _SAA_H
#include "../dispatch.h" #include "../dispatch.h"
#include "../macroInt.h"
#include <queue> #include <queue>
#include "../../../extern/SAASound/src/SAASound.h" #include "../../../extern/SAASound/src/SAASound.h"
class DivPlatformSAA1099: public DivDispatch { class DivPlatformSAA1099: public DivDispatch {
protected: protected:
struct Channel: public SharedChannelFreq, public SharedChannelVolume<int> { struct Channel: public SharedChannel<int> {
unsigned char freqH, freqL; unsigned char freqH, freqL;
unsigned char psgMode; unsigned char psgMode;
unsigned char pan; unsigned char pan;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<int>(15),
SharedChannelVolume<int>(15),
freqH(0), freqH(0),
freqL(0), freqL(0),
psgMode(1), psgMode(1),

View file

@ -22,24 +22,17 @@
#include "../dispatch.h" #include "../dispatch.h"
#include <queue> #include <queue>
#include "../macroInt.h"
#include "../waveSynth.h" #include "../waveSynth.h"
#include "vgsound_emu/src/scc/scc.hpp" #include "vgsound_emu/src/scc/scc.hpp"
class DivPlatformSCC: public DivDispatch { class DivPlatformSCC: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<signed char> { struct Channel: public SharedChannel<signed char> {
bool freqInit; bool freqInit;
signed short wave; signed short wave;
signed char waveROM[32] = {0}; // 8 bit signed waveform signed char waveROM[32] = {0}; // 8 bit signed waveform
DivMacroInt std;
DivWaveSynth ws; DivWaveSynth ws;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<signed char>(15),
SharedChannelVolume<signed char>(15),
freqInit(false), freqInit(false),
wave(-1) {} wave(-1) {}
}; };

View file

@ -19,15 +19,14 @@
#ifndef _SEGAPCM_H #ifndef _SEGAPCM_H
#define _SEGAPCM_H #define _SEGAPCM_H
#include "../dispatch.h" #include "../dispatch.h"
#include "../instrument.h" #include "../instrument.h"
#include <queue> #include <queue>
#include "../macroInt.h"
class DivPlatformSegaPCM: public DivDispatch { class DivPlatformSegaPCM: public DivDispatch {
protected: protected:
struct Channel: public SharedChannelFreq, public SharedChannelVolume<int> { struct Channel: public SharedChannel<int> {
DivMacroInt std;
bool furnacePCM, isNewSegaPCM; bool furnacePCM, isNewSegaPCM;
unsigned char chVolL, chVolR; unsigned char chVolL, chVolR;
unsigned char chPanL, chPanR; unsigned char chPanL, chPanR;
@ -40,13 +39,8 @@ class DivPlatformSegaPCM: public DivDispatch {
unsigned char freq; unsigned char freq;
PCMChannel(): sample(-1), pos(0), len(0), freq(0) {} PCMChannel(): sample(-1), pos(0), len(0), freq(0) {}
} pcm; } pcm;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<int>(127),
SharedChannelVolume<int>(127),
furnacePCM(false), furnacePCM(false),
isNewSegaPCM(false), isNewSegaPCM(false),
chVolL(127), chVolL(127),

View file

@ -21,7 +21,6 @@
#define _SMS_H #define _SMS_H
#include "../dispatch.h" #include "../dispatch.h"
#include "../macroInt.h"
#include "sound/sn76496.h" #include "sound/sn76496.h"
extern "C" { extern "C" {
#include "../../../extern/Nuked-PSG/ympsg.h" #include "../../../extern/Nuked-PSG/ympsg.h"
@ -29,17 +28,11 @@ extern "C" {
#include <queue> #include <queue>
class DivPlatformSMS: public DivDispatch { class DivPlatformSMS: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<signed char> { struct Channel: public SharedChannel<signed char> {
int actualNote; int actualNote;
bool writeVol; bool writeVol;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<signed char>(15),
SharedChannelVolume<signed char>(15),
actualNote(0), actualNote(0),
writeVol(false) {} writeVol(false) {}
}; };

View file

@ -21,28 +21,21 @@
#define _SNES_H #define _SNES_H
#include "../dispatch.h" #include "../dispatch.h"
#include "../macroInt.h"
#include "../waveSynth.h" #include "../waveSynth.h"
#include <queue> #include <queue>
#include "sound/snes/SPC_DSP.h" #include "sound/snes/SPC_DSP.h"
class DivPlatformSNES: public DivDispatch { class DivPlatformSNES: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<int> { struct Channel: public SharedChannel<int> {
unsigned int audPos; unsigned int audPos;
int sample, wave; int sample, wave;
int panL, panR; int panL, panR;
bool useWave, setPos, noise, echo, pitchMod, invertL, invertR, shallWriteVol, shallWriteEnv; bool useWave, setPos, noise, echo, pitchMod, invertL, invertR, shallWriteVol, shallWriteEnv;
int wtLen; int wtLen;
DivInstrumentSNES state; DivInstrumentSNES state;
DivMacroInt std;
DivWaveSynth ws; DivWaveSynth ws;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<int>(127),
SharedChannelVolume<int>(127),
audPos(0), audPos(0),
sample(-1), sample(-1),
wave(-1), wave(-1),

View file

@ -22,11 +22,10 @@
#include "../dispatch.h" #include "../dispatch.h"
#include <queue> #include <queue>
#include "../macroInt.h"
#include "sound/su.h" #include "sound/su.h"
class DivPlatformSoundUnit: public DivDispatch { class DivPlatformSoundUnit: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<signed char> { struct Channel: public SharedChannel<signed char> {
int cutoff, baseCutoff, res, control, hasOffset; int cutoff, baseCutoff, res, control, hasOffset;
signed char pan; signed char pan;
unsigned char duty; unsigned char duty;
@ -37,14 +36,8 @@ class DivPlatformSoundUnit: public DivDispatch {
unsigned char freqSweepV, volSweepV, cutSweepV; unsigned char freqSweepV, volSweepV, cutSweepV;
unsigned short syncTimer; unsigned short syncTimer;
signed short wave; signed short wave;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<signed char>(127),
SharedChannelVolume<signed char>(127),
cutoff(16383), cutoff(16383),
baseCutoff(16380), baseCutoff(16380),
res(0), res(0),

View file

@ -21,24 +21,17 @@
#define _SWAN_H #define _SWAN_H
#include "../dispatch.h" #include "../dispatch.h"
#include "../macroInt.h"
#include "../waveSynth.h" #include "../waveSynth.h"
#include "sound/swan.h" #include "sound/swan.h"
#include <queue> #include <queue>
class DivPlatformSwan: public DivDispatch { class DivPlatformSwan: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<int> { struct Channel: public SharedChannel<int> {
unsigned char pan; unsigned char pan;
int wave; int wave;
DivMacroInt std;
DivWaveSynth ws; DivWaveSynth ws;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<int>(15),
SharedChannelVolume<int>(15),
pan(255), pan(255),
wave(-1) {} wave(-1) {}
}; };

View file

@ -22,20 +22,13 @@
#include "../dispatch.h" #include "../dispatch.h"
#include <queue> #include <queue>
#include "../macroInt.h"
#include "sound/t6w28/T6W28_Apu.h" #include "sound/t6w28/T6W28_Apu.h"
class DivPlatformT6W28: public DivDispatch { class DivPlatformT6W28: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<signed char> { struct Channel: public SharedChannel<signed char> {
unsigned char panL, panR, duty; unsigned char panL, panR, duty;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<signed char>(15),
SharedChannelVolume<signed char>(15),
panL(15), panL(15),
panR(15), panR(15),
duty(7) {} duty(7) {}

View file

@ -19,23 +19,17 @@
#ifndef _TIA_H #ifndef _TIA_H
#define _TIA_H #define _TIA_H
#include "../dispatch.h" #include "../dispatch.h"
#include "../macroInt.h"
#include <queue> #include <queue>
#include "sound/tia/Audio.h" #include "sound/tia/Audio.h"
class DivPlatformTIA: public DivDispatch { class DivPlatformTIA: public DivDispatch {
protected: protected:
struct Channel: public SharedChannelFreq, public SharedChannelVolume<int> { struct Channel: public SharedChannel<int> {
unsigned char shape; unsigned char shape;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<int>(15),
SharedChannelVolume<int>(15),
shape(4) {} shape(4) {}
}; };
Channel chan[2]; Channel chan[2];

View file

@ -19,6 +19,7 @@
#ifndef _TX81Z_H #ifndef _TX81Z_H
#define _TX81Z_H #define _TX81Z_H
#include "fmshared_OPM.h" #include "fmshared_OPM.h"
#include <queue> #include <queue>
#include "sound/ymfm/ymfm_opz.h" #include "sound/ymfm/ymfm_opz.h"

View file

@ -22,24 +22,17 @@
#include "../dispatch.h" #include "../dispatch.h"
#include <queue> #include <queue>
#include "../macroInt.h"
#include "../waveSynth.h" #include "../waveSynth.h"
#include "sound/vsu.h" #include "sound/vsu.h"
class DivPlatformVB: public DivDispatch { class DivPlatformVB: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<signed char> { struct Channel: public SharedChannel<signed char> {
unsigned char pan, envLow, envHigh; unsigned char pan, envLow, envHigh;
bool noise, deferredWaveUpdate; bool noise, deferredWaveUpdate;
signed short wave; signed short wave;
DivMacroInt std;
DivWaveSynth ws; DivWaveSynth ws;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<signed char>(15),
SharedChannelVolume<signed char>(15),
pan(255), pan(255),
envLow(0), envLow(0),
envHigh(0), envHigh(0),

View file

@ -19,20 +19,19 @@
#ifndef _VERA_H #ifndef _VERA_H
#define _VERA_H #define _VERA_H
#include "../dispatch.h" #include "../dispatch.h"
#include "../instrument.h" #include "../instrument.h"
#include "../macroInt.h"
struct VERA_PSG; struct VERA_PSG;
struct VERA_PCM; struct VERA_PCM;
class DivPlatformVERA: public DivDispatch { class DivPlatformVERA: public DivDispatch {
protected: protected:
struct Channel: public SharedChannelFreq, public SharedChannelVolume<int> { struct Channel: public SharedChannel<int> {
unsigned char pan; unsigned char pan;
unsigned accum; unsigned accum;
int noiseval; int noiseval;
DivMacroInt std;
struct PCMChannel { struct PCMChannel {
int sample; int sample;
@ -42,14 +41,8 @@ class DivPlatformVERA: public DivDispatch {
bool depth16; bool depth16;
PCMChannel(): sample(-1), pos(0), len(0), freq(0), depth16(false) {} PCMChannel(): sample(-1), pos(0), len(0), freq(0), depth16(false) {}
} pcm; } pcm;
// somebody please split this into multiple lines!
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<int>(0),
SharedChannelVolume<int>(0),
pan(0), pan(0),
accum(0), accum(0),
noiseval(0), noiseval(0),

View file

@ -21,21 +21,14 @@
#define _VIC20_H #define _VIC20_H
#include "../dispatch.h" #include "../dispatch.h"
#include "../macroInt.h"
#include "sound/vic20sound.h" #include "sound/vic20sound.h"
#include <queue> #include <queue>
class DivPlatformVIC20: public DivDispatch { class DivPlatformVIC20: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<int> { struct Channel: public SharedChannel<int> {
int wave, waveWriteCycle; int wave, waveWriteCycle;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<int>(15),
SharedChannelVolume<int>(15),
wave(0), wave(0),
waveWriteCycle(-1) {} waveWriteCycle(-1) {}
}; };

View file

@ -22,25 +22,18 @@
#include <queue> #include <queue>
#include "../dispatch.h" #include "../dispatch.h"
#include "../macroInt.h"
#include "vgsound_emu/src/vrcvi/vrcvi.hpp" #include "vgsound_emu/src/vrcvi/vrcvi.hpp"
class DivPlatformVRC6: public DivDispatch, public vrcvi_intf { class DivPlatformVRC6: public DivDispatch, public vrcvi_intf {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<signed char> { struct Channel: public SharedChannel<signed char> {
int dacPeriod, dacRate, dacOut; int dacPeriod, dacRate, dacOut;
unsigned int dacPos; unsigned int dacPos;
int dacSample; int dacSample;
unsigned char duty; unsigned char duty;
bool pcm, furnaceDac; bool pcm, furnaceDac;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<signed char>(15),
SharedChannelVolume<signed char>(15),
dacPeriod(0), dacPeriod(0),
dacRate(0), dacRate(0),
dacOut(0), dacOut(0),

View file

@ -22,12 +22,11 @@
#include "../dispatch.h" #include "../dispatch.h"
#include "../engine.h" #include "../engine.h"
#include "../macroInt.h"
#include "../waveSynth.h" #include "../waveSynth.h"
#include "vgsound_emu/src/x1_010/x1_010.hpp" #include "vgsound_emu/src/x1_010/x1_010.hpp"
class DivPlatformX1_010: public DivDispatch, public vgsound_emu_mem_intf { class DivPlatformX1_010: public DivDispatch, public vgsound_emu_mem_intf {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<int> { struct Channel: public SharedChannel<int> {
struct Envelope { struct Envelope {
struct EnvFlag { struct EnvFlag {
unsigned char envEnable : 1; unsigned char envEnable : 1;
@ -77,7 +76,6 @@ class DivPlatformX1_010: public DivDispatch, public vgsound_emu_mem_intf {
unsigned char waveBank; unsigned char waveBank;
unsigned int bankSlot; unsigned int bankSlot;
Envelope env; Envelope env;
DivMacroInt std;
DivWaveSynth ws; DivWaveSynth ws;
void reset() { void reset() {
freq=baseFreq=pitch=pitch2=note=0; freq=baseFreq=pitch=pitch2=note=0;
@ -90,13 +88,8 @@ class DivPlatformX1_010: public DivDispatch, public vgsound_emu_mem_intf {
vol=outVol=lvol=rvol=15; vol=outVol=lvol=rvol=15;
waveBank=0; waveBank=0;
} }
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<int>(15),
SharedChannelVolume<int>(15),
fixedFreq(0), fixedFreq(0),
wave(-1), wave(-1),
sample(-1), sample(-1),

View file

@ -19,6 +19,7 @@
#ifndef _YM2203_H #ifndef _YM2203_H
#define _YM2203_H #define _YM2203_H
#include "fmshared_OPN.h" #include "fmshared_OPN.h"
#include "sound/ymfm/ymfm_opn.h" #include "sound/ymfm/ymfm_opn.h"

View file

@ -17,6 +17,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#ifndef _YM2203EXT_H
#define _YM2203EXT_H
#include "../dispatch.h" #include "../dispatch.h"
#include "ym2203.h" #include "ym2203.h"
@ -40,3 +43,5 @@ class DivPlatformYM2203Ext: public DivPlatformYM2203 {
void quit(); void quit();
~DivPlatformYM2203Ext(); ~DivPlatformYM2203Ext();
}; };
#endif

View file

@ -19,6 +19,7 @@
#ifndef _YM2608_H #ifndef _YM2608_H
#define _YM2608_H #define _YM2608_H
#include "fmshared_OPN.h" #include "fmshared_OPN.h"
#include "sound/ymfm/ymfm_opn.h" #include "sound/ymfm/ymfm_opn.h"

View file

@ -17,6 +17,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#ifndef _YM2608EXT_H
#define _YM2608EXT_H
#include "../dispatch.h" #include "../dispatch.h"
#include "ym2608.h" #include "ym2608.h"
@ -40,3 +43,5 @@ class DivPlatformYM2608Ext: public DivPlatformYM2608 {
void quit(); void quit();
~DivPlatformYM2608Ext(); ~DivPlatformYM2608Ext();
}; };
#endif

View file

@ -19,6 +19,7 @@
#ifndef _YM2610_H #ifndef _YM2610_H
#define _YM2610_H #define _YM2610_H
#include "ym2610shared.h" #include "ym2610shared.h"
class DivPlatformYM2610: public DivPlatformYM2610Base<14> { class DivPlatformYM2610: public DivPlatformYM2610Base<14> {

View file

@ -19,6 +19,7 @@
#ifndef _YM2610B_H #ifndef _YM2610B_H
#define _YM2610B_H #define _YM2610B_H
#include "ym2610shared.h" #include "ym2610shared.h"
class DivPlatformYM2610B: public DivPlatformYM2610Base<16> { class DivPlatformYM2610B: public DivPlatformYM2610Base<16> {

View file

@ -17,6 +17,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#ifndef _YM2610BEXT_H
#define _YM2610BEXT_H
#include "../dispatch.h" #include "../dispatch.h"
#include "ym2610b.h" #include "ym2610b.h"
@ -40,3 +43,5 @@ class DivPlatformYM2610BExt: public DivPlatformYM2610B {
void quit(); void quit();
~DivPlatformYM2610BExt(); ~DivPlatformYM2610BExt();
}; };
#endif

View file

@ -17,6 +17,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#ifndef _YM2610EXT_H
#define _YM2610EXT_H
#include "../dispatch.h" #include "../dispatch.h"
#include "ym2610.h" #include "ym2610.h"
@ -40,3 +43,5 @@ class DivPlatformYM2610Ext: public DivPlatformYM2610 {
void quit(); void quit();
~DivPlatformYM2610Ext(); ~DivPlatformYM2610Ext();
}; };
#endif

View file

@ -19,6 +19,7 @@
#ifndef _YM2610SHARED_H #ifndef _YM2610SHARED_H
#define _YM2610SHARED_H #define _YM2610SHARED_H
#include "fmshared_OPN.h" #include "fmshared_OPN.h"
#include "../engine.h" #include "../engine.h"
#include "../../ta-log.h" #include "../../ta-log.h"

View file

@ -22,24 +22,17 @@
#include "../dispatch.h" #include "../dispatch.h"
#include <queue> #include <queue>
#include "../macroInt.h"
#include "sound/ymz280b.h" #include "sound/ymz280b.h"
class DivPlatformYMZ280B: public DivDispatch { class DivPlatformYMZ280B: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<int> { struct Channel: public SharedChannel<int> {
unsigned int audPos; unsigned int audPos;
int sample, wave; int sample, wave;
int panning; int panning;
bool setPos, isNewYMZ; bool setPos, isNewYMZ;
int macroVolMul; int macroVolMul;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<int>(255),
SharedChannelVolume<int>(255),
audPos(0), audPos(0),
sample(-1), sample(-1),
panning(8), panning(8),

View file

@ -22,20 +22,13 @@
#include "../dispatch.h" #include "../dispatch.h"
#include <queue> #include <queue>
#include "../macroInt.h"
class DivPlatformZXBeeper: public DivDispatch { class DivPlatformZXBeeper: public DivDispatch {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<signed char> { struct Channel: public SharedChannel<signed char> {
unsigned short sPosition; unsigned short sPosition;
unsigned char duty; unsigned char duty;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel(): Channel():
SharedChannelFreq(), SharedChannel<signed char>(1),
SharedChannelVolume<signed char>(1),
sPosition(0), sPosition(0),
duty(64) {} duty(64) {}
}; };

View file

@ -124,14 +124,30 @@
ImGui::TextColored(sms->nuked?colorOn:colorOff,">> Nuked"); ImGui::TextColored(sms->nuked?colorOn:colorOff,">> Nuked");
#define GENESIS_CHAN_DEBUG \ #define COMMON_CHAN_DEBUG \
DivPlatformGenesis::Channel* ch=(DivPlatformGenesis::Channel*)data; \
ImGui::Text("> YM2612"); \
ImGui::Text("- freqHL: %.2x%.2x",ch->freqH,ch->freqL); \
ImGui::Text("* freq: %d",ch->freq); \ ImGui::Text("* freq: %d",ch->freq); \
ImGui::Text(" - base: %d",ch->baseFreq); \ ImGui::Text(" - base: %d",ch->baseFreq); \
ImGui::Text(" - pitch: %d",ch->pitch); \ ImGui::Text(" - pitch: %d",ch->pitch); \
ImGui::Text(" - pitch2: %d",ch->pitch2); \ ImGui::Text(" - pitch2: %d",ch->pitch2); \
ImGui::Text("- note: %d",ch->note); \
ImGui::Text("- ins: %d",ch->ins); \
ImGui::Text("- vol: %.2x",ch->vol); \
ImGui::Text("- outVol: %.2x",ch->outVol);
#define COMMON_CHAN_DEBUG_BOOL \
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active"); \
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged"); \
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged"); \
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn"); \
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff"); \
ImGui::TextColored(ch->portaPause?colorOn:colorOff,">> PortaPause"); \
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta");
#define GENESIS_CHAN_DEBUG \
DivPlatformGenesis::Channel* ch=(DivPlatformGenesis::Channel*)data; \
ImGui::Text("> YM2612"); \
ImGui::Text("- freqHL: %.2x%.2x",ch->freqH,ch->freqL); \
COMMON_CHAN_DEBUG; \
ImGui::Text("- portaPauseFreq: %d",ch->portaPauseFreq); \ ImGui::Text("- portaPauseFreq: %d",ch->portaPauseFreq); \
ImGui::Text("* DAC:"); \ ImGui::Text("* DAC:"); \
ImGui::Text(" - period: %d",ch->dacPeriod); \ ImGui::Text(" - period: %d",ch->dacPeriod); \
@ -140,21 +156,11 @@
ImGui::Text(" - sample: %d",ch->dacSample); \ ImGui::Text(" - sample: %d",ch->dacSample); \
ImGui::Text(" - delay: %d",ch->dacDelay); \ ImGui::Text(" - delay: %d",ch->dacDelay); \
ImGui::Text(" - output: %d",ch->dacOutput); \ ImGui::Text(" - output: %d",ch->dacOutput); \
ImGui::Text("- note: %d",ch->note); \
ImGui::Text("- ins: %d",ch->ins); \
ImGui::Text("- vol: %.2x",ch->vol); \
ImGui::Text("- outVol: %.2x",ch->outVol); \
ImGui::Text("- pan: %x",ch->pan); \ ImGui::Text("- pan: %x",ch->pan); \
ImGui::Text("- opMask: %x",ch->opMask); \ ImGui::Text("- opMask: %x",ch->opMask); \
ImGui::Text("- sampleBank: %d",ch->sampleBank); \ ImGui::Text("- sampleBank: %d",ch->sampleBank); \
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active"); \ COMMON_CHAN_DEBUG_BOOL; \
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged"); \
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged"); \
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn"); \
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff"); \
ImGui::TextColored(ch->portaPause?colorOn:colorOff,">> PortaPause"); \
ImGui::TextColored(ch->furnaceDac?colorOn:colorOff,">> FurnaceDAC"); \ ImGui::TextColored(ch->furnaceDac?colorOn:colorOff,">> FurnaceDAC"); \
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta"); \
ImGui::TextColored(ch->hardReset?colorOn:colorOff,">> hardReset"); \ ImGui::TextColored(ch->hardReset?colorOn:colorOff,">> hardReset"); \
ImGui::TextColored(ch->opMaskChanged?colorOn:colorOff,">> opMaskChanged"); \ ImGui::TextColored(ch->opMaskChanged?colorOn:colorOff,">> opMaskChanged"); \
ImGui::TextColored(ch->dacMode?colorOn:colorOff,">> DACMode"); \ ImGui::TextColored(ch->dacMode?colorOn:colorOff,">> DACMode"); \
@ -165,67 +171,31 @@
DivPlatformOPN::OPNOpChannelStereo* ch=(DivPlatformOPN::OPNOpChannelStereo*)data; \ DivPlatformOPN::OPNOpChannelStereo* ch=(DivPlatformOPN::OPNOpChannelStereo*)data; \
ImGui::Text("> YM2612 (per operator)"); \ ImGui::Text("> YM2612 (per operator)"); \
ImGui::Text("- freqHL: %.2x%.2x",ch->freqH,ch->freqL); \ ImGui::Text("- freqHL: %.2x%.2x",ch->freqH,ch->freqL); \
ImGui::Text("* freq: %d",ch->freq); \ COMMON_CHAN_DEBUG; \
ImGui::Text(" - base: %d",ch->baseFreq); \
ImGui::Text(" - pitch: %d",ch->pitch); \
ImGui::Text(" - pitch2: %d",ch->pitch2); \
ImGui::Text("- portaPauseFreq: %d",ch->portaPauseFreq); \ ImGui::Text("- portaPauseFreq: %d",ch->portaPauseFreq); \
ImGui::Text("- ins: %d",ch->ins); \
ImGui::Text("- vol: %.2x",ch->vol); \
ImGui::Text("- outVol: %.2x",ch->outVol); \
ImGui::Text("- pan: %x",ch->pan); \ ImGui::Text("- pan: %x",ch->pan); \
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active"); \ COMMON_CHAN_DEBUG_BOOL; \
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged"); \
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged"); \
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn"); \
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff"); \
ImGui::TextColored(ch->portaPause?colorOn:colorOff,">> PortaPause"); \
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta"); \
ImGui::TextColored(ch->mask?colorOn:colorOff,">> Mask"); ImGui::TextColored(ch->mask?colorOn:colorOff,">> Mask");
#define SMS_CHAN_DEBUG \ #define SMS_CHAN_DEBUG \
DivPlatformSMS::Channel* ch=(DivPlatformSMS::Channel*)data; \ DivPlatformSMS::Channel* ch=(DivPlatformSMS::Channel*)data; \
ImGui::Text("> SMS"); \ ImGui::Text("> SMS"); \
ImGui::Text("* freq: %d",ch->freq); \ COMMON_CHAN_DEBUG; \
ImGui::Text(" - base: %d",ch->baseFreq); \ COMMON_CHAN_DEBUG_BOOL;
ImGui::Text(" - pitch: %d",ch->pitch); \
ImGui::Text(" - pitch2: %d",ch->pitch2); \
ImGui::Text("- note: %d",ch->note); \
ImGui::Text("- ins: %d",ch->ins); \
ImGui::Text("- vol: %.2x",ch->vol); \
ImGui::Text("- outVol: %.2x",ch->outVol); \
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active"); \
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged"); \
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged"); \
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn"); \
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff");
#define OPN_CHAN_DEBUG \ #define OPN_CHAN_DEBUG \
DivPlatformOPN::OPNChannel* ch=(DivPlatformOPN::OPNChannel*)data; \ DivPlatformOPN::OPNChannel* ch=(DivPlatformOPN::OPNChannel*)data; \
ImGui::Text("> YM2203"); \ ImGui::Text("> YM2203"); \
ImGui::Text("- freqHL: %.2x%.2x",ch->freqH,ch->freqL); \ ImGui::Text("- freqHL: %.2x%.2x",ch->freqH,ch->freqL); \
ImGui::Text("* freq: %d",ch->freq); \ COMMON_CHAN_DEBUG; \
ImGui::Text(" - base: %d",ch->baseFreq); \
ImGui::Text(" - pitch: %d",ch->pitch); \
ImGui::Text(" - pitch2: %d",ch->pitch2); \
ImGui::Text("- portaPauseFreq: %d",ch->portaPauseFreq); \ ImGui::Text("- portaPauseFreq: %d",ch->portaPauseFreq); \
ImGui::Text("* PSG:"); \ ImGui::Text("* PSG:"); \
ImGui::Text(" - psgMode: %d",ch->psgMode); \ ImGui::Text(" - psgMode: %d",ch->psgMode); \
ImGui::Text(" - autoEnvNum: %d",ch->autoEnvNum); \ ImGui::Text(" - autoEnvNum: %d",ch->autoEnvNum); \
ImGui::Text(" - autoEnvDen: %d",ch->autoEnvDen); \ ImGui::Text(" - autoEnvDen: %d",ch->autoEnvDen); \
ImGui::Text("- sample: %d",ch->sample); \ ImGui::Text("- sample: %d",ch->sample); \
ImGui::Text("- note: %d",ch->note); \
ImGui::Text("- ins: %d",ch->ins); \
ImGui::Text("- vol: %.2x",ch->vol); \
ImGui::Text("- outVol: %.2x",ch->outVol); \
ImGui::Text("- opMask: %x",ch->opMask); \ ImGui::Text("- opMask: %x",ch->opMask); \
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active"); \ COMMON_CHAN_DEBUG_BOOL; \
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged"); \
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged"); \
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn"); \
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff"); \
ImGui::TextColored(ch->portaPause?colorOn:colorOff,">> PortaPause"); \
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta"); \
ImGui::TextColored(ch->hardReset?colorOn:colorOff,">> hardReset"); \ ImGui::TextColored(ch->hardReset?colorOn:colorOff,">> hardReset"); \
ImGui::TextColored(ch->opMaskChanged?colorOn:colorOff,">> opMaskChanged"); \ ImGui::TextColored(ch->opMaskChanged?colorOn:colorOff,">> opMaskChanged"); \
ImGui::TextColored(ch->furnacePCM?colorOn:colorOff,">> FurnacePCM"); ImGui::TextColored(ch->furnacePCM?colorOn:colorOff,">> FurnacePCM");
@ -234,71 +204,34 @@
DivPlatformOPN::OPNOpChannel* ch=(DivPlatformOPN::OPNOpChannel*)data; \ DivPlatformOPN::OPNOpChannel* ch=(DivPlatformOPN::OPNOpChannel*)data; \
ImGui::Text("> YM2203 (per operator)"); \ ImGui::Text("> YM2203 (per operator)"); \
ImGui::Text("- freqHL: %.2x%.2x",ch->freqH,ch->freqL); \ ImGui::Text("- freqHL: %.2x%.2x",ch->freqH,ch->freqL); \
ImGui::Text("* freq: %d",ch->freq); \ COMMON_CHAN_DEBUG; \
ImGui::Text(" - base: %d",ch->baseFreq); \
ImGui::Text(" - pitch: %d",ch->pitch); \
ImGui::Text(" - pitch2: %d",ch->pitch2); \
ImGui::Text("- portaPauseFreq: %d",ch->portaPauseFreq); \ ImGui::Text("- portaPauseFreq: %d",ch->portaPauseFreq); \
ImGui::Text("- ins: %d",ch->ins); \ COMMON_CHAN_DEBUG_BOOL; \
ImGui::Text("- vol: %.2x",ch->vol); \
ImGui::Text("- outVol: %.2x",ch->outVol); \
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active"); \
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged"); \
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged"); \
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn"); \
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff"); \
ImGui::TextColored(ch->portaPause?colorOn:colorOff,">> PortaPause"); \
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta"); \
ImGui::TextColored(ch->mask?colorOn:colorOff,">> Mask"); ImGui::TextColored(ch->mask?colorOn:colorOff,">> Mask");
#define OPNB_CHAN_DEBUG \ #define OPNB_CHAN_DEBUG \
ImGui::Text("- freqHL: %.2x%.2x",ch->freqH,ch->freqL); \ ImGui::Text("- freqHL: %.2x%.2x",ch->freqH,ch->freqL); \
ImGui::Text("* freq: %d",ch->freq); \ COMMON_CHAN_DEBUG; \
ImGui::Text(" - base: %d",ch->baseFreq); \
ImGui::Text(" - pitch: %d",ch->pitch); \
ImGui::Text(" - pitch2: %d",ch->pitch2); \
ImGui::Text("- portaPauseFreq: %d",ch->portaPauseFreq); \ ImGui::Text("- portaPauseFreq: %d",ch->portaPauseFreq); \
ImGui::Text("* PSG:"); \ ImGui::Text("* PSG:"); \
ImGui::Text(" - psgMode: %d",ch->psgMode); \ ImGui::Text(" - psgMode: %d",ch->psgMode); \
ImGui::Text(" - autoEnvNum: %d",ch->autoEnvNum); \ ImGui::Text(" - autoEnvNum: %d",ch->autoEnvNum); \
ImGui::Text(" - autoEnvDen: %d",ch->autoEnvDen); \ ImGui::Text(" - autoEnvDen: %d",ch->autoEnvDen); \
ImGui::Text("- sample: %d",ch->sample); \ ImGui::Text("- sample: %d",ch->sample); \
ImGui::Text("- note: %d",ch->note); \
ImGui::Text("- ins: %d",ch->ins); \
ImGui::Text("- vol: %.2x",ch->vol); \
ImGui::Text("- outVol: %.2x",ch->outVol); \
ImGui::Text("- pan: %x",ch->pan); \ ImGui::Text("- pan: %x",ch->pan); \
ImGui::Text("- opMask: %x",ch->opMask); \ ImGui::Text("- opMask: %x",ch->opMask); \
ImGui::Text("- macroVolMul: %x",ch->macroVolMul); \ ImGui::Text("- macroVolMul: %x",ch->macroVolMul); \
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active"); \ COMMON_CHAN_DEBUG_BOOL; \
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged"); \
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged"); \
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn"); \
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff"); \
ImGui::TextColored(ch->portaPause?colorOn:colorOff,">> PortaPause"); \
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta"); \
ImGui::TextColored(ch->hardReset?colorOn:colorOff,">> hardReset"); \ ImGui::TextColored(ch->hardReset?colorOn:colorOff,">> hardReset"); \
ImGui::TextColored(ch->opMaskChanged?colorOn:colorOff,">> opMaskChanged"); \ ImGui::TextColored(ch->opMaskChanged?colorOn:colorOff,">> opMaskChanged"); \
ImGui::TextColored(ch->furnacePCM?colorOn:colorOff,">> FurnacePCM"); ImGui::TextColored(ch->furnacePCM?colorOn:colorOff,">> FurnacePCM");
#define OPNB_OPCHAN_DEBUG \ #define OPNB_OPCHAN_DEBUG \
ImGui::Text("- freqHL: %.2x%.2x",ch->freqH,ch->freqL); \ ImGui::Text("- freqHL: %.2x%.2x",ch->freqH,ch->freqL); \
ImGui::Text("* freq: %d",ch->freq); \ COMMON_CHAN_DEBUG; \
ImGui::Text(" - base: %d",ch->baseFreq); \
ImGui::Text(" - pitch: %d",ch->pitch); \
ImGui::Text(" - pitch2: %d",ch->pitch2); \
ImGui::Text("- portaPauseFreq: %d",ch->portaPauseFreq); \ ImGui::Text("- portaPauseFreq: %d",ch->portaPauseFreq); \
ImGui::Text("- ins: %d",ch->ins); \
ImGui::Text("- vol: %.2x",ch->vol); \
ImGui::Text("- outVol: %.2x",ch->outVol); \
ImGui::Text("- pan: %x",ch->pan); \ ImGui::Text("- pan: %x",ch->pan); \
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active"); \ COMMON_CHAN_DEBUG_BOOL; \
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged"); \
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged"); \
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn"); \
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff"); \
ImGui::TextColored(ch->portaPause?colorOn:colorOff,">> PortaPause"); \
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta"); \
ImGui::TextColored(ch->mask?colorOn:colorOff,">> Mask"); ImGui::TextColored(ch->mask?colorOn:colorOff,">> Mask");
void putDispatchChip(void* data, int type) { void putDispatchChip(void* data, int type) {
@ -696,52 +629,28 @@ void putDispatchChan(void* data, int chanNum, int type) {
case DIV_SYSTEM_GB: { case DIV_SYSTEM_GB: {
DivPlatformGB::Channel* ch=(DivPlatformGB::Channel*)data; DivPlatformGB::Channel* ch=(DivPlatformGB::Channel*)data;
ImGui::Text("> GameBoy"); ImGui::Text("> GameBoy");
ImGui::Text("* freq: %d",ch->freq); COMMON_CHAN_DEBUG;
ImGui::Text(" - base: %d",ch->baseFreq);
ImGui::Text(" - pitch: %d",ch->pitch);
ImGui::Text(" - pitch2: %d",ch->pitch2);
ImGui::Text("- note: %d",ch->note);
ImGui::Text("- ins: %d",ch->ins);
ImGui::Text("- duty: %d",ch->duty); ImGui::Text("- duty: %d",ch->duty);
ImGui::Text("- sweep: %.2x",ch->sweep); ImGui::Text("- sweep: %.2x",ch->sweep);
ImGui::Text("- vol: %.2x",ch->vol);
ImGui::Text("- outVol: %.2x",ch->outVol);
ImGui::Text("- wave: %d",ch->wave); ImGui::Text("- wave: %d",ch->wave);
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active"); COMMON_CHAN_DEBUG_BOOL;
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged");
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged");
ImGui::TextColored(ch->sweepChanged?colorOn:colorOff,">> SweepChanged"); ImGui::TextColored(ch->sweepChanged?colorOn:colorOff,">> SweepChanged");
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn");
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff");
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta");
break; break;
} }
case DIV_SYSTEM_PCE: { case DIV_SYSTEM_PCE: {
DivPlatformPCE::Channel* ch=(DivPlatformPCE::Channel*)data; DivPlatformPCE::Channel* ch=(DivPlatformPCE::Channel*)data;
ImGui::Text("> PCEngine"); ImGui::Text("> PCEngine");
ImGui::Text("* freq: %d",ch->freq); COMMON_CHAN_DEBUG;
ImGui::Text(" - base: %d",ch->baseFreq);
ImGui::Text(" - pitch: %d",ch->pitch);
ImGui::Text(" - pitch2: %d",ch->pitch2);
ImGui::Text("- note: %d",ch->note);
ImGui::Text("* DAC:"); ImGui::Text("* DAC:");
ImGui::Text(" - period: %d",ch->dacPeriod); ImGui::Text(" - period: %d",ch->dacPeriod);
ImGui::Text(" - rate: %d",ch->dacRate); ImGui::Text(" - rate: %d",ch->dacRate);
ImGui::Text(" - pos: %d",ch->dacPos); ImGui::Text(" - pos: %d",ch->dacPos);
ImGui::Text(" - out: %d",ch->dacOut); ImGui::Text(" - out: %d",ch->dacOut);
ImGui::Text(" - sample: %d",ch->dacSample); ImGui::Text(" - sample: %d",ch->dacSample);
ImGui::Text("- ins: %d",ch->ins);
ImGui::Text("- pan: %.2x",ch->pan); ImGui::Text("- pan: %.2x",ch->pan);
ImGui::Text("- vol: %.2x",ch->vol);
ImGui::Text("- outVol: %.2x",ch->outVol);
ImGui::Text("- wave: %d",ch->wave); ImGui::Text("- wave: %d",ch->wave);
ImGui::Text("- macroVolMul: %d",ch->macroVolMul); ImGui::Text("- macroVolMul: %d",ch->macroVolMul);
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active"); COMMON_CHAN_DEBUG_BOOL;
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged");
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged");
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn");
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff");
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta");
ImGui::TextColored(ch->noise?colorOn:colorOff,">> Noise"); ImGui::TextColored(ch->noise?colorOn:colorOff,">> Noise");
ImGui::TextColored(ch->pcm?colorOn:colorOff,">> DAC"); ImGui::TextColored(ch->pcm?colorOn:colorOff,">> DAC");
ImGui::TextColored(ch->furnaceDac?colorOn:colorOff,">> FurnaceDAC"); ImGui::TextColored(ch->furnaceDac?colorOn:colorOff,">> FurnaceDAC");
@ -750,52 +659,27 @@ void putDispatchChan(void* data, int chanNum, int type) {
case DIV_SYSTEM_NES: { case DIV_SYSTEM_NES: {
DivPlatformNES::Channel* ch=(DivPlatformNES::Channel*)data; DivPlatformNES::Channel* ch=(DivPlatformNES::Channel*)data;
ImGui::Text("> NES"); ImGui::Text("> NES");
ImGui::Text("* freq: %d",ch->freq); COMMON_CHAN_DEBUG;
ImGui::Text(" - base: %d",ch->baseFreq);
ImGui::Text(" - pitch: %d",ch->pitch);
ImGui::Text(" - pitch2: %d",ch->pitch2);
ImGui::Text(" - prev: %d",ch->prevFreq); ImGui::Text(" - prev: %d",ch->prevFreq);
ImGui::Text("- note: %d",ch->note);
ImGui::Text("- ins: %d",ch->ins);
ImGui::Text("- duty: %d",ch->duty); ImGui::Text("- duty: %d",ch->duty);
ImGui::Text("- sweep: %.2x",ch->sweep); ImGui::Text("- sweep: %.2x",ch->sweep);
ImGui::Text("- vol: %.2x",ch->vol); COMMON_CHAN_DEBUG_BOOL;
ImGui::Text("- outVol: %.2x",ch->outVol);
ImGui::Text("- wave: %d",ch->wave);
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active");
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged");
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged");
ImGui::TextColored(ch->sweepChanged?colorOn:colorOff,">> SweepChanged"); ImGui::TextColored(ch->sweepChanged?colorOn:colorOff,">> SweepChanged");
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn");
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff");
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta");
ImGui::TextColored(ch->furnaceDac?colorOn:colorOff,">> FurnaceDAC"); ImGui::TextColored(ch->furnaceDac?colorOn:colorOff,">> FurnaceDAC");
break; break;
} }
case DIV_SYSTEM_C64_6581: case DIV_SYSTEM_C64_8580: { case DIV_SYSTEM_C64_6581: case DIV_SYSTEM_C64_8580: {
DivPlatformC64::Channel* ch=(DivPlatformC64::Channel*)data; DivPlatformC64::Channel* ch=(DivPlatformC64::Channel*)data;
ImGui::Text("> C64"); ImGui::Text("> C64");
ImGui::Text("* freq: %d",ch->freq); COMMON_CHAN_DEBUG;
ImGui::Text(" - base: %d",ch->baseFreq); ImGui::Text("- prevFreq: %d",ch->prevFreq);
ImGui::Text(" - pitch: %d",ch->pitch);
ImGui::Text(" - pitch2: %d",ch->pitch2);
ImGui::Text(" - prev: %d",ch->prevFreq);
ImGui::Text("- testWhen: %d",ch->testWhen); ImGui::Text("- testWhen: %d",ch->testWhen);
ImGui::Text("- note: %d",ch->note);
ImGui::Text("- ins: %d",ch->ins);
ImGui::Text("- duty: %d",ch->duty); ImGui::Text("- duty: %d",ch->duty);
ImGui::Text("- sweep: %.2x",ch->sweep); ImGui::Text("- sweep: %.2x",ch->sweep);
ImGui::Text("- wave: %.1x",ch->wave); ImGui::Text("- wave: %.1x",ch->wave);
ImGui::Text("- ADSR: %.1x %.1x %.1x %.1x",ch->attack,ch->decay,ch->sustain,ch->release); ImGui::Text("- ADSR: %.1x %.1x %.1x %.1x",ch->attack,ch->decay,ch->sustain,ch->release);
ImGui::Text("- vol: %.2x",ch->vol); COMMON_CHAN_DEBUG_BOOL;
ImGui::Text("- outVol: %.2x",ch->outVol);
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active");
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged");
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged");
ImGui::TextColored(ch->sweepChanged?colorOn:colorOff,">> SweepChanged"); ImGui::TextColored(ch->sweepChanged?colorOn:colorOff,">> SweepChanged");
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn");
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff");
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta");
ImGui::TextColored(ch->filter?colorOn:colorOff,">> Filter"); ImGui::TextColored(ch->filter?colorOn:colorOff,">> Filter");
ImGui::TextColored(ch->resetMask?colorOn:colorOff,">> ResetMask"); ImGui::TextColored(ch->resetMask?colorOn:colorOff,">> ResetMask");
ImGui::TextColored(ch->resetFilter?colorOn:colorOff,">> ResetFilter"); ImGui::TextColored(ch->resetFilter?colorOn:colorOff,">> ResetFilter");
@ -809,68 +693,37 @@ void putDispatchChan(void* data, int chanNum, int type) {
DivPlatformArcade::Channel* ch=(DivPlatformArcade::Channel*)data; DivPlatformArcade::Channel* ch=(DivPlatformArcade::Channel*)data;
ImGui::Text("> YM2151"); ImGui::Text("> YM2151");
ImGui::Text("- freqHL: %.2x%.2x",ch->freqH,ch->freqL); ImGui::Text("- freqHL: %.2x%.2x",ch->freqH,ch->freqL);
ImGui::Text("* freq: %d",ch->freq); COMMON_CHAN_DEBUG;
ImGui::Text(" - base: %d",ch->baseFreq);
ImGui::Text(" - pitch: %d",ch->pitch);
ImGui::Text(" - pitch2: %d",ch->pitch2);
ImGui::Text("- note: %d",ch->note);
ImGui::Text("- ins: %d",ch->ins);
ImGui::Text("- KOnCycles: %d",ch->konCycles); ImGui::Text("- KOnCycles: %d",ch->konCycles);
ImGui::Text("- vol: %.2x",ch->vol);
ImGui::Text("- outVol: %.2x",ch->outVol);
ImGui::Text("- chVolL: %.2x",ch->chVolL); ImGui::Text("- chVolL: %.2x",ch->chVolL);
ImGui::Text("- chVolR: %.2x",ch->chVolR); ImGui::Text("- chVolR: %.2x",ch->chVolR);
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active"); COMMON_CHAN_DEBUG_BOOL;
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged");
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged");
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn");
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff");
ImGui::TextColored(ch->portaPause?colorOn:colorOff,">> PortaPause");
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta");
break; break;
} }
case DIV_SYSTEM_SEGAPCM: case DIV_SYSTEM_SEGAPCM:
case DIV_SYSTEM_SEGAPCM_COMPAT: { case DIV_SYSTEM_SEGAPCM_COMPAT: {
DivPlatformSegaPCM::Channel* ch=(DivPlatformSegaPCM::Channel*)data; DivPlatformSegaPCM::Channel* ch=(DivPlatformSegaPCM::Channel*)data;
ImGui::Text("> SegaPCM"); ImGui::Text("> SegaPCM");
ImGui::Text("* freq: %d",ch->freq); COMMON_CHAN_DEBUG;
ImGui::Text(" - base: %d",ch->baseFreq);
ImGui::Text(" - pitch: %d",ch->pitch);
ImGui::Text(" - pitch2: %d",ch->pitch2);
ImGui::Text("- note: %d",ch->note);
ImGui::Text("- ins: %d",ch->ins);
ImGui::Text("* PCM:"); ImGui::Text("* PCM:");
ImGui::Text(" - sample: %d",ch->pcm.sample); ImGui::Text(" - sample: %d",ch->pcm.sample);
ImGui::Text(" - pos: %d",ch->pcm.pos); ImGui::Text(" - pos: %d",ch->pcm.pos);
ImGui::Text(" - len: %d",ch->pcm.len); ImGui::Text(" - len: %d",ch->pcm.len);
ImGui::Text(" - freq: %d",ch->pcm.freq); ImGui::Text(" - freq: %d",ch->pcm.freq);
ImGui::Text("- vol: %.2x",ch->vol);
ImGui::Text("- outVol: %.2x",ch->outVol);
ImGui::Text("- chVolL: %.2x",ch->chVolL); ImGui::Text("- chVolL: %.2x",ch->chVolL);
ImGui::Text("- chVolR: %.2x",ch->chVolR); ImGui::Text("- chVolR: %.2x",ch->chVolR);
ImGui::Text("- chPanL: %.2x",ch->chPanL); ImGui::Text("- chPanL: %.2x",ch->chPanL);
ImGui::Text("- chPanR: %.2x",ch->chPanR); ImGui::Text("- chPanR: %.2x",ch->chPanR);
ImGui::Text("- macroVolMul: %.2x",ch->macroVolMul); ImGui::Text("- macroVolMul: %.2x",ch->macroVolMul);
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active"); COMMON_CHAN_DEBUG_BOOL;
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged");
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged");
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn");
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff");
ImGui::TextColored(ch->portaPause?colorOn:colorOff,">> PortaPause");
ImGui::TextColored(ch->furnacePCM?colorOn:colorOff,">> FurnacePCM"); ImGui::TextColored(ch->furnacePCM?colorOn:colorOff,">> FurnacePCM");
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta");
ImGui::TextColored(ch->isNewSegaPCM?colorOn:colorOff,">> IsNewSegaPCM"); ImGui::TextColored(ch->isNewSegaPCM?colorOn:colorOff,">> IsNewSegaPCM");
break; break;
} }
case DIV_SYSTEM_AY8910: { case DIV_SYSTEM_AY8910: {
DivPlatformAY8910::Channel* ch=(DivPlatformAY8910::Channel*)data; DivPlatformAY8910::Channel* ch=(DivPlatformAY8910::Channel*)data;
ImGui::Text("> AY-3-8910"); ImGui::Text("> AY-3-8910");
ImGui::Text("* freq: %d",ch->freq); COMMON_CHAN_DEBUG;
ImGui::Text(" - base: %d",ch->baseFreq);
ImGui::Text(" - pitch: %d",ch->pitch);
ImGui::Text(" - pitch2: %d",ch->pitch2);
ImGui::Text("- note: %d",ch->note);
ImGui::Text("- ins: %d",ch->ins);
ImGui::Text("* psgMode:"); ImGui::Text("* psgMode:");
ImGui::Text(" * curr:"); ImGui::Text(" * curr:");
ImGui::Text(" - tone: %d",ch->curPSGMode.tone); ImGui::Text(" - tone: %d",ch->curPSGMode.tone);
@ -890,27 +743,14 @@ void putDispatchChan(void* data, int chanNum, int type) {
ImGui::Text(" - out: %d",ch->dac.out); ImGui::Text(" - out: %d",ch->dac.out);
ImGui::Text("- autoEnvNum: %.2x",ch->autoEnvNum); ImGui::Text("- autoEnvNum: %.2x",ch->autoEnvNum);
ImGui::Text("- autoEnvDen: %.2x",ch->autoEnvDen); ImGui::Text("- autoEnvDen: %.2x",ch->autoEnvDen);
ImGui::Text("- vol: %.2x",ch->vol); COMMON_CHAN_DEBUG_BOOL;
ImGui::Text("- outVol: %.2x",ch->outVol);
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active");
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged");
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged");
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn");
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff");
ImGui::TextColored(ch->portaPause?colorOn:colorOff,">> PortaPause");
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta");
ImGui::TextColored(ch->dac.furnaceDAC?colorOn:colorOff,">> furnaceDAC"); ImGui::TextColored(ch->dac.furnaceDAC?colorOn:colorOff,">> furnaceDAC");
break; break;
} }
case DIV_SYSTEM_AY8930: { case DIV_SYSTEM_AY8930: {
DivPlatformAY8930::Channel* ch=(DivPlatformAY8930::Channel*)data; DivPlatformAY8930::Channel* ch=(DivPlatformAY8930::Channel*)data;
ImGui::Text("> AY8930"); ImGui::Text("> AY8930");
ImGui::Text("* freq: %d",ch->freq); COMMON_CHAN_DEBUG;
ImGui::Text(" - base: %d",ch->baseFreq);
ImGui::Text(" - pitch: %d",ch->pitch);
ImGui::Text(" - pitch2: %d",ch->pitch2);
ImGui::Text("- note: %d",ch->note);
ImGui::Text("- ins: %d",ch->ins);
ImGui::Text("- duty: %d",ch->duty); ImGui::Text("- duty: %d",ch->duty);
ImGui::Text("* envelope:"); ImGui::Text("* envelope:");
ImGui::Text(" - mode: %d",ch->envelope.mode); ImGui::Text(" - mode: %d",ch->envelope.mode);
@ -936,39 +776,19 @@ void putDispatchChan(void* data, int chanNum, int type) {
ImGui::Text(" - out: %d",ch->dac.out); ImGui::Text(" - out: %d",ch->dac.out);
ImGui::Text("- autoEnvNum: %.2x",ch->autoEnvNum); ImGui::Text("- autoEnvNum: %.2x",ch->autoEnvNum);
ImGui::Text("- autoEnvDen: %.2x",ch->autoEnvDen); ImGui::Text("- autoEnvDen: %.2x",ch->autoEnvDen);
ImGui::Text("- vol: %.2x",ch->vol); COMMON_CHAN_DEBUG_BOOL;
ImGui::Text("- outVol: %.2x",ch->outVol);
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active");
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged");
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged");
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn");
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff");
ImGui::TextColored(ch->portaPause?colorOn:colorOff,">> PortaPause");
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta");
ImGui::TextColored(ch->dac.furnaceDAC?colorOn:colorOff,">> furnaceDAC"); ImGui::TextColored(ch->dac.furnaceDAC?colorOn:colorOff,">> furnaceDAC");
break; break;
} }
case DIV_SYSTEM_QSOUND: { case DIV_SYSTEM_QSOUND: {
DivPlatformQSound::Channel* ch=(DivPlatformQSound::Channel*)data; DivPlatformQSound::Channel* ch=(DivPlatformQSound::Channel*)data;
ImGui::Text("> QSound"); ImGui::Text("> QSound");
ImGui::Text("* freq: %d",ch->freq); COMMON_CHAN_DEBUG;
ImGui::Text(" - base: %d",ch->baseFreq);
ImGui::Text(" - pitch: %d",ch->pitch);
ImGui::Text(" - pitch2: %d",ch->pitch2);
ImGui::Text("- note: %d",ch->note);
ImGui::Text("- ins: %d",ch->ins);
ImGui::Text("- sample: %d",ch->sample); ImGui::Text("- sample: %d",ch->sample);
ImGui::Text("- echo: %d",ch->echo); ImGui::Text("- echo: %d",ch->echo);
ImGui::Text("- panning: %d",ch->panning); ImGui::Text("- panning: %d",ch->panning);
ImGui::Text("- vol: %.2x",ch->vol);
ImGui::Text("- outVol: %.2x",ch->outVol);
ImGui::Text("- resVol: %.2x",ch->resVol); ImGui::Text("- resVol: %.2x",ch->resVol);
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active"); COMMON_CHAN_DEBUG_BOOL;
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged");
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged");
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn");
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff");
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta");
ImGui::TextColored(ch->useWave?colorOn:colorOff,">> UseWave"); ImGui::TextColored(ch->useWave?colorOn:colorOff,">> UseWave");
ImGui::TextColored(ch->surround?colorOn:colorOff,">> Surround"); ImGui::TextColored(ch->surround?colorOn:colorOff,">> Surround");
ImGui::TextColored(ch->isNewQSound?colorOn:colorOff,">> IsNewQSound"); ImGui::TextColored(ch->isNewQSound?colorOn:colorOff,">> IsNewQSound");
@ -977,14 +797,9 @@ void putDispatchChan(void* data, int chanNum, int type) {
case DIV_SYSTEM_X1_010: { case DIV_SYSTEM_X1_010: {
DivPlatformX1_010::Channel* ch=(DivPlatformX1_010::Channel*)data; DivPlatformX1_010::Channel* ch=(DivPlatformX1_010::Channel*)data;
ImGui::Text("> X1-010"); ImGui::Text("> X1-010");
ImGui::Text("* freq: %.4x",ch->freq); COMMON_CHAN_DEBUG;
ImGui::Text(" - base: %d",ch->baseFreq);
ImGui::Text(" - pitch: %d",ch->pitch);
ImGui::Text(" - pitch2: %d",ch->pitch2);
ImGui::Text("- note: %d",ch->note);
ImGui::Text("- wave: %d",ch->wave); ImGui::Text("- wave: %d",ch->wave);
ImGui::Text("- sample: %d",ch->sample); ImGui::Text("- sample: %d",ch->sample);
ImGui::Text("- ins: %d",ch->ins);
ImGui::Text("- pan: %d",ch->pan); ImGui::Text("- pan: %d",ch->pan);
ImGui::Text("* envelope:"); ImGui::Text("* envelope:");
ImGui::Text(" - shape: %d",ch->env.shape); ImGui::Text(" - shape: %d",ch->env.shape);
@ -995,17 +810,10 @@ void putDispatchChan(void* data, int chanNum, int type) {
ImGui::Text(" - autoEnvDen: %.2x",ch->autoEnvDen); ImGui::Text(" - autoEnvDen: %.2x",ch->autoEnvDen);
ImGui::Text("- WaveBank: %d",ch->waveBank); ImGui::Text("- WaveBank: %d",ch->waveBank);
ImGui::Text("- bankSlot: %d",ch->bankSlot); ImGui::Text("- bankSlot: %d",ch->bankSlot);
ImGui::Text("- vol: %.2x",ch->vol);
ImGui::Text("- outVol: %.2x",ch->outVol);
ImGui::Text("- Lvol: %.2x",ch->lvol); ImGui::Text("- Lvol: %.2x",ch->lvol);
ImGui::Text("- Rvol: %.2x",ch->rvol); ImGui::Text("- Rvol: %.2x",ch->rvol);
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active"); COMMON_CHAN_DEBUG_BOOL;
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged");
ImGui::TextColored(ch->envChanged?colorOn:colorOff,">> EnvChanged"); ImGui::TextColored(ch->envChanged?colorOn:colorOff,">> EnvChanged");
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged");
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn");
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff");
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta");
ImGui::TextColored(ch->furnacePCM?colorOn:colorOff,">> FurnacePCM"); ImGui::TextColored(ch->furnacePCM?colorOn:colorOff,">> FurnacePCM");
ImGui::TextColored(ch->pcm?colorOn:colorOff,">> PCM"); ImGui::TextColored(ch->pcm?colorOn:colorOff,">> PCM");
ImGui::TextColored(ch->env.flag.envEnable?colorOn:colorOff,">> EnvEnable"); ImGui::TextColored(ch->env.flag.envEnable?colorOn:colorOff,">> EnvEnable");
@ -1020,11 +828,7 @@ void putDispatchChan(void* data, int chanNum, int type) {
case DIV_SYSTEM_N163: { case DIV_SYSTEM_N163: {
DivPlatformN163::Channel* ch=(DivPlatformN163::Channel*)data; DivPlatformN163::Channel* ch=(DivPlatformN163::Channel*)data;
ImGui::Text("> N163"); ImGui::Text("> N163");
ImGui::Text("* freq: %.4x",ch->freq); COMMON_CHAN_DEBUG;
ImGui::Text(" - base: %d",ch->baseFreq);
ImGui::Text(" - pitch: %d",ch->pitch);
ImGui::Text(" - pitch2: %d",ch->pitch2);
ImGui::Text("- note: %d",ch->note);
ImGui::Text("- wave: %d",ch->wave); ImGui::Text("- wave: %d",ch->wave);
ImGui::Text("- wavepos: %d",ch->wavePos); ImGui::Text("- wavepos: %d",ch->wavePos);
ImGui::Text("- wavelen: %d",ch->waveLen); ImGui::Text("- wavelen: %d",ch->waveLen);
@ -1033,45 +837,25 @@ void putDispatchChan(void* data, int chanNum, int type) {
ImGui::Text("- loadpos: %d",ch->loadPos); ImGui::Text("- loadpos: %d",ch->loadPos);
ImGui::Text("- loadlen: %d",ch->loadLen); ImGui::Text("- loadlen: %d",ch->loadLen);
ImGui::Text("- loadmode: %d",ch->loadMode); ImGui::Text("- loadmode: %d",ch->loadMode);
ImGui::Text("- ins: %d",ch->ins);
ImGui::Text("- vol: %.2x",ch->vol);
ImGui::Text("- outVol: %.2x",ch->outVol);
ImGui::Text("- resVol: %.2x",ch->resVol); ImGui::Text("- resVol: %.2x",ch->resVol);
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active"); COMMON_CHAN_DEBUG_BOOL;
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged");
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged");
ImGui::TextColored(ch->volumeChanged?colorOn:colorOff,">> VolumeChanged"); ImGui::TextColored(ch->volumeChanged?colorOn:colorOff,">> VolumeChanged");
ImGui::TextColored(ch->waveChanged?colorOn:colorOff,">> WaveChanged"); ImGui::TextColored(ch->waveChanged?colorOn:colorOff,">> WaveChanged");
ImGui::TextColored(ch->waveUpdated?colorOn:colorOff,">> WaveUpdated"); ImGui::TextColored(ch->waveUpdated?colorOn:colorOff,">> WaveUpdated");
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn");
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff");
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta");
break; break;
} }
case DIV_SYSTEM_VRC6: { case DIV_SYSTEM_VRC6: {
DivPlatformVRC6::Channel* ch=(DivPlatformVRC6::Channel*)data; DivPlatformVRC6::Channel* ch=(DivPlatformVRC6::Channel*)data;
ImGui::Text("> VRC6"); ImGui::Text("> VRC6");
ImGui::Text("* freq: %d",ch->freq); COMMON_CHAN_DEBUG;
ImGui::Text(" - base: %d",ch->baseFreq);
ImGui::Text(" - pitch: %d",ch->pitch);
ImGui::Text(" - pitch2: %d",ch->pitch2);
ImGui::Text("- note: %d",ch->note);
ImGui::Text("* DAC:"); ImGui::Text("* DAC:");
ImGui::Text(" - period: %d",ch->dacPeriod); ImGui::Text(" - period: %d",ch->dacPeriod);
ImGui::Text(" - rate: %d",ch->dacRate); ImGui::Text(" - rate: %d",ch->dacRate);
ImGui::Text(" - out: %d",ch->dacOut); ImGui::Text(" - out: %d",ch->dacOut);
ImGui::Text(" - pos: %d",ch->dacPos); ImGui::Text(" - pos: %d",ch->dacPos);
ImGui::Text(" - sample: %d",ch->dacSample); ImGui::Text(" - sample: %d",ch->dacSample);
ImGui::Text("- ins: %d",ch->ins);
ImGui::Text("- duty: %d",ch->duty); ImGui::Text("- duty: %d",ch->duty);
ImGui::Text("- vol: %.2x",ch->vol); COMMON_CHAN_DEBUG_BOOL;
ImGui::Text("- outVol: %.2x",ch->outVol);
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active");
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged");
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged");
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn");
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff");
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta");
ImGui::TextColored(ch->pcm?colorOn:colorOff,">> DAC"); ImGui::TextColored(ch->pcm?colorOn:colorOff,">> DAC");
ImGui::TextColored(ch->furnaceDac?colorOn:colorOff,">> FurnaceDAC"); ImGui::TextColored(ch->furnaceDac?colorOn:colorOff,">> FurnaceDAC");
break; break;
@ -1177,46 +961,30 @@ void putDispatchChan(void* data, int chanNum, int type) {
case DIV_SYSTEM_LYNX: { case DIV_SYSTEM_LYNX: {
DivPlatformLynx::Channel* ch=(DivPlatformLynx::Channel*)data; DivPlatformLynx::Channel* ch=(DivPlatformLynx::Channel*)data;
ImGui::Text("> Lynx"); ImGui::Text("> Lynx");
ImGui::Text("* freq:"); COMMON_CHAN_DEBUG;
ImGui::Text(" - base: %d",ch->baseFreq);
ImGui::Text(" - pitch: %d",ch->pitch);
ImGui::Text(" - pitch2: %d",ch->pitch2);
ImGui::Text("* FreqDiv:"); ImGui::Text("* FreqDiv:");
ImGui::Text(" - clockDivider: %d",ch->fd.clockDivider); ImGui::Text(" - clockDivider: %d",ch->fd.clockDivider);
ImGui::Text(" - backup: %d",ch->fd.backup); ImGui::Text(" - backup: %d",ch->fd.backup);
ImGui::Text("* note: %d",ch->note); ImGui::Text("- actualNote: %d",ch->actualNote);
ImGui::Text(" - actualNote: %d",ch->actualNote);
ImGui::Text("* Sample:"); ImGui::Text("* Sample:");
ImGui::Text(" - sample: %d",ch->sample); ImGui::Text(" - sample: %d",ch->sample);
ImGui::Text(" - pos: %d",ch->samplePos); ImGui::Text(" - pos: %d",ch->samplePos);
ImGui::Text(" - accum: %d",ch->sampleAccum); ImGui::Text(" - accum: %d",ch->sampleAccum);
ImGui::Text(" * freq: %d",ch->sampleFreq); ImGui::Text(" * freq: %d",ch->sampleFreq);
ImGui::Text(" - base: %d",ch->sampleBaseFreq); ImGui::Text(" - base: %d",ch->sampleBaseFreq);
ImGui::Text("- ins: %d",ch->ins);
ImGui::Text("* duty:"); ImGui::Text("* duty:");
ImGui::Text(" - int_feedback7: %d",ch->duty.int_feedback7); ImGui::Text(" - int_feedback7: %d",ch->duty.int_feedback7);
ImGui::Text(" - feedback: %d",ch->duty.feedback); ImGui::Text(" - feedback: %d",ch->duty.feedback);
ImGui::Text("- pan: %.2x",ch->pan); ImGui::Text("- pan: %.2x",ch->pan);
ImGui::Text("- vol: %.2x",ch->vol);
ImGui::Text("- outVol: %.2x",ch->outVol);
ImGui::Text("- macroVolMul: %.2x",ch->macroVolMul); ImGui::Text("- macroVolMul: %.2x",ch->macroVolMul);
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active"); COMMON_CHAN_DEBUG_BOOL;
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged");
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged");
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn");
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff");
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta");
ImGui::TextColored(ch->pcm?colorOn:colorOff,">> DAC"); ImGui::TextColored(ch->pcm?colorOn:colorOff,">> DAC");
break; break;
} }
case DIV_SYSTEM_PCM_DAC: { case DIV_SYSTEM_PCM_DAC: {
DivPlatformPCMDAC::Channel* ch=(DivPlatformPCMDAC::Channel*)data; DivPlatformPCMDAC::Channel* ch=(DivPlatformPCMDAC::Channel*)data;
ImGui::Text("> PCM DAC"); ImGui::Text("> PCM DAC");
ImGui::Text("* freq:"); COMMON_CHAN_DEBUG;
ImGui::Text(" - base: %d",ch->baseFreq);
ImGui::Text(" - pitch: %d",ch->pitch);
ImGui::Text(" - pitch2: %d",ch->pitch2);
ImGui::Text("* note: %d",ch->note);
ImGui::Text("* Sample: %d",ch->sample); ImGui::Text("* Sample: %d",ch->sample);
ImGui::Text(" - dir: %d",ch->audDir); ImGui::Text(" - dir: %d",ch->audDir);
ImGui::Text(" - loc: %d",ch->audLoc); ImGui::Text(" - loc: %d",ch->audLoc);
@ -1224,17 +992,10 @@ void putDispatchChan(void* data, int chanNum, int type) {
ImGui::Text(" * pos: %d",ch->audPos); ImGui::Text(" * pos: %d",ch->audPos);
ImGui::Text(" - sub: %d",ch->audSub); ImGui::Text(" - sub: %d",ch->audSub);
ImGui::Text("- wave: %d",ch->wave); ImGui::Text("- wave: %d",ch->wave);
ImGui::Text("- ins: %d",ch->ins);
ImGui::Text("- panL: %.2x",ch->panL); ImGui::Text("- panL: %.2x",ch->panL);
ImGui::Text("- panR: %.2x",ch->panR); ImGui::Text("- panR: %.2x",ch->panR);
ImGui::Text("- vol: %.2x",ch->vol);
ImGui::Text("- envVol: %.2x",ch->envVol); ImGui::Text("- envVol: %.2x",ch->envVol);
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active"); COMMON_CHAN_DEBUG_BOOL;
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged");
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged");
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn");
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff");
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta");
ImGui::TextColored(ch->useWave?colorOn:colorOff,">> UseWave"); ImGui::TextColored(ch->useWave?colorOn:colorOff,">> UseWave");
ImGui::TextColored(ch->setPos?colorOn:colorOff,">> SetPos"); ImGui::TextColored(ch->setPos?colorOn:colorOff,">> SetPos");
break; break;

View file

@ -928,6 +928,7 @@ const int availableSystems[]={
DIV_SYSTEM_AY8910, DIV_SYSTEM_AY8910,
DIV_SYSTEM_AMIGA, DIV_SYSTEM_AMIGA,
DIV_SYSTEM_PCSPKR, DIV_SYSTEM_PCSPKR,
DIV_SYSTEM_POKEMINI,
DIV_SYSTEM_SFX_BEEPER, DIV_SYSTEM_SFX_BEEPER,
DIV_SYSTEM_YMU759, DIV_SYSTEM_YMU759,
DIV_SYSTEM_DUMMY, DIV_SYSTEM_DUMMY,
@ -1019,6 +1020,7 @@ const int chipsSquare[]={
DIV_SYSTEM_SMS, DIV_SYSTEM_SMS,
DIV_SYSTEM_AY8910, DIV_SYSTEM_AY8910,
DIV_SYSTEM_PCSPKR, DIV_SYSTEM_PCSPKR,
DIV_SYSTEM_POKEMINI,
DIV_SYSTEM_SAA1099, DIV_SYSTEM_SAA1099,
DIV_SYSTEM_VIC20, DIV_SYSTEM_VIC20,
DIV_SYSTEM_MSM5232, DIV_SYSTEM_MSM5232,

View file

@ -216,6 +216,11 @@ void FurnaceGUI::initSystemPresets() {
) )
} }
); );
ENTRY(
"Pokémon Mini", {
CH(DIV_SYSTEM_POKEMINI, 32, 0, "")
}
);
CATEGORY_END; CATEGORY_END;
CATEGORY_BEGIN("Computers","let's get to work on chiptune today."); CATEGORY_BEGIN("Computers","let's get to work on chiptune today.");
@ -1079,6 +1084,11 @@ void FurnaceGUI::initSystemPresets() {
CH(DIV_SYSTEM_PCSPKR, 32, 0, "") CH(DIV_SYSTEM_PCSPKR, 32, 0, "")
} }
); );
ENTRY(
"Pokémon Mini", {
CH(DIV_SYSTEM_POKEMINI, 32, 0, "")
}
);
ENTRY( ENTRY(
"Commodore VIC", { "Commodore VIC", {
CH(DIV_SYSTEM_VIC20, 64, 0, "clockSel=1") CH(DIV_SYSTEM_VIC20, 64, 0, "clockSel=1")