From f1dc908883e14cdef07ba09bff8c286d53b7e8bf Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Thu, 3 Oct 2019 15:53:22 -0700 Subject: [PATCH] Clarify emulated behavior for ReadBCA --- Source/Core/Core/HW/DVD/DVDInterface.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/HW/DVD/DVDInterface.cpp b/Source/Core/Core/HW/DVD/DVDInterface.cpp index 0e4fdc5b5f..fbb58b48d5 100644 --- a/Source/Core/Core/HW/DVD/DVDInterface.cpp +++ b/Source/Core/Core/HW/DVD/DVDInterface.cpp @@ -881,8 +881,15 @@ void ExecuteCommand(ReplyType reply_type) break; // Wii-exclusive case DICommand::ReadBCA: - WARN_LOG(DVDINTERFACE, "DVDLowReadDiskBca"); - Memory::Write_U32(1, s_DIMAR + 0x30); + WARN_LOG(DVDINTERFACE, "DVDLowReadDiskBca - supplying dummy data to appease NSMBW"); + // NSMBW checks that the first 0x33 bytes of the BCA are 0, then it expects a 1. + // Most (all?) other games have 0x34 0's at the start of the BCA, but don't actually + // read it. NSMBW doesn't care about the other 12 bytes (which contain manufacturing data?) + + // TODO: Read the .bca file that cleanrip generates, if it exists + // Memory::CopyToEmu(output_address, bca_data, 0x40); + Memory::Memset(s_DIMAR, 0, 0x40); + Memory::Write_U8(1, s_DIMAR + 0x33); break; // Wii-exclusive case DICommand::RequestDiscStatus: