summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorLC <mathew1800@gmail.com>2020-09-07 22:31:18 -0400
committerGitHub <noreply@github.com>2020-09-07 22:31:18 -0400
commit48cfc32bf3e4e4c5ac591e38fea4b205e74a4cc0 (patch)
treec94ea3eeebafb28be639840884f765d886af7a1d /Source/Core
parente7e51756068a450b6e920c7783c81d7df4d2d133 (diff)
parent327b985718954be4c09d451389edca498fa30f7c (diff)
Merge pull request #8935 from JosJuice/di-read-latency
DVDInterface: Increase the latency for read commands
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/HW/DVD/DVDInterface.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/Source/Core/Core/HW/DVD/DVDInterface.cpp b/Source/Core/Core/HW/DVD/DVDInterface.cpp
index 9d5afafd5c..5b1d388025 100644
--- a/Source/Core/Core/HW/DVD/DVDInterface.cpp
+++ b/Source/Core/Core/HW/DVD/DVDInterface.cpp
@@ -43,9 +43,11 @@
#include "VideoCommon/OnScreenDisplay.h"
-// The minimum time it takes for the DVD drive to process a command (in
-// microseconds)
-constexpr u64 COMMAND_LATENCY_US = 300;
+// The minimum time it takes for the DVD drive to process a command (in microseconds)
+constexpr u64 MINIMUM_COMMAND_LATENCY_US = 300;
+
+// The time it takes for a read command to start (in microseconds)
+constexpr u64 READ_COMMAND_LATENCY_US = 600;
// The size of the streaming buffer.
constexpr u64 STREAMING_BUFFER_SIZE = 1024 * 1024;
@@ -1208,10 +1210,10 @@ void ExecuteCommand(ReplyType reply_type)
if (!command_handled_by_thread)
{
- // TODO: Needs testing to determine if COMMAND_LATENCY_US is accurate for this
- CoreTiming::ScheduleEvent(COMMAND_LATENCY_US * (SystemTimers::GetTicksPerSecond() / 1000000),
- s_finish_executing_command,
- PackFinishExecutingCommandUserdata(reply_type, interrupt_type));
+ // TODO: Needs testing to determine if MINIMUM_COMMAND_LATENCY_US is accurate for this
+ CoreTiming::ScheduleEvent(
+ MINIMUM_COMMAND_LATENCY_US * (SystemTimers::GetTicksPerSecond() / 1000000),
+ s_finish_executing_command, PackFinishExecutingCommandUserdata(reply_type, interrupt_type));
}
}
@@ -1227,10 +1229,10 @@ void PerformDecryptingRead(u32 position, u32 length, u32 output_address,
if (!command_handled_by_thread)
{
- // TODO: Needs testing to determine if COMMAND_LATENCY_US is accurate for this
- CoreTiming::ScheduleEvent(COMMAND_LATENCY_US * (SystemTimers::GetTicksPerSecond() / 1000000),
- s_finish_executing_command,
- PackFinishExecutingCommandUserdata(reply_type, interrupt_type));
+ // TODO: Needs testing to determine if MINIMUM_COMMAND_LATENCY_US is accurate for this
+ CoreTiming::ScheduleEvent(
+ MINIMUM_COMMAND_LATENCY_US * (SystemTimers::GetTicksPerSecond() / 1000000),
+ s_finish_executing_command, PackFinishExecutingCommandUserdata(reply_type, interrupt_type));
}
}
@@ -1405,8 +1407,8 @@ static void ScheduleReads(u64 offset, u32 length, const DiscIO::Partition& parti
"Schedule reads: offset=0x%" PRIx64 " length=0x%" PRIx32 " address=0x%" PRIx32, offset,
length, output_address);
- // The DVD drive's minimum turnaround time on a command, based on a hardware test.
- s64 ticks_until_completion = COMMAND_LATENCY_US * (SystemTimers::GetTicksPerSecond() / 1000000);
+ s64 ticks_until_completion =
+ READ_COMMAND_LATENCY_US * (SystemTimers::GetTicksPerSecond() / 1000000);
u32 buffered_blocks = 0;
u32 unbuffered_blocks = 0;