Applied PCem patch #d12b9ef.

Applied PCem patch #ef2c34c.
Updated vidapi to enable/disable the renderers on resize (patch from 86Box.)
Re-worked the D2D renderer to actually work when dynloaded.
Some more changes to the VNC renderer.  Not done yet, the library is horrible.
Updated the Travis work files to allow for downloadable dependencies.
This commit is contained in:
waltje
2019-04-30 04:14:13 -05:00
parent bbab8fecd7
commit 2e079b67a3
14 changed files with 409 additions and 283 deletions

View File

@@ -9,7 +9,7 @@
# #
# Build script for the Travis CI remote builder service. # Build script for the Travis CI remote builder service.
# #
# Version: @(#).travis-build.sh 1.0.6 2019/04/27 # Version: @(#).travis-build.sh 1.0.7 2019/04/30
# #
# Author: Fred N. van Kempen, <decwiz@yahoo.com> # Author: Fred N. van Kempen, <decwiz@yahoo.com>
# #
@@ -45,6 +45,9 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Define the build options here.
OPTS=D2D=d SDL=d VNC=d PNG=d
if [ "x${DEV_BUILD}" = "xy" ]; then if [ "x${DEV_BUILD}" = "xy" ]; then
TARGET="win-${TRAVIS_BUILD_NUMBER}_dev-x86" TARGET="win-${TRAVIS_BUILD_NUMBER}_dev-x86"
elif [ "x${DEBUG}" = "xy" ]; then elif [ "x${DEBUG}" = "xy" ]; then
@@ -54,21 +57,26 @@
else else
TARGET="win-${TRAVIS_BUILD_NUMBER}-x86" TARGET="win-${TRAVIS_BUILD_NUMBER}-x86"
fi fi
echo "Building VARCem, build #${TRAVIS_BUILD_NUMBER} target ${TARGET}"
cd src
# We only need the first few characters of the commit ID. # We only need the first few characters of the commit ID.
export COMMIT=${TRAVIS_COMMIT::7} export COMMIT=${TRAVIS_COMMIT::7}
echo "Downloading VARCem build dependencies.."
curl -# ${EXTDEP_URL} | tar xzf - 2>/dev/null
# Build the project. # Build the project.
make -f win/mingw/Makefile.MinGW BUILD=${TRAVIS_BUILD_NUMBER} echo "Building VARCem, build #${TRAVIS_BUILD_NUMBER} target ${TARGET}"
cd src
make -f win/mingw/Makefile.MinGW ${OPTS} BUILD=${TRAVIS_BUILD_NUMBER}
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo "Build failed, not uploading." echo "Build failed, not uploading."
exit 1 exit 1
fi fi
# Package the results so we can upload them.
echo "Build #${TRAVIS_BUILD_NUMBER} OK, packing up." echo "Build #${TRAVIS_BUILD_NUMBER} OK, packing up."
zip -9 ../${TARGET}.zip *.exe zip -9 ../${TARGET}.zip *.exe

View File

@@ -9,7 +9,7 @@
# #
# Deployment script for the Travis CI remote builder service. # Deployment script for the Travis CI remote builder service.
# #
# Version: @(#).travis-deploy.sh 1.0.4 2019/04/27 # Version: @(#).travis-deploy.sh 1.0.5 2019/04/30
# #
# Author: Fred N. van Kempen, <decwiz@yahoo.com> # Author: Fred N. van Kempen, <decwiz@yahoo.com>
# #
@@ -62,17 +62,16 @@
BTYPE=regular BTYPE=regular
fi fi
# We only need the first few characters of the commit ID.
export COMMIT=${TRAVIS_COMMIT::7}
if [ ! -f ${TARGET}.zip ]; then if [ ! -f ${TARGET}.zip ]; then
echo "Target file ${TARGET}.zip not found, giving up." echo "Target file ${TARGET}.zip not found, giving up."
exit 1 exit 1
fi fi
# We only need the first few characters of the commit ID.
export COMMIT=${TRAVIS_COMMIT::7}
echo "Uploading VARCem build #${TRAVIS_BUILD_NUMBER} target ${TARGET}" echo "Uploading VARCem build #${TRAVIS_BUILD_NUMBER} target ${TARGET}"
curl -# -X POST \ curl -# -X POST \
-F "type=${BTYPE}" \ -F "type=${BTYPE}" \
-F "build=${TRAVIS_BUILD_NUMBER}" \ -F "build=${TRAVIS_BUILD_NUMBER}" \

View File

