summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Michaël Banaan Ananas <happppp@users.noreply.github.com>2012-10-26 21:45:43 +0000
committer Michaël Banaan Ananas <happppp@users.noreply.github.com>2012-10-26 21:45:43 +0000
commit7740759fbc40aa1159e3b4d38d31b092feac5601 (patch)
tree26cf1af8149cd54825a7d20946f06a857e579509 /src
parenta3693d295255b681474864496aa332d036994fb1 (diff)
fix z80 cycles on illegal prefixes
Diffstat (limited to 'src')
-rw-r--r--src/emu/cpu/z80/z80.c13
-rw-r--r--src/mame/drivers/system1.c6
-rw-r--r--src/mess/machine/msx.c6
3 files changed, 11 insertions, 14 deletions
diff --git a/src/emu/cpu/z80/z80.c b/src/emu/cpu/z80/z80.c
index 43edf4f52f9..b095169f837 100644
--- a/src/emu/cpu/z80/z80.c
+++ b/src/emu/cpu/z80/z80.c
@@ -316,9 +316,9 @@ static const UINT8 cc_xy[0x100] = {
4+4, 4+4, 4+4, 4+4, 4+4, 4+4,19 , 4+4, 4+4, 4+4, 4+4, 4+4, 4+4, 4+4,19 , 4+4,
4+4, 4+4, 4+4, 4+4, 4+4, 4+4,19 , 4+4, 4+4, 4+4, 4+4, 4+4, 4+4, 4+4,19 , 4+4,
5+4,10+4,10+4,10+4,10+4,11+4, 7+4,11+4, 5+4,10+4,10+4, 0 ,10+4,17+4, 7+4,11+4, /* cb -> cc_xycb */
- 5+4,10+4,10+4,11+4,10+4,11+4, 7+4,11+4, 5+4, 4+4,10+4,11+4,10+4, 4+4, 7+4,11+4,
- 5+4,10+4,10+4,19+4,10+4,11+4, 7+4,11+4, 5+4, 4+4,10+4, 4+4,10+4, 4+4, 7+4,11+4,
- 5+4,10+4,10+4, 4+4,10+4,11+4, 7+4,11+4, 5+4, 6+4,10+4, 4+4,10+4, 4+4, 7+4,11+4
+ 5+4,10+4,10+4,11+4,10+4,11+4, 7+4,11+4, 5+4, 4+4,10+4,11+4,10+4, 4 , 7+4,11+4, /* dd -> cc_xy again */
+ 5+4,10+4,10+4,19+4,10+4,11+4, 7+4,11+4, 5+4, 4+4,10+4, 4+4,10+4, 4 , 7+4,11+4, /* ed -> cc_ed */
+ 5+4,10+4,10+4, 4+4,10+4,11+4, 7+4,11+4, 5+4, 6+4,10+4, 4+4,10+4, 4 , 7+4,11+4 /* fd -> cc_xy again */
};
static const UINT8 cc_xycb[0x100] = {
@@ -780,7 +780,6 @@ INLINE UINT32 ARG16(z80_state *z80)
#define RETI(Z) do { \
POP((Z), pc); \
(Z)->WZ = (Z)->PC; \
-/* according to http://www.msxnet.org/tech/z80-documented.pdf */\
(Z)->iff1 = (Z)->iff2; \
(Z)->daisy.call_reti_device(); \
} while (0)
@@ -3651,10 +3650,8 @@ static CPU_EXECUTE( z80 )
do
{
/* check for NSC800 IRQs line RSTA, RSTB, RSTC */
- if ((z80->nsc800_irq_state[NSC800_RSTA] != CLEAR_LINE ||
- z80->nsc800_irq_state[NSC800_RSTB] != CLEAR_LINE ||
- z80->nsc800_irq_state[NSC800_RSTC] != CLEAR_LINE) && z80->iff1 && !z80->after_ei)
- take_interrupt_nsc800(z80);
+ if ((z80->nsc800_irq_state[NSC800_RSTA] != CLEAR_LINE || z80->nsc800_irq_state[NSC800_RSTB] != CLEAR_LINE || z80->nsc800_irq_state[NSC800_RSTC] != CLEAR_LINE) && z80->iff1 && !z80->after_ei)
+ take_interrupt_nsc800(z80);
/* check for IRQs before each instruction */
if (z80->irq_state != CLEAR_LINE && z80->iff1 && !z80->after_ei)
diff --git a/src/mame/drivers/system1.c b/src/mame/drivers/system1.c
index 6e6c410da94..d9cd314c967 100644
--- a/src/mame/drivers/system1.c
+++ b/src/mame/drivers/system1.c
@@ -308,9 +308,9 @@ static const UINT8 cc_xy[0x100] = {
( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,(19 )*5+3*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,(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2*2,(10+4)*5+4*2,( 4+4)*5+2*2,( 7+4)*5+3*2,(11+4)*5+2*2
+( 5+4)*5+2*2,(10+4)*5+2*2,(10+4)*5+4*2,(11+4)*5+3*2,(10+4)*5+4*2,(11+4)*5+2*2,( 7+4)*5+3*2,(11+4)*5+2*2,( 5+4)*5+2*2,( 4+4)*5+2*2,(10+4)*5+4*2,(11+4)*5+3*2,(10+4)*5+4*2,( 4 )*5+2*2,( 7+4)*5+3*2,(11+4)*5+2*2,
+( 5+4)*5+2*2,(10+4)*5+2*2,(10+4)*5+4*2,(19+4)*5+2*2,(10+4)*5+4*2,(11+4)*5+2*2,( 7+4)*5+3*2,(11+4)*5+2*2,( 5+4)*5+2*2,( 4+4)*5+2*2,(10+4)*5+4*2,( 4+4)*5+2*2,(10+4)*5+4*2,( 4 )*5+2*2,( 7+4)*5+3*2,(11+4)*5+2*2,
+( 5+4)*5+2*2,(10+4)*5+2*2,(10+4)*5+4*2,( 4+4)*5+2*2,(10+4)*5+4*2,(11+4)*5+2*2,( 7+4)*5+3*2,(11+4)*5+2*2,( 5+4)*5+2*2,( 6+4)*5+2*2,(10+4)*5+4*2,( 4+4)*5+2*2,(10+4)*5+4*2,( 4 )*5+2*2,( 7+4)*5+3*2,(11+4)*5+2*2
};
static const UINT8 cc_xycb[0x100] = {
diff --git a/src/mess/machine/msx.c b/src/mess/machine/msx.c
index 91e1f5d7d24..bcad4521b17 100644
--- a/src/mess/machine/msx.c
+++ b/src/mess/machine/msx.c
@@ -468,9 +468,9 @@ static const UINT8 cc_xy[0x100] = {
4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2,19 +2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2,19 +2, 4+4+2,
4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2,19 +2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2,19 +2, 4+4+2,
5+4+2,10+4+2,10+4+2,10+4+2,10+4+2,11+4+2, 7+4+2,11+4+2, 5+4+2,10+4+2,10+4+2, 0 +2,10+4+2,17+4+2, 7+4+2,11+4+2,
- 5+4+2,10+4+2,10+4+2,11+4+2,10+4+2,11+4+2, 7+4+2,11+4+2, 5+4+2, 4+4+2,10+4+2,11+4+2,10+4+2, 4+4+2, 7+4+2,11+4+2,
- 5+4+2,10+4+2,10+4+2,19+4+2,10+4+2,11+4+2, 7+4+2,11+4+2, 5+4+2, 4+4+2,10+4+2, 4+4+2,10+4+2, 4+4+2, 7+4+2,11+4+2,
- 5+4+2,10+4+2,10+4+2, 4+4+2,10+4+2,11+4+2, 7+4+2,11+4+2, 5+4+2, 6+4+2,10+4+2, 4+4+2,10+4+2, 4+4+2, 7+4+2,11+4+2
+ 5+4+2,10+4+2,10+4+2,11+4+2,10+4+2,11+4+2, 7+4+2,11+4+2, 5+4+2, 4+4+2,10+4+2,11+4+2,10+4+2, 4 +2, 7+4+2,11+4+2,
+ 5+4+2,10+4+2,10+4+2,19+4+2,10+4+2,11+4+2, 7+4+2,11+4+2, 5+4+2, 4+4+2,10+4+2, 4+4+2,10+4+2, 4 +2, 7+4+2,11+4+2,
+ 5+4+2,10+4+2,10+4+2, 4+4+2,10+4+2,11+4+2, 7+4+2,11+4+2, 5+4+2, 6+4+2,10+4+2, 4+4+2,10+4+2, 4 +2, 7+4+2,11+4+2
};
static const UINT8 cc_xycb[0x100] = {