| 343 | } |
| 344 | |
| 345 | Common::MemOperationReturnCode MemWatchEntry::writeMemoryToRAM(const char* memory, |
| 346 | const size_t size) |
| 347 | { |
| 348 | u32 realConsoleAddress = m_consoleAddress; |
| 349 | if (m_boundToPointer) |
| 350 | { |
| 351 | std::array<char, sizeof(u32)> realConsoleAddressBuffer{}; |
| 352 | for (int offset : m_pointerOffsets) |
| 353 | { |
| 354 | if (DolphinComm::DolphinAccessor::readFromRAM( |
| 355 | Common::dolphinAddrToOffset(realConsoleAddress, |
| 356 | DolphinComm::DolphinAccessor::isARAMAccessible()), |
| 357 | realConsoleAddressBuffer.data(), sizeof(u32), true)) |
| 358 | { |
| 359 | std::memcpy(&realConsoleAddress, realConsoleAddressBuffer.data(), sizeof(u32)); |
| 360 | if (DolphinComm::DolphinAccessor::isValidConsoleAddress(realConsoleAddress)) |
| 361 | { |
| 362 | realConsoleAddress += offset; |
| 363 | } |
| 364 | else |
| 365 | { |
| 366 | m_isValidPointer = false; |
| 367 | return Common::MemOperationReturnCode::invalidPointer; |
| 368 | } |
| 369 | } |
| 370 | else |
| 371 | { |
| 372 | return Common::MemOperationReturnCode::operationFailed; |
| 373 | } |
| 374 | } |
| 375 | // Resolve sucessful |
| 376 | m_isValidPointer = true; |
| 377 | } |
| 378 | |
| 379 | if (!DolphinComm::DolphinAccessor::isValidConsoleAddress(realConsoleAddress)) |
| 380 | return Common::MemOperationReturnCode::OK; |
| 381 | |
| 382 | if (DolphinComm::DolphinAccessor::writeToRAM( |
| 383 | Common::dolphinAddrToOffset(realConsoleAddress, |
| 384 | DolphinComm::DolphinAccessor::isARAMAccessible()), |
| 385 | memory, size, shouldBeBSwappedForType(m_type))) |
| 386 | return Common::MemOperationReturnCode::OK; |
| 387 | return Common::MemOperationReturnCode::operationFailed; |
| 388 | } |
| 389 | |
| 390 | std::string MemWatchEntry::getStringFromMemory() const |
| 391 | { |
nothing calls this directly
no test coverage detected