X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fpsxcounters.c;h=18bd6a4e367f8cd5ade8a12cb8d06bceaabaf881;hb=fed9fd6f2cba07f2db3715d7f35f911a7b582517;hp=32a18475e8aa56162b5e2d29cce3f4a2da57c865;hpb=d014a47167b28b19f87546bca0b0c53f08b1daff;p=pcsx_rearmed.git diff --git a/libpcsxcore/psxcounters.c b/libpcsxcore/psxcounters.c index 32a18475..18bd6a4e 100644 --- a/libpcsxcore/psxcounters.c +++ b/libpcsxcore/psxcounters.c @@ -361,14 +361,20 @@ void psxRcntUpdate() // Update lace. if( hSyncCount >= HSyncTotal[Config.PsxType] ) { + u32 status, field = 0; rcnts[3].cycleStart += Config.PsxType ? PSXCLK / 50 : PSXCLK / 60; hSyncCount = 0; frame_counter++; gpuSyncPluginSR(); - if ((HW_GPU_STATUS & SWAP32(PSXGPU_ILACE_BITS)) == SWAP32(PSXGPU_ILACE_BITS)) - HW_GPU_STATUS |= SWAP32(frame_counter << 31); - GPU_vBlank(0, SWAP32(HW_GPU_STATUS) >> 31); + status = SWAP32(HW_GPU_STATUS) | PSXGPU_FIELD; + if ((status & PSXGPU_ILACE_BITS) == PSXGPU_ILACE_BITS) { + field = frame_counter & 1; + status |= field << 31; + status ^= field << 13; + } + HW_GPU_STATUS = SWAP32(status); + GPU_vBlank(0, field); } scheduleRcntBase(); @@ -376,7 +382,7 @@ void psxRcntUpdate() psxRcntSet(); -#ifndef NDEBUG +#if 0 //ndef NDEBUG DebugVSync(); #endif }