X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fasm6502.c;h=c95e5babd9e8e50cbb9fd0cf3017e173edfbeb18;hp=c3aa2a34ebe102916229f03dc6ead13c5601f0a5;hb=4361b69d3178d7fc98d0388f9a223af6c2651aba;hpb=6f5482d73adb0165c0130bb47d852644ab0c4869 diff --git a/hacks/asm6502.c b/hacks/asm6502.c index c3aa2a34..c95e5bab 100644 --- a/hacks/asm6502.c +++ b/hacks/asm6502.c @@ -20,8 +20,6 @@ I changed the structure of the assembler in this version. */ -#define NDEBUG /* Uncomment when done with debugging */ - #include #include /*#include */ @@ -31,7 +29,14 @@ #include #include #include -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif +#if defined(HAVE_STDINT_H) +# include +#elif defined(HAVE_INTTYPES_H) +# include +#endif #include #include "yarandom.h" @@ -41,7 +46,7 @@ # define random rand #endif*/ -#ifndef USE_IPHONE +#ifndef HAVE_MOBILE # define READ_FILES #endif @@ -1373,8 +1378,10 @@ static BOOL parseDec(char **s, Bit32 *value){ free(dec); return TRUE; } - else + else{ + free(dec); return FALSE; + } } static BOOL parseValue(char **s, Bit32 *value){ @@ -1683,7 +1690,7 @@ static char *fileToBuffer(const char *filename){ if (!buffer) abort(); ifp = fopen(filename, "rb"); - if (!ifp) return 0; + if (!ifp) abort(); while((c = getc(ifp)) != EOF){ buffer[i++] = c; @@ -1874,7 +1881,7 @@ static BOOL translate(m6502_Opcodes *op,Param *param, machine_6502 *machine){ if (op->BRA) { pushByte(machine, op->BRA); { - int diff = abs(param->lbladdr - machine->defaultCodePC); + int diff = abs((int)param->lbladdr - (int)machine->defaultCodePC); int backward = (param->lbladdr < machine->defaultCodePC); pushByte(machine, (backward) ? 0xff - diff : diff - 1); }