MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / CIA_vsync_prehandler

Function CIA_vsync_prehandler

src/cia.cpp:1409–1444  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1407
1408static void write_battclock(void);
1409void CIA_vsync_prehandler(void)
1410{
1411 if (heartbeat_cnt > 0)
1412 heartbeat_cnt--;
1413
1414 if (rtc_msm.delayed_write < 0) {
1415 rtc_msm.delayed_write = 50;
1416 } else if (rtc_msm.delayed_write > 0) {
1417 rtc_msm.delayed_write--;
1418 if (rtc_msm.delayed_write == 0)
1419 write_battclock();
1420 }
1421 if (rtc_ricoh.delayed_write < 0) {
1422 rtc_ricoh.delayed_write = 50;
1423 } else if (rtc_ricoh.delayed_write > 0) {
1424 rtc_ricoh.delayed_write--;
1425 if (rtc_ricoh.delayed_write == 0)
1426 write_battclock();
1427 }
1428
1429 led_vsync();
1430 keybuf_vsync();
1431 if (kblostsynccnt > 0) {
1432 kblostsynccnt -= maxvpos;
1433 if (kblostsynccnt <= 0) {
1434 kblostsynccnt = 0;
1435 kbcode = 0;
1436 cia_keyreq(kbcode);
1437#if KB_DEBUG
1438 write_log(_T("lostsync\n"));
1439#endif
1440 }
1441 }
1442
1443 cia_cycle_accurate = currprefs.m68k_speed >= 0 && currprefs.cpu_compatible;
1444}
1445
1446static void check_led(void)
1447{

Callers 1

devices_vsync_preFunction · 0.85

Calls 5

write_battclockFunction · 0.85
led_vsyncFunction · 0.85
keybuf_vsyncFunction · 0.85
cia_keyreqFunction · 0.85
write_logFunction · 0.70

Tested by

no test coverage detected