summaryrefslogtreecommitdiff
path: root/Data/Sys
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2019-05-01 12:08:58 +0200
committerGitHub <noreply@github.com>2019-05-01 12:08:58 +0200
commitd9999f406bb42ab3b46b393bdb2e9a088020e5bb (patch)
tree16a58bb6fe202c91d1e57b9c41ebda54d8de423d /Data/Sys
parent37c85b32c058e820d0bc81aca8d380e09aef1bd5 (diff)
parent0ac642a537d9d1173252de7ed8db116063ec6e1a (diff)
Merge pull request #8059 from JosJuice/casper-dcache-hack-pal
Port Casper's Scare School: Spooky Sports Day dcache hack to PAL
Diffstat (limited to 'Data/Sys')
-rw-r--r--Data/Sys/GameSettings/RX4E4Z.ini4
-rw-r--r--Data/Sys/GameSettings/RX4PMT.ini26
2 files changed, 28 insertions, 2 deletions
diff --git a/Data/Sys/GameSettings/RX4E4Z.ini b/Data/Sys/GameSettings/RX4E4Z.ini
index 007e8d255b..6a6e25ca91 100644
--- a/Data/Sys/GameSettings/RX4E4Z.ini
+++ b/Data/Sys/GameSettings/RX4E4Z.ini
@@ -1,4 +1,4 @@
-# Casper's Scare School: Spooky Sports Day (RX4E4Z)
+# RX4E4Z - Casper's Scare School: Spooky Sports Day
[OnFrame]
# Work around a dcache issue by preventing the game from doing something pointless.
@@ -17,7 +17,7 @@
# .text:800D2E6C mr r5, read_length # length
# .text:800D2E70 mr r6, read_offset # offset
# .text:800D2E74 addi r3, this, file.file_info # file_info
-# .text:800D2E78 addi r4, r4, dvd_read_buf@l # addr
+# .text:800D2E78 subi r4, r4, dvd_read_buf@l # addr
# .text:800D2E7C addi r7, r7, game_dvd_read_callback@l # callback
# .text:800D2E80 li r8, 2 # unknown
# .text:800D2E84 bl DVDReadAsync
diff --git a/Data/Sys/GameSettings/RX4PMT.ini b/Data/Sys/GameSettings/RX4PMT.ini
new file mode 100644
index 0000000000..c8ad7c3ff4
--- /dev/null
+++ b/Data/Sys/GameSettings/RX4PMT.ini
@@ -0,0 +1,26 @@
+# RX4PMT - Casper's Scare School: Spooky Sports Day
+
+[OnFrame]
+# Work around a dcache issue by preventing the game from doing something pointless.
+#
+# The game's DVD read function writes 0x87654321 to the entire read buffer and 0x12345678 to the
+# last 4 bytes. It then calls DVDReadAsync() and without waiting for the read to complete at all,
+# it checks if the last 4 bytes are still 0x12345678. If they are, then the game fails.
+#
+# The check always passes on console because DVDReadAsync() -> issueCommand() calls
+# DCInvalidateRange() (dcbi) on the read buffer.
+#
+# Dolphin cannot emulate this without an extremely significant performance hit.
+#
+# .text:80164B8C lis r7, game_dvd_read_callback@ha
+# .text:80164B90 stw r0, 0(r17) # write 0x12345678 to the end of the buffer
+# .text:80164B94 mr r5, read_length # length
+# .text:80164B98 mr r6, read_offset # offset
+# .text:80164B9C addi r3, this, file.file_info # file_info
+# .text:80164BA0 subi r4, r4, dvd_read_buf@l # addr
+# .text:80164BA4 addi r7, r7, game_dvd_read_callback@l # callback
+# .text:80164BA8 li r8, 2 # unknown
+# .text:80164BAC bl DVDReadAsync
+#
+$Fix file reads (dcache bypass)
+0x80164b90:dword:0x60000000