]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Illegal MOVEC disassembler PC fix.
authorToni Wilen <twilen@winuae.net>
Sun, 12 Jan 2020 17:56:59 +0000 (19:56 +0200)
committerToni Wilen <twilen@winuae.net>
Sun, 12 Jan 2020 17:56:59 +0000 (19:56 +0200)
disasm.cpp

index b36f52fcbc386b6905af3c6b4c5d65c86c249389..77b994ec3e3f72ea4c0b49e1fc3f989056e8e1bb 100644 (file)
@@ -1619,7 +1619,7 @@ uae_u32 m68k_disasm_2 (TCHAR *buf, int bufsize, uaecptr pc, uaecptr *nextpc, int
                struct instr *dp;
                uaecptr oldpc;
                uaecptr m68kpc_illg = 0;
-               bool illegal = false;
+               int illegal = 0;
                int segid, lastsegid;
                TCHAR *symbolpos;
 
@@ -1629,12 +1629,12 @@ uae_u32 m68k_disasm_2 (TCHAR *buf, int bufsize, uaecptr pc, uaecptr *nextpc, int
                extra = get_word_debug (pc + 2);
                if (cpufunctbl[opcode] == op_illg_1 || cpufunctbl[opcode] == op_unimpl_1) {
                        m68kpc_illg = pc + 2;
-                       illegal = TRUE;
+                       illegal = 1;
                }
 
                dp = table68k + opcode;
                if (dp->mnemo == i_ILLG) {
-                       illegal = FALSE;
+                       illegal = 0;
                        opcode = 0x4AFC;
                        dp = table68k + opcode;
                }
@@ -1699,9 +1699,9 @@ uae_u32 m68k_disasm_2 (TCHAR *buf, int bufsize, uaecptr pc, uaecptr *nextpc, int
                        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;
+                       if (lvl < 1 || !(m2cregs[j].flags & (1 << (lvl - 1))))
+                               illegal = -1;
                } else if (lookup->mnemo == i_CHK2) {
                        TCHAR *p;
                        if (!(extra & 0x0800)) {
@@ -2081,8 +2081,8 @@ uae_u32 m68k_disasm_2 (TCHAR *buf, int bufsize, uaecptr pc, uaecptr *nextpc, int
                        buf = buf_out(buf, &bufsize, _T("\n"));
                }
 
-               if (illegal)
-                       pc =  m68kpc_illg;
+               if (illegal > 0)
+                       pc = m68kpc_illg;
        }
        if (nextpc)
                *nextpc = pc;