summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2014-12-20 21:22:47 +0100
committerJosJuice <josjuice@gmail.com>2014-12-20 22:07:28 +0100
commitbe9789f2c61970ecb975ddeb96c764bbbcec5b3c (patch)
tree5a02e6866866cd5cf4c22c9f89dc6c585eecdf51 /Source/Core
parenta7296681ff6cb9dc41314f36c8bee490e048f1ef (diff)
WII_IPC_HLE_Device_DI: Use the new accurate timing
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/HW/DVDInterface.cpp1
-rw-r--r--Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.cpp47
-rw-r--r--Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.h4
3 files changed, 7 insertions, 45 deletions
diff --git a/Source/Core/Core/HW/DVDInterface.cpp b/Source/Core/Core/HW/DVDInterface.cpp
index 6ef5b69d7a..31e3cc2b4f 100644
--- a/Source/Core/Core/HW/DVDInterface.cpp
+++ b/Source/Core/Core/HW/DVDInterface.cpp
@@ -770,6 +770,7 @@ DVDCommandResult ExecuteCommand(u32 command_0, u32 command_1, u32 command_2,
// Less than ~1/155th of a second hangs Oregon Trail at "loading wheel".
// More than ~1/140th of a second hangs Resident Evil Archives: Resident Evil Zero.
+ // (Might not be true anymore since the other speeds were completely redone in December 2014)
result.ticks_until_completion = SystemTimers::GetTicksPerSecond() / 146;
break;
diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.cpp
index 55e61ede78..9628afde9b 100644
--- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.cpp
+++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.cpp
@@ -8,6 +8,7 @@
#include "Common/CommonTypes.h"
#include "Common/Logging/LogManager.h"
+#include "Core/ConfigManager.h"
#include "Core/VolumeHandler.h"
#include "Core/HW/DVDInterface.h"
#include "Core/HW/Memmap.h"
@@ -65,8 +66,11 @@ IPCCommandResult CWII_IPC_HLE_Device_di::IOCtl(u32 _CommandAddress)
DVDCommandResult result = ExecuteCommand(command_0, command_1, command_2,
BufferOut, BufferOutSize, false);
Memory::Write_U32(result.interrupt_type, _CommandAddress + 0x4);
- // TODO: Don't discard result.ticks_until_completion
- return { true, GetCmdDelay(_CommandAddress) };
+
+ if (SConfig::GetInstance().m_LocalCoreStartupParameter.bFastDiscSpeed)
+ result.ticks_until_completion = 0; // An optional hack to speed up loading times
+
+ return { true, result.ticks_until_completion };
}
IPCCommandResult CWII_IPC_HLE_Device_di::IOCtlV(u32 _CommandAddress)
@@ -113,42 +117,3 @@ IPCCommandResult CWII_IPC_HLE_Device_di::IOCtlV(u32 _CommandAddress)
Memory::Write_U32(ReturnValue, _CommandAddress + 4);
return IPC_DEFAULT_REPLY;
}
-
-u64 CWII_IPC_HLE_Device_di::GetCmdDelay(u32 _CommandAddress)
-{
- u32 BufferIn = Memory::Read_U32(_CommandAddress + 0x10);
- u32 Command = Memory::Read_U32(BufferIn) >> 24;
-
- // Hacks below
-
- switch (Command)
- {
- case DVDLowRead:
- case DVDLowUnencryptedRead:
- {
- u32 const Size = Memory::Read_U32(BufferIn + 0x04);
- // Delay depends on size of read, that makes sense, right?
- // More than ~1150K "bytes / sec" hangs NSMBWii on boot.
- // Less than ~800K "bytes / sec" hangs DKCR randomly (ok, probably not true)
- return SystemTimers::GetTicksPerSecond() / 975000 * Size;
- }
-
- case DVDLowClearCoverInterrupt:
- // Less than ~1/155th of a second hangs Oregon Trail at "loading wheel".
- // More than ~1/140th of a second hangs Resident Evil Archives: Resident Evil Zero.
- return SystemTimers::GetTicksPerSecond() / 146;
-
- // case DVDLowAudioBufferConfig:
- // case DVDLowInquiry:
- // case DVDLowReadDiskID:
- // case DVDLowWaitForCoverClose:
- // case DVDLowGetCoverReg:
- // case DVDLowGetCoverStatus:
- // case DVDLowReset:
- // case DVDLowClosePartition:
- default:
- // random numbers here!
- // More than ~1/2000th of a second hangs DKCR with DSP HLE, maybe.
- return SystemTimers::GetTicksPerSecond() / 15000;
- }
-}
diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.h
index 5975e0f621..6c10e8f258 100644
--- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.h
+++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.h
@@ -25,8 +25,4 @@ public:
IPCCommandResult IOCtl(u32 _CommandAddress) override;
IPCCommandResult IOCtlV(u32 _CommandAddress) override;
-
-private:
-
- u64 CWII_IPC_HLE_Device_di::GetCmdDelay(u32 _CommandAddress);
};