mirror of
https://github.com/rkujawa/rk65c02.git
synced 2024-12-13 01:29:57 +00:00
Add struct with info about reason for stopping emulation.
This commit is contained in:
parent
13ef3e2d08
commit
941e89173a
@ -280,6 +280,7 @@ void
|
||||
emul_stp(rk65c02emu_t *e, void *id, instruction_t *i)
|
||||
{
|
||||
e->state = STOPPED;
|
||||
e->stopreason = STP;
|
||||
}
|
||||
|
||||
/* STA - store accumulator */
|
||||
|
@ -45,6 +45,7 @@ rk65c02_start(rk65c02emu_t *e) {
|
||||
printf("unimplemented opcode %X @ %X\n", i.opcode,
|
||||
e->regs.PC);
|
||||
e->state = STOPPED;
|
||||
e->stopreason = EMUERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,9 +6,17 @@
|
||||
typedef enum {
|
||||
STOPPED,
|
||||
RUNNING,
|
||||
STEPPING
|
||||
STEPPING /* XXX: how to implement? */
|
||||
} emu_state_t;
|
||||
|
||||
typedef enum
|
||||
STP, /* due to 65C02 STP instruction */
|
||||
BREAKPOINT, /* due to breakpoint set */
|
||||
WATCHPOINT, /* due to watchpoint set */
|
||||
HOST, /* due to host stop function called */
|
||||
EMUERROR /* due to emulator error */
|
||||
} emu_stop_reason_t;
|
||||
|
||||
struct reg_state {
|
||||
uint8_t A; /* accumulator */
|
||||
uint8_t X; /* index X */
|
||||
@ -41,6 +49,7 @@ struct rk65c02emu {
|
||||
emu_state_t state;
|
||||
bus_t *bus;
|
||||
reg_state_t regs;
|
||||
emu_stop_reason_t stopreason;
|
||||
};
|
||||
|
||||
typedef struct rk65c02emu rk65c02emu_t;
|
||||
|
Loading…
Reference in New Issue
Block a user