--- M6502/M6502.xs 2007/08/01 21:40:17 82 +++ M6502/M6502.xs 2007/08/01 21:46:23 83 @@ -18,6 +18,14 @@ void reset (void) { debugf(("M6502::reset called")); + if ( ! R ) { + debugf(("allocating space for R")); + R = malloc(sizeof(M6502)); + if (!R) { + printf("can't alloc %d bytes for M6502", sizeof(M6502)); + exit(1); + } + } Reset6502(R); dump_R; }