From: gameblabla Date: Mon, 16 Aug 2021 21:03:52 +0000 (+0000) Subject: Fixed Linked List DMA end marker. (#183) X-Git-Tag: r23~145 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=502ea36eb42c455c063ce30a5ee93ddd75f839e6;p=pcsx_rearmed.git Fixed Linked List DMA end marker. (#183) Taken from PCSX Redux project. https://github.com/grumpycoders/pcsx-redux/pull/396/commits/a6401da3a4e7b4860b0f7a7f679cf9a93e739caa --- diff --git a/libpcsxcore/psxdma.c b/libpcsxcore/psxdma.c index 03ee5639..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; } diff --git a/plugins/dfxvideo/gpu.c b/plugins/dfxvideo/gpu.c index 3d20dfa4..649cb429 100644 --- a/plugins/dfxvideo/gpu.c +++ b/plugins/dfxvideo/gpu.c @@ -1060,8 +1060,8 @@ long CALLBACK GPUdmaChain(uint32_t * baseAddrL, uint32_t addr) if(count>0) GPUwriteDataMem(&baseAddrL[dmaMem>>2],count); addr = GETLE32(&baseAddrL[addr>>2])&0xffffff; - } - 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. GPUIsIdle; diff --git a/plugins/gpu-gles/gpuPlugin.c b/plugins/gpu-gles/gpuPlugin.c index 60570ace..6d3ca14c 100644 --- a/plugins/gpu-gles/gpuPlugin.c +++ b/plugins/gpu-gles/gpuPlugin.c @@ -2205,9 +2205,8 @@ do if(count>0) GPUwriteDataMem(&baseAddrL[dmaMem>>2],count); addr = baseAddrL[addr>>2]&0xffffff; - } -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. GPUIsIdle; return 0;