summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authoralekseiplusplus <alekseijeaves@protonmail.com>2023-12-08 11:48:26 +1100
committeralekseiplusplus <alekseijeaves@protonmail.com>2023-12-08 11:48:26 +1100
commit8968f471650d25c9df68347644e0e5c0ecdbda6e (patch)
tree2a85cf00b0b1b168a24a1f408d203b5517949a69 /src/main.c
parentd28ad56810b43cb3ea5d11e5e32042f69ee04562 (diff)
minor commit
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c15
1 files changed, 10 insertions, 5 deletions
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 <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();