summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
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();