More correct visualisation of virtual and physical memory.
Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
parent
4205bc852f
commit
087f0f7942
2 changed files with 30 additions and 10 deletions
|
@ -30,6 +30,14 @@
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|
||||||
|
struct MemoryTab
|
||||||
|
{
|
||||||
|
void * basePtr;
|
||||||
|
size_t baseAddr;
|
||||||
|
size_t length;
|
||||||
|
std::string name;
|
||||||
|
};
|
||||||
|
|
||||||
void HelpMarker(const char* desc)
|
void HelpMarker(const char* desc)
|
||||||
{
|
{
|
||||||
ImGui::TextDisabled("(?)");
|
ImGui::TextDisabled("(?)");
|
||||||
|
@ -804,18 +812,31 @@ namespace sa2
|
||||||
{
|
{
|
||||||
if (ImGui::BeginTabBar("Memory"))
|
if (ImGui::BeginTabBar("Memory"))
|
||||||
{
|
{
|
||||||
if (ImGui::BeginTabItem("Main"))
|
std::vector<MemoryTab> banks;
|
||||||
|
|
||||||
|
banks.push_back({mem, 0, _6502_MEM_LEN, "Memory"});
|
||||||
|
banks.push_back({MemGetCxRomPeripheral(), _6502_IO_BEGIN, 4 * 1024, "Cx ROM"});
|
||||||
|
|
||||||
|
size_t i = 0;
|
||||||
|
void * bank;
|
||||||
|
while ((bank = MemGetBankPtr(i)))
|
||||||
{
|
{
|
||||||
void * mainBase = MemGetMainPtr(0);
|
const std::string name = "Bank " + std::to_string(i);
|
||||||
myMainMemoryEditor.DrawContents(mainBase, _6502_MEM_LEN);
|
banks.push_back({bank, 0, _6502_MEM_LEN, name});
|
||||||
ImGui::EndTabItem();
|
++i;
|
||||||
}
|
}
|
||||||
if (ImGui::BeginTabItem("AUX"))
|
|
||||||
|
myMemoryEditors.resize(banks.size());
|
||||||
|
|
||||||
|
for (i = 0; i < banks.size(); ++i)
|
||||||
{
|
{
|
||||||
void * auxBase = MemGetAuxPtr(0);
|
if (ImGui::BeginTabItem(banks[i].name.c_str()))
|
||||||
myAuxMemoryEditor.DrawContents(auxBase, _6502_MEM_LEN);
|
{
|
||||||
ImGui::EndTabItem();
|
myMemoryEditors[i].DrawContents(banks[i].basePtr, banks[i].length, banks[i].baseAddr);
|
||||||
|
ImGui::EndTabItem();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::EndTabBar();
|
ImGui::EndTabBar();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,8 +38,7 @@ namespace sa2
|
||||||
uint64_t myBaseDebuggerCycles;
|
uint64_t myBaseDebuggerCycles;
|
||||||
std::unordered_map<DWORD, uint64_t> myAddressCycles;
|
std::unordered_map<DWORD, uint64_t> myAddressCycles;
|
||||||
|
|
||||||
MemoryEditor myMainMemoryEditor;
|
std::vector<MemoryEditor> myMemoryEditors;
|
||||||
MemoryEditor myAuxMemoryEditor;
|
|
||||||
|
|
||||||
std::vector<SoundInfo> myAudioInfo;
|
std::vector<SoundInfo> myAudioInfo;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue