add support for MSX2 .dmf

your songs may sound different. I am not going to bother supporting effects
and quirks
This commit is contained in:
tildearrow 2024-12-06 03:00:15 -05:00
parent 06d22f601a
commit 5ceccb5988
3 changed files with 18 additions and 0 deletions

View file

@ -413,6 +413,9 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
if (ds.system[0]==DIV_SYSTEM_ARCADE) { if (ds.system[0]==DIV_SYSTEM_ARCADE) {
ins->type=DIV_INS_OPM; ins->type=DIV_INS_OPM;
} }
if (ds.system[0]==DIV_SYSTEM_MSX2) {
ins->type=DIV_INS_SCC;
}
if ((ds.system[0]==DIV_SYSTEM_NES || ds.system[0]==DIV_SYSTEM_NES_VRC7 || ds.system[0]==DIV_SYSTEM_NES_FDS) && ins->type==DIV_INS_STD) { if ((ds.system[0]==DIV_SYSTEM_NES || ds.system[0]==DIV_SYSTEM_NES_VRC7 || ds.system[0]==DIV_SYSTEM_NES_FDS) && ins->type==DIV_INS_STD) {
ins->type=DIV_INS_NES; ins->type=DIV_INS_NES;
} }
@ -723,6 +726,9 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
if (ds.system[0]==DIV_SYSTEM_NES_FDS) { if (ds.system[0]==DIV_SYSTEM_NES_FDS) {
wave->max=63; wave->max=63;
} }
if (ds.system[0]==DIV_SYSTEM_MSX2) {
wave->max=255;
}
if (wave->len>65) { if (wave->len>65) {
logE("invalid wave length %d. are we doing something wrong?",wave->len); logE("invalid wave length %d. are we doing something wrong?",wave->len);
lastError="file is corrupt or unreadable at wavetables"; lastError="file is corrupt or unreadable at wavetables";
@ -1070,6 +1076,11 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
ds.system[0]=DIV_SYSTEM_YM2151; ds.system[0]=DIV_SYSTEM_YM2151;
ds.system[1]=DIV_SYSTEM_SEGAPCM_COMPAT; ds.system[1]=DIV_SYSTEM_SEGAPCM_COMPAT;
} }
if (ds.system[0]==DIV_SYSTEM_MSX2) {
ds.systemLen=2;
ds.system[0]=DIV_SYSTEM_AY8910;
ds.system[1]=DIV_SYSTEM_SCC;
}
if (ds.system[0]==DIV_SYSTEM_SMS_OPLL) { if (ds.system[0]==DIV_SYSTEM_SMS_OPLL) {
ds.systemLen=2; ds.systemLen=2;
ds.system[0]=DIV_SYSTEM_SMS; ds.system[0]=DIV_SYSTEM_SMS;

View file

@ -46,6 +46,7 @@ enum DivSystem {
DIV_SYSTEM_C64_6581, DIV_SYSTEM_C64_6581,
DIV_SYSTEM_C64_8580, DIV_SYSTEM_C64_8580,
DIV_SYSTEM_ARCADE, // ** COMPOUND SYSTEM - DO NOT USE! ** DIV_SYSTEM_ARCADE, // ** COMPOUND SYSTEM - DO NOT USE! **
DIV_SYSTEM_MSX2, // ** COMPOUND SYSTEM - DO NOT USE! **
DIV_SYSTEM_YM2610, DIV_SYSTEM_YM2610,
DIV_SYSTEM_YM2610_EXT, DIV_SYSTEM_YM2610_EXT,

View file

@ -969,6 +969,12 @@ void DivEngine::registerSystems() {
fmExtChEffectHandlerMap fmExtChEffectHandlerMap
); );
sysDefs[DIV_SYSTEM_MSX2]=new DivSysDef(
_("MSX + SCC"), NULL, 0, 0x0a, 8, true, false, 0, true, 0, 0, 0,
"<COMPOUND SYSTEM!>",
{}, {}, {}, {}
);
sysDefs[DIV_SYSTEM_AY8910]=new DivSysDef( sysDefs[DIV_SYSTEM_AY8910]=new DivSysDef(
_("AY-3-8910"), NULL, 0x80, 0, 3, false, true, 0x151, false, 1U<<DIV_SAMPLE_DEPTH_8BIT, 0, 0, _("AY-3-8910"), NULL, 0x80, 0, 3, false, true, 0x151, false, 1U<<DIV_SAMPLE_DEPTH_8BIT, 0, 0,
_("this chip is everywhere! ZX Spectrum, MSX, Amstrad CPC, Intellivision, Vectrex...\nthe discovery of envelope bass helped it beat the SN76489 with ease."), _("this chip is everywhere! ZX Spectrum, MSX, Amstrad CPC, Intellivision, Vectrex...\nthe discovery of envelope bass helped it beat the SN76489 with ease."),