diff --git a/papers/format.md b/papers/format.md index cfbe256a..aab764fd 100644 --- a/papers/format.md +++ b/papers/format.md @@ -25,6 +25,7 @@ furthermore, an `or reserved` indicates this field is always present, but is res the format versions are: +- 51: Furnace 0.5.7pre3 - 50: Furnace 0.5.7pre2 - 49: Furnace 0.5.7pre1 - 48: Furnace 0.5.6 @@ -105,6 +106,7 @@ size | description | - 0x09: Neo Geo (YM2610) - 13 channels | - bit 6 enables alternate mode: | - 0x42: Genesis extended - 13 channels + | - 0x43: SMS (SN76489) + OPLL (YM2413) - 13 channels | - 0x47: C64 (6581) - 3 channels | - 0x49: Neo Geo extended - 16 channels | - bit 7 for non-DefleMask chips: @@ -444,6 +446,7 @@ size | description | - instrument | - volume | - effect and effect data... + STR | pattern name (>=51) # the Furnace instrument format (.fui) diff --git a/src/engine/engine.h b/src/engine/engine.h index 25e7c306..4d7f7e62 100644 --- a/src/engine/engine.h +++ b/src/engine/engine.h @@ -37,8 +37,8 @@ warnings+=(String("\n")+x); \ } -#define DIV_VERSION "0.5.7pre2" -#define DIV_ENGINE_VERSION 50 +#define DIV_VERSION "0.5.7pre3" +#define DIV_ENGINE_VERSION 51 enum DivStatusView { DIV_STATUS_NOTHING=0, diff --git a/src/engine/fileOps.cpp b/src/engine/fileOps.cpp index 2004af57..37ab0f83 100644 --- a/src/engine/fileOps.cpp +++ b/src/engine/fileOps.cpp @@ -986,6 +986,10 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) { pat->data[j][5+(k<<1)]=reader.readS(); } } + + if (ds.version>=51) { + pat->name=reader.readString(); + } } if (reader.tell()writeS(pat->data[j][3]); // volume w->write(&pat->data[j][4],2*song.pat[i>>16].effectRows*2); // effects } + + w->writeString(pat->name,false); } /// POINTERS diff --git a/src/gui/orders.cpp b/src/gui/orders.cpp index a30c4350..94191ec0 100644 --- a/src/gui/orders.cpp +++ b/src/gui/orders.cpp @@ -19,9 +19,10 @@ #include "gui.h" #include "IconsFontAwesome4.h" +#include void FurnaceGUI::drawOrders() { - char selID[64]; + static char selID[4096]; if (nextWindow==GUI_WINDOW_ORDERS) { ordersOpen=true; ImGui::SetNextWindowFocus(); @@ -66,9 +67,9 @@ void FurnaceGUI::drawOrders() { bool highlightLoop=(i>=loopOrder && i<=loopEnd); if (highlightLoop) ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg,ImGui::GetColorU32(uiColors[GUI_COLOR_SONG_LOOP])); if (settings.orderRowsBase==1) { - snprintf(selID,64,"%.2X##O_S%.2x",i,i); + snprintf(selID,4096,"%.2X##O_S%.2x",i,i); } else { - snprintf(selID,64,"%d##O_S%.2x",i,i); + snprintf(selID,4096,"%d##O_S%.2x",i,i); } if (ImGui::Selectable(selID)) { e->setOrder(i); @@ -79,7 +80,12 @@ void FurnaceGUI::drawOrders() { for (int j=0; jgetTotalChannelCount(); j++) { if (!e->song.chanShow[j]) continue; ImGui::TableNextColumn(); - snprintf(selID,64,"%.2X##O_%.2x_%.2x",e->song.orders.ord[j][i],j,i); + DivPattern* pat=e->song.pat[j].getPattern(e->song.orders.ord[j][i],false); + /*if (!pat->name.empty()) { + snprintf(selID,4096,"%s##O_%.2x_%.2x",pat->name.c_str(),j,i); + } else {*/ + snprintf(selID,4096,"%.2X##O_%.2x_%.2x",e->song.orders.ord[j][i],j,i); + //} if (ImGui::Selectable(selID,(orderEditMode!=0 && curOrder==i && orderCursor==j))) { if (curOrder==i) { if (orderEditMode==0) { @@ -106,6 +112,9 @@ void FurnaceGUI::drawOrders() { } } } + if (!pat->name.empty() && ImGui::IsItemHovered()) { + ImGui::SetTooltip("%s",pat->name.c_str()); + } if (ImGui::IsItemClicked(ImGuiMouseButton_Right)) { if (curOrder==i) { if (orderEditMode==0) {