@@ -8,7 +8,7 @@
* *
* x86 CPU segment emulation. * x86 CPU segment emulation.
* *
* Version: @(#)x86seg.c 1.0.6 2019/04/20 * Version: @(#)x86seg.c 1.0.7 2019/04/29
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -456,8 +456,10 @@ void loadseg(uint16_t seg, x86seg *s)
s->access = (3 << 5) | 2 | 0x80; s->access = (3 << 5) | 2 | 0x80;
s->base = seg << 4; s->base = seg << 4;
s->seg = seg; s->seg = seg;
#if 0
if (s == &_ss) if (s == &_ss)
set_stack32(0); set_stack32(0);
#endif
s->checked = 1; s->checked = 1;
#ifdef USE_DYNAREC #ifdef USE_DYNAREC
if (s == &_ds) if (s == &_ds)

View File

@@ -8,7 +8,7 @@
* *
* Define the various platform support functions. * Define the various platform support functions.
* *
* Version: @(#)plat.h 1.0.24 2019/04/26 * Version: @(#)plat.h 1.0.25 2019/04/29
* *
* Author: Fred N. van Kempen, <decwiz@yahoo.com> * Author: Fred N. van Kempen, <decwiz@yahoo.com>
* *
@@ -125,6 +125,7 @@ typedef struct {
void (*reset)(int fs); void (*reset)(int fs);
void (*resize)(int x, int y); void (*resize)(int x, int y);
int (*pause)(void); int (*pause)(void);
void (*enable)(int yes);
void (*screenshot)(const wchar_t *fn); void (*screenshot)(const wchar_t *fn);
int (*is_available)(void); int (*is_available)(void);
} vidapi_t; } vidapi_t;

View File

@@ -8,7 +8,7 @@
* *
* Define the various UI functions. * Define the various UI functions.
* *
* Version: @(#)ui.h 1.0.17 2019/04/26 * Version: @(#)ui.h 1.0.18 2019/04/29
* *
* Author: Fred N. van Kempen, <decwiz@yahoo.com> * Author: Fred N. van Kempen, <decwiz@yahoo.com>
* *
@@ -201,6 +201,7 @@ extern const char *vidapi_getname(int api);
extern int vidapi_set(int api); extern int vidapi_set(int api);
extern void vidapi_resize(int x, int y); extern void vidapi_resize(int x, int y);
extern int vidapi_pause(void); extern int vidapi_pause(void);
extern void vidapi_enable(int yes);
extern void vidapi_reset(void); extern void vidapi_reset(void);
extern void vidapi_screenshot(void); extern void vidapi_screenshot(void);
extern void plat_startblit(void); extern void plat_startblit(void);

View File

@@ -8,7 +8,7 @@
* *
* Handle the various video renderer modules. * Handle the various video renderer modules.
* *
* Version: @(#)ui_vidapi.c 1.0.5 2019/03/07 * Version: @(#)ui_vidapi.c 1.0.6 2019/04/29
* *
* Author: Fred N. van Kempen, <decwiz@yahoo.com> * Author: Fred N. van Kempen, <decwiz@yahoo.com>
* *
@@ -181,6 +181,25 @@ vidapi_pause(void)
} }
void
vidapi_enable(int yes)
{
/* If not defined, assume not needed. */
if (plat_vidapis[vid_api]->enable == NULL) return;
/* Lock the blitter. */
plat_startblit();
/* Wait for it to be ours. */
video_blit_wait();
plat_vidapis[vid_api]->enable(yes);
/* Release the blitter. */
plat_endblit();
}
void void
vidapi_reset(void) vidapi_reset(void)
{ {

View File

@@ -10,7 +10,7 @@
* *
* TODO: Implement screenshots, and Audio Redirection. * TODO: Implement screenshots, and Audio Redirection.
* *
* Version: @(#)vnc.c 1.0.10 2019/04/28 * Version: @(#)vnc.c 1.0.11 2019/04/29
* *
* Author: Fred N. van Kempen, <decwiz@yahoo.com> * Author: Fred N. van Kempen, <decwiz@yahoo.com>
* Based on raw code by RichardG, <richardg867@gmail.com> * Based on raw code by RichardG, <richardg867@gmail.com>
@@ -464,11 +464,10 @@ const vidapi_t vnc_vidapi = {
"vnc", "vnc",
"VNC", "VNC",
0, 0,
vnc_init, vnc_init, vnc_close, NULL,
vnc_close,
NULL,
vnc_resize, vnc_resize,
vnc_pause, vnc_pause,
NULL,
vnc_screenshot, vnc_screenshot,
vnc_available vnc_available
}; };

View File

@@ -8,7 +8,7 @@
# #
# Makefile for Windows systems using the MinGW32 environment. # Makefile for Windows systems using the MinGW32 environment.
# #
# Version: @(#)Makefile.mingw 1.0.83 2019/04/28 # Version: @(#)Makefile.mingw 1.0.84 2019/04/29
# #
# Author: Fred N. van Kempen, <decwiz@yahoo.com> # Author: Fred N. van Kempen, <decwiz@yahoo.com>
# #
@@ -359,11 +359,11 @@ ifneq ($(VNS), n)
ifeq ($(VNS_PATH), ) ifeq ($(VNS_PATH), )
VNS_PATH := $(EXT_PATH)/vns VNS_PATH := $(EXT_PATH)/vns
endif endif
OPTS += -I$(VNS_PATH)/include/mingw -I$(VNS_PATH)/include OPTS += -I$(VNS_PATH)/include
ifeq ($(X64), y) ifeq ($(X64), y)
LIBS += -L$(VNS_PATH)/lib/mingw/x64 LIBS += -L$(VNS_PATH)/lib/x64
else else
LIBS += -L$(VNS_PATH)/lib/mingw/x86 LIBS += -L$(VNS_PATH)/lib/x86
endif endif
ifeq ($(VNS), y) ifeq ($(VNS), y)
LIBS += -lvns.dll LIBS += -lvns.dll
@@ -414,11 +414,11 @@ ifneq ($(SDL), n)
ifeq ($(SDL_PATH), ) ifeq ($(SDL_PATH), )
SDL_PATH := $(EXT_PATH)/sdl SDL_PATH := $(EXT_PATH)/sdl
endif endif
OPTS += -I$(SDL_PATH)/include/mingw -I$(SDL_PATH)/include OPTS += -I$(SDL_PATH)/include
ifeq ($(X64), y) ifeq ($(X64), y)
LIBS += -L$(SDL_PATH)/lib/mingw/x64 LIBS += -L$(SDL_PATH)/lib/x64
else else
LIBS += -L$(SDL_PATH)/lib/mingw/x86 LIBS += -L$(SDL_PATH)/lib/x86
endif endif
ifeq ($(SDL), y) ifeq ($(SDL), y)
LIBS += -lsdl2.dll LIBS += -lsdl2.dll
@@ -440,11 +440,11 @@ ifneq ($(D2D), n)
OPTS += -DUSE_D2D=1 OPTS += -DUSE_D2D=1
endif endif
ifneq ($(D2D_PATH), ) ifneq ($(D2D_PATH), )
OPTS += -I$(D2D_PATH)/include/mingw -I$(D2D_PATH)/include OPTS += -I$(D2D_PATH)/include
ifeq ($(X64), y) ifeq ($(X64), y)
LOPTS += -L$(D2D_PATH)/lib/mingw/x64 LOPTS += -L$(D2D_PATH)/lib/x64
else else
LOPTS += -L$(D2D_PATH)/lib/mingw/x86 LOPTS += -L$(D2D_PATH)/lib/x86
endif endif
endif endif
ifeq ($(D2D), y) ifeq ($(D2D), y)
@@ -487,6 +487,7 @@ ifndef VNC
VNC := n VNC := n
endif endif
ifneq ($(VNC), n) ifneq ($(VNC), n)
ZLIB := (VNC)
ifeq ($(VNC), d) ifeq ($(VNC), d)
OPTS += -DUSE_VNC=2 OPTS += -DUSE_VNC=2
else else
@@ -495,7 +496,7 @@ ifneq ($(VNC), n)
ifeq ($(VNC_PATH), ) ifeq ($(VNC_PATH), )
VNC_PATH := $(EXT_PATH)/vnc VNC_PATH := $(EXT_PATH)/vnc
endif endif
OPTS += -I$(VNC_PATH)/include/mingw -I$(VNC_PATH)/include OPTS += -I$(VNC_PATH)/include
ifeq ($(X64), y) ifeq ($(X64), y)
LIBS += -L$(VNC_PATH)/lib/x64 LIBS += -L$(VNC_PATH)/lib/x64
else else
@@ -523,7 +524,7 @@ ifneq ($(RDP), n)
ifeq ($(RDP_PATH), ) ifeq ($(RDP_PATH), )
RDP_PATH := $(EXT_PATH)/rdp RDP_PATH := $(EXT_PATH)/rdp
endif endif
OPTS += -I$(RDP_PATH)/include/mingw -I$(RDP_PATH)/include OPTS += -I$(RDP_PATH)/include
ifeq ($(X64), y) ifeq ($(X64), y)
LIBS += -L$(RDP_PATH)/lib/x64 LIBS += -L$(RDP_PATH)/lib/x64
else else
@@ -543,6 +544,7 @@ ifndef PNG
PNG := n PNG := n
endif endif
ifneq ($(PNG), n) ifneq ($(PNG), n)
ZLIB := $(PNG)
ifeq ($(PNG), d) ifeq ($(PNG), d)
OPTS += -DUSE_LIBPNG=2 OPTS += -DUSE_LIBPNG=2
else else
@@ -551,7 +553,7 @@ ifneq ($(PNG), n)
ifeq ($(PNG_PATH), ) ifeq ($(PNG_PATH), )
PNG_PATH := $(EXT_PATH)/png PNG_PATH := $(EXT_PATH)/png
endif endif
OPTS += -I$(PNG_PATH)/include/mingw -I$(PNG_PATH)/include OPTS += -I$(PNG_PATH)/include
ifeq ($(X64), y) ifeq ($(X64), y)
LIBS += -L$(PNG_PATH)/lib/x64 LIBS += -L$(PNG_PATH)/lib/x64
else else
@@ -567,6 +569,33 @@ ifneq ($(PNG), n)
MISCOBJ += png.o MISCOBJ += png.o
endif endif
# ZLIB: N=no, Y=yes,linked, D=yes,dynamic, S=yes,static
ifndef ZLIB
ZLIB := n
endif
ifneq ($(ZLIB), n)
ifeq ($(ZLIB), d)
OPTS += -DUSE_ZLIB=2
else
OPTS += -DUSE_ZLIB=1
endif
ifeq ($(ZLIB_PATH), )
ZLIB_PATH := $(EXT_PATH)/zlib
endif
OPTS += -I$(ZLIB_PATH)/include
ifeq ($(X64), y)
LIBS += -L$(ZLIB_PATH)/lib/x64
else
LIBS += -L$(ZLIB_PATH)/lib/x86
endif
ifeq ($(ZLIB), y)
LIBS += -lz
endif
ifeq ($(ZLIB), s)
LIBS += -lz_static
endif
endif
# WX: N=no, Y=yes,linked, D=yes,dynamic, S=yes,static # WX: N=no, Y=yes,linked, D=yes,dynamic, S=yes,static
ifneq ($(WX), n) ifneq ($(WX), n)
OPTS += -DUSE_WX=$(WX) $(WX_FLAGS) OPTS += -DUSE_WX=$(WX) $(WX_FLAGS)

View File

@@ -8,7 +8,7 @@
# #
# Makefile for Windows using Visual Studio 2015. # Makefile for Windows using Visual Studio 2015.
# #
# Version: @(#)Makefile.VC 1.0.67 2019/04/28 # Version: @(#)Makefile.VC 1.0.68 2019/04/29
# #
# Author: Fred N. van Kempen, <decwiz@yahoo.com> # Author: Fred N. van Kempen, <decwiz@yahoo.com>
# #
@@ -55,159 +55,10 @@ ifndef EXTRAS
EXTRAS := EXTRAS :=
endif endif
# Defaults for several build options (possibly defined in a chained file.) # Defaults for several build options (possibly defined in a chained file.)
ifndef AUTODEP
AUTODEP := n
endif
ifndef CRASHDUMP
CRASHDUMP := n
endif
ifndef DEBUG
DEBUG := n
endif
ifndef LOGGING
LOGGING := n
endif
ifndef PROFILER
PROFILER := n
endif
ifndef OPTIM
OPTIM := n
endif
ifndef RELEASE
RELEASE := n
endif
ifndef X64
X64 := n
endif
ifndef ARM
ARM := n
endif
ifndef ARM64
ARM64 := n
endif
ifndef DYNAREC
DYNAREC := y
ifeq ($(ARM), y)
DYNAREC := n
endif
ifeq ($(ARM64), y)
DYNAREC := n
endif
endif
ifndef WX ifndef WX
WX := n WX := n
endif endif
ifndef USB
USB := n
endif
ifndef VNS
VNS := n
endif
ifndef SDL
SDL := n
endif
ifndef D2D
D2D := n
endif
ifndef VNC
VNC := n
endif
ifndef RDP
RDP := n
endif
ifndef PNG
PNG := n
endif
ifndef DEV_BUILD
DEV_BUILD := n
endif
ifndef DEV_BRANCH
DEV_BRANCH := n
endif
ifndef AMD_K
AMD_K := n
endif
ifndef SIS471
SIS471 := n
endif
ifndef SIS496
SIS496 := n
endif
ifndef COMPAQ
COMPAQ := n
endif
ifndef MICRAL
MICRAL := n
endif
ifndef SUPERSPORT
SUPERSPORT := n
endif
ifndef DINPUT
DINPUT := y
ifeq ($(ARM), y)
DINPUT := n
endif
endif
ifndef D3DX
D3DX := y
ifeq ($(ARM), y)
D3DX := n
endif
ifeq ($(ARM64), y)
D3DX := n
endif
endif
ifndef OPENAL
OPENAL := y
endif
ifndef FLUIDSYNTH
FLUIDSYNTH := y
endif
ifndef MUNT
MUNT := y
endif
ifndef PAS16
PAS16 := n
endif
ifndef GUSMAX
GUSMAX := n
endif
ifndef XL24
XL24 := n
endif
ifndef WONDER
WONDER := n
endif
ifndef PRINTER
PRINTER := n
endif
ifndef HOSTCD
HOSTCD := n
endif
ifndef CASSETTE
CASSETTE := n
endif
# Name of the executable.
NETIF := pcap_if
ifndef PROG
ifneq ($(WX), n)
PROG := WxVARCem
else
PROG := VARCem
endif
endif
ifeq ($(DEBUG), y)
PROG := $(PROG)-d
NETIF := $(NETIF)-d
LOGGING := y
else
ifeq ($(LOGGING), y)
PROG := $(PROG)-l
endif
endif
# Which modules to include a development build. # Which modules to include a development build.
@@ -230,6 +81,12 @@ ifeq ($(DEV_BUILD), y)
endif endif
# What is the location of our external dependencies?
ifeq ($(EXT_PATH), )
EXT_PATH := ../external
endif
# WxWidgets basic info. Extract using the config program. # WxWidgets basic info. Extract using the config program.
ifneq ($(WX), n) ifneq ($(WX), n)
EXPATH += wx EXPATH += wx
@@ -282,6 +139,28 @@ VPATH := $(EXPATH) . cpu \
machines ui win machines ui win
#
# Name of the executable.
#
NETIF := pcap_if
ifndef PROG
ifneq ($(WX), n)
PROG := WxVARCem
else
PROG := VARCem
endif
endif
ifeq ($(DEBUG), y)
PROG := $(PROG)-d
NETIF := $(NETIF)-d
LOGGING := y
else
ifeq ($(LOGGING), y)
PROG := $(PROG)-l
endif
endif
# #
# Select the required build environment. # Select the required build environment.
# #
@@ -328,6 +207,9 @@ else
LOPTS_C := -SUBSYSTEM:CONSOLE,5.01 LOPTS_C := -SUBSYSTEM:CONSOLE,5.01
LOPTS_W := -SUBSYSTEM:WINDOWS,5.01 LOPTS_W := -SUBSYSTEM:WINDOWS,5.01
endif endif
# Add general build options from the environment.
ifdef BUILD ifdef BUILD
OPTS += -DBUILD=$(BUILD) OPTS += -DBUILD=$(BUILD)
endif endif
@@ -385,25 +267,24 @@ else
CGOPS := codegen_ops_x86.h CGOPS := codegen_ops_x86.h
VCG := vid_voodoo_codegen_x86.h VCG := vid_voodoo_codegen_x86.h
endif endif
LIBS := ddraw.lib dxguid.lib d3d9.lib version.lib winmm.lib LIBS := ddraw.lib dxguid.lib d3d9.lib version.lib winmm.lib \
ifeq ($(DINPUT), y) comctl32.lib comdlg32.lib advapi32.lib gdi32.lib \
LIBS += dinput8.lib
else
LIBS += xinput.lib
endif
ifeq ($(D3DX), y)
LIBS += d3dx9.lib
endif
LIBS += comctl32.lib comdlg32.lib advapi32.lib gdi32.lib \
shell32.lib user32.lib shell32.lib user32.lib
LIBS += ws2_32.lib wsock32.lib iphlpapi.lib psapi.lib
ifeq ($(DEBUG), y)
LIBS += libcmtd.lib libvcruntimed.lib libucrtd.lib
endif
# Optional modules. # Optional modules.
MISCOBJ := MISCOBJ :=
# Dynamic Recompiler (compiled-in)
ifndef DYNAREC
DYNAREC := y
ifeq ($(ARM), y)
DYNAREC := n
endif
ifeq ($(ARM64), y)
DYNAREC := n
endif
endif
ifeq ($(DYNAREC), y) ifeq ($(DYNAREC), y)
OPTS += -DUSE_DYNAREC OPTS += -DUSE_DYNAREC
RFLAGS += -DUSE_DYNAREC RFLAGS += -DUSE_DYNAREC
@@ -415,20 +296,51 @@ ifeq ($(DYNAREC), y)
codegen_timing_winchip.obj $(PLATCG) codegen_timing_winchip.obj $(PLATCG)
endif endif
ifeq ($(VNS), y) # VNS: N=no, Y=yes,linked, D=yes,dynamic, S=yes,static
ifndef VNS
VNS := n
endif
ifneq ($(VNS), n)
OPTS += -DUSE_VNS OPTS += -DUSE_VNS
ifeq ($(VNS_PATH), )
VNS_PATH := $(EXT_PATH)/vns
endif
OPTS += -I$(VNS_PATH)/include
ifeq ($(X64), y)
LIBS += -LIBPATH:$(VNS_PATH)/lib/x64
else
LIBS += -LIBPATH:$(VNS_PATH)/lib/x86
endif
ifeq ($(VNS), y)
LIBS += libvns.lib
endif
ifeq ($(VNS), s)
LIBS += libvns_static.lib
endif
MISCOBJ += net_vns.obj MISCOBJ += net_vns.obj
endif endif
# OpenAL (always dynamic)
ifndef OPENAL
OPENAL := y
endif
ifeq ($(OPENAL), y) ifeq ($(OPENAL), y)
OPTS += -DUSE_OPENAL OPTS += -DUSE_OPENAL
endif endif
# FluidSynth (always dynamic)
ifndef FLUIDSYNTH
FLUIDSYNTH := y
endif
ifeq ($(FLUIDSYNTH), y) ifeq ($(FLUIDSYNTH), y)
OPTS += -DUSE_FLUIDSYNTH OPTS += -DUSE_FLUIDSYNTH
MISCOBJ += midi_fluidsynth.obj MISCOBJ += midi_fluidsynth.obj
endif endif
# MunT (compiled-in)
ifndef MUNT
MUNT := y
endif
ifeq ($(MUNT), y) ifeq ($(MUNT), y)
OPTS += -DUSE_MUNT OPTS += -DUSE_MUNT
MISCOBJ += midi_mt32.obj \ MISCOBJ += midi_mt32.obj \
@@ -440,24 +352,34 @@ ifeq ($(MUNT), y)
TVA.obj TVF.obj TVP.obj sha1.obj c_interface.obj TVA.obj TVF.obj TVP.obj sha1.obj c_interface.obj
endif endif
# N=no, Y=yes,linked, D=yes,dynamic, S=yes,static # SDL: N=no, Y=yes,linked, D=yes,dynamic, S=yes,static
ifndef SDL
SDL := n
endif
ifneq ($(SDL), n) ifneq ($(SDL), n)
OPTS += -DUSE_SDL OPTS += -DUSE_SDL
ifneq ($(SDL_PATH), ) ifeq ($(SDL_PATH), )
OPTS += -I$(SDL_PATH)/include/msvc -I$(SDL_PATH)/include SDL_PATH := $(EXT_PATH)/sdl
ifeq ($(X64), y) endif
LOPTS += -LIBPATH:$(SDL_PATH)\lib\msvc\x64 OPTS += -I$(SDL_PATH)/include
else ifeq ($(X64), y)
LOPTS += -LIBPATH:$(SDL_PATH)\lib\msvc\x86 LIBS += -LIBPATH:$(SDL_PATH)/lib/x64
endif else
LIBS += -LIBPATH:$(SDL_PATH)/lib/x86
endif endif
ifeq ($(SDL), y) ifeq ($(SDL), y)
LIBS += sdl2.lib LIBS += sdl2.lib
endif endif
ifeq ($(SDL), s)
LIBS += sdl2_static.lib
endif
SDLOBJ := win_sdl.obj SDLOBJ := win_sdl.obj
endif endif
# N=no, Y=yes,linked, D=yes,dynamic, S=yes,static # D2D: N=no, Y=yes,linked, D=yes,dynamic
ifndef D2D
D2D := n
endif
ifneq ($(D2D), n) ifneq ($(D2D), n)
ifeq ($(D2D), d) ifeq ($(D2D), d)
OPTS += -DUSE_D2D=2 OPTS += -DUSE_D2D=2
@@ -465,11 +387,11 @@ ifneq ($(D2D), n)
OPTS += -DUSE_D2D=1 OPTS += -DUSE_D2D=1
endif endif
ifneq ($(D2D_PATH), ) ifneq ($(D2D_PATH), )
OPTS += -I$(D2D_PATH)/include/msvc -I$(D2D_PATH)/include OPTS += -I$(D2D_PATH)/include
ifeq ($(X64), y) ifeq ($(X64), y)
LOPTS += -LIBPATH:$(D2D_PATH)\lib\msvc\x64 LOPTS += -LIBPATH:$(D2D_PATH)/lib/x64
else else
LOPTS += -LIBPATH:$(D2D_PATH)\lib\msvc\x86 LOPTS += -LIBPATH:$(D2D_PATH)/lib/x86
endif endif
endif endif
ifeq ($(D2D), y) ifeq ($(D2D), y)
@@ -478,73 +400,123 @@ ifneq ($(D2D), n)
D2DOBJ := win_d2d.obj D2DOBJ := win_d2d.obj
endif endif
# D3DX (always hard-linked)
ifndef D3DX
D3DX := y
ifeq ($(ARM), y)
D3DX := n
endif
ifeq ($(ARM64), y)
D3DX := n
endif
endif
ifeq ($(D3DX), y) ifeq ($(D3DX), y)
OPTS += -DUSE_D3DX OPTS += -DUSE_D3DX
LIBS += d3dx9.lib
endif endif
# DINPUT and XInput (always hard-linked)
ifndef DINPUT
DINPUT := y
ifeq ($(ARM), y)
DINPUT := n
endif
endif
ifeq ($(DINPUT), y) ifeq ($(DINPUT), y)
OPTS += -DUSE_DINPUT OPTS += -DUSE_DINPUT
LIBS += dinput8.lib
else
LIBS += xinput.lib
endif endif
# N=no, Y=yes,linked, D=yes,dynamic, S=yes,static # VNC: N=no, Y=yes,linked, D=yes,dynamic, S=yes,static
ifndef VNC
VNC := n
endif
ifneq ($(VNC), n) ifneq ($(VNC), n)
OPTS += -DUSE_VNC ifeq ($(VNC), d)
ifneq ($(VNC_PATH), ) OPTS += -DUSE_VNC=2
OPTS += -I$(VNC_PATH)/include/msvc -I$(VNC_PATH)/include else
ifeq ($(X64), y) OPTS += -DUSE_VNC=1
LOPTS += -LIBPATH:$(VNC_PATH)\lib\x64 endif
else ifeq ($(VNC_PATH), )
LOPTS += -LIBPATH:$(VNC_PATH)\lib\x86 VNC_PATH := $(EXT_PATH)/vnc
endif endif
OPTS += -I$(VNC_PATH)/include
ifeq ($(X64), y)
LIBS += -LIBPATH:$(VNC_PATH)/lib/x64
else
LIBS += -LIBPATH:$(VNC_PATH)/lib/x86
endif endif
ifeq ($(VNC), y) ifeq ($(VNC), y)
LIBS += libvncserver.lib LIBS += libvncserver.lib
endif endif
ifeq ($(VNC), s)
LIBS += libvncserver_static.lib zlib.lib
endif
MISCOBJ += vnc.obj vnc_keymap.obj MISCOBJ += vnc.obj vnc_keymap.obj
endif endif
# N=no, Y=yes,linked, D=yes,dynamic, S=yes,static # RDP: N=no, Y=yes,linked, D=yes,dynamic, S=yes,static
ifndef RDP
RDP := n
endif
ifneq ($(RDP), n) ifneq ($(RDP), n)
OPTS += -DUSE_RDP ifeq ($(RDP), d)
ifneq ($(RDP_PATH), ) OPTS += -DUSE_RDP=2
OPTS += -I$(RDP_PATH)/include/msvc -I$(RDP_PATH)/include else
ifeq ($(X64), y) OPTS += -DUSE_RDP=1
LOPTS += -LIBPATH:$(RDP_PATH)\lib\x64 endif
else ifeq ($(RDP_PATH), )
LOPTS += -LIBPATH:$(RDP_PATH)\lib\x86 RDP_PATH := $(EXT_PATH)/rdp
endif endif
OPTS += -I$(RDP_PATH)/include
ifeq ($(X64), y)
LIBS += -LIBPATH:$(RDP_PATH)/lib/x64
else
LIBS += -LIBPATH:$(RDP_PATH)/lib/x86
endif endif
ifeq ($(RDP), y) ifeq ($(RDP), y)
LIBS += rdpsrvr.lib LIBS += rdpsrvr.lib
endif endif
ifeq ($(RDP), s)
LIBS += rdpsrvr_static.lib
endif
MISCOBJ += rdp.obj MISCOBJ += rdp.obj
endif endif
# N=no, Y=yes,linked, D=yes,dynamic, S=yes,static # PNG: N=no, Y=yes,linked, D=yes,dynamic, S=yes,static
ifndef PNG
PNG := n
endif
ifneq ($(PNG), n) ifneq ($(PNG), n)
ifeq ($(PNG), d) ifeq ($(PNG), d)
OPTS += -DUSE_LIBPNG=2 OPTS += -DUSE_LIBPNG=2
else else
OPTS += -DUSE_LIBPNG=1 OPTS += -DUSE_LIBPNG=1
endif endif
ifneq ($(PNG_PATH), ) ifeq ($(PNG_PATH), )
OPTS += -I$(PNG_PATH)/include/msvc -I$(PNG_PATH)/include PNG_PATH := $(EXT_PATH)/png
ifeq ($(X64), y) endif
LOPTS += -LIBPATH:$(PNG_PATH)\lib\x64 OPTS += -I$(PNG_PATH)/include
else ifeq ($(X64), y)
LOPTS += -LIBPATH:$(PNG_PATH)\lib\x86 LIBS += -LIBPATH:$(PNG_PATH)/lib/x64
endif else
LIBS += -LIBPATH:$(PNG_PATH)/lib/x86
endif endif
ifeq ($(PNG), y) ifeq ($(PNG), y)
LIBS += libpng16_dll.lib #zlib.lib LIBS += libpng16_dll.lib #zlib.lib
endif endif
ifeq ($(PNG), s)
LIBS += libpng16.lib zlib.lib
endif
MISCOBJ += png.obj MISCOBJ += png.obj
endif endif
# N=no, Y=yes,linked, D=yes,dynamic, S=yes,static # WX: N=no, Y=yes,linked, D=yes,dynamic, S=yes,static
ifneq ($(WX), n) ifneq ($(WX), n)
OPTS += -DUSE_WX $(WX_FLAGS) OPTS += -DUSE_WX=$(WX) $(WX_FLAGS)
LIBS += $(WX_LIBS) -lm LIBS += $(WX_LIBS)
UIOBJ := wx_main.obj wx_ui.obj wx_stbar.obj wx_render.obj UIOBJ := wx_main.obj wx_ui.obj wx_stbar.obj wx_render.obj
else else
UIOBJ := win_ui.obj \ UIOBJ := win_ui.obj \
@@ -629,6 +601,13 @@ ifeq ($(DEV_BRANCH), y)
endif endif
# Finalize the list of libraries to load.
LIBS += ws2_32.lib wsock32.lib iphlpapi.lib psapi.lib
ifeq ($(DEBUG), y)
LIBS += libcmtd.lib libvcruntimed.lib libucrtd.lib
endif
# Final versions of the toolchain flags. # Final versions of the toolchain flags.
LDFLAGS := $(LOPTS) LDFLAGS := $(LOPTS)
CFLAGS := $(WX_FLAGS) $(OPTS) $(COPTS) $(COPTIM) $(DOPTS) $(AFLAGS) CFLAGS := $(WX_FLAGS) $(OPTS) $(COPTS) $(COPTIM) $(DOPTS) $(AFLAGS)

View File

@@ -8,10 +8,7 @@
* *
* Rendering module for Microsoft Direct2D. * Rendering module for Microsoft Direct2D.
* *
* **NOTE** This module currently does not work when compiled using * Version: @(#)win_d2d.cpp 1.0.6 2019/04/29
* the GCC compiler (MinGW) and when used in dynamic mode.
*
* Version: @(#)win_d2d.cpp 1.0.5 2019/04/28
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* David Hrdlicka, <hrdlickadavid@outlook.com> * David Hrdlicka, <hrdlickadavid@outlook.com>
@@ -68,10 +65,8 @@
/* Pointers to the real functions. */ /* Pointers to the real functions. */
static HRESULT (*D2D1_CreateFactory)(D2D1_FACTORY_TYPE facType, typedef HRESULT (WINAPI *MyCreateFactory_t)(D2D1_FACTORY_TYPE, REFIID, CONST D2D1_FACTORY_OPTIONS*, void**);
REFIID riid, static MyCreateFactory_t D2D1_CreateFactory;
CONST D2D1_FACTORY_OPTIONS *pFacOptions,
void **ppIFactory);
static const dllimp_t d2d_imports[] = { static const dllimp_t d2d_imports[] = {
{ "D2D1CreateFactory", &D2D1_CreateFactory }, { "D2D1CreateFactory", &D2D1_CreateFactory },
@@ -92,6 +87,7 @@ static ID2D1Bitmap *d2d_bitmap;
static int d2d_width, d2d_height, static int d2d_width, d2d_height,
d2d_screen_width, d2d_screen_height, d2d_screen_width, d2d_screen_height,
d2d_fs; d2d_fs;
static int d2d_enabled;
static void static void
@@ -199,6 +195,11 @@ d2d_blit(bitmap_t *scr, int x, int y, int y1, int y2, int w, int h)
DEBUG("D2D: blit(x=%d, y=%d, y1=%d, y2=%d, w=%d, h=%d)\n", x,y, y1,y2, w,h); DEBUG("D2D: blit(x=%d, y=%d, y1=%d, y2=%d, w=%d, h=%d)\n", x,y, y1,y2, w,h);
if (! d2d_enabled) {
video_blit_done();
return;
}
// TODO: Detect double scanned mode and resize render target // TODO: Detect double scanned mode and resize render target
// appropriately for more clear picture // appropriately for more clear picture
if (w != d2d_width || h != d2d_height) { if (w != d2d_width || h != d2d_height) {
@@ -333,6 +334,8 @@ d2d_close(void)
d2d_handle = NULL; d2d_handle = NULL;
} }
#endif #endif
d2d_enabled = 0;
} }
@@ -341,7 +344,8 @@ d2d_init(int fs)
{ {
WCHAR title[200]; WCHAR title[200];
D2D1_HWND_RENDER_TARGET_PROPERTIES props; D2D1_HWND_RENDER_TARGET_PROPERTIES props;
HRESULT hr = S_OK; D2D1_FACTORY_OPTIONS options;
HRESULT hr;
INFO("D2D: init(fs=%d)\n", fs); INFO("D2D: init(fs=%d)\n", fs);
@@ -356,6 +360,16 @@ d2d_init(int fs)
INFO("D2D: module '%s' loaded.\n", PATH_D2D_DLL); INFO("D2D: module '%s' loaded.\n", PATH_D2D_DLL);
#endif #endif
ZeroMemory(&options, sizeof(D2D1_FACTORY_OPTIONS));
if (FAILED(DLLFUNC(CreateFactory)(D2D1_FACTORY_TYPE_MULTI_THREADED,
__uuidof(ID2D1Factory),
&options,
reinterpret_cast <void **>(&d2d_factory)))) {
ERRLOG("D2D: unable to load factory, D2D not available.\n");
d2d_close();
return(0);
}
if (fs) { if (fs) {
/* /*
* Direct2D seems to lack any proper fullscreen mode, * Direct2D seems to lack any proper fullscreen mode,
@@ -391,31 +405,24 @@ d2d_init(int fs)
props = D2D1::HwndRenderTargetProperties(hwndRender); props = D2D1::HwndRenderTargetProperties(hwndRender);
} }
hr = DLLFUNC(CreateFactory)(D2D1_FACTORY_TYPE_MULTI_THREADED,
__uuidof(ID2D1Factory),
NULL,
reinterpret_cast <void **>(&d2d_factory));
if (FAILED(hr)) {
ERRLOG("D2D: unable to load factory, D2D not available.\n");
d2d_close();
return(0);
}
hr = d2d_factory->CreateHwndRenderTarget(D2D1::RenderTargetProperties(), hr = d2d_factory->CreateHwndRenderTarget(D2D1::RenderTargetProperties(),
props, &d2d_hwndRT); props, &d2d_hwndRT);
if (SUCCEEDED(hr)) {
// Create a bitmap for storing intermediate data
hr = d2d_hwndRT->CreateBitmap(D2D1::SizeU(2048, 2048),
D2D1::BitmapProperties(D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE)),
&d2d_bitmap);
}
if (FAILED(hr)) { if (FAILED(hr)) {
ERRLOG("D2D: init: error 0x%08lx\n", hr); ERRLOG("D2D: unable to create target: error 0x%08lx\n", hr);
d2d_close(); d2d_close();
return(0); return(0);
} }
// Create a bitmap for storing intermediate data
hr = d2d_hwndRT->CreateBitmap(D2D1::SizeU(2048, 2048),
D2D1::BitmapProperties(D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE)),
&d2d_bitmap);
if (FAILED(hr)) {
ERRLOG("D2D: unable to create bitmap: error 0x%08lx\n", hr);
d2d_close();
return(0);
}
d2d_fs = fs; d2d_fs = fs;
d2d_width = 0; d2d_width = 0;
d2d_height = 0; d2d_height = 0;
@@ -426,6 +433,8 @@ d2d_init(int fs)
/* Register our renderer! */ /* Register our renderer! */
video_blit_set(d2d_blit); video_blit_set(d2d_blit);
d2d_enabled = 1;
return(1); return(1);
} }
@@ -456,15 +465,21 @@ d2d_available(void)
} }
static void
d2d_enable(int yes)
{
d2d_enabled = yes;
}
const vidapi_t d2d_vidapi = { const vidapi_t d2d_vidapi = {
"d2d", "d2d",
"Direct 2D", "Direct 2D",
1, 1,
d2d_init, d2d_init, d2d_close, NULL,
d2d_close,
NULL,
NULL, NULL,
NULL, NULL,
d2d_enable,
d2d_screenshot, d2d_screenshot,
d2d_available d2d_available
}; };

View File

@@ -8,7 +8,7 @@
* *
* Rendering module for Microsoft Direct3D 9. * Rendering module for Microsoft Direct3D 9.
* *
* Version: @(#)win_d3d.cpp 1.0.16 2019/04/07 * Version: @(#)win_d3d.cpp 1.0.17 2019/04/29
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -69,6 +69,7 @@ static HWND d3d_hwnd;
static HWND d3d_device_window; static HWND d3d_device_window;
static int d3d_w, static int d3d_w,
d3d_h; d3d_h;
static int is_enabled;
static CUSTOMVERTEX d3d_verts[] = { static CUSTOMVERTEX d3d_verts[] = {
{ 0.0f, 0.0f, 1.0f, 1.0f, 0xffffff, 0.0f, 0.0f}, { 0.0f, 0.0f, 1.0f, 1.0f, 0xffffff, 0.0f, 0.0f},
@@ -193,6 +194,11 @@ d3d_blit_fs(bitmap_t *scr, int x, int y, int y1, int y2, int w, int h)
int yy; int yy;
double l = 0, t = 0, r = 0, b = 0; double l = 0, t = 0, r = 0, b = 0;
if (! is_enabled) {
video_blit_done();
return;
}
if ((y1 == y2) || (h <= 0)) { if ((y1 == y2) || (h <= 0)) {
video_blit_done(); video_blit_done();
return; /*Nothing to do*/ return; /*Nothing to do*/
@@ -306,6 +312,11 @@ d3d_blit(bitmap_t *b, int x, int y, int y1, int y2, int w, int h)
RECT r; RECT r;
int yy; int yy;
if (! is_enabled) {
video_blit_done();
return;
}
if ((y1 == y2) || (h <= 0)) { if ((y1 == y2) || (h <= 0)) {
video_blit_done(); video_blit_done();
return; /*Nothing to do*/ return; /*Nothing to do*/
@@ -470,6 +481,8 @@ d3d_close(void)
DestroyWindow(d3d_device_window); DestroyWindow(d3d_device_window);
d3d_device_window = NULL; d3d_device_window = NULL;
} }
is_enabled = 0;
} }
@@ -589,6 +602,8 @@ d3d_init(int fs)
else else
video_blit_set(d3d_blit); video_blit_set(d3d_blit);
is_enabled = 1;
return(1); return(1);
} }
@@ -605,6 +620,13 @@ d3d_resize(int x, int y)
} }
static void
d3d_enable(int yes)
{
is_enabled = yes;
}
static void static void
d3d_screenshot(const wchar_t *fn) d3d_screenshot(const wchar_t *fn)
{ {
@@ -629,11 +651,10 @@ const vidapi_t d3d_vidapi = {
"d3d", "d3d",
"DirectDraw 3D", "DirectDraw 3D",
1, 1,
d3d_init, d3d_init, d3d_close, d3d_reset,
d3d_close,
d3d_reset,
d3d_resize, d3d_resize,
NULL, NULL,
d3d_enable,
d3d_screenshot, d3d_screenshot,
NULL NULL
}; };

View File

@@ -8,7 +8,7 @@
* *
* Rendering module for Microsoft DirectDraw 9. * Rendering module for Microsoft DirectDraw 9.
* *
* Version: @(#)win_ddraw.cpp 1.0.20 2019/04/27 * Version: @(#)win_ddraw.cpp 1.0.21 2019/04/29
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -63,6 +63,7 @@ static LPDIRECTDRAWCLIPPER lpdd_clipper = NULL;
static HWND ddraw_hwnd; static HWND ddraw_hwnd;
static int ddraw_w, ddraw_h, static int ddraw_w, ddraw_h,
xs, ys, ys2; xs, ys, ys2;
static int is_enabled;
static const char * static const char *
@@ -253,6 +254,11 @@ ddraw_blit_fs(bitmap_t *scr, int x, int y, int y1, int y2, int w, int h)
HRESULT hr; HRESULT hr;
int yy; int yy;
if (! is_enabled) {
video_blit_done();
return;
}
if ((lpdds_back == NULL) || (y1 == y2) || (h <= 0)) { if ((lpdds_back == NULL) || (y1 == y2) || (h <= 0)) {
video_blit_done(); video_blit_done();
return; return;
@@ -327,6 +333,11 @@ ddraw_blit(bitmap_t *scr, int x, int y, int y1, int y2, int w, int h)
POINT po; POINT po;
int yy; int yy;
if (! is_enabled) {
video_blit_done();
return;
}
if ((lpdds_back == NULL) || (y1 == y2) || (h <= 0)) { if ((lpdds_back == NULL) || (y1 == y2) || (h <= 0)) {
video_blit_done(); video_blit_done();
return; return;
@@ -418,6 +429,8 @@ ddraw_close(void)
lpdd4->Release(); lpdd4->Release();
lpdd4 = NULL; lpdd4 = NULL;
} }
is_enabled = 0;
} }
@@ -562,10 +575,19 @@ ddraw_init(int fs)
else else
video_blit_set(ddraw_blit); video_blit_set(ddraw_blit);
is_enabled = 1;
return(1); return(1);
} }
static void
ddraw_enable(int yes)
{
is_enabled = yes;
}
static int static int
SaveBMP(const wchar_t *fn, BITMAPINFO *bmi, uint8_t *pixels) SaveBMP(const wchar_t *fn, BITMAPINFO *bmi, uint8_t *pixels)
{ {
@@ -753,11 +775,10 @@ const vidapi_t ddraw_vidapi = {
"ddraw", "ddraw",
"DirectDraw 9+", "DirectDraw 9+",
1, 1,
ddraw_init, ddraw_init, ddraw_close, NULL,
ddraw_close,
NULL,
NULL, NULL,
NULL, NULL,
ddraw_enable,
ddraw_screenshot, ddraw_screenshot,
NULL NULL
}; };

View File

@@ -12,7 +12,7 @@
* we will not use that, but, instead, use a new window which * we will not use that, but, instead, use a new window which
* coverrs the entire desktop. * coverrs the entire desktop.
* *
* Version: @(#)win_sdl.c 1.0.9 2019/04/27 * Version: @(#)win_sdl.c 1.0.10 2019/04/29
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Michael Dr<44>ing, <michael@drueing.de> * Michael Dr<44>ing, <michael@drueing.de>
@@ -90,6 +90,7 @@ static HWND sdl_parent_hwnd = NULL;
static int sdl_w, sdl_h; static int sdl_w, sdl_h;
static int cur_w, cur_h; static int cur_w, cur_h;
static int sdl_fs; static int sdl_fs;
static int is_enabled;
/* Pointers to the real functions. */ /* Pointers to the real functions. */
@@ -255,6 +256,11 @@ sdl_blit(bitmap_t *scr, int x, int y, int y1, int y2, int w, int h)
int xx, yy, ret; int xx, yy, ret;
int pitch; int pitch;
if (! is_enabled) {
video_blit_done();
return;
}
if ((y1 == y2) || (scr == NULL)) { if ((y1 == y2) || (scr == NULL)) {
video_blit_done(); video_blit_done();
return; return;
@@ -344,6 +350,8 @@ sdl_close(void)
dynld_close(sdl_handle); dynld_close(sdl_handle);
sdl_handle = NULL; sdl_handle = NULL;
} }
is_enabled = 0;
} }
@@ -462,6 +470,8 @@ sdl_init(int fs)
/* Register our renderer! */ /* Register our renderer! */
video_blit_set(sdl_blit); video_blit_set(sdl_blit);
is_enabled = 1;
return(1); return(1);
} }
@@ -520,15 +530,21 @@ sdl_available(void)
} }
static void
sdl_enable(int yes)
{
is_enabled = yes;
}
const vidapi_t sdl_vidapi = { const vidapi_t sdl_vidapi = {
"sdl", "sdl",
"SDL2", "SDL2",
1, 1,
sdl_init, sdl_init, sdl_close, NULL,
sdl_close,
NULL,
sdl_resize, sdl_resize,
NULL, NULL,
sdl_enable,
sdl_screenshot, sdl_screenshot,
sdl_available sdl_available
}; };

