| 201 | } |
| 202 | |
| 203 | Common::MemOperationReturnCode DolphinAccessor::readEntireRAM(char* buffer) |
| 204 | { |
| 205 | // MEM2, if enabled, is read right after MEM1 in the buffer so both regions are contigous |
| 206 | if (isMEM2Present()) |
| 207 | { |
| 208 | if (!DolphinComm::DolphinAccessor::readFromRAM( |
| 209 | Common::dolphinAddrToOffset(Common::MEM1_START, false), buffer, |
| 210 | Common::GetMEM1SizeReal(), false)) |
| 211 | return Common::MemOperationReturnCode::operationFailed; |
| 212 | |
| 213 | // Read Wii extra RAM |
| 214 | if (!DolphinComm::DolphinAccessor::readFromRAM( |
| 215 | Common::dolphinAddrToOffset(Common::MEM2_START, false), |
| 216 | buffer + Common::GetMEM1SizeReal(), Common::GetMEM2SizeReal(), false)) |
| 217 | return Common::MemOperationReturnCode::operationFailed; |
| 218 | } |
| 219 | else if (isARAMAccessible()) |
| 220 | { |
| 221 | // read ARAM |
| 222 | if (!DolphinComm::DolphinAccessor::readFromRAM( |
| 223 | Common::dolphinAddrToOffset(Common::ARAM_START, true), buffer, Common::ARAM_SIZE, |
| 224 | false)) |
| 225 | return Common::MemOperationReturnCode::operationFailed; |
| 226 | |
| 227 | // Read GameCube and Wii basic RAM |
| 228 | if (!DolphinComm::DolphinAccessor::readFromRAM( |
| 229 | Common::dolphinAddrToOffset(Common::MEM1_START, true), buffer + Common::ARAM_SIZE, |
| 230 | Common::GetMEM1SizeReal(), false)) |
| 231 | return Common::MemOperationReturnCode::operationFailed; |
| 232 | } |
| 233 | else |
| 234 | { |
| 235 | if (!DolphinComm::DolphinAccessor::readFromRAM( |
| 236 | Common::dolphinAddrToOffset(Common::MEM1_START, false), buffer, |
| 237 | Common::GetMEM1SizeReal(), false)) |
| 238 | return Common::MemOperationReturnCode::operationFailed; |
| 239 | } |
| 240 | |
| 241 | return Common::MemOperationReturnCode::OK; |
| 242 | } |
| 243 | |
| 244 | std::string DolphinAccessor::getFormattedValueFromMemory(const u32 ramIndex, |
| 245 | Common::MemType memType, size_t memSize, |
nothing calls this directly
no test coverage detected