diff -r src/emu/e6809.c vecx-SDL2-master/src/emu/e6809.c 5c5 < #include "vecx.h" // for dat FLAGS --- > 195d194 < GLOBAL_vecx->F[CPU->reg_pc] |= F_OPERAND; 1117d1115 < GLOBAL_vecx->F[CPU->reg_pc-1] |= F_OPCODE; // pc_read8 has marked it as an operand and incremented PC. Undo. diff -r src/emu/vecx.c vecx-SDL2-master/src/emu/vecx.c 13,14d12 < struct vecx *GLOBAL_vecx = NULL; // for saving dat file on quit. < 188d185 < /* This is where the main vecx data structure in initialised. Add initialisation for our extra fields here. */ 191,201d187 < { < int addr; < GLOBAL_vecx = vecx; // because it is not passed to anywhere useful when we intercept 'Quit' < for (addr = 0; addr <= 0xFFFF; addr++) { < vecx->F[addr] = 0; // mark the ways in which ram/rom addresses are used. < vecx->DP[addr] = 0x100; // Note the value of DP when executing code at this address. 100 is unassigned 200 is more than one value seen. < vecx->IndexBase[addr] = 0; // When loading table,x for any address, save the value of 'table' for this address. < vecx->Index[addr] = 0; // When loading table,x for any address, save the value of 'x' for this address. < } < } < diff -r src/emu/vecx.h vecx-SDL2-master/src/emu/vecx.h 51,64d50 < #define DatVersion 0x1000 /* to ensure dat file compatibility - change whenever the format changes*/ < typedef uint32_t FLAGS; // 32 for now, may extend to 64 later if needed. < // Classify accesses < #define F_OPCODE 1 /* First byte of an opcode+operand */ < #define F_OPERAND 2 /* Second and later bytes of opcode+operand */ < #define F_DATA 4 /* fetched as data (eg 'LDA') */ < #define F_DATA_LO 8 /* low byte of a double-byte fetch */ < #define F_DATA_HI 16 /* high byte of a double-byte fetch */ < #define F_CALL_TARGET 32 < #define F_JUMP_TARGET 64 < #define F_RETURN_TARGET 128 < #define F_ILLEGAL 256 /* was fetched as an opcode or operand but did not decode correctly */ < #define F_DATA_INDEXED 512 /* fetched as data using an indexed instruction. May be part of a table. */ < #define F_ADDRESS 1024 /* Not merely a 16-bit value but definitely one that points to code or data */ 66c52 < typedef struct vecx --- > typedef struct 77,81d62 < FLAGS F[0x10000]; // mark the ways in which ram/rom addresses are used. < uint16_t DP[0x10000]; // Note the value of DP when executing code at this address. 100 is unassigned 200 is more than one value seen. < uint16_t IndexBase[0x10000]; // When loading table,x for any address, save the value of 'table' for this address. < uint16_t Index[0x10000]; // When loading table,x for any address, save the value of 'x' for this address. < 92,93d72 < < extern struct vecx *GLOBAL_vecx; // for saving dat file on quit. diff -r src/main.c vecx-SDL2-master/src/main.c 247c247 < if (SDL_Init(SDL_INIT_VIDEO /* | SDL_INIT_AUDIO */) < 0) // turn off sound while developing --- > if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) 284,317d283 < // Write the disassembly file < { < int i, dup; < FILE *dat; < char *datfile = malloc(strlen(cart_filename)+16); < sprintf(datfile, "%s.inf", cart_filename); < dat = fopen(datfile, "w"); < if (dat == NULL) { < sprintf(datfile, "%s", tmpnam(NULL)); < dat = fopen(datfile, "w"); < if (dat == NULL) { < fprintf(stderr, "ERROR: vecx cannot open %s.inf OR %s to save dat information\n", cart_filename, datfile); < exit(1); < } < fprintf(stderr, "WARNING: vecx cannot open %s.inf to save dat information - saving to %s instead\n", cart_filename, datfile); < } < fprintf(dat, "V %X C %s\n", DatVersion, cart_filename); < for (i = 0; i <= 0xFFFF; i++) { < fprintf(dat, "%04X F %X ", i, GLOBAL_vecx->F[i]); // mark the ways in which ram/rom addresses are used. < fprintf(dat, "D %X ", GLOBAL_vecx->DP[i]); // Note the value of DP when executing code at this address. 100 is unassigned 200 is more than one value seen. < fprintf(dat, "B %X ", GLOBAL_vecx->IndexBase[i]); // When loading table,x for any address, save the value of 'table' for this address. < fprintf(dat, "I %X", GLOBAL_vecx->Index[i]); // When loading table,x for any address, save the value of 'x' for this address. < dup = 0; < while ((i < 0xFFFF) < && (GLOBAL_vecx->F[i] == GLOBAL_vecx->F[i+1]) < && (GLOBAL_vecx->DP[i] == GLOBAL_vecx->DP[i+1]) < && (GLOBAL_vecx->IndexBase[i] == GLOBAL_vecx->IndexBase[i+1]) < && (GLOBAL_vecx->Index[i] == GLOBAL_vecx->Index[i+1])) { < dup += 1; i += 1; < } < fprintf(dat, " %d\n", dup); < } < } < diff -r src/ser.c vecx-SDL2-master/src/ser.c 5,9c5,9 < #include "emu/e6522.h" < #include "emu/e6809.h" < #include "emu/e8910.h" < #include "emu/edac.h" < #include "emu/vecx.h" --- > #include "emu\e6522.h" > #include "emu\e6809.h" > #include "emu\e8910.h" > #include "emu\edac.h" > #include "emu\vecx.h"