From 0c21e1a072273d007dd5215a560c34f41720c891 Mon Sep 17 00:00:00 2001 From: Dagen Brock Date: Tue, 18 Oct 2016 22:01:19 -0700 Subject: [PATCH] Windows SDL version (builds, not functioning) --- .gitlab-ci.yml | 33 ++++++++++++++++++++++++++++++++- src/Makefile | 19 +++++++++++++++++-- src/config.c | 4 ++-- src/sdl2_driver.c | 4 ++-- src/sim65816.c | 4 ++-- src/vars_win32 | 4 ++-- src/vars_win32_sdl | 13 ++++++++----- 7 files changed, 65 insertions(+), 16 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6403a1e..8934b6c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -73,13 +73,44 @@ build-win32: - make artifacts: paths: - - gsplus.exe + - gsplus32.exe expire_in: 5 minutes package-win32: tags: - windows stage: package + artifacts: + paths: + - gsplus32.exe + + + + + + +build-win-sdl: + tags: + - windows + stage: build + script: + - cd src + - ln -s vars_win32_sdl vars + - make clean + - make artifacts: paths: - gsplus.exe + expire_in: 5 minutes + +package-win-sdl: + tags: + - windows + stage: package + artifacts: + paths: + - gsplus.exe + + + + diff --git a/src/Makefile b/src/Makefile index f5d8484..70748ad 100644 --- a/src/Makefile +++ b/src/Makefile @@ -52,8 +52,8 @@ gsplusfb: $(OBJECTS) compile_time.o mv gsplusfb .. cp -f ../config.template ../config.txt -# Mingw32 (native windows) / Cygwin builds: -gsplus.exe: $(OBJECTS) compile_time.o +# Mingw32 / Cygwin builds: The Win32 API version +gsplus32.exe: $(OBJECTS) compile_time.o g++ $(CCOPTS) $(LDOPTS) $(OBJECTS) compile_time.o $(LDFLAGS) -o $(NAME)$(SUFFIX) $(EXTRA_LIBS) -lwinmm -lgdi32 -ldsound -lcomctl32 -lws2_32 -lshell32 #mkdir -p ../GSplus.app/lib #cp -f gsplus.exe ../GSplus.app/GSplus.exe @@ -64,6 +64,21 @@ gsplus.exe: $(OBJECTS) compile_time.o #cp -f GSplus.bat ../GSplus.app/GSplus.bat #cp -f parallel.rom ../GSplus.app #cp -f ../COPYING.txt ../GSplus.app + cp gsplus32.exe .. + +# Mingw32 / Cygwin builds: The SDL version (builds, but non-functioning) +gsplus.exe: $(OBJECTS) compile_time.o + #g++ $(CCOPTS) $(LDOPTS) $(OBJECTS) compile_time.o $(LDFLAGS) -o $(NAME)$(SUFFIX) $(EXTRA_LIBS) -lwinmm -lgdi32 -ldsound -lcomctl32 -lws2_32 -lshell32 + g++ $(CCOPTS) $(LDOPTS) $(OBJECTS) compile_time.o $(LDFLAGS) -o $(NAME)$(SUFFIX) $(EXTRA_LIBS) -lSDLmain -mwindows + #mkdir -p ../GSplus.app/lib + #cp -f gsplus.exe ../GSplus.app/GSplus.exe + #cp -f ../config.template ../GSplus.app/config.txt + #cp -f ../lib/*.ttf ../GSplus.app/lib + #cp -f ../lib/arch/win32/*.dll ../GSplus.app + #cp -f ../lib/NoBoot.po ../GSplus.app + #cp -f GSplus.bat ../GSplus.app/GSplus.bat + #cp -f parallel.rom ../GSplus.app + #cp -f ../COPYING.txt ../GSplus.app cp gsplus.exe .. # NOT CURRENTLY SUPPORTED diff --git a/src/config.c b/src/config.c index 6d8768d..29e5c05 100644 --- a/src/config.c +++ b/src/config.c @@ -110,7 +110,7 @@ extern char* g_imagewriter_prop_font; extern int g_imagewriter_paper; extern int g_imagewriter_banner; -#if defined(_WIN32) || defined(__CYGWIN__) +#if defined(_WIN32) || defined(__CYGWIN__) && !defined(WIN_SDL) extern int g_win_show_console_request; extern int g_win_status_debug_request; #endif @@ -348,7 +348,7 @@ Cfg_menu g_cfg_imagewriter_menu[] = { Cfg_menu g_cfg_devel_menu[] = { { "Developer Options", g_cfg_devel_menu, 0, 0, CFGTYPE_MENU }, -#if defined(_WIN32) || defined(__CYGWIN__) +#if defined(_WIN32) || defined(__CYGWIN__) && !defined(WIN_SDL) { "Status lines,0,Hide,1,Show", KNMP(g_win_status_debug_request), CFGTYPE_INT }, { "Console,0,Hide,1,Show", KNMP(g_win_show_console_request), CFGTYPE_INT }, #endif diff --git a/src/sdl2_driver.c b/src/sdl2_driver.c index 1f87e7c..2fac409 100644 --- a/src/sdl2_driver.c +++ b/src/sdl2_driver.c @@ -21,8 +21,7 @@ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// @todo: mouse clip bugs.. great western shootout. Paint 8/16 - +// @todo: mouse clip bugs.. great western shootout. Paint 8/16. still in win32 #include "SDL.h" #include #include @@ -178,6 +177,7 @@ int a2_key_to_sdlkeycode[][3] = { { -1, -1, -1 } }; + int main(int argc, char **argv) { diff --git a/src/sim65816.c b/src/sim65816.c index d2010c0..612e8bb 100644 --- a/src/sim65816.c +++ b/src/sim65816.c @@ -37,7 +37,7 @@ extern const char *g_config_gsplus_name_list[]; #include "tfe/protos_tfe.h" #endif -#if defined (_WIN32) || defined(__CYGWIN__) +#if defined (_WIN32) || defined(__CYGWIN__) && !defined(WIN_SDL) #define WIN32_LEAN_AND_MEAN /* Tell windows we want less header gunk */ #define STRICT /* Tell Windows we want compile type checks */ #include /* Need a definition for LPTSTR in CYGWIN */ @@ -1246,7 +1246,7 @@ gsport_expand_path(char *out_ptr, const char *in_ptr, int maxlen) if(!strncmp("0", name_buf, 128)) { /* Replace ${0} with g_argv0_path */ tmp_ptr = &(g_argv0_path[0]); -#if defined (_WIN32) || defined(__CYGWIN__) +#if defined (_WIN32) || defined(__CYGWIN__) && !defined(WIN_SDL) } else if(!strncmp("PWD", name_buf, 128)) { /* Replace ${PWD} with cwd in Windows */ get_cwd(out_ptr,128); diff --git a/src/vars_win32 b/src/vars_win32 index 75d2c36..00c3684 100644 --- a/src/vars_win32 +++ b/src/vars_win32 @@ -1,11 +1,11 @@ -TARGET = gsplus.exe +TARGET = gsplus32.exe OBJECTS = $(OBJECTS1) $(TFEOBJ) $(ATOBJ) $(PCAPOBJ) scc_windriver.o win32snd_driver.o win_console.o win_generic.o gsplus32.o CCOPTS = -O2 -DGSPLUS_LITTLE_ENDIAN -DHAVE_TFE -DWIN_SOUND -DTOGGLE_STATUS -DWIN32 -D_WIN32 -D__USE_W32_SOCKETS -D_WINSOCK2API_ -std=gnu99 -DHAVE_ATBRIDGE CPPOPTS = -O2 -DGSPLUS_LITTLE_ENDIAN -DHAVE_TFE -DTOGGLE_STATUS -DWIN32 -D_WIN32 -D__USE_W32_SOCKETS -D_WINSOCK2API_ -DHAVE_ATBRIDGE SUFFIX = ".exe" -NAME = gsplus +NAME = gsplus32 EXTRA_LIBS = -Larch/win32 -lcomdlg32 -lShlwapi -lIPHlpApi XOPTS = -Wall -fomit-frame-pointer -march=i686 diff --git a/src/vars_win32_sdl b/src/vars_win32_sdl index b84737b..ba7ecfc 100644 --- a/src/vars_win32_sdl +++ b/src/vars_win32_sdl @@ -1,11 +1,14 @@ TARGET = gsplus.exe -OBJECTS = $(OBJECTS1) $(TFEOBJ) $(ATOBJ) $(PCAPOBJ) scc_windriver.o sdl2snd_driver.o win_console.o win_generic.o gsplus32.o -CCOPTS = -O2 -DGSPLUS_LITTLE_ENDIAN -DHAVE_TFE -DHAVE_SDL -DTOGGLE_STATUS -DWIN32 -D_WIN32 -D__USE_W32_SOCKETS -D_WINSOCK2API_ -std=gnu99 -DHAVE_ATBRIDGE -I/usr/include/SDL2 -CPPOPTS = -O2 -DGSPLUS_LITTLE_ENDIAN -DHAVE_TFE -DHAVE_SDL -DTOGGLE_STATUS -DWIN32 -D_WIN32 -D__USE_W32_SOCKETS -D_WINSOCK2API_ -DHAVE_ATBRIDGE -I /usr/include/freetype2 -I/usr/include/SDL2 +NAME = gsplus +OBJECTS = sdl2_driver.o $(OBJECTS1) sdl2snd_driver.o + +CCOPTS = -O2 -DGSPLUS_LITTLE_ENDIAN -DHAVE_SDL -DWIN_SDL -DTOGGLE_STATUS -I/usr/include/SDL2 +CPPOPTS = -O2 -DGSPLUS_LITTLE_ENDIAN -DHAVE_SDL -DWIN_SDL -DTOGGLE_STATUS -I /usr/include/freetype2 -I/usr/include/SDL2 SUFFIX = ".exe" -NAME = gsplus -EXTRA_LIBS = -Larch/win32 -lSDL2 -lfreetype -lcomdlg32 -lShlwapi -lIPHlpApi +EXTRA_LIBS = -Larch/win32 -lSDL2main -lSDL2 -lfreetype -lcomdlg32 -lShlwapi -lIPHlpApi -lcygwin +EXTRA_LIBS = -L/usr/local/lib -lcygwin -lSDL2main -lSDL2 -mwindows -lfreetype -lcomdlg32 -lShlwapi -lIPHlpApi -L/usr/lib -lpthread + XOPTS = -Wall -fomit-frame-pointer -march=i686 XLIBS =