Fixes #33 - Trace shows incorrect stack

This commit is contained in:
Stefan Arentz 2016-11-21 22:41:07 -05:00
parent f981835e44
commit a57248f086

2
fmt.c
View File

@ -52,7 +52,7 @@ void cpu_format_stack(struct cpu_t *cpu, char buffer[764]) {
p = strcat(p, " ");
}
char tmp[8];
sprintf(tmp, "%.2X", _mem_get_byte_direct(cpu, 0x0100 + sp));
sprintf(tmp, "%.2X", _mem_get_byte_direct(cpu, 0x0100 + sp + 1));
p = strcat(p, tmp);
}
strcat(p, "]");