diff --git a/src/gui/debugWindow.cpp b/src/gui/debugWindow.cpp index ba42c2374..8f1a4506b 100644 --- a/src/gui/debugWindow.cpp +++ b/src/gui/debugWindow.cpp @@ -240,11 +240,12 @@ void FurnaceGUI::drawDebug() { DivSystem system=e->song.system[i]; if (e->getChannelCount(system)>0) { if (ImGui::TreeNode(fmt::sprintf("%d: %s",i,e->getSystemName(system)).c_str())) { - if (ImGui::BeginTable("OscilloscopeTable",4,ImGuiTableFlags_Borders|ImGuiTableFlags_SizingStretchSame)) { + if (ImGui::BeginTable("OscilloscopeTable",5,ImGuiTableFlags_Borders|ImGuiTableFlags_SizingStretchSame)) { ImGui::TableSetupColumn("c0",ImGuiTableColumnFlags_WidthFixed); ImGui::TableSetupColumn("c1",ImGuiTableColumnFlags_WidthFixed); ImGui::TableSetupColumn("c2",ImGuiTableColumnFlags_WidthStretch); ImGui::TableSetupColumn("c3",ImGuiTableColumnFlags_WidthStretch); + ImGui::TableSetupColumn("c4",ImGuiTableColumnFlags_WidthStretch); ImGui::TableNextRow(); ImGui::TableNextColumn(); @@ -255,6 +256,8 @@ void FurnaceGUI::drawDebug() { ImGui::Text("Needle"); ImGui::TableNextColumn(); ImGui::Text("Data"); + ImGui::TableNextColumn(); + ImGui::Text("I am so bored!"); for (int j=0; jgetChannelCount(system); j++, c++) { DivDispatchOscBuffer* oscBuf=e->getOscBuffer(c); @@ -277,13 +280,24 @@ void FurnaceGUI::drawDebug() { // address ImGui::TableNextColumn(); unsigned int needle=oscBuf->needle; - ImGui::BeginDisabled(oscBuf->follow); - /*if (ImGui::InputInt(fmt::sprintf("##%d_OSCFollowNeedle_%d",i,c).c_str(),&needle,1,100)) { - }*/ - ImGui::EndDisabled(); + ImGui::Text("%.8x",needle); // data ImGui::TableNextColumn(); ImGui::Text("%d",oscBuf->data[needle>>16]); + // save + ImGui::TableNextColumn(); + if (ImGui::Button(fmt::sprintf("Help me!##%d_OSCSaveDamnIt",j).c_str())) { + FILE* f=fopen("/tmp/oscbuf.bin","wb"); + if (f==NULL) { + showError(fmt::sprintf("screw this bullshit! it FAILED! %s\nnow I am about to be consumed by the tsunami!\nCOME GET ME FAST, my location is [REDACTED] CQD SOS",strerror(errno))); + } else { + e->synchronized([f,oscBuf]() { + fwrite(oscBuf->data,sizeof(short),65536,f); + }); + fclose(f); + showError(fmt::sprintf("DATA WRITTEN TO /tmp/oscbuf.bin\nthe needle was at %.8x during operation ((needle>>16)<<1 = %u for its actual position in the file).\n\nnow go inspect the file and find out who's biting on that stupid triangle before\nyou succumb to the tsunami, tildearrow is stabbed by Codename Redacted and the Furnace factory comes to a\nperennial halt. HURRY UP!!!",needle,needle>>16)); + } + } } ImGui::EndTable(); }