| 5848 | } |
| 5849 | |
| 5850 | static bool linesync_beam_multi_single(void) |
| 5851 | { |
| 5852 | frame_time_t maxtime = read_processor_time() + 2 * vsynctimebase; |
| 5853 | bool input_read_done = false; |
| 5854 | bool was_syncline = is_syncline != 0; |
| 5855 | |
| 5856 | events_reset_syncline(); |
| 5857 | if (vpos == 0 && !was_syncline) { |
| 5858 | int firstline, lastline; |
| 5859 | linesync_first_last_line(&firstline, &lastline); |
| 5860 | |
| 5861 | display_slices = currprefs.gfx_display_sections; |
| 5862 | if (!display_slices) |
| 5863 | display_slices = 1; |
| 5864 | display_slice_cnt = 0; |
| 5865 | vsyncnextscanline = vsync_activeheight / display_slices + 1; |
| 5866 | vsyncnextscanline_add = vsync_activeheight / display_slices; |
| 5867 | display_slice_lines = (lastline - firstline) / display_slices + 1; |
| 5868 | nextwaitvpos = firstline + display_slice_lines + display_slice_lines / 2; |
| 5869 | if (display_slices <= 1) |
| 5870 | nextwaitvpos = lastline + 1; |
| 5871 | if (display_slices <= 2 && vsyncnextscanline > vsync_activeheight * 2 / 3) |
| 5872 | vsyncnextscanline = vsync_activeheight * 2 / 3; |
| 5873 | |
| 5874 | display_rendered = false; |
| 5875 | frame_rendered = true; |
| 5876 | frame_shown = true; |
| 5877 | } |
| 5878 | |
| 5879 | if (!display_slices) |
| 5880 | return false; |
| 5881 | |
| 5882 | if (is_last_line()) { |
| 5883 | |
| 5884 | if (!was_syncline && !display_rendered) { |
| 5885 | do_render_slice(1, display_slice_cnt, vpos); |
| 5886 | display_rendered = true; |
| 5887 | } |
| 5888 | // if 2 slices: make sure we are out of vblank. |
| 5889 | if (display_slices <= 2) { |
| 5890 | while (!currprefs.turbo_emulation && sync_timeout_check(maxtime)) { |
| 5891 | int vp = target_get_display_scanline(-1); |
| 5892 | if (vp != -1) |
| 5893 | break; |
| 5894 | maybe_process_pull_audio(); |
| 5895 | if (currprefs.m68k_speed < 0 && !was_syncline) { |
| 5896 | is_syncline = -3; |
| 5897 | return 0; |
| 5898 | } |
| 5899 | target_spin(0); |
| 5900 | } |
| 5901 | vsync_clear(); |
| 5902 | } |
| 5903 | |
| 5904 | while (!currprefs.turbo_emulation && sync_timeout_check(maxtime)) { |
| 5905 | int vp = target_get_display_scanline(-1); |
| 5906 | if (vp < 0 || vp >= vsyncnextscanline) |
| 5907 | break; |
no test coverage detected