VOGONS

Common searches


DOSBox-X branch

Topic actions

Reply 1160 of 2397, by hail-to-the-ryzen

User metadata
Rank Member
Rank
Member

Would it be possible to assume that a reboot is for an OS requiring the new page fault method and add the code there, too? Also, the updated reboot code in dosbox-x is very nice and a lot of work to implement throughout.

Reply 1161 of 2397, by TheGreatCodeholio

User metadata
Rank Oldbie
Rank
Oldbie
hail-to-the-ryzen wrote:

Would it be possible to assume that a reboot is for an OS requiring the new page fault method and add the code there, too? Also, the updated reboot code in dosbox-x is very nice and a lot of work to implement throughout.

When DOSBox-X boots up, it runs through a mock BIOS screen, then boots to the emulated DOS kernel. The mock BIOS screen takes the place of the DOSBox 0.74 splash screen. When you use the "boot" command, that throws an exception to signal to the SDL main loop that it's time to shutdown the DOS kernel and pass control to the guest OS. In the latest code, if the guest OS triggers a system reboot in any way (through the keyboard controller, port 92h, jumping to F000:FFF0, etc.) and it's not the 286 reset vector trick, another exception is thrown to signal that tells the SDL main loop to run back through the mock BIOS and DOS kernel re-initialization.

The only way a guest OS will boot in DOSBox-X is when the exception is thrown to the SDL main code to signal that the DOS kernel should shutdown. There is no direct path from a reboot or the BIOS startup procedure to booting a guest OS. There is only one way that execution will go to booting a guest OS in this codebase, and it's very clear where it happens, so that's where you add your code. If the guest OS causes a system reboot, the path back to the BIOS and DOS kernel is also very clear and defined.

I hope that helps.

EDIT: You could have your code switch it on when the "boot" command throws the exception to start booting the guest OS, and switch it back when the exception is thrown to trigger a system reboot. It's pretty easy to do.

DOSBox-X project: more emulation better accuracy.
DOSLIB and DOSLIB2: Learn how to tinker and hack hardware and software from DOS.

Reply 1163 of 2397, by hail-to-the-ryzen

User metadata
Rank Member
Rank
Member
TheGreatCodeholio wrote:

Can someone spin up a Win32 binary for me? I no longer make Win32 binaries. I do all development on Linux and I leave the Win32 code as-is in the codebase.

Patch to build latest dosbox-x with mingw32:

diff -rupN dosbox-x-Orig//configure.ac dosbox-x//configure.ac
--- dosbox-x-Orig//configure.ac 2017-04-13 02:25:09 -0400
+++ dosbox-x//configure.ac 2017-04-16 01:46:32 -0400
@@ -64,7 +64,7 @@ dnl Need GCC to know this code is using
CXXFLAGS="$CXXFLAGS -Wall"

dnl Scalars in the code use MMX/SSE intrinsics
-CXXFLAGS="$CXXFLAGS -mmmx -msse -msse2 -D_FILE_OFFSET_BITS=64"
+CXXFLAGS="$CXXFLAGS -O2 -mno-ms-bitfields"

dnl Stop reporting "type punning" warnings, I'm sick of hearing about it.
CXXFLAGS="$CXXFLAGS -Wno-strict-aliasing"
@@ -84,7 +84,7 @@ AM_PATH_SDL($SDL_VERSION,
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
)
LIBS="$LIBS $SDL_LIBS"
-CPPFLAGS="$CPPFLAGS $SDL_CFLAGS"
+CPPFLAGS="$CPPFLAGS $SDL_CFLAGS -I/usr/include -D__USE_MINGW_ANSI_STDIO=0"

dnl Check if SDL is 1.2.x (1.3 not supported)
AC_MSG_CHECKING([SDL version only being 1.2.X])
@@ -424,13 +424,13 @@ fi

AH_TEMPLATE(C_FLUIDSYNTH,[Define to 1 to enable fluidsynth MIDI synthesis])
AC_CHECK_HEADER(fluidsynth.h,have_fluidsynth_h=yes,)
-AC_CHECK_LIB(fluidsynth, new_fluid_synth, have_fluidsynth_lib=yes,,)
-if test x$have_fluidsynth_lib = xyes -a x$have_fluidsynth_h = xyes ; then
- LIBS="$LIBS -lfluidsynth"
- AC_DEFINE(C_FLUIDSYNTH,1)
-else
+#AC_CHECK_LIB(fluidsynth, new_fluid_synth, have_fluidsynth_lib=yes,,)
+#if test x$have_fluidsynth_lib = xyes -a x$have_fluidsynth_h = xyes ; then
+# LIBS="$LIBS -lfluidsynth"
+# AC_DEFINE(C_FLUIDSYNTH,1)
+#else
AC_MSG_WARN([fluidsynth MIDI synthesis not available])
-fi
+#fi

# FFMPEG output
AH_TEMPLATE(C_AVCODEC,[Define to 1 to use FFMPEG libavcodec for video capture])
@@ -500,44 +500,6 @@ dnl Some target detection and actions fo
case "$host" in
*-*-cygwin* | *-*-mingw32*)
LIBS="$LIBS -lwinmm"
- AH_TEMPLATE(C_D3DSHADERS,[Define to 1 to use Direct3D shaders, requires d3d9.h and libd3dx9])
- AC_ARG_WITH(dx-headers,[ --with-dx-headers=DIR DirectX include files location],
- dx_headers="$withval", dx_headers="")
- AC_ARG_WITH(dx-libs,[ --with-dx-libs=DIR DirectX library location],
- dx_libs="$withval", dx_libs="")
- ac_save_CPPFLAGS=$CPPFLAGS
- if test x$dx_headers != x ; then
- CPPFLAGS="$CPPFLAGS -I$dx_headers"
- fi
- AC_LANG(C++)
- AC_CHECK_HEADERS(ddraw.h)
- AC_CHECK_HEADERS(d3d9.h,have_d3d9_h=yes,)
- AC_MSG_CHECKING(whether direct3d display output will be enabled)
- if test x$have_d3d9_h = xyes ; then
- AC_MSG_RESULT(yes)
Show last 381 lines
-        AC_ARG_ENABLE(shaders,AC_HELP_STRING([--disable-shaders],[Disable d3d pixelshader support (which requires libd3dx9)]),,[
- AC_MSG_CHECKING(whether direct3d pixelshaders will be enabled)
- ac_save_LIBS=$LIBS
- if test x$dx_libs != x ; then
- dx_libs=" -L$dx_libs"
- fi
- LIBS="$LIBS$dx_libs -ld3dx9"
- AC_TRY_LINK([#include <d3d9.h>
- #include <d3dx9.h>
- extern "C" int main();],D3DXCreateEffect(0, 0, 0, 0, 0, 0, 0, 0, 0), have_d3dx9_lib=yes,)
- if test x$have_d3dx9_lib = xyes ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE(C_D3DSHADERS,1)
- else
- LIBS=$ac_save_LIBS
- AC_MSG_RESULT(no)
- AC_MSG_WARN([Can't find libd3dx9, pixelshader support disabled])
- fi
- ],)
- else
- CPPFLAGS=$ac_save_CPPFLAGS
- AC_MSG_RESULT(no)
- fi
AC_DEFINE(C_DIRECTSERIAL, 1, [ Define to 1 if you want serial passthrough support (Win32, Posix and OS/2 only).])
AC_DEFINE(C_DIRECTLPT, 1, [ Define to 1 if you want parallel passthrough support (Win32 only).])
if test x$have_sdl_net_lib = xyes -a x$have_sdl_net_h = xyes ; then
diff -rupN dosbox-x-Orig//include/bios_disk.h dosbox-x//include/bios_disk.h
--- dosbox-x-Orig//include/bios_disk.h 2017-04-13 02:25:09 -0400
+++ dosbox-x//include/bios_disk.h 2017-04-15 23:41:23 -0400
@@ -30,6 +30,10 @@
#include "bios.h"
#endif

+#ifdef __MINGW32__
+#include <stdlib.h>
+#endif
+
/* The Section handling Bios Disk Access */
#define BIOS_MAX_DISK 10

diff -rupN dosbox-x-Orig//include/cpu.h dosbox-x//include/cpu.h
--- dosbox-x-Orig//include/cpu.h 2017-04-13 02:25:09 -0400
+++ dosbox-x//include/cpu.h 2017-04-15 23:35:24 -0400
@@ -30,6 +30,10 @@
#include "mem.h"
#endif

+#ifdef __MINGW32__
+#include <stdlib.h>
+#endif
+
#define CPU_AUTODETERMINE_NONE 0x00
#define CPU_AUTODETERMINE_CORE 0x01
#define CPU_AUTODETERMINE_CYCLES 0x02
diff -rupN dosbox-x-Orig//include/mem.h dosbox-x//include/mem.h
--- dosbox-x-Orig//include/mem.h 2017-04-13 02:25:09 -0400
+++ dosbox-x//include/mem.h 2017-04-15 23:22:30 -0400
@@ -31,7 +31,17 @@
# ifndef _BSD_SOURCE
# define _BSD_SOURCE /* for htole16, etc. endian.h functions */
# endif
-# include <endian.h>
+# ifdef _WIN32
+# define htole16(x) (x)
+# define le16toh(x) (x)
+# define htole32(x) (x)
+# define le32toh(x) (x)
+# define htole64(x) (x)
+# define le64toh(x) (x)
+# endif
+# ifndef _WIN32
+# include <endian.h>
+# endif
#endif

#if defined(__APPLE__)
diff -rupN dosbox-x-Orig//src/dos/dos_files.cpp dosbox-x//src/dos/dos_files.cpp
--- dosbox-x-Orig//src/dos/dos_files.cpp 2017-04-13 02:25:09 -0400
+++ dosbox-x//src/dos/dos_files.cpp 2017-04-16 01:34:40 -0400
@@ -29,7 +29,6 @@
#include "dos_inc.h"
#include "drives.h"
#include "cross.h"
-#include "dos_network2.h"

#define DOS_FILESTART 4

@@ -357,10 +356,6 @@ bool DOS_FindNext(void) {


bool DOS_ReadFile(Bit16u entry,Bit8u * data,Bit16u * amount) {
-#ifdef WIN32
- if(Network_IsActiveResource(entry))
- return Network_ReadFile(entry,data,amount);
-#endif
Bit32u handle=RealHandle(entry);
if (handle>=DOS_FILES) {
DOS_SetError(DOSERR_INVALID_HANDLE);
@@ -383,10 +378,6 @@ bool DOS_ReadFile(Bit16u entry,Bit8u * d
}

bool DOS_WriteFile(Bit16u entry,Bit8u * data,Bit16u * amount) {
-#ifdef WIN32
- if(Network_IsActiveResource(entry))
- return Network_WriteFile(entry,data,amount);
-#endif
Bit32u handle=RealHandle(entry);
if (handle>=DOS_FILES) {
DOS_SetError(DOSERR_INVALID_HANDLE);
@@ -440,10 +431,6 @@ bool DOS_LockFile(Bit16u entry,Bit8u mod
}

bool DOS_CloseFile(Bit16u entry) {
-#ifdef WIN32
- if(Network_IsActiveResource(entry))
- return Network_CloseFile(entry);
-#endif
Bit32u handle=RealHandle(entry);
if (handle>=DOS_FILES) {
DOS_SetError(DOSERR_INVALID_HANDLE);
@@ -542,10 +529,6 @@ bool DOS_CreateFile(char const * name,Bi
}

bool DOS_OpenFile(char const * name,Bit8u flags,Bit16u * entry) {
-#ifdef WIN32
- if(Network_IsNetworkResource(const_cast<char *>(name)))
- return Network_OpenFile(const_cast<char *>(name),flags,entry);
-#endif
/* First check for devices */
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?
else LOG(LOG_FILES,LOG_NORMAL)("file open command %X file %s",flags,name);
diff -rupN dosbox-x-Orig//src/fpu/fpu_instructions.h dosbox-x//src/fpu/fpu_instructions.h
--- dosbox-x-Orig//src/fpu/fpu_instructions.h 2017-04-13 02:25:09 -0400
+++ dosbox-x//src/fpu/fpu_instructions.h 2017-04-15 23:39:58 -0400
@@ -454,7 +454,7 @@ static void FPU_FCOM(Bitu st, Bitu other
* "none" for no FPU, 287 or 387 for cputype=286 and cputype=386, or "auto" to match the CPU (8086 => 8087).
* If the FPU type is 387 or auto, then skip this hack. Else for 8087 and 287, use this hack. */
if (CPU_ArchitectureType<CPU_ARCHTYPE_386) {
- if (isinf(fpu.regs[st].d) && isinf(fpu.regs[other].d)) {
+ if (std::isinf(fpu.regs[st].d) && std::isinf(fpu.regs[other].d)) {
/* 8087/287 consider -inf == +inf and that's what DOS programs test for to detect 287 vs 387 */
FPU_SET_C3(1);FPU_SET_C2(0);FPU_SET_C0(0);return;
}
diff -rupN dosbox-x-Orig//src/gui/Makefile.am dosbox-x//src/gui/Makefile.am
--- dosbox-x-Orig//src/gui/Makefile.am 2017-04-13 02:25:09 -0400
+++ dosbox-x//src/gui/Makefile.am 2017-04-16 01:05:46 -0400
@@ -9,8 +9,6 @@ libgui_a_SOURCES = \
render_templates_sai.h render_templates_hq.h \
render_templates_hq2x.h render_templates_hq3x.h \
midi.cpp midi_win32.h midi_oss.h midi_coreaudio.h midi_alsa.h \
- direct3d.cpp direct3d.h \
- hq2x_d3d.cpp hq2x_d3d.h \
midi_coremidi.h sdl_gui.cpp dosbox_splash.h menu.cpp \
DelayReverb.cpp DelayReverb.h File.cpp File.h \
fmath.h FreeverbModel.cpp FreeverbModel.h BReverbModel.cpp BReverbModel.h \
diff -rupN dosbox-x-Orig//src/gui/mmath.h dosbox-x//src/gui/mmath.h
--- dosbox-x-Orig//src/gui/mmath.h 2017-04-13 02:25:09 -0400
+++ dosbox-x//src/gui/mmath.h 2017-04-16 01:21:39 -0400
@@ -448,7 +448,7 @@ inline float exp(float x)
using namespace local;
const ExpVar<>& expVar = C<>::expVar;

-#if 1
+#ifndef __MINGW32__
__m128 x1 = _mm_set_ss(x);

int limit = _mm_cvtss_si32(x1) & 0x7fffffff;
@@ -504,6 +504,7 @@ inline double expd(double x)
return y * di.d;
}

+#ifndef __MINGW32__
inline void expd_v(double *px, int n)
{
using namespace local;
@@ -608,6 +609,7 @@ inline __m128 exp_ps(__m128 x)

return t;
}
+#endif

inline float log(float x)
{
@@ -625,6 +627,7 @@ inline float log(float x)
return f;
}

+#ifndef __MINGW32__
inline __m128 log_ps(__m128 x)
{
using namespace local;
@@ -668,6 +671,7 @@ inline __m128 log_ps(__m128 x)
rev = _mm_mul_ps(b2, rev);
return _mm_add_ps(a, rev);
}
+#endif

#ifndef __CYGWIN__
// cygwin defines log2() in global namespace!
diff -rupN dosbox-x-Orig//src/gui/sdl_mapper.cpp dosbox-x//src/gui/sdl_mapper.cpp
--- dosbox-x-Orig//src/gui/sdl_mapper.cpp 2017-04-13 02:25:09 -0400
+++ dosbox-x//src/gui/sdl_mapper.cpp 2017-04-16 01:01:14 -0400
@@ -2579,6 +2579,7 @@ void MAPPER_RunInternal() {
GFX_RestoreMode();
}
#ifdef __WIN32__
+# ifndef __MINGW32__
if(GetAsyncKeyState(0x11)) {
INPUT ip;

@@ -2596,6 +2597,7 @@ void MAPPER_RunInternal() {
ip.ki.dwFlags = KEYEVENTF_KEYUP; // KEYEVENTF_KEYUP for key release
SendInput(1, &ip, sizeof(INPUT));
}
+# endif
#endif
KEYBOARD_ClrBuffer();
GFX_LosingFocus();
diff -rupN dosbox-x-Orig//src/gui/sdlmain.cpp dosbox-x//src/gui/sdlmain.cpp
--- dosbox-x-Orig//src/gui/sdlmain.cpp 2017-04-13 02:25:09 -0400
+++ dosbox-x//src/gui/sdlmain.cpp 2017-04-16 01:43:13 -0400
@@ -17,6 +17,7 @@
*/

#ifdef WIN32
+#define _WIN32_WINNT 0x0500
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
@@ -1269,8 +1270,6 @@ static bool exthook_enabled = false;
#if defined(WIN32)
static HHOOK exthook_winhook = NULL;

-extern "C" void SDL_DOSBox_X_Hack_Set_Toggle_Key_WM_USER_Hack(unsigned char x);
-
static LRESULT CALLBACK WinExtHookKeyboardHookProc(int nCode,WPARAM wParam,LPARAM lParam) {
if (nCode == HC_ACTION) {
HWND myHwnd = GetHWND();
@@ -1321,6 +1320,7 @@ static LRESULT CALLBACK WinExtHookKeyboa
case VK_ESCAPE: // try to catch CTRL+ESC as well (so Windows 95 Start Menu is accessible)
case VK_SPACE: // and space (catching VK_ZOOM isn't enough to prevent Windows 10 from changing res)
// these keys have no meaning to DOSBox and so we hook them by default to allow the guest OS to use them
+#ifndef __MINGW32__
case VK_BROWSER_BACK: // Browser Back key
case VK_BROWSER_FORWARD: // Browser Forward key
case VK_BROWSER_REFRESH: // Browser Refresh key
@@ -1336,6 +1336,7 @@ static LRESULT CALLBACK WinExtHookKeyboa
case VK_LAUNCH_MEDIA_SELECT: // Select Media key
case VK_LAUNCH_APP1: // Start Application 1 key
case VK_LAUNCH_APP2: // Start Application 2 key
+#endif
case VK_PLAY: // Play key
case VK_ZOOM: // Zoom key (the (+) magnifying glass keyboard shortcut laptops have these days on the spacebar?)
nopass = true;
@@ -1381,6 +1382,7 @@ static LRESULT CALLBACK WinExtHookKeyboa

// Microsoft doesn't have an outright "set toggle key state" call, they expect you
// to know the state and then fake input to toggle. Blegh. Fine.
+#ifndef __MINGW32__
void WinSetKeyToggleState(unsigned int vkCode, bool state) {
bool curState = (GetKeyState(vkCode) & 1) ? true : false;
INPUT inps;
@@ -1402,17 +1404,20 @@ void WinSetKeyToggleState(unsigned int v
SendInput(1, &inps, sizeof(INPUT));
}
#endif
+#endif

Bitu Keyboard_Guest_LED_State();
void UpdateKeyboardLEDState(Bitu led_state/* in the same bitfield arrangement as using command 0xED on PS/2 keyboards */);

void UpdateKeyboardLEDState(Bitu led_state/* in the same bitfield arrangement as using command 0xED on PS/2 keyboards */) {
#if defined(WIN32) /* Microsoft Windows */
+ #ifndef __MINGW32__
if (exthook_enabled) { // ONLY if ext hook is enabled, else we risk infinite loops with keyboard events
WinSetKeyToggleState(VK_NUMLOCK, !!(led_state & 2));
WinSetKeyToggleState(VK_SCROLL, !!(led_state & 1));
WinSetKeyToggleState(VK_CAPITAL, !!(led_state & 4));
}
+ #endif
#endif
}

@@ -1440,9 +1445,6 @@ void DoExtendedKeyboardHook(bool enable)
}
}

- // Enable the SDL hack for Win32 to handle Num/Scroll/Caps
- SDL_DOSBox_X_Hack_Set_Toggle_Key_WM_USER_Hack(1);
-
// if hooking Num/Scroll/Caps Lock then record the toggle state of those keys.
// then read from the keyboard emulation the LED state set by the guest and apply it to the host keyboard.
if (enable_hook_lock_toggle_keys) {
@@ -1458,9 +1460,11 @@ void DoExtendedKeyboardHook(bool enable)
if (exthook_winhook) {
if (enable_hook_lock_toggle_keys) {
// restore state
+#ifndef __MINGW32__
WinSetKeyToggleState(VK_NUMLOCK, on_capture_num_lock_was_on);
WinSetKeyToggleState(VK_SCROLL, on_capture_scroll_lock_was_on);
WinSetKeyToggleState(VK_CAPITAL, on_capture_caps_lock_was_on);
+#endif
}

{
@@ -1477,8 +1481,6 @@ void DoExtendedKeyboardHook(bool enable)
}

// Disable the SDL hack for Win32 to handle Num/Scroll/Caps
- SDL_DOSBox_X_Hack_Set_Toggle_Key_WM_USER_Hack(0);
-
UnhookWindowsHookEx(exthook_winhook);
exthook_winhook = NULL;
}
@@ -2922,7 +2924,7 @@ search:

if((!strcmp(ext,".img")) || (!strcmp(ext,".pcjr")) || (!strcmp(ext,".jrc")) || (!strcmp(ext,".ima"))) {
extern Bitu ZDRIVE_NUM;
- char root[4] = {'A'+ZDRIVE_NUM,':','\\',0};
+ char root[4] = {static_cast<char>('A'+ZDRIVE_NUM),':','\\',0};
char cmd[20];
DOS_Shell shell;
Bit16u n=1; Bit8u c='\n';
@@ -2965,7 +2967,7 @@ void Go_Boot2(const char boot_drive[_MAX
DOS_WriteFile(STDOUT,&c,&n);
char temp[7];
extern Bitu ZDRIVE_NUM;
- char root[4] = {'A'+ZDRIVE_NUM,':','\\',0};
+ char root[4] = {static_cast<char>('A'+ZDRIVE_NUM),':','\\',0};
char cmd[20];
temp[0] = 0;
cmd[0] = 0;
@@ -3564,6 +3566,7 @@ static bool PasteClipboardNext()

const char cKey = strPasteBuffer[0];
SHORT shVirKey = VkKeyScan(cKey); // If it fails then MapVirtK will also fail, so no bail yet
+#ifndef __MINGW32__
UINT uiScanCode = MapVirtualKey(LOBYTE(shVirKey), MAPVK_VK_TO_VSC);
if (uiScanCode)
{
@@ -3609,6 +3612,7 @@ static bool PasteClipboardNext()
if (bModAlt != bModAltOn) GenKBStroke(uiScanCodeAlt, bModAltOn, sdlmMods);
//putchar(cKey); // For debugging dropped strokes
}
+#endif

// Pop head. Could be made more efficient, but this is neater.
strPasteBuffer = strPasteBuffer.substr(1, strPasteBuffer.length()); // technically -1, but it clamps by itself anyways...
@@ -4459,8 +4463,10 @@ int main(int argc, char* argv[]) {
CommandLine com_line(argc,argv);

#if defined(WIN32)
+# ifndef __MINGW32__
/* Microsoft's IME does not play nice with DOSBox */
ImmDisableIME((DWORD)(-1));
+# endif
#endif

{
diff -rupN dosbox-x-Orig//src/hardware/sblaster.cpp dosbox-x//src/hardware/sblaster.cpp
--- dosbox-x-Orig//src/hardware/sblaster.cpp 2017-04-13 02:25:09 -0400
+++ dosbox-x//src/hardware/sblaster.cpp 2017-04-16 01:26:31 -0400
@@ -55,6 +55,7 @@
#include "setup.h"
#include "support.h"
#include "shell.h"
+#include <stdlib.h>
using namespace std;

void MIDI_RawOutByte(Bit8u data);
diff -rupN dosbox-x-Orig//src/winres.rc dosbox-x//src/winres.rc
--- dosbox-x-Orig//src/winres.rc 2017-04-13 02:25:09 -0400
+++ dosbox-x//src/winres.rc 2017-04-16 01:30:18 -0400
@@ -1,5 +1,5 @@

-#include "winres.h"
+#include "afxres.h"
#include "../include/resource.h"

// icon resource

Reply 1164 of 2397, by TheGreatCodeholio

User metadata
Rank Oldbie
Rank
Oldbie

I would be happy to merge that into DOSBox-X if you were to make a merge request on Github.

DOSBox-X project: more emulation better accuracy.
DOSLIB and DOSLIB2: Learn how to tinker and hack hardware and software from DOS.

Reply 1166 of 2397, by TheGreatCodeholio

User metadata
Rank Oldbie
Rank
Oldbie
hail-to-the-ryzen wrote:

Could you merge it using the patch tool? It should incorporate fine except maybe the last few lines which have Windows EOL characters.

I'll try.

DOSBox-X project: more emulation better accuracy.
DOSLIB and DOSLIB2: Learn how to tinker and hack hardware and software from DOS.

Reply 1167 of 2397, by hail-to-the-ryzen

User metadata
Rank Member
Rank
Member

Added the code for allowing nonrecursive_page_fault=false with core=normal, but normal_loop() has code which also assigns values for dosbox_allow_nonrecursive_page_fault. I think this prevents Win9x from booting. I can bypass this issue by reverting the page fault handling code in normal_loop() to the old method. This enables the higher performance in DOS where the frame rates are low.

Edit: ...or the try..catch block in dosbox.cpp.

Reply 1168 of 2397, by TheGreatCodeholio

User metadata
Rank Oldbie
Rank
Oldbie

The code changes are substantial enough that I'm going to go ahead and merge your patch into a branch instead of master. I'll give you a chance to flesh it out there so it can eventually merge into master without breaking Linux or other build scenarios. It is branch 'mingw-testme-20170415-2332-hail-to-the-ryzen'

The reason I ask for git merge requests is that applying the patch from this site is slightly error prone. I had to apply your patch once, then when the patch for the winres.rc file was rejected for not having the same CRLF line endings, hacked the .rej file to add CRLF endings and then fed it back into patch.

DOSBox-X project: more emulation better accuracy.
DOSLIB and DOSLIB2: Learn how to tinker and hack hardware and software from DOS.

Reply 1170 of 2397, by hail-to-the-ryzen

User metadata
Rank Member
Rank
Member

I repeated the tests done earlier. This time I see no performance cost in the dosbox-x page fault handling method. It runs as fast or faster than vanilla dosbox.

I also found why my builds were running slower than expected. I had activated the fpu-x86 core instead of the fpu interpreter core with core=normal. For an unknown reason, running the fpu interpreter core in this case is faster than the x86 version! Once the x86 version is disabled, as by default in dosbox-x, then the performance is more similar to vanilla dosbox. I missed this because past testing typically showed a 50% performance decrease with the fpu interpreter core, but more careful testing on recent versions shows this different result.

Reply 1172 of 2397, by TheGreatCodeholio

User metadata
Rank Oldbie
Rank
Oldbie

I just pulled out an old IBM PC with CGA. Can anyone here verify my notes on the CGA card? It would help with DOSBox-X emulation.

https://github.com/joncampbell123/dosbox-x/issues/256

DOSBox-X project: more emulation better accuracy.
DOSLIB and DOSLIB2: Learn how to tinker and hack hardware and software from DOS.

Reply 1173 of 2397, by TheGreatCodeholio

User metadata
Rank Oldbie
Rank
Oldbie
hail-to-the-ryzen wrote:
This line is repeated 2x in cpu.cpp: […]
Show full quote

This line is repeated 2x in cpu.cpp:

if (enable_cmpxchg8b) reg_edx |= 0x100; /* CMPXCHG8B */

Added to bug tracker.

DOSBox-X project: more emulation better accuracy.
DOSLIB and DOSLIB2: Learn how to tinker and hack hardware and software from DOS.

Reply 1174 of 2397, by Myloch

User metadata
Rank Oldbie
Rank
Oldbie

Munt 2.1 released. Will new version of mt32 emulation be added to dosbox_x? Some members said it sounds better

"Gamer & collector for passion, I firmly believe in the preservation and the diffusion of old/rare software, against all personal egoisms"

Reply 1175 of 2397, by TheGreatCodeholio

User metadata
Rank Oldbie
Rank
Oldbie
Myloch wrote:

Munt 2.1 released. Will new version of mt32 emulation be added to dosbox_x? Some members said it sounds better

I don't have the means to test MT32 emulation, so it will only end up in DOSBox-X if someone writes a patch or submits a pull request for me to merge.

DOSBox-X project: more emulation better accuracy.
DOSLIB and DOSLIB2: Learn how to tinker and hack hardware and software from DOS.

Reply 1176 of 2397, by TheGreatCodeholio

User metadata
Rank Oldbie
Rank
Oldbie

MS-DOS remote control TSR. Anyone need such a tool?

It lets you control an MS-DOS PC through the serial port, including reading/writing memory and I/O ports and uploading/downloading files.

The client-side is currently written to run on Linux, but theoretically could be compiled for MinGW/Cywgin if you tried.

https://github.com/joncampbell123/doslib/tree … l/remctl/serial

DOSBox-X project: more emulation better accuracy.
DOSLIB and DOSLIB2: Learn how to tinker and hack hardware and software from DOS.

Reply 1177 of 2397, by Yesterplay80

User metadata
Rank Oldbie
Rank
Oldbie
TheGreatCodeholio wrote:

I don't have the means to test MT32 emulation, so it will only end up in DOSBox-X if someone writes a patch or submits a pull request for me to merge.

There's a patch file already provided with the source code of MUNT: https://github.com/munt/munt/tree/master/DOSBox-mt32-patch

My full-featured DOSBox SVN builds for Windows & Linux: Vanilla DOSBox and DOSBox ECE (Google Drive Mirror)

Reply 1178 of 2397, by hail-to-the-ryzen

User metadata
Rank Member
Rank
Member

In pic.cpp:

	if (CPU_CycleLeft > 0) {
if (PIC_IRQCheck)
PIC_runIRQs();
...
}

if (PIC_IRQCheck)
PIC_runIRQs();

PIC_runIRQs runs 2x if CPU_CycleLeft >0. Is that as intended?

Reply 1179 of 2397, by TheGreatCodeholio

User metadata
Rank Oldbie
Rank
Oldbie
hail-to-the-ryzen wrote:
In pic.cpp: […]
Show full quote

In pic.cpp:

	if (CPU_CycleLeft > 0) {
if (PIC_IRQCheck)
PIC_runIRQs();
...
}

if (PIC_IRQCheck)
PIC_runIRQs();

PIC_runIRQs runs 2x if CPU_CycleLeft >0. Is that as intended?

No, but it can't hurt.
But I'll add it to the issue tracker as a potential (very minor) performance gain optimization to check. If removing it breaks anything then it stays.

DOSBox-X project: more emulation better accuracy.
DOSLIB and DOSLIB2: Learn how to tinker and hack hardware and software from DOS.