latest sdl options and first try of win sdl with new libs

This commit is contained in:
Dagen Brock 2018-03-11 15:10:46 -05:00
parent 3a6d272a50
commit 5c945e8bff
7 changed files with 56 additions and 28 deletions

View File

@ -185,6 +185,7 @@ package-win-sdl:
- cp /bin/cygjbig-2.dll .
- cp /bin/cyglzma-5.dll .
- cp /bin/cygwebp-5.dll .
- cp /cygdrive/c/mingw/bin/SDL2.dll .

View File

@ -22,6 +22,18 @@ git config --global user.email "dagenbrock@gmail.com"
# I also search for and add any SDL2 or FreeType libs just in case.
# UPDATE FOR PROPER SDL2 BUILDS ON WINDOWS!!!
# I used to link the libraries that were installed with all this environment,
# but I had problems with it ever having a working driver. Now we download
# the devel libraries for SDL2 and link to them directly.
# Latest is something like: SDL2-devel-2.0.8-mingw.tar.gz
# Unpack that where CI can see it on the builder, our standard is c:\mingw
# So something like:
tar -xvzf SDL2-devel-2.0.8-mingw.tar.gz
cd SDL2-2.0.8
mkdir /cygdrive/c/mingw
mv x86_64-w64-mingw32/* /cygdrive/c/mingw/
## SOME NOTES ON SETTING UP GITLAB RUNNER TO BUILD ON WINDOWS
## STEP 1 - Install Gitlab Runner

View File

@ -10,9 +10,7 @@
#include "config.h"
#include "glog.h"
#include "imagewriter.h"
#if defined(__OS2__)
#include "arch\os2\src\dirport.h"
#elif defined(_MSC_VER)
#if defined(_MSC_VER)
#include "arch\win32\dirent-win32.h"
#else
#include <dirent.h>
@ -565,7 +563,6 @@ config_init()
void
cfg_exit()
{
/* printf("In cfg exit\n"); */
if(g_rom_version >= 1) {
g_config_control_panel = 0;
}
@ -592,7 +589,7 @@ cfg_text_screen_dump()
int i, j;
filename = "gsplus.screen.dump";
printf("Writing text screen to the file %s\n", filename);
glogf("Writing text screen to the file %s\n", filename);
ofile = fopen(filename, "w");
if(ofile == 0) {
fatal_printf("Could not write to file %s, (%d)\n", filename,
@ -764,8 +761,7 @@ config_parse_option(char *buf, int pos, int len, int line)
*strptr = gsplus_malloc_str(&buf[pos]);
break;
default:
printf("Config file variable %s is unknown type: %d\n",
nameptr, type);
glogf("Config file variable %s is unknown type: %d\n", nameptr, type);
}
}
@ -914,7 +910,7 @@ config_load_roms()
"read %d bytes\n", &g_cfg_tmp_path[0], errno, len, ret);
continue;
}
printf("Read: %d bytes of ROM in slot %d from file %s.\n", ret, i, &g_cfg_tmp_path[0]);
glogf("Read: %d bytes of ROM in slot %d from file %s.\n", ret, i, &g_cfg_tmp_path[0]);
fclose(file);
}
}
@ -1038,18 +1034,6 @@ config_parse_config_gsplus_file()
// not really a fan of that either and think it should be take out.
// Especially now that you can pass a filename.
// #ifndef __OS2__
// if(g_cfg_cwd_str[0] != 0) {
// ret = chdir(&g_cfg_cwd_str[0]);
// if(ret != 0) {
// printf("chdir to %s, errno:%d\n", g_cfg_cwd_str, errno);
// }
// }
// /* In any case, copy the directory path to g_cfg_cwd_str */
// (void)getcwd(&g_cfg_cwd_str[0], CFG_PATH_MAX);
// #endif
fconf = fopen(g_config_gsplus_name, "r");
if(fconf == 0) {
perror("ERROR");
@ -2652,7 +2636,7 @@ cfg_str_match(const char *str1, const char *str2, int len)
void
cfg_file_readdir(const char *pathptr)
{
#ifndef __OS2__
struct dirent *direntptr;
struct stat stat_buf;
DIR *dirptr;
@ -2779,7 +2763,6 @@ cfg_file_readdir(const char *pathptr)
g_cfg_dirlist.curent = i;
}
}
#endif
}
void
@ -3072,7 +3055,6 @@ cfg_file_update_ptr(char *str)
void
cfg_file_selected(int select_dir)
{
#ifndef __OS2__
struct stat stat_buf;
char *str;
int fmt;
@ -3126,7 +3108,6 @@ cfg_file_selected(int select_dir)
}
}
}
#endif
}
void

