changeset 745:daa31ee7d8cd

Get windows build compiling again post-merge
author Michael Pavone <pavone@retrodev.com>
date Thu, 28 May 2015 22:31:21 -0700
parents fc68992cf18d
children 9d4d40f833d0
files Makefile debug.c io.c render_sdl.c
diffstat 4 files changed, 26 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Thu May 28 21:19:55 2015 -0700
+++ b/Makefile	Thu May 28 22:31:21 2015 -0700
@@ -9,8 +9,8 @@
 BLASTEM:=blastem.exe
 
 CC:=wine gcc.exe
-CFLAGS:=-O2 -std=gnu99 -Wreturn-type -Werror=return-type -Werror=
-LDFLAGS:= -L"C:/MinGW/usr/lib" -lm -lmingw32 -lSDLmain -lSDL -mwindows
+CFLAGS:=-g -std=gnu99 -Wreturn-type -Werror=return-type -Werror=implicit-function-declaration -I"C:/MinGW/usr/include/SDL2" -DGLEW_STATIC
+LDFLAGS:= -L"C:/MinGW/usr/lib" -lm -lmingw32 -lSDL2main -lSDL2 -lopengl32 -lglu32 -mwindows
 CPU:=i686
 
 else
@@ -63,7 +63,7 @@
 LDFLAGS+= -framework OpenGL
 endif
 
-TRANSOBJS=gen.o backend.o mem.o
+TRANSOBJS=gen.o backend.o $(MEM)
 M68KOBJS=68kinst.o m68k_core.o
 ifeq ($(CPU),x86_64)
 M68KOBJS+= m68k_core_x86.o
@@ -97,7 +97,7 @@
 MAINOBJS+= $(Z80OBJS)
 endif
 
-ifdef WINDOWS
+ifeq ($(OS),Windows)
 MAINOBJS+= glew32s.lib
 endif
 
--- a/debug.c	Thu May 28 21:19:55 2015 -0700
+++ b/debug.c	Thu May 28 22:31:21 2015 -0700
@@ -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 @@
 	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 @@
 		} else {
 			prompt = 1;
 		}
+#endif
 		if (!fgets(input_buf, sizeof(input_buf), stdin)) {
 			fputs("fgets failed", stderr);
 			break;
--- a/io.c	Thu May 28 21:19:55 2015 -0700
+++ b/io.c	Thu May 28 22:31:21 2015 -0700
@@ -3,6 +3,7 @@
  This file is part of BlastEm.
  BlastEm is free software distributed under the terms of the GNU General Public License version 3 or greater. See COPYING for full license text.
 */
+#ifndef _WIN32
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/socket.h>
@@ -10,7 +11,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <errno.h>
+#endif
 #include <string.h>
+#include <stdlib.h>
 
 #include "io.h"
 #include "blastem.h"
@@ -544,7 +547,7 @@
 
 	for (int i = 0; i < 3; i++)
 	{
-
+#ifndef _WIN32
 		if (ports[i].device_type == IO_SEGA_PARALLEL)
 		{
 			char *pipe_name = tern_find_ptr(config, "ioparallel_pipe");
@@ -606,7 +609,9 @@
 				close(ports[i].device.stream.listen_fd);
 				ports[i].device_type = IO_NONE;
 			}
-		} else if (ports[i].device_type == IO_GAMEPAD3 || ports[i].device_type == IO_GAMEPAD6) {
+		} else 
+#endif
+		if (ports[i].device_type == IO_GAMEPAD3 || ports[i].device_type == IO_GAMEPAD6) {
 			printf("IO port %s connected to gamepad #%d with type '%s'\n", io_name(i), ports[i].device.pad.gamepad_num + 1, device_type_names[ports[i].device_type]);
 		} else {
 			printf("IO port %s connected to device '%s'\n", io_name(i), device_type_names[ports[i].device_type]);
@@ -770,6 +775,7 @@
 	}
 }
 
+#ifndef _WIN32
 static void wait_for_connection(io_port * port)
 {
 	if (port->device.stream.data_fd == -1)
@@ -869,6 +875,7 @@
 		}
 	}
 }
+#endif
 
 void io_data_write(io_port * port, uint8_t value, uint32_t current_cycle)
 {
@@ -889,12 +896,14 @@
 		}
 		port->output = value;
 		break;
+#ifndef _WIN32
 	case IO_GENERIC:
 		wait_for_connection(port);
 		port->input[IO_STATE] = IO_WRITE_PENDING;
 		port->output = value;
 		service_socket(port);
 		break;
+#endif
 	default:
 		port->output = value;
 	}
@@ -938,6 +947,7 @@
 		}
 		break;
 	}
+#ifndef _WIN32
 	case IO_SEGA_PARALLEL:
 		if (!th)
 		{
@@ -954,6 +964,7 @@
 		service_socket(port);
 		input = ~port->input[IO_TH0];
 		break;
+#endif
 	default:
 		input = 0;
 		break;
--- a/render_sdl.c	Thu May 28 21:19:55 2015 -0700
+++ b/render_sdl.c	Thu May 28 22:31:21 2015 -0700
@@ -5,6 +5,7 @@
 */
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 #include <math.h>
 #include "render.h"
 #include "blastem.h"