MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / dmaGetAddr

Function dmaGetAddr

pcsx2/Dmac.cpp:149–176  ·  view source on GitHub ↗

Note: Dma addresses are guaranteed to be aligned to 16 bytes (128 bits)

Source from the content-addressed store, hash-verified

147
148// Note: Dma addresses are guaranteed to be aligned to 16 bytes (128 bits)
149__ri tDMA_TAG *dmaGetAddr(u32 addr, bool write)
150{
151 // if (addr & 0xf) { DMA_LOG("*PCSX2*: DMA address not 128bit aligned: %8.8x", addr); }
152 if (DMA_TAG(addr).SPR) return (tDMA_TAG*)&eeMem->Scratch[addr & 0x3ff0];
153
154 // FIXME: Why??? DMA uses physical addresses
155 addr &= 0x1ffffff0;
156
157 if (addr < Ps2MemSize::ExposedRam)
158 {
159 return (tDMA_TAG*)&eeMem->Main[addr];
160 }
161 else if (addr < 0x10000000)
162 {
163 return (tDMA_TAG*)(write ? eeMem->ZeroWrite : eeMem->ZeroRead);
164 }
165 else if (addr < 0x10004000)
166 {
167 // Secret scratchpad address for DMA = end of maximum main memory?
168 //Console.Warning("Writing to the scratchpad without the SPR flag set!");
169 return (tDMA_TAG*)&eeMem->Scratch[addr & 0x3ff0];
170 }
171 else
172 {
173 Console.Error( "*PCSX2*: DMA error: %8.8x", addr);
174 return NULL;
175 }
176}
177
178
179// Returns true if the DMA is enabled and executed successfully. Returns false if execution

Callers 15

vif1TransferToMemoryFunction · 0.85
_VIF1chainFunction · 0.85
vif1SetupTransferFunction · 0.85
getAddrMethod · 0.85
mfifo_VIF1chainFunction · 0.85
mfifoVIF1transferFunction · 0.85
GIFchainFunction · 0.85
ReadTagFunction · 0.85
mfifoGIFchainFunction · 0.85
mfifoGIFtransferFunction · 0.85
__Deci2CallFunction · 0.85
_VIF0chainFunction · 0.85

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected