…Show last 381 lines
61- AC_ARG_ENABLE(shaders,AC_HELP_STRING([--disable-shaders],[Disable d3d pixelshader support (which requires libd3dx9)]),,[
62- AC_MSG_CHECKING(whether direct3d pixelshaders will be enabled)
63- ac_save_LIBS=$LIBS
64- if test x$dx_libs != x ; then
65- dx_libs=" -L$dx_libs"
66- fi
67- LIBS="$LIBS$dx_libs -ld3dx9"
68- AC_TRY_LINK([#include <d3d9.h>
69- #include <d3dx9.h>
70- extern "C" int main();],D3DXCreateEffect(0, 0, 0, 0, 0, 0, 0, 0, 0), have_d3dx9_lib=yes,)
71- if test x$have_d3dx9_lib = xyes ; then
72- AC_MSG_RESULT(yes)
73- AC_DEFINE(C_D3DSHADERS,1)
74- else
75- LIBS=$ac_save_LIBS
76- AC_MSG_RESULT(no)
77- AC_MSG_WARN([Can't find libd3dx9, pixelshader support disabled])
78- fi
79- ],)
80- else
81- CPPFLAGS=$ac_save_CPPFLAGS
82- AC_MSG_RESULT(no)
83- fi
84 AC_DEFINE(C_DIRECTSERIAL, 1, [ Define to 1 if you want serial passthrough support (Win32, Posix and OS/2 only).])
85 AC_DEFINE(C_DIRECTLPT, 1, [ Define to 1 if you want parallel passthrough support (Win32 only).])
86 if test x$have_sdl_net_lib = xyes -a x$have_sdl_net_h = xyes ; then
87diff -rupN dosbox-x-Orig//include/bios_disk.h dosbox-x//include/bios_disk.h
88--- dosbox-x-Orig//include/bios_disk.h 2017-04-13 02:25:09 -0400
89+++ dosbox-x//include/bios_disk.h 2017-04-15 23:41:23 -0400
90@@ -30,6 +30,10 @@
91 #include "bios.h"
92 #endif
93
94+#ifdef __MINGW32__
95+#include <stdlib.h>
96+#endif
97+
98 /* The Section handling Bios Disk Access */
99 #define BIOS_MAX_DISK 10
100
101diff -rupN dosbox-x-Orig//include/cpu.h dosbox-x//include/cpu.h
102--- dosbox-x-Orig//include/cpu.h 2017-04-13 02:25:09 -0400
103+++ dosbox-x//include/cpu.h 2017-04-15 23:35:24 -0400
104@@ -30,6 +30,10 @@
105 #include "mem.h"
106 #endif
107
108+#ifdef __MINGW32__
109+#include <stdlib.h>
110+#endif
111+
112 #define CPU_AUTODETERMINE_NONE 0x00
113 #define CPU_AUTODETERMINE_CORE 0x01
114 #define CPU_AUTODETERMINE_CYCLES 0x02
115diff -rupN dosbox-x-Orig//include/mem.h dosbox-x//include/mem.h
116--- dosbox-x-Orig//include/mem.h 2017-04-13 02:25:09 -0400
117+++ dosbox-x//include/mem.h 2017-04-15 23:22:30 -0400
118@@ -31,7 +31,17 @@
119 # ifndef _BSD_SOURCE
120 # define _BSD_SOURCE /* for htole16, etc. endian.h functions */
121 # endif
122-# include <endian.h>
123+# ifdef _WIN32
124+# define htole16(x) (x)
125+# define le16toh(x) (x)
126+# define htole32(x) (x)
127+# define le32toh(x) (x)
128+# define htole64(x) (x)
129+# define le64toh(x) (x)
130+# endif
131+# ifndef _WIN32
132+# include <endian.h>
133+# endif
134 #endif
135
136 #if defined(__APPLE__)
137diff -rupN dosbox-x-Orig//src/dos/dos_files.cpp dosbox-x//src/dos/dos_files.cpp
138--- dosbox-x-Orig//src/dos/dos_files.cpp 2017-04-13 02:25:09 -0400
139+++ dosbox-x//src/dos/dos_files.cpp 2017-04-16 01:34:40 -0400
140@@ -29,7 +29,6 @@
141 #include "dos_inc.h"
142 #include "drives.h"
143 #include "cross.h"
144-#include "dos_network2.h"
145
146 #define DOS_FILESTART 4
147
148@@ -357,10 +356,6 @@ bool DOS_FindNext(void) {
149
150
151 bool DOS_ReadFile(Bit16u entry,Bit8u * data,Bit16u * amount) {
152-#ifdef WIN32
153- if(Network_IsActiveResource(entry))
154- return Network_ReadFile(entry,data,amount);
155-#endif
156 Bit32u handle=RealHandle(entry);
157 if (handle>=DOS_FILES) {
158 DOS_SetError(DOSERR_INVALID_HANDLE);
159@@ -383,10 +378,6 @@ bool DOS_ReadFile(Bit16u entry,Bit8u * d
160 }
161
162 bool DOS_WriteFile(Bit16u entry,Bit8u * data,Bit16u * amount) {
163-#ifdef WIN32
164- if(Network_IsActiveResource(entry))
165- return Network_WriteFile(entry,data,amount);
166-#endif
167 Bit32u handle=RealHandle(entry);
168 if (handle>=DOS_FILES) {
169 DOS_SetError(DOSERR_INVALID_HANDLE);
170@@ -440,10 +431,6 @@ bool DOS_LockFile(Bit16u entry,Bit8u mod
171 }
172
173 bool DOS_CloseFile(Bit16u entry) {
174-#ifdef WIN32
175- if(Network_IsActiveResource(entry))
176- return Network_CloseFile(entry);
177-#endif
178 Bit32u handle=RealHandle(entry);
179 if (handle>=DOS_FILES) {
180 DOS_SetError(DOSERR_INVALID_HANDLE);
181@@ -542,10 +529,6 @@ bool DOS_CreateFile(char const * name,Bi
182 }
183
184 bool DOS_OpenFile(char const * name,Bit8u flags,Bit16u * entry) {
185-#ifdef WIN32
186- if(Network_IsNetworkResource(const_cast<char *>(name)))
187- return Network_OpenFile(const_cast<char *>(name),flags,entry);
188-#endif
189 /* First check for devices */
190 if (flags>2) LOG(LOG_FILES,LOG_NORMAL)("Special file open command %X file %s",flags,name); // FIXME: Why? Is there something about special opens DOSBox doesn't handle properly?
191 else LOG(LOG_FILES,LOG_NORMAL)("file open command %X file %s",flags,name);
192diff -rupN dosbox-x-Orig//src/fpu/fpu_instructions.h dosbox-x//src/fpu/fpu_instructions.h
193--- dosbox-x-Orig//src/fpu/fpu_instructions.h 2017-04-13 02:25:09 -0400
194+++ dosbox-x//src/fpu/fpu_instructions.h 2017-04-15 23:39:58 -0400
195@@ -454,7 +454,7 @@ static void FPU_FCOM(Bitu st, Bitu other
196 * "none" for no FPU, 287 or 387 for cputype=286 and cputype=386, or "auto" to match the CPU (8086 => 8087).
197 * If the FPU type is 387 or auto, then skip this hack. Else for 8087 and 287, use this hack. */
198 if (CPU_ArchitectureType<CPU_ARCHTYPE_386) {
199- if (isinf(fpu.regs[st].d) && isinf(fpu.regs[other].d)) {
200+ if (std::isinf(fpu.regs[st].d) && std::isinf(fpu.regs[other].d)) {
201 /* 8087/287 consider -inf == +inf and that's what DOS programs test for to detect 287 vs 387 */
202 FPU_SET_C3(1);FPU_SET_C2(0);FPU_SET_C0(0);return;
203 }
204diff -rupN dosbox-x-Orig//src/gui/Makefile.am dosbox-x//src/gui/Makefile.am
205--- dosbox-x-Orig//src/gui/Makefile.am 2017-04-13 02:25:09 -0400
206+++ dosbox-x//src/gui/Makefile.am 2017-04-16 01:05:46 -0400
207@@ -9,8 +9,6 @@ libgui_a_SOURCES = \
208 render_templates_sai.h render_templates_hq.h \
209 render_templates_hq2x.h render_templates_hq3x.h \
210 midi.cpp midi_win32.h midi_oss.h midi_coreaudio.h midi_alsa.h \
211- direct3d.cpp direct3d.h \
212- hq2x_d3d.cpp hq2x_d3d.h \
213 midi_coremidi.h sdl_gui.cpp dosbox_splash.h menu.cpp \
214 DelayReverb.cpp DelayReverb.h File.cpp File.h \
215 fmath.h FreeverbModel.cpp FreeverbModel.h BReverbModel.cpp BReverbModel.h \
216diff -rupN dosbox-x-Orig//src/gui/mmath.h dosbox-x//src/gui/mmath.h
217--- dosbox-x-Orig//src/gui/mmath.h 2017-04-13 02:25:09 -0400
218+++ dosbox-x//src/gui/mmath.h 2017-04-16 01:21:39 -0400
219@@ -448,7 +448,7 @@ inline float exp(float x)
220 using namespace local;
221 const ExpVar<>& expVar = C<>::expVar;
222
223-#if 1
224+#ifndef __MINGW32__
225 __m128 x1 = _mm_set_ss(x);
226
227 int limit = _mm_cvtss_si32(x1) & 0x7fffffff;
228@@ -504,6 +504,7 @@ inline double expd(double x)
229 return y * di.d;
230 }
231
232+#ifndef __MINGW32__
233 inline void expd_v(double *px, int n)
234 {
235 using namespace local;
236@@ -608,6 +609,7 @@ inline __m128 exp_ps(__m128 x)
237
238 return t;
239 }
240+#endif
241
242 inline float log(float x)
243 {
244@@ -625,6 +627,7 @@ inline float log(float x)
245 return f;
246 }
247
248+#ifndef __MINGW32__
249 inline __m128 log_ps(__m128 x)
250 {
251 using namespace local;
252@@ -668,6 +671,7 @@ inline __m128 log_ps(__m128 x)
253 rev = _mm_mul_ps(b2, rev);
254 return _mm_add_ps(a, rev);
255 }
256+#endif
257
258 #ifndef __CYGWIN__
259 // cygwin defines log2() in global namespace!
260diff -rupN dosbox-x-Orig//src/gui/sdl_mapper.cpp dosbox-x//src/gui/sdl_mapper.cpp
261--- dosbox-x-Orig//src/gui/sdl_mapper.cpp 2017-04-13 02:25:09 -0400
262+++ dosbox-x//src/gui/sdl_mapper.cpp 2017-04-16 01:01:14 -0400
263@@ -2579,6 +2579,7 @@ void MAPPER_RunInternal() {
264 GFX_RestoreMode();
265 }
266 #ifdef __WIN32__
267+# ifndef __MINGW32__
268 if(GetAsyncKeyState(0x11)) {
269 INPUT ip;
270
271@@ -2596,6 +2597,7 @@ void MAPPER_RunInternal() {
272 ip.ki.dwFlags = KEYEVENTF_KEYUP; // KEYEVENTF_KEYUP for key release
273 SendInput(1, &ip, sizeof(INPUT));
274 }
275+# endif
276 #endif
277 KEYBOARD_ClrBuffer();
278 GFX_LosingFocus();
279diff -rupN dosbox-x-Orig//src/gui/sdlmain.cpp dosbox-x//src/gui/sdlmain.cpp
280--- dosbox-x-Orig//src/gui/sdlmain.cpp 2017-04-13 02:25:09 -0400
281+++ dosbox-x//src/gui/sdlmain.cpp 2017-04-16 01:43:13 -0400
282@@ -17,6 +17,7 @@
283 */
284
285 #ifdef WIN32
286+#define _WIN32_WINNT 0x0500
287 # ifndef WIN32_LEAN_AND_MEAN
288 # define WIN32_LEAN_AND_MEAN
289 # endif
290@@ -1269,8 +1270,6 @@ static bool exthook_enabled = false;
291 #if defined(WIN32)
292 static HHOOK exthook_winhook = NULL;
293
294-extern "C" void SDL_DOSBox_X_Hack_Set_Toggle_Key_WM_USER_Hack(unsigned char x);
295-
296 static LRESULT CALLBACK WinExtHookKeyboardHookProc(int nCode,WPARAM wParam,LPARAM lParam) {
297 if (nCode == HC_ACTION) {
298 HWND myHwnd = GetHWND();
299@@ -1321,6 +1320,7 @@ static LRESULT CALLBACK WinExtHookKeyboa
300 case VK_ESCAPE: // try to catch CTRL+ESC as well (so Windows 95 Start Menu is accessible)
301 case VK_SPACE: // and space (catching VK_ZOOM isn't enough to prevent Windows 10 from changing res)
302 // these keys have no meaning to DOSBox and so we hook them by default to allow the guest OS to use them
303+#ifndef __MINGW32__
304 case VK_BROWSER_BACK: // Browser Back key
305 case VK_BROWSER_FORWARD: // Browser Forward key
306 case VK_BROWSER_REFRESH: // Browser Refresh key
307@@ -1336,6 +1336,7 @@ static LRESULT CALLBACK WinExtHookKeyboa
308 case VK_LAUNCH_MEDIA_SELECT: // Select Media key
309 case VK_LAUNCH_APP1: // Start Application 1 key
310 case VK_LAUNCH_APP2: // Start Application 2 key
311+#endif
312 case VK_PLAY: // Play key
313 case VK_ZOOM: // Zoom key (the (+) magnifying glass keyboard shortcut laptops have these days on the spacebar?)
314 nopass = true;
315@@ -1381,6 +1382,7 @@ static LRESULT CALLBACK WinExtHookKeyboa
316
317 // Microsoft doesn't have an outright "set toggle key state" call, they expect you
318 // to know the state and then fake input to toggle. Blegh. Fine.
319+#ifndef __MINGW32__
320 void WinSetKeyToggleState(unsigned int vkCode, bool state) {
321 bool curState = (GetKeyState(vkCode) & 1) ? true : false;
322 INPUT inps;
323@@ -1402,17 +1404,20 @@ void WinSetKeyToggleState(unsigned int v
324 SendInput(1, &inps, sizeof(INPUT));
325 }
326 #endif
327+#endif
328
329 Bitu Keyboard_Guest_LED_State();
330 void UpdateKeyboardLEDState(Bitu led_state/* in the same bitfield arrangement as using command 0xED on PS/2 keyboards */);
331
332 void UpdateKeyboardLEDState(Bitu led_state/* in the same bitfield arrangement as using command 0xED on PS/2 keyboards */) {
333 #if defined(WIN32) /* Microsoft Windows */
334+ #ifndef __MINGW32__
335 if (exthook_enabled) { // ONLY if ext hook is enabled, else we risk infinite loops with keyboard events
336 WinSetKeyToggleState(VK_NUMLOCK, !!(led_state & 2));
337 WinSetKeyToggleState(VK_SCROLL, !!(led_state & 1));
338 WinSetKeyToggleState(VK_CAPITAL, !!(led_state & 4));
339 }
340+ #endif
341 #endif
342 }
343
344@@ -1440,9 +1445,6 @@ void DoExtendedKeyboardHook(bool enable)
345 }
346 }
347
348- // Enable the SDL hack for Win32 to handle Num/Scroll/Caps
349- SDL_DOSBox_X_Hack_Set_Toggle_Key_WM_USER_Hack(1);
350-
351 // if hooking Num/Scroll/Caps Lock then record the toggle state of those keys.
352 // then read from the keyboard emulation the LED state set by the guest and apply it to the host keyboard.
353 if (enable_hook_lock_toggle_keys) {
354@@ -1458,9 +1460,11 @@ void DoExtendedKeyboardHook(bool enable)
355 if (exthook_winhook) {
356 if (enable_hook_lock_toggle_keys) {
357 // restore state
358+#ifndef __MINGW32__
359 WinSetKeyToggleState(VK_NUMLOCK, on_capture_num_lock_was_on);
360 WinSetKeyToggleState(VK_SCROLL, on_capture_scroll_lock_was_on);
361 WinSetKeyToggleState(VK_CAPITAL, on_capture_caps_lock_was_on);
362+#endif
363 }
364
365 {
366@@ -1477,8 +1481,6 @@ void DoExtendedKeyboardHook(bool enable)
367 }
368
369 // Disable the SDL hack for Win32 to handle Num/Scroll/Caps
370- SDL_DOSBox_X_Hack_Set_Toggle_Key_WM_USER_Hack(0);
371-
372 UnhookWindowsHookEx(exthook_winhook);
373 exthook_winhook = NULL;
374 }
375@@ -2922,7 +2924,7 @@ search:
376
377 if((!strcmp(ext,".img")) || (!strcmp(ext,".pcjr")) || (!strcmp(ext,".jrc")) || (!strcmp(ext,".ima"))) {
378 extern Bitu ZDRIVE_NUM;
379- char root[4] = {'A'+ZDRIVE_NUM,':','\\',0};
380+ char root[4] = {static_cast<char>('A'+ZDRIVE_NUM),':','\\',0};
381 char cmd[20];
382 DOS_Shell shell;
383 Bit16u n=1; Bit8u c='\n';
384@@ -2965,7 +2967,7 @@ void Go_Boot2(const char boot_drive[_MAX
385 DOS_WriteFile(STDOUT,&c,&n);
386 char temp[7];
387 extern Bitu ZDRIVE_NUM;
388- char root[4] = {'A'+ZDRIVE_NUM,':','\\',0};
389+ char root[4] = {static_cast<char>('A'+ZDRIVE_NUM),':','\\',0};
390 char cmd[20];
391 temp[0] = 0;
392 cmd[0] = 0;
393@@ -3564,6 +3566,7 @@ static bool PasteClipboardNext()
394
395 const char cKey = strPasteBuffer[0];
396 SHORT shVirKey = VkKeyScan(cKey); // If it fails then MapVirtK will also fail, so no bail yet
397+#ifndef __MINGW32__
398 UINT uiScanCode = MapVirtualKey(LOBYTE(shVirKey), MAPVK_VK_TO_VSC);
399 if (uiScanCode)
400 {
401@@ -3609,6 +3612,7 @@ static bool PasteClipboardNext()
402 if (bModAlt != bModAltOn) GenKBStroke(uiScanCodeAlt, bModAltOn, sdlmMods);
403 //putchar(cKey); // For debugging dropped strokes
404 }
405+#endif
406
407 // Pop head. Could be made more efficient, but this is neater.
408 strPasteBuffer = strPasteBuffer.substr(1, strPasteBuffer.length()); // technically -1, but it clamps by itself anyways...
409@@ -4459,8 +4463,10 @@ int main(int argc, char* argv[]) {
410 CommandLine com_line(argc,argv);
411
412 #if defined(WIN32)
413+# ifndef __MINGW32__
414 /* Microsoft's IME does not play nice with DOSBox */
415 ImmDisableIME((DWORD)(-1));
416+# endif
417 #endif
418
419 {
420diff -rupN dosbox-x-Orig//src/hardware/sblaster.cpp dosbox-x//src/hardware/sblaster.cpp
421--- dosbox-x-Orig//src/hardware/sblaster.cpp 2017-04-13 02:25:09 -0400
422+++ dosbox-x//src/hardware/sblaster.cpp 2017-04-16 01:26:31 -0400
423@@ -55,6 +55,7 @@
424 #include "setup.h"
425 #include "support.h"
426 #include "shell.h"
427+#include <stdlib.h>
428 using namespace std;
429
430 void MIDI_RawOutByte(Bit8u data);
431diff -rupN dosbox-x-Orig//src/winres.rc dosbox-x//src/winres.rc
432--- dosbox-x-Orig//src/winres.rc 2017-04-13 02:25:09 -0400
433+++ dosbox-x//src/winres.rc 2017-04-16 01:30:18 -0400
434@@ -1,5 +1,5 @@
435
436-#include "winres.h"
437+#include "afxres.h"
438 #include "../include/resource.h"
439
440 // icon resource