From 2a2276dbee5c46b123698287e73b370c054da4c7 Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 3 Nov 2022 01:04:21 +0100 Subject: [PATCH] On the NEC V20/V30, REP string instructions with segment override move IP back one further byte on a hardware interrupt, fixes V20 detection on HWiNFO16. --- src/cpu/808x.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cpu/808x.c b/src/cpu/808x.c index b9e4a34c4..ade656dd8 100644 --- a/src/cpu/808x.c +++ b/src/cpu/808x.c @@ -1084,7 +1084,10 @@ rep_action(int bits) if (irq_pending() && (repeating != 0)) { access(71, bits); pfq_clear(); - set_ip(cpu_state.pc - 2); + if (is_nec && (ovr_seg != NULL)) + set_ip(cpu_state.pc - 3); + else + set_ip(cpu_state.pc - 2); t = 0; } if (t == 0) {