From 2efc56e882af77de2fecacd1afabc27daff10e42 Mon Sep 17 00:00:00 2001 From: TomW Date: Mon, 31 Aug 2015 19:31:23 +0100 Subject: [PATCH] Reset triggered by keyboard controller should now be handled correctly by dynamic recompiler. --- src/386_dynarec.c | 3 +++ src/808x.c | 1 + src/x86_ops_io.h | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/386_dynarec.c b/src/386_dynarec.c index 401f7b9..71a60b3 100644 --- a/src/386_dynarec.c +++ b/src/386_dynarec.c @@ -1423,6 +1423,9 @@ inrecomp=0; if (!abrt && !x86_was_reset) codegen_block_end(); + + if (x86_was_reset) + codegen_reset(); // output &= ~2; } // if (output && (SP & 1)) diff --git a/src/808x.c b/src/808x.c index 2346299..273cb3c 100644 --- a/src/808x.c +++ b/src/808x.c @@ -676,6 +676,7 @@ void softresetx86() flags=2; idt.base = 0; x86seg_reset(); + x86_was_reset = 1; } static void setznp8(uint8_t val) diff --git a/src/x86_ops_io.h b/src/x86_ops_io.h index 3c9fcd7..96b5edd 100644 --- a/src/x86_ops_io.h +++ b/src/x86_ops_io.h @@ -33,6 +33,8 @@ static int opOUT_AL_imm(uint32_t fetchdat) check_io_perm(port); outb(port, AL); CLOCK_CYCLES(10); + if (port == 0x64) + return x86_was_reset; return 0; } static int opOUT_AX_imm(uint32_t fetchdat) @@ -87,7 +89,7 @@ static int opOUT_AL_DX(uint32_t fetchdat) check_io_perm(DX); outb(DX, AL); CLOCK_CYCLES(11); - return 0; + return x86_was_reset; } static int opOUT_AX_DX(uint32_t fetchdat) {