MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / cdvdVsync

Function cdvdVsync

pcsx2/CDVD/CDVD.cpp:1633–1678  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1631}
1632
1633void cdvdVsync()
1634{
1635 // We're counting in frames, but one second isn't exactly 50 or 60 frames in most cases, so we'll keep the fractions.
1636 cdvd.RTCcount++;
1637 const double verticalFrequency = GetVerticalFrequency();
1638 if (cdvd.RTCcount < verticalFrequency)
1639 return;
1640
1641 cdvd.RTCcount -= verticalFrequency;
1642
1643 cdvdUpdateTrayState();
1644
1645 // FolderMemoryCard needs information on how much time has passed since the last write
1646 // Call it every second.
1647 sioNextFrame();
1648
1649 cdvd.RTC.second++;
1650 if (cdvd.RTC.second < 60)
1651 return;
1652 cdvd.RTC.second = 0;
1653
1654 cdvd.RTC.minute++;
1655 if (cdvd.RTC.minute < 60)
1656 return;
1657 cdvd.RTC.minute = 0;
1658
1659 cdvd.RTC.hour++;
1660 if (cdvd.RTC.hour < 24)
1661 return;
1662 cdvd.RTC.hour = 0;
1663
1664 cdvd.RTC.day++;
1665 if (cdvd.RTC.day <= (cdvd.RTC.month == 2 && cdvd.RTC.year % 4 == 0 ? 29 : monthmap[cdvd.RTC.month - 1]))
1666 return;
1667 cdvd.RTC.day = 1;
1668
1669 cdvd.RTC.month++;
1670 if (cdvd.RTC.month <= 12)
1671 return;
1672 cdvd.RTC.month = 1;
1673
1674 cdvd.RTC.year++;
1675 if (cdvd.RTC.year < 100)
1676 return;
1677 cdvd.RTC.year = 0;
1678}
1679
1680static __fi u8 cdvdRead18(void) // SDATAOUT
1681{

Callers 1

psxVBlankStartFunction · 0.85

Calls 3

GetVerticalFrequencyFunction · 0.85
cdvdUpdateTrayStateFunction · 0.85
sioNextFrameFunction · 0.85

Tested by

no test coverage detected