Fix assertion on $af register and add more debug output to asserts

This commit is contained in:
2018-06-17 10:49:52 -07:00
parent a4df6411ca
commit 0a3340f4fc

View File

@@ -254,11 +254,14 @@ static void help(char *arg_list)
static int64_t parse_reg_str(const char *str)
{
int i;
uint8_t f = (cpu.nf << CPU_F_BIT_POS_N) | (cpu.zf << CPU_F_BIT_POS_Z) |
(cpu.cf << CPU_F_BIT_POS_C) | (cpu.hf << CPU_F_BIT_POS_H);
const struct {
const char *str;
int64_t value;
} entries[] = {
//{ "af", cpu,af },
{ "af", (cpu.a << 8) | f },
{ "bc", cpu.bc },
{ "de", cpu.de },
{ "sp", cpu.sp },
@@ -349,6 +352,8 @@ static void assert(char *arg_list)
fail:
printf("ASSERT: %s %s %s\n", val0_str, operator_str, val1_str);
printf("%s=%ld, %s=%ld\n", val0_str, val0, val1_str, val1);
regs(NULL);
stats(NULL);
exit(1);
}