View File

@@ -8,7 +8,7 @@
* *
* Implement the user Interface module. * Implement the user Interface module.
* *
* Version: @(#)win_ui.c 1.0.35 2019/04/26 * Version: @(#)win_ui.c 1.0.36 2019/04/29
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -86,6 +86,7 @@ static HMENU menuMain = NULL, /* application menu bar */
*sb_menu = NULL; *sb_menu = NULL;
static int sb_nparts = 0; static int sb_nparts = 0;
static const sbpart_t *sb_parts = NULL; static const sbpart_t *sb_parts = NULL;
static int minimized = 0;
static int infocus = 1; static int infocus = 1;
static int hook_enabled = 0; static int hook_enabled = 0;
static int save_window_pos = 0; static int save_window_pos = 0;
@@ -422,11 +423,23 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
x += cruft_x; x += cruft_x;
y += (cruft_y + cruft_sb); y += (cruft_y + cruft_sb);
} }
y -= cruft_sb;
if ((x <= 0) || (y <= 0)) {
minimized = 1;
break;
} else if (minimized == 1) {
minimized = 0;
video_force_resize_set(1);
}
/* Disable the renderer for now. */
vidapi_enable(0);
/* Request a re-size if needed. */ /* Request a re-size if needed. */
if ((x != scrnsz_x) || (y != scrnsz_y)) doresize = 1; if ((x != scrnsz_x) || (y != scrnsz_y)) doresize = 1;
y -= cruft_sb;
/* Set the new panel size. */ /* Set the new panel size. */
scrnsz_x = x; scrnsz_x = x;
scrnsz_y = y; scrnsz_y = y;
@@ -442,6 +455,9 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
/* Update the renderer if needed. */ /* Update the renderer if needed. */
vidapi_resize(scrnsz_x, scrnsz_y); vidapi_resize(scrnsz_x, scrnsz_y);
/* OK, safe to enable the renderer again. */
vidapi_enable(1);
/* Re-clip the mouse area if needed. */ /* Re-clip the mouse area if needed. */
if (mouse_capture) { if (mouse_capture) {
GetWindowRect(hwndRender, &rect); GetWindowRect(hwndRender, &rect);