summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorbooto <remornicus@gmail.com>2019-01-29 23:27:07 -0500
committerbooto <remornicus@gmail.com>2019-05-21 22:23:42 -0400
commit03d7fef5a635001beb052a4e5ddaaadc9e2d0b0a (patch)
treea8a039f03e68d727e13ffcc9b5ce0f10adb6edd7 /Source/Core
parent70299f2505c1fdeb77c6ddf55c5bfe9171b8e6d7 (diff)
ARAM: No ARAM backing DMA in wiimode
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/HW/DSP.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/Source/Core/Core/HW/DSP.cpp b/Source/Core/Core/HW/DSP.cpp
index d65ae8ccd3..778987f690 100644
--- a/Source/Core/Core/HW/DSP.cpp
+++ b/Source/Core/Core/HW/DSP.cpp
@@ -579,20 +579,29 @@ static void Do_ARAM_DMA()
aram_transfer_direction[s_arDMA.Cnt.dir], s_arDMA.ARAddr,
aram_transfer_direction[1 - s_arDMA.Cnt.dir], s_arDMA.MMAddr, PC);
+ if (s_ARAM.wii_mode)
+ {
+ // Wii has no physical ARAM
+ if (s_arDMA.Cnt.dir == ARAM_DMA_DIR_FROM_ARAM)
+ {
+ std::fill_n(Memory::GetPointer(s_arDMA.MMAddr), ARAM_LINE_SIZE * lines_to_transfer, 0);
+ }
+ s_arDMA.MMAddr += ARAM_LINE_SIZE * lines_to_transfer;
+ s_arDMA.ARAddr += ARAM_LINE_SIZE * lines_to_transfer;
+ s_arDMA.Cnt.count -= ARAM_LINE_SIZE * lines_to_transfer;
+ return;
+ }
+
const ARAM_ADDRESS_CONVERSION_F convert_address = conversion_functions[s_ARAM_Info.base_size];
for (u32 n = 0; n < lines_to_transfer; ++n)
+
{
std::optional<u32> physical_aram_addr = convert_address(s_arDMA.ARAddr);
if (physical_aram_addr)
{
- const u8* source = &s_ARAM.ptr[*physical_aram_addr];
- u8* dest = Memory::GetPointer(s_arDMA.MMAddr);
- if (s_arDMA.Cnt.dir == ARAM_DMA_DIR_TO_ARAM)
- {
- source = dest;
- dest = &s_ARAM.ptr[*physical_aram_addr];
- }
- std::copy_n(source, ARAM_LINE_SIZE, dest);
+ u8* copy_pointers[2] = {Memory::GetPointer(s_arDMA.MMAddr), &s_ARAM.ptr[*physical_aram_addr]};
+ std::copy_n(copy_pointers[s_arDMA.Cnt.dir], ARAM_LINE_SIZE,
+ copy_pointers[1 - s_arDMA.Cnt.dir]);
}
else
{
@@ -607,7 +616,7 @@ static void Do_ARAM_DMA()
s_arDMA.ARAddr += ARAM_LINE_SIZE;
}
s_arDMA.Cnt.count -= ARAM_LINE_SIZE * lines_to_transfer;
-}
+} // namespace DSP
u8 ReadARAM(u32 address)
{