Merge branch 'master' into es5506_alt

This commit is contained in:
cam900 2022-10-09 20:05:15 +09:00 committed by GitHub
commit f8c494e1dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
57 changed files with 3520 additions and 397 deletions

View file

@ -30,6 +30,12 @@ void FurnaceGUI::drawDebug() {
static int bpRow;
static int bpTick;
static bool bpOn;
static double ptcClock;
static double ptcDivider;
static int ptcOctave;
static int ptcMode;
static int ptcBlockBits;
if (nextWindow==GUI_WINDOW_DEBUG) {
debugOpen=true;
ImGui::SetNextWindowFocus();
@ -98,7 +104,7 @@ void FurnaceGUI::drawDebug() {
ImGui::Columns();
ImGui::TreePop();
}
if (ImGui::TreeNode("Playback Status")) {
if (ImGui::TreeNode("Channel Status")) {
ImGui::Text("for best results set latency to minimum or use the Frame Advance button.");
ImGui::Columns(e->getTotalChannelCount());
for (int i=0; i<e->getTotalChannelCount(); i++) {
@ -160,6 +166,11 @@ void FurnaceGUI::drawDebug() {
ImGui::Columns();
ImGui::TreePop();
}
if (ImGui::TreeNode("Playback Status")) {
String pdi=e->getPlaybackDebugInfo();
ImGui::TextWrapped("%s",pdi.c_str());
ImGui::TreePop();
}
if (ImGui::TreeNode("Sample Debug")) {
for (int i=0; i<e->song.sampleLen; i++) {
DivSample* sample=e->getSample(i);
@ -296,6 +307,78 @@ void FurnaceGUI::drawDebug() {
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Pitch Table Calculator")) {
ImGui::InputDouble("Clock",&ptcClock);
ImGui::InputDouble("Divider/FreqBase",&ptcDivider);
ImGui::InputInt("Octave",&ptcOctave);
if (ImGui::RadioButton("Frequency",ptcMode==0)) ptcMode=0;
ImGui::SameLine();
if (ImGui::RadioButton("Period",ptcMode==1)) ptcMode=1;
ImGui::SameLine();
if (ImGui::RadioButton("FreqNum/Block",ptcMode==2)) ptcMode=2;
if (ptcMode==2) {
if (ImGui::InputInt("FreqNum Bits",&ptcBlockBits)) {
if (ptcBlockBits<0) ptcBlockBits=0;
if (ptcBlockBits>13) ptcBlockBits=13;
}
}
if (ImGui::BeginTable("PitchTable",7)) {
ImGui::TableNextRow(ImGuiTableRowFlags_Headers);
ImGui::TableNextColumn();
ImGui::Text("Note");
ImGui::TableNextColumn();
ImGui::Text("Pitch");
ImGui::TableNextColumn();
ImGui::Text("Base");
ImGui::TableNextColumn();
ImGui::Text("Hex");
ImGui::TableNextColumn();
ImGui::Text("Final");
ImGui::TableNextColumn();
ImGui::Text("Hex");
ImGui::TableNextColumn();
ImGui::Text("Delta");
int lastFinal=0;
for (int i=0; i<12; i++) {
int note=(12*ptcOctave)+i;
int pitch=0;
int base=e->calcBaseFreq(ptcClock,ptcDivider,note,ptcMode==1);
int final=e->calcFreq(base,pitch,ptcMode==1,0,0,ptcClock,ptcDivider,(ptcMode==2)?ptcBlockBits:0);
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("%d",note);
ImGui::TableNextColumn();
ImGui::Text("%d",pitch);
ImGui::TableNextColumn();
ImGui::Text("%d",base);
ImGui::TableNextColumn();
ImGui::Text("%x",base);
ImGui::TableNextColumn();
ImGui::Text("%d",final);
ImGui::TableNextColumn();
ImGui::Text("%x",final);
ImGui::TableNextColumn();
ImGui::Text("%d",final-lastFinal);
lastFinal=final;
}
ImGui::EndTable();
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Playground")) {
if (pgSys<0 || pgSys>=e->song.systemLen) pgSys=0;
if (ImGui::BeginCombo("Chip",fmt::sprintf("%d. %s",pgSys+1,e->getSystemName(e->song.system[pgSys])).c_str())) {