From 3edd8d168b5e3ac015628000dbc6bfcaff85efd0 Mon Sep 17 00:00:00 2001 From: Luke Usher Date: Tue, 1 Mar 2022 20:37:10 +0000 Subject: [PATCH] chihiro: fix an issue where media board detection failed due to instant response time --- src/devices/chihiro/MediaBoard.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/devices/chihiro/MediaBoard.cpp b/src/devices/chihiro/MediaBoard.cpp index 4ff753d2e..d17092f8f 100644 --- a/src/devices/chihiro/MediaBoard.cpp +++ b/src/devices/chihiro/MediaBoard.cpp @@ -90,6 +90,9 @@ void MediaBoard::ComRead(uint32_t offset, void* buffer, uint32_t length) void MediaBoard::ComWrite(uint32_t offset, void* buffer, uint32_t length) { + // Instant replies cause race conditions, software seems to expect at least a little delay + Sleep(100); + if (offset == 0x900000) { // Some kind of reset? memcpy(readBuffer, buffer, 0x20); return; @@ -115,7 +118,7 @@ void MediaBoard::ComWrite(uint32_t offset, void* buffer, uint32_t length) // Read the given Command and handle it uint32_t command = inputBuffer16[1]; switch (command) { - case MB_CMD_DIMM_SIZE: + case MB_CMD_DIMM_SIZE: outputBuffer32[1] = 1024 * ONE_MB; break; case MB_CMD_STATUS: