]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
MOVEC disassembly shows if used control register is supported by current CPU model.
authorToni Wilen <twilen@winuae.net>
Sat, 4 Jan 2020 14:26:36 +0000 (16:26 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 4 Jan 2020 14:26:36 +0000 (16:26 +0200)
disasm.cpp
include/newcpu.h

index b69b5448724aeef6f45e76d09d5fe4e716bee50d..b36f52fcbc386b6905af3c6b4c5d65c86c249389 100644 (file)
 
 
 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;
index d81739fc806feefcfa5cbb84504351d777d4c183..84b48335a7f968abd4bd092f2ca74285c7d96b34 100644 (file)
@@ -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[];