mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-27 15:03:01 +00:00
add register view
supported chips only.
This commit is contained in:
parent
f54aeb4c08
commit
df35b8fb45
28 changed files with 240 additions and 8 deletions
|
@ -206,13 +206,25 @@ class DivDispatch {
|
|||
virtual void* getChanState(int chan);
|
||||
|
||||
/**
|
||||
* get this dispatch's state.
|
||||
* get the register pool of this dispatch.
|
||||
* @return a pointer, or NULL.
|
||||
*/
|
||||
virtual unsigned char* getRegisterPool();
|
||||
|
||||
/**
|
||||
* get the size of the register pool of this dispatch.
|
||||
* @return the size.
|
||||
*/
|
||||
virtual int getRegisterPoolSize();
|
||||
|
||||
/**
|
||||
* get this dispatch's state. DO NOT IMPLEMENT YET.
|
||||
* @return a pointer to the dispatch's state. must be deallocated manually!
|
||||
*/
|
||||
virtual void* getState();
|
||||
|
||||
/**
|
||||
* set this dispatch's state.
|
||||
* set this dispatch's state. DO NOT IMPLEMENT YET.
|
||||
* @param state a pointer to a state pertaining to this dispatch,
|
||||
* or NULL if this dispatch does not support state saves.
|
||||
*/
|
||||
|
|
|
@ -728,6 +728,13 @@ void* DivEngine::getDispatchChanState(int ch) {
|
|||
return disCont[dispatchOfChan[ch]].dispatch->getChanState(dispatchChanOfChan[ch]);
|
||||
}
|
||||
|
||||
unsigned char* DivEngine::getRegisterPool(int sys, int& size) {
|
||||
if (sys<0 || sys>=song.systemLen) return NULL;
|
||||
if (disCont[sys].dispatch==NULL) return NULL;
|
||||
size=disCont[sys].dispatch->getRegisterPoolSize();
|
||||
return disCont[sys].dispatch->getRegisterPool();
|
||||
}
|
||||
|
||||
void DivEngine::enableCommandStream(bool enable) {
|
||||
cmdStreamEnabled=enable;
|
||||
}
|
||||
|
|
|
@ -530,6 +530,9 @@ class DivEngine {
|
|||
// get dispatch channel state
|
||||
void* getDispatchChanState(int chan);
|
||||
|
||||
// get register pool
|
||||
unsigned char* getRegisterPool(int sys, int& size);
|
||||
|
||||
// enable command stream dumping
|
||||
void enableCommandStream(bool enable);
|
||||
|
||||
|
|
|
@ -29,6 +29,14 @@ void* DivDispatch::getChanState(int chan) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
unsigned char* DivDispatch::getRegisterPool() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int DivDispatch::getRegisterPoolSize() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void* DivDispatch::getState() {
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -145,6 +145,7 @@ void DivPlatformArcade::acquire_nuked(short* bufL, short* bufR, size_t start, si
|
|||
QueuedWrite& w=writes.front();
|
||||
if (w.addrOrVal) {
|
||||
OPM_Write(&fm,1,w.val);
|
||||
regPool[w.addr&0xff]=w.val;
|
||||
//printf("write: %x = %.2x\n",w.addr,w.val);
|
||||
writes.pop();
|
||||
} else {
|
||||
|
@ -216,6 +217,7 @@ void DivPlatformArcade::acquire_ymfm(short* bufL, short* bufR, size_t start, siz
|
|||
QueuedWrite& w=writes.front();
|
||||
fm_ymfm->write(0x0+((w.addr>>8)<<1),w.addr);
|
||||
fm_ymfm->write(0x1+((w.addr>>8)<<1),w.val);
|
||||
regPool[w.addr&0xff]=w.val;
|
||||
writes.pop();
|
||||
delay=1;
|
||||
}
|
||||
|
@ -877,6 +879,14 @@ void* DivPlatformArcade::getChanState(int ch) {
|
|||
return &chan[ch];
|
||||
}
|
||||
|
||||
unsigned char* DivPlatformArcade::getRegisterPool() {
|
||||
return regPool;
|
||||
}
|
||||
|
||||
int DivPlatformArcade::getRegisterPoolSize() {
|
||||
return 256;
|
||||
}
|
||||
|
||||
void DivPlatformArcade::poke(unsigned int addr, unsigned short val) {
|
||||
immWrite(addr,val);
|
||||
}
|
||||
|
@ -887,6 +897,7 @@ void DivPlatformArcade::poke(std::vector<DivRegWrite>& wlist) {
|
|||
|
||||
void DivPlatformArcade::reset() {
|
||||
while (!writes.empty()) writes.pop();
|
||||
memset(regPool,0,256);
|
||||
if (useYMFM) {
|
||||
fm_ymfm->reset();
|
||||
} else {
|
||||
|
|
|
@ -71,6 +71,8 @@ class DivPlatformArcade: public DivDispatch {
|
|||
ymfm::ym2151::output_data out_ymfm;
|
||||
DivArcadeInterface iface;
|
||||
|
||||
unsigned char regPool[256];
|
||||
|
||||
bool extMode, useYMFM;
|
||||
|
||||
bool isMuted[13];
|
||||
|
@ -90,6 +92,8 @@ class DivPlatformArcade: public DivDispatch {
|
|||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
unsigned char* getRegisterPool();
|
||||
int getRegisterPoolSize();
|
||||
void reset();
|
||||
void forceIns();
|
||||
void tick();
|
||||
|
|
|
@ -94,6 +94,7 @@ void DivPlatformAY8910::acquire(short* bufL, short* bufR, size_t start, size_t l
|
|||
QueuedWrite w=writes.front();
|
||||
ay->address_w(w.addr);
|
||||
ay->data_w(w.val);
|
||||
regPool[w.addr&0x0f]=w.val;
|
||||
writes.pop();
|
||||
}
|
||||
ay->sound_stream_update(ayBuf,len);
|
||||
|
@ -400,9 +401,18 @@ void* DivPlatformAY8910::getChanState(int ch) {
|
|||
return &chan[ch];
|
||||
}
|
||||
|
||||
unsigned char* DivPlatformAY8910::getRegisterPool() {
|
||||
return regPool;
|
||||
}
|
||||
|
||||
int DivPlatformAY8910::getRegisterPoolSize() {
|
||||
return 16;
|
||||
}
|
||||
|
||||
void DivPlatformAY8910::reset() {
|
||||
while (!writes.empty()) writes.pop();
|
||||
ay->device_reset();
|
||||
memset(regPool,0,16);
|
||||
for (int i=0; i<3; i++) {
|
||||
chan[i]=DivPlatformAY8910::Channel();
|
||||
chan[i].vol=0x0f;
|
||||
|
|
|
@ -47,6 +47,7 @@ class DivPlatformAY8910: public DivDispatch {
|
|||
};
|
||||
std::queue<QueuedWrite> writes;
|
||||
ay8910_device* ay;
|
||||
unsigned char regPool[16];
|
||||
unsigned char lastBusy;
|
||||
|
||||
bool dacMode;
|
||||
|
@ -76,6 +77,8 @@ class DivPlatformAY8910: public DivDispatch {
|
|||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
unsigned char* getRegisterPool();
|
||||
int getRegisterPoolSize();
|
||||
void reset();
|
||||
void forceIns();
|
||||
void tick();
|
||||
|
|
|
@ -124,6 +124,7 @@ void DivPlatformAY8930::acquire(short* bufL, short* bufR, size_t start, size_t l
|
|||
} else {
|
||||
ay->data_w(w.val);
|
||||
}
|
||||
regPool[w.addr&0x1f]=w.val;
|
||||
writes.pop();
|
||||
}
|
||||
ay->sound_stream_update(ayBuf,len);
|
||||
|
@ -462,9 +463,18 @@ void* DivPlatformAY8930::getChanState(int ch) {
|
|||
return &chan[ch];
|
||||
}
|
||||
|
||||
unsigned char* DivPlatformAY8930::getRegisterPool() {
|
||||
return regPool;
|
||||
}
|
||||
|
||||
int DivPlatformAY8930::getRegisterPoolSize() {
|
||||
return 32;
|
||||
}
|
||||
|
||||
void DivPlatformAY8930::reset() {
|
||||
while (!writes.empty()) writes.pop();
|
||||
ay->device_reset();
|
||||
memset(regPool,0,32);
|
||||
for (int i=0; i<3; i++) {
|
||||
chan[i]=DivPlatformAY8930::Channel();
|
||||
chan[i].vol=31;
|
||||
|
|
|
@ -47,6 +47,7 @@ class DivPlatformAY8930: public DivDispatch {
|
|||
};
|
||||
std::queue<QueuedWrite> writes;
|
||||
ay8930_device* ay;
|
||||
unsigned char regPool[32];
|
||||
unsigned char ayNoiseAnd, ayNoiseOr;
|
||||
bool bank;
|
||||
|
||||
|
@ -69,6 +70,8 @@ class DivPlatformAY8930: public DivDispatch {
|
|||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
unsigned char* getRegisterPool();
|
||||
int getRegisterPoolSize();
|
||||
void reset();
|
||||
void forceIns();
|
||||
void tick();
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "../engine.h"
|
||||
#include <math.h>
|
||||
|
||||
#define rWrite(a,v) if (!skipRegisterWrites) {sid.write(a,v); if (dumpWrites) {addWrite(a,v);} }
|
||||
#define rWrite(a,v) if (!skipRegisterWrites) {sid.write(a,v); regPool[(a)&0x1f]=v; if (dumpWrites) {addWrite(a,v);} }
|
||||
|
||||
#define CHIP_FREQBASE 524288
|
||||
|
||||
|
@ -467,12 +467,21 @@ void* DivPlatformC64::getChanState(int ch) {
|
|||
return &chan[ch];
|
||||
}
|
||||
|
||||
unsigned char* DivPlatformC64::getRegisterPool() {
|
||||
return regPool;
|
||||
}
|
||||
|
||||
int DivPlatformC64::getRegisterPoolSize() {
|
||||
return 32;
|
||||
}
|
||||
|
||||
void DivPlatformC64::reset() {
|
||||
for (int i=0; i<3; i++) {
|
||||
chan[i]=DivPlatformC64::Channel();
|
||||
}
|
||||
|
||||
sid.reset();
|
||||
memset(regPool,0,32);
|
||||
|
||||
rWrite(0x18,0x0f);
|
||||
|
||||
|
|
|
@ -70,6 +70,7 @@ class DivPlatformC64: public DivDispatch {
|
|||
int filtCut, resetTime;
|
||||
|
||||
SID sid;
|
||||
unsigned char regPool[32];
|
||||
|
||||
friend void putDispatchChan(void*,int,int);
|
||||
|
||||
|
@ -78,6 +79,8 @@ class DivPlatformC64: public DivDispatch {
|
|||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
unsigned char* getRegisterPool();
|
||||
int getRegisterPoolSize();
|
||||
void reset();
|
||||
void forceIns();
|
||||
void tick();
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
#include "../engine.h"
|
||||
#include <math.h>
|
||||
|
||||
#define rWrite(a,v) if (!skipRegisterWrites) {GB_apu_write(gb,a,v); if (dumpWrites) {addWrite(a,v);} }
|
||||
#define immWrite(a,v) {GB_apu_write(gb,a,v); if (dumpWrites) {addWrite(a,v);} }
|
||||
#define rWrite(a,v) if (!skipRegisterWrites) {GB_apu_write(gb,a,v); regPool[(a)&0x7f]=v; if (dumpWrites) {addWrite(a,v);} }
|
||||
#define immWrite(a,v) {GB_apu_write(gb,a,v); regPool[(a)&0x7f]=v; if (dumpWrites) {addWrite(a,v);} }
|
||||
|
||||
#define CHIP_DIVIDER 16
|
||||
|
||||
|
@ -395,6 +395,14 @@ void* DivPlatformGB::getChanState(int ch) {
|
|||
return &chan[ch];
|
||||
}
|
||||
|
||||
unsigned char* DivPlatformGB::getRegisterPool() {
|
||||
return regPool;
|
||||
}
|
||||
|
||||
int DivPlatformGB::getRegisterPoolSize() {
|
||||
return 64;
|
||||
}
|
||||
|
||||
void DivPlatformGB::reset() {
|
||||
for (int i=0; i<4; i++) {
|
||||
chan[i]=DivPlatformGB::Channel();
|
||||
|
@ -403,6 +411,7 @@ void DivPlatformGB::reset() {
|
|||
addWrite(0xffffffff,0);
|
||||
}
|
||||
memset(gb,0,sizeof(GB_gameboy_t));
|
||||
memset(regPool,0,128);
|
||||
gb->model=GB_MODEL_DMG_B;
|
||||
GB_apu_init(gb);
|
||||
GB_set_sample_rate(gb,rate);
|
||||
|
|
|
@ -55,6 +55,8 @@ class DivPlatformGB: public DivDispatch {
|
|||
unsigned char lastPan;
|
||||
|
||||
GB_gameboy_t* gb;
|
||||
unsigned char regPool[128];
|
||||
|
||||
unsigned char procMute();
|
||||
void updateWave();
|
||||
friend void putDispatchChan(void*,int,int);
|
||||
|
@ -62,6 +64,8 @@ class DivPlatformGB: public DivDispatch {
|
|||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
unsigned char* getRegisterPool();
|
||||
int getRegisterPoolSize();
|
||||
void reset();
|
||||
void forceIns();
|
||||
void tick();
|
||||
|
|
|
@ -121,6 +121,7 @@ void DivPlatformGenesis::acquire_nuked(short* bufL, short* bufR, size_t start, s
|
|||
OPN2_Write(&fm,0x1+((w.addr>>8)<<1),w.val);
|
||||
//printf("write: %x = %.2x\n",w.addr,w.val);
|
||||
lastBusy=0;
|
||||
regPool[w.addr&0x1ff]=w.val;
|
||||
writes.pop();
|
||||
} else {
|
||||
lastBusy++;
|
||||
|
@ -190,6 +191,7 @@ void DivPlatformGenesis::acquire_ymfm(short* bufL, short* bufR, size_t start, si
|
|||
QueuedWrite& w=writes.front();
|
||||
fm_ymfm->write(0x0+((w.addr>>8)<<1),w.addr);
|
||||
fm_ymfm->write(0x1+((w.addr>>8)<<1),w.val);
|
||||
regPool[w.addr&0x1ff]=w.val;
|
||||
writes.pop();
|
||||
lastBusy=1;
|
||||
}
|
||||
|
@ -805,8 +807,17 @@ void* DivPlatformGenesis::getChanState(int ch) {
|
|||
return &chan[ch];
|
||||
}
|
||||
|
||||
unsigned char* DivPlatformGenesis::getRegisterPool() {
|
||||
return regPool;
|
||||
}
|
||||
|
||||
int DivPlatformGenesis::getRegisterPoolSize() {
|
||||
return 512;
|
||||
}
|
||||
|
||||
void DivPlatformGenesis::reset() {
|
||||
while (!writes.empty()) writes.pop();
|
||||
memset(regPool,0,512);
|
||||
if (useYMFM) {
|
||||
fm_ymfm->reset();
|
||||
}
|
||||
|
|
|
@ -79,6 +79,7 @@ class DivPlatformGenesis: public DivDispatch {
|
|||
ymfm::ym2612* fm_ymfm;
|
||||
ymfm::ym2612::output_data out_ymfm;
|
||||
DivYM2612Interface iface;
|
||||
unsigned char regPool[512];
|
||||
|
||||
bool dacMode;
|
||||
int dacPeriod;
|
||||
|
@ -106,6 +107,8 @@ class DivPlatformGenesis: public DivDispatch {
|
|||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
unsigned char* getRegisterPool();
|
||||
int getRegisterPoolSize();
|
||||
void reset();
|
||||
void forceIns();
|
||||
void tick();
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#define CHIP_DIVIDER 16
|
||||
|
||||
#define rWrite(a,v) if (!skipRegisterWrites) {apu_wr_reg(nes,a,v); if (dumpWrites) {addWrite(a,v);} }
|
||||
#define rWrite(a,v) if (!skipRegisterWrites) {apu_wr_reg(nes,a,v); regPool[(a)&0x7f]=v; if (dumpWrites) {addWrite(a,v);} }
|
||||
|
||||
const char* regCheatSheetNES[]={
|
||||
"S0Volume", "4000",
|
||||
|
@ -444,6 +444,14 @@ void* DivPlatformNES::getChanState(int ch) {
|
|||
return &chan[ch];
|
||||
}
|
||||
|
||||
unsigned char* DivPlatformNES::getRegisterPool() {
|
||||
return regPool;
|
||||
}
|
||||
|
||||
int DivPlatformNES::getRegisterPoolSize() {
|
||||
return 32;
|
||||
}
|
||||
|
||||
void DivPlatformNES::reset() {
|
||||
for (int i=0; i<5; i++) {
|
||||
chan[i]=DivPlatformNES::Channel();
|
||||
|
@ -459,6 +467,7 @@ void DivPlatformNES::reset() {
|
|||
sampleBank=0;
|
||||
|
||||
apu_turn_on(nes,apuType);
|
||||
memset(regPool,0,128);
|
||||
nes->apu.cpu_cycles=0;
|
||||
nes->apu.cpu_opcode_cycle=0;
|
||||
|
||||
|
|
|
@ -59,6 +59,7 @@ class DivPlatformNES: public DivDispatch {
|
|||
unsigned char sampleBank;
|
||||
unsigned char apuType;
|
||||
struct NESAPU* nes;
|
||||
unsigned char regPool[128];
|
||||
|
||||
friend void putDispatchChan(void*,int,int);
|
||||
|
||||
|
@ -66,6 +67,8 @@ class DivPlatformNES: public DivDispatch {
|
|||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
unsigned char* getRegisterPool();
|
||||
int getRegisterPoolSize();
|
||||
void reset();
|
||||
void forceIns();
|
||||
void tick();
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
curChan=c; \
|
||||
rWrite(0,curChan); \
|
||||
} \
|
||||
regPool[16+((c)<<4)+((a)&0x0f)]=v; \
|
||||
rWrite(a,v); \
|
||||
}
|
||||
|
||||
|
@ -110,6 +111,7 @@ void DivPlatformPCE::acquire(short* bufL, short* bufR, size_t start, size_t len)
|
|||
while (!writes.empty() && cycles<24) {
|
||||
QueuedWrite w=writes.front();
|
||||
pce->Write(cycles,w.addr,w.val);
|
||||
regPool[w.addr&0x0f]=w.val;
|
||||
//cycles+=2;
|
||||
writes.pop();
|
||||
}
|
||||
|
@ -442,8 +444,17 @@ void* DivPlatformPCE::getChanState(int ch) {
|
|||
return &chan[ch];
|
||||
}
|
||||
|
||||
unsigned char* DivPlatformPCE::getRegisterPool() {
|
||||
return regPool;
|
||||
}
|
||||
|
||||
int DivPlatformPCE::getRegisterPoolSize() {
|
||||
return 112;
|
||||
}
|
||||
|
||||
void DivPlatformPCE::reset() {
|
||||
while (!writes.empty()) writes.pop();
|
||||
memset(regPool,0,128);
|
||||
for (int i=0; i<6; i++) {
|
||||
chan[i]=DivPlatformPCE::Channel();
|
||||
}
|
||||
|
|
|
@ -74,12 +74,15 @@ class DivPlatformPCE: public DivDispatch {
|
|||
int tempR[32];
|
||||
unsigned char sampleBank, lfoMode, lfoSpeed;
|
||||
PCE_PSG* pce;
|
||||
unsigned char regPool[128];
|
||||
void updateWave(int ch);
|
||||
friend void putDispatchChan(void*,int,int);
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
unsigned char* getRegisterPool();
|
||||
int getRegisterPoolSize();
|
||||
void reset();
|
||||
void forceIns();
|
||||
void tick();
|
||||
|
|
|
@ -83,6 +83,7 @@ void DivPlatformSAA1099::acquire_mame(short* bufL, short* bufR, size_t start, si
|
|||
QueuedWrite w=writes.front();
|
||||
saa.control_w(w.addr);
|
||||
saa.data_w(w.val);
|
||||
regPool[w.addr&0x1f]=w.val;
|
||||
writes.pop();
|
||||
}
|
||||
saa.sound_stream_update(saaBuf,len);
|
||||
|
@ -103,6 +104,7 @@ void DivPlatformSAA1099::acquire_saaSound(short* bufL, short* bufR, size_t start
|
|||
while (!writes.empty()) {
|
||||
QueuedWrite w=writes.front();
|
||||
saa_saaSound->WriteAddressData(w.addr,w.val);
|
||||
regPool[w.addr&0x1f]=w.val;
|
||||
writes.pop();
|
||||
}
|
||||
saa_saaSound->GenerateMany((unsigned char*)saaBuf[0],len);
|
||||
|
@ -367,8 +369,17 @@ void* DivPlatformSAA1099::getChanState(int ch) {
|
|||
return &chan[ch];
|
||||
}
|
||||
|
||||
unsigned char* DivPlatformSAA1099::getRegisterPool() {
|
||||
return regPool;
|
||||
}
|
||||
|
||||
int DivPlatformSAA1099::getRegisterPoolSize() {
|
||||
return 32;
|
||||
}
|
||||
|
||||
void DivPlatformSAA1099::reset() {
|
||||
while (!writes.empty()) writes.pop();
|
||||
memset(regPool,0,32);
|
||||
switch (core) {
|
||||
case DIV_SAA_CORE_MAME:
|
||||
saa=saa1099_device();
|
||||
|
|
|
@ -56,6 +56,7 @@ class DivPlatformSAA1099: public DivDispatch {
|
|||
DivSAACores core;
|
||||
saa1099_device saa;
|
||||
CSAASound* saa_saaSound;
|
||||
unsigned char regPool[32];
|
||||
unsigned char lastBusy;
|
||||
|
||||
bool dacMode;
|
||||
|
@ -85,6 +86,8 @@ class DivPlatformSAA1099: public DivDispatch {
|
|||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
unsigned char* getRegisterPool();
|
||||
int getRegisterPoolSize();
|
||||
void reset();
|
||||
void forceIns();
|
||||
void tick();
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#define rWrite(a,v) if (!skipRegisterWrites) {tia.set(a,v); if (dumpWrites) {addWrite(a,v);} }
|
||||
#define rWrite(a,v) if (!skipRegisterWrites) {tia.set(a,v); regPool[((a)-0x15)&0x0f]=v; if (dumpWrites) {addWrite(a,v);} }
|
||||
|
||||
const char* regCheatSheetTIA[]={
|
||||
"AUDC0", "15",
|
||||
|
@ -281,8 +281,17 @@ void* DivPlatformTIA::getChanState(int ch) {
|
|||
return &chan[ch];
|
||||
}
|
||||
|
||||
unsigned char* DivPlatformTIA::getRegisterPool() {
|
||||
return regPool;
|
||||
}
|
||||
|
||||
int DivPlatformTIA::getRegisterPoolSize() {
|
||||
return 6;
|
||||
}
|
||||
|
||||
void DivPlatformTIA::reset() {
|
||||
tia.reset();
|
||||
memset(regPool,0,16);
|
||||
for (int i=0; i<2; i++) {
|
||||
chan[i]=DivPlatformTIA::Channel();
|
||||
chan[i].vol=0x0f;
|
||||
|
|
|
@ -38,6 +38,7 @@ class DivPlatformTIA: public DivDispatch {
|
|||
Channel chan[2];
|
||||
bool isMuted[2];
|
||||
TIASound tia;
|
||||
unsigned char regPool[16];
|
||||
friend void putDispatchChan(void*,int,int);
|
||||
|
||||
unsigned char dealWithFreq(unsigned char shape, int base, int pitch);
|
||||
|
@ -46,6 +47,8 @@ class DivPlatformTIA: public DivDispatch {
|
|||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
unsigned char* getRegisterPool();
|
||||
int getRegisterPoolSize();
|
||||
void reset();
|
||||
void forceIns();
|
||||
void tick();
|
||||
|
|
|
@ -111,6 +111,7 @@ void DivPlatformYM2610::acquire(short* bufL, short* bufR, size_t start, size_t l
|
|||
QueuedWrite& w=writes.front();
|
||||
fm->write(0x0+((w.addr>>8)<<1),w.addr);
|
||||
fm->write(0x1+((w.addr>>8)<<1),w.val);
|
||||
regPool[w.addr&0x1ff]=w.val;
|
||||
writes.pop();
|
||||
delay=4;
|
||||
}
|
||||
|
@ -848,6 +849,14 @@ void* DivPlatformYM2610::getChanState(int ch) {
|
|||
return &chan[ch];
|
||||
}
|
||||
|
||||
unsigned char* DivPlatformYM2610::getRegisterPool() {
|
||||
return regPool;
|
||||
}
|
||||
|
||||
int DivPlatformYM2610::getRegisterPoolSize() {
|
||||
return 512;
|
||||
}
|
||||
|
||||
void DivPlatformYM2610::poke(unsigned int addr, unsigned short val) {
|
||||
immWrite(addr,val);
|
||||
}
|
||||
|
@ -858,6 +867,7 @@ void DivPlatformYM2610::poke(std::vector<DivRegWrite>& wlist) {
|
|||
|
||||
void DivPlatformYM2610::reset() {
|
||||
while (!writes.empty()) writes.pop();
|
||||
memset(regPool,0,512);
|
||||
if (dumpWrites) {
|
||||
addWrite(0xffffffff,0);
|
||||
}
|
||||
|
|
|
@ -59,6 +59,7 @@ class DivPlatformYM2610: public DivDispatch {
|
|||
ymfm::ym2610* fm;
|
||||
ymfm::ym2610::output_data fmout;
|
||||
DivYM2610Interface iface;
|
||||
unsigned char regPool[512];
|
||||
unsigned char lastBusy;
|
||||
|
||||
bool dacMode;
|
||||
|
@ -88,6 +89,8 @@ class DivPlatformYM2610: public DivDispatch {
|
|||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
unsigned char* getRegisterPool();
|
||||
int getRegisterPoolSize();
|
||||
void reset();
|
||||
void forceIns();
|
||||
void tick();
|
||||
|
|
|
@ -2039,6 +2039,49 @@ void FurnaceGUI::drawChannels() {
|
|||
ImGui::End();
|
||||
}
|
||||
|
||||
void FurnaceGUI::drawRegView() {
|
||||
if (nextWindow==GUI_WINDOW_REGISTER_VIEW) {
|
||||
channelsOpen=true;
|
||||
ImGui::SetNextWindowFocus();
|
||||
nextWindow=GUI_WINDOW_NOTHING;
|
||||
}
|
||||
if (!regViewOpen) return;
|
||||
if (ImGui::Begin("Register View",®ViewOpen)) {
|
||||
for (int i=0; i<e->song.systemLen; i++) {
|
||||
ImGui::Text("%d. %s",i+1,getSystemName(e->song.system[i]));
|
||||
int size=0;
|
||||
unsigned char* regPool=e->getRegisterPool(i,size);
|
||||
if (regPool==NULL) {
|
||||
ImGui::Text("- no register pool available");
|
||||
} else {
|
||||
ImGui::PushFont(patFont);
|
||||
if (ImGui::BeginTable("Memory",17)) {
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
for (int i=0; i<16; i++) {
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextColored(uiColors[GUI_COLOR_PATTERN_ROW_INDEX]," %X",i);
|
||||
}
|
||||
for (int i=0; i<=((size-1)>>4); i++) {
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextColored(uiColors[GUI_COLOR_PATTERN_ROW_INDEX],"%.2X",i*16);
|
||||
for (int j=0; j<16; j++) {
|
||||
ImGui::TableNextColumn();
|
||||
if (i*16+j>=size) continue;
|
||||
ImGui::Text("%.2x",regPool[i*16+j]);
|
||||
}
|
||||
}
|
||||
ImGui::EndTable();
|
||||
}
|
||||
ImGui::PopFont();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_REGISTER_VIEW;
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
void FurnaceGUI::startSelection(int xCoarse, int xFine, int y) {
|
||||
if (xCoarse!=selStart.xCoarse || xFine!=selStart.xFine || y!=selStart.y) {
|
||||
curNibble=false;
|
||||
|
@ -3052,6 +3095,9 @@ void FurnaceGUI::doAction(int what) {
|
|||
case GUI_ACTION_WINDOW_CHANNELS:
|
||||
nextWindow=GUI_WINDOW_CHANNELS;
|
||||
break;
|
||||
case GUI_ACTION_WINDOW_REGISTER_VIEW:
|
||||
nextWindow=GUI_WINDOW_REGISTER_VIEW;
|
||||
break;
|
||||
|
||||
case GUI_ACTION_COLLAPSE_WINDOW:
|
||||
collapseWindow=true;
|
||||
|
@ -3121,6 +3167,9 @@ void FurnaceGUI::doAction(int what) {
|
|||
case GUI_WINDOW_CHANNELS:
|
||||
channelsOpen=false;
|
||||
break;
|
||||
case GUI_WINDOW_REGISTER_VIEW:
|
||||
regViewOpen=false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -4667,6 +4716,7 @@ bool FurnaceGUI::loop() {
|
|||
if (ImGui::MenuItem("piano/input pad",BIND_FOR(GUI_ACTION_WINDOW_PIANO),pianoOpen)) pianoOpen=!pianoOpen;
|
||||
if (ImGui::MenuItem("oscilloscope",BIND_FOR(GUI_ACTION_WINDOW_OSCILLOSCOPE),oscOpen)) oscOpen=!oscOpen;
|
||||
if (ImGui::MenuItem("volume meter",BIND_FOR(GUI_ACTION_WINDOW_VOL_METER),volMeterOpen)) volMeterOpen=!volMeterOpen;
|
||||
if (ImGui::MenuItem("register view",BIND_FOR(GUI_ACTION_WINDOW_REGISTER_VIEW),regViewOpen)) regViewOpen=!regViewOpen;
|
||||
if (ImGui::MenuItem("statistics",BIND_FOR(GUI_ACTION_WINDOW_STATS),statsOpen)) statsOpen=!statsOpen;
|
||||
|
||||
ImGui::EndMenu();
|
||||
|
@ -4770,6 +4820,7 @@ bool FurnaceGUI::loop() {
|
|||
drawPiano();
|
||||
drawNotes();
|
||||
drawChannels();
|
||||
drawRegView();
|
||||
|
||||
if (ImGuiFileDialog::Instance()->Display("FileDialog",ImGuiWindowFlags_NoCollapse|ImGuiWindowFlags_NoMove,ImVec2(600.0f*dpiScale,400.0f*dpiScale),ImVec2(scrW*dpiScale,scrH*dpiScale))) {
|
||||
//ImGui::GetIO().ConfigFlags&=~ImGuiConfigFlags_NavEnableKeyboard;
|
||||
|
@ -5380,6 +5431,7 @@ bool FurnaceGUI::init() {
|
|||
pianoOpen=e->getConfBool("pianoOpen",false);
|
||||
notesOpen=e->getConfBool("notesOpen",false);
|
||||
channelsOpen=e->getConfBool("channelsOpen",false);
|
||||
regViewOpen=e->getConfBool("regViewOpen",false);
|
||||
|
||||
syncSettings();
|
||||
|
||||
|
@ -5533,6 +5585,7 @@ bool FurnaceGUI::finish() {
|
|||
e->setConf("pianoOpen",pianoOpen);
|
||||
e->setConf("notesOpen",notesOpen);
|
||||
e->setConf("channelsOpen",channelsOpen);
|
||||
e->setConf("regViewOpen",regViewOpen);
|
||||
|
||||
// commit last window size
|
||||
e->setConf("lastWindowWidth",scrW);
|
||||
|
@ -5602,6 +5655,7 @@ FurnaceGUI::FurnaceGUI():
|
|||
pianoOpen(false),
|
||||
notesOpen(false),
|
||||
channelsOpen(false),
|
||||
regViewOpen(false),
|
||||
selecting(false),
|
||||
curNibble(false),
|
||||
orderNibble(false),
|
||||
|
|
|
@ -127,6 +127,7 @@ enum FurnaceGUIWindows {
|
|||
GUI_WINDOW_PIANO,
|
||||
GUI_WINDOW_NOTES,
|
||||
GUI_WINDOW_CHANNELS,
|
||||
GUI_WINDOW_REGISTER_VIEW
|
||||
};
|
||||
|
||||
enum FurnaceGUIFileDialogs {
|
||||
|
@ -209,6 +210,7 @@ enum FurnaceGUIActions {
|
|||
GUI_ACTION_WINDOW_PIANO,
|
||||
GUI_ACTION_WINDOW_NOTES,
|
||||
GUI_ACTION_WINDOW_CHANNELS,
|
||||
GUI_ACTION_WINDOW_REGISTER_VIEW,
|
||||
|
||||
GUI_ACTION_COLLAPSE_WINDOW,
|
||||
GUI_ACTION_CLOSE_WINDOW,
|
||||
|
@ -520,7 +522,7 @@ class FurnaceGUI {
|
|||
bool editControlsOpen, ordersOpen, insListOpen, songInfoOpen, patternOpen, insEditOpen;
|
||||
bool waveListOpen, waveEditOpen, sampleListOpen, sampleEditOpen, aboutOpen, settingsOpen;
|
||||
bool mixerOpen, debugOpen, oscOpen, volMeterOpen, statsOpen, compatFlagsOpen;
|
||||
bool pianoOpen, notesOpen, channelsOpen;
|
||||
bool pianoOpen, notesOpen, channelsOpen, regViewOpen;
|
||||
SelectionPoint selStart, selEnd, cursor;
|
||||
bool selecting, curNibble, orderNibble, followOrders, followPattern, changeAllOrders;
|
||||
bool collapseWindow, demandScrollX, fancyPattern, wantPatName;
|
||||
|
@ -647,6 +649,7 @@ class FurnaceGUI {
|
|||
void drawPiano();
|
||||
void drawNotes();
|
||||
void drawChannels();
|
||||
void drawRegView();
|
||||
void drawAbout();
|
||||
void drawSettings();
|
||||
void drawDebug();
|
||||
|
|
Loading…
Reference in a new issue