From: Toni Wilen Date: Sat, 4 Jan 2020 14:26:36 +0000 (+0200) Subject: MOVEC disassembly shows if used control register is supported by current CPU model. X-Git-Tag: 4400~195 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=d7158af7e5bd38f64bb2ff341b306f4c7583e2f6;p=francis%2Fwinuae.git MOVEC disassembly shows if used control register is supported by current CPU model. --- diff --git a/disasm.cpp b/disasm.cpp index b69b5448..b36f52fc 100644 --- a/disasm.cpp +++ b/disasm.cpp @@ -12,25 +12,25 @@ struct cpum2c m2cregs[] = { - { 0, _T("SFC") }, - { 1, _T("DFC") }, - { 2, _T("CACR") }, - { 3, _T("TC") }, - { 4, _T("ITT0") }, - { 5, _T("ITT1") }, - { 6, _T("DTT0") }, - { 7, _T("DTT1") }, - { 8, _T("BUSC") }, - { 0x800, _T("USP") }, - { 0x801, _T("VBR") }, - { 0x802, _T("CAAR") }, - { 0x803, _T("MSP") }, - { 0x804, _T("ISP") }, - { 0x805, _T("MMUS") }, - { 0x806, _T("URP") }, - { 0x807, _T("SRP") }, - { 0x808, _T("PCR") }, - { -1, NULL } + { 0, 31, _T("SFC") }, + { 1, 31, _T("DFC") }, + { 2, 30, _T("CACR") }, + { 3, 24, _T("TC") }, + { 4, 24, _T("ITT0") }, + { 5, 24, _T("ITT1") }, + { 6, 24, _T("DTT0") }, + { 7, 24, _T("DTT1") }, + { 8, 16, _T("BUSC") }, + { 0x800, 31, _T("USP") }, + { 0x801, 31, _T("VBR") }, + { 0x802, 6, _T("CAAR") }, + { 0x803, 15, _T("MSP") }, + { 0x804, 31, _T("ISP") }, + { 0x805, 8, _T("MMUS") }, + { 0x806, 12, _T("URP") }, + { 0x807, 12, _T("SRP") }, + { 0x808, 16, _T("PCR") }, + { -1, 0, NULL } }; const TCHAR *fpsizes[] = { @@ -1696,6 +1696,11 @@ uae_u32 m68k_disasm_2 (TCHAR *buf, int bufsize, uaecptr pc, uaecptr *nextpc, int _tcscat(instrname, _T(",")); _tcscat(instrname, regs); } + int lvl = (currprefs.cpu_model - 68000) / 10; + if (lvl == 6) + lvl = 5; + if (lvl < 1 || !(m2cregs[j].flags & (1 << (lvl - 1)))) + illegal = true; pc += 2; } else if (lookup->mnemo == i_CHK2) { TCHAR *p; diff --git a/include/newcpu.h b/include/newcpu.h index d81739fc..84b48335 100644 --- a/include/newcpu.h +++ b/include/newcpu.h @@ -809,6 +809,7 @@ extern uae_u32 val_move2c (int regno); extern void val_move2c2 (int regno, uae_u32 val); struct cpum2c { int regno; + int flags; const TCHAR *regname; }; extern struct cpum2c m2cregs[];