Update print to account for unsigned int, w/ T
This commit is contained in:
parent
14733b9660
commit
736122276b
@ -1,5 +1,6 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <inttypes.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "print.h"
|
#include "print.h"
|
||||||
#include "emulator.h"
|
#include "emulator.h"
|
||||||
@ -16,9 +17,9 @@ void printState(Machine *state, FILE *stream) {
|
|||||||
void printRegisters(Machine *state, FILE *stream) {
|
void printRegisters(Machine *state, FILE *stream) {
|
||||||
fprintf(stream, "Registers:\n");
|
fprintf(stream, "Registers:\n");
|
||||||
for (int i = 0; i < REGISTER_COUNT; i++) {
|
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,
|
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.Zero ? 'Z' : UNSET_CONDITION_CODE_CHAR,
|
||||||
state->conditionCodes.Carry ? 'C' : UNSET_CONDITION_CODE_CHAR,
|
state->conditionCodes.Carry ? 'C' : UNSET_CONDITION_CODE_CHAR,
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
#ifndef __PRINT__
|
||||||
|
#define __PRINT__
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "emulator.h"
|
#include "emulator.h"
|
||||||
|
|
||||||
@ -6,3 +8,5 @@ dword readDoubleWord(byte *memory, uint32_t address);
|
|||||||
void printState(Machine *state, FILE *stream);
|
void printState(Machine *state, FILE *stream);
|
||||||
void printRegisters(Machine *state, FILE *stream);
|
void printRegisters(Machine *state, FILE *stream);
|
||||||
void printMemory(Machine *state, FILE *stream);
|
void printMemory(Machine *state, FILE *stream);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user