--- M6502/config.h 2007/07/30 21:53:04 35 +++ M6502/config.h 2008/04/13 00:32:39 195 @@ -1,15 +1,37 @@ -// M6502 options -#define EXEC6502 1 -#define DEBUG 1 - // make perlxsi.c happy EXTERN_C void xs_init (pTHX); -// which module to bootstrap -#define EMU_START "use Arch;" - // do we want to dump our C debug? #define DEBUGF 1 -// do we wont to dump PC? -#define DUMP_K 1 +// do we wont to dump registars? +//#define DUMP_R 1 + +void push_R(void); +void pull_R(void); + +extern int debug; + +#if DEBUGF +#define debugf(x) do { \ + if (debug) { \ + PerlIO_stdoutf("#> "); \ + PerlIO_stdoutf x ; \ + PerlIO_stdoutf("\n"); \ + } \ +} while (0) +#else +#define debugf(x) +#endif + +#if 1 +#define dump_R do { \ + if (debug) { \ + printf("#> PC: %04x A:%02x P:%02x X:%02x Y:%02x S:%02x\n", \ + R->PC.W, R->A, R->P, R->X, R->Y, R->S ); \ + } \ +} while (0) +#else +#define dump_R +#endif +