LOW QUALITY TILDEARROW CODE...
This commit is contained in:
parent
97402e6d41
commit
9e726eba83
|
@ -653,7 +653,6 @@ src/engine/platform/sound/sm8521.c
|
||||||
src/engine/platform/sound/supervision.c
|
src/engine/platform/sound/supervision.c
|
||||||
|
|
||||||
src/engine/platform/sound/upd1771.cpp
|
src/engine/platform/sound/upd1771.cpp
|
||||||
src/engine/platform/sound/upd1771c.c
|
|
||||||
|
|
||||||
src/engine/platform/sound/d65modified.c
|
src/engine/platform/sound/d65modified.c
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,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.push(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);} }
|
#define rWrite(a,v) if (!skipRegisterWrites) {packet[a]=v; writePacket=true; if (dumpWrites) {addWrite(a,v);} }
|
||||||
|
|
||||||
#define CHIP_DIVIDER 64
|
#define CHIP_DIVIDER 64
|
||||||
|
|
||||||
|
@ -40,22 +40,22 @@ void DivPlatformSCVTone::acquire(short** buf, size_t len) {
|
||||||
for (size_t h=0; h<len; h++) {
|
for (size_t h=0; h<len; h++) {
|
||||||
while (!writes.empty()) {
|
while (!writes.empty()) {
|
||||||
QueuedWrite w=writes.front();
|
QueuedWrite w=writes.front();
|
||||||
upd1771c_write_packet(&scv,w.addr&15,w.val);
|
scv.write(w.val);
|
||||||
regPool[w.addr&0xf]=w.val;
|
regPool[w.addr&0xf]=w.val;
|
||||||
writes.pop();
|
writes.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
short s=upd1771c_sound_stream_update(&scv)<<3;
|
scv.sound_stream_update(&buf[0][h],1);
|
||||||
|
/*
|
||||||
if (isMuted[0]) s=0;
|
if (isMuted[0]) s=0;
|
||||||
oscBuf[0]->data[oscBuf[0]->needle++]=s;
|
oscBuf[0]->data[oscBuf[0]->needle++]=s;
|
||||||
buf[0][h]=s;
|
buf[0][h]=s;
|
||||||
buf[1][h]=s;
|
buf[1][h]=s;*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformSCVTone::tick(bool sysTick) {
|
void DivPlatformSCVTone::tick(bool sysTick) {
|
||||||
for (int i=0; i<1; i++) {
|
for (int i=0; i<1; i++) {
|
||||||
|
|
||||||
chan[i].std.next();
|
chan[i].std.next();
|
||||||
if (chan[i].std.vol.had) {
|
if (chan[i].std.vol.had) {
|
||||||
chan[i].outVol=VOL_SCALE_LINEAR(chan[i].vol&31,MIN(31,chan[i].std.vol.val),31);
|
chan[i].outVol=VOL_SCALE_LINEAR(chan[i].vol&31,MIN(31,chan[i].std.vol.val),31);
|
||||||
|
@ -144,6 +144,21 @@ void DivPlatformSCVTone::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if need be, write packet
|
||||||
|
if (writePacket) {
|
||||||
|
writePacket=false;
|
||||||
|
int len=1;
|
||||||
|
if (packet[0]==2) {
|
||||||
|
len=4;
|
||||||
|
} else if (packet[0]==1) {
|
||||||
|
len=10;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<len; i++) {
|
||||||
|
writes.push(QueuedWrite(0,packet[i]));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformSCVTone::dispatch(DivCommand c) {
|
int DivPlatformSCVTone::dispatch(DivCommand c) {
|
||||||
|
@ -304,15 +319,17 @@ void DivPlatformSCVTone::reset() {
|
||||||
if (dumpWrites) {
|
if (dumpWrites) {
|
||||||
addWrite(0xffffffff,0);
|
addWrite(0xffffffff,0);
|
||||||
}
|
}
|
||||||
upd1771c_reset(&scv);
|
scv.device_reset();
|
||||||
memset(tempL,0,32*sizeof(int));
|
memset(tempL,0,32*sizeof(int));
|
||||||
memset(tempR,0,32*sizeof(int));
|
memset(tempR,0,32*sizeof(int));
|
||||||
memset(kon,0,1*sizeof(unsigned char));
|
memset(kon,0,1*sizeof(unsigned char));
|
||||||
memset(initWrite,1,1*sizeof(unsigned char));
|
memset(initWrite,1,1*sizeof(unsigned char));
|
||||||
|
memset(packet,0,16);
|
||||||
|
writePacket=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformSCVTone::getOutputCount() {
|
int DivPlatformSCVTone::getOutputCount() {
|
||||||
return 2;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DivPlatformSCVTone::keyOffAffectsArp(int ch) {
|
bool DivPlatformSCVTone::keyOffAffectsArp(int ch) {
|
||||||
|
@ -328,11 +345,11 @@ void DivPlatformSCVTone::notifyInsDeletion(void* ins) {
|
||||||
void DivPlatformSCVTone::setFlags(const DivConfig& flags) {
|
void DivPlatformSCVTone::setFlags(const DivConfig& flags) {
|
||||||
chipClock=6000000;
|
chipClock=6000000;
|
||||||
CHECK_CUSTOM_CLOCK;
|
CHECK_CUSTOM_CLOCK;
|
||||||
rate=chipClock/32;
|
rate=chipClock/4;
|
||||||
for (int i=0; i<1; i++) {
|
for (int i=0; i<1; i++) {
|
||||||
oscBuf[i]->rate=rate;
|
oscBuf[i]->rate=rate;
|
||||||
}
|
}
|
||||||
upd1771c_sound_set_clock(&scv,(unsigned int)chipClock,8);
|
//upd1771c_sound_set_clock(&scv,(unsigned int)chipClock,8);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformSCVTone::poke(unsigned int addr, unsigned short val) {
|
void DivPlatformSCVTone::poke(unsigned int addr, unsigned short val) {
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include "../../fixedQueue.h"
|
#include "../../fixedQueue.h"
|
||||||
#include "sound/upd1771c.h"
|
#include "sound/upd1771.h"
|
||||||
|
|
||||||
class DivPlatformSCVTone: public DivDispatch {
|
class DivPlatformSCVTone: public DivDispatch {
|
||||||
struct Channel: public SharedChannel<signed char> {
|
struct Channel: public SharedChannel<signed char> {
|
||||||
|
@ -52,8 +52,11 @@ class DivPlatformSCVTone: public DivDispatch {
|
||||||
unsigned char regPool[16];
|
unsigned char regPool[16];
|
||||||
unsigned char kon[4];
|
unsigned char kon[4];
|
||||||
unsigned char initWrite[4];
|
unsigned char initWrite[4];
|
||||||
struct upd1771c_t scv;
|
upd1771c_device scv;
|
||||||
|
|
||||||
|
unsigned char packet[16];
|
||||||
|
|
||||||
|
bool writePacket;
|
||||||
|
|
||||||
friend void putDispatchChip(void*,int);
|
friend void putDispatchChip(void*,int);
|
||||||
friend void putDispatchChan(void*,int,int);
|
friend void putDispatchChan(void*,int,int);
|
||||||
|
|
Loading…
Reference in a new issue