View File

@ -25,6 +25,12 @@ extern int g_use_bw_hires; // defined in video.c
// Set starting X/Y positions
extern int g_startx; // defined in video.c
extern int g_starty; // defined in video.c
// Use High DPI (Retina) display - SDL2
extern int g_highdpi; // defined in video.c
// Create borderless window - SDL2
extern int g_borderless; // defined in video.c
// Allow window resizing, dragging to scale - SDL2
extern int g_resizeable; // defined in video.c
// Enable Dagen's scanline simulator (SDL2)
extern int g_scanline_simulator; // defined in sim65816.c
// Ethernet (interface?)
@ -87,8 +93,17 @@ int parse_cli_options(int argc, char **argv) {
glogf("%s Halting on bad reads", parse_log_prefix);
g_halt_on_bad_read = 2;
} else if(!strcmp("-fullscreen", argv[i])) {
glogf("%s Starting emulator in fullscreen", parse_log_prefix);
g_fullscreen = 1;
glogf("%s Starting emulator in fullscreen", parse_log_prefix);
g_fullscreen = 1;
} else if(!strcmp("-highdpi", argv[i])) {
glogf("%s Creating window in High DPI mode", parse_log_prefix);
g_highdpi = 1;
} else if(!strcmp("-borderless", argv[i])) {
glogf("%s Creating borderless window", parse_log_prefix);
g_borderless = 1;
} else if(!strcmp("-resizeable", argv[i])) {
glogf("%s Window will be resizeable", parse_log_prefix);
g_resizeable = 1;
} else if(!strcmp("-noignbadacc", argv[i])) {
glogf("%s Not ignoring bad memory accesses", parse_log_prefix);
g_ignore_bad_acc = 0;
@ -254,6 +269,9 @@ void help_exit() {
printf(" -bw Force B/W modes\n");
printf(" -dhr140 Use simple double-hires color map\n");
printf(" -fullscreen Attempt to start emulator in fullscreen\n");
printf(" -highdpi Attempt to open window in high DPI\n");
printf(" -borderless Attempt to create borderless window\n");
printf(" -resizeable Allow you to resize window (non-integral scaling to pixel)\n");
printf(" -mem value Set memory size to value\n");
printf(" -skip value Set skip_amt to value\n");
printf(" -audio value Set audio enable to value\n");

View File

@ -44,6 +44,9 @@ int screenshot_index = 0; // allows us to save time by not scanning from 0 each
char screenshot_filename[256];
extern int g_fullscreen; // only checked at start if set via CLI, otherwise it's set via function call x_full_screen()
extern int g_highdpi;
extern int g_borderless;
extern int g_resizeable;
extern int g_scanline_simulator;
extern int g_startx;
extern int g_starty;
@ -291,6 +294,16 @@ void dev_video_init_sdl() {
if (g_fullscreen) {
more_flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
}
if (g_highdpi) {
more_flags |= SDL_WINDOW_ALLOW_HIGHDPI;
}
if (g_borderless) {
more_flags |= SDL_WINDOW_BORDERLESS;
}
if (g_resizeable) {
more_flags |= SDL_WINDOW_RESIZABLE;
}
window = SDL_CreateWindow(
window_title, // window title (GSport vX.X)

View File

@ -5,8 +5,8 @@ FSTOBJ = win32_host_fst.o
OBJECTS = sdl2_driver.o $(OBJECTS1) $(FSTOBJ) 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
CCOPTS = -O2 -DGSPLUS_LITTLE_ENDIAN -DHAVE_SDL -DWIN_SDL -DTOGGLE_STATUS -I/usr/include/SDL2 -L/cygdrive/c/mingw/lib -I/cygdrive/c/mingw/include/SDL2/
CPPOPTS = -O2 -DGSPLUS_LITTLE_ENDIAN -DHAVE_SDL -DWIN_SDL -DTOGGLE_STATUS -I/usr/include/freetype2 -L/cygdrive/c/mingw/lib -I/cygdrive/c/mingw/include/SDL2/
SUFFIX = ".exe"
EXTRA_LIBS = -Larch/win32 -lSDL2main -lSDL2 -lfreetype -lcomdlg32 -lShlwapi -lIPHlpApi -lcygwin

View File

@ -91,6 +91,9 @@ int g_use_dhr140 = 0;
int g_use_bw_hires = 0;
int g_startx = WINDOWPOS_UNDEFINED;
int g_starty = WINDOWPOS_UNDEFINED;
int g_highdpi = 0;
int g_borderless = 0;
int g_resizeable = 0;
int g_a2_new_all_stat[200];
int g_a2_cur_all_stat[200];