mirror of
https://github.com/rkujawa/rk65c02.git
synced 2024-12-23 22:30:01 +00:00
Add functions to dump stack.
Always useful.
This commit is contained in:
parent
442c8dc3df
commit
299b7ee7d8
@ -124,6 +124,27 @@ rk65c02_step(rk65c02emu_t *e, uint16_t steps) {
|
|||||||
e->stopreason = STEPPED;
|
e->stopreason = STEPPED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
rk65c02_dump_stack(rk65c02emu_t *e, uint8_t n)
|
||||||
|
{
|
||||||
|
uint16_t stackaddr;
|
||||||
|
|
||||||
|
stackaddr = STACK_END-n;
|
||||||
|
|
||||||
|
while (stackaddr <= STACK_END) {
|
||||||
|
|
||||||
|
if ((stackaddr == STACK_END-n) || !((stackaddr % 0x10)))
|
||||||
|
printf("stack %#02x: ", stackaddr);
|
||||||
|
|
||||||
|
printf("%#02x ", bus_read_1(e->bus, stackaddr));
|
||||||
|
|
||||||
|
stackaddr++;
|
||||||
|
|
||||||
|
if (!(stackaddr % 0x10))
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
rk65c02_dump_regs(rk65c02emu_t *e)
|
rk65c02_dump_regs(rk65c02emu_t *e)
|
||||||
{
|
{
|
||||||
|
@ -62,6 +62,7 @@ rk65c02emu_t rk65c02_init(bus_t *);
|
|||||||
void rk65c02_start(rk65c02emu_t *);
|
void rk65c02_start(rk65c02emu_t *);
|
||||||
void rk65c02_step(rk65c02emu_t *, uint16_t);
|
void rk65c02_step(rk65c02emu_t *, uint16_t);
|
||||||
void rk65c02_dump_regs(rk65c02emu_t *);
|
void rk65c02_dump_regs(rk65c02emu_t *);
|
||||||
|
void rk65c02_dump_stack(rk65c02emu_t *, uint8_t);
|
||||||
void rk65c02_irq(rk65c02emu_t *e);
|
void rk65c02_irq(rk65c02emu_t *e);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user