mirror of
https://github.com/LIV2/WinUAE.git
synced 2025-12-06 00:12:52 +00:00
68030 MMU configuration exception was incorrectly followed by f-line exception
This commit is contained in:
parent
7861e3f16d
commit
a333766bbc
20
cpummu30.cpp
20
cpummu30.cpp
@ -333,7 +333,7 @@ static bool mmu_op30_invea(uae_u32 opcode)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mmu_op30_pmove (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr extra)
|
int mmu_op30_pmove(uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr extra)
|
||||||
{
|
{
|
||||||
int preg = (next >> 10) & 31;
|
int preg = (next >> 10) & 31;
|
||||||
int rw = (next >> 9) & 1;
|
int rw = (next >> 9) & 1;
|
||||||
@ -341,13 +341,13 @@ bool mmu_op30_pmove (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr extra)
|
|||||||
int unused = (next & 0xff);
|
int unused = (next & 0xff);
|
||||||
|
|
||||||
if (mmu_op30_invea(opcode))
|
if (mmu_op30_invea(opcode))
|
||||||
return true;
|
return 1;
|
||||||
// unused low 8 bits must be zeroed
|
// unused low 8 bits must be zeroed
|
||||||
if (unused)
|
if (unused)
|
||||||
return true;
|
return 1;
|
||||||
// read and fd set?
|
// read and fd set?
|
||||||
if (rw && fd)
|
if (rw && fd)
|
||||||
return true;
|
return 1;
|
||||||
|
|
||||||
#if MMU030_OP_DBG_MSG
|
#if MMU030_OP_DBG_MSG
|
||||||
switch (preg) {
|
switch (preg) {
|
||||||
@ -393,7 +393,7 @@ bool mmu_op30_pmove (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr extra)
|
|||||||
else {
|
else {
|
||||||
tc_030 = x_get_long (extra);
|
tc_030 = x_get_long (extra);
|
||||||
if (mmu030_decode_tc(tc_030, true))
|
if (mmu030_decode_tc(tc_030, true))
|
||||||
return true;
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x12: // SRP
|
case 0x12: // SRP
|
||||||
@ -404,7 +404,7 @@ bool mmu_op30_pmove (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr extra)
|
|||||||
srp_030 = (uae_u64)x_get_long (extra) << 32;
|
srp_030 = (uae_u64)x_get_long (extra) << 32;
|
||||||
srp_030 |= x_get_long (extra + 4);
|
srp_030 |= x_get_long (extra + 4);
|
||||||
if (mmu030_decode_rp(srp_030))
|
if (mmu030_decode_rp(srp_030))
|
||||||
return true;
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x13: // CRP
|
case 0x13: // CRP
|
||||||
@ -415,13 +415,13 @@ bool mmu_op30_pmove (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr extra)
|
|||||||
crp_030 = (uae_u64)x_get_long (extra) << 32;
|
crp_030 = (uae_u64)x_get_long (extra) << 32;
|
||||||
crp_030 |= x_get_long (extra + 4);
|
crp_030 |= x_get_long (extra + 4);
|
||||||
if (mmu030_decode_rp(crp_030))
|
if (mmu030_decode_rp(crp_030))
|
||||||
return true;
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x18: // MMUSR
|
case 0x18: // MMUSR
|
||||||
if (fd) {
|
if (fd) {
|
||||||
// FD must be always zero when MMUSR read or write
|
// FD must be always zero when MMUSR read or write
|
||||||
return true;
|
return 1;
|
||||||
}
|
}
|
||||||
if (rw)
|
if (rw)
|
||||||
x_put_word (extra, mmusr_030);
|
x_put_word (extra, mmusr_030);
|
||||||
@ -446,14 +446,14 @@ bool mmu_op30_pmove (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr extra)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
write_log (_T("Bad PMOVE at %08x\n"),m68k_getpc());
|
write_log (_T("Bad PMOVE at %08x\n"),m68k_getpc());
|
||||||
return true;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fd && !rw && preg != 0x18) {
|
if (!fd && !rw && preg != 0x18) {
|
||||||
mmu030_flush_atc_all();
|
mmu030_flush_atc_all();
|
||||||
}
|
}
|
||||||
tt_enabled = (tt0_030 & TT_ENABLE) || (tt1_030 & TT_ENABLE);
|
tt_enabled = (tt0_030 & TT_ENABLE) || (tt1_030 & TT_ENABLE);
|
||||||
return false;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mmu_op30_ptest (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr extra)
|
bool mmu_op30_ptest (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr extra)
|
||||||
|
|||||||
@ -53,9 +53,9 @@ extern struct mmu030_access mmu030_ad[MAX_MMU030_ACCESS + 1];
|
|||||||
|
|
||||||
void mmu030_page_fault(uaecptr addr, bool read, int flags, uae_u32 fc);
|
void mmu030_page_fault(uaecptr addr, bool read, int flags, uae_u32 fc);
|
||||||
|
|
||||||
bool mmu_op30_pmove (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr extra);
|
int mmu_op30_pmove(uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr extra);
|
||||||
bool mmu_op30_ptest (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr extra);
|
bool mmu_op30_ptest(uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr extra);
|
||||||
bool mmu_op30_pflush (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr extra);
|
bool mmu_op30_pflush(uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr extra);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uae_u32 addr_base;
|
uae_u32 addr_base;
|
||||||
|
|||||||
20
newcpu.cpp
20
newcpu.cpp
@ -4063,10 +4063,10 @@ static bool mmu_op30fake_pflush (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecp
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 68030 (68851) MMU instructions only
|
// 68030 (68851) MMU instructions only
|
||||||
bool mmu_op30 (uaecptr pc, uae_u32 opcode, uae_u16 extra, uaecptr extraa)
|
bool mmu_op30(uaecptr pc, uae_u32 opcode, uae_u16 extra, uaecptr extraa)
|
||||||
{
|
{
|
||||||
int type = extra >> 13;
|
int type = extra >> 13;
|
||||||
bool fline = false;
|
int fline = 0;
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
@ -4074,28 +4074,28 @@ bool mmu_op30 (uaecptr pc, uae_u32 opcode, uae_u16 extra, uaecptr extraa)
|
|||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
if (currprefs.mmu_model)
|
if (currprefs.mmu_model)
|
||||||
fline = mmu_op30_pmove (pc, opcode, extra, extraa);
|
fline = mmu_op30_pmove(pc, opcode, extra, extraa);
|
||||||
else
|
else
|
||||||
fline = mmu_op30fake_pmove (pc, opcode, extra, extraa);
|
fline = mmu_op30fake_pmove(pc, opcode, extra, extraa);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (currprefs.mmu_model)
|
if (currprefs.mmu_model)
|
||||||
fline = mmu_op30_pflush (pc, opcode, extra, extraa);
|
fline = mmu_op30_pflush(pc, opcode, extra, extraa);
|
||||||
else
|
else
|
||||||
fline = mmu_op30fake_pflush (pc, opcode, extra, extraa);
|
fline = mmu_op30fake_pflush(pc, opcode, extra, extraa);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
if (currprefs.mmu_model)
|
if (currprefs.mmu_model)
|
||||||
fline = mmu_op30_ptest (pc, opcode, extra, extraa);
|
fline = mmu_op30_ptest(pc, opcode, extra, extraa);
|
||||||
else
|
else
|
||||||
fline = mmu_op30fake_ptest (pc, opcode, extra, extraa);
|
fline = mmu_op30fake_ptest(pc, opcode, extra, extraa);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (fline) {
|
if (fline > 0) {
|
||||||
m68k_setpc(pc);
|
m68k_setpc(pc);
|
||||||
op_illg(opcode);
|
op_illg(opcode);
|
||||||
}
|
}
|
||||||
return fline;
|
return fline != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check if an address matches a ttr */
|
/* check if an address matches a ttr */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user