diff --git a/src/engine/fileOpsIns.cpp b/src/engine/fileOpsIns.cpp index ddf9a1df7..602fbba55 100644 --- a/src/engine/fileOpsIns.cpp +++ b/src/engine/fileOpsIns.cpp @@ -650,12 +650,12 @@ void DivEngine::loadY12(SafeReader& reader, std::vector& ret, St ins->fm.ops = 4; ins->name = stripPath; - for (int i = 0; i < 4; ++i) { + for (int i : {0,1,2,3}) { DivInstrumentFM::Operator& insOp = ins->fm.op[i]; uint8_t tmp = reader.readC(); insOp.mult = (tmp & 0xF); insOp.dt = ((tmp >> 4) & 0x7); - insOp.tl = (reader.readC() & 0xF); + insOp.tl = (reader.readC() & 0x3F); tmp = reader.readC(); insOp.rs = ((tmp >> 6) & 0x3); insOp.ar = (tmp & 0x1F); @@ -671,7 +671,7 @@ void DivEngine::loadY12(SafeReader& reader, std::vector& ret, St } ins->fm.alg = reader.readC(); ins->fm.fb = reader.readC(); - reader.seek(14, SEEK_CUR); + reader.seek(62, SEEK_CUR); ret.push_back(ins); } catch (EndOfFileException& e) { lastError = "premature end of file"; diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index d3218b30c..47b81f6eb 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -1290,9 +1290,9 @@ void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) { if (!dirExists(workingDirIns)) workingDirIns=getHomeDir(); hasOpened=fileDialog->openLoad( "Load Instrument", - {"compatible files", "*.fui *.dmp *.tfi *.vgi *.s3i *.sbi *.bnk *.ff *.opm", + {"compatible files", "*.fui *.dmp *.tfi *.vgi *.s3i *.sbi *.y12 *.bnk *.ff *.opm", "all files", ".*"}, - "compatible files{.fui,.dmp,.tfi,.vgi,.s3i,.sbi,.bnk,.ff,.opm},.*", + "compatible files{.fui,.dmp,.tfi,.vgi,.s3i,.sbi,.y12,.bnk,.ff,.opm},.*", workingDirIns, dpiScale ); diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index f1565b8ee..5ed9cf0ad 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -2485,6 +2485,7 @@ void FurnaceGUI::applyUISettings(bool updateFonts) { ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtension,".vgi",uiColors[GUI_COLOR_FILE_INSTR],ICON_FA_FILE); ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtension,".s3i",uiColors[GUI_COLOR_FILE_INSTR],ICON_FA_FILE); ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtension,".sbi",uiColors[GUI_COLOR_FILE_INSTR],ICON_FA_FILE); + ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtension,".y12",uiColors[GUI_COLOR_FILE_INSTR],ICON_FA_FILE); ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtension,".bnk",uiColors[GUI_COLOR_FILE_INSTR],ICON_FA_FILE); ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtension,".fti",uiColors[GUI_COLOR_FILE_INSTR],ICON_FA_FILE); ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtension,".bti",uiColors[GUI_COLOR_FILE_INSTR],ICON_FA_FILE);