diff options
| author | SND\ckain_cp <SND\ckain_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2014-01-30 11:03:50 +0000 |
|---|---|---|
| committer | SND\ckain_cp <SND\ckain_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2014-01-30 11:03:50 +0000 |
| commit | dc196d4ad7aa65975089ba613200fcdf5f80f78f (patch) | |
| tree | 44fd45123ceb85559626abf4f4e6fff6ba164564 /plugins | |
| parent | 0849a1f756e4ddd52cbfcd96bb2364c30adc4b94 (diff) | |
| download | pcsxr-dc196d4ad7aa65975089ba613200fcdf5f80f78f.tar.gz | |
peopsgl/xvideo: CPUToVRAM write: wrap to beginning of same scanline when going past GPU FB width. Fixes Alunda CLUT being destroyed. Hopefully breaks nothing.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@88616 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'plugins')
| -rwxr-xr-x | plugins/dfxvideo/gpu.c | 15 | ||||
| -rwxr-xr-x | plugins/peopsxgl/gpu.c | 15 |
2 files changed, 22 insertions, 8 deletions
diff --git a/plugins/dfxvideo/gpu.c b/plugins/dfxvideo/gpu.c index a477a411..846722e0 100755 --- a/plugins/dfxvideo/gpu.c +++ b/plugins/dfxvideo/gpu.c @@ -1495,10 +1495,14 @@ STARTVRAM: gdata=GETLE32(pMem); pMem++; - PUTLE16(VRAMWrite.ImagePtr, (unsigned short)gdata); VRAMWrite.ImagePtr++; - if(VRAMWrite.ImagePtr>=psxVuw_eom) VRAMWrite.ImagePtr-=iGPUHeight*1024; + // Write odd pixel - Wrap from beginning to next index if going past GPU width + if(VRAMWrite.Width+VRAMWrite.x-VRAMWrite.RowsRemaining >= 1024) { + PUTLE16(VRAMWrite.ImagePtr-1024, (unsigned short)gdata); VRAMWrite.ImagePtr++; + } else { PUTLE16(VRAMWrite.ImagePtr, (unsigned short)gdata); VRAMWrite.ImagePtr++; } + if(VRAMWrite.ImagePtr>=psxVuw_eom) VRAMWrite.ImagePtr-=iGPUHeight*1024;// Check if went past framebuffer VRAMWrite.RowsRemaining --; + // Check if end at odd pixel drawn if(VRAMWrite.RowsRemaining <= 0) { VRAMWrite.ColsRemaining--; @@ -1513,8 +1517,11 @@ STARTVRAM: VRAMWrite.ImagePtr += 1024 - VRAMWrite.Width; } - PUTLE16(VRAMWrite.ImagePtr, (unsigned short)(gdata>>16)); VRAMWrite.ImagePtr++; - if(VRAMWrite.ImagePtr>=psxVuw_eom) VRAMWrite.ImagePtr-=iGPUHeight*1024; + // Write even pixel - Wrap from beginning to next index if going past GPU width + if(VRAMWrite.Width+VRAMWrite.x-VRAMWrite.RowsRemaining >= 1024) { + PUTLE16(VRAMWrite.ImagePtr-1024, (unsigned short)(gdata>>16)); VRAMWrite.ImagePtr++; + } else { PUTLE16(VRAMWrite.ImagePtr, (unsigned short)(gdata>>16)); VRAMWrite.ImagePtr++; } + if(VRAMWrite.ImagePtr>=psxVuw_eom) VRAMWrite.ImagePtr-=iGPUHeight*1024;// Check if went past framebuffer VRAMWrite.RowsRemaining --; } diff --git a/plugins/peopsxgl/gpu.c b/plugins/peopsxgl/gpu.c index 5d59782c..1cd50ac9 100755 --- a/plugins/peopsxgl/gpu.c +++ b/plugins/peopsxgl/gpu.c @@ -2902,10 +2902,14 @@ STARTVRAM: gdata=*pMem++; - *VRAMWrite.ImagePtr++ = (unsigned short)gdata; - if(VRAMWrite.ImagePtr>=psxVuw_eom) VRAMWrite.ImagePtr-=iGPUHeight*1024; + // Write odd pixel - Wrap from beginning to next index if going past GPU width + if(VRAMWrite.Width+VRAMWrite.x-VRAMWrite.RowsRemaining >= 1024) { + *((VRAMWrite.ImagePtr++)-1024) = (unsigned short)gdata; + } else { *VRAMWrite.ImagePtr++ = (unsigned short)gdata;} + if(VRAMWrite.ImagePtr>=psxVuw_eom) VRAMWrite.ImagePtr-=iGPUHeight*1024;// Check if went past framebuffer VRAMWrite.RowsRemaining --; + // Check if end at odd pixel drawn if(VRAMWrite.RowsRemaining <= 0) { VRAMWrite.ColsRemaining--; @@ -2919,8 +2923,11 @@ STARTVRAM: VRAMWrite.ImagePtr += 1024 - VRAMWrite.Width; } - *VRAMWrite.ImagePtr++ = (unsigned short)(gdata>>16); - if(VRAMWrite.ImagePtr>=psxVuw_eom) VRAMWrite.ImagePtr-=iGPUHeight*1024; + // Write even pixel - Wrap from beginning to next index if going past GPU width + if(VRAMWrite.Width+VRAMWrite.x-VRAMWrite.RowsRemaining >= 1024) { + *((VRAMWrite.ImagePtr++)-1024) = (unsigned short)(gdata>>16); + } else *VRAMWrite.ImagePtr++ = (unsigned short)(gdata>>16); + if(VRAMWrite.ImagePtr>=psxVuw_eom) VRAMWrite.ImagePtr-=iGPUHeight*1024;// Check if went past framebuffer VRAMWrite.RowsRemaining --; } |
