Revert "Add ES5506 support and Various enhancement for sample, etc"

This commit is contained in:
tildearrow 2023-02-06 01:03:55 -05:00 committed by GitHub
parent 4f33f9d815
commit 4023ee3e4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 15 additions and 1971 deletions

View File

@ -530,7 +530,6 @@ src/engine/platform/pokemini.cpp
src/engine/platform/pong.cpp
src/engine/platform/vic20.cpp
src/engine/platform/vrc6.cpp
src/engine/platform/es5506.cpp
src/engine/platform/scc.cpp
src/engine/platform/ymz280b.cpp
src/engine/platform/namcowsg.cpp

View File

@ -1657,10 +1657,6 @@ chips which aren't on this list don't have any flags.
- 1: 16.67MHz
- bit 4: stereo (bool)
## 0xb1: Ensoniq ES5506
- bit 0-4: channels (int)
## 0xb5: tildearrow Sound Unit
- bit 0: clockSel (int)

View File

@ -217,18 +217,6 @@ enum DivDispatchCmds {
DIV_CMD_FM_AM2_DEPTH, // (depth)
DIV_CMD_FM_PM2_DEPTH, // (depth)
DIV_CMD_ES5506_FILTER_MODE, // (value)
DIV_CMD_ES5506_FILTER_K1, // (value, mask)
DIV_CMD_ES5506_FILTER_K2, // (value, mask)
DIV_CMD_ES5506_FILTER_K1_SLIDE, // (value, negative)
DIV_CMD_ES5506_FILTER_K2_SLIDE, // (value, negative)
DIV_CMD_ES5506_ENVELOPE_COUNT, // (count)
DIV_CMD_ES5506_ENVELOPE_LVRAMP, // (ramp)
DIV_CMD_ES5506_ENVELOPE_RVRAMP, // (ramp)
DIV_CMD_ES5506_ENVELOPE_K1RAMP, // (ramp, slowdown)
DIV_CMD_ES5506_ENVELOPE_K2RAMP, // (ramp, slowdown)
DIV_CMD_ES5506_PAUSE, // (value)
DIV_ALWAYS_SET_VOLUME, // () -> alwaysSetVol
DIV_CMD_MAX
@ -646,8 +634,8 @@ class DivDispatch {
#define COLOR_PAL (283.75*15625.0+25.0)
#define CLAMP_VAR(x,xMin,xMax) \
if ((x)<(xMin)) (x)=(xMin); \
if ((x)>(xMax)) (x)=(xMax);
if (x<xMin) x=xMin; \
if (x>xMax) x=xMax;
#define NEW_ARP_STRAT (parent->song.linearPitch==2 && !parent->song.oldArpStrategy)
#define HACKY_LEGATO_MESS chan[c.chan].std.arp.will && !chan[c.chan].std.arp.mode && !NEW_ARP_STRAT

View File

@ -67,7 +67,6 @@
#include "platform/vrc6.h"
#include "platform/fds.h"
#include "platform/mmc5.h"
#include "platform/es5506.h"
#include "platform/scc.h"
#include "platform/ymz280b.h"
#include "platform/rf5c68.h"
@ -437,9 +436,6 @@ void DivDispatchContainer::init(DivSystem sys, DivEngine* eng, int chanCount, do
case DIV_SYSTEM_MMC5:
dispatch=new DivPlatformMMC5;
break;
case DIV_SYSTEM_ES5506:
dispatch=new DivPlatformES5506;
break;
case DIV_SYSTEM_SCC:
dispatch=new DivPlatformSCC;
((DivPlatformSCC*)dispatch)->setChipModel(false);

View File

@ -2515,8 +2515,6 @@ int DivEngine::getEffectiveSampleRate(int rate) {
return (48828*MIN(128,(rate*128/48828)))/128;
case DIV_SYSTEM_X1_010:
return (31250*MIN(255,(rate*16/31250)))/16; // TODO: support variable clock case
case DIV_SYSTEM_ES5506:
return (31250*MIN(131071,(rate*2048/31250)))/2048; // TODO: support variable clock, channel limit case
default:
break;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,329 +0,0 @@
/**
* Furnace Tracker - multi-system chiptune tracker
* Copyright (C) 2021-2023 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 _ES5506_H
#define _ES5506_H
#pragma once
#include "../dispatch.h"
#include "../engine.h"
#include <queue>
#include "../macroInt.h"
#include "../sample.h"
#include "vgsound_emu/src/es550x/es5506.hpp"
class DivPlatformES5506: public DivDispatch, public es550x_intf {
struct Channel : public SharedChannel<unsigned int> {
struct PCM {
bool isNoteMap;
int index, next;
int note;
double freqOffs;
double nextFreqOffs;
bool pause, direction;
unsigned int bank;
unsigned int start;
unsigned int end;
unsigned int length;
unsigned int loopStart;
unsigned int loopEnd;
unsigned int nextPos;
DivSampleLoopMode loopMode;
PCM():
isNoteMap(false),
index(-1),
next(-1),
note(0),
freqOffs(1.0),
nextFreqOffs(1.0),
pause(false),
direction(false),
bank(0),
start(0),
end(0),
length(0),
loopStart(0),
loopEnd(0),
nextPos(0),
loopMode(DIV_SAMPLE_LOOP_MAX) {}
} pcm;
int nextFreq, nextNote, currNote, wave;
unsigned int volMacroMax, panMacroMax;
bool useWave, isReverseLoop;
unsigned int cr;
struct NoteChanged { // Note changed flags
union { // pack flag bits in single byte
struct { // flag bits
unsigned char offs: 1; // frequency offset
unsigned char note: 1; // note
unsigned char freq: 1; // base frequency
unsigned char dummy: 5; // dummy for bit padding
};
unsigned char changed; // Packed flags are stored here
};
NoteChanged() :
changed(0) {}
} noteChanged;
struct VolChanged { // Volume changed flags
union { // pack flag bits in single byte
struct { // flag bits
unsigned char lVol: 1; // left volume
unsigned char rVol: 1; // right volume
unsigned char ca: 1; // Channel assignment
unsigned char dummy: 5; // dummy for bit padding
};
unsigned char changed; // Packed flags are stored here
};
VolChanged() :
changed(0) {}
} volChanged;
struct FilterChanged { // Filter changed flags
union { // pack flag bits in single byte
struct { // flag bits
unsigned char mode: 1; // Filter mode
unsigned char k1: 1; // K1
unsigned char k2: 1; // K2
unsigned char dummy: 5; // dummy for bit padding
};
unsigned char changed; // Packed flags are stored here
};
FilterChanged():
changed(0) {}
} filterChanged;
struct EnvChanged { // Envelope changed flags
union { // pack flag bits in single byte
struct { // flag bits
unsigned char ecount: 1; // Envelope count
unsigned char lVRamp: 1; // Left volume Ramp
unsigned char rVRamp: 1; // Right volume Ramp
unsigned char k1Ramp: 1; // K1 Ramp w/Slow flag
unsigned char k2Ramp: 1; // K2 Ramp w/Slow flag
unsigned char dummy: 3; // dummy for bit padding
};
unsigned char changed; // Packed flags are stored here
};
EnvChanged():
changed(0) {}
} envChanged;
struct PCMChanged {
union {
struct {
unsigned char index: 1; // sample index
unsigned char slice: 1; // transwave slice
unsigned char position: 1; // sample position in memory
unsigned char loopBank: 1; // Loop mode and Bank
unsigned char dummy: 4; // dummy for bit padding
};
unsigned char changed;
};
PCMChanged():
changed(0) {}
} pcmChanged;
struct Overwrite {
DivInstrumentES5506::Filter filter;
DivInstrumentES5506::Envelope envelope;
struct State {
// overwrited flag
union {
struct {
unsigned char mode: 1; // filter mode
unsigned char k1: 1; // k1
unsigned char k2: 1; // k2
unsigned char ecount: 1; // envelope count
unsigned char lVRamp: 1; // left volume ramp
unsigned char rVRamp: 1; // right volume ramp
unsigned char k1Ramp: 1; // k1 ramp
unsigned char k2Ramp: 1; // k2 ramp
};
unsigned char overwrited;
};
State():
overwrited(0) {}
} state;
Overwrite():
filter(DivInstrumentES5506::Filter()),
envelope(DivInstrumentES5506::Envelope()),
state(State()) {}
} overwrite;
unsigned char ca;
signed int k1Offs, k2Offs;
signed int k1Slide, k2Slide;
signed int k1Prev, k2Prev;
unsigned int lVol, rVol;
unsigned int outLVol, outRVol;
unsigned int resLVol, resRVol;
signed int oscOut;
DivInstrumentES5506::Filter filter;
DivInstrumentES5506::Envelope envelope;
Channel():
SharedChannel<unsigned int>(0xff),
pcm(PCM()),
nextFreq(0),
nextNote(0),
currNote(0),
wave(-1),
volMacroMax(0xffff),
panMacroMax(0xffff),
useWave(false),
isReverseLoop(false),
cr(0),
noteChanged(NoteChanged()),
volChanged(VolChanged()),
filterChanged(FilterChanged()),
envChanged(EnvChanged()),
pcmChanged(PCMChanged()),
overwrite(Overwrite()),
ca(0),
k1Offs(0),
k2Offs(0),
k1Slide(0),
k2Slide(0),
k1Prev(0xffff),
k2Prev(0xffff),
lVol(0xff),
rVol(0xff),
outLVol(0xffff),
outRVol(0xffff),
resLVol(0xffff),
resRVol(0xffff),
oscOut(0),
filter(DivInstrumentES5506::Filter()),
envelope(DivInstrumentES5506::Envelope()) {
outVol=0xffff;
}
};
Channel chan[32];
DivDispatchOscBuffer* oscBuf[32];
bool isMuted[32];
signed short* sampleMem; // ES5506 uses 16 bit data bus for samples
size_t sampleMemLen;
unsigned int sampleOffES5506[256];
bool sampleLoaded[256];
struct QueuedHostIntf {
unsigned char state;
unsigned char step;
unsigned char addr;
unsigned int val;
unsigned int mask;
unsigned int* read;
unsigned short delay;
bool isRead;
QueuedHostIntf(unsigned char s, unsigned char a, unsigned int v, unsigned int m=(unsigned int)(~0), unsigned short d=0):
state(0),
step(s),
addr(a),
val(v),
mask(m),
read(NULL),
delay(0),
isRead(false) {}
QueuedHostIntf(unsigned char st, unsigned char s, unsigned char a, unsigned int* r, unsigned int m=(unsigned int)(~0), unsigned short d=0):
state(st),
step(s),
addr(a),
val(0),
mask(m),
read(r),
delay(d),
isRead(true) {}
};
struct QueuedReadState {
unsigned int* read;
unsigned char state;
QueuedReadState(unsigned int* r, unsigned char s):
read(r),
state(s) {}
};
std::queue<QueuedHostIntf> hostIntf32;
std::queue<QueuedHostIntf> hostIntf8;
std::queue<unsigned char> queuedRead;
std::queue<QueuedReadState> queuedReadState;
int cycle, curPage;
unsigned char maskedVal;
unsigned int irqv;
bool isMasked, isReaded;
bool irqTrigger;
unsigned int curCR;
unsigned char prevChanCycle;
unsigned char initChanMax, chanMax;
es5506_core es5506;
unsigned char regPool[4*16*128]; // 7 bit page x 16 registers per page x 32 bit per registers
friend void putDispatchChip(void*,int);
friend void putDispatchChan(void*,int,int);
public:
virtual void e_pin(bool state) override; // E output
virtual void irqb(bool state) override; // IRQB output
virtual s16 read_sample(u8 voice, u8 bank, u32 address) override {
if (sampleMem==NULL) return 0;
return sampleMem[((bank&3)<<21)|(address&0x1fffff)];
}
virtual void acquire(short** buf, size_t len) override;
virtual int dispatch(DivCommand c) override;
virtual void* getChanState(int chan) override;
virtual DivMacroInt* getChanMacroInt(int ch) override;
virtual DivDispatchOscBuffer* getOscBuffer(int chan) override;
virtual unsigned char* getRegisterPool() override;
virtual int getRegisterPoolSize() override;
virtual void reset() override;
virtual void forceIns() override;
virtual void tick(bool sysTick=true) override;
virtual void muteChannel(int ch, bool mute) override;
virtual int getOutputCount() override;
virtual bool keyOffAffectsArp(int ch) override;
virtual void setFlags(const DivConfig& flags) override;
virtual void notifyInsChange(int ins) override;
virtual void notifyWaveChange(int wave) override;
virtual void notifyInsDeletion(void* ins) override;
virtual void poke(unsigned int addr, unsigned short val) override;
virtual void poke(std::vector<DivRegWrite>& wlist) override;
virtual const void* getSampleMem(int index = 0) override;
virtual size_t getSampleMemCapacity(int index = 0) override;
virtual size_t getSampleMemUsage(int index = 0) override;
virtual bool isSampleLoaded(int index, int sample) override;
virtual void renderSamples(int sysID) override;
virtual const char** getRegisterSheet() override;
virtual int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags) override;
virtual void quit() override;
DivPlatformES5506():
DivDispatch(),
es550x_intf(),
es5506(*this) {}
};
#endif

View File

@ -681,10 +681,7 @@ int DivPlatformGenesis::dispatch(DivCommand c) {
break;
} else {
rWrite(0x2b,1<<7);
if (dumpWrites) {
addWrite(0xffff0000,chan[c.chan].dacSample);
addWrite(0xffff0003,chan[c.chan].dacDirection);
}
if (dumpWrites) addWrite(0xffff0000,chan[c.chan].dacSample);
}
chan[c.chan].dacPos=0;
chan[c.chan].dacPeriod=0;

View File

@ -217,18 +217,6 @@ const char* cmdName[]={
"FM_AM2_DEPTH",
"FM_PM2_DEPTH",
"ES5506_FILTER_MODE",
"ES5506_FILTER_K1",
"ES5506_FILTER_K2",
"ES5506_FILTER_K1_SLIDE",
"ES5506_FILTER_K2_SLIDE",
"ES5506_ENVELOPE_COUNT",
"ES5506_ENVELOPE_LVRAMP",
"ES5506_ENVELOPE_RVRAMP",
"ES5506_ENVELOPE_K1RAMP",
"ES5506_ENVELOPE_K2RAMP",
"ES5506_PAUSE",
"ALWAYS_SET_VOLUME"
};
@ -1520,7 +1508,8 @@ void DivEngine::nextBuf(float** in, float** out, int inChans, int outChans, unsi
samp_temp=s->data16[sPreview.pos];
if (sPreview.dir) {
sPreview.pos--;
} else {
}
else {
sPreview.pos++;
}
}

View File

@ -407,10 +407,6 @@ template<const int mask> int effectValAnd(unsigned char, unsigned char val) {
return val&mask;
};
template<const int shift> int effectValShift(unsigned char, unsigned char val) {
return val<<shift;
};
template<const int maxOp> int effectOpVal(unsigned char, unsigned char val) {
if ((val>>4)>maxOp) throw DivDoNotHandleEffect();
return (val>>4)-1;
@ -425,10 +421,6 @@ template<const int bits> int effectValLong(unsigned char cmd, unsigned char val)
return ((((unsigned int)cmd)&((1<<(bits-8))-1))<<8)|((unsigned int)val);
};
template<const int bits, const int shift> int effectValLongShift(unsigned char cmd, unsigned char val) {
return (((((unsigned int)cmd)&((1<<(bits-8))-1))<<8)|((unsigned int)val))<<shift;
};
void DivEngine::registerSystems() {
logD("registering systems...");
@ -1550,46 +1542,14 @@ void DivEngine::registerSystems() {
{DIV_INS_OPL, DIV_INS_OPL, DIV_INS_OPL, DIV_INS_OPL, DIV_INS_OPL, DIV_INS_OPL, DIV_INS_OPL, DIV_INS_OPL, DIV_INS_OPL, DIV_INS_OPL, DIV_INS_OPL, DIV_INS_OPL, DIV_INS_OPL, DIV_INS_OPL, DIV_INS_OPL, DIV_INS_OPL, DIV_INS_OPL, DIV_INS_OPL, DIV_INS_OPL, DIV_INS_OPL, DIV_INS_MULTIPCM, DIV_INS_MULTIPCM, DIV_INS_MULTIPCM, DIV_INS_MULTIPCM, DIV_INS_MULTIPCM, DIV_INS_MULTIPCM, DIV_INS_MULTIPCM, DIV_INS_MULTIPCM, DIV_INS_MULTIPCM, DIV_INS_MULTIPCM, DIV_INS_MULTIPCM, DIV_INS_MULTIPCM, DIV_INS_MULTIPCM, DIV_INS_MULTIPCM, DIV_INS_MULTIPCM, DIV_INS_MULTIPCM, DIV_INS_MULTIPCM, DIV_INS_MULTIPCM, DIV_INS_MULTIPCM, DIV_INS_MULTIPCM, DIV_INS_MULTIPCM, DIV_INS_MULTIPCM, DIV_INS_MULTIPCM, DIV_INS_MULTIPCM}
);
EffectHandlerMap es5506PreEffectHandlerMap={
{0x10, {DIV_CMD_WAVE, "10xx: Change waveform or sample (00 to FF)",effectVal}},
{0x11, {DIV_CMD_ES5506_FILTER_MODE, "11xx: Set filter mode (00 to 03)",effectValAnd<3>}},
{0x14, {DIV_CMD_ES5506_FILTER_K1, "14xx: Set filter coefficient K1 low byte (00 to FF)",effectValShift<0>,constVal<0x00ff>}},
{0x15, {DIV_CMD_ES5506_FILTER_K1, "15xx: Set filter coefficient K1 high byte (00 to FF)",effectValShift<8>,constVal<0xff00>}},
{0x16, {DIV_CMD_ES5506_FILTER_K2, "16xx: Set filter coefficient K2 low byte (00 to FF)",effectValShift<0>,constVal<0x00ff>}},
{0x17, {DIV_CMD_ES5506_FILTER_K2, "17xx: Set filter coefficient K2 high byte (00 to FF)",effectValShift<8>,constVal<0xff00>}},
{0x18, {DIV_CMD_ES5506_FILTER_K1_SLIDE, "18xx: Set filter coefficient K1 slide up (00 to FF)",effectVal,constVal<0>}},
{0x19, {DIV_CMD_ES5506_FILTER_K1_SLIDE, "19xx: Set filter coefficient K1 slide down (00 to FF)",effectVal,constVal<1>}},
{0x1a, {DIV_CMD_ES5506_FILTER_K2_SLIDE, "1Axx: Set filter coefficient K2 slide up (00 to FF)",effectVal,constVal<0>}},
{0x1b, {DIV_CMD_ES5506_FILTER_K2_SLIDE, "1Bxx: Set filter coefficient K2 slide down (00 to FF)",effectVal,constVal<1>}},
{0x22, {DIV_CMD_ES5506_ENVELOPE_LVRAMP, "22xx: Set envelope left volume ramp (signed) (00 to FF)",effectVal}},
{0x23, {DIV_CMD_ES5506_ENVELOPE_RVRAMP, "23xx: Set envelope right volume ramp (signed) (00 to FF)",effectVal}},
{0x24, {DIV_CMD_ES5506_ENVELOPE_K1RAMP, "24xx: Set envelope filter coefficient k1 ramp (signed) (00 to FF)",effectVal,constVal<0>}},
{0x25, {DIV_CMD_ES5506_ENVELOPE_K1RAMP, "25xx: Set envelope filter coefficient k1 ramp (signed, slower) (00 to FF)",effectVal,constVal<1>}},
{0x26, {DIV_CMD_ES5506_ENVELOPE_K2RAMP, "26xx: Set envelope filter coefficient k2 ramp (signed) (00 to FF)",effectVal,constVal<0>}},
{0x27, {DIV_CMD_ES5506_ENVELOPE_K2RAMP, "27xx: Set envelope filter coefficient k2 ramp (signed, slower) (00 to FF)",effectVal,constVal<1>}},
{0xdf, {DIV_CMD_SAMPLE_DIR, "DFxx: Set sample playback direction (0: normal; 1: reverse)"}}
};
EffectHandlerMap es5506PostEffectHandlerMap={
{0x12, {DIV_CMD_ES5506_PAUSE, "120x: Set pause (bit 0)",effectValAnd<1>}}
};
const EffectHandler es5506ECountHandler(DIV_CMD_ES5506_ENVELOPE_COUNT, "2xxx: Set envelope count (000 to 1FF)", effectValLong<9>);
const EffectHandler es5506K1Handler(DIV_CMD_ES5506_FILTER_K1, "3xxx: Set filter coefficient K1 (000 to FFF)", effectValLongShift<12,4>,constVal<0xfff0>);
const EffectHandler es5506K2Handler(DIV_CMD_ES5506_FILTER_K2, "4xxx: Set filter coefficient K2 (000 to FFF)", effectValLongShift<12,4>,constVal<0xfff0>);
for (int i=0; i<2; i++) es5506PreEffectHandlerMap.emplace(0x20+i,es5506ECountHandler);
for (int i=0; i<16; i++) es5506PreEffectHandlerMap.emplace(0x30+i, es5506K1Handler);
for (int i=0; i<16; i++) es5506PreEffectHandlerMap.emplace(0x40+i, es5506K2Handler);
// TODO: custom sample format
// TODO: not sure about sample formats
sysDefs[DIV_SYSTEM_ES5506]=new DivSysDef(
"Ensoniq ES5506", NULL, 0xb1, 0, 32, false, true, 0/*0x171*/, false, (1U<<DIV_SAMPLE_DEPTH_8BIT)|(1U<<DIV_SAMPLE_DEPTH_16BIT),
"Ensoniq ES5506", NULL, 0xb1, 0, 32, false, true, 0, false, (1U<<DIV_SAMPLE_DEPTH_8BIT)|(1U<<DIV_SAMPLE_DEPTH_16BIT),
"a sample chip used in the Ensoniq's unique TransWave synthesizers, and SoundScape series PC ISA soundcards (which are yet another (partially) Sound Blaster compatible ones with emulated OPL3 and MIDI ROMpler).",
{"Channel 1", "Channel 2", "Channel 3", "Channel 4", "Channel 5", "Channel 6", "Channel 7", "Channel 8", "Channel 9", "Channel 10", "Channel 11", "Channel 12", "Channel 13", "Channel 14", "Channel 15", "Channel 16", "Channel 17", "Channel 18", "Channel 19", "Channel 20", "Channel 21", "Channel 22", "Channel 23", "Channel 24", "Channel 25", "Channel 26", "Channel 27", "Channel 28", "Channel 29", "Channel 30", "Channel 31", "Channel 32"},
{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32"},
{DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM},
{DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506},
{DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA},
es5506PreEffectHandlerMap,
es5506PostEffectHandlerMap
{DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506, DIV_INS_ES5506}
);
sysDefs[DIV_SYSTEM_Y8950]=new DivSysDef(

View File

@ -376,40 +376,6 @@ void DivEngine::performVGMWrite(SafeWriter* w, DivSystem sys, DivRegWrite& write
w->writeC(0xd6+i);
}
break;
case DIV_SYSTEM_ES5506:
for (int i=0; i<32; i++) {
for (int b=0; b<4; b++) {
w->writeC(0xbe);
w->writeC((0xf<<2)+b);
w->writeC(i);
}
unsigned int init_cr=0x0303;
for (int b=0; b<4; b++) {
w->writeC(0xbe);
w->writeC(b);
w->writeC(init_cr>>(24-(b<<3)));
}
for (int r=1; r<11; r++) {
for (int b=0; b<4; b++) {
w->writeC(0xbe);
w->writeC((r<<2)+b);
w->writeC(((r==7 || r==9) && b&2)?0xff:0);
}
}
for (int b=0; b<4; b++) {
w->writeC(0xbe);
w->writeC((0xf<<2)+b);
w->writeC(0x20|i);
}
for (int r=1; r<10; r++) {
for (int b=0; b<4; b++) {
w->writeC(0xbe);
w->writeC((r<<2)+b);
w->writeC(0);
}
}
}
break;
case DIV_SYSTEM_OPL:
case DIV_SYSTEM_OPL_DRUMS:
// disable envelope
@ -792,11 +758,6 @@ void DivEngine::performVGMWrite(SafeWriter* w, DivSystem sys, DivRegWrite& write
w->writeC(write.val&0xff);
}
break;
case DIV_SYSTEM_ES5506:
w->writeC(0xbe);
w->writeC(write.addr&0xff);
w->writeC(write.val&0xff);
break;
case DIV_SYSTEM_VBOY:
w->writeC(0xc7);
w->writeS_BE(baseAddr2S|(write.addr>>2));
@ -1073,7 +1034,6 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop, int version, bool p
int writeSegaPCM=0;
DivDispatch* writeX1010[2]={NULL,NULL};
DivDispatch* writeQSound[2]={NULL,NULL};
DivDispatch* writeES5506[2]={NULL,NULL};
DivDispatch* writeZ280[2]={NULL,NULL};
DivDispatch* writeRF5C68[2]={NULL,NULL};
DivDispatch* writeMSM6295[2]={NULL,NULL};
@ -1423,20 +1383,6 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop, int version, bool p
howManyChips++;
}
break;
case DIV_SYSTEM_ES5506:
if (!hasES5505) {
// VGM identifies ES5506 if highest bit sets, otherwise ES5505
hasES5505=0x80000000|disCont[i].dispatch->chipClock;
willExport[i]=true;
writeES5506[0]=disCont[i].dispatch;
} else if (!(hasES5505&0x40000000)) {
isSecond[i]=true;
willExport[i]=false;
hasES5505|=0xc0000000;
writeES5506[1]=disCont[i].dispatch;
howManyChips++;
}
break;
case DIV_SYSTEM_VBOY:
if (!hasVSU) {
hasVSU=disCont[i].dispatch->chipClock;
@ -1738,7 +1684,7 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop, int version, bool p
w->writeI(hasES5503);
w->writeI(hasES5505);
w->writeC(0); // 5503 chans
w->writeC(hasES5505?1:0); // 5505 chans
w->writeC(0); // 5505 chans
w->writeC(0); // C352 clock divider
w->writeC(0); // reserved
w->writeI(hasX1);
@ -1861,7 +1807,7 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop, int version, bool p
if (memPos>=16777216) break;
}
for (unsigned char i=0; i<writeSegaPCM; i++) {
for (int i=0; i<writeSegaPCM; i++) {
w->writeC(0x67);
w->writeC(0x66);
w->writeC(0x80);
@ -1987,19 +1933,6 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop, int version, bool p
}
}
// TODO
for (int i=0; i<2; i++) {
if (writeES5506[i]!=NULL && writeES5506[i]->getSampleMemUsage()>0) {
w->writeC(0x67);
w->writeC(0x66);
w->writeC(0x8F);
w->writeI((writeES5506[i]->getSampleMemUsage()+8)|(i*0x80000000));
w->writeI(writeES5506[i]->getSampleMemCapacity());
w->writeI(0);
w->write(writeES5506[i]->getSampleMem(),writeES5506[i]->getSampleMemUsage());
}
}
// initialize streams
int streamID=0;
if (!directStream) {

View File

@ -46,7 +46,6 @@
#include "../engine/platform/x1_010.h"
#include "../engine/platform/n163.h"
#include "../engine/platform/vrc6.h"
#include "../engine/platform/es5506.h"
#include "../engine/platform/lynx.h"
#include "../engine/platform/pcmdac.h"
#include "../engine/platform/k007232.h"
@ -492,24 +491,6 @@ void putDispatchChip(void* data, int type) {
ImGui::TextColored(ch->outStereo?colorOn:colorOff,">> OutStereo");
break;
}
case DIV_SYSTEM_ES5506: {
DivPlatformES5506* ch=(DivPlatformES5506*)data;
ImGui::Text("> ES5506");
COMMON_CHIP_DEBUG;
ImGui::Text("- cycle: %d",ch->cycle);
ImGui::Text("- curPage: %d",ch->curPage);
ImGui::Text("- maskedVal: %.2x",ch->maskedVal);
ImGui::Text("- irqv: %.2x",ch->irqv);
ImGui::Text("- curCR: %.8x",ch->curCR);
ImGui::Text("- prevChanCycle: %d",ch->prevChanCycle);
ImGui::Text("- initChanMax: %d",ch->initChanMax);
ImGui::Text("- chanMax: %d",ch->chanMax);
COMMON_CHIP_DEBUG_BOOL;
ImGui::TextColored(ch->isMasked?colorOn:colorOff,">> IsMasked");
ImGui::TextColored(ch->isReaded?colorOn:colorOff,">> isReaded");
ImGui::TextColored(ch->irqTrigger?colorOn:colorOff,">> IrqTrigger");
break;
}
case DIV_SYSTEM_K007232: {
DivPlatformK007232* ch=(DivPlatformK007232*)data;
ImGui::Text("> K007232");
@ -880,97 +861,6 @@ void putDispatchChan(void* data, int chanNum, int type) {
ImGui::TextColored(ch->furnaceDac?colorOn:colorOff,">> FurnaceDAC");
break;
}
case DIV_SYSTEM_ES5506: {
DivPlatformES5506::Channel* ch=(DivPlatformES5506::Channel*)data;
ImGui::Text("> ES5506");
COMMON_CHAN_DEBUG;
ImGui::Text("- nextFreq: %d",ch->nextFreq);
ImGui::Text("- nextNote: %d",ch->nextNote);
ImGui::Text("- currNote: %d",ch->currNote);
ImGui::Text("- wave: %d",ch->wave);
ImGui::Text("- VolMacroMax: %d",ch->volMacroMax);
ImGui::Text("- PanMacroMax: %d",ch->panMacroMax);
ImGui::Text("* PCM:");
ImGui::Text(" * index: %d",ch->pcm.index);
ImGui::Text(" - next: %d",ch->pcm.next);
ImGui::Text(" - note: %d",ch->pcm.note);
ImGui::Text(" * freqOffs: %.6f",ch->pcm.freqOffs);
ImGui::Text(" - next: %.6f",ch->pcm.nextFreqOffs);
ImGui::Text(" - bank: %.2x",ch->pcm.bank);
ImGui::Text(" - start: %.8x",ch->pcm.start);
ImGui::Text(" - end: %.8x",ch->pcm.end);
ImGui::Text(" - length: %.8x",ch->pcm.length);
ImGui::Text(" - loopStart: %.8x",ch->pcm.loopStart);
ImGui::Text(" - loopEnd: %.8x",ch->pcm.loopEnd);
ImGui::Text(" - loopMode: %d",ch->pcm.loopMode);
ImGui::Text(" - nextPos: %d",ch->pcm.nextPos);
ImGui::Text("* Filter:");
ImGui::Text(" - Mode: %d",ch->filter.mode);
ImGui::Text(" - K1: %.4x",ch->filter.k1);
ImGui::Text(" - K2: %.4x",ch->filter.k2);
ImGui::Text("* Envelope:");
ImGui::Text(" - EnvCount: %.3x",ch->envelope.ecount);
ImGui::Text(" - LVRamp: %d",ch->envelope.lVRamp);
ImGui::Text(" - RVRamp: %d",ch->envelope.rVRamp);
ImGui::Text(" - K1Ramp: %d",ch->envelope.k1Ramp);
ImGui::Text(" - K2Ramp: %d",ch->envelope.k2Ramp);
ImGui::Text(" - K1Offs: %d",ch->k1Offs);
ImGui::Text(" - K2Offs: %d",ch->k2Offs);
ImGui::Text(" - K1Slide: %d",ch->k1Slide);
ImGui::Text(" - K2Slide: %d",ch->k2Slide);
ImGui::Text(" - K1Prev: %.4x",ch->k1Prev);
ImGui::Text(" - K2Prev: %.4x",ch->k2Prev);
ImGui::Text("* Overwrite:");
ImGui::Text(" * Filter:");
ImGui::Text(" - Mode: %d",ch->overwrite.filter.mode);
ImGui::Text(" - K1: %.4x",ch->overwrite.filter.k1);
ImGui::Text(" - K2: %.4x",ch->overwrite.filter.k2);
ImGui::Text(" * Envelope:");
ImGui::Text(" - EnvCount: %.3x",ch->overwrite.envelope.ecount);
ImGui::Text(" - LVRamp: %d",ch->overwrite.envelope.lVRamp);
ImGui::Text(" - RVRamp: %d",ch->overwrite.envelope.rVRamp);
ImGui::Text(" - K1Ramp: %d",ch->overwrite.envelope.k1Ramp);
ImGui::Text(" - K2Ramp: %d",ch->overwrite.envelope.k2Ramp);
ImGui::Text("- CA: %.2x",ch->ca);
ImGui::Text("- LVol: %.2x",ch->lVol);
ImGui::Text("- RVol: %.2x",ch->rVol);
ImGui::Text("- outLVol: %.2x",ch->outLVol);
ImGui::Text("- outRVol: %.2x",ch->outRVol);
ImGui::Text("- ResLVol: %.2x",ch->resLVol);
ImGui::Text("- ResRVol: %.2x",ch->resRVol);
ImGui::Text("- oscOut: %d",ch->oscOut);
COMMON_CHAN_DEBUG_BOOL;
ImGui::TextColored(ch->volChanged.lVol?colorOn:colorOff,">> LVolChanged");
ImGui::TextColored(ch->volChanged.rVol?colorOn:colorOff,">> RVolChanged");
ImGui::TextColored(ch->filterChanged.mode?colorOn:colorOff,">> FilterModeChanged");
ImGui::TextColored(ch->filterChanged.k1?colorOn:colorOff,">> FilterK1Changed");
ImGui::TextColored(ch->filterChanged.k2?colorOn:colorOff,">> FilterK2Changed");
ImGui::TextColored(ch->envChanged.ecount?colorOn:colorOff,">> EnvECountChanged");
ImGui::TextColored(ch->envChanged.lVRamp?colorOn:colorOff,">> EnvLVRampChanged");
ImGui::TextColored(ch->envChanged.rVRamp?colorOn:colorOff,">> EnvRVRampChanged");
ImGui::TextColored(ch->envChanged.k1Ramp?colorOn:colorOff,">> EnvK1RampChanged");
ImGui::TextColored(ch->envChanged.k2Ramp?colorOn:colorOff,">> EnvK2RampChanged");
ImGui::TextColored(ch->pcmChanged.index?colorOn:colorOff,">> PCMIndexChanged");
ImGui::TextColored(ch->pcmChanged.slice?colorOn:colorOff,">> PCMSliceChanged");
ImGui::TextColored(ch->pcmChanged.position?colorOn:colorOff,">> PCMPositionChanged");
ImGui::TextColored(ch->pcmChanged.loopBank?colorOn:colorOff,">> PCMLoopBankChanged");
ImGui::TextColored(ch->isReverseLoop?colorOn:colorOff,">> IsReverseLoop");
ImGui::TextColored(ch->pcm.pause?colorOn:colorOff,">> PCMPause");
ImGui::TextColored(ch->pcm.direction?colorOn:colorOff,">> PCMDirection");
ImGui::TextColored(ch->envelope.k1Slow?colorOn:colorOff,">> EnvK1Slow");
ImGui::TextColored(ch->envelope.k2Slow?colorOn:colorOff,">> EnvK2Slow");
ImGui::TextColored(ch->overwrite.envelope.k1Slow?colorOn:colorOff,">> EnvK1SlowOverwrite");
ImGui::TextColored(ch->overwrite.envelope.k2Slow?colorOn:colorOff,">> EnvK2SlowOverwrite");
ImGui::TextColored(ch->overwrite.state.mode?colorOn:colorOff,">> FilterModeOverwrited");
ImGui::TextColored(ch->overwrite.state.k1?colorOn:colorOff,">> FilterK1Overwrited");
ImGui::TextColored(ch->overwrite.state.k2?colorOn:colorOff,">> FilterK2Overwrited");
ImGui::TextColored(ch->overwrite.state.ecount?colorOn:colorOff,">> EnvECountOverwrited");
ImGui::TextColored(ch->overwrite.state.lVRamp?colorOn:colorOff,">> EnvLVRampOverwrited");
ImGui::TextColored(ch->overwrite.state.rVRamp?colorOn:colorOff,">> EnvRVRampOverwrited");
ImGui::TextColored(ch->overwrite.state.k1Ramp?colorOn:colorOff,">> EnvK1RampOverwrited");
ImGui::TextColored(ch->overwrite.state.k2Ramp?colorOn:colorOff,">> EnvK2RampOverwrited");
break;
}
case DIV_SYSTEM_LYNX: {
DivPlatformLynx::Channel* ch=(DivPlatformLynx::Channel*)data;
ImGui::Text("> Lynx");

View File

@ -191,7 +191,6 @@ void FurnaceGUI::drawDebug() {
ImGui::Text("loopMode: %d (<NULL!>)",(unsigned char)sample->loopMode);
}
ImGui::Text("depth: %d",(unsigned char)sample->depth);
ImGui::Text("length8: %d",sample->length8);
ImGui::Text("length16: %d",sample->length16);
ImGui::Text("length1: %d",sample->length1);

View File

@ -984,7 +984,6 @@ const int availableSystems[]={
DIV_SYSTEM_VRC6,
DIV_SYSTEM_FDS,
DIV_SYSTEM_MMC5,
DIV_SYSTEM_ES5506,
DIV_SYSTEM_SCC,
DIV_SYSTEM_SCC_PLUS,
DIV_SYSTEM_YMZ280B,
@ -1102,7 +1101,6 @@ const int chipsSample[]={
DIV_SYSTEM_K007232,
DIV_SYSTEM_GA20,
DIV_SYSTEM_PCM_DAC,
DIV_SYSTEM_ES5506,
0 // don't remove this last one!
};

View File

@ -295,8 +295,8 @@ const char* es5506EnvelopeModes[3]={
"k1 slowdown", "k2 slowdown", NULL
};
const char* es5506ControlModes[3]={
"pause", "reverse", NULL
const char* es5506ControlModes[2]={
"pause", NULL
};
const int orderedOps[4]={
@ -4326,9 +4326,7 @@ void FurnaceGUI::drawInsEdit() {
}
ImGui::EndCombo();
}
// Wavetable
if (ins->type==DIV_INS_AMIGA || ins->type==DIV_INS_SNES) {
ImGui::BeginDisabled(ins->amiga.useNoteMap);
P(ImGui::Checkbox("Use wavetable (Amiga/SNES/Generic DAC only)",&ins->amiga.useWave));
if (ins->amiga.useWave) {
int len=ins->amiga.waveLen+1;
@ -4350,14 +4348,12 @@ void FurnaceGUI::drawInsEdit() {
PARAMETER
}
}
ImGui::EndDisabled();
}
// Note map
ImGui::BeginDisabled(ins->amiga.useWave);
P(ImGui::Checkbox("Use sample map",&ins->amiga.useNoteMap));
if (ins->amiga.useNoteMap) {
// TODO: frequency map?
if (ImGui::BeginTable("NoteMap",2/*3*/,ImGuiTableFlags_ScrollY|ImGuiTableFlags_Borders|ImGuiTableFlags_SizingStretchSame)) {
if (ImGui::BeginTable("NoteMap",2,ImGuiTableFlags_ScrollY|ImGuiTableFlags_Borders|ImGuiTableFlags_SizingStretchSame)) {
ImGui::TableSetupColumn("c0",ImGuiTableColumnFlags_WidthFixed);
ImGui::TableSetupColumn("c1",ImGuiTableColumnFlags_WidthStretch);
//ImGui::TableSetupColumn("c2",ImGuiTableColumnFlags_WidthStretch);
@ -5102,10 +5098,6 @@ void FurnaceGUI::drawInsEdit() {
dutyLabel="Duty";
dutyMax=ins->amiga.useSample?0:7;
}
if (ins->type==DIV_INS_ES5506) {
dutyLabel="Filter Mode";
dutyMax=3;
}
if (ins->type==DIV_INS_SU) {
dutyMax=127;
}
@ -5449,8 +5441,7 @@ void FurnaceGUI::drawInsEdit() {
macroList.push_back(FurnaceGUIMacroDesc("Envelope K1 ramp",&ins->std.ex6Macro,-128,127,160,uiColors[GUI_COLOR_MACRO_OTHER]));
macroList.push_back(FurnaceGUIMacroDesc("Envelope K2 ramp",&ins->std.ex7Macro,-128,127,160,uiColors[GUI_COLOR_MACRO_OTHER]));
macroList.push_back(FurnaceGUIMacroDesc("Envelope mode",&ins->std.ex8Macro,0,2,64,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,es5506EnvelopeModes));
macroList.push_back(FurnaceGUIMacroDesc("Channel assignment",&ins->std.fbMacro,0,5,64,uiColors[GUI_COLOR_MACRO_OTHER]));
macroList.push_back(FurnaceGUIMacroDesc("Control",&ins->std.algMacro,0,2,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,es5506ControlModes));
macroList.push_back(FurnaceGUIMacroDesc("Control",&ins->std.algMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,es5506ControlModes));
}
if (ins->type==DIV_INS_MSM5232) {
macroList.push_back(FurnaceGUIMacroDesc("Noise",&ins->std.ex3Macro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));

View File

@ -2012,11 +2012,6 @@ void FurnaceGUI::initSystemPresets() {
CH(DIV_SYSTEM_X1_010, 1.0f, 0, "clockSel=1")
}
);
ENTRY(
"Sammy/Seta/Visco SSV", {
CH(DIV_SYSTEM_ES5506, 1.0f, 0, "channels=31")
}
);
ENTRY(
"Cave 68000", {
CH(DIV_SYSTEM_YMZ280B, 1.0f, 0, "")
@ -2429,11 +2424,6 @@ void FurnaceGUI::initSystemPresets() {
CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, "")
}
);
ENTRY(
"Ensoniq ES5506 (OTTO)", {
CH(DIV_SYSTEM_ES5506, 1.0f, 0, "channels=31")
}
);
CATEGORY_END;
CATEGORY_BEGIN("Wavetable","chips which use user-specified waveforms to generate sound.");

View File

@ -248,7 +248,6 @@ void FurnaceGUI::drawSampleEdit() {
}
ImGui::EndCombo();
}
ImGui::Text("Length: %d",sample->samples);
bool isThereSNES=false;
for (int i=0; i<e->song.systemLen; i++) {

View File

@ -845,7 +845,7 @@ bool FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool mo
altered=true;
}
ImGui::Text("Initial channel limit:");
if (CWSliderInt("##N163_InitialChannelLimit",&channels,1,8)) {
if (CWSliderInt("##InitialChannelLimit",&channels,1,8)) {
if (channels<1) channels=1;
if (channels>8) channels=8;
altered=true;
@ -863,22 +863,6 @@ bool FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool mo
}
break;
}
case DIV_SYSTEM_ES5506: {
int channels=flags.getInt("channels",0x1f)+1;
ImGui::Text("Initial channel limit:");
if (CWSliderInt("##OTTO_InitialChannelLimit",&channels,5,32)) {
if (channels<5) channels=5;
if (channels>32) channels=32;
altered=true;
} rightClickable
if (altered) {
e->lockSave([&]() {
flags.set("channels",channels-1);
});
}
break;
}
case DIV_SYSTEM_YM2203:
case DIV_SYSTEM_YM2203_EXT:
case DIV_SYSTEM_YM2203_CSM: {