diff options
author | alekseiplusplus <alekseijeaves@protonmail.com> | 2023-12-08 11:48:26 +1100 |
---|---|---|
committer | alekseiplusplus <alekseijeaves@protonmail.com> | 2023-12-08 11:48:26 +1100 |
commit | 8968f471650d25c9df68347644e0e5c0ecdbda6e (patch) | |
tree | 2a85cf00b0b1b168a24a1f408d203b5517949a69 /src/main.c | |
parent | d28ad56810b43cb3ea5d11e5e32042f69ee04562 (diff) |
minor commit
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -1,6 +1,5 @@ #include "apple.h" #include "video/interface.h" -#include <ncurses.h> #include <unistd.h> #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(); |