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

Function hwDmacSrcChainWithStack

pcsx2/Hw.cpp:191–293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191__ri bool hwDmacSrcChainWithStack(DMACh& dma, int id) {
192 switch (id) {
193 case TAG_REFE: // Refe - Transfer Packet According to ADDR field
194 dma.tadr += 16;
195 //End Transfer
196 return true;
197
198 case TAG_CNT: // CNT - Transfer QWC following the tag.
199 // Set MADR to QW afer tag, and set TADR to QW following the data.
200 dma.tadr += 16;
201 dma.madr = dma.tadr;
202 //dma.tadr = dma.madr + (dma.qwc << 4);
203 return false;
204
205 case TAG_NEXT: // Next - Transfer QWC following tag. TADR = ADDR
206 {
207 // Set MADR to QW following the tag, and set TADR to the address formerly in MADR.
208 u32 temp = dma.madr;
209 dma.madr = dma.tadr + 16;
210 dma.tadr = temp;
211 return false;
212 }
213 case TAG_REF: // Ref - Transfer QWC from ADDR field
214 case TAG_REFS: // Refs - Transfer QWC from ADDR field (Stall Control)
215 //Set TADR to next tag
216 dma.tadr += 16;
217 return false;
218
219 case TAG_CALL: // Call - Transfer QWC following the tag, save succeeding tag
220 {
221 // Store the address in MADR in temp, and set MADR to the data following the tag.
222 u32 temp = dma.madr;
223 dma.madr = dma.tadr + 16;
224
225 // Stash an address on the address stack pointer.
226 switch(dma.chcr.ASP)
227 {
228 case 0: //Check if ASR0 is empty
229 // Store the succeeding tag in asr0, and mark chcr as having 1 address.
230 dma.asr0 = dma.madr + (dma.qwc << 4);
231 dma.chcr.ASP++;
232 break;
233
234 case 1:
235 // Store the succeeding tag in asr1, and mark chcr as having 2 addresses.
236 dma.asr1 = dma.madr + (dma.qwc << 4);
237 dma.chcr.ASP++;
238 break;
239
240 default:
241 Console.Warning("Call Stack Overflow (report if it fixes/breaks anything)");
242 return true;
243 }
244
245 // Set TADR to the address from MADR we stored in temp.
246 dma.tadr = temp;
247
248 return false;

Callers 5

vif1SetupTransferFunction · 0.85
mfifoVIF1transferFunction · 0.85
ReadTagFunction · 0.85
mfifoGIFtransferFunction · 0.85
vif0SetupTransferFunction · 0.85

Calls 1

WarningMethod · 0.45

Tested by

no test coverage detected