summaryrefslogtreecommitdiff
path: root/debug.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2015-05-28 23:05:32 -0700
committerMichael Pavone <pavone@retrodev.com>2015-05-28 23:05:32 -0700
commitd597043be9f8d1c22ac6a2365e5cbb9f82e7ea46 (patch)
tree131c7ea0f3ec03882bb8183a734f04c757918180 /debug.c
parent391656eca9eb35b7e3937b2af1316460d5639306 (diff)
parent66aedc9c1a87c8811be4dba263dbcd7ec026cc70 (diff)
Merge
Diffstat (limited to 'debug.c')
-rw-r--r--debug.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/debug.c b/debug.c
index e121277..74e076b 100644
--- a/debug.c
+++ b/debug.c
@@ -3,7 +3,9 @@
#include "68kinst.h"
#include <stdlib.h>
#include <string.h>
+#ifndef _WIN32
#include <sys/select.h>
+#endif
#include "render.h"
static bp_def * breakpoints = NULL;
@@ -510,16 +512,21 @@ m68k_context * debugger(m68k_context * context, uint32_t address)
printf("%X: %s\n", address, input_buf);
uint32_t after = address + (after_pc-pc)*2;
int debugging = 1;
+#ifdef _WIN32
+#define prompt 1
+#else
int prompt = 1;
fd_set read_fds;
FD_ZERO(&read_fds);
struct timeval timeout;
+#endif
while (debugging) {
if (prompt) {
fputs(">", stdout);
fflush(stdout);
}
process_events();
+#ifndef _WIN32
timeout.tv_sec = 0;
timeout.tv_usec = 16667;
FD_SET(fileno(stdin), &read_fds);
@@ -529,6 +536,7 @@ m68k_context * debugger(m68k_context * context, uint32_t address)
} else {
prompt = 1;
}
+#endif
if (!fgets(input_buf, sizeof(input_buf), stdin)) {
fputs("fgets failed", stderr);
break;