2022-03-21 22:34:43 +00:00
|
|
|
/**
|
|
|
|
* Furnace Tracker - multi-system chiptune tracker
|
2024-01-17 02:26:57 +00:00
|
|
|
* Copyright (C) 2021-2024 tildearrow and contributors
|
2022-03-21 22:34:43 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "gui.h"
|
2022-10-22 08:05:32 +00:00
|
|
|
#include <imgui.h>
|
2022-03-21 22:34:43 +00:00
|
|
|
|
|
|
|
void FurnaceGUI::drawRegView() {
|
|
|
|
if (nextWindow==GUI_WINDOW_REGISTER_VIEW) {
|
|
|
|
channelsOpen=true;
|
|
|
|
ImGui::SetNextWindowFocus();
|
|
|
|
nextWindow=GUI_WINDOW_NOTHING;
|
|
|
|
}
|
|
|
|
if (!regViewOpen) return;
|
2024-05-27 22:53:46 +00:00
|
|
|
if (ImGui::Begin("Register View",®ViewOpen,globalWinFlags,_("Register View"))) {
|
2022-03-21 22:34:43 +00:00
|
|
|
for (int i=0; i<e->song.systemLen; i++) {
|
|
|
|
ImGui::Text("%d. %s",i+1,getSystemName(e->song.system[i]));
|
|
|
|
int size=0;
|
|
|
|
int depth=8;
|
|
|
|
unsigned char* regPool=e->getRegisterPool(i,size,depth);
|
|
|
|
unsigned short* regPoolW=(unsigned short*)regPool;
|
|
|
|
if (regPool==NULL) {
|
2024-05-27 00:31:17 +00:00
|
|
|
ImGui::Text(_("- no register pool available"));
|
2022-03-21 22:34:43 +00:00
|
|
|
} else {
|
|
|
|
ImGui::PushFont(patFont);
|
|
|
|
if (ImGui::BeginTable("Memory",17)) {
|
2022-10-22 08:05:32 +00:00
|
|
|
ImGui::TableSetupColumn("addr",ImGuiTableColumnFlags_WidthFixed);
|
|
|
|
|
2022-03-21 22:34:43 +00:00
|
|
|
ImGui::TableNextRow();
|
|
|
|
ImGui::TableNextColumn();
|
|
|
|
for (int i=0; i<16; i++) {
|
|
|
|
ImGui::TableNextColumn();
|
|
|
|
ImGui::TextColored(uiColors[GUI_COLOR_PATTERN_ROW_INDEX]," %X",i);
|
|
|
|
}
|
|
|
|
for (int i=0; i<=((size-1)>>4); i++) {
|
|
|
|
ImGui::TableNextRow();
|
|
|
|
ImGui::TableNextColumn();
|
|
|
|
ImGui::TextColored(uiColors[GUI_COLOR_PATTERN_ROW_INDEX],"%.2X",i*16);
|
|
|
|
for (int j=0; j<16; j++) {
|
|
|
|
ImGui::TableNextColumn();
|
|
|
|
if (i*16+j>=size) continue;
|
|
|
|
if (depth == 8) {
|
|
|
|
ImGui::Text("%.2x",regPool[i*16+j]);
|
|
|
|
} else if (depth == 16) {
|
|
|
|
ImGui::Text("%.4x",regPoolW[i*16+j]);
|
|
|
|
} else {
|
|
|
|
ImGui::Text("??");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ImGui::EndTable();
|
|
|
|
}
|
|
|
|
ImGui::PopFont();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_REGISTER_VIEW;
|
|
|
|
ImGui::End();
|
2022-05-19 21:35:00 +00:00
|
|
|
}
|