geneve: v9938 should abort a command when the mode is switched before completion.

This commit is contained in:
Michael Zapf 2018-01-08 02:12:22 +01:00
parent f1497bb159
commit 1da116e724
2 changed files with 19 additions and 1 deletions

View File

@ -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;
}

View File

@ -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"