| 5640 | } |
| 5641 | |
| 5642 | static bool linesync_beam_single_single(void) |
| 5643 | { |
| 5644 | bool was_syncline = is_syncline != 0; |
| 5645 | frame_time_t maxtime = read_processor_time() + 2 * vsynctimebase; |
| 5646 | int vp; |
| 5647 | |
| 5648 | if (is_last_line()) { |
| 5649 | if (vsyncnextstep != 1) { |
| 5650 | vsyncnextstep = 1; |
| 5651 | do_render_slice(-1, 0, vpos); |
| 5652 | // wait until out of vblank |
| 5653 | while (!currprefs.turbo_emulation && sync_timeout_check(maxtime)) { |
| 5654 | maybe_process_pull_audio(); |
| 5655 | vp = target_get_display_scanline(-1); |
| 5656 | if (vp >= 0 && vp < vsync_activeheight / 2) |
| 5657 | break; |
| 5658 | if (currprefs.m68k_speed < 0 && !was_syncline) { |
| 5659 | is_syncline = -3; |
| 5660 | return 0; |
| 5661 | } |
| 5662 | target_spin(0); |
| 5663 | } |
| 5664 | } |
| 5665 | if (vsyncnextstep != 2) { |
| 5666 | vsyncnextstep = 2; |
| 5667 | vsync_clear(); |
| 5668 | // wait until second half of display |
| 5669 | while (!currprefs.turbo_emulation && sync_timeout_check(maxtime)) { |
| 5670 | maybe_process_pull_audio(); |
| 5671 | vp = target_get_display_scanline(-1); |
| 5672 | if (vp >= vsync_activeheight / 2) |
| 5673 | break; |
| 5674 | if (currprefs.m68k_speed < 0 && !was_syncline) { |
| 5675 | is_syncline = -2; |
| 5676 | is_syncline_end = vsync_activeheight - 1; |
| 5677 | return 0; |
| 5678 | } |
| 5679 | scanlinesleep(vp, vsync_activeheight / 2); |
| 5680 | } |
| 5681 | } |
| 5682 | if (vsyncnextstep != 3) { |
| 5683 | vsyncnextstep = 3; |
| 5684 | // wait until end of display (or start of next field) |
| 5685 | while (!currprefs.turbo_emulation && sync_timeout_check(maxtime)) { |
| 5686 | maybe_process_pull_audio(); |
| 5687 | vp = target_get_display_scanline(-1); |
| 5688 | if (vp >= vsync_activeheight - 1 || vp < vsync_activeheight / 2) |
| 5689 | break; |
| 5690 | if (currprefs.m68k_speed < 0 && !was_syncline) { |
| 5691 | is_syncline = -2; |
| 5692 | is_syncline_end = vsync_activeheight - 1; |
| 5693 | return 0; |
| 5694 | } |
| 5695 | scanlinesleep(vp, vsync_activeheight - 1); |
| 5696 | } |
| 5697 | } |
| 5698 | if (vsyncnextstep != 4) { |
| 5699 | vsyncnextstep = 4; |
no test coverage detected