Replace printf/fprintf with own print_info() / print_error() using SDL_log
[mercenary-reloaded.git] / src / libcpu / execute.c
index 0b53f23..9d3180e 100644 (file)
@@ -20,6 +20,7 @@
 #include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
+#include "../libsdl/print.h"
 #include "execute.h"
 #include "m68k.h"
 #include "m68kcpu.h"
@@ -175,7 +176,7 @@ int execute_cpu(int irq, const struct cpu_stop stop_at[], int *event)
                        /* checking if game does not hit any 'stop_at' break point, give error output */
                        if (instruction_count >= 10000000) {
                                if (instruction_count == 10000000)
-                                       fprintf(stderr, "!!! games seems to got stuck in an endless loop, please fix !!!\n");
+                                       print_error("!!! games seems to got stuck in an endless loop, please fix !!!\n");
                                fprintf(stderr, "program counter at: %06x\n", REG_PC);
                                if (instruction_count == 10000020)
                                        break;
@@ -184,7 +185,7 @@ int execute_cpu(int irq, const struct cpu_stop stop_at[], int *event)
                        for (i = 0; stop_at[i].event; i++) {
                                if (REG_PC == stop_at[i].pc) {
 #ifdef DEBUG_CPU
-                                       printf("execution to address 0x%06x took %d opcodes\n", REG_PC, instruction_count);
+                                       print_error("execution to address 0x%06x took %d opcodes\n", REG_PC, instruction_count);
 #endif
                                        *event = stop_at[i].event;
                                        return cycle_count;