Skip to content

Commit

Permalink
MemoryViewer: Fixed writing to USB Gecko
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmoCortney committed Nov 22, 2024
1 parent 465d4f2 commit 782e34c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion MungPlex/source/Connection/USBGecko.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ namespace MungPlex
*reinterpret_cast<uint32_t*>(pokeAddrValPair.data()) = std::byteswap(pokeAddress);
*reinterpret_cast<dataType*>(&pokeAddrValPair[8 - sizeof(dataType)]) = pokeVal;

if constexpr (std::is_same_v<dataType, int8_t> || std::is_same_v<dataType, uint8_t>)
if constexpr (std::is_same_v<dataType, int8_t> || std::is_same_v<dataType, uint8_t> || std::is_same_v<dataType, char>)
{
if ((ftStatus = sendGeckoCommand(cmd_poke08)) != FT_OK)
return ftStatus;
Expand Down
8 changes: 4 additions & 4 deletions MungPlex/source/MemoryViewer/MemoryViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,20 @@ 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
{
switch (ProcessInformation::GetConsoleConnectionType())
{
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<char>(_hexView[byteWriteAddress - _viewAddress], byteWriteAddress);
gecko->Poke<char>(_hexView[byteWriteOffset], byteWriteOffset + _viewAddress);
refreshMemory();
}
} break;
Expand Down

0 comments on commit 782e34c

Please sign in to comment.