mirror of
https://github.com/gopher64/gopher64.git
synced 2026-11-17 11:14:17 +01:00
fix issue when V_SYNC is cleared (#1357)
* fix issue when V_SYNC is cleared * fix switch from interlaced to progressive
This commit is contained in:
1 parent
cebfadef36
commit
56dd24c699
1 file changed
+16
-8
+16
-8
@@ -44,7 +44,9 @@ fn reset_pace_deadline(device: &mut device::Device) {
|
||||
}
|
||||
|
||||
fn set_vertical_interrupt(device: &mut device::Device) {
|
||||
if device::events::get_event(device, device::events::EVENT_TYPE_VI).is_none() {
|
||||
if device.vi.regs[VI_V_SYNC_REG] != 0
|
||||
&& device::events::get_event(device, device::events::EVENT_TYPE_VI).is_none()
|
||||
{
|
||||
device::events::create_event(device, device::events::EVENT_TYPE_VI, device.vi.delay)
|
||||
}
|
||||
}
|
||||
@@ -168,16 +170,22 @@ pub fn vertical_interrupt_event(device: &mut device::Device) {
|
||||
|
||||
retroachievements::do_frame();
|
||||
|
||||
/* toggle vi field if in interlaced mode */
|
||||
device.vi.field ^= (device.vi.regs[VI_STATUS_REG] >> 6) & 0x1;
|
||||
/* toggle vi field if in interlaced mode, the field is always 0 in progressive mode */
|
||||
if device.vi.regs[VI_STATUS_REG] & 0x40 != 0 {
|
||||
device.vi.field ^= 1;
|
||||
} else {
|
||||
device.vi.field = 0;
|
||||
}
|
||||
|
||||
device::mi::set_rcp_interrupt(device, device::mi::MI_INTR_VI);
|
||||
|
||||
device::events::create_event_at(
|
||||
device,
|
||||
device::events::EVENT_TYPE_VI,
|
||||
device.cpu.next_event_count + device.vi.delay,
|
||||
);
|
||||
if device.vi.delay != 0 {
|
||||
device::events::create_event_at(
|
||||
device,
|
||||
device::events::EVENT_TYPE_VI,
|
||||
device.cpu.next_event_count + device.vi.delay,
|
||||
);
|
||||
}
|
||||
|
||||
let v_intr = (device.vi.regs[VI_V_INTR_REG] & 0x3FF) as i64;
|
||||
let v_start = ((device.vi.regs[VI_V_START_REG] >> 16) & 0x3FF) as i64;
|
||||
|
||||
Reference in new issue
Block a user