// next 32-bit pointer
addr = psxMu32( addr & ~0x3 ) & 0xffffff;
size += 1;
- } while (addr != 0xffffff);
+ } while (!(addr & 0x800000)); // contrary to some documentation, the end-of-linked-list marker is not actually 0xFF'FFFF
+ // any pointer with bit 23 set will do.
return size;
}
size = GPU_dmaChain((u32 *)psxM, madr & 0x1fffff);
if ((int)size <= 0)
size = gpuDmaChainSize(madr);
- HW_GPU_STATUS &= ~PSXGPU_nBUSY;
+ HW_GPU_STATUS &= SWAP32(~PSXGPU_nBUSY);
// we don't emulate progress, just busy flag and end irq,
// so pretend we're already at the last block
HW_DMA2_CHCR &= SWAP32(~0x01000000);
DMA_INTERRUPT(2);
}
- HW_GPU_STATUS |= PSXGPU_nBUSY; // GPU no longer busy
+ HW_GPU_STATUS |= SWAP32(PSXGPU_nBUSY); // GPU no longer busy
}
void psxDma6(u32 madr, u32 bcr, u32 chcr) {
- u32 size;
+ u32 words;
u32 *mem = (u32 *)PSXM(madr);
#ifdef PSXDMA_LOG
}
// already 32-bit size
- size = bcr;
+ words = bcr;
while (bcr--) {
*mem-- = SWAP32((madr - 4) & 0xffffff);
madr -= 4;
}
- mem++; *mem = 0xffffff;
+ *++mem = SWAP32(0xffffff);
- GPUOTCDMA_INT(size);
+ //GPUOTCDMA_INT(size);
+ // halted
+ psxRegs.cycle += words;
+ GPUOTCDMA_INT(16);
return;
}
#ifdef PSXDMA_LOG