MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / DMA_SI_CopyToDRAM

Function DMA_SI_CopyToDRAM

Source/Core/DMA.cpp:164–190  ·  view source on GitHub ↗

Copy 64bytes to DRAM from PIF_RAM

Source from the content-addressed store, hash-verified

162// Copy 64bytes to DRAM from PIF_RAM
163//*****************************************************************************
164void DMA_SI_CopyToDRAM( )
165{
166 // Check controller status!
167 CController::Get()->Process();
168
169 u32 mem {Memory_SI_GetRegister(SI_DRAM_ADDR_REG) & 0x1fffffff};
170 u32 * p_src {(u32 *)g_pMemoryBuffers[MEM_PIF_RAM]};
171 u32 * p_dst {(u32 *)(g_pu8RamBase + mem)};
172
173#ifdef DAEDLAUS_PROFILER
174 DPF( DEBUG_MEMORY_PIF, "PIF -> DRAM (0x%08x) Transfer ", mem );
175#endif
176 // Fuse 4 reads and 4 writes to just one which is a lot faster - Corn
177 for(u32 i {}; i < 16; i++)
178 {
179 p_dst[i] = BSWAP32(p_src[i]);
180 }
181
182
183 Memory_SI_SetRegisterBits(SI_STATUS_REG, SI_STATUS_INTERRUPT);
184 Memory_MI_SetRegisterBits(MI_INTR_REG, MI_INTR_SI);
185
186 //Skipping this IRQ fixes allows Body Harvest, Nightmare Creatures and Cruisn' USA to boot
187 //ToDo: Implement Delay SI, PJ64 uses that option to make these games boot..
188 if (g_ROM.GameHacks != BODY_HARVEST)
189 R4300_Interrupt_UpdateCause3();
190}
191
192/*
193#define PI_DOM2_ADDR1 0x05000000 // to 0x05FFFFFF

Callers

nothing calls this directly

Calls 2

ProcessMethod · 0.45

Tested by

no test coverage detected