Improve CPU_TRACING output

This commit is contained in:
Aaron Culliney 2014-11-09 12:09:13 -08:00
parent 30d7f88c21
commit 2c12aa6112
2 changed files with 7 additions and 3 deletions

View File

@ -746,7 +746,7 @@ GLUE_C_WRITE(cpu65_trace_epilogue)
case addr_absolute_y:
case addr_j_indirect:
case addr_j_indirect_x: /* word arg */
sprintf(fmt, "%04X:%02X%02X%02X %s %s", current_pc, cpu65_opcode, (uint8_t)arg1, (uint8_t)arg2, opcodes_65c02[cpu65_opcode].mnemonic, disasm_templates[opcodes_65c02[cpu65_opcode].mode]);
sprintf(fmt, "%04X:%02X%02X%02X %s %s", current_pc, cpu65_opcode, (uint8_t)arg2, (uint8_t)arg1, opcodes_65c02[cpu65_opcode].mnemonic, disasm_templates[opcodes_65c02[cpu65_opcode].mode]);
sprintf(buf, fmt, (uint8_t)arg1, (uint8_t)arg2);
break;

View File

@ -101,8 +101,8 @@ TEST test_boot_disk_bytes() {
// This test is fairly abusive ... it creates an ~88MB file in $HOME
// ... but if it's correct, you're fairly assured the cpu/vm is working =)
#define EXPECTED_CPU_TRACE_FILE_SIZE 86057107
#define EXPECTED_CPU_TRACE_SHA "525098EDD23E4602791D0167DAE0FB65ACE33ABD"
#define EXPECTED_CPU_TRACE_FILE_SIZE 86057401
#define EXPECTED_CPU_TRACE_SHA "B6154D9DCC39EFD2AA69BEBF981E3024427F5240"
TEST test_boot_disk_cputrace() {
char *homedir = getenv("HOME");
char *output = NULL;
@ -122,6 +122,10 @@ TEST test_boot_disk_cputrace() {
char mdstr[(SHA_DIGEST_LENGTH*2)+1];
FILE *fp = fopen(output, "r");
fseek(fp, 0, SEEK_END);
long expectedSize = ftell(fp);
ASSERT(expectedSize == EXPECTED_CPU_TRACE_FILE_SIZE);
fseek(fp, 0, SEEK_SET);
char *buf = malloc(EXPECTED_CPU_TRACE_FILE_SIZE);
if (fread(buf, 1, EXPECTED_CPU_TRACE_FILE_SIZE, fp) != EXPECTED_CPU_TRACE_FILE_SIZE) {
ASSERT(false);