| 299 | } |
| 300 | |
| 301 | Common::MemOperationReturnCode MemWatchEntry::readMemoryFromRAM() |
| 302 | { |
| 303 | u32 realConsoleAddress = m_consoleAddress; |
| 304 | if (m_boundToPointer) |
| 305 | { |
| 306 | std::array<char, sizeof(u32)> realConsoleAddressBuffer{}; |
| 307 | for (int offset : m_pointerOffsets) |
| 308 | { |
| 309 | if (DolphinComm::DolphinAccessor::readFromRAM( |
| 310 | Common::dolphinAddrToOffset(realConsoleAddress, |
| 311 | DolphinComm::DolphinAccessor::isARAMAccessible()), |
| 312 | realConsoleAddressBuffer.data(), sizeof(u32), true)) |
| 313 | { |
| 314 | std::memcpy(&realConsoleAddress, realConsoleAddressBuffer.data(), sizeof(u32)); |
| 315 | if (DolphinComm::DolphinAccessor::isValidConsoleAddress(realConsoleAddress)) |
| 316 | { |
| 317 | realConsoleAddress += offset; |
| 318 | } |
| 319 | else |
| 320 | { |
| 321 | m_isValidPointer = false; |
| 322 | return Common::MemOperationReturnCode::invalidPointer; |
| 323 | } |
| 324 | } |
| 325 | else |
| 326 | { |
| 327 | return Common::MemOperationReturnCode::operationFailed; |
| 328 | } |
| 329 | } |
| 330 | // Resolve sucessful |
| 331 | m_isValidPointer = true; |
| 332 | } |
| 333 | |
| 334 | if (!DolphinComm::DolphinAccessor::isValidConsoleAddress(realConsoleAddress)) |
| 335 | return Common::MemOperationReturnCode::OK; |
| 336 | |
| 337 | if (DolphinComm::DolphinAccessor::readFromRAM( |
| 338 | Common::dolphinAddrToOffset(realConsoleAddress, |
| 339 | DolphinComm::DolphinAccessor::isARAMAccessible()), |
| 340 | m_memory, getSizeForType(m_type, m_length), shouldBeBSwappedForType(m_type))) |
| 341 | return Common::MemOperationReturnCode::OK; |
| 342 | return Common::MemOperationReturnCode::operationFailed; |
| 343 | } |
| 344 | |
| 345 | Common::MemOperationReturnCode MemWatchEntry::writeMemoryToRAM(const char* memory, |
| 346 | const size_t size) |
no test coverage detected