summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/m68000/m68k_in.c
diff options
context:
space:
mode:
author Alex W. Jackson <alex.w.jackson@gmail.com>2014-04-22 17:09:12 +0000
committer Alex W. Jackson <alex.w.jackson@gmail.com>2014-04-22 17:09:12 +0000
commit69e99a89f232bcd07be576192f0460e0173d7efd (patch)
treeac9c91797913899e7cb04e4f6d8bbcbe6e661122 /src/emu/cpu/m68000/m68k_in.c
parent94fc4f582a6ae7974935d66eeed2fdfa83ea4bc0 (diff)
m68000: implement TAS callback (currently only used by megadrive) in a more sensible and versatile way [Alex Jackson]
Diffstat (limited to 'src/emu/cpu/m68000/m68k_in.c')
-rw-r--r--src/emu/cpu/m68000/m68k_in.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/emu/cpu/m68000/m68k_in.c b/src/emu/cpu/m68000/m68k_in.c
index a5809607138..29ff095350c 100644
--- a/src/emu/cpu/m68000/m68k_in.c
+++ b/src/emu/cpu/m68000/m68k_in.c
@@ -10015,21 +10015,20 @@ M68KMAKE_OP(tas, 8, ., .)
{
UINT32 ea = M68KMAKE_GET_EA_AY_8;
UINT32 dst = m68ki_read_8((mc68kcpu), ea);
- UINT32 allow_writeback = TRUE;
(mc68kcpu)->not_z_flag = dst;
(mc68kcpu)->n_flag = NFLAG_8(dst);
(mc68kcpu)->v_flag = VFLAG_CLEAR;
(mc68kcpu)->c_flag = CFLAG_CLEAR;
- /* The Genesis/Megadrive games Gargoyles and Ex-Mutants need the TAS writeback
- disabled in order to function properly. Some Amiga software may also rely
- on this, but only when accessing specific addresses so additional functionality
- will be needed. */
- if (!(mc68kcpu)->tas_instr_callback.isnull())
- allow_writeback = ((mc68kcpu)->tas_instr_callback)();
-
- if (allow_writeback)
+ /* On the 68000 and 68010, the TAS instruction uses a unique bus cycle that may have
+ side effects (e.g. delaying DMA) or may fail to write back at all depending on the
+ bus implementation.
+ In particular, the Genesis/Megadrive games Gargoyles and Ex-Mutants need the TAS
+ to fail to write back in order to function properly. */
+ if (CPU_TYPE_IS_010_LESS((mc68kcpu)->cpu_type) && !(mc68kcpu)->tas_write_callback.isnull())
+ ((mc68kcpu)->tas_write_callback)(*(mc68kcpu)->program, ea, dst | 0x80, 0xff);
+ else
m68ki_write_8((mc68kcpu), ea, dst | 0x80);
}