diff --git a/Makefile b/Makefile index 71155b2..8d171be 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ LDFLAGS += `$(SDL2_CONFIG) --libs` else ifeq ($(TARGET),mingw) CC = x86_64-w64-mingw32-gcc -CFLAGS += -g -Ofast -std=c99 -Wall -Wextra +CFLAGS += -g -Ofast -std=c99 -Wall -Wextra -DWINDOWS LDFLAGS += -lmingw32 -lSDL2main -lSDL2 TARGET_FILE_EXTENSION = .exe else diff --git a/src/bus.c b/src/bus.c index 272496d..41749fd 100644 --- a/src/bus.c +++ b/src/bus.c @@ -30,10 +30,12 @@ extern mouse_t mouse; int bus_io_read(void *user, uint32_t *value, uint32_t port) { (void) user; switch (port) { +#ifndef WINDOWS case 0x00000000: { // serial port *value = serial_get(); break; }; +#endif case 0x80000000 ... 0x8000031F: { // overlay port uint8_t overlay_number = port & 0x000000FF; diff --git a/src/main.c b/src/main.c index 332b172..3b1b58b 100644 --- a/src/main.c +++ b/src/main.c @@ -119,7 +119,9 @@ int main(int argc, char *argv[]) { ScreenDraw(); } +#ifndef WINDOWS serial_init(); +#endif tick_start = SDL_GetTicks(); tick_end = SDL_GetTicks(); diff --git a/src/serial.c b/src/serial.c index 55ab87b..ef80355 100644 --- a/src/serial.c +++ b/src/serial.c @@ -1,6 +1,7 @@ +#include +#ifndef WINDOWS #include #include -#include #include #include #include @@ -50,6 +51,8 @@ int serial_get(void) { return 0; } +#endif + void serial_put(int value) { putchar((int) value); fflush(stdout);