From 1da116e724c87a54fb5ddc0c3e27517b49b5ef7b Mon Sep 17 00:00:00 2001 From: Michael Zapf Date: Mon, 8 Jan 2018 02:12:22 +0100 Subject: geneve: v9938 should abort a command when the mode is switched before completion. --- src/devices/video/v9938.cpp | 19 +++++++++++++++++++ src/mame/drivers/ti99_4x.cpp | 1 - 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/devices/video/v9938.cpp b/src/devices/video/v9938.cpp index 4d4606ea11d..b5bbc0120dd 100644 --- a/src/devices/video/v9938.cpp +++ b/src/devices/video/v9938.cpp @@ -1794,6 +1794,25 @@ void v99x8_device::set_mode() { if ( (s_modes[i].m == n) || (s_modes[i].m == 0xff) ) break; } + + // MZ: What happens when the mode is changed during command execution? + // This is left unspecified in the docs. On a Geneve, experiments showed + // that the command is not aborted (the CE flag is still 1) and runs for + // about 90% of the nominal execution time, but VRAM is only correctly + // filled up to the time of switching, and after that, isolated locations + // within the normally affected area are changed, but inconsistently. + // Obviously, it depends on the time when the switch happened. + // This behavior occurs on every switch from a mode Graphics4 and higher + // to another mode, e.g. also from Graphics7 to Graphics6. + // Due to the lack of more information, we simply abort the command. + + if (m_vdp_engine && m_mode != i) + { + LOG("Command aborted due to mode change\n"); + m_vdp_engine = nullptr; + m_stat_reg[2] &= 0xFE; + } + m_mode = i; } diff --git a/src/mame/drivers/ti99_4x.cpp b/src/mame/drivers/ti99_4x.cpp index ba24b0c615e..3a50d10255b 100644 --- a/src/mame/drivers/ti99_4x.cpp +++ b/src/mame/drivers/ti99_4x.cpp @@ -42,7 +42,6 @@ #include "cpu/tms9900/tms9900.h" #include "sound/wave.h" -#include "video/v9938.h" #include "machine/tms9901.h" #include "imagedev/cassette.h" -- cgit v1.2.3