Skip to content

Commit

Permalink
different shading on pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvita committed Dec 22, 2020
1 parent 4dd4a4c commit f188bf2
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ include $(DEVKITPRO)/libnx/switch_rules
#---------------------------------------------------------------------------------
VERSION_MAJOR := 3
VERSION_MINOR := 7
VERSION_MICRO := 24
VERSION_MICRO := 25
NIGHTLY :=

APP_TITLE := EdiZon SE
Expand Down
1 change: 1 addition & 0 deletions include/guis/gui_cheats.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class GuiCheats : public Gui
u64 m_EditorBaseAddr = 0x00;
u64 m_BookmarkAddr = 0;
u8 m_addressmod = 0;
bool m_show_ptr = true;
time_t m_Time1;
struct helperinfo_t
{
Expand Down
2 changes: 1 addition & 1 deletion include/version.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define VERSION_STRING "3.7.24"
#define VERSION_STRING "3.7.25"
46 changes: 44 additions & 2 deletions source/guis/gui_cheats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,7 @@ void GuiCheats::drawEditRAMMenu2()
// Gui::drawTextAligned(font20, 1010, line2, m_searchMenuLocation == SEARCH_VALUE ? currTheme.selectedColor : currTheme.textColor, "u64", ALIGNED_CENTER);

// status line
u64 addr = m_EditorBaseAddr - (m_EditorBaseAddr % 16) - 0x20;
u64 addr = m_EditorBaseAddr - (m_EditorBaseAddr % 16) - 0x20;
u32 out;
u64 address = m_EditorBaseAddr - (m_EditorBaseAddr % 16) - 0x20 + (m_selectedEntry - 1 - (m_selectedEntry / 5)) * 4 ;
ss.str("");
Expand Down Expand Up @@ -1325,6 +1325,24 @@ void GuiCheats::drawEditRAMMenu2()
ss << dataTypes[m_searchType2]<<":" << std::uppercase << std::dec << _getAddressDisplayString(address, m_debugger, m_searchType2).c_str();
Gui::drawTextAligned(font20, 860, line3, currTheme.textColor, ss.str().c_str(), ALIGNED_LEFT);

// pointer display if address in range
if (address % 8 == 0)
{
u64 pointed_address;
m_debugger->readMemory(&pointed_address, sizeof(u64), address);
ss.str("");
if (pointed_address >= m_mainBaseAddr && pointed_address <= m_mainend)
ss << "Main + " << std::uppercase << std::hex << std::setfill('0') << std::setw(10) << pointed_address - m_mainBaseAddr;
else if (pointed_address >= m_heapBaseAddr && pointed_address <= m_heapEnd)
ss << "Heap + " << std::uppercase << std::hex << std::setfill('0') << std::setw(10) << pointed_address - m_heapBaseAddr;
if (ss.str().size() != 0)
{
Gui::drawTextAligned(font20, 30, line3, currTheme.textColor, ss.str().c_str(), ALIGNED_LEFT);
ss.str("");
ss << std::uppercase << std::hex << std::setfill('0') << std::setw(10) << pointed_address;
Gui::drawTextAligned(font20, 360, line3, currTheme.textColor, ss.str().c_str(), ALIGNED_LEFT);
}
};
// Gui::drawTextAligned(font20, Gui::g_framebuffer_width - 100, line2, currTheme.textColor, "\uE0A5 \uE14A", ALIGNED_RIGHT); // the end bracket
// Gui::drawTextAligned(font20, 260, line2, m_searchMenuLocation == SEARCH_TYPE ? currTheme.selectedColor : currTheme.textColor, "U8", ALIGNED_CENTER);
// Gui::drawTextAligned(font20, 510, line2, m_searchMenuLocation == SEARCH_MODE ? currTheme.selectedColor : currTheme.textColor, "U16", ALIGNED_CENTER);
Expand All @@ -1340,7 +1358,31 @@ void GuiCheats::drawEditRAMMenu2()
Gui::drawRectangled(88 + (i % 5) * 225, 235 + (i / 5) * 50, 225, 50, m_searchMode == static_cast<searchMode_t>(i) ? currTheme.selectedColor : currTheme.highlightColor);
if ((i % 5) != 0)
{
Gui::drawRectangled(93 + (i % 5) * 225, 240 + (i / 5) * 50, 215, 40, currTheme.separatorColor);
color_t separatorColor;
if (addr % 8 == 0 && m_show_ptr)
{
separatorColor = currTheme.separatorColor;
u64 pointed_address;
m_debugger->readMemory(&pointed_address, sizeof(u64), addr);
// ss.str("");
if (pointed_address >= m_mainBaseAddr && pointed_address <= m_mainend)
separatorColor = Gui::makeColor(0xFF, 0xFF, 0x00, 0x40);
// ss << "M+" << std::uppercase << std::hex << std::setfill('0') << std::setw(10) << pointed_address - m_mainBaseAddr;
else if (pointed_address >= m_heapBaseAddr && pointed_address <= m_heapEnd)
separatorColor = Gui::makeColor(0x00, 0xFF, 0x00, 0x40);
// ss << "H+" << std::uppercase << std::hex << std::setfill('0') << std::setw(10) << pointed_address - m_heapBaseAddr;
// if (ss.str().size() != 0)
// {
// Gui::drawTextAligned(font20, 200 + (i % 5) * 225, 245 + (i / 5) * 50, currTheme.textColor, ss.str().c_str(), ALIGNED_CENTER);
// addr += 8;
// i++;
// ss.str("");
// ss << std::uppercase << std::hex << std::setfill('0') << std::setw(10) << pointed_address;
// Gui::drawTextAligned(font20, 200 + (i % 5) * 225, 245 + (i / 5) * 50, currTheme.textColor, ss.str().c_str(), ALIGNED_CENTER);
// continue;
// }
};
Gui::drawRectangled(93 + (i % 5) * 225, 240 + (i / 5) * 50, 215, 40, separatorColor);
ss.str("");
// dmntchtReadCheatProcessMemory(addr, &out, sizeof(u32));
m_debugger->readMemory(&out, sizeof(u32), addr);
Expand Down

0 comments on commit f188bf2

Please sign in to comment.