PCSX2-Counters: Fix RTC counting at certain cases

Previously, the seconds variable of the RTC was updated on progressive modes after every 50 Vsyncs, which was obviously wrong. The code has been adjusted to update the RTC with respect to the vertical frequencies of various other video modes.
This commit is contained in:
Akash 2016-12-24 11:47:05 +05:30
parent 7aa554b8eb
commit c92830b103
4 changed files with 4 additions and 2 deletions

View File

@ -975,7 +975,7 @@ u8 monthmap[13] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
void cdvdVsync() {
cdvd.RTCcount++;
if (cdvd.RTCcount < ((gsVideoMode == GS_VideoMode::NTSC) ? 60 : 50)) return;
if (cdvd.RTCcount < (GetVerticalFrequency().ToIntRounded())) return;
cdvd.RTCcount = 0;
if ( cdvd.Status == CDVD_STATUS_TRAY_OPEN )

View File

@ -100,6 +100,8 @@ struct cdvdStruct {
u8 CReadWrite;
u8 CNumBlocks;
// Calculates the number of Vsyncs and once it reaches a total number of Vsyncs worth a second with respect to
// the videomode's vertical frequency, it updates the real time clock.
int RTCcount;
cdvdRTC RTC;

View File

@ -123,7 +123,6 @@ struct SyncCounter
#define MODE_HBLANK 0x1 //Set for the remaining ~1/6 of 1 Scanline
extern Fixed100 GetVerticalFrequency();
extern Counter counters[4];
extern SyncCounter hsyncCounter;
extern SyncCounter vsyncCounter;

View File

@ -19,6 +19,7 @@
#include "System/SysThreads.h"
#include "Gif.h"
extern Fixed100 GetVerticalFrequency();
extern __aligned16 u8 g_RealGSMem[Ps2MemSize::GSregs];
enum CSR_FifoState