summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authoralekseiplusplus <alekseijeaves@protonmail.com>2023-12-07 17:34:18 +1100
committeralekseiplusplus <alekseijeaves@protonmail.com>2023-12-07 17:34:18 +1100
commitf8df4908fe6986e691ea96b4b07ffbff349ccce0 (patch)
treea868c23e64fb41bd1e25d3e4f34d738ebd0c549a /src/main.c
parent68cdad3be01539e583627e1c8929f182255541be (diff)
changed shift ins.s and now log CPU state
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c19
1 files changed, 14 insertions, 5 deletions
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 <ncurses.h>
#include <unistd.h>
-
+#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