// memory (data) view #include "pch.h" static const char *hexbyte(uint32_t addr) { static char buf[0x10]; // check address uint32_t pa = Gekko::BadAddress; if (Gekko::Gekko) { int WIMG; pa = Gekko::Gekko->EffectiveToPhysical(addr, Gekko::MmuAccess::Read, WIMG); } if (mi.ram) { if (pa != Gekko::BadAddress) { if (pa < RAMSIZE) { sprintf_s (buf, sizeof(buf), "%02X", mi.ram[pa]); return buf; } } } return "??"; } static const char *charbyte(uint32_t addr) { static char buf[0x10]; buf[0] = '.'; buf[1] = 0; // check address uint32_t pa = Gekko::BadAddress; if (Gekko::Gekko) { int WIMG; pa = Gekko::Gekko->EffectiveToPhysical(addr, Gekko::MmuAccess::Read, WIMG); } if (mi.ram && pa != Gekko::BadAddress) { if (pa < RAMSIZE) { uint8_t data = mi.ram[pa]; if ((data >= 32) && (data <= 255)) sprintf_s(buf, sizeof(buf), "%c\0", data); return buf; } } return "?"; } void con_update_dump_window() { con_attr(7, 0); for (int i = 0; i < wind.data_h; i++) { con_fill_line(wind.data_y + i, ' '); } uint32_t pa = Gekko::BadAddress; if (Gekko::Gekko) { int WIMG; pa = Gekko::Gekko->EffectiveToPhysical(con.data, Gekko::MmuAccess::Read, WIMG); } con_attr(0, 3); con_fill_line(wind.data_y, 0xc4); con_attr(0, 3); if(wind.focus == WDATA) con_printf_at(0, wind.data_y, "\x1%c\x1f", ConColor::WHITE); con_attr(0, 3); con_print_at(2, wind.data_y, "F2"); con_printf_at(6, wind.data_y, " phys:%08X stack:%08X sda1:%08X sda2:%08X", pa, Gekko::Gekko->regs.gpr[1], Gekko::Gekko->regs.gpr[13], Gekko::Gekko->regs.gpr[2] ); con_attr(7, 0); for(int row=0; row