mirror of
https://github.com/cc65/cc65.git
synced 2025-04-08 19:38:55 +00:00
CPU registers can be accessed from outside 6502.c.
The linkage of the 'Regs' variable in 6502.c was changed from static to extern. This makes the Regs type visible (and even alterable) from the outside. This change helps tools to inspect the CPU state. In particular, it was implemented to facilitate a tool that verifies opcode functionality using the '65x02' testsuite. But the change is also potentially useful for e.g. an online debugger that wants to inspect the CPU state while the 6502 is neing simulated.
This commit is contained in:
parent
a53524b9de
commit
86ccf25e81
@ -391,7 +391,7 @@ CPUType CPU;
|
||||
typedef void (*OPFunc) (void);
|
||||
|
||||
/* The CPU registers */
|
||||
static CPURegs Regs;
|
||||
CPURegs Regs;
|
||||
|
||||
/* Cycles for the current insn */
|
||||
static unsigned Cycles;
|
||||
|
@ -65,6 +65,9 @@ struct CPURegs {
|
||||
unsigned PC; /* Program counter */
|
||||
};
|
||||
|
||||
/* Current CPU registers */
|
||||
extern CPURegs Regs;
|
||||
|
||||
/* Status register bits */
|
||||
#define CF 0x01 /* Carry flag */
|
||||
#define ZF 0x02 /* Zero flag */
|
||||
|
Loading…
x
Reference in New Issue
Block a user