From 736122276b87c915d773fe7c349f0c61e2972e3b Mon Sep 17 00:00:00 2001 From: sBubshait Date: Mon, 3 Jun 2024 16:14:41 +0100 Subject: [PATCH] Update print to account for unsigned int, w/ T --- src/print.c | 5 +++-- src/print.h | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/print.c b/src/print.c index 874357d..c4e4f6c 100644 --- a/src/print.c +++ b/src/print.c @@ -1,5 +1,6 @@ #include #include +#include #include #include "print.h" #include "emulator.h" @@ -16,9 +17,9 @@ void printState(Machine *state, FILE *stream) { void printRegisters(Machine *state, FILE *stream) { fprintf(stream, "Registers:\n"); for (int i = 0; i < REGISTER_COUNT; i++) { - fprintf(stream, "X%02d\t= %u\n", i, state->registers[i]); + fprintf(stream, "X%02d\t= %" PRIu64 "\n", i, state->registers[i]); } - fprintf(stream, "PC\t= %u\n", state->pc); + fprintf(stream, "PC\t= %" PRIu64 "\n", state->pc); fprintf(stream, "PSTATE\t: %c%c%c%c", state->conditionCodes.Negative ? 'N' : UNSET_CONDITION_CODE_CHAR, state->conditionCodes.Zero ? 'Z' : UNSET_CONDITION_CODE_CHAR, state->conditionCodes.Carry ? 'C' : UNSET_CONDITION_CODE_CHAR, diff --git a/src/print.h b/src/print.h index c84a3ea..404e947 100644 --- a/src/print.h +++ b/src/print.h @@ -1,3 +1,5 @@ +#ifndef __PRINT__ +#define __PRINT__ #include #include "emulator.h" @@ -6,3 +8,5 @@ dword readDoubleWord(byte *memory, uint32_t address); void printState(Machine *state, FILE *stream); void printRegisters(Machine *state, FILE *stream); void printMemory(Machine *state, FILE *stream); + +#endif