memory composition, part 6

This commit is contained in:
tildearrow 2024-03-06 16:12:39 -05:00
parent 1e536b80ad
commit 1e221393c4
3 changed files with 7 additions and 20 deletions

View file

@ -0,0 +1,5 @@
# memory composition
this window displays the memory usage of chips that support memory (e.g. for samples).
![memory composition](memcompo.png)

View file

@ -1,5 +1,5 @@
# statistics
the Statistics dialog shows running stats such as overall audio processing load and per-chip sample memory.
the Statistics window shows audio load (CPU used by emulation/playback).
![statistics dialog](stats.png)
![statistics window](stats.png)

View file

@ -36,24 +36,6 @@ void FurnaceGUI::drawStats() {
ImGui::Text("Audio load");
ImGui::SameLine();
ImGui::ProgressBar((double)lastProcTime/maxGot,ImVec2(-FLT_MIN,0),procStr.c_str());
ImGui::Separator();
for (int i=0; i<e->song.systemLen; i++) {
DivDispatch* dispatch=e->getDispatch(i);
for (int j=0; dispatch!=NULL && dispatch->getSampleMemCapacity(j)>0; j++) {
size_t capacity=dispatch->getSampleMemCapacity(j);
size_t usage=dispatch->getSampleMemUsage(j);
String usageStr;
if (settings.memUsageUnit==1) {
usageStr=fmt::sprintf("%d/%dKB",usage/1024,capacity/1024);
} else {
usageStr=fmt::sprintf("%d/%d",usage,capacity);
}
ImGui::AlignTextToFramePadding();
ImGui::Text("%s [%d]", e->getSystemName(e->song.system[i]), j);
ImGui::SameLine();
ImGui::ProgressBar(((float)usage)/((float)capacity),ImVec2(-FLT_MIN,0),usageStr.c_str());
}
}
}
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_STATS;
ImGui::End();