--- hatari/src/uae-cpu/readcpu.c 2019/04/01 07:10:40 1.1.1.3 +++ hatari/src/uae-cpu/readcpu.c 2019/04/09 08:47:24 1.1.1.10 @@ -10,7 +10,13 @@ * This file is distributed under the GNU Public License, version 2 or at * your option any later version. Read the file gpl.txt for details. */ -static char rcsid[] = "Hatari $Id: readcpu.c,v 1.1.1.3 2019/04/01 07:10:40 root Exp $"; + + +/* 2008/04/26 [NP] Handle sz_byte for Areg as a valid srcmode if current instruction is a MOVE */ +/* (e.g. move.b a1,(a0) ($1089)) (fix Blood Money on Superior 65) */ + + +const char ReadCpu_fileid[] = "Hatari readcpu.c : " __DATE__ " " __TIME__; #include #include @@ -19,7 +25,7 @@ static char rcsid[] = "Hatari $Id: readc int nr_cpuop_funcs; -struct mnemolookup lookuptab[] = { +const struct mnemolookup lookuptab[] = { { i_ILLG, "ILLEGAL" }, { i_OR, "OR" }, { i_CHK, "CHK" }, @@ -199,7 +205,7 @@ static void build_insn (int insn) int isjmp = 0; struct instr_def id; const char *opcstr; - int i; + int j; int flaglive = 0, flagdead = 0; @@ -211,27 +217,27 @@ static void build_insn (int insn) can't trap. Usually, this will be overwritten with the gencomp based information, anyway. */ - for (i = 0; i < 5; i++) { - switch (id.flaginfo[i].flagset){ + for (j = 0; j < 5; j++) { + switch (id.flaginfo[j].flagset){ case fa_unset: break; case fa_isjmp: isjmp = 1; break; case fa_isbranch: isjmp = 1; break; - case fa_zero: flagdead |= 1 << i; break; - case fa_one: flagdead |= 1 << i; break; - case fa_dontcare: flagdead |= 1 << i; break; + case fa_zero: flagdead |= 1 << j; break; + case fa_one: flagdead |= 1 << j; break; + case fa_dontcare: flagdead |= 1 << j; break; case fa_unknown: isjmp = 1; flagdead = -1; goto out1; - case fa_set: flagdead |= 1 << i; break; + case fa_set: flagdead |= 1 << j; break; } } out1: - for (i = 0; i < 5; i++) { - switch (id.flaginfo[i].flaguse) { + for (j = 0; j < 5; j++) { + switch (id.flaginfo[j].flaguse) { case fu_unused: break; - case fu_isjmp: isjmp = 1; flaglive |= 1 << i; break; - case fu_maybecc: isjmp = 1; flaglive |= 1 << i; break; - case fu_unknown: isjmp = 1; flaglive |= 1 << i; break; - case fu_used: flaglive |= 1 << i; break; + case fu_isjmp: isjmp = 1; flaglive |= 1 << j; break; + case fu_maybecc: isjmp = 1; flaglive |= 1 << j; break; + case fu_unknown: isjmp = 1; flaglive |= 1 << j; break; + case fu_used: flaglive |= 1 << j; break; } } @@ -292,7 +298,7 @@ static void build_insn (int insn) bitval[bitc] = bitval[bitC]; pos = 0; - while (opcstr[pos] && !isspace(opcstr[pos])) { + while (opcstr[pos] && !isspace((unsigned)opcstr[pos])) { if (opcstr[pos] == '.') { pos++; switch (opcstr[pos]) { @@ -327,7 +333,7 @@ static void build_insn (int insn) mnemonic[mnp] = 0; /* now, we have read the mnemonic and the size */ - while (opcstr[pos] && isspace(opcstr[pos])) + while (opcstr[pos] && isspace((unsigned)opcstr[pos])) pos++; /* A goto a day keeps the D******a away. */ @@ -521,7 +527,8 @@ static void build_insn (int insn) { srcgather = 0; } - if (srcmode == Areg && sz == sz_byte) +// if (srcmode == Areg && sz == sz_byte) + if (srcmode == Areg && sz == sz_byte && strcmp ( mnemonic , "MOVE" ) != 0 ) // [NP] move.b is valid on 68000 goto nomatch; if (opcstr[pos] != ',')