C219: more updates

to-do:
- VGM export
- presets
- noise/invert toggles
This commit is contained in:
tildearrow 2023-08-27 20:05:08 -05:00
parent 859182bb08
commit 26f6f22ef5
3 changed files with 10 additions and 5 deletions

View File

@ -193,10 +193,9 @@ void DivPlatformC140::tick(bool sysTick) {
unsigned int end=0;
if (chan[i].sample>=0 && chan[i].sample<parent->song.sampleLen) {
if (is219) {
bank=(sampleOff[chan[i].sample]>>16)&0xff;
bank=(sampleOff[chan[i].sample]>>16)&3;
start=sampleOff[chan[i].sample]&0xffff;
end=MIN(start+(s->length8>>1)-1,65535);
logV("sampleOff[%d]=%d",chan[i].sample,sampleOff[chan[i].sample]);
} else {
bank=(sampleOff[chan[i].sample]>>16)&0xff;
start=sampleOff[chan[i].sample]&0xffff;
@ -217,8 +216,10 @@ void DivPlatformC140::tick(bool sysTick) {
}
rWrite(0x05+(i<<4),0); // force keyoff first
if (is219) {
// TODO; group banking
if (groupBank[i>>2]!=bank) {
groupBank[i>>2]=bank;
}
rWrite(0x1f1+(((3+(i>>2))&3)<<1),groupBank[i>>2]);
} else {
rWrite(0x04+(i<<4),bank);
}
@ -427,6 +428,9 @@ void DivPlatformC140::reset() {
chan[i].std.setEngine(parent);
rWrite(0x05+(i<<4),0);
}
for (int i=0; i<4; i++) {
groupBank[i]=0;
}
}
int DivPlatformC140::getOutputCount() {

View File

@ -55,6 +55,7 @@ class DivPlatformC140: public DivDispatch {
bool sampleLoaded[256];
bool is219;
int totalChans;
unsigned char groupBank[4];
unsigned char* sampleMem;
size_t sampleMemLen;

View File

@ -1891,7 +1891,7 @@ void DivEngine::registerSystems() {
"Namco C219", NULL, 0xcf, 0, 16, false, true, 0x161, false, (1U<<DIV_SAMPLE_DEPTH_MULAW)|(1U<<DIV_SAMPLE_DEPTH_8BIT),
"Namco's PCM chip used in their NA1/2 hardware.",
{"Channel 1", "Channel 2", "Channel 3", "Channel 4", "Channel 5", "Channel 6", "Channel 7", "Channel 8", "Channel 9", "Channel 10", "Channel 11", "Channel 12", "Channel 13", "Channel 14", "Channel 15", "Channel 16"},
{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24"},
{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16"},
{DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM},
{DIV_INS_C219, DIV_INS_C219, DIV_INS_C219, DIV_INS_C219, DIV_INS_C219, DIV_INS_C219, DIV_INS_C219, DIV_INS_C219, DIV_INS_C219, DIV_INS_C219, DIV_INS_C219, DIV_INS_C219, DIV_INS_C219, DIV_INS_C219, DIV_INS_C219, DIV_INS_C219},
{DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA},