From 05a8b65ec66d00f7dd5f2a0b6ee48eb1f98be77e Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 5 Feb 2024 13:07:38 -0500 Subject: [PATCH] fix .dmp saving for OPM and NES to-do: which system is PCE, NES and OPM? --- src/engine/instrument.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/engine/instrument.cpp b/src/engine/instrument.cpp index 31be38638..754bcfd2a 100644 --- a/src/engine/instrument.cpp +++ b/src/engine/instrument.cpp @@ -3678,15 +3678,18 @@ bool DivInstrument::saveDMP(const char* path) { // guess the system switch (type) { case DIV_INS_FM: - // we can't tell between Genesis, Neo Geo and Arcade ins type yet + // we can't tell Genesis and Neo Geo apart w->writeC(0x02); w->writeC(1); break; case DIV_INS_STD: - // we can't tell between SMS and NES ins type yet w->writeC(0x03); w->writeC(0); break; + case DIV_INS_NES: + w->writeC(0x06); + w->writeC(0); + break; case DIV_INS_GB: w->writeC(0x04); w->writeC(0); @@ -3696,7 +3699,7 @@ bool DivInstrument::saveDMP(const char* path) { w->writeC(0); break; case DIV_INS_PCE: - w->writeC(0x06); + w->writeC(0x05); w->writeC(0); break; case DIV_INS_OPLL: @@ -3704,6 +3707,10 @@ bool DivInstrument::saveDMP(const char* path) { w->writeC(0x13); w->writeC(1); break; + case DIV_INS_OPM: + w->writeC(0x08); + w->writeC(1); + break; case DIV_INS_OPZ: // data will be lost w->writeC(0x08); @@ -3720,7 +3727,7 @@ bool DivInstrument::saveDMP(const char* path) { return false; } - if (type==DIV_INS_FM || type==DIV_INS_OPLL || type==DIV_INS_OPZ) { + if (type==DIV_INS_FM || type==DIV_INS_OPM || type==DIV_INS_OPLL || type==DIV_INS_OPZ) { w->writeC(fm.fms); w->writeC(fm.fb); w->writeC(fm.alg);