mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-24 05:25:12 +00:00
Merge branch 'tildearrow:master' into master
This commit is contained in:
commit
ce1444965a
84 changed files with 483 additions and 314 deletions
BIN
demos/x16/Shades of Blue.fur
Normal file
BIN
demos/x16/Shades of Blue.fur
Normal file
Binary file not shown.
|
@ -13,7 +13,8 @@ every instrument can be renamed and have its type changed.
|
||||||
depending on the instrument type, there are many different types of instrument editor:
|
depending on the instrument type, there are many different types of instrument editor:
|
||||||
|
|
||||||
- [FM synthesis](fm.md) - for use with YM2612, YM2151 and FM block portion of YM2610.
|
- [FM synthesis](fm.md) - for use with YM2612, YM2151 and FM block portion of YM2610.
|
||||||
- [Standard](standard.md) - for use with NES and Sega Master System's PSG sound source and its derivatives.
|
- [PSG](psg.md) - for use with TI SN76489 and derivatives like Sega Master System's PSG.
|
||||||
|
- [NES](nes.md) - for use with NES.
|
||||||
- [Game Boy](game-boy.md) - for use with Game Boy APU.
|
- [Game Boy](game-boy.md) - for use with Game Boy APU.
|
||||||
- [PC Engine / TurboGrafx-16](pce.md) - for use with PC Engine's wavetable synthesizer.
|
- [PC Engine / TurboGrafx-16](pce.md) - for use with PC Engine's wavetable synthesizer.
|
||||||
- [WonderSwan](wonderswan.md) - for use with WonderSwan's wavetable synthesizer.
|
- [WonderSwan](wonderswan.md) - for use with WonderSwan's wavetable synthesizer.
|
||||||
|
|
18
doc/4-instrument/nes.md
Normal file
18
doc/4-instrument/nes.md
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# Standard instrument editor
|
||||||
|
|
||||||
|
The instrument editor for NES consists of these macros:
|
||||||
|
|
||||||
|
- **Volume**: volume.
|
||||||
|
- **Arpeggio**: pitch in half-steps.
|
||||||
|
- **Duty**: duty cycle and noise mode.
|
||||||
|
- pulse duty cycles:
|
||||||
|
- `0`: 12.5%
|
||||||
|
- `1`: 25%
|
||||||
|
- `2`: 50%
|
||||||
|
- `3`: 75%
|
||||||
|
- noise modes:
|
||||||
|
- `0`: long noise.
|
||||||
|
- `1`: short noise.
|
||||||
|
- **Panning**: output for left and right channels.
|
||||||
|
- **Pitch**: fine pitch.
|
||||||
|
- **Phase Reset**: trigger restart of waveform.
|
14
doc/4-instrument/psg.md
Normal file
14
doc/4-instrument/psg.md
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# PSG instrument editor
|
||||||
|
|
||||||
|
The instrument editor for PSG (SMS, MSX, and other TI SN76489 derivatives) consists of these macros:
|
||||||
|
|
||||||
|
- **Volume**: volume.
|
||||||
|
- **Arpeggio**: pitch in half-steps.
|
||||||
|
- **Duty**: noise mode.
|
||||||
|
- `0`: short noise, preset frequencies.
|
||||||
|
- `1`: long noise, preset frequencies.
|
||||||
|
- `2`: short noise, use channel 3 for frequency.
|
||||||
|
- `3`: long noise, use channel 3 for frequency.
|
||||||
|
- **Panning**: output for left and right channels.
|
||||||
|
- **Pitch**: fine pitch.
|
||||||
|
- **Phase Reset**: trigger restart of waveform.
|
|
@ -1,10 +0,0 @@
|
||||||
# Standard instrument editor
|
|
||||||
|
|
||||||
The instrument editor for NES and PSG (SMS, MSX, and such) consists of these macros:
|
|
||||||
|
|
||||||
- **Volume**: volume
|
|
||||||
- **Arpeggio**: pitch in half-steps
|
|
||||||
- **Duty**: duty cycle and noise mode for NES channels. _Note:_ This has no effect on Sega Master System.
|
|
||||||
- **Panning**: output for left and right channels
|
|
||||||
- **Pitch**: fine pitch
|
|
||||||
- **Phase Reset**: trigger restart of waveform
|
|
|
@ -295,6 +295,8 @@ struct DivRegWrite {
|
||||||
*/
|
*/
|
||||||
unsigned int addr;
|
unsigned int addr;
|
||||||
unsigned int val;
|
unsigned int val;
|
||||||
|
DivRegWrite():
|
||||||
|
addr(0), val(0) {}
|
||||||
DivRegWrite(unsigned int a, unsigned int v):
|
DivRegWrite(unsigned int a, unsigned int v):
|
||||||
addr(a), val(v) {}
|
addr(a), val(v) {}
|
||||||
};
|
};
|
||||||
|
|
140
src/engine/fixedQueue.h
Normal file
140
src/engine/fixedQueue.h
Normal file
|
@ -0,0 +1,140 @@
|
||||||
|
/**
|
||||||
|
* 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 _FIXED_QUEUE_H
|
||||||
|
#define _FIXED_QUEUE_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include "../ta-log.h"
|
||||||
|
|
||||||
|
template<typename T, size_t items> struct FixedQueue {
|
||||||
|
size_t readPos, writePos;
|
||||||
|
T data[items];
|
||||||
|
|
||||||
|
T& front();
|
||||||
|
T& back();
|
||||||
|
bool pop();
|
||||||
|
bool push(const T& item);
|
||||||
|
|
||||||
|
bool pop_front();
|
||||||
|
bool pop_back();
|
||||||
|
bool push_front(const T& item);
|
||||||
|
bool push_back(const T& item);
|
||||||
|
void clear();
|
||||||
|
bool empty();
|
||||||
|
size_t size();
|
||||||
|
FixedQueue():
|
||||||
|
readPos(0),
|
||||||
|
writePos(0) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename T, size_t items> T& FixedQueue<T,items>::front() {
|
||||||
|
return data[readPos];
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T, size_t items> T& FixedQueue<T,items>::back() {
|
||||||
|
if (writePos==0) return data[items-1];
|
||||||
|
return data[writePos-1];
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T, size_t items> bool FixedQueue<T,items>::pop() {
|
||||||
|
if (readPos==writePos) return false;
|
||||||
|
if (++readPos>=items) readPos=0;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T, size_t items> bool FixedQueue<T,items>::push(const T& item) {
|
||||||
|
if (writePos==(readPos-1)) {
|
||||||
|
logW("queue overflow!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (writePos==items-1 && readPos==0) {
|
||||||
|
logW("queue overflow!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
data[writePos]=item;
|
||||||
|
if (++writePos>=items) writePos=0;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T, size_t items> bool FixedQueue<T,items>::pop_front() {
|
||||||
|
if (readPos==writePos) return false;
|
||||||
|
if (++readPos>=items) readPos=0;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T, size_t items> bool FixedQueue<T,items>::push_back(const T& item) {
|
||||||
|
if (writePos==(readPos-1)) {
|
||||||
|
logW("queue overflow!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (writePos==items-1 && readPos==0) {
|
||||||
|
logW("queue overflow!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
data[writePos]=item;
|
||||||
|
if (++writePos>=items) writePos=0;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T, size_t items> bool FixedQueue<T,items>::pop_back() {
|
||||||
|
if (readPos==writePos) return false;
|
||||||
|
if (writePos>0) {
|
||||||
|
writePos--;
|
||||||
|
} else {
|
||||||
|
writePos=items-1;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T, size_t items> bool FixedQueue<T,items>::push_front(const T& item) {
|
||||||
|
if (readPos==(writePos+1)) {
|
||||||
|
logW("stack overflow!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (readPos==0 && writePos==items-1) {
|
||||||
|
logW("stack overflow!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (readPos>0) {
|
||||||
|
readPos--;
|
||||||
|
} else {
|
||||||
|
readPos=items-1;
|
||||||
|
}
|
||||||
|
data[readPos]=item;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T, size_t items> void FixedQueue<T,items>::clear() {
|
||||||
|
readPos=0;
|
||||||
|
writePos=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T, size_t items> bool FixedQueue<T,items>::empty() {
|
||||||
|
return (readPos==writePos);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T, size_t items> size_t FixedQueue<T,items>::size() {
|
||||||
|
if (readPos>writePos) {
|
||||||
|
return items+writePos-readPos;
|
||||||
|
}
|
||||||
|
return writePos-readPos;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -21,7 +21,6 @@
|
||||||
#define _AMIGA_H
|
#define _AMIGA_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
|
||||||
#include "../waveSynth.h"
|
#include "../waveSynth.h"
|
||||||
|
|
||||||
class DivPlatformAmiga: public DivDispatch {
|
class DivPlatformAmiga: public DivDispatch {
|
||||||
|
|
|
@ -878,7 +878,7 @@ void DivPlatformArcade::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformArcade::reset() {
|
void DivPlatformArcade::reset() {
|
||||||
while (!writes.empty()) writes.pop_front();
|
writes.clear();
|
||||||
memset(regPool,0,256);
|
memset(regPool,0,256);
|
||||||
if (useYMFM) {
|
if (useYMFM) {
|
||||||
fm_ymfm->reset();
|
fm_ymfm->reset();
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#ifndef _ARCADE_H
|
#ifndef _ARCADE_H
|
||||||
#define _ARCADE_H
|
#define _ARCADE_H
|
||||||
#include "fmshared_OPM.h"
|
#include "fmshared_OPM.h"
|
||||||
#include <queue>
|
|
||||||
#include "../../../extern/opm/opm.h"
|
#include "../../../extern/opm/opm.h"
|
||||||
#include "sound/ymfm/ymfm_opm.h"
|
#include "sound/ymfm/ymfm_opm.h"
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#define rWrite(a,v) if (!skipRegisterWrites) {pendingWrites[a]=v;}
|
#define rWrite(a,v) if (!skipRegisterWrites) {pendingWrites[a]=v;}
|
||||||
#define immWrite(a,v) if (!skipRegisterWrites) {writes.emplace(regRemap(a),v); if (dumpWrites) {addWrite(regRemap(a),v);} }
|
#define immWrite(a,v) if (!skipRegisterWrites) {writes.push(QueuedWrite(regRemap(a),v)); if (dumpWrites) {addWrite(regRemap(a),v);} }
|
||||||
|
|
||||||
#define CHIP_DIVIDER (extMode?extDiv:((sunsoft||clockSel)?16:8))
|
#define CHIP_DIVIDER (extMode?extDiv:((sunsoft||clockSel)?16:8))
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#ifndef _AY_H
|
#ifndef _AY_H
|
||||||
#define _AY_H
|
#define _AY_H
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
#include "sound/ay8910.h"
|
#include "sound/ay8910.h"
|
||||||
|
|
||||||
class DivPlatformAY8910: public DivDispatch {
|
class DivPlatformAY8910: public DivDispatch {
|
||||||
|
@ -89,9 +89,10 @@ class DivPlatformAY8910: public DivDispatch {
|
||||||
unsigned short addr;
|
unsigned short addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
bool addrOrVal;
|
bool addrOrVal;
|
||||||
|
QueuedWrite(): addr(0), val(0), addrOrVal(false) {}
|
||||||
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v), addrOrVal(false) {}
|
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v), addrOrVal(false) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,128> writes;
|
||||||
ay8910_device* ay;
|
ay8910_device* ay;
|
||||||
DivDispatchOscBuffer* oscBuf[3];
|
DivDispatchOscBuffer* oscBuf[3];
|
||||||
unsigned char regPool[16];
|
unsigned char regPool[16];
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#define rWrite(a,v) if (!skipRegisterWrites) {pendingWrites[a]=v;}
|
#define rWrite(a,v) if (!skipRegisterWrites) {pendingWrites[a]=v;}
|
||||||
#define immWrite2(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} }
|
#define immWrite2(a,v) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);} }
|
||||||
|
|
||||||
#define CHIP_DIVIDER (clockSel?8:4)
|
#define CHIP_DIVIDER (clockSel?8:4)
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#ifndef _AY8930_H
|
#ifndef _AY8930_H
|
||||||
#define _AY8930_H
|
#define _AY8930_H
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
#include "sound/ay8910.h"
|
#include "sound/ay8910.h"
|
||||||
|
|
||||||
class DivPlatformAY8930: public DivDispatch {
|
class DivPlatformAY8930: public DivDispatch {
|
||||||
|
@ -99,9 +99,10 @@ class DivPlatformAY8930: public DivDispatch {
|
||||||
unsigned short addr;
|
unsigned short addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
bool addrOrVal;
|
bool addrOrVal;
|
||||||
|
QueuedWrite(): addr(0), val(0), addrOrVal(false) {}
|
||||||
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v), addrOrVal(false) {}
|
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v), addrOrVal(false) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,128> writes;
|
||||||
ay8930_device* ay;
|
ay8930_device* ay;
|
||||||
DivDispatchOscBuffer* oscBuf[3];
|
DivDispatchOscBuffer* oscBuf[3];
|
||||||
unsigned char regPool[32];
|
unsigned char regPool[32];
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#define _K005289_H
|
#define _K005289_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
|
||||||
#include "../waveSynth.h"
|
#include "../waveSynth.h"
|
||||||
#include "vgsound_emu/src/k005289/k005289.hpp"
|
#include "vgsound_emu/src/k005289/k005289.hpp"
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "../../ta-log.h"
|
#include "../../ta-log.h"
|
||||||
|
|
||||||
#define rWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} }
|
#define rWrite(a,v) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);} }
|
||||||
|
|
||||||
#define CHIP_FREQBASE 524288
|
#define CHIP_FREQBASE 524288
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define _C64_H
|
#define _C64_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
#include "sound/c64/sid.h"
|
#include "sound/c64/sid.h"
|
||||||
#include "sound/c64_fp/SID.h"
|
#include "sound/c64_fp/SID.h"
|
||||||
#include "sound/c64_d/dsid.h"
|
#include "sound/c64_d/dsid.h"
|
||||||
|
@ -62,9 +62,10 @@ class DivPlatformC64: public DivDispatch {
|
||||||
struct QueuedWrite {
|
struct QueuedWrite {
|
||||||
unsigned char addr;
|
unsigned char addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
|
QueuedWrite(): addr(0), val(0) {}
|
||||||
QueuedWrite(unsigned char a, unsigned char v): addr(a), val(v) {}
|
QueuedWrite(unsigned char a, unsigned char v): addr(a), val(v) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,128> writes;
|
||||||
|
|
||||||
unsigned char filtControl, filtRes, vol;
|
unsigned char filtControl, filtRes, vol;
|
||||||
unsigned char writeOscBuf;
|
unsigned char writeOscBuf;
|
||||||
|
|
|
@ -26,9 +26,8 @@
|
||||||
#define PITCH_OFFSET ((double)(16*2048*(chanMax+1)))
|
#define PITCH_OFFSET ((double)(16*2048*(chanMax+1)))
|
||||||
#define NOTE_ES5506(c,note) (parent->calcBaseFreq(chipClock,chan[c].pcm.freqOffs,note,false))
|
#define NOTE_ES5506(c,note) (parent->calcBaseFreq(chipClock,chan[c].pcm.freqOffs,note,false))
|
||||||
|
|
||||||
#define rWrite(a,...) {if(!skipRegisterWrites) {hostIntf32.emplace(4,(a),__VA_ARGS__); }}
|
#define rWrite(a,...) {if(!skipRegisterWrites) {hostIntf32.push_back(QueuedHostIntf(4,(a),__VA_ARGS__)); }}
|
||||||
//#define rRead(a,st,...) {hostIntf32.emplace(st,4,(a),__VA_ARGS__);}
|
#define immWrite(a,...) {hostIntf32.push_back(QueuedHostIntf(4,(a),__VA_ARGS__));}
|
||||||
#define immWrite(a,...) {hostIntf32.emplace(4,(a),__VA_ARGS__);}
|
|
||||||
#define pageWrite(p,a,...) \
|
#define pageWrite(p,a,...) \
|
||||||
if (!skipRegisterWrites) { \
|
if (!skipRegisterWrites) { \
|
||||||
if (curPage!=(p)) { \
|
if (curPage!=(p)) { \
|
||||||
|
@ -118,15 +117,15 @@ void DivPlatformES5506::acquire(short** buf, size_t len) {
|
||||||
while (!hostIntf32.empty()) {
|
while (!hostIntf32.empty()) {
|
||||||
QueuedHostIntf w=hostIntf32.front();
|
QueuedHostIntf w=hostIntf32.front();
|
||||||
if (w.isRead && (w.read!=NULL)) {
|
if (w.isRead && (w.read!=NULL)) {
|
||||||
hostIntf8.emplace(w.state,0,w.addr,w.read,w.mask);
|
hostIntf8.push(QueuedHostIntf(w.state,0,w.addr,w.read,w.mask));
|
||||||
hostIntf8.emplace(w.state,1,w.addr,w.read,w.mask);
|
hostIntf8.push(QueuedHostIntf(w.state,1,w.addr,w.read,w.mask));
|
||||||
hostIntf8.emplace(w.state,2,w.addr,w.read,w.mask);
|
hostIntf8.push(QueuedHostIntf(w.state,2,w.addr,w.read,w.mask));
|
||||||
hostIntf8.emplace(w.state,3,w.addr,w.read,w.mask,w.delay);
|
hostIntf8.push(QueuedHostIntf(w.state,3,w.addr,w.read,w.mask,w.delay));
|
||||||
} else {
|
} else {
|
||||||
hostIntf8.emplace(0,w.addr,w.val,w.mask);
|
hostIntf8.push(QueuedHostIntf(0,w.addr,w.val,w.mask));
|
||||||
hostIntf8.emplace(1,w.addr,w.val,w.mask);
|
hostIntf8.push(QueuedHostIntf(1,w.addr,w.val,w.mask));
|
||||||
hostIntf8.emplace(2,w.addr,w.val,w.mask);
|
hostIntf8.push(QueuedHostIntf(2,w.addr,w.val,w.mask));
|
||||||
hostIntf8.emplace(3,w.addr,w.val,w.mask,w.delay);
|
hostIntf8.push(QueuedHostIntf(3,w.addr,w.val,w.mask,w.delay));
|
||||||
}
|
}
|
||||||
hostIntf32.pop();
|
hostIntf32.pop();
|
||||||
}
|
}
|
||||||
|
@ -1095,8 +1094,6 @@ DivMacroInt* DivPlatformES5506::getChanMacroInt(int ch) {
|
||||||
void DivPlatformES5506::reset() {
|
void DivPlatformES5506::reset() {
|
||||||
while (!hostIntf32.empty()) hostIntf32.pop();
|
while (!hostIntf32.empty()) hostIntf32.pop();
|
||||||
while (!hostIntf8.empty()) hostIntf8.pop();
|
while (!hostIntf8.empty()) hostIntf8.pop();
|
||||||
while (!queuedRead.empty()) queuedRead.pop();
|
|
||||||
while (!queuedReadState.empty()) queuedReadState.pop();
|
|
||||||
for (int i=0; i<32; i++) {
|
for (int i=0; i<32; i++) {
|
||||||
chan[i]=DivPlatformES5506::Channel();
|
chan[i]=DivPlatformES5506::Channel();
|
||||||
chan[i].std.setEngine(parent);
|
chan[i].std.setEngine(parent);
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include "../engine.h"
|
#include "../engine.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
#include "../macroInt.h"
|
#include "../macroInt.h"
|
||||||
#include "../sample.h"
|
#include "../sample.h"
|
||||||
#include "vgsound_emu/src/es550x/es5506.hpp"
|
#include "vgsound_emu/src/es550x/es5506.hpp"
|
||||||
|
@ -238,6 +238,15 @@ class DivPlatformES5506: public DivDispatch, public es550x_intf {
|
||||||
unsigned int* read;
|
unsigned int* read;
|
||||||
unsigned short delay;
|
unsigned short delay;
|
||||||
bool isRead;
|
bool isRead;
|
||||||
|
QueuedHostIntf():
|
||||||
|
state(0),
|
||||||
|
step(0),
|
||||||
|
addr(0),
|
||||||
|
val(0),
|
||||||
|
mask(0),
|
||||||
|
read(NULL),
|
||||||
|
delay(0),
|
||||||
|
isRead(false) {}
|
||||||
QueuedHostIntf(unsigned char s, unsigned char a, unsigned int v, unsigned int m=(unsigned int)(~0), unsigned short d=0):
|
QueuedHostIntf(unsigned char s, unsigned char a, unsigned int v, unsigned int m=(unsigned int)(~0), unsigned short d=0):
|
||||||
state(0),
|
state(0),
|
||||||
step(s),
|
step(s),
|
||||||
|
@ -257,17 +266,8 @@ class DivPlatformES5506: public DivDispatch, public es550x_intf {
|
||||||
delay(d),
|
delay(d),
|
||||||
isRead(true) {}
|
isRead(true) {}
|
||||||
};
|
};
|
||||||
struct QueuedReadState {
|
FixedQueue<QueuedHostIntf,2048> hostIntf32;
|
||||||
unsigned int* read;
|
FixedQueue<QueuedHostIntf,2048> hostIntf8;
|
||||||
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, volScale;
|
int cycle, curPage, volScale;
|
||||||
unsigned char maskedVal;
|
unsigned char maskedVal;
|
||||||
unsigned int irqv;
|
unsigned int irqv;
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include "../instrument.h"
|
#include "../instrument.h"
|
||||||
#include <deque>
|
#include "../fixedQueue.h"
|
||||||
|
|
||||||
#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)
|
||||||
|
|
||||||
|
@ -79,9 +79,10 @@ class DivPlatformFMBase: public DivDispatch {
|
||||||
unsigned short addr;
|
unsigned short addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
bool addrOrVal;
|
bool addrOrVal;
|
||||||
|
QueuedWrite(): addr(0), val(0), addrOrVal(false) {}
|
||||||
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v), addrOrVal(false) {}
|
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v), addrOrVal(false) {}
|
||||||
};
|
};
|
||||||
std::deque<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,2048> writes;
|
||||||
|
|
||||||
unsigned char lastBusy;
|
unsigned char lastBusy;
|
||||||
int delay;
|
int delay;
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include "../../ta-log.h"
|
#include "../../ta-log.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#define rWrite(a,v) {if(!skipRegisterWrites) {writes.emplace(a,v); if(dumpWrites) addWrite(a,v);}}
|
#define rWrite(a,v) {if(!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if(dumpWrites) addWrite(a,v);}}
|
||||||
|
|
||||||
#define CHIP_DIVIDER 64
|
#define CHIP_DIVIDER 64
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ void DivPlatformGA20::acquire(short** buf, size_t len) {
|
||||||
ga20.write(w.addr,w.val);
|
ga20.write(w.addr,w.val);
|
||||||
regPool[w.addr]=w.val;
|
regPool[w.addr]=w.val;
|
||||||
writes.pop();
|
writes.pop();
|
||||||
delay=w.delay;
|
delay=1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
short *buffer[4]={
|
short *buffer[4]={
|
||||||
|
@ -361,9 +361,7 @@ DivDispatchOscBuffer* DivPlatformGA20::getOscBuffer(int ch) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformGA20::reset() {
|
void DivPlatformGA20::reset() {
|
||||||
while (!writes.empty()) {
|
writes.clear();
|
||||||
writes.pop();
|
|
||||||
}
|
|
||||||
memset(regPool,0,32);
|
memset(regPool,0,32);
|
||||||
ga20.device_reset();
|
ga20.device_reset();
|
||||||
delay=0;
|
delay=0;
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define _GA20_H
|
#define _GA20_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
#include "../macroInt.h"
|
#include "../macroInt.h"
|
||||||
#include "sound/ga20/iremga20.h"
|
#include "sound/ga20/iremga20.h"
|
||||||
|
|
||||||
|
@ -47,15 +47,14 @@ class DivPlatformGA20: public DivDispatch, public iremga20_intf {
|
||||||
DivDispatchOscBuffer* oscBuf[4];
|
DivDispatchOscBuffer* oscBuf[4];
|
||||||
bool isMuted[4];
|
bool isMuted[4];
|
||||||
struct QueuedWrite {
|
struct QueuedWrite {
|
||||||
unsigned short addr;
|
unsigned char addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
unsigned short delay;
|
QueuedWrite(): addr(0), val(0) {}
|
||||||
QueuedWrite(unsigned short a, unsigned char v, unsigned short d=1):
|
QueuedWrite(unsigned char a, unsigned char v):
|
||||||
addr(a),
|
addr(a),
|
||||||
val(v),
|
val(v) {}
|
||||||
delay(d) {}
|
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,256> writes;
|
||||||
unsigned int sampleOffGA20[256];
|
unsigned int sampleOffGA20[256];
|
||||||
bool sampleLoaded[256];
|
bool sampleLoaded[256];
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
#include "../../ta-log.h"
|
#include "../../ta-log.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#define rWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); regPool[(a)&0x7f]=v; if (dumpWrites) {addWrite(a,v);} }
|
#define rWrite(a,v) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); regPool[(a)&0x7f]=v; if (dumpWrites) {addWrite(a,v);} }
|
||||||
#define immWrite(a,v) {writes.emplace(a,v); regPool[(a)&0x7f]=v; if (dumpWrites) {addWrite(a,v);} }
|
#define immWrite(a,v) {writes.push(QueuedWrite(a,v)); regPool[(a)&0x7f]=v; if (dumpWrites) {addWrite(a,v);} }
|
||||||
|
|
||||||
#define CHIP_DIVIDER 16
|
#define CHIP_DIVIDER 16
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include "../waveSynth.h"
|
#include "../waveSynth.h"
|
||||||
#include "sound/gb/gb.h"
|
#include "sound/gb/gb.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
|
|
||||||
class DivPlatformGB: public DivDispatch {
|
class DivPlatformGB: public DivDispatch {
|
||||||
struct Channel: public SharedChannel<signed char> {
|
struct Channel: public SharedChannel<signed char> {
|
||||||
|
@ -64,9 +64,10 @@ class DivPlatformGB: public DivDispatch {
|
||||||
struct QueuedWrite {
|
struct QueuedWrite {
|
||||||
unsigned char addr;
|
unsigned char addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
|
QueuedWrite(): addr(0), val(0) {}
|
||||||
QueuedWrite(unsigned char a, unsigned char v): addr(a), val(v) {}
|
QueuedWrite(unsigned char a, unsigned char v): addr(a), val(v) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,256> writes;
|
||||||
|
|
||||||
int antiClickPeriodCount, antiClickWavePos;
|
int antiClickPeriodCount, antiClickWavePos;
|
||||||
|
|
||||||
|
|
|
@ -284,7 +284,7 @@ void DivPlatformGenesis::acquire(short** buf, size_t len) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformGenesis::fillStream(std::vector<DivDelayedWrite>& stream, int sRate, size_t len) {
|
void DivPlatformGenesis::fillStream(std::vector<DivDelayedWrite>& stream, int sRate, size_t len) {
|
||||||
while (!writes.empty()) writes.pop_front();
|
writes.clear();
|
||||||
for (size_t i=0; i<len; i++) {
|
for (size_t i=0; i<len; i++) {
|
||||||
processDAC(sRate);
|
processDAC(sRate);
|
||||||
|
|
||||||
|
@ -1282,7 +1282,7 @@ float DivPlatformGenesis::getPostAmp() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformGenesis::reset() {
|
void DivPlatformGenesis::reset() {
|
||||||
while (!writes.empty()) writes.pop_front();
|
writes.clear();
|
||||||
memset(regPool,0,512);
|
memset(regPool,0,512);
|
||||||
if (useYMFM) {
|
if (useYMFM) {
|
||||||
fm_ymfm->reset();
|
fm_ymfm->reset();
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include "../../ta-log.h"
|
#include "../../ta-log.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#define rWrite(a,v) {if(!skipRegisterWrites) {writes.emplace(a,v); if(dumpWrites) addWrite(a,v);}}
|
#define rWrite(a,v) {if(!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if(dumpWrites) addWrite(a,v);}}
|
||||||
|
|
||||||
#define CHIP_DIVIDER 64
|
#define CHIP_DIVIDER 64
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define _K007232_H
|
#define _K007232_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
#include "../macroInt.h"
|
#include "../macroInt.h"
|
||||||
#include "vgsound_emu/src/k007232/k007232.hpp"
|
#include "vgsound_emu/src/k007232/k007232.hpp"
|
||||||
|
|
||||||
|
@ -57,12 +57,13 @@ class DivPlatformK007232: public DivDispatch, public k007232_intf {
|
||||||
unsigned short addr;
|
unsigned short addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
unsigned short delay;
|
unsigned short delay;
|
||||||
|
QueuedWrite(): addr(0), val(0), delay(1) {}
|
||||||
QueuedWrite(unsigned short a, unsigned char v, unsigned short d=1):
|
QueuedWrite(unsigned short a, unsigned char v, unsigned short d=1):
|
||||||
addr(a),
|
addr(a),
|
||||||
val(v),
|
val(v),
|
||||||
delay(d) {}
|
delay(d) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,256> writes;
|
||||||
unsigned int sampleOffK007232[256];
|
unsigned int sampleOffK007232[256];
|
||||||
bool sampleLoaded[256];
|
bool sampleLoaded[256];
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
//#define rWrite(a,v) pendingWrites[a]=v;
|
//#define rWrite(a,v) pendingWrites[a]=v;
|
||||||
#define rWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} }
|
#define rWrite(a,v) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);} }
|
||||||
|
|
||||||
#define NOTE_LINEAR(x) ((x)<<7)
|
#define NOTE_LINEAR(x) ((x)<<7)
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define _MSM5232_H
|
#define _MSM5232_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
#include "sound/oki/msm5232.h"
|
#include "sound/oki/msm5232.h"
|
||||||
|
|
||||||
class DivPlatformMSM5232: public DivDispatch {
|
class DivPlatformMSM5232: public DivDispatch {
|
||||||
|
@ -48,9 +48,10 @@ class DivPlatformMSM5232: public DivDispatch {
|
||||||
struct QueuedWrite {
|
struct QueuedWrite {
|
||||||
unsigned char addr;
|
unsigned char addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
|
QueuedWrite(): addr(0), val(0) {}
|
||||||
QueuedWrite(unsigned char a, unsigned char v): addr(a), val(v) {}
|
QueuedWrite(unsigned char a, unsigned char v): addr(a), val(v) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,256> writes;
|
||||||
|
|
||||||
int cycles, curChan, delay, detune, clockDriftAccum;
|
int cycles, curChan, delay, detune, clockDriftAccum;
|
||||||
unsigned int clockDriftLFOPos, clockDriftLFOSpeed;
|
unsigned int clockDriftLFOPos, clockDriftLFOSpeed;
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#define rWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} }
|
#define rWrite(a,v) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);} }
|
||||||
|
|
||||||
const char** DivPlatformMSM6258::getRegisterSheet() {
|
const char** DivPlatformMSM6258::getRegisterSheet() {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define _MSM6258_H
|
#define _MSM6258_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
#include "sound/oki/okim6258.h"
|
#include "sound/oki/okim6258.h"
|
||||||
|
|
||||||
class DivPlatformMSM6258: public DivDispatch {
|
class DivPlatformMSM6258: public DivDispatch {
|
||||||
|
@ -42,9 +42,10 @@ class DivPlatformMSM6258: public DivDispatch {
|
||||||
struct QueuedWrite {
|
struct QueuedWrite {
|
||||||
unsigned short addr;
|
unsigned short addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
|
QueuedWrite(): addr(0), val(0) {}
|
||||||
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v) {}
|
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,256> writes;
|
||||||
okim6258_device* msm;
|
okim6258_device* msm;
|
||||||
unsigned char lastBusy;
|
unsigned char lastBusy;
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,8 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#define rWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} }
|
#define rWrite(a,v) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);} }
|
||||||
#define rWriteDelay(a,v,d) if (!skipRegisterWrites) {writes.emplace(a,v,d); if (dumpWrites) {addWrite(a,v);} }
|
#define rWriteDelay(a,v,d) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v,d)); if (dumpWrites) {addWrite(a,v);} }
|
||||||
|
|
||||||
const char** DivPlatformMSM6295::getRegisterSheet() {
|
const char** DivPlatformMSM6295::getRegisterSheet() {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define _MSM6295_H
|
#define _MSM6295_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
#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 {
|
||||||
|
@ -41,12 +41,13 @@ class DivPlatformMSM6295: public DivDispatch, public vgsound_emu_mem_intf {
|
||||||
unsigned short addr;
|
unsigned short addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
unsigned short delay;
|
unsigned short delay;
|
||||||
|
QueuedWrite(): addr(0), val(0), delay(96) {}
|
||||||
QueuedWrite(unsigned short a, unsigned char v, unsigned short d=96):
|
QueuedWrite(unsigned short a, unsigned char v, unsigned short d=96):
|
||||||
addr(a),
|
addr(a),
|
||||||
val(v),
|
val(v),
|
||||||
delay(d) {}
|
delay(d) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,256> writes;
|
||||||
msm6295_core msm;
|
msm6295_core msm;
|
||||||
unsigned char lastBusy;
|
unsigned char lastBusy;
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,8 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#define rRead(a,v) n163.addr_w(a); n163.data_r(v);
|
#define rRead(a,v) n163.addr_w(a); n163.data_r(v);
|
||||||
#define rWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} }
|
#define rWrite(a,v) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);} }
|
||||||
#define rWriteMask(a,v,m) if (!skipRegisterWrites) {writes.emplace(a,v,m); if (dumpWrites) {addWrite(a,v);} }
|
#define rWriteMask(a,v,m) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v,m)); if (dumpWrites) {addWrite(a,v);} }
|
||||||
#define chWrite(c,a,v) \
|
#define chWrite(c,a,v) \
|
||||||
if (c<=chanMax) { \
|
if (c<=chanMax) { \
|
||||||
rWrite(0x78-(c<<3)+(a&7),v) \
|
rWrite(0x78-(c<<3)+(a&7),v) \
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define _N163_H
|
#define _N163_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
#include "../waveSynth.h"
|
#include "../waveSynth.h"
|
||||||
#include "vgsound_emu/src/n163/n163.hpp"
|
#include "vgsound_emu/src/n163/n163.hpp"
|
||||||
|
|
||||||
|
@ -57,9 +57,10 @@ class DivPlatformN163: public DivDispatch {
|
||||||
unsigned char addr;
|
unsigned char addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
unsigned char mask;
|
unsigned char mask;
|
||||||
|
QueuedWrite(): addr(0), val(0), mask(~0) {}
|
||||||
QueuedWrite(unsigned char a, unsigned char v, unsigned char m=~0): addr(a), val(v), mask(m) {}
|
QueuedWrite(unsigned char a, unsigned char v, unsigned char m=~0): addr(a), val(v), mask(m) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,2048> writes;
|
||||||
unsigned char initChanMax;
|
unsigned char initChanMax;
|
||||||
unsigned char chanMax;
|
unsigned char chanMax;
|
||||||
short loadWave, loadPos, loadLen;
|
short loadWave, loadPos, loadLen;
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
//#define rWrite(a,v) pendingWrites[a]=v;
|
//#define rWrite(a,v) pendingWrites[a]=v;
|
||||||
#define rWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} }
|
#define rWrite(a,v) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);} }
|
||||||
|
|
||||||
#define CHIP_FREQBASE 4194304
|
#define CHIP_FREQBASE 4194304
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define _NAMCOWSG_H
|
#define _NAMCOWSG_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
#include "../waveSynth.h"
|
#include "../waveSynth.h"
|
||||||
#include "sound/namco.h"
|
#include "sound/namco.h"
|
||||||
|
|
||||||
|
@ -43,9 +43,10 @@ class DivPlatformNamcoWSG: public DivDispatch {
|
||||||
struct QueuedWrite {
|
struct QueuedWrite {
|
||||||
unsigned short addr;
|
unsigned short addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
|
QueuedWrite(): addr(0), val(0) {}
|
||||||
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v) {}
|
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,256> writes;
|
||||||
|
|
||||||
namco_audio_device* namco;
|
namco_audio_device* namco;
|
||||||
int devType, chans;
|
int devType, chans;
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#define rWrite(a,v) if (!skipRegisterWrites) {pendingWrites[a]=v;}
|
#define rWrite(a,v) if (!skipRegisterWrites) {pendingWrites[a]=v;}
|
||||||
#define immWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} }
|
#define immWrite(a,v) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);} }
|
||||||
|
|
||||||
#define KVSL(x,y) ((chan[x].state.op[orderedOpsL1[ops==4][y]].kvs==2 && isOutputL[ops==4][chan[x].state.alg][y]) || chan[x].state.op[orderedOpsL1[ops==4][y]].kvs==1)
|
#define KVSL(x,y) ((chan[x].state.op[orderedOpsL1[ops==4][y]].kvs==2 && isOutputL[ops==4][chan[x].state.alg][y]) || chan[x].state.op[orderedOpsL1[ops==4][y]].kvs==1)
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define _OPL_H
|
#define _OPL_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
#include "../../../extern/opl/opl3.h"
|
#include "../../../extern/opl/opl3.h"
|
||||||
#include "sound/ymfm/ymfm_adpcm.h"
|
#include "sound/ymfm/ymfm_adpcm.h"
|
||||||
|
|
||||||
|
@ -64,9 +64,10 @@ class DivPlatformOPL: public DivDispatch {
|
||||||
unsigned short addr;
|
unsigned short addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
bool addrOrVal;
|
bool addrOrVal;
|
||||||
|
QueuedWrite(): addr(0), val(0), addrOrVal(false) {}
|
||||||
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v), addrOrVal(false) {}
|
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v), addrOrVal(false) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,2048> writes;
|
||||||
opl3_chip fm;
|
opl3_chip fm;
|
||||||
unsigned char* adpcmBMem;
|
unsigned char* adpcmBMem;
|
||||||
size_t adpcmBMemLen;
|
size_t adpcmBMemLen;
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#define rWrite(a,v) if (!skipRegisterWrites) {pendingWrites[a]=v;}
|
#define rWrite(a,v) if (!skipRegisterWrites) {pendingWrites[a]=v;}
|
||||||
#define immWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} }
|
#define immWrite(a,v) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);} }
|
||||||
|
|
||||||
#define CHIP_FREQBASE 1180068
|
#define CHIP_FREQBASE 1180068
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define _OPLL_H
|
#define _OPLL_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "../../../extern/Nuked-OPLL/opll.h"
|
#include "../../../extern/Nuked-OPLL/opll.h"
|
||||||
|
@ -50,9 +50,10 @@ class DivPlatformOPLL: public DivDispatch {
|
||||||
unsigned short addr;
|
unsigned short addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
bool addrOrVal;
|
bool addrOrVal;
|
||||||
|
QueuedWrite(): addr(0), val(0), addrOrVal(false) {}
|
||||||
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v), addrOrVal(false) {}
|
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v), addrOrVal(false) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,512> writes;
|
||||||
opll_t fm;
|
opll_t fm;
|
||||||
int delay, lastCustomMemory;
|
int delay, lastCustomMemory;
|
||||||
unsigned char lastBusy;
|
unsigned char lastBusy;
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
//#define rWrite(a,v) pendingWrites[a]=v;
|
//#define rWrite(a,v) pendingWrites[a]=v;
|
||||||
#define rWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} }
|
#define rWrite(a,v) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);} }
|
||||||
#define chWrite(c,a,v) \
|
#define chWrite(c,a,v) \
|
||||||
if (!skipRegisterWrites) { \
|
if (!skipRegisterWrites) { \
|
||||||
if (curChan!=c) { \
|
if (curChan!=c) { \
|
||||||
|
@ -531,7 +531,7 @@ int DivPlatformPCE::getRegisterPoolSize() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformPCE::reset() {
|
void DivPlatformPCE::reset() {
|
||||||
while (!writes.empty()) writes.pop();
|
writes.clear();
|
||||||
memset(regPool,0,128);
|
memset(regPool,0,128);
|
||||||
for (int i=0; i<6; i++) {
|
for (int i=0; i<6; i++) {
|
||||||
chan[i]=DivPlatformPCE::Channel();
|
chan[i]=DivPlatformPCE::Channel();
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define _PCE_H
|
#define _PCE_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
#include "../waveSynth.h"
|
#include "../waveSynth.h"
|
||||||
#include "sound/pce_psg.h"
|
#include "sound/pce_psg.h"
|
||||||
|
|
||||||
|
@ -62,9 +62,10 @@ class DivPlatformPCE: public DivDispatch {
|
||||||
struct QueuedWrite {
|
struct QueuedWrite {
|
||||||
unsigned char addr;
|
unsigned char addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
|
QueuedWrite(): addr(0), val(9) {}
|
||||||
QueuedWrite(unsigned char a, unsigned char v): addr(a), val(v) {}
|
QueuedWrite(unsigned char a, unsigned char v): addr(a), val(v) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,512> writes;
|
||||||
unsigned char lastPan;
|
unsigned char lastPan;
|
||||||
|
|
||||||
int cycles, curChan, delay;
|
int cycles, curChan, delay;
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#define _PCM_DAC_H
|
#define _PCM_DAC_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
|
||||||
#include "../waveSynth.h"
|
#include "../waveSynth.h"
|
||||||
|
|
||||||
class DivPlatformPCMDAC: public DivDispatch {
|
class DivPlatformPCMDAC: public DivDispatch {
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define _PCSPKR_H
|
#define _PCSPKR_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
|
@ -40,12 +40,16 @@ class DivPlatformPCSpeaker: public DivDispatch {
|
||||||
struct RealQueueVal {
|
struct RealQueueVal {
|
||||||
int tv_sec, tv_nsec;
|
int tv_sec, tv_nsec;
|
||||||
unsigned short val;
|
unsigned short val;
|
||||||
|
RealQueueVal():
|
||||||
|
tv_sec(0),
|
||||||
|
tv_nsec(0),
|
||||||
|
val(0) {}
|
||||||
RealQueueVal(int sec, int nsec, unsigned short v):
|
RealQueueVal(int sec, int nsec, unsigned short v):
|
||||||
tv_sec(sec),
|
tv_sec(sec),
|
||||||
tv_nsec(nsec),
|
tv_nsec(nsec),
|
||||||
val(v) {}
|
val(v) {}
|
||||||
};
|
};
|
||||||
std::queue<RealQueueVal> realQueue;
|
FixedQueue<RealQueueVal,2048> realQueue;
|
||||||
std::mutex realQueueLock;
|
std::mutex realQueueLock;
|
||||||
bool isMuted[1];
|
bool isMuted[1];
|
||||||
bool on, flip, lastOn, realOutEnabled;
|
bool on, flip, lastOn, realOutEnabled;
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include "../engine.h"
|
#include "../engine.h"
|
||||||
#include "../../ta-log.h"
|
#include "../../ta-log.h"
|
||||||
|
|
||||||
#define rWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} }
|
#define rWrite(a,v) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);} }
|
||||||
|
|
||||||
#define CHIP_DIVIDER 1
|
#define CHIP_DIVIDER 1
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define _POKEY_H
|
#define _POKEY_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "sound/pokey/mzpokeysnd.h"
|
#include "sound/pokey/mzpokeysnd.h"
|
||||||
|
@ -45,9 +45,10 @@ class DivPlatformPOKEY: public DivDispatch {
|
||||||
struct QueuedWrite {
|
struct QueuedWrite {
|
||||||
unsigned char addr;
|
unsigned char addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
|
QueuedWrite(): addr(0), val(0) {}
|
||||||
QueuedWrite(unsigned char a, unsigned char v): addr(a), val(v) {}
|
QueuedWrite(unsigned char a, unsigned char v): addr(a), val(v) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,128> writes;
|
||||||
unsigned char audctl, skctl;
|
unsigned char audctl, skctl;
|
||||||
bool audctlChanged, skctlChanged;
|
bool audctlChanged, skctlChanged;
|
||||||
unsigned char oscBufDelay;
|
unsigned char oscBufDelay;
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include "sound/d65modified.h"
|
#include "sound/d65modified.h"
|
||||||
#include <queue>
|
|
||||||
|
|
||||||
class DivPlatformPV1000: public DivDispatch {
|
class DivPlatformPV1000: public DivDispatch {
|
||||||
struct Channel: public SharedChannel<int> {
|
struct Channel: public SharedChannel<int> {
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#define _QSOUND_H
|
#define _QSOUND_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
|
||||||
#include "sound/qsound.h"
|
#include "sound/qsound.h"
|
||||||
|
|
||||||
class DivPlatformQSound: public DivDispatch {
|
class DivPlatformQSound: public DivDispatch {
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#define _RF5C68_H
|
#define _RF5C68_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
|
||||||
#include "sound/rf5c68.h"
|
#include "sound/rf5c68.h"
|
||||||
|
|
||||||
class DivPlatformRF5C68: public DivDispatch {
|
class DivPlatformRF5C68: public DivDispatch {
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#define rWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} }
|
#define rWrite(a,v) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);} }
|
||||||
|
|
||||||
#define CHIP_DIVIDER 2
|
#define CHIP_DIVIDER 2
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define _SAA_H
|
#define _SAA_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
#include "../../../extern/SAASound/src/SAASound.h"
|
#include "../../../extern/SAASound/src/SAASound.h"
|
||||||
|
|
||||||
class DivPlatformSAA1099: public DivDispatch {
|
class DivPlatformSAA1099: public DivDispatch {
|
||||||
|
@ -44,9 +44,10 @@ class DivPlatformSAA1099: public DivDispatch {
|
||||||
unsigned short addr;
|
unsigned short addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
bool addrOrVal;
|
bool addrOrVal;
|
||||||
|
QueuedWrite(): addr(0), val(0), addrOrVal(false) {}
|
||||||
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v), addrOrVal(false) {}
|
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v), addrOrVal(false) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,256> writes;
|
||||||
CSAASound* saa_saaSound;
|
CSAASound* saa_saaSound;
|
||||||
unsigned char regPool[32];
|
unsigned char regPool[32];
|
||||||
unsigned char lastBusy;
|
unsigned char lastBusy;
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#define _SCC_H
|
#define _SCC_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
|
||||||
#include "../waveSynth.h"
|
#include "../waveSynth.h"
|
||||||
#include "vgsound_emu/src/scc/scc.hpp"
|
#include "vgsound_emu/src/scc/scc.hpp"
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#define rWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} }
|
#define rWrite(a,v) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);} }
|
||||||
#define chWrite(c,a,v) rWrite(((c)<<3)+(a),v)
|
#define chWrite(c,a,v) rWrite(((c)<<3)+(a),v)
|
||||||
|
|
||||||
void DivPlatformSegaPCM::acquire(short** buf, size_t len) {
|
void DivPlatformSegaPCM::acquire(short** buf, size_t len) {
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include "../instrument.h"
|
#include "../instrument.h"
|
||||||
#include "sound/segapcm.h"
|
#include "sound/segapcm.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
|
|
||||||
class DivPlatformSegaPCM: public DivDispatch {
|
class DivPlatformSegaPCM: public DivDispatch {
|
||||||
protected:
|
protected:
|
||||||
|
@ -59,9 +59,10 @@ class DivPlatformSegaPCM: public DivDispatch {
|
||||||
unsigned short addr;
|
unsigned short addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
bool addrOrVal;
|
bool addrOrVal;
|
||||||
|
QueuedWrite(): addr(0), val(0), addrOrVal(false) {}
|
||||||
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v), addrOrVal(false) {}
|
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v), addrOrVal(false) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,1024> writes;
|
||||||
segapcm_device pcm;
|
segapcm_device pcm;
|
||||||
int delay;
|
int delay;
|
||||||
int pcmL, pcmR, pcmCycles;
|
int pcmL, pcmR, pcmCycles;
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
//#define rWrite(a,v) pendingWrites[a]=v;
|
//#define rWrite(a,v) pendingWrites[a]=v;
|
||||||
#define rWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} }
|
#define rWrite(a,v) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);} }
|
||||||
|
|
||||||
#define CHIP_DIVIDER 64
|
#define CHIP_DIVIDER 64
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define _SM8521_H
|
#define _SM8521_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
#include "../waveSynth.h"
|
#include "../waveSynth.h"
|
||||||
#include "sound/sm8521.h"
|
#include "sound/sm8521.h"
|
||||||
|
|
||||||
|
@ -48,9 +48,10 @@ class DivPlatformSM8521: public DivDispatch {
|
||||||
struct QueuedWrite {
|
struct QueuedWrite {
|
||||||
unsigned short addr;
|
unsigned short addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
|
QueuedWrite(): addr(0), val(0) {}
|
||||||
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v) {}
|
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,128> writes;
|
||||||
|
|
||||||
bool antiClickEnabled;
|
bool antiClickEnabled;
|
||||||
struct sm8521_t sm8521;
|
struct sm8521_t sm8521;
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include "../../ta-log.h"
|
#include "../../ta-log.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#define rWrite(a,v) {if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);}}}
|
#define rWrite(a,v) {if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);}}}
|
||||||
|
|
||||||
const char* regCheatSheetSN[]={
|
const char* regCheatSheetSN[]={
|
||||||
"DATA", "0",
|
"DATA", "0",
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "../../../extern/Nuked-PSG/ympsg.h"
|
#include "../../../extern/Nuked-PSG/ympsg.h"
|
||||||
}
|
}
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
|
|
||||||
class DivPlatformSMS: public DivDispatch {
|
class DivPlatformSMS: public DivDispatch {
|
||||||
struct Channel: public SharedChannel<signed char> {
|
struct Channel: public SharedChannel<signed char> {
|
||||||
|
@ -59,9 +59,10 @@ class DivPlatformSMS: public DivDispatch {
|
||||||
unsigned short addr;
|
unsigned short addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
bool addrOrVal;
|
bool addrOrVal;
|
||||||
|
QueuedWrite(): addr(0), val(0), addrOrVal(false) {}
|
||||||
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v), addrOrVal(false) {}
|
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v), addrOrVal(false) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,128> writes;
|
||||||
friend void putDispatchChip(void*,int);
|
friend void putDispatchChip(void*,int);
|
||||||
friend void putDispatchChan(void*,int,int);
|
friend void putDispatchChan(void*,int,int);
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include "../waveSynth.h"
|
#include "../waveSynth.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
#include "sound/snes/SPC_DSP.h"
|
#include "sound/snes/SPC_DSP.h"
|
||||||
|
|
||||||
class DivPlatformSNES: public DivDispatch {
|
class DivPlatformSNES: public DivDispatch {
|
||||||
|
@ -81,9 +81,10 @@ class DivPlatformSNES: public DivDispatch {
|
||||||
struct QueuedWrite {
|
struct QueuedWrite {
|
||||||
unsigned char addr;
|
unsigned char addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
|
QueuedWrite(): addr(0), val(0) {}
|
||||||
QueuedWrite(unsigned char a, unsigned char v): addr(a), val(v) {}
|
QueuedWrite(unsigned char a, unsigned char v): addr(a), val(v) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,256> writes;
|
||||||
|
|
||||||
signed char sampleMem[65536];
|
signed char sampleMem[65536];
|
||||||
signed char copyOfSampleMem[65536];
|
signed char copyOfSampleMem[65536];
|
||||||
|
|
|
@ -351,7 +351,7 @@ void SID::write(int offset, unsigned char value)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x04: // Voice #1 control register
|
case 0x04: // Voice #1 control register
|
||||||
voice[0]->writeCONTROL_REG(muted[0] ? 0 : value);
|
voice[0]->writeCONTROL_REG(value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x05: // Voice #1 Attack and Decay length
|
case 0x05: // Voice #1 Attack and Decay length
|
||||||
|
@ -379,7 +379,7 @@ void SID::write(int offset, unsigned char value)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x0b: // Voice #2 control register
|
case 0x0b: // Voice #2 control register
|
||||||
voice[1]->writeCONTROL_REG(muted[1] ? 0 : value);
|
voice[1]->writeCONTROL_REG(value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x0c: // Voice #2 Attack and Decay length
|
case 0x0c: // Voice #2 Attack and Decay length
|
||||||
|
@ -407,7 +407,7 @@ void SID::write(int offset, unsigned char value)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x12: // Voice #3 control register
|
case 0x12: // Voice #3 control register
|
||||||
voice[2]->writeCONTROL_REG(muted[2] ? 0 : value);
|
voice[2]->writeCONTROL_REG(value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x13: // Voice #3 Attack and Decay length
|
case 0x13: // Voice #3 Attack and Decay length
|
||||||
|
|
|
@ -320,11 +320,11 @@ int SID::output()
|
||||||
const int v2 = voice[1]->output(voice[0]->wave());
|
const int v2 = voice[1]->output(voice[0]->wave());
|
||||||
const int v3 = voice[2]->output(voice[1]->wave());
|
const int v3 = voice[2]->output(voice[1]->wave());
|
||||||
|
|
||||||
lastChanOut[0]=v1;
|
lastChanOut[0]=muted[0]?0:v1;
|
||||||
lastChanOut[1]=v2;
|
lastChanOut[1]=muted[1]?0:v2;
|
||||||
lastChanOut[2]=v3;
|
lastChanOut[2]=muted[2]?0:v3;
|
||||||
|
|
||||||
return externalFilter->clock(filter->clock(v1, v2, v3));
|
return externalFilter->clock(filter->clock(muted[0]?0:v1, muted[1]?0:v2, muted[2]?0:v3));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ void okim6258_device::device_reset()
|
||||||
|
|
||||||
void okim6258_device::sound_stream_update(short** outputs, int len)
|
void okim6258_device::sound_stream_update(short** outputs, int len)
|
||||||
{
|
{
|
||||||
auto &buffer = outputs[0];
|
short* buffer = outputs[0];
|
||||||
|
|
||||||
if (m_status & STATUS_PLAYING)
|
if (m_status & STATUS_PLAYING)
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
//#define rWrite(a,v) pendingWrites[a]=v;
|
//#define rWrite(a,v) pendingWrites[a]=v;
|
||||||
#define rWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} }
|
#define rWrite(a,v) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);} }
|
||||||
#define chWrite(c,a,v) rWrite(((c)<<5)|(a),v);
|
#define chWrite(c,a,v) rWrite(((c)<<5)|(a),v);
|
||||||
|
|
||||||
#define CHIP_DIVIDER 2
|
#define CHIP_DIVIDER 2
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define _SU_H
|
#define _SU_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
#include "sound/su.h"
|
#include "sound/su.h"
|
||||||
|
|
||||||
class DivPlatformSoundUnit: public DivDispatch {
|
class DivPlatformSoundUnit: public DivDispatch {
|
||||||
|
@ -74,9 +74,10 @@ class DivPlatformSoundUnit: public DivDispatch {
|
||||||
struct QueuedWrite {
|
struct QueuedWrite {
|
||||||
unsigned char addr;
|
unsigned char addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
|
QueuedWrite(): addr(0), val(0) {}
|
||||||
QueuedWrite(unsigned char a, unsigned char v): addr(a), val(v) {}
|
QueuedWrite(unsigned char a, unsigned char v): addr(a), val(v) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,512> writes;
|
||||||
unsigned char lastPan;
|
unsigned char lastPan;
|
||||||
bool sampleMemSize;
|
bool sampleMemSize;
|
||||||
unsigned char ilCtrl, ilSize, fil1;
|
unsigned char ilCtrl, ilSize, fil1;
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
#include "../engine.h"
|
#include "../engine.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#define rWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);}}
|
#define rWrite(a,v) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);}}
|
||||||
#define postWrite(a,v) postDACWrites.emplace(a,v);
|
#define postWrite(a,v) postDACWrites.push(DivRegWrite(a,v));
|
||||||
|
|
||||||
#define CHIP_DIVIDER 32
|
#define CHIP_DIVIDER 32
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include "../waveSynth.h"
|
#include "../waveSynth.h"
|
||||||
#include "sound/swan.h"
|
#include "sound/swan.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
|
|
||||||
class DivPlatformSwan: public DivDispatch {
|
class DivPlatformSwan: public DivDispatch {
|
||||||
struct Channel: public SharedChannel<int> {
|
struct Channel: public SharedChannel<int> {
|
||||||
|
@ -48,10 +48,11 @@ class DivPlatformSwan: public DivDispatch {
|
||||||
struct QueuedWrite {
|
struct QueuedWrite {
|
||||||
unsigned char addr;
|
unsigned char addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
|
QueuedWrite(): addr(0), val(0) {}
|
||||||
QueuedWrite(unsigned char a, unsigned char v): addr(a), val(v) {}
|
QueuedWrite(unsigned char a, unsigned char v): addr(a), val(v) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,256> writes;
|
||||||
std::queue<DivRegWrite> postDACWrites;
|
FixedQueue<DivRegWrite,2048> postDACWrites;
|
||||||
WSwan* ws;
|
WSwan* ws;
|
||||||
void updateWave(int ch);
|
void updateWave(int ch);
|
||||||
friend void putDispatchChip(void*,int);
|
friend void putDispatchChip(void*,int);
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
//#define rWrite(a,v) pendingWrites[a]=v;
|
//#define rWrite(a,v) pendingWrites[a]=v;
|
||||||
#define rWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} }
|
#define rWrite(a,v) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);} }
|
||||||
|
|
||||||
const char* regCheatSheetT6W28[]={
|
const char* regCheatSheetT6W28[]={
|
||||||
"Data0", "0",
|
"Data0", "0",
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define _T6W28_H
|
#define _T6W28_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
#include "sound/t6w28/T6W28_Apu.h"
|
#include "sound/t6w28/T6W28_Apu.h"
|
||||||
|
|
||||||
class DivPlatformT6W28: public DivDispatch {
|
class DivPlatformT6W28: public DivDispatch {
|
||||||
|
@ -40,9 +40,10 @@ class DivPlatformT6W28: public DivDispatch {
|
||||||
struct QueuedWrite {
|
struct QueuedWrite {
|
||||||
unsigned char addr;
|
unsigned char addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
|
QueuedWrite(): addr(0), val(0) {}
|
||||||
QueuedWrite(unsigned char a, unsigned char v): addr(a), val(v) {}
|
QueuedWrite(unsigned char a, unsigned char v): addr(a), val(v) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,256> writes;
|
||||||
unsigned char lastPan;
|
unsigned char lastPan;
|
||||||
|
|
||||||
int cycles, curChan, delay;
|
int cycles, curChan, delay;
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#define _TIA_H
|
#define _TIA_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
|
||||||
#include "sound/tia/Audio.h"
|
#include "sound/tia/Audio.h"
|
||||||
|
|
||||||
class DivPlatformTIA: public DivDispatch {
|
class DivPlatformTIA: public DivDispatch {
|
||||||
|
|
|
@ -986,7 +986,7 @@ void DivPlatformTX81Z::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformTX81Z::reset() {
|
void DivPlatformTX81Z::reset() {
|
||||||
while (!writes.empty()) writes.pop_front();
|
writes.clear();
|
||||||
memset(regPool,0,330);
|
memset(regPool,0,330);
|
||||||
fm_ymfm->reset();
|
fm_ymfm->reset();
|
||||||
if (dumpWrites) {
|
if (dumpWrites) {
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define _TX81Z_H
|
#define _TX81Z_H
|
||||||
|
|
||||||
#include "fmshared_OPM.h"
|
#include "fmshared_OPM.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
#include "sound/ymfm/ymfm_opz.h"
|
#include "sound/ymfm/ymfm_opz.h"
|
||||||
|
|
||||||
class DivTXInterface: public ymfm::ymfm_interface {
|
class DivTXInterface: public ymfm::ymfm_interface {
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
//#define rWrite(a,v) pendingWrites[a]=v;
|
//#define rWrite(a,v) pendingWrites[a]=v;
|
||||||
#define rWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} }
|
#define rWrite(a,v) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);} }
|
||||||
#define chWrite(c,a,v) rWrite(0x400+((c)<<6)+((a)<<2),v);
|
#define chWrite(c,a,v) rWrite(0x400+((c)<<6)+((a)<<2),v);
|
||||||
|
|
||||||
#define CHIP_DIVIDER 16
|
#define CHIP_DIVIDER 16
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define _PLATFORM_VB_H
|
#define _PLATFORM_VB_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
#include "../waveSynth.h"
|
#include "../waveSynth.h"
|
||||||
#include "sound/vsu.h"
|
#include "sound/vsu.h"
|
||||||
|
|
||||||
|
@ -46,9 +46,10 @@ class DivPlatformVB: public DivDispatch {
|
||||||
struct QueuedWrite {
|
struct QueuedWrite {
|
||||||
unsigned short addr;
|
unsigned short addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
|
QueuedWrite(): addr(0), val(0) {}
|
||||||
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v) {}
|
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,2048> writes;
|
||||||
unsigned char lastPan;
|
unsigned char lastPan;
|
||||||
|
|
||||||
int cycles, curChan, delay;
|
int cycles, curChan, delay;
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include "sound/vic20sound.h"
|
#include "sound/vic20sound.h"
|
||||||
#include <queue>
|
|
||||||
|
|
||||||
class DivPlatformVIC20: public DivDispatch {
|
class DivPlatformVIC20: public DivDispatch {
|
||||||
struct Channel: public SharedChannel<int> {
|
struct Channel: public SharedChannel<int> {
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#define rWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} }
|
#define rWrite(a,v) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);} }
|
||||||
#define chWrite(c,a,v) rWrite(0x9000+(c<<12)+(a&3),v)
|
#define chWrite(c,a,v) rWrite(0x9000+(c<<12)+(a&3),v)
|
||||||
|
|
||||||
const char* regCheatSheetVRC6[]={
|
const char* regCheatSheetVRC6[]={
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#ifndef _VRC6_H
|
#ifndef _VRC6_H
|
||||||
#define _VRC6_H
|
#define _VRC6_H
|
||||||
|
|
||||||
#include <queue>
|
#include "../fixedQueue.h"
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include "vgsound_emu/src/vrcvi/vrcvi.hpp"
|
#include "vgsound_emu/src/vrcvi/vrcvi.hpp"
|
||||||
|
|
||||||
|
@ -49,9 +49,10 @@ class DivPlatformVRC6: public DivDispatch, public vrcvi_intf {
|
||||||
struct QueuedWrite {
|
struct QueuedWrite {
|
||||||
unsigned short addr;
|
unsigned short addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
|
QueuedWrite(): addr(0), val(0) {}
|
||||||
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v) {}
|
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
FixedQueue<QueuedWrite,64> writes;
|
||||||
unsigned char sampleBank;
|
unsigned char sampleBank;
|
||||||
unsigned char writeOscBuf;
|
unsigned char writeOscBuf;
|
||||||
vrcvi_core vrc6;
|
vrcvi_core vrc6;
|
||||||
|
|
|
@ -974,7 +974,7 @@ void DivPlatformYM2203::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformYM2203::reset() {
|
void DivPlatformYM2203::reset() {
|
||||||
while (!writes.empty()) writes.pop_front();
|
writes.clear();
|
||||||
memset(regPool,0,256);
|
memset(regPool,0,256);
|
||||||
if (dumpWrites) {
|
if (dumpWrites) {
|
||||||
addWrite(0xffffffff,0);
|
addWrite(0xffffffff,0);
|
||||||
|
|
|
@ -1481,7 +1481,7 @@ void DivPlatformYM2608::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformYM2608::reset() {
|
void DivPlatformYM2608::reset() {
|
||||||
while (!writes.empty()) writes.pop_front();
|
writes.clear();
|
||||||
memset(regPool,0,512);
|
memset(regPool,0,512);
|
||||||
if (dumpWrites) {
|
if (dumpWrites) {
|
||||||
addWrite(0xffffffff,0);
|
addWrite(0xffffffff,0);
|
||||||
|
|
|
@ -1441,7 +1441,7 @@ void DivPlatformYM2610::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformYM2610::reset() {
|
void DivPlatformYM2610::reset() {
|
||||||
while (!writes.empty()) writes.pop_front();
|
writes.clear();
|
||||||
memset(regPool,0,512);
|
memset(regPool,0,512);
|
||||||
if (dumpWrites) {
|
if (dumpWrites) {
|
||||||
addWrite(0xffffffff,0);
|
addWrite(0xffffffff,0);
|
||||||
|
|
|
@ -1508,7 +1508,7 @@ void DivPlatformYM2610B::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformYM2610B::reset() {
|
void DivPlatformYM2610B::reset() {
|
||||||
while (!writes.empty()) writes.pop_front();
|
writes.clear();
|
||||||
memset(regPool,0,512);
|
memset(regPool,0,512);
|
||||||
if (dumpWrites) {
|
if (dumpWrites) {
|
||||||
addWrite(0xffffffff,0);
|
addWrite(0xffffffff,0);
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#define _YMZ280B_H
|
#define _YMZ280B_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
|
||||||
#include "sound/ymz280b.h"
|
#include "sound/ymz280b.h"
|
||||||
|
|
||||||
class DivPlatformYMZ280B: public DivDispatch {
|
class DivPlatformYMZ280B: public DivDispatch {
|
||||||
|
|
|
@ -260,7 +260,6 @@ int DivPlatformZXBeeper::getRegisterPoolSize() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformZXBeeper::reset() {
|
void DivPlatformZXBeeper::reset() {
|
||||||
while (!writes.empty()) writes.pop();
|
|
||||||
memset(regPool,0,128);
|
memset(regPool,0,128);
|
||||||
for (int i=0; i<6; i++) {
|
for (int i=0; i<6; i++) {
|
||||||
chan[i]=DivPlatformZXBeeper::Channel();
|
chan[i]=DivPlatformZXBeeper::Channel();
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#define _ZXBEEPER_H
|
#define _ZXBEEPER_H
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include <queue>
|
|
||||||
|
|
||||||
class DivPlatformZXBeeper: public DivDispatch {
|
class DivPlatformZXBeeper: public DivDispatch {
|
||||||
struct Channel: public SharedChannel<signed char> {
|
struct Channel: public SharedChannel<signed char> {
|
||||||
|
@ -35,12 +34,6 @@ class DivPlatformZXBeeper: public DivDispatch {
|
||||||
Channel chan[6];
|
Channel chan[6];
|
||||||
DivDispatchOscBuffer* oscBuf[6];
|
DivDispatchOscBuffer* oscBuf[6];
|
||||||
bool isMuted[6];
|
bool isMuted[6];
|
||||||
struct QueuedWrite {
|
|
||||||
unsigned char addr;
|
|
||||||
unsigned char val;
|
|
||||||
QueuedWrite(unsigned char a, unsigned char v): addr(a), val(v) {}
|
|
||||||
};
|
|
||||||
std::queue<QueuedWrite> writes;
|
|
||||||
unsigned char lastPan, ulaOut;
|
unsigned char lastPan, ulaOut;
|
||||||
|
|
||||||
int cycles, curChan, sOffTimer, delay, curSample, curSamplePeriod;
|
int cycles, curChan, sOffTimer, delay, curSample, curSamplePeriod;
|
||||||
|
|
Loading…
Reference in a new issue