Merge branch 'tildearrow:master' into welcomescr

This commit is contained in:
Eknous 2024-09-22 11:31:03 +04:00 committed by GitHub
commit 8dc8bc285d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
69 changed files with 10475 additions and 2379 deletions

View file

@ -301,6 +301,8 @@ const char* aboutLine[]={
_N("ep128emu by Istvan Varga"),
_N("NDS sound emulator by cam900"),
_N("openMSX YMF278 emulator (modified version) by the openMSX developers"),
_N("SID2 emulator by LTVA (modification of reSID emulator)"),
_N("SID3 emulator by LTVA"),
"",
_N("greetings to:"),
"floxy!",

File diff suppressed because it is too large Load diff

View file

@ -356,6 +356,7 @@ enum FurnaceGUIColors {
GUI_COLOR_INSTR_SID2,
GUI_COLOR_INSTR_SUPERVISION,
GUI_COLOR_INSTR_UPD1771C,
GUI_COLOR_INSTR_SID3,
GUI_COLOR_INSTR_UNKNOWN,
GUI_COLOR_CHANNEL_BG,
@ -2236,7 +2237,7 @@ class FurnaceGUI {
vsync(1),
frameRateLimit(60),
displayRenderTime(0),
inputRepeat(0),
inputRepeat(1),
glRedSize(8),
glGreenSize(8),
glBlueSize(8),
@ -2749,9 +2750,11 @@ class FurnaceGUI {
void drawSSGEnv(unsigned char type, const ImVec2& size);
void drawWaveform(unsigned char type, bool opz, const ImVec2& size);
void drawWaveformSID3(unsigned char type, const ImVec2& size);
void drawAlgorithm(unsigned char alg, FurnaceGUIFMAlgs algType, const ImVec2& size);
void drawESFMAlgorithm(DivInstrumentESFM& esfm, const ImVec2& size);
void drawFMEnv(unsigned char tl, unsigned char ar, unsigned char dr, unsigned char d2r, unsigned char rr, unsigned char sl, unsigned char sus, unsigned char egt, unsigned char algOrGlobalSus, float maxTl, float maxArDr, float maxRr, const ImVec2& size, unsigned short instType);
void drawSID3Env(unsigned char tl, unsigned char ar, unsigned char dr, unsigned char d2r, unsigned char rr, unsigned char sl, unsigned char sus, unsigned char egt, unsigned char algOrGlobalSus, float maxTl, float maxArDr, float maxRr, const ImVec2& size, unsigned short instType);
void drawGBEnv(unsigned char vol, unsigned char len, unsigned char sLen, bool dir, const ImVec2& size);
bool drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& flags, bool modifyOnChange, bool fromMenu=false);
void kvsConfig(DivInstrument* ins, bool supportsKVS=true);
@ -2815,6 +2818,7 @@ class FurnaceGUI {
void insTabFMModernHeader(DivInstrument* ins);
void insTabFM(DivInstrument* ins);
void insTabWavetable(DivInstrument* ins);
void insTabSample(DivInstrument* ins);
void drawOrderButtons();
@ -2851,6 +2855,7 @@ class FurnaceGUI {
void drawPattern();
void drawInsList(bool asChild=false);
void drawInsEdit();
void drawInsSID3(DivInstrument* ins);
void drawWaveList(bool asChild=false);
void drawWaveEdit();
void drawSampleList(bool asChild=false);

View file

@ -186,6 +186,7 @@ const char* insTypes[DIV_INS_MAX+1][3]={
{"SID2",ICON_FA_KEYBOARD_O,ICON_FUR_INS_SID2},
{"Watara Supervision",ICON_FA_GAMEPAD,ICON_FUR_INS_SUPERVISION},
{"NEC μPD1771C",ICON_FA_BAR_CHART,ICON_FUR_INS_UPD1771C},
{"SID3",ICON_FA_KEYBOARD_O,ICON_FUR_INS_SID3},
{NULL,ICON_FA_QUESTION,ICON_FA_QUESTION}
};
@ -346,40 +347,40 @@ const FurnaceGUIColors fxColors[256]={
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
// 60-6F
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
// 70-7F
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
// 80-8F
GUI_COLOR_PATTERN_EFFECT_PANNING,
@ -418,27 +419,27 @@ const FurnaceGUIColors fxColors[256]={
GUI_COLOR_PATTERN_EFFECT_MISC,
// A0-AF
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
// B0-BF
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID,
@ -1022,6 +1023,7 @@ const FurnaceGUIColorDef guiColors[GUI_COLOR_MAX]={
D(GUI_COLOR_INSTR_SID2,"",ImVec4(0.6f,0.75f,1.0f,1.0f)),
D(GUI_COLOR_INSTR_SUPERVISION,"",ImVec4(0.52f,1.0f,0.6f,1.0f)),
D(GUI_COLOR_INSTR_UPD1771C,"",ImVec4(0.94f,0.52f,0.6f,1.0f)),
D(GUI_COLOR_INSTR_SID3,"",ImVec4(0.6f,0.75f,0.6f,1.0f)),
D(GUI_COLOR_INSTR_UNKNOWN,"",ImVec4(0.3f,0.3f,0.3f,1.0f)),
D(GUI_COLOR_CHANNEL_BG,"",ImVec4(0.4f,0.6f,0.8f,1.0f)),
@ -1274,6 +1276,7 @@ const int availableSystems[]={
DIV_SYSTEM_OPL4_DRUMS,
DIV_SYSTEM_SUPERVISION,
DIV_SYSTEM_UPD1771C,
DIV_SYSTEM_SID3,
0 // don't remove this last one!
};
@ -1373,6 +1376,7 @@ const int chipsSpecial[]={
DIV_SYSTEM_SID2,
DIV_SYSTEM_SUPERVISION,
DIV_SYSTEM_UPD1771C,
DIV_SYSTEM_SID3,
0 // don't remove this last one!
};

File diff suppressed because it is too large Load diff

View file

@ -33,6 +33,7 @@ const int _THIRTY_ONE=31;
const int _SIXTY_FOUR=64;
const int _ONE_HUNDRED=100;
const int _ONE_HUNDRED_TWENTY_SEVEN=127;
const int _ONE_HUNDRED_SEVENTY_NINE=179;
const int _TWO_HUNDRED_FIFTY_FIVE=255;
const int _FIVE_HUNDRED_ELEVEN=511;
const int _TWO_THOUSAND_FORTY_SEVEN=2047;

View file

@ -35,6 +35,7 @@ extern const int _THIRTY_ONE;
extern const int _SIXTY_FOUR;
extern const int _ONE_HUNDRED;
extern const int _ONE_HUNDRED_TWENTY_SEVEN;
extern const int _ONE_HUNDRED_SEVENTY_NINE;
extern const int _TWO_HUNDRED_FIFTY_FIVE;
extern const int _FIVE_HUNDRED_ELEVEN;
extern const int _TWO_THOUSAND_FORTY_SEVEN;

View file

@ -37,7 +37,7 @@ void FurnaceGUI::drawSysDefs(std::vector<FurnaceGUISysDef>& category, bool& acce
ImGui::TableNextColumn();
if (!i.subDefs.empty()) {
if (i.orig.empty()) {
sysDefID=fmt::sprintf("%s%s/%dS",i.name,sysDefIDLeader,index);
sysDefID=fmt::sprintf("%s%s/%dS",_(i.name.c_str()),sysDefIDLeader,index);
} else {
sysDefID=fmt::sprintf("%s/%dS",sysDefIDLeader,index);
}
@ -45,7 +45,7 @@ void FurnaceGUI::drawSysDefs(std::vector<FurnaceGUISysDef>& category, bool& acce
ImGui::SameLine();
}
if (!i.orig.empty()) {
sysDefID=fmt::sprintf("%s%s/%d",i.name,sysDefIDLeader,index);
sysDefID=fmt::sprintf("%s%s/%d",_(i.name.c_str()),sysDefIDLeader,index);
if (ImGui::Selectable(sysDefID.c_str(),false,ImGuiSelectableFlags_DontClosePopups)) {
nextDesc=i.definition;
nextDescName=i.name;

View file

@ -1282,116 +1282,120 @@ void FurnaceGUI::drawPattern() {
memset(floors,0,4*4*sizeof(unsigned int));
for (int i=0; i<chans; i++) {
bool isPaired=false;
int numPairs=0;
unsigned int pairMin=i;
unsigned int pairMax=i;
unsigned char curFloor=0;
if (!e->curSubSong->chanShow[i]) {
continue;
}
std::vector<DivChannelPair> pairs;
e->getChanPaired(i,pairs);
DivChannelPair pairs=e->getChanPaired(i);
for (int j=0; j<8; j++) {
if (pairs.pairs[j]==-1) continue;
int pairCh=e->dispatchFirstChan[i]+pairs.pairs[j];
if (!e->curSubSong->chanShow[pairCh]) {
for (DivChannelPair pair: pairs) {
bool isPaired=false;
int numPairs=0;
unsigned int pairMin=i;
unsigned int pairMax=i;
unsigned char curFloor=0;
if (!e->curSubSong->chanShow[i]) {
continue;
}
isPaired=true;
if ((unsigned int)pairCh<pairMin) pairMin=pairCh;
if ((unsigned int)pairCh>pairMax) pairMax=pairCh;
}
if (!isPaired) continue;
float posY=chanHeadBottom;
// find a free floor
while (curFloor<4) {
bool free=true;
for (unsigned int j=pairMin; j<=pairMax; j++) {
const unsigned int j0=j>>5;
const unsigned int j1=1U<<(j&31);
if (floors[curFloor][j0]&j1) {
free=false;
break;
for (int j=0; j<8; j++) {
if (pair.pairs[j]==-1) continue;
int pairCh=e->dispatchFirstChan[i]+pair.pairs[j];
if (!e->curSubSong->chanShow[pairCh]) {
continue;
}
}
if (free) break;
curFloor++;
}
if (curFloor<4) {
// occupy floor
floors[curFloor][pairMin>>5]|=1U<<(pairMin&31);
floors[curFloor][pairMax>>5]|=1U<<(pairMax&31);
}
pos=(patChanX[i+1]+patChanX[i])*0.5;
posCenter=pos;
posMin=pos;
posMax=pos;
numPairs++;
if (pairs.label==NULL) {
textSize=ImGui::CalcTextSize("???");
} else {
textSize=ImGui::CalcTextSize(pairs.label);
}
posY+=(textSize.y+ImGui::GetStyle().ItemSpacing.y)*curFloor;
tdl->AddLine(
ImVec2(pos,chanHeadBottom),
ImVec2(pos,posY+textSize.y),
ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]),
2.0f*dpiScale
);
for (int j=0; j<8; j++) {
if (pairs.pairs[j]==-1) continue;
int pairCh=e->dispatchFirstChan[i]+pairs.pairs[j];
if (!e->curSubSong->chanShow[pairCh]) {
continue;
isPaired=true;
if ((unsigned int)pairCh<pairMin) pairMin=pairCh;
if ((unsigned int)pairCh>pairMax) pairMax=pairCh;
}
pos=(patChanX[pairCh+1]+patChanX[pairCh])*0.5;
posCenter+=pos;
if (!isPaired) continue;
float posY=chanHeadBottom;
// find a free floor
while (curFloor<4) {
bool free=true;
for (unsigned int j=pairMin; j<=pairMax; j++) {
const unsigned int j0=j>>5;
const unsigned int j1=1U<<(j&31);
if (floors[curFloor][j0]&j1) {
free=false;
break;
}
}
if (free) break;
curFloor++;
}
if (curFloor<4) {
// occupy floor
floors[curFloor][pairMin>>5]|=1U<<(pairMin&31);
floors[curFloor][pairMax>>5]|=1U<<(pairMax&31);
}
pos=(patChanX[i+1]+patChanX[i])*0.5;
posCenter=pos;
posMin=pos;
posMax=pos;
numPairs++;
if (pos<posMin) posMin=pos;
if (pos>posMax) posMax=pos;
if (pair.label==NULL) {
textSize=ImGui::CalcTextSize("???");
} else {
textSize=ImGui::CalcTextSize(pair.label);
}
posY+=(textSize.y+ImGui::GetStyle().ItemSpacing.y)*curFloor;
tdl->AddLine(
ImVec2(pos,chanHeadBottom),
ImVec2(pos,posY+textSize.y),
ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]),
2.0f*dpiScale
);
}
posCenter/=numPairs;
for (int j=0; j<8; j++) {
if (pair.pairs[j]==-1) continue;
int pairCh=e->dispatchFirstChan[i]+pair.pairs[j];
if (!e->curSubSong->chanShow[pairCh]) {
continue;
}
if (pairs.label==NULL) {
tdl->AddLine(
ImVec2(posMin,posY+textSize.y),
ImVec2(posMax,posY+textSize.y),
ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]),
2.0f*dpiScale
);
} else {
tdl->AddLine(
ImVec2(posMin,posY+textSize.y),
ImVec2(posCenter-textSize.x*0.5-6.0f*dpiScale,posY+textSize.y),
ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]),
2.0f*dpiScale
);
tdl->AddLine(
ImVec2(posCenter+textSize.x*0.5+6.0f*dpiScale,posY+textSize.y),
ImVec2(posMax,posY+textSize.y),
ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]),
2.0f*dpiScale
);
pos=(patChanX[pairCh+1]+patChanX[pairCh])*0.5;
posCenter+=pos;
numPairs++;
if (pos<posMin) posMin=pos;
if (pos>posMax) posMax=pos;
tdl->AddLine(
ImVec2(pos,chanHeadBottom),
ImVec2(pos,posY+textSize.y),
ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]),
2.0f*dpiScale
);
}
delayedLabels.push_back(DelayedLabel(posCenter,posY,textSize,pairs.label));
posCenter/=numPairs;
if (pair.label==NULL) {
tdl->AddLine(
ImVec2(posMin,posY+textSize.y),
ImVec2(posMax,posY+textSize.y),
ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]),
2.0f*dpiScale
);
} else {
tdl->AddLine(
ImVec2(posMin,posY+textSize.y),
ImVec2(posCenter-textSize.x*0.5-6.0f*dpiScale,posY+textSize.y),
ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]),
2.0f*dpiScale
);
tdl->AddLine(
ImVec2(posCenter+textSize.x*0.5+6.0f*dpiScale,posY+textSize.y),
ImVec2(posMax,posY+textSize.y),
ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]),
2.0f*dpiScale
);
delayedLabels.push_back(DelayedLabel(posCenter,posY,textSize,pair.label));
}
}
}

