summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/i86/i286.c
diff options
context:
space:
mode:
author Phil Bennett <philipjbennett@users.noreply.github.com>2009-12-31 00:56:09 +0000
committer Phil Bennett <philipjbennett@users.noreply.github.com>2009-12-31 00:56:09 +0000
commitf7b4dbfea164e38e9da67df6f3392b7771fd85e2 (patch)
tree626c889ca6314253fe5d8d710e974da552221243 /src/emu/cpu/i86/i286.c
parent6f4011f247373d2599fafcb8c7acc1a4c0950574 (diff)
Fixed x86 HLT instruction handling [Phill Harvey-Smith]
Date: Mon, 28 Dec 2009 00:29:31 +0000 From: Phill Harvey-Smith <afra@aurigae.demon.co.uk> To: submit@mamedev.org Subject: i86 patch Hi, Attatched is a patch correcting the operation of the hlt instruction in the i86 core. I have done test builds with both the current mame and mess source for both debug and normal builds, and all seems to be ok. Cheers. Phill. -- Phill Harvey-Smith, Programmer, Hardware hacker, and general eccentric ! "You can twist perceptions, but reality won't budge" -- Rush.
Diffstat (limited to 'src/emu/cpu/i86/i286.c')
-rw-r--r--src/emu/cpu/i86/i286.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/emu/cpu/i86/i286.c b/src/emu/cpu/i86/i286.c
index 18e96ffcc27..199b8be6484 100644
--- a/src/emu/cpu/i86/i286.c
+++ b/src/emu/cpu/i86/i286.c
@@ -60,16 +60,18 @@ struct _i80286_state
const device_config *device;
const address_space *program;
const address_space *io;
- INT32 AuxVal, OverVal, SignVal, ZeroVal, CarryVal, DirVal; /* 0 or non-0 valued flags */
- UINT8 ParityVal;
+ INT32 AuxVal, OverVal, SignVal, ZeroVal, CarryVal, DirVal; /* 0 or non-0 valued flags */
+ UINT8 ParityVal;
UINT8 TF, IF; /* 0 or 1 valued flags */
UINT8 int_vector;
INT8 nmi_state;
INT8 irq_state;
- INT8 test_state; /* PJB 03/05 */
+ INT8 test_state;
UINT8 rep_in_progress;
INT32 extra_cycles; /* extra cycles for interrupts */
+ int halted; /* Is the CPU halted ? */
+
memory_interface mem;
int icount;
unsigned prefix_base;
@@ -173,6 +175,7 @@ static CPU_RESET( i80286 )
CHANGE_PC(cpustate->pc);
+ cpustate->halted = 0;
}
/****************************************************************************/
@@ -181,6 +184,11 @@ static CPU_RESET( i80286 )
static void set_irq_line(i80286_state *cpustate, int irqline, int state)
{
+ if (state != CLEAR_LINE && cpustate->halted)
+ {
+ cpustate->halted = 0;
+ }
+
if (irqline == INPUT_LINE_NMI)
{
if (cpustate->nmi_state == state)
@@ -205,6 +213,9 @@ static CPU_EXECUTE( i80286 )
{
i80286_state *cpustate = get_safe_token(device);
+ if (cpustate->halted)
+ return cycles;
+
/* copy over the cycle counts if they're not correct */
if (timing.id != 80286)
timing = i80286_cycles;