From 47e557e9cee5af0e7fdb50737eb8934635b93a83 Mon Sep 17 00:00:00 2001 From: SarahW Date: Tue, 10 Mar 2020 21:14:57 +0000 Subject: [PATCH] Implement Amstrad reset port 0x66. Fixes CTRL-ALT-DEL on Amstrad machines. --- src/808x.c | 1 + src/amstrad.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/808x.c b/src/808x.c index f3f8d0f..b080c97 100644 --- a/src/808x.c +++ b/src/808x.c @@ -689,6 +689,7 @@ void softresetx86() x86seg_reset(); flushmmucache(); x86_was_reset = 1; + FETCHCLEAR(); } static void setznp8(uint8_t val) diff --git a/src/amstrad.c b/src/amstrad.c index b952151..714380c 100644 --- a/src/amstrad.c +++ b/src/amstrad.c @@ -6,6 +6,7 @@ #include "mouse.h" #include "video.h" #include "fdc.h" +#include "x86.h" #include "amstrad.h" @@ -77,6 +78,10 @@ void amstrad_write(uint16_t port, uint8_t val, void *priv) { switch (port) { + case 0x66: + softresetx86(); + break; + case 0x378: case 0x379: case 0x37a: @@ -161,6 +166,7 @@ void amstrad_init() io_sethandler(0x0078, 0x0001, amstrad_mouse_read, NULL, NULL, amstrad_mouse_write, NULL, NULL, NULL); io_sethandler(0x007a, 0x0001, amstrad_mouse_read, NULL, NULL, amstrad_mouse_write, NULL, NULL, NULL); + io_sethandler(0x0066, 0x0001, NULL, NULL, NULL, amstrad_write, NULL, NULL, NULL); io_sethandler(0x0378, 0x0003, amstrad_read, NULL, NULL, amstrad_write, NULL, NULL, NULL); io_sethandler(0xdead, 0x0001, amstrad_read, NULL, NULL, amstrad_write, NULL, NULL, NULL); if ((romset == ROM_PC200 || romset == ROM_PPC512) && gfxcard != GFX_BUILTIN)