mirror of
https://github.com/mitch030504/Wiicompiled_VR_Frame.git
synced 2026-10-06 06:00:25 +02:00
Bulk-copy DVD DMA into non-executable guest RAM
Ported from chrissotraidis/wiicompiled (KartPad) ec14a0dddacbd1267de159215ba39d5f19633164. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019rLZ24cFcqTNBmb4w2dpSq
This commit is contained in:
1 parent
77333709ae
commit
03db602a05
1 file changed
+8
-3
@@ -104,10 +104,15 @@ extern "C" void DVDInit_8015EA1C();
|
||||
extern "C" uint32_t g_dvdFstReservedBase;
|
||||
extern "C" uint32_t g_dvdFstReservedSize;
|
||||
|
||||
// Byte-wise copy into guest RAM plus the DMA notification the GX caches need.
|
||||
// DVD DMA normally targets ordinary RAM. Keep scalar writes for executable
|
||||
// ranges so the translated-code write guard still sees every modified byte.
|
||||
static void CopyToGuestAsDma(uint32_t dest, const uint8_t* data, size_t size) {
|
||||
for (size_t i = 0; i < size; ++i) {
|
||||
Memory::Write8(dest + static_cast<uint32_t>(i), data[i]);
|
||||
if (size != 0 && !RecompMod::ExecutableWriteGuardMayHit(dest, size)) {
|
||||
std::memcpy(Memory::GetPointer(dest, size), data, size);
|
||||
} else {
|
||||
for (size_t i = 0; i < size; ++i) {
|
||||
Memory::Write8(dest + static_cast<uint32_t>(i), data[i]);
|
||||
}
|
||||
}
|
||||
GxNotifyGuestRamDmaWrite(dest, static_cast<uint32_t>(size));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user