a regular 68000 processor will generate a read operation when using the clr.b/.w/.l opcodes, this was fixed / changed on the 020.

I'm not aware of any software explicitly requiring this right now, but it would be detectable if you have read-triggered hardware and various 68k documents advise caution when using the opcodes / porting code using said opcodes to a 020 based machine for that reason.

There was some private discussion with Charles before doing this, apparently it is detectable on the Genesis where a read from the VDP port will increment the internal address counter.
This commit is contained in:
David Haywood 2013-08-21 06:56:57 +00:00
parent 070bb4fb3d
commit 844e696071

View File

@ -3895,7 +3895,14 @@ M68KMAKE_OP(clr, 8, ., d)
M68KMAKE_OP(clr, 8, ., .) M68KMAKE_OP(clr, 8, ., .)
{ {
m68ki_write_8((mc68kcpu), M68KMAKE_GET_EA_AY_8, 0); UINT32 ea = M68KMAKE_GET_EA_AY_8;
if(CPU_TYPE_IS_010_LESS((mc68kcpu)->cpu_type))
{
m68ki_read_8((mc68kcpu), ea); /* the 68000 (and 010?) does a dummy read, the value is discarded */
}
m68ki_write_8((mc68kcpu), ea, 0);
(mc68kcpu)->n_flag = NFLAG_CLEAR; (mc68kcpu)->n_flag = NFLAG_CLEAR;
(mc68kcpu)->v_flag = VFLAG_CLEAR; (mc68kcpu)->v_flag = VFLAG_CLEAR;
@ -3917,7 +3924,14 @@ M68KMAKE_OP(clr, 16, ., d)
M68KMAKE_OP(clr, 16, ., .) M68KMAKE_OP(clr, 16, ., .)
{ {
m68ki_write_16((mc68kcpu), M68KMAKE_GET_EA_AY_16, 0); UINT32 ea = M68KMAKE_GET_EA_AY_16;
if(CPU_TYPE_IS_010_LESS((mc68kcpu)->cpu_type))
{
m68ki_read_16((mc68kcpu), ea); /* the 68000 (and 010?) does a dummy read, the value is discarded */
}
m68ki_write_16((mc68kcpu), ea, 0);
(mc68kcpu)->n_flag = NFLAG_CLEAR; (mc68kcpu)->n_flag = NFLAG_CLEAR;
(mc68kcpu)->v_flag = VFLAG_CLEAR; (mc68kcpu)->v_flag = VFLAG_CLEAR;
@ -3939,7 +3953,14 @@ M68KMAKE_OP(clr, 32, ., d)
M68KMAKE_OP(clr, 32, ., .) M68KMAKE_OP(clr, 32, ., .)
{ {
m68ki_write_32((mc68kcpu), M68KMAKE_GET_EA_AY_32, 0); UINT32 ea = M68KMAKE_GET_EA_AY_32;
if(CPU_TYPE_IS_010_LESS((mc68kcpu)->cpu_type))
{
m68ki_read_32((mc68kcpu), ea); /* the 68000 (and 010?) does a dummy read, the value is discarded */
}
m68ki_write_32((mc68kcpu), ea, 0);
(mc68kcpu)->n_flag = NFLAG_CLEAR; (mc68kcpu)->n_flag = NFLAG_CLEAR;
(mc68kcpu)->v_flag = VFLAG_CLEAR; (mc68kcpu)->v_flag = VFLAG_CLEAR;