Prepare for NGP system

Also add PCM DAC as system format 0xc0
This commit is contained in:
Natt Akuma 2022-07-02 08:19:25 +07:00
parent fd5f1106bc
commit fac415c8e8
4 changed files with 54 additions and 0 deletions

View file

@ -236,6 +236,7 @@ size | description
| - 0xbd: YM2612 extra features extended - 11 channels
| - 0xbe: YM2612 extra features - 7 channels
| - 0xbf: T6W28 - 4 channels
| - 0xc0: PCM DAC - 1 channel
| - 0xde: YM2610B extended - 19 channels
| - 0xe0: QSound - 19 channels
| - 0xfd: Dummy System - 8 channels

View file

@ -114,6 +114,8 @@ enum DivSystem {
DIV_SYSTEM_YM2612_FRAC,
DIV_SYSTEM_YM2612_FRAC_EXT,
DIV_SYSTEM_RESERVED_8,
DIV_SYSTEM_T6W28,
DIV_SYSTEM_PCM_DAC,
DIV_SYSTEM_DUMMY
};

View file

@ -2082,6 +2082,35 @@ void DivEngine::registerSystems() {
fmPostEffectHandler
);
sysDefs[DIV_SYSTEM_T6W28]=new DivSysDef(
"T6W28", NULL, 0xbf, 0, 4, false, true, 0, false,
"an SN76489 derivative used in Neo Geo Pocket, has independent stereo volume and noise channel frequency.",
{"Square 1", "Square 2", "Square 3", "Noise"},
{"S1", "S2", "S3", "NO"},
{DIV_CH_PULSE, DIV_CH_PULSE, DIV_CH_PULSE, DIV_CH_NOISE},
{DIV_INS_STD, DIV_INS_STD, DIV_INS_STD, DIV_INS_STD},
{},
[this](int ch, unsigned char effect, unsigned char effectVal) -> bool {
switch (effect) {
case 0x20: // SN noise mode
dispatchCmd(DivCommand(DIV_CMD_STD_NOISE_MODE,ch,effectVal));
break;
default:
return false;
}
return true;
}
);
sysDefs[DIV_SYSTEM_PCM_DAC]=new DivSysDef(
"Generic PCM DAC", NULL, 0xc0, 0, 1, false, true, 0, false,
"as generic sample playback as it gets.",
{"Sample"},
{"PCM"},
{DIV_CH_PCM},
{DIV_INS_AMIGA}
);
sysDefs[DIV_SYSTEM_DUMMY]=new DivSysDef(
"Dummy System", NULL, 0xfd, 0, 8, false, true, 0, false,
"this is a system designed for testing purposes.",

View file

@ -608,12 +608,34 @@ void FurnaceGUI::drawSysConf(int chan, DivSystem type, unsigned int& flags, bool
}
break;
}
case DIV_SYSTEM_PCM_DAC: {
int sampRate=(flags&65535)+1;
int bitDepth=((flags>>16)&15)+1;
bool stereo=(flags>>20)&1;
ImGui::Text("Output rate:");
if (CWSliderInt("##SampRate",&sampRate,1,65536)) {
if (sampRate<1) sampRate=1;
if (sampRate>65536) sampRate=65536;
copyOfFlags=(flags&(~65535))|(sampRate-1);
} rightClickable
ImGui::Text("Output depth:");
if (CWSliderInt("##BitDepth",&bitDepth,1,16)) {
if (bitDepth<1) bitDepth=1;
if (bitDepth>16) bitDepth=16;
copyOfFlags=(flags&(~(15<<16)))|((bitDepth-1)<<16);
} rightClickable
if (ImGui::Checkbox("Stereo",&stereo)) {
copyOfFlags=(flags&(~(1<<20)))|(stereo<<20);
}
break;
}
case DIV_SYSTEM_GB:
case DIV_SYSTEM_SWAN:
case DIV_SYSTEM_VERA:
case DIV_SYSTEM_BUBSYS_WSG:
case DIV_SYSTEM_YMU759:
case DIV_SYSTEM_PET:
case DIV_SYSTEM_T6W28:
ImGui::Text("nothing to configure");
break;
default: