executed at start of scanline
| 6505 | |
| 6506 | // executed at start of scanline |
| 6507 | static void hsync_handler(bool vs) |
| 6508 | { |
| 6509 | hsync_handler_pre(vs); |
| 6510 | if (vs) { |
| 6511 | devices_vsync_pre(); |
| 6512 | if (savestate_check()) { |
| 6513 | uae_reset(0, 0); |
| 6514 | return; |
| 6515 | } |
| 6516 | if (uae_quit_check()) { |
| 6517 | return; |
| 6518 | } |
| 6519 | } |
| 6520 | if (vpos == vsync_startline + 1 && !maxvpos_display_vsync_next) { |
| 6521 | inputdevice_read_msg(true); |
| 6522 | vsync_display_render(); |
| 6523 | vsync_display_rendered = false; |
| 6524 | if ((currprefs.cs_hvcsync == HVSYNC_COMBINED || currprefs.cs_hvcsync == HVSYNC_COMBINED_SYNC) && valid_programmed_mode()) { |
| 6525 | if (beamcon0 & (BEAMCON0_VARVSYEN | BEAMCON0_VARCSYEN)) { |
| 6526 | lof_display = lof_pdetect; |
| 6527 | } else { |
| 6528 | lof_display = lof_detect; |
| 6529 | } |
| 6530 | } else if (currprefs.cs_hvcsync == HVSYNC_HVSYNC || currprefs.cs_hvcsync == HVSYNC_HVSYNC_SYNC) { |
| 6531 | if (beamcon0 & BEAMCON0_VARVSYEN) { |
| 6532 | lof_display = lof_pdetect; |
| 6533 | } else { |
| 6534 | lof_display = lof_detect; |
| 6535 | } |
| 6536 | } else { |
| 6537 | if (beamcon0 & BEAMCON0_VARCSYEN) { |
| 6538 | lof_display = lof_pdetect; |
| 6539 | } else { |
| 6540 | lof_display = lof_detect; |
| 6541 | } |
| 6542 | } |
| 6543 | reset_autoscale(); |
| 6544 | virtual_vsync_check(); |
| 6545 | last_vsync_evt = get_cycles() + (maxvpos * maxhpos * 3) * CYCLE_UNIT; |
| 6546 | display_vsync_counter++; |
| 6547 | maxvpos_display_vsync_next = true; |
| 6548 | display_hsync_counter = 0; |
| 6549 | vsync_start_check(); |
| 6550 | } else if (vpos != vsync_startline + 1 && maxvpos_display_vsync_next) { |
| 6551 | // protect against weird VPOSW writes causing continuous vblanks |
| 6552 | maxvpos_display_vsync_next = false; |
| 6553 | vsync_start_check(); |
| 6554 | } else { |
| 6555 | display_hsync_counter++; |
| 6556 | if (display_hsync_counter > maxvpos) { |
| 6557 | display_hsync_counter = 0; |
| 6558 | inputdevice_read_msg(true); |
| 6559 | vsync_display_render(); |
| 6560 | vsync_display_rendered = false; |
| 6561 | vsync_start_check(); |
| 6562 | } |
| 6563 | |
| 6564 | } |
no test coverage detected