#include "apple.h" #include "video/interface.h" #include #include "cpu/6502.h" int main() { AppleOn(); DisplayInit(); FILE *Log = fopen("log/log.raw", "w+"); int Time = 0; while(1) { // Computing CallInstructionTable(); // Logging 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':'.' , 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); Time++; } // Display information PrintInfo(); } DisplayClose(); return 0; }