X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=libpcsxcore%2Fpsxdma.c;h=cb84fbccfc6ce9c807de7796a60e319fcf0f8ce9;hp=b0f3fba4752d50ff92c926e54b9f5df7a006213f;hb=3968e69e7fa8f9cb0d44ac79477d5929b9649271;hpb=58ebb94c13df061762a7aca78e52f066339d9610 diff --git a/libpcsxcore/psxdma.c b/libpcsxcore/psxdma.c index b0f3fba4..cb84fbcc 100644 --- a/libpcsxcore/psxdma.c +++ b/libpcsxcore/psxdma.c @@ -122,7 +122,8 @@ static u32 gpuDmaChainSize(u32 addr) { // 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; } @@ -220,7 +221,7 @@ void gpuInterrupt() { } void psxDma6(u32 madr, u32 bcr, u32 chcr) { - u32 size; + u32 words; u32 *mem = (u32 *)PSXM(madr); #ifdef PSXDMA_LOG @@ -238,7 +239,7 @@ void psxDma6(u32 madr, u32 bcr, u32 chcr) { } // already 32-bit size - size = bcr; + words = bcr; while (bcr--) { *mem-- = SWAP32((madr - 4) & 0xffffff); @@ -246,7 +247,10 @@ void psxDma6(u32 madr, u32 bcr, u32 chcr) { } mem++; *mem = 0xffffff; - GPUOTCDMA_INT(size); + //GPUOTCDMA_INT(size); + // halted + psxRegs.cycle += words; + GPUOTCDMA_INT(16); return; } #ifdef PSXDMA_LOG