From 0715db56086c294af96935193da35cceb7868225 Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Mon, 22 Nov 2021 21:17:57 -0500 Subject: [PATCH] INTV: adjust sme timings and fix accesses to registers, fixes motocross --- .../Intellivision/Intellivision.IEmulator.cs | 4 ++-- .../Consoles/Intellivision/STIC.cs | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs index 4ceef49121..9742ec37fb 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs @@ -87,7 +87,7 @@ namespace BizHawk.Emulation.Cores.Intellivision _stic.active_display = false; _stic.Sr1 = false; - _cpu.PendingCycles = 3000 + _cpu.GetPendingCycles(); + _cpu.PendingCycles = 2990 + _cpu.GetPendingCycles(); while (_cpu.GetPendingCycles() > 0) { @@ -97,7 +97,7 @@ namespace BizHawk.Emulation.Cores.Intellivision } // vblank phase 2 - _cpu.PendingCycles = 791 + _cpu.GetPendingCycles(); + _cpu.PendingCycles = 801 + _cpu.GetPendingCycles(); _stic.in_vb_1 = false; while (_cpu.GetPendingCycles() > 0) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Intellivision/STIC.cs b/src/BizHawk.Emulation.Cores/Consoles/Intellivision/STIC.cs index fc3c2bd755..3bbb4af95d 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Intellivision/STIC.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Intellivision/STIC.cs @@ -194,7 +194,7 @@ namespace BizHawk.Emulation.Cores.Intellivision switch (addr & 0xF000) { case 0x0000: - if (addr <= 0x003F && (in_vb_1 | !active_display)) + if (addr <= 0x003F && (in_vb_1 | (!active_display & !in_vb_2))) { if (addr == 0x0021 && !peek) { @@ -209,7 +209,7 @@ namespace BizHawk.Emulation.Cores.Intellivision } break; case 0x4000: - if ((addr <= 0x403F) && (in_vb_1 | !active_display)) + if ((addr <= 0x403F) && (in_vb_1 | (!active_display & !in_vb_2))) { if (addr == 0x4021 && !peek) { @@ -218,7 +218,7 @@ namespace BizHawk.Emulation.Cores.Intellivision } break; case 0x8000: - if ((addr <= 0x803F) && (in_vb_1 | !active_display)) + if ((addr <= 0x803F) && (in_vb_1 | (!active_display & !in_vb_2))) { if (addr == 0x8021 && !peek) { @@ -227,7 +227,7 @@ namespace BizHawk.Emulation.Cores.Intellivision } break; case 0xC000: - if ((addr <= 0xC03F) && (in_vb_1 | !active_display)) + if ((addr <= 0xC03F) && (in_vb_1 | (!active_display & !in_vb_2))) { if (addr == 0xC021 && !peek) { @@ -245,28 +245,28 @@ namespace BizHawk.Emulation.Cores.Intellivision switch (addr & 0xF000) { case 0x0000: - if (addr <= 0x003F && (in_vb_1 | !active_display)) + if (addr <= 0x003F && (in_vb_1 | (!active_display & !in_vb_2))) { write_reg(addr, value, poke); return true; } break; case 0x4000: - if (addr <= 0x403F && (in_vb_1 | !active_display)) + if (addr <= 0x403F && (in_vb_1 | (!active_display & !in_vb_2))) { write_reg(addr-0x4000, value, poke); return true; } break; case 0x8000: - if (addr <= 0x803F && (in_vb_1 | !active_display)) + if (addr <= 0x803F && (in_vb_1 | (!active_display & !in_vb_2))) { write_reg(addr-0x8000, value, poke); return true; } break; case 0xC000: - if (addr <= 0xC03F && (in_vb_1 | !active_display)) + if (addr <= 0xC03F && (in_vb_1 | (!active_display & !in_vb_2))) { write_reg(addr-0xC000, value, poke); return true;