--- hatari/src/debug/68kDisass.c 2019/04/09 08:55:35 1.1.1.6 +++ hatari/src/debug/68kDisass.c 2019/04/09 08:56:48 1.1.1.7 @@ -5,16 +5,16 @@ * or at your option any later version. Read the file gpl.txt for details. ***/ -#include +#include "main.h" #include -#include -#include +#if HAVE_STRINGS_H +# include +#endif -#include "config.h" #include "sysdeps.h" -#include "main.h" #include "configuration.h" #include "newcpu.h" +#include "stMemory.h" #ifdef WINUAE_FOR_HATARI #include "debug.h" #endif @@ -130,11 +130,7 @@ static inline unsigned short Disass68kGe if ( ! valid_address ( addr , 2 ) ) return 0; -#ifndef WINUAE_FOR_HATARI - return get_word(addr); -#else - return get_word_debug(addr); -#endif + return STMemory_ReadWord ( addr ); } // Load a text file into memory, count the lines and replace the LF with 0-bytes. @@ -1733,7 +1729,6 @@ static OpcodeTableStruct OpcodeTable[] = static int Disass68k(long addr, char *labelBuffer, char *opcodeBuffer, char *operandBuffer, char *commentBuffer) { long baseAddr = addr; - int val; int i; int count = 0; char addressLabel[256]; @@ -1834,10 +1829,10 @@ static int Disass68k(long addr, char *la case dtASCString: { - int count = 1; - unsigned short val = Disass68kGetWord(addr+0); + unsigned short opcval = Disass68kGetWord(addr+0); + count = 1; strcpy(opcodeBuffer,"DC.B"); - if((val >> 8) == 0) + if ((opcval >> 8) == 0) { strcat(operandBuffer, "0"); } else { @@ -1874,6 +1869,7 @@ static int Disass68k(long addr, char *la case dtFunctionPointer: { const char *sp; + int val; val = (Disass68kGetWord(addr) << 16) | Disass68kGetWord(addr+2); sp = Disass68kSymbolName(val, 2); strcpy(opcodeBuffer,"DC.L"); @@ -1902,13 +1898,12 @@ more: while(1) { unsigned short opcode[5]; - unsigned int i; OpcodeTableStruct *ots = &OpcodeTable[index++]; int size; char sizeChar = 0; char *dbuf; int ea; - unsigned int maxop; + int maxop; if(ots->opcodeName == NULL) break; @@ -2030,10 +2025,10 @@ more: ea = opcode[0] & 0x3F; dbuf = operandBuffer; - maxop=(sizeof(ots->op)/sizeof(ots->op[0])); + maxop = (int)(sizeof(ots->op)/sizeof(ots->op[0])); for(i=0; iop[i]) {