dev84 - new compat flag and store macro modes

This commit is contained in:
tildearrow 2022-04-18 00:52:29 -05:00
parent fc8a130c71
commit b8c790bf79
6 changed files with 65 additions and 7 deletions

View file

@ -1,8 +1,7 @@
# to-do for 0.6pre1 # to-do for 0.6pre1
- panning macro - panning macro
- single macro for hard-panned chips - QSound?
- two macros for soft-panned ones
- pitch macro - pitch macro
- relative mode - relative mode
- test - test

View file

@ -42,8 +42,8 @@
#define BUSY_BEGIN_SOFT softLocked=true; isBusy.lock(); #define BUSY_BEGIN_SOFT softLocked=true; isBusy.lock();
#define BUSY_END isBusy.unlock(); softLocked=false; #define BUSY_END isBusy.unlock(); softLocked=false;
#define DIV_VERSION "dev83" #define DIV_VERSION "dev84"
#define DIV_ENGINE_VERSION 83 #define DIV_ENGINE_VERSION 84
// for imports // for imports
#define DIV_VERSION_MOD 0xff01 #define DIV_VERSION_MOD 0xff01

View file

@ -990,6 +990,9 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
ds.ignoreDACModeOutsideIntendedChannel=true; ds.ignoreDACModeOutsideIntendedChannel=true;
ds.e1e2AlsoTakePriority=false; ds.e1e2AlsoTakePriority=false;
} }
if (ds.version<84) {
ds.newSegaPCM=false;
}
ds.isDMF=false; ds.isDMF=false;
reader.readS(); // reserved reader.readS(); // reserved
@ -1334,7 +1337,12 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
reader.readC(); reader.readC();
reader.readC(); reader.readC();
} }
for (int i=0; i<23; i++) { if (ds.version>=84) {
ds.newSegaPCM=reader.readC();
} else {
reader.readC();
}
for (int i=0; i<22; i++) {
reader.readC(); reader.readC();
} }
} }
@ -2274,7 +2282,8 @@ SafeWriter* DivEngine::saveFur(bool notPrimary) {
w->writeC(song.sharedExtStat); w->writeC(song.sharedExtStat);
w->writeC(song.ignoreDACModeOutsideIntendedChannel); w->writeC(song.ignoreDACModeOutsideIntendedChannel);
w->writeC(song.e1e2AlsoTakePriority); w->writeC(song.e1e2AlsoTakePriority);
for (int i=0; i<23; i++) { w->writeC(song.newSegaPCM);
for (int i=0; i<22; i++) {
w->writeC(0); w->writeC(0);
} }

View file

@ -482,6 +482,27 @@ void DivInstrument::putInsData(SafeWriter* w) {
w->writeC(ws.param2); w->writeC(ws.param2);
w->writeC(ws.param3); w->writeC(ws.param3);
w->writeC(ws.param4); w->writeC(ws.param4);
// other macro modes
w->writeC(std.volMacro.mode);
w->writeC(std.dutyMacro.mode);
w->writeC(std.waveMacro.mode);
w->writeC(std.pitchMacro.mode);
w->writeC(std.ex1Macro.mode);
w->writeC(std.ex2Macro.mode);
w->writeC(std.ex3Macro.mode);
w->writeC(std.algMacro.mode);
w->writeC(std.fbMacro.mode);
w->writeC(std.fmsMacro.mode);
w->writeC(std.amsMacro.mode);
w->writeC(std.panLMacro.mode);
w->writeC(std.panRMacro.mode);
w->writeC(std.phaseResetMacro.mode);
w->writeC(std.ex4Macro.mode);
w->writeC(std.ex5Macro.mode);
w->writeC(std.ex6Macro.mode);
w->writeC(std.ex7Macro.mode);
w->writeC(std.ex8Macro.mode);
} }
DivDataErrors DivInstrument::readInsData(SafeReader& reader, short version) { DivDataErrors DivInstrument::readInsData(SafeReader& reader, short version) {
@ -954,6 +975,29 @@ DivDataErrors DivInstrument::readInsData(SafeReader& reader, short version) {
ws.param4=reader.readC(); ws.param4=reader.readC();
} }
// other macro modes
if (version>=84) {
std.volMacro.mode=reader.readC();
std.dutyMacro.mode=reader.readC();
std.waveMacro.mode=reader.readC();
std.pitchMacro.mode=reader.readC();
std.ex1Macro.mode=reader.readC();
std.ex2Macro.mode=reader.readC();
std.ex3Macro.mode=reader.readC();
std.algMacro.mode=reader.readC();
std.fbMacro.mode=reader.readC();
std.fmsMacro.mode=reader.readC();
std.amsMacro.mode=reader.readC();
std.panLMacro.mode=reader.readC();
std.panRMacro.mode=reader.readC();
std.phaseResetMacro.mode=reader.readC();
std.ex4Macro.mode=reader.readC();
std.ex5Macro.mode=reader.readC();
std.ex6Macro.mode=reader.readC();
std.ex7Macro.mode=reader.readC();
std.ex8Macro.mode=reader.readC();
}
return DIV_DATA_SUCCESS; return DIV_DATA_SUCCESS;
} }

View file

@ -323,6 +323,7 @@ struct DivSong {
bool sharedExtStat; bool sharedExtStat;
bool ignoreDACModeOutsideIntendedChannel; bool ignoreDACModeOutsideIntendedChannel;
bool e1e2AlsoTakePriority; bool e1e2AlsoTakePriority;
bool newSegaPCM;
DivOrders orders; DivOrders orders;
std::vector<DivInstrument*> ins; std::vector<DivInstrument*> ins;
@ -404,7 +405,8 @@ struct DivSong {
gbInsAffectsEnvelope(true), gbInsAffectsEnvelope(true),
sharedExtStat(true), sharedExtStat(true),
ignoreDACModeOutsideIntendedChannel(false), ignoreDACModeOutsideIntendedChannel(false),
e1e2AlsoTakePriority(false) { e1e2AlsoTakePriority(false),
newSegaPCM(true) {
for (int i=0; i<32; i++) { for (int i=0; i<32; i++) {
system[i]=DIV_SYSTEM_NULL; system[i]=DIV_SYSTEM_NULL;
systemVol[i]=64; systemVol[i]=64;

View file

@ -166,6 +166,10 @@ void FurnaceGUI::drawCompatFlags() {
if (ImGui::IsItemHovered()) { if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("behavior changed in 0.6"); ImGui::SetTooltip("behavior changed in 0.6");
} }
ImGui::Checkbox("New SegaPCM features (macros and better panning)",&e->song.newSegaPCM);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("behavior changed in 0.6");
}
} }
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_COMPAT_FLAGS; if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_COMPAT_FLAGS;
ImGui::End(); ImGui::End();