µPD1771C: implement tone/noise mode

This commit is contained in:
tildearrow 2025-01-29 04:10:54 -05:00
parent 9e726eba83
commit 8776e1c442
5 changed files with 228 additions and 130 deletions

View file

@ -26,7 +26,7 @@
//#define rWrite(a,v) pendingWrites[a]=v; //#define rWrite(a,v) pendingWrites[a]=v;
#define rWrite(a,v) if (!skipRegisterWrites) {packet[a]=v; writePacket=true; 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 512
const char* regCheatSheetUPD1771cTone[]={ const char* regCheatSheetUPD1771cTone[]={
NULL NULL
@ -46,16 +46,15 @@ void DivPlatformSCVTone::acquire(short** buf, size_t len) {
} }
scv.sound_stream_update(&buf[0][h],1); scv.sound_stream_update(&buf[0][h],1);
/* oscBuf[0]->data[oscBuf[0]->needle++]=scv.chout[0]<<3;
if (isMuted[0]) s=0; oscBuf[1]->data[oscBuf[1]->needle++]=scv.chout[1]<<3;
oscBuf[0]->data[oscBuf[0]->needle++]=s; oscBuf[2]->data[oscBuf[2]->needle++]=scv.chout[2]<<3;
buf[0][h]=s; oscBuf[3]->data[oscBuf[3]->needle++]=scv.chout[3]<<3;
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<4; 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);
@ -65,7 +64,11 @@ void DivPlatformSCVTone::tick(bool sysTick) {
} else if (chan[i].std.arp.had) { } else if (chan[i].std.arp.had) {
if (!chan[i].inPorta) { if (!chan[i].inPorta) {
int f=parent->calcArp(chan[i].note,chan[i].std.arp.val); int f=parent->calcArp(chan[i].note,chan[i].std.arp.val);
chan[i].baseFreq=NOTE_PERIODIC(f); if (i==3) {
chan[i].baseFreq=f;
} else {
chan[i].baseFreq=NOTE_PERIODIC(f);
}
} }
chan[i].freqChanged=true; chan[i].freqChanged=true;
} }
@ -88,63 +91,41 @@ void DivPlatformSCVTone::tick(bool sysTick) {
chan[i].freqChanged=true; chan[i].freqChanged=true;
} }
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) { if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
//DivInstrument* ins=parent->getIns(chan[i].ins,DIV_INS_PCE); if (i==3) {
if (i==0) { chan[i].freq=(chan[i].baseFreq+chan[i].pitch+chan[i].pitch2+143);
if (!parent->song.oldArpStrategy) {
if (chan[i].fixedArp) {
chan[i].freq=(chan[i].baseNoteOverride)+chan[i].pitch+chan[i].pitch2;
} else {
chan[i].freq+=chan[i].arpOff;
}
}
} else {
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,true,0,chan[i].pitch2,chipClock,CHIP_DIVIDER); chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,true,0,chan[i].pitch2,chipClock,CHIP_DIVIDER);
} }
if (chan[i].freqChanged || initWrite[i] || chan[i].keyOn) { if (i==3) {
if (chan[i].duty == 0) { if (chan[i].freq<0) chan[i].freq=0;
rWrite(0,2); } else {
rWrite(1,(chan[i].wave<<5)|chan[i].pos); if (chan[i].freq<1) chan[i].freq=1;
float p = ((float)chan[i].freq)/((float)(31-chan[i].pos))*31.0;
rWrite(2,MIN(MAX((int)p,0),255));
rWrite(3,chan[i].outVol);
} else if (chan[i].duty == 1) {
rWrite(0,1);
rWrite(1,(chan[i].wave<<5));
rWrite(2,MIN(MAX(chan[i].freq>>7,0),255));
rWrite(3,chan[i].outVol);
} else {
rWrite(0,0);
}
initWrite[i]=0;
} }
if (chan[i].keyOff) { if (chan[i].freq>255) chan[i].freq=255;
rWrite(0,0);
}
if (chan[i].keyOn) kon[i]=1;
if (chan[i].keyOff) kon[i]=0;
if (chan[i].keyOn) chan[i].keyOn=false; if (chan[i].keyOn) chan[i].keyOn=false;
if (chan[i].keyOff) chan[i].keyOff=false; if (chan[i].keyOff) chan[i].keyOff=false;
chan[i].freqChanged=false; chan[i].freqChanged=false;
} }
if (kon[i]) {
if (i==0) {
if (chan[i].duty == 0) {
rWrite(0,2);
rWrite(1,(chan[i].wave<<5)|chan[i].pos);
// TODO: improve
float p = ((float)chan[i].freq)/((float)(32-chan[i].pos))*32.0;
rWrite(2,MIN(MAX((int)p,0),255));
rWrite(3,chan[i].outVol);
} else if (chan[i].duty == 1) {
rWrite(0,1);
rWrite(1,(chan[i].wave<<5));
rWrite(2,MIN(MAX(chan[i].freq>>7,0),255));
rWrite(3,chan[i].outVol);
} else {
rWrite(0,0);
}
}
} else {
if (i == 0) {
rWrite(0,0);
}
}
} }
rWrite(0,1);
rWrite(1,chan[3].wave<<5);
rWrite(2,(0xff-chan[3].freq));
rWrite(3,(chan[3].active && !isMuted[3])?(chan[3].outVol&0x1f):0);
rWrite(4,chan[0].freq-1);
rWrite(5,chan[1].freq-1);
rWrite(6,chan[2].freq-1);
rWrite(7,(chan[0].active && !isMuted[0])?chan[0].outVol:0);
rWrite(8,(chan[1].active && !isMuted[1])?chan[1].outVol:0);
rWrite(9,(chan[2].active && !isMuted[2])?chan[2].outVol:0);
// if need be, write packet // if need be, write packet
if (writePacket) { if (writePacket) {
writePacket=false; writePacket=false;
@ -166,7 +147,7 @@ int DivPlatformSCVTone::dispatch(DivCommand c) {
case DIV_CMD_NOTE_ON: { case DIV_CMD_NOTE_ON: {
DivInstrument* ins=parent->getIns(chan[c.chan].ins,DIV_INS_UPD1771C); DivInstrument* ins=parent->getIns(chan[c.chan].ins,DIV_INS_UPD1771C);
if (c.value!=DIV_NOTE_NULL) { if (c.value!=DIV_NOTE_NULL) {
chan[c.chan].baseFreq=c.chan==3?c.value:NOTE_PERIODIC(c.value); chan[c.chan].baseFreq=c.chan==3?(c.value):NOTE_PERIODIC(c.value);
chan[c.chan].freqChanged=true; chan[c.chan].freqChanged=true;
chan[c.chan].note=c.value; chan[c.chan].note=c.value;
} }
@ -218,7 +199,7 @@ int DivPlatformSCVTone::dispatch(DivCommand c) {
chan[c.chan].freqChanged=true; chan[c.chan].freqChanged=true;
break; break;
case DIV_CMD_NOTE_PORTA: { case DIV_CMD_NOTE_PORTA: {
int destFreq=NOTE_PERIODIC(c.value2); int destFreq=(c.chan==3)?c.value2:(NOTE_PERIODIC(c.value2));
bool return2=false; bool return2=false;
if (destFreq>chan[c.chan].baseFreq) { if (destFreq>chan[c.chan].baseFreq) {
chan[c.chan].baseFreq+=c.value; chan[c.chan].baseFreq+=c.value;
@ -247,16 +228,24 @@ int DivPlatformSCVTone::dispatch(DivCommand c) {
case DIV_CMD_N163_WAVE_POSITION: case DIV_CMD_N163_WAVE_POSITION:
chan[c.chan].pos=c.value; chan[c.chan].pos=c.value;
break; break;
case DIV_CMD_LEGATO: case DIV_CMD_LEGATO: {
chan[c.chan].baseFreq=NOTE_PERIODIC(c.value+((HACKY_LEGATO_MESS)?(chan[c.chan].std.arp.val):(0))); int newNote=c.value+((HACKY_LEGATO_MESS)?(chan[c.chan].std.arp.val):(0));
chan[c.chan].baseFreq=(c.chan==3)?newNote:(NOTE_PERIODIC(newNote));
chan[c.chan].freqChanged=true; chan[c.chan].freqChanged=true;
chan[c.chan].note=c.value; chan[c.chan].note=c.value;
break; break;
}
case DIV_CMD_PRE_PORTA: case DIV_CMD_PRE_PORTA:
if (chan[c.chan].active && c.value2) { if (chan[c.chan].active && c.value2) {
if (parent->song.resetMacroOnPorta) chan[c.chan].macroInit(parent->getIns(chan[c.chan].ins,DIV_INS_UPD1771C)); if (parent->song.resetMacroOnPorta) chan[c.chan].macroInit(parent->getIns(chan[c.chan].ins,DIV_INS_UPD1771C));
} }
if (!chan[c.chan].inPorta && c.value && !parent->song.brokenPortaArp && chan[c.chan].std.arp.will && !NEW_ARP_STRAT) chan[c.chan].baseFreq=NOTE_PERIODIC(chan[c.chan].note); if (!chan[c.chan].inPorta && c.value && !parent->song.brokenPortaArp && chan[c.chan].std.arp.will && !NEW_ARP_STRAT) {
if (c.chan==3) {
chan[c.chan].baseFreq=chan[c.chan].note;
} else {
chan[c.chan].baseFreq=NOTE_PERIODIC(chan[c.chan].note);
}
}
chan[c.chan].inPorta=c.value; chan[c.chan].inPorta=c.value;
break; break;
case DIV_CMD_GET_VOLMAX: case DIV_CMD_GET_VOLMAX:
@ -282,7 +271,7 @@ void DivPlatformSCVTone::muteChannel(int ch, bool mute) {
} }
void DivPlatformSCVTone::forceIns() { void DivPlatformSCVTone::forceIns() {
for (int i=0; i<1; i++) { for (int i=0; i<4; i++) {
chan[i].insChanged=true; chan[i].insChanged=true;
chan[i].freqChanged=true; chan[i].freqChanged=true;
//chwrite(i,0x05,isMuted[i]?0:chan[i].pan); //chwrite(i,0x05,isMuted[i]?0:chan[i].pan);
@ -312,7 +301,7 @@ int DivPlatformSCVTone::getRegisterPoolSize() {
void DivPlatformSCVTone::reset() { void DivPlatformSCVTone::reset() {
writes.clear(); writes.clear();
memset(regPool,0,16); memset(regPool,0,16);
for (int i=0; i<1; i++) { for (int i=0; i<4; i++) {
chan[i]=DivPlatformSCVTone::Channel(); chan[i]=DivPlatformSCVTone::Channel();
chan[i].std.setEngine(parent); chan[i].std.setEngine(parent);
} }
@ -322,8 +311,6 @@ void DivPlatformSCVTone::reset() {
scv.device_reset(); 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(initWrite,1,1*sizeof(unsigned char));
memset(packet,0,16); memset(packet,0,16);
writePacket=false; writePacket=false;
} }
@ -337,7 +324,7 @@ bool DivPlatformSCVTone::keyOffAffectsArp(int ch) {
} }
void DivPlatformSCVTone::notifyInsDeletion(void* ins) { void DivPlatformSCVTone::notifyInsDeletion(void* ins) {
for (int i=0; i<1; i++) { for (int i=0; i<4; i++) {
chan[i].std.notifyInsDeletion((DivInstrument*)ins); chan[i].std.notifyInsDeletion((DivInstrument*)ins);
} }
} }
@ -346,7 +333,7 @@ void DivPlatformSCVTone::setFlags(const DivConfig& flags) {
chipClock=6000000; chipClock=6000000;
CHECK_CUSTOM_CLOCK; CHECK_CUSTOM_CLOCK;
rate=chipClock/4; rate=chipClock/4;
for (int i=0; i<1; i++) { for (int i=0; i<4; 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);
@ -364,7 +351,7 @@ int DivPlatformSCVTone::init(DivEngine* p, int channels, int sugRate, const DivC
parent=p; parent=p;
dumpWrites=false; dumpWrites=false;
skipRegisterWrites=false; skipRegisterWrites=false;
for (int i=0; i<1; i++) { for (int i=0; i<4; i++) {
isMuted[i]=false; isMuted[i]=false;
oscBuf[i]=new DivDispatchOscBuffer; oscBuf[i]=new DivDispatchOscBuffer;
} }
@ -374,7 +361,7 @@ int DivPlatformSCVTone::init(DivEngine* p, int channels, int sugRate, const DivC
} }
void DivPlatformSCVTone::quit() { void DivPlatformSCVTone::quit() {
for (int i=0; i<1; i++) { for (int i=0; i<4; i++) {
delete oscBuf[i]; delete oscBuf[i];
} }
} }

View file

@ -50,8 +50,6 @@ class DivPlatformSCVTone: public DivDispatch {
int tempR[32]; int tempR[32];
int coreQuality; int coreQuality;
unsigned char regPool[16]; unsigned char regPool[16];
unsigned char kon[4];
unsigned char initWrite[4];
upd1771c_device scv; upd1771c_device scv;
unsigned char packet[16]; unsigned char packet[16];

View file

@ -46,11 +46,8 @@ void DivPlatformSCVWave::acquire(short** buf, size_t len) {
} }
scv.sound_stream_update(&buf[0][h],1); scv.sound_stream_update(&buf[0][h],1);
/* if (isMuted[0]) buf[0][h]=0;
if (isMuted[0]) s=0; oscBuf[0]->data[oscBuf[0]->needle++]=buf[0][h];
oscBuf[0]->data[oscBuf[0]->needle++]=s;
buf[0][h]=s;
buf[1][h]=s;*/
} }
} }
@ -92,26 +89,6 @@ void DivPlatformSCVWave::tick(bool sysTick) {
if (i==0) { if (i==0) {
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,true,0,chan[i].pitch2,chipClock,CHIP_DIVIDER); chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,true,0,chan[i].pitch2,chipClock,CHIP_DIVIDER);
} }
if (chan[i].freqChanged || initWrite[i] || chan[i].keyOn) {
if (chan[i].duty == 0) {
rWrite(0,2);
rWrite(1,(chan[i].wave<<5)|chan[i].pos);
float p = ((float)chan[i].freq)/((float)(31-chan[i].pos))*31.0;
rWrite(2,MIN(MAX((int)p,0),255));
rWrite(3,chan[i].outVol);
} else if (chan[i].duty == 1) {
rWrite(0,1);
rWrite(1,(chan[i].wave<<5));
rWrite(2,MIN(MAX(chan[i].freq>>7,0),255));
rWrite(3,chan[i].outVol);
} else {
rWrite(0,0);
}
initWrite[i]=0;
}
if (chan[i].keyOff) {
rWrite(0,0);
}
if (chan[i].keyOn) kon[i]=1; if (chan[i].keyOn) kon[i]=1;
if (chan[i].keyOff) kon[i]=0; if (chan[i].keyOff) kon[i]=0;
if (chan[i].keyOn) chan[i].keyOn=false; if (chan[i].keyOn) chan[i].keyOn=false;
@ -122,19 +99,19 @@ void DivPlatformSCVWave::tick(bool sysTick) {
if (kon[i]) { if (kon[i]) {
if (i==0) { if (i==0) {
if (chan[i].duty == 0) { if (chan[i].duty == 0) {
rWrite(0,2); rWrite(0,2);
rWrite(1,(chan[i].wave<<5)|chan[i].pos); rWrite(1,(chan[i].wave<<5)|chan[i].pos);
// TODO: improve // TODO: improve
float p = ((float)chan[i].freq)/((float)(32-chan[i].pos))*32.0; float p = ((float)chan[i].freq)/((float)(31-chan[i].pos))*31.0;
rWrite(2,MIN(MAX((int)p,0),255)); rWrite(2,MIN(MAX((int)p,0),255));
rWrite(3,chan[i].outVol); rWrite(3,chan[i].outVol);
} else if (chan[i].duty == 1) { } else if (chan[i].duty == 1) {
rWrite(0,1); rWrite(0,1);
rWrite(1,(chan[i].wave<<5)); rWrite(1,(chan[i].wave<<5));
rWrite(2,MIN(MAX(chan[i].freq>>7,0),255)); rWrite(2,MIN(MAX(chan[i].freq>>7,0),255));
rWrite(3,chan[i].outVol); rWrite(3,chan[i].outVol);
} else { } else {
rWrite(0,0); rWrite(0,0);
} }
} }
} else { } else {

View file

@ -202,24 +202,151 @@ static const signed char WAVEFORMS[8][32]={
#define NOISE_SIZE 255 #define NOISE_SIZE 255
static const unsigned char noise_tbl[]= static const unsigned char noise_tbl[8][256] = {
{ {
0x1c,0x86,0x8a,0x8f,0x98,0xa1,0xad,0xbe,0xd9,0x8a,0x66,0x4d,0x40,0x33,0x2b,0x23, 0x84, 0x87, 0x8c, 0x93, 0x9a, 0xa4, 0xb2, 0xc8, 0x8a, 0x6c, 0x58, 0x4e, 0x43, 0x3d, 0x37, 0x33,
0x1e,0x8a,0x90,0x97,0xa4,0xae,0xb8,0xd6,0xec,0xe9,0x69,0x4a,0x3e,0x34,0x2d,0x27, 0x86, 0x8d, 0x95, 0x9d, 0xa8, 0xb5, 0xc9, 0xe7, 0x6d, 0x58, 0x4b, 0x43, 0x3e, 0x38, 0x37, 0x34,
0x24,0x24,0x89,0x8e,0x93,0x9c,0xa5,0xb0,0xc1,0xdd,0x40,0x36,0x30,0x29,0x27,0x24, 0x87, 0x8b, 0x8f, 0x96, 0x9d, 0xa7, 0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x42, 0x42, 0x95, 0x97, 0x98, 0x9c, 0x9f, 0xa4, 0xab, 0xb4, 0x92, 0x95, 0x99,
0x9c, 0xa2, 0xa8, 0xb1, 0xc0, 0x57, 0x4f, 0x4a, 0x48, 0x44, 0x42, 0x41, 0x41, 0x94, 0x95, 0x97,
0x9b, 0x9e, 0xa3, 0xa9, 0xb3, 0x3e, 0x92, 0x93, 0x95, 0x98, 0x9b, 0xa0, 0xa7, 0xb1, 0x65, 0x58,
0x50, 0x4b, 0x49, 0x45, 0x43, 0x41, 0x94, 0x97, 0x9b, 0x9e, 0xa4, 0xa9, 0xb3, 0xc2, 0x59, 0x51,
0x4b, 0x4a, 0x46, 0x45, 0x42, 0x42, 0x96, 0x96, 0x99, 0x9c, 0x9f, 0xa4, 0xab, 0xb5, 0x4d, 0x4b,
0x47, 0x45, 0x43, 0x43, 0x97, 0x97, 0x9a, 0x9d, 0xa0, 0xa5, 0xac, 0xb6, 0x41, 0x42
},
{
0x93, 0x93, 0x93, 0x94, 0x95, 0x99, 0x9c, 0xa1, 0xa8, 0x4e, 0x48, 0x45, 0x43, 0x44, 0x42, 0x42,
0x95, 0x95, 0x95, 0x96, 0x97, 0x98, 0x9b, 0x9e, 0xa6, 0x43, 0x41, 0x41, 0x95, 0x94, 0x94, 0x95,
0x97, 0x9b, 0x9d, 0xa3, 0xa9, 0x4f, 0x4a, 0x46, 0x45, 0x45, 0x43, 0x43, 0x97, 0x96, 0x96, 0x97,
0x99, 0x9a, 0x9c, 0x9f, 0xa7, 0x94, 0x93, 0x94, 0x96, 0x9a, 0x9d, 0xa2, 0xa9, 0x4f, 0x49, 0x45,
0x44, 0x45, 0x43, 0x43, 0x96, 0x96, 0x96, 0x96, 0x98, 0x99, 0x9c, 0x9f, 0xa7, 0x93, 0x93, 0x93,
0x93, 0x95, 0x96, 0x99, 0x9c, 0xa4, 0x50, 0x4b, 0x49, 0x45, 0x44, 0x42, 0x42, 0x95, 0x95, 0x95,
0x96, 0x97, 0x9b, 0x9e, 0xa3, 0xaa, 0x50, 0x4b, 0x46, 0x46, 0x46, 0x44, 0x44, 0x97, 0x97, 0x97,
0x97, 0x99, 0x9a, 0x9d, 0x9f, 0xa8, 0x47, 0x46, 0x46, 0x44, 0x44, 0x98, 0x98, 0x97, 0x98, 0x9a,
0x9b, 0x9d, 0xa0, 0xa8, 0x42, 0x96, 0x95, 0x95, 0x96, 0x98, 0x98, 0x9b, 0x9e, 0xa6, 0xa6, 0x93,
0x95, 0x99, 0x9c, 0xa1, 0xa7, 0x4e, 0x48, 0x44, 0x43, 0x44, 0x41, 0x42, 0x95, 0x95, 0x95, 0x95,
0x97, 0x98, 0x9b, 0x9e, 0xa6, 0x9d, 0xa5, 0x52, 0x4c, 0x4b, 0x46, 0x45, 0x42, 0x43, 0x97, 0x96,
0x96, 0x97, 0x98, 0x9c, 0x9f, 0xa4, 0xab, 0x51, 0x4b, 0x48, 0x46, 0x47, 0x44, 0x45, 0x98, 0x98,
0x98, 0x98, 0x9a, 0x9b, 0x9e, 0xa0, 0xa8, 0x9f, 0xa4, 0xab, 0x51, 0x4c, 0x48, 0x47, 0x47, 0x45,
0x45, 0x99, 0x98, 0x98, 0x99, 0x9a, 0x9b, 0x9e, 0xa1, 0xa9, 0x98, 0x9d, 0x9f, 0xa4, 0xab, 0x51,
0x4b, 0x47, 0x47, 0x47, 0x45, 0x45, 0x98, 0x98, 0x98, 0x98, 0x9a, 0x9b, 0x9e, 0xa1, 0xa8, 0x9c,
0x9f, 0xa7, 0x42, 0x42, 0x95, 0x95, 0x95, 0x96, 0x97, 0x98, 0x9b, 0x9e, 0xa6, 0x3f
},
{
0x94, 0x93, 0x92, 0x92, 0x93, 0x95, 0x96, 0x99, 0x9c, 0x43, 0x43, 0x43, 0x41, 0x41, 0x42, 0x95,
0x95, 0x95, 0x94, 0x94, 0x94, 0x95, 0x97, 0x97, 0x9a, 0x40, 0x40, 0x41, 0x95, 0x95, 0x94, 0x95,
0x95, 0x97, 0x97, 0x9a, 0x9e, 0x45, 0x44, 0x44, 0x42, 0x42, 0x43, 0x97, 0x96, 0x96, 0x96, 0x96,
0x95, 0x96, 0x98, 0x99, 0x9c, 0x94, 0x94, 0x94, 0x94, 0x96, 0x97, 0x9a, 0x9d, 0x44, 0x43, 0x44,
0x42, 0x42, 0x43, 0x96, 0x96, 0x96, 0x95, 0x95, 0x95, 0x96, 0x98, 0x98, 0x9b, 0x93, 0x93, 0x93,
0x92, 0x92, 0x93, 0x95, 0x95, 0x98, 0x49, 0x44, 0x43, 0x44, 0x42, 0x42, 0x43, 0x96, 0x96, 0x96,
0x95, 0x96, 0x98, 0x99, 0x9b, 0x9f, 0x46, 0x45, 0x45, 0x43, 0x44, 0x44, 0x98, 0x98, 0x97, 0x97,
0x97, 0x97, 0x97, 0x99, 0x9a, 0x9d, 0x45, 0x43, 0x43, 0x44, 0x98, 0x98, 0x98, 0x97, 0x97, 0x97,
0x97, 0x99, 0x9a, 0x9d, 0x95, 0x95, 0x94, 0x94, 0x94, 0x94, 0x94, 0x96, 0x97, 0x9a, 0x9a, 0x92,
0x93, 0x94, 0x95, 0x98, 0x9c, 0x43, 0x42, 0x43, 0x40, 0x40, 0x41, 0x95, 0x95, 0x94, 0x94, 0x94,
0x93, 0x94, 0x96, 0x97, 0x9a, 0x96, 0x99, 0x4a, 0x45, 0x44, 0x44, 0x42, 0x42, 0x43, 0x97, 0x96,
0x96, 0x96, 0x97, 0x98, 0x99, 0x9c, 0xa0, 0x47, 0x46, 0x46, 0x44, 0x44, 0x45, 0x98, 0x98, 0x98,
0x98, 0x97, 0x97, 0x98, 0x99, 0x9a, 0x9d, 0x9a, 0x9c, 0xa0, 0x47, 0x46, 0x46, 0x44, 0x44, 0x45,
0x99, 0x98, 0x98, 0x98, 0x97, 0x97, 0x98, 0x9a, 0x9a, 0x9e, 0x97, 0x98, 0x99, 0x9c, 0xa0, 0x47,
0x46, 0x46, 0x44, 0x44, 0x45, 0x98, 0x98, 0x98, 0x98, 0x98, 0x97, 0x98, 0x9a, 0x9a, 0x9d, 0x98,
0x99, 0x9c, 0x42, 0x95, 0x95, 0x95, 0x94, 0x94, 0x94, 0x95, 0x96, 0x97, 0x9a, 0x40
},
{
0xe6, 0x1c, 0x87, 0xcb, 0x42, 0x9b, 0x87, 0x35, 0xd8, 0x1c, 0xa3, 0x58, 0x84, 0xa4, 0x28, 0x71,
0xd9, 0x3e, 0x82, 0xbb, 0x28, 0xd2, 0x80, 0x63, 0xe0, 0x38, 0x71, 0xcb, 0x22, 0x81, 0x9b, 0x83,
0xa4, 0x28, 0x71, 0xd8, 0x3e, 0x81, 0xbb, 0x28, 0xd2, 0x80, 0x63, 0xe0, 0x37, 0x71, 0xcb, 0x22,
0x81, 0x9b, 0xa3, 0x57, 0x83, 0xa3, 0x28, 0x70, 0xd8, 0x3e, 0x81, 0xba, 0x28, 0xd1, 0x80, 0x63,
0xe0, 0x37, 0x70, 0xcb, 0x22, 0x81, 0x9b, 0x23, 0x82, 0x9b, 0x28, 0xd2, 0x80, 0x63, 0xe1, 0x38,
0x71, 0xcc, 0x23, 0x81, 0x9b, 0x9c, 0x88, 0x36, 0xd9, 0x1d, 0xa4, 0x58, 0x84, 0xa5, 0x28, 0x72,
0xd9, 0x3f, 0x82, 0xbb, 0x29, 0xd2, 0x81, 0x64, 0xe1, 0x38, 0x72, 0xcc, 0x23, 0x82, 0x9b, 0xcc,
0x43, 0x9c, 0x88, 0x36, 0xd8, 0x1d, 0xa4, 0x58, 0x84, 0xa5, 0x29, 0x71, 0xd9, 0x3f, 0x82, 0xbc,
0x29, 0xd2, 0x81, 0x64, 0xe1, 0x39, 0x72, 0xcc, 0x23, 0x82, 0x9c, 0x37, 0xd9, 0x1d, 0xa4, 0x59,
0x85, 0xa6, 0x29, 0x72, 0xda, 0x40, 0x83, 0xbc, 0x2a, 0xd3, 0x82, 0x64, 0xe2, 0x39, 0x72, 0xcc,
0x24, 0x82, 0x9c, 0x82, 0x64, 0xe1, 0x3a, 0x72, 0xcc, 0x24, 0x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0x87, 0x19, 0x88, 0xe4, 0x87, 0x19, 0x88, 0x1a, 0x89, 0xe5, 0x88,
0x1a, 0x89, 0xe5, 0x88, 0x1a, 0x89, 0xe5, 0x87, 0x1a, 0x89, 0xe4, 0x88, 0x19, 0x89, 0xe4, 0x87,
0x19, 0x88, 0xe4, 0x87, 0x19, 0x88, 0xe4, 0x87, 0x19, 0x88, 0xe4, 0x87, 0x19, 0x88, 0xe4, 0x87,
0x19, 0x88, 0xe3, 0x86, 0x19, 0x88, 0xe3, 0x86, 0x18, 0x87, 0xe3, 0x86, 0x18, 0x88, 0xe3, 0x86,
0x18, 0x87, 0xe3, 0x86, 0x18, 0x87, 0xe3, 0x86, 0x18, 0x87, 0xe3, 0x86, 0x18, 0x87, 0xe3, 0x86,
0x18, 0x87, 0xe2, 0x85, 0x18, 0x87, 0xe3, 0x85, 0x17, 0x19, 0x88, 0xe3, 0x86, 0x19, 0x88, 0xe4,
0x86, 0x19, 0x88, 0xe3, 0x86, 0x18, 0x88, 0xe3, 0x86, 0x18, 0x87, 0xe3, 0x86, 0x18, 0x87, 0xe3,
0x86, 0x18, 0x87, 0xe3, 0x85, 0x18, 0x87, 0xe3, 0x86, 0x18, 0x87, 0xe3, 0x86, 0x18, 0x87, 0xe3,
0x85, 0x18, 0x87, 0x19, 0x88, 0xe3, 0x86, 0x19, 0x88, 0xe3, 0x86, 0x18, 0x87, 0xe3, 0x86, 0x18,
0x87, 0x1a, 0x89, 0xe4, 0x87, 0x19, 0x88, 0xe4, 0x87, 0x19, 0x1b, 0x89, 0x1c, 0x8b
},
{
0xa1, 0xe6, 0xcf, 0x79, 0x58, 0x4a, 0x78, 0x7a, 0x53, 0x7b, 0xc2, 0xc3, 0x82, 0x36, 0x48, 0x84,
0xcb, 0xa6, 0x67, 0x2e, 0x49, 0x7c, 0xaa, 0x93, 0x87, 0x73, 0x62, 0x6c, 0xa4, 0xaa, 0x71, 0xa7,
0x67, 0x2f, 0x4a, 0x7c, 0xab, 0x94, 0x87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 0x37, 0x4a, 0x85, 0xcd, 0xa8, 0x68, 0x30, 0x4b, 0x7d, 0xac, 0x95, 0x88, 0x74, 0x63,
0x6e, 0xa6, 0xac, 0x73, 0xab, 0x94, 0x87, 0x73, 0x62, 0x6d, 0xa5, 0xab, 0x72, 0x5a
},
{
0xbf, 0xdc, 0xd4, 0xaa, 0x82, 0x81, 0x35, 0x34, 0x4d, 0x75, 0x95, 0xcb, 0xde, 0xc9, 0x91, 0x72,
0x4a, 0x30, 0x6b, 0x57, 0x69, 0x7d, 0x65, 0x3f, 0x33, 0x4f, 0x69, 0x81, 0xc1, 0xde, 0xd6, 0xac,
0x83, 0x82, 0x37, 0x36, 0x4f, 0x77, 0x96, 0xcd, 0xe0, 0xca, 0x93, 0x73, 0x4c, 0x31, 0x6d, 0x58,
0x6a, 0x4f, 0x68, 0x80, 0xc0, 0xdd, 0xd5, 0xab, 0x82, 0x82, 0x36, 0x35, 0x4e, 0x76, 0x95, 0xcc,
0xdf, 0xca, 0x92, 0x73, 0x4b, 0x31, 0x6c, 0x57, 0x6a, 0xe0, 0xca, 0x92, 0x73, 0x4c, 0x31, 0x6c,
0x58, 0x6a, 0xad, 0xd5, 0xdb, 0xbc, 0x7b, 0x63, 0x3c, 0x31, 0x4e, 0x66, 0x7e, 0xbe, 0xdb, 0xd3,
0xaa, 0x81, 0x80, 0x34, 0x33, 0x4c, 0x75, 0x94, 0xcb, 0xde, 0xc8, 0x91, 0x71, 0x4a, 0x2f, 0x6b,
0x56, 0x68, 0x35, 0x4e, 0x76, 0x95, 0xcc, 0xdf, 0xca, 0x92, 0x72, 0x4b, 0x30, 0x6c, 0x57, 0x6a,
0xcc, 0xdf, 0xca, 0x91, 0x72, 0x4b, 0x30, 0x6c, 0x57, 0x69, 0x69, 0x7e, 0xbe, 0xdb, 0xd3, 0xa9,
0x81, 0x80, 0x34, 0x33, 0x4c, 0x74, 0x94, 0xcb, 0xdd, 0xc8, 0x90, 0x71, 0x4a, 0x2f, 0x6b, 0x55,
0x68, 0x56, 0x69, 0xac, 0xd4, 0xd9, 0xbb, 0x7a, 0x62, 0x3c, 0x30, 0x4c, 0x65, 0x7d, 0xbd, 0xda,
0xd2, 0xa8, 0x80, 0x7f, 0x34, 0x33, 0x4c, 0x74, 0x94, 0xca, 0xdd, 0xc8, 0x90, 0x71, 0x49, 0x2e,
0x6a, 0x55, 0x67, 0xd3, 0xa9, 0x81, 0x80, 0x34, 0x33, 0x4c, 0x74, 0x94, 0xca, 0xde, 0xc8, 0x91,
0x71, 0x4a, 0x2f, 0x6a, 0x56, 0x68, 0xbd, 0xda, 0xd2, 0xa8, 0x7f, 0x7e, 0x33, 0x32, 0x4b, 0x73,
0x92, 0xc9, 0xdc, 0xc7, 0x8f, 0x70, 0x49, 0x2e, 0x69, 0x54, 0x67, 0x6a, 0x56, 0x68, 0x93, 0xca,
0xdd, 0xc8, 0x90, 0x70, 0x49, 0x2e, 0x6a, 0x55, 0x68, 0x3d, 0x31, 0x4e, 0x67, 0x7f
},
}; };
@ -245,6 +372,7 @@ void upd1771c_device::device_reset()
m_nw_tpos = 0; m_nw_tpos = 0;
memset(m_n_value, 0x00, sizeof(m_n_value)); memset(m_n_value, 0x00, sizeof(m_n_value));
memset(m_n_ppos, 0x00, sizeof(m_n_ppos)); memset(m_n_ppos, 0x00, sizeof(m_n_ppos));
memset(chout,0,4*sizeof(short));
} }
@ -468,7 +596,7 @@ void upd1771c_device::sound_stream_update(short* output, int len)
for (int sampindex = 0; sampindex < len; sampindex++) for (int sampindex = 0; sampindex < len; sampindex++)
{ {
//"wavetable-LFSR" component //"wavetable-LFSR" component
int wlfsr_val = ((int)noise_tbl[m_nw_tpos]) - 127;//data too wide int wlfsr_val = ((int)noise_tbl[m_nw_timbre][m_nw_tpos]) - 127;//data too wide
m_nw_ppos++; m_nw_ppos++;
if (m_nw_ppos >= m_nw_period) if (m_nw_ppos >= m_nw_period)
@ -480,7 +608,7 @@ void upd1771c_device::sound_stream_update(short* output, int len)
} }
//mix in each of the noise's 3 pulse components //mix in each of the noise's 3 pulse components
char res[3]; signed char res[3];
for (int i = 0; i < 3; ++i) for (int i = 0; i < 3; ++i)
{ {
res[i] = m_n_value[i] * 127; res[i] = m_n_value[i] * 127;
@ -492,11 +620,17 @@ void upd1771c_device::sound_stream_update(short* output, int len)
} }
} }
//not quite, but close. //not quite, but close.
chout[0]=res[0] * m_n_volume[0];
chout[1]=res[1] * m_n_volume[1];
chout[2]=res[2] * m_n_volume[2];
chout[3]=wlfsr_val * m_nw_volume;
output[sampindex]= output[sampindex]=
((wlfsr_val * m_nw_volume) | ((chout[3]) |
(res[0] * m_n_volume[0]) | (chout[0]) |
(res[1] * m_n_volume[1]) | (chout[1]) |
(res[2] * m_n_volume[2])) * 8; (chout[2])) * 8;
} }
break; break;

View file

@ -29,6 +29,8 @@ public:
// sound stream update overrides // sound stream update overrides
void sound_stream_update(short* output, int len); void sound_stream_update(short* output, int len);
short chout[4];
private: private:
static constexpr unsigned MAX_PACKET_SIZE = 0x8000; static constexpr unsigned MAX_PACKET_SIZE = 0x8000;