this finishes current line
| 5478 | |
| 5479 | // this finishes current line |
| 5480 | static void hsync_handler_pre(bool onvsync) |
| 5481 | { |
| 5482 | if (!custom_disabled) { |
| 5483 | |
| 5484 | /* reset light pen latch */ |
| 5485 | if (agnus_vb_active_end_line) { |
| 5486 | lightpen_triggered = 0; |
| 5487 | sprite_0 = 0; |
| 5488 | } |
| 5489 | |
| 5490 | if (!lightpen_triggered && (bplcon0 & 8)) { |
| 5491 | // lightpen always triggers at the beginning of the last line |
| 5492 | if (agnus_vb_start_line) { |
| 5493 | vpos_lpen = vpos; |
| 5494 | hpos_lpen = 1; |
| 5495 | hhpos_lpen = HHPOSR(); |
| 5496 | lightpen_triggered = 1; |
| 5497 | } else if (lightpen_enabled && !agnus_vb_active) { |
| 5498 | int lpnum = inputdevice_get_lightpen_id(); |
| 5499 | if (lpnum < 0) { |
| 5500 | lpnum = 0; |
| 5501 | } |
| 5502 | if (lightpen_cx[lpnum] > 0 && lightpen_cy[lpnum] == vpos) { |
| 5503 | event2_newevent_xx(-1, lightpen_cx[lpnum] * CYCLE_UNIT, lightpen_cx[lpnum], lightpen_trigger_func); |
| 5504 | } |
| 5505 | } |
| 5506 | } |
| 5507 | |
| 5508 | if (GET_PLANES(bplcon0)) { |
| 5509 | notice_resolution_seen(GET_RES_AGNUS(bplcon0), interlace_seen != 0); |
| 5510 | } |
| 5511 | } |
| 5512 | |
| 5513 | devices_hsync(); |
| 5514 | |
| 5515 | hsync_counter++; |
| 5516 | |
| 5517 | check_line_enabled(); |
| 5518 | |
| 5519 | #ifdef DEBUGGER |
| 5520 | debug_hsync(); |
| 5521 | #endif |
| 5522 | } |
| 5523 | |
| 5524 | // low latency vsync |
| 5525 |
no test coverage detected