diff options
| author | JMC47 <JMC4789@gmail.com> | 2020-04-16 18:28:09 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-16 18:28:09 -0400 |
| commit | 85a8325701b5f72dc6974725ff7b63078e2c01fe (patch) | |
| tree | 23386fe36e021bc77f5925031e1591a47c8db9cd /Source/Core | |
| parent | 19fc43f190545fa5c5cb490a7cb34715db61430a (diff) | |
| parent | 94f83db2b57458adeb8d4c33fe5e9e80ee30d8e4 (diff) | |
Merge pull request #8733 from JosJuice/di-baten-kaitos
Adjust s_DIMAR/s_DILENGTH behavior (fixes Baten Kaitos music)
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/HW/DVD/DVDInterface.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Source/Core/Core/HW/DVD/DVDInterface.cpp b/Source/Core/Core/HW/DVD/DVDInterface.cpp index 9ecb58dc03..ff4d623fa4 100644 --- a/Source/Core/Core/HW/DVD/DVDInterface.cpp +++ b/Source/Core/Core/HW/DVD/DVDInterface.cpp @@ -1233,8 +1233,17 @@ void SetHighError(u32 high_error) void FinishExecutingCommand(ReplyType reply_type, DIInterruptType interrupt_type, s64 cycles_late, const std::vector<u8>& data) { - s_DIMAR += s_DILENGTH; - s_DILENGTH = 0; + // The data parameter contains the requested data iff this was called from DVDThread, and is + // empty otherwise. DVDThread is the only source of ReplyType::NoReply and ReplyType::DTK. + + u32 transfer_size = 0; + if (reply_type == ReplyType::NoReply) + transfer_size = static_cast<u32>(data.size()); + else if (reply_type == ReplyType::Interrupt || reply_type == ReplyType::IOS) + transfer_size = s_DILENGTH; + + s_DIMAR += transfer_size; + s_DILENGTH -= transfer_size; switch (reply_type) { |