View file

@ -185,7 +185,7 @@ void PlotNoLerp(const char* label, const float* values, int values_count, int va
PlotNoLerpEx(ImGuiPlotType_Lines, label, &Plot_ArrayGetter, (void*)&data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size);
}
int PlotBitfieldEx(const char* label, int (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char** overlay_text, int bits, ImVec2 frame_size, const bool* values_highlight, ImVec4 highlightColor, ImVec4 color)
int PlotBitfieldEx(const char* label, int (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char** overlay_text, int bits, ImVec2 frame_size, const bool* values_highlight, ImVec4 highlightColor, ImVec4 color, std::string (*hoverFunc)(int,float,void*), void* hoverFuncUser)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = ImGui::GetCurrentWindow();
@ -225,8 +225,18 @@ int PlotBitfieldEx(const char* label, int (*values_getter)(void* data, int idx),
const int v_idx = (int)(t * item_count);
IM_ASSERT(v_idx >= 0 && v_idx < values_count);
//const float v0 = values_getter(data, (v_idx + values_offset) % values_count);
const float v0 = values_getter(data, (v_idx + values_offset) % values_count);
//ImGui::SetTooltip("%d: %8.4g", v_idx, v0);
if (hoverFunc) {
std::string hoverText=hoverFunc(v_idx,v0,hoverFuncUser);
if (!hoverText.empty()) {
ImGui::SetTooltip("%s",hoverText.c_str());
}
} else {
ImGui::SetTooltip("%d: %d (%X)", v_idx, (int)v0, (int)v0);
}
idx_hovered = v_idx;
}
@ -290,10 +300,10 @@ int PlotBitfieldEx(const char* label, int (*values_getter)(void* data, int idx),
return idx_hovered;
}
void PlotBitfield(const char* label, const int* values, int values_count, int values_offset, const char** overlay_text, int bits, ImVec2 graph_size, int stride, const bool* values_highlight, ImVec4 highlightColor, ImVec4 color)
void PlotBitfield(const char* label, const int* values, int values_count, int values_offset, const char** overlay_text, int bits, ImVec2 graph_size, int stride, const bool* values_highlight, ImVec4 highlightColor, ImVec4 color, std::string (*hoverFunc)(int,float,void*), void* hoverFuncUser)
{
FurnacePlotIntArrayGetterData data(values, stride);
PlotBitfieldEx(label, &Plot_IntArrayGetter, (void*)&data, values_count, values_offset, overlay_text, bits, graph_size, values_highlight, highlightColor, color);
PlotBitfieldEx(label, &Plot_IntArrayGetter, (void*)&data, values_count, values_offset, overlay_text, bits, graph_size, values_highlight, highlightColor, color, hoverFunc, hoverFuncUser);
}
int PlotCustomEx(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_display_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 frame_size, ImVec4 color, int highlight, std::string (*hoverFunc)(int,float,void*), void* hoverFuncUser, bool blockMode, std::string (*guideFunc)(float), const bool* values_highlight, ImVec4 highlightColor)

View file

@ -21,5 +21,5 @@
#include "../pch.h"
void PlotNoLerp(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0, 0), int stride = sizeof(float));
void PlotBitfield(const char* label, const int* values, int values_count, int values_offset = 0, const char** overlay_text = NULL, int bits = 8, ImVec2 graph_size = ImVec2(0, 0), int stride = sizeof(float), const bool* values_highlight = NULL, ImVec4 highlightColor = ImVec4(1.0f,1.0f,1.0f,1.0f), ImVec4 color = ImVec4(1.0f,1.0f,1.0f,1.0f));
void PlotBitfield(const char* label, const int* values, int values_count, int values_offset = 0, const char** overlay_text = NULL, int bits = 8, ImVec2 graph_size = ImVec2(0, 0), int stride = sizeof(float), const bool* values_highlight = NULL, ImVec4 highlightColor = ImVec4(1.0f,1.0f,1.0f,1.0f), ImVec4 color = ImVec4(1.0f,1.0f,1.0f,1.0f), std::string (*hoverFunc)(int,float,void*) = NULL, void* hoverFuncUser = NULL);
void PlotCustom(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0, 0), int stride = sizeof(float), ImVec4 fgColor = ImVec4(1.0f,1.0f,1.0f,1.0f), int highlight = 0, std::string (*hoverFunc)(int,float,void*) = NULL, void* hoverFuncUser=NULL, bool blockMode=false, std::string (*guideFunc)(float) = NULL, const bool* values_highlight = NULL, ImVec4 highlightColor = ImVec4(1.0f,1.0f,1.0f,1.0f));

File diff suppressed because it is too large Load diff

View file

@ -83,7 +83,7 @@ const char* locales[][3]={
//{"Nederlands (4%)", "nl_NL", "start Furnace opnieuw op om deze instelling effectief te maken."},
{"Polski (95%)", "pl_PL", "aby to ustawienie było skuteczne, należy ponownie uruchomić program."},
{"Português (Brasil) (90%)", "pt_BR", "reinicie o Furnace para que essa configuração entre em vigor."},
{"Русский (90%)", "ru_RU", "перезапустите программу, чтобы эта настройка вступила в силу."},
{"Русский", "ru_RU", "перезапустите программу, чтобы эта настройка вступила в силу."},
{"Slovenčina (15%)", "sk_SK", "???"},
{"Svenska", "sv_SE", "starta om programmet för att denna inställning ska träda i kraft."},
//{"ไทย (0%)", "th_TH", "???"},
@ -4167,6 +4167,7 @@ void FurnaceGUI::drawSettings() {
UI_COLOR_CONFIG(GUI_COLOR_INSTR_SID2,_("SID2"));
UI_COLOR_CONFIG(GUI_COLOR_INSTR_SUPERVISION,_("Supervision"));
UI_COLOR_CONFIG(GUI_COLOR_INSTR_UPD1771C,_("μPD1771C"));
UI_COLOR_CONFIG(GUI_COLOR_INSTR_SID3,_("SID3"));
UI_COLOR_CONFIG(GUI_COLOR_INSTR_UNKNOWN,_("Other/Unknown"));
ImGui::TreePop();
}
@ -4900,7 +4901,7 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
settings.selectAssetOnLoad=conf.getInt("selectAssetOnLoad",1);
settings.inputRepeat=conf.getInt("inputRepeat",0);
settings.inputRepeat=conf.getInt("inputRepeat",1);
}
if (groups&GUI_SETTINGS_FONT) {

View file

@ -2619,6 +2619,28 @@ bool FurnaceGUI::drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& fl
supportsCustomRate=false;
ImGui::Text(_("nothing to configure"));
break;
case DIV_SYSTEM_SID3: {
bool quarterClock=flags.getBool("quarterClock",false);
if (ImGui::Checkbox(_("Quarter clock speed"),&quarterClock)) {
altered=true;
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip(_("Decreases clock speed and CPU audio load by 4 times.\nCan be used if your CPU is too slow for the chip."
"\nDoes not affect clock speed during export!\n\n"
"Warning! Filters may become unstable at high cutoff and resonance\nif this option or lower clock speed are used!\n"
"Also filters' timbre may be different near these values.\n\n"
"Default clock speed is 1MHz (1000000Hz)."));
}
if (altered) {
e->lockSave([&]() {
flags.set("quarterClock",(int)quarterClock);
});
}
break;
}
default: {
bool sysPal=flags.getInt("clockSel",0);

View file

@ -112,3 +112,109 @@ String getKeyName(int key, bool emptyNone) {
}
return ret;
}
double sinus(double x) {
return sin(x);
}
double rectSin(double x) {
return sin(x) > 0 ? sin(x) : 0;
}
double absSin(double x) {
return fabs(sin(x));
}
double square(double x) {
return fmod(x, (2 * M_PI)) >= M_PI ? -1 : 1;
}
double rectSquare(double x) {
return square(x) > 0 ? square(x) : 0;
}
double quartSin(double x) {
return absSin(x) * rectSquare(2 * x);
}
double squiSin(double x) {
return sin(x) >= 0 ? sin(2 * x) : 0;
}
double squiAbsSin(double x) {
return fabs(squiSin(x));
}
double saw(double x) {
return atan(tan(x / 2)) / (M_PI / 2);
}
double rectSaw(double x) {
return saw(x) > 0 ? saw(x) : 0;
}
double absSaw(double x) {
return saw(x) < 0 ? saw(x) + 1 : saw(x);
}
double cubSaw(double x) {
return pow(saw(x), 3);
}
double rectCubSaw(double x) {
return pow(rectSaw(x), 3);
}
double absCubSaw(double x) {
return pow(absSaw(x), 3);
}
double cubSine(double x) {
return pow(sin(x), 3);
}
double rectCubSin(double x) {
return pow(rectSin(x), 3);
}
double absCubSin(double x) {
return pow(absSin(x), 3);
}
double quartCubSin(double x) {
return pow(quartSin(x), 3);
}
double squishCubSin(double x) {
return pow(squiSin(x), 3);
}
double squishAbsCubSin(double x) {
return pow(squiAbsSin(x), 3);
}
double triangle(double x) {
return asin(sin(x)) / (M_PI / 2);
}
double rectTri(double x) {
return triangle(x) > 0 ? triangle(x) : 0;
}
double absTri(double x) {
return fabs(triangle(x));
}
double quartTri(double x) {
return absTri(x) * rectSquare(2 * x);
}
double squiTri(double x) {
return sin(x) >= 0 ? triangle(2 * x) : 0;
}
double absSquiTri(double x) {
return fabs(squiTri(x));
}
double cubTriangle(double x) {
return pow(triangle(x), 3);
}
double cubRectTri(double x) {
return pow(rectTri(x), 3);
}
double cubAbsTri(double x) {
return pow(absTri(x), 3);
}
double cubQuartTri(double x) {
return pow(quartTri(x), 3);
}
double cubSquiTri(double x) {
return pow(squiTri(x), 3);
}
double absCubSquiTri(double x) {
return fabs(cubSquiTri(x));
}

View file

@ -30,4 +30,37 @@
#endif
String getHomeDir();
String getKeyName(int key, bool emptyNone=false);
String getKeyName(int key, bool emptyNone=false);
double sinus(double x);
double rectSin(double x);
double absSin(double x);
double square(double x);
double rectSquare(double x);
double quartSin(double x);
double squiSin(double x);
double squiAbsSin(double x);
double saw(double x);
double rectSaw(double x);
double absSaw(double x);
double cubSaw(double x);
double rectCubSaw(double x);
double absCubSaw(double x);
double cubSine(double x);
double rectCubSin(double x);
double absCubSin(double x);
double quartCubSin(double x);
double squishCubSin(double x);
double squishAbsCubSin(double x);
double triangle(double x);
double rectTri(double x);
double absTri(double x);
double quartTri(double x);
double squiTri(double x);
double absSquiTri(double x);
double cubTriangle(double x);
double cubRectTri(double x);
double cubAbsTri(double x);
double cubQuartTri(double x);
double cubSquiTri(double x);
double absCubSquiTri(double x);

View file

@ -19,6 +19,7 @@
#define _USE_MATH_DEFINES
#include "gui.h"
#include "util.h"
#include "plot_nolerp.h"
#include "IconsFontAwesome4.h"
#include "misc/cpp/imgui_stdlib.h"
@ -40,111 +41,6 @@ const char* waveInterpolations[4]={
_N("Cubic")
};
double sinus(double x) {
return sin(x);
}
double rectSin(double x) {
return sin(x) > 0 ? sin(x) : 0;
}
double absSin(double x) {
return fabs(sin(x));
}
double square(double x) {
return fmod(x, (2 * M_PI)) >= M_PI ? -1 : 1;
}
double rectSquare(double x) {
return square(x) > 0 ? square(x) : 0;
}
double quartSin(double x) {
return absSin(x) * rectSquare(2 * x);
}
double squiSin(double x) {
return sin(x) >= 0 ? sin(2 * x) : 0;
}
double squiAbsSin(double x) {
return fabs(squiSin(x));
}
double saw(double x) {
return atan(tan(x / 2)) / (M_PI / 2);
}
double rectSaw(double x) {
return saw(x) > 0 ? saw(x) : 0;
}
double absSaw(double x) {
return saw(x) < 0 ? saw(x) + 1 : saw(x);
}
double cubSaw(double x) {
return pow(saw(x), 3);
}
double rectCubSaw(double x) {
return pow(rectSaw(x), 3);
}
double absCubSaw(double x) {
return pow(absSaw(x), 3);
}
double cubSine(double x) {
return pow(sin(x), 3);
}
double rectCubSin(double x) {
return pow(rectSin(x), 3);
}
double absCubSin(double x) {
return pow(absSin(x), 3);
}
double quartCubSin(double x) {
return pow(quartSin(x), 3);
}
double squishCubSin(double x) {
return pow(squiSin(x), 3);
}
double squishAbsCubSin(double x) {
return pow(squiAbsSin(x), 3);
}
double triangle(double x) {
return asin(sin(x)) / (M_PI / 2);
}
double rectTri(double x) {
return triangle(x) > 0 ? triangle(x) : 0;
}
double absTri(double x) {
return fabs(triangle(x));
}
double quartTri(double x) {
return absTri(x) * rectSquare(2 * x);
}
double squiTri(double x) {
return sin(x) >= 0 ? triangle(2 * x) : 0;
}
double absSquiTri(double x) {
return fabs(squiTri(x));
}
double cubTriangle(double x) {
return pow(triangle(x), 3);
}
double cubRectTri(double x) {
return pow(rectTri(x), 3);
}
double cubAbsTri(double x) {
return pow(absTri(x), 3);
}
double cubQuartTri(double x) {
return pow(quartTri(x), 3);
}
double cubSquiTri(double x) {
return pow(squiTri(x), 3);
}
double absCubSquiTri(double x) {
return fabs(cubSquiTri(x));
}
typedef double (*WaveFunc) (double a);
WaveFunc waveFuncs[]={
@ -495,7 +391,7 @@ void FurnaceGUI::drawWaveEdit() {
ImGui::TableNextColumn();
ImGui::Text(_("Width"));
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip(_("use a width of:\n- any on Amiga/N163\n- 32 on Game Boy, PC Engine, SCC, Konami Bubble System, Namco WSG, Virtual Boy and WonderSwan\n- 64 on FDS\n- 128 on X1-010\nany other widths will be scaled during playback."));
ImGui::SetTooltip(_("use a width of:\n- any on Amiga/N163\n- 32 on Game Boy, PC Engine, SCC, Konami Bubble System, Namco WSG, Virtual Boy and WonderSwan\n- 64 on FDS\n- 128 on X1-010\n- 256 on SID3\nany other widths will be scaled during playback."));
}
ImGui::SameLine();
ImGui::SetNextItemWidth(96.0f*dpiScale);
@ -509,7 +405,7 @@ void FurnaceGUI::drawWaveEdit() {
ImGui::SameLine();
ImGui::Text(_("Height"));
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip(_("use a height of:\n- 16 for Game Boy, WonderSwan, Namco WSG, Konami Bubble System, X1-010 Envelope shape and N163\n- 32 for PC Engine\n- 64 for FDS and Virtual Boy\n- 256 for X1-010 and SCC\nany other heights will be scaled during playback."));
ImGui::SetTooltip(_("use a height of:\n- 16 for Game Boy, WonderSwan, Namco WSG, Konami Bubble System, X1-010 Envelope shape and N163\n- 32 for PC Engine\n- 64 for FDS and Virtual Boy\n- 256 for X1-010, SCC and SID3\nany other heights will be scaled during playback."));
}
ImGui::SameLine();
ImGui::SetNextItemWidth(96.0f*dpiScale);