1.1 diff -r 9bb057d009d4 -r 6773a87e27b1 src/main.c 1.2 --- a/src/main.c Sun Nov 28 23:07:49 2010 +0000 1.3 +++ b/src/main.c Sun Nov 28 23:08:06 2010 +0000 1.4 @@ -245,8 +245,11 @@ 1.5 int main(void) 1.6 { 1.7 // copyright banner 1.8 - printf("FreeBee: A Quick-and-Dirty AT&T 3B1 Emulator\n"); 1.9 + printf("FreeBee: A Quick-and-Dirty AT&T 3B1 Emulator. Version %s, %s mode.\n", VER_FULLSTR, VER_BUILD_TYPE); 1.10 printf("Copyright (C) 2010 P. A. Pemberton.\n"); 1.11 + printf("Built %s by %s@%s.\n", VER_COMPILE_DATETIME, VER_COMPILE_BY, VER_COMPILE_HOST); 1.12 + printf("Compiler: %s\n", VER_COMPILER); 1.13 + printf("CFLAGS: %s\n", VER_CFLAGS); 1.14 printf("Musashi M680x0 emulator engine developed by Karl Stenerud <kstenerud@gmail.com>\n"); 1.15 1.16 // set up system state 1.17 @@ -268,7 +271,24 @@ 1.18 // repeat: 1.19 // m68k_execute() 1.20 // m68k_set_irq() every 60ms 1.21 - printf("ran for %d cycles\n", m68k_execute(100000)); 1.22 + int32_t dwTimerTickCounter, dwCpuCycles; 1.23 + const int32_t CLOCKS_PER_TIMER_TICK = 10e6/60; //< number of clocks per 60Hz timer tick 1.24 + 1.25 + // initialise emulation variables 1.26 + dwTimerTickCounter = CLOCKS_PER_TIMER_TICK; 1.27 + bool exitEmu = false; 1.28 + for (;;) { 1.29 + dwCpuCycles = m68k_execute(10e6/60); 1.30 + dwTimerTickCounter -= dwCpuCycles; 1.31 + 1.32 + // check for timer tick expiry 1.33 + if (dwTimerTickCounter <= 0) { 1.34 + // TODO: Timer Tick IRQ 1.35 + 1.36 + } 1.37 + 1.38 + if (exitEmu) break; 1.39 + } 1.40 1.41 // shut down and exit 1.42