From 782e34c311c339144e99457bce8697263dc11c3c Mon Sep 17 00:00:00 2001 From: Lawn Meower Date: Fri, 22 Nov 2024 17:50:27 +0100 Subject: [PATCH] MemoryViewer: Fixed writing to USB Gecko --- MungPlex/source/Connection/USBGecko.hpp | 2 +- MungPlex/source/MemoryViewer/MemoryViewer.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/MungPlex/source/Connection/USBGecko.hpp b/MungPlex/source/Connection/USBGecko.hpp index efd809a..b15f565 100644 --- a/MungPlex/source/Connection/USBGecko.hpp +++ b/MungPlex/source/Connection/USBGecko.hpp @@ -124,7 +124,7 @@ namespace MungPlex *reinterpret_cast(pokeAddrValPair.data()) = std::byteswap(pokeAddress); *reinterpret_cast(&pokeAddrValPair[8 - sizeof(dataType)]) = pokeVal; - if constexpr (std::is_same_v || std::is_same_v) + if constexpr (std::is_same_v || std::is_same_v || std::is_same_v) { if ((ftStatus = sendGeckoCommand(cmd_poke08)) != FT_OK) return ftStatus; diff --git a/MungPlex/source/MemoryViewer/MemoryViewer.cpp b/MungPlex/source/MemoryViewer/MemoryViewer.cpp index 0caa8ab..daee881 100644 --- a/MungPlex/source/MemoryViewer/MemoryViewer.cpp +++ b/MungPlex/source/MemoryViewer/MemoryViewer.cpp @@ -123,7 +123,7 @@ void MungPlex::MemoryViewer::drawHexEditor() { if (_validAddress) { - if(ProcessInformation::GetConsoleConnectionType() != ProcessInformation::CONSOLE) + if(ProcessInformation::GetProcessType() != ProcessInformation::CONSOLE) _memEdit.DrawContents(_hexView.data(), _readSize, _viewAddress, ProcessInformation::GetHandle(), _readAddressEx, _rereorder); else { @@ -131,12 +131,12 @@ void MungPlex::MemoryViewer::drawHexEditor() { case ProcessInformation::CON_USBGecko: { - static uint64_t byteWriteAddress = 0; + static uint64_t byteWriteOffset = 0; - if (_memEdit.DrawContents(_hexView.data(), _readSize, _viewAddress, NULL, nullptr, false, 0, &byteWriteAddress)) + if (_memEdit.DrawContents(_hexView.data(), _readSize, _viewAddress, NULL, nullptr, false, 0, &byteWriteOffset)) { USBGecko* gecko = ProcessInformation::GetUsbGecko(); - gecko->Poke(_hexView[byteWriteAddress - _viewAddress], byteWriteAddress); + gecko->Poke(_hexView[byteWriteOffset], byteWriteOffset + _viewAddress); refreshMemory(); } } break;