From f8df4908fe6986e691ea96b4b07ffbff349ccce0 Mon Sep 17 00:00:00 2001 From: alekseiplusplus Date: Thu, 7 Dec 2023 17:34:18 +1100 Subject: changed shift ins.s and now log CPU state --- src/main.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 9e6a5ee..f8b5457 100644 --- a/src/main.c +++ b/src/main.c @@ -2,12 +2,11 @@ #include "video/interface.h" #include #include - +#include "cpu/6502.h" int main() { - AppleOn(); DisplayInit(); @@ -16,11 +15,21 @@ int main() { int Time = 0; while(1) { - // Logging - fprintf(Log, "%04x : %04x\n", Time, PC); - fflush(Log); // Computing CallInstructionTable(); + // Logging + fprintf(Log, + "%04x : %04x : %02x : %02x : %02x : %c%c_%c%c%c%c%c : %02x\n", + Time, PC-idata.length, acc, X, Y, + getFlag(flag_N) ? 'N':'.' , + getFlag(flag_V) ? 'V':'.' , + getFlag(flag_B) ? 'B':'.' , + getFlag(flag_D) ? 'D':'.' , + getFlag(flag_I) ? 'I':'.' , + getFlag(flag_Z) ? 'Z':'.' , + getFlag(flag_C) ? 'C':'.' , + S); + fflush(Log); // Display information PrintInfo(); // Logging -- cgit v1.2.3