diff options
author | Aaron Giles <aaron@aarongiles.com> | 2008-04-17 02:58:24 +0000 |
---|---|---|
committer | Aaron Giles <aaron@aarongiles.com> | 2008-04-17 02:58:24 +0000 |
commit | 2028ecc2f7d98c91b0794664bd14fea900d72c3f (patch) | |
tree | 2461b7e77654cb6b8ce0cfebfe7d209a382850a1 | |
parent | 3c35a00e87c6bf7af741b48d58083fbb0b1de0e3 (diff) |
Removed ancient 720 kludge.
Added support in the T-11 core for an external vector via irq_callback.
Apparently the hardware actually did support this and it is necessary
for emulating the BK 0010/11 computer in MESS.
-rw-r--r-- | src/emu/cpu/t11/t11.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/emu/cpu/t11/t11.c b/src/emu/cpu/t11/t11.c index b4add6fc438..db093c3b9f2 100644 --- a/src/emu/cpu/t11/t11.c +++ b/src/emu/cpu/t11/t11.c @@ -202,24 +202,21 @@ static void t11_check_irqs(void) /* compare the priority of the interrupt to the PSW */ if (irq->priority > priority) { - /* get the priority of this interrupt */ - int new_pc = RWORD(irq->vector); - int new_psw = RWORD(irq->vector + 2); + int vector = irq->vector; + int new_pc, new_psw; - /* call the callback */ - if (t11.irq_callback) + /* call the callback; if we don't get -1 back, use the return value as our vector */ + if (t11.irq_callback != NULL) { - int vector = 0; - - if (t11.irq_state & 8) vector = 3; - else if (t11.irq_state & 4) vector = 2; - else if (t11.irq_state & 2) vector = 1; - (*t11.irq_callback)(vector); + int new_vector = (*t11.irq_callback)(t11.irq_state & 15); + if (new_vector != -1) + vector = new_vector; } - /* kludge for 720 - fix me! */ - if (new_pc == 0) - return; + /* fetch the new PC and PSW from that vector */ + assert((vector & 3) == 0); + new_pc = RWORD(vector); + new_psw = RWORD(vector + 2); /* push the old state, set the new one */ PUSH(PSW); @@ -459,7 +456,7 @@ void t11_get_info(UINT32 state, cpuinfo *info) /* --- the following bits of info are returned as 64-bit signed integers --- */ case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(t11); break; case CPUINFO_INT_INPUT_LINES: info->i = 4; break; - case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; + case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = -1; break; case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break; |