--- hatari/src/uae-cpu/build68k.c 2019/04/01 07:09:16 1.1 +++ hatari/src/uae-cpu/build68k.c 2019/04/01 07:13:48 1.1.1.5 @@ -1,26 +1,28 @@ /* - * UAE - The Un*x Amiga Emulator + * UAE - The Un*x Amiga Emulator - CPU core * * Read 68000 CPU specs from file "table68k" and build table68k.c * * Copyright 1995,1996 Bernd Schmidt + * + * Adaptation to Hatari by Thomas Huth + * + * 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. */ - +const char Build68k_rcsid[] = "Hatari $Id: build68k.c,v 1.1.1.5 2019/04/01 07:13:48 root Exp $"; #include #include +#include -/* -#include "config.h" -#include "options.h" -#include "sysconfig.h" -*/ -#include "sysdeps.h" #include "readcpu.h" + static FILE *tablef; static int nextch = 0; + static void getnextch(void) { do { @@ -60,14 +62,10 @@ int main(int argc, char **argv) { int no_insns = 0; -/* - printf ("#include \"sysconfig.h\"\n"); - printf ("#include \"config.h\"\n"); - printf ("#include \"options.h\"\n"); -*/ + /*printf ("#include \"sysconfig.h\"\n");*/ printf ("#include \"sysdeps.h\"\n"); printf ("#include \"readcpu.h\"\n"); - printf ("struct instr_def defs68k[] = {\n"); + printf ("const struct instr_def defs68k[] = {\n"); #if 0 tablef = fopen("table68k","r"); if (tablef == NULL) { @@ -117,6 +115,7 @@ int main(int argc, char **argv) case 'r': currbit = bitr; break; case 'R': currbit = bitR; break; case 'z': currbit = bitz; break; + case 'p': currbit = bitp; break; default: abort(); } if (!(bitmask & 1)) { @@ -165,6 +164,7 @@ int main(int argc, char **argv) switch(nextch){ case '-': flagset[i] = fa_unset; break; case '/': flagset[i] = fa_isjmp; break; + case '+': flagset[i] = fa_isbranch; break; case '0': flagset[i] = fa_zero; break; case '1': flagset[i] = fa_one; break; case 'x': flagset[i] = fa_dontcare; break; @@ -218,12 +218,12 @@ int main(int argc, char **argv) char *opstrp = opcstr, *osendp; int slen = 0; - while (isspace(*opstrp)) + while (isspace((unsigned)(*opstrp))) opstrp++; osendp = opstrp; while (*osendp) { - if (!isspace (*osendp)) + if (!isspace ((unsigned)(*osendp))) slen = osendp - opstrp + 1; osendp++; }