mirror of
https://github.com/rkujawa/rk65c02.git
synced 2024-11-18 21:07:00 +00:00
Preliminary support for stepping.
This commit is contained in:
parent
941e89173a
commit
80b6848108
@ -10,6 +10,8 @@
|
||||
#include "instruction.h"
|
||||
#include "rk65c02.h"
|
||||
|
||||
void rk65c02_exec(rk65c02emu_t *);
|
||||
|
||||
rk65c02emu_t
|
||||
rk65c02_init(bus_t *b)
|
||||
{
|
||||
@ -23,12 +25,11 @@ rk65c02_init(bus_t *b)
|
||||
}
|
||||
|
||||
void
|
||||
rk65c02_start(rk65c02emu_t *e) {
|
||||
rk65c02_exec(rk65c02emu_t *e)
|
||||
{
|
||||
instruction_t i;
|
||||
instrdef_t id;
|
||||
|
||||
e->state = RUNNING;
|
||||
while (e->state == RUNNING) {
|
||||
/* XXX: handle breakpoints and watch points */
|
||||
|
||||
/* if disassembly-when-running enabled */
|
||||
@ -48,6 +49,26 @@ rk65c02_start(rk65c02emu_t *e) {
|
||||
e->stopreason = EMUERROR;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
rk65c02_start(rk65c02emu_t *e) {
|
||||
|
||||
e->state = RUNNING;
|
||||
while (e->state == RUNNING) {
|
||||
rk65c02_exec(e);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
rk65c02_step(rk65c02emu_t *e, uint16_t steps) {
|
||||
|
||||
uint16_t i = 0;
|
||||
|
||||
e->state = STEPPING;
|
||||
while ((e->state == STEPPING) && (i < steps)) {
|
||||
rk65c02_exec(e);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
/*
|
||||
int
|
||||
|
@ -9,10 +9,11 @@ typedef enum {
|
||||
STEPPING /* XXX: how to implement? */
|
||||
} emu_state_t;
|
||||
|
||||
typedef enum
|
||||
typedef enum {
|
||||
STP, /* due to 65C02 STP instruction */
|
||||
BREAKPOINT, /* due to breakpoint set */
|
||||
WATCHPOINT, /* due to watchpoint set */
|
||||
STEPPED, /* stepped appropriate number of instructions */
|
||||
HOST, /* due to host stop function called */
|
||||
EMUERROR /* due to emulator error */
|
||||
} emu_stop_reason_t;
|
||||
@ -56,6 +57,7 @@ typedef struct rk65c02emu rk65c02emu_t;
|
||||
|
||||
rk65c02emu_t rk65c02_init(bus_t *);
|
||||
void rk65c02_start(rk65c02emu_t *);
|
||||
void rk65c02_step(rk65c02emu_t *, uint16_t);
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user