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

Function scanlinesleep

src/custom.cpp:5539–5561  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5537
5538extern int busywait;
5539static void scanlinesleep(int currline, int nextline)
5540{
5541 if (currline < 0)
5542 return;
5543 if (currline >= nextline)
5544 return;
5545 if (vsync_hblank) {
5546 int diff = (int)(vsync_hblank / (nextline - currline));
5547 int us = 1000000 / diff;
5548 if (us < target_sleep_nanos(-1)) { // spin if less than minimum sleep time
5549 target_spin(nextline - currline - 1);
5550 return;
5551 }
5552 }
5553 if (busywait) {
5554 target_spin(1);
5555 return;
5556 }
5557 if (currprefs.m68k_speed < 0)
5558 sleep_millis_main(1);
5559 else
5560 target_sleep_nanos(500);
5561}
5562
5563static void linesync_first_last_line(int *first, int *last)
5564{

Callers 5

linesync_beam_multi_dualFunction · 0.85
linesync_beam_vrrFunction · 0.85

Calls 3

target_sleep_nanosFunction · 0.85
target_spinFunction · 0.85
sleep_millis_mainFunction · 0.85

Tested by

no test coverage detected