From 8968f471650d25c9df68347644e0e5c0ecdbda6e Mon Sep 17 00:00:00 2001 From: alekseiplusplus Date: Fri, 8 Dec 2023 11:48:26 +1100 Subject: minor commit --- src/main.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 801dba7..f1dfada 100644 --- a/src/main.c +++ b/src/main.c @@ -1,6 +1,5 @@ #include "apple.h" #include "video/interface.h" -#include #include #include "cpu/6502.h" @@ -17,8 +16,13 @@ int main() { while(1) { // Computing CallInstructionTable(); + // Logging - fprintf(Log, + if (Time >= 0x2000) + // Stop logging after an arbitrary amount of time, so as to not create a huge file. + fclose(Log); + else { + fprintf(Log, "%04x : %04x : %02x : %02x : %02x : %c%c_%c%c%c%c%c : %02x\n", Time, PC, acc, X, Y, GetFlag(flag_N) ? 'N':'.' , @@ -29,11 +33,12 @@ int main() { GetFlag(flag_Z) ? 'Z':'.' , GetFlag(flag_C) ? 'C':'.' , S); - fflush(Log); + fflush(Log); + Time++; + } + // Display information PrintInfo(); - // Logging - Time++; } DisplayClose(); -- cgit v1.2.3