Implement API to terminate current emulator session from within main

emulator thread (ie soft power off).
This commit is contained in:
SarahW 2020-10-31 22:06:09 +00:00
commit 00034c1ece
10 changed files with 39 additions and 2 deletions

View file

@ -79,7 +79,10 @@ static void piix_pm_write(uint16_t port, uint8_t val, void *p)
{
pclog("PIIX transition to power state %i\n", (val >> 2) & 7);
if (val == 0x20)
fatal("Power off\n");
{
pclog("Power off\n");
stop_emulation_now();
}
}
piix->pm.pmcntrl = (piix->pm.pmcntrl & ~0xff00) | ((val & 0x1c) << 8);
break;