From 85f7d8d7dd0637b69023dce380ef63da92f05a0d Mon Sep 17 00:00:00 2001 From: Brad Grantham Date: Mon, 10 Sep 2018 12:29:16 -0700 Subject: [PATCH] update cpu6502 with Jim's improvements --- cpu6502.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cpu6502.h b/cpu6502.h index 3483869..027b3e1 100644 --- a/cpu6502.h +++ b/cpu6502.h @@ -14,6 +14,12 @@ void read(int addr, unsigned char data); */ +#ifndef CPU6502_H +#define CPU6502_H + +#include +#include + template struct CPU6502 { @@ -1468,7 +1474,8 @@ struct CPU6502 default: printf("unhandled instruction %02X at %04X\n", inst, pc - 1); - fflush(stdout); exit(1); + fflush(stdout); + exit(1); } assert(cycles[inst] > 0); clk.add_cpu_cycles(cycles[inst]); @@ -1496,3 +1503,5 @@ int CPU6502::cycles[256] = /* 0xF- */ 2, 5, -1, -1, -1, 4, 6, -1, 2, 4, -1, -1, -1, 4, 7, -1, }; +#endif // CPU6502_H +