From e3bd18a68d947c7fb36e21f8ff539293adc3c58b Mon Sep 17 00:00:00 2001 From: leecher1337 Date: Tue, 2 Jun 2020 12:49:45 +0200 Subject: [PATCH] Implement Regkey to re-enable possibility to switch between window magnification sizes. #95 --- ntvdmpatch/doc/patches.txt | 3 ++ ntvdmpatch/patches/minnt/ega_crash.patch | 66 +++++++++++++++++++---- ntvdmpatch/patches/minnt/eyestrain.patch | 11 ++++ ntvdmpatch/release/reg/eyestrain.reg | Bin 0 -> 254 bytes readme.txt | 48 ++++++++++++++--- 5 files changed, 111 insertions(+), 17 deletions(-) create mode 100644 ntvdmpatch/patches/minnt/eyestrain.patch create mode 100644 ntvdmpatch/release/reg/eyestrain.reg diff --git a/ntvdmpatch/doc/patches.txt b/ntvdmpatch/doc/patches.txt index 8fe0219..a41b874 100644 --- a/ntvdmpatch/doc/patches.txt +++ b/ntvdmpatch/doc/patches.txt @@ -37,6 +37,9 @@ ega_crash.patch - Console graphics is required, as newer Windows display crashes when not properly checked, so added checks for this. emm.patch - Fixes a little problem in the EMM-Manager +eyestrain.patch - Commandline parameters like the hotkey to change video + size can't get passed to NTVDM in newer windows versions, + therefore, parameter is read from registry cpuenv key framerate.patch - Increase screen refresh rate so that Video graphics output is smoother and not so choppy anymore. fixexe.patch - It seems like the creator of the OpenNT package diff --git a/ntvdmpatch/patches/minnt/ega_crash.patch b/ntvdmpatch/patches/minnt/ega_crash.patch index 03f8478..ae38fc0 100644 --- a/ntvdmpatch/patches/minnt/ega_crash.patch +++ b/ntvdmpatch/patches/minnt/ega_crash.patch @@ -1,30 +1,78 @@ --- NT4\private\mvdm\softpc.new\host\src\nt_ega.c +++ nt\private\mvdm\softpc.new\host\src\nt_ega.c 590a591,592 -> int max_width = sc.PC_W_Width >> 1, -> max_height = sc.PC_W_Height >> 1; -608c610 +> int max_width = 320, +> max_height = 200; +608,609c610,615 < if( height>200 || width>40 ){ ---- -> -609c612,616 < assert2( NO, "VDM: nt_ega_lo_graph_std() w=%d h=%d", width, height ); --- +> > if ((screen_x >= max_width) || (screen_y >= max_height)) > { > sub_note_trace2(EGA_HOST_VERBOSE, > "VDM: nt_ega_lo_graph_std() x=%d y=%d", > screen_x, screen_y); -611a624,627 +611a618,621 > if (screen_x + width > max_width) > width = max_width - screen_x; > if (screen_y + height > max_height) > height = max_height - screen_y; -672c688 +672c682 < while(--local_width); --- > while((--local_width)>0); -677c693 +677c687 < while(--local_height); --- > while((--local_height)>0); +714a725,726 +> int max_width = 320, +> max_height = 200; +732,733c744,748 +< if( height>200 || width>40 ){ +< assert2( NO, "VDM: nt_ega_lo_graph_big() w=%d h=%d", width, height ); +--- +> if ((screen_x >= max_width) || (screen_y >= max_height)) +> { +> sub_note_trace2(EGA_HOST_VERBOSE, +> "VDM: nt_ega_lo_graph_big() x=%d y=%d", +> screen_x, screen_y); +735a751,754 +> if (screen_x + width > max_width) +> width = max_width - screen_x; +> if (screen_y + height > max_height) +> height = max_height - screen_y; +819c838 +< while( --local_width ); +--- +> while((--local_width)>0); +824c843 +< while(--local_height); +--- +> while((--local_height)>0); +863a883,884 +> int max_width = 320, +> max_height = 200; +883,884c904,908 +< if( height>200 || width>40 ){ +< assert2( NO, "VDM: nt_ega_lo_graph_huge() w=%d h=%d", width, height ); +--- +> if ((screen_x >= max_width) || (screen_y >= max_height)) +> { +> sub_note_trace2(EGA_HOST_VERBOSE, +> "VDM: nt_ega_lo_graph_huge() x=%d y=%d", +> screen_x, screen_y); +886a911,914 +> if (screen_x + width > max_width) +> width = max_width - screen_x; +> if (screen_y + height > max_height) +> height = max_height - screen_y; +996c1024 +< while( --local_width ); +--- +> while((--local_width)>0); +1000c1028 +< } while(--local_height); +--- +> } while((--local_height)>0); diff --git a/ntvdmpatch/patches/minnt/eyestrain.patch b/ntvdmpatch/patches/minnt/eyestrain.patch new file mode 100644 index 0000000..a0ee1f3 --- /dev/null +++ b/ntvdmpatch/patches/minnt/eyestrain.patch @@ -0,0 +1,11 @@ +--- NT4\private\mvdm\softpc.new\host\src\nt_reset.c ++++ nt\private\mvdm\softpc.new\host\src\nt_reset.c +311a312,319 +> #ifndef MONITOR // Newer Windows versions don't have possibility to edit cmdline, so get from env +> if (!BWVKey && (psz=host_getenv(achES))) +> { +> BWVKey = (WORD)strtoul(psz, NULL, 16); +> if (BWVKey > 0xFE) +> BWVKey = 0; +> } +> #endif diff --git a/ntvdmpatch/release/reg/eyestrain.reg b/ntvdmpatch/release/reg/eyestrain.reg new file mode 100644 index 0000000000000000000000000000000000000000..b4538e7e38132c3a5f274a4f158994b306666425 GIT binary patch literal 254 zcmXw!%L>9U5Jk^g@E=M)Ky=~4g$oGK!%L}7*;bQ`&+g{e+~q38b)Ifw&t{}bPd)!ocO>o2#lImGYSoo^ Qcj12+GACrlL}&ljKLv3r-v9sr literal 0 HcmV?d00001 diff --git a/readme.txt b/readme.txt index bde722f..7cff1c7 100644 --- a/readme.txt +++ b/readme.txt @@ -120,11 +120,9 @@ setting a registry key. Some registry keys also need to be set to show that the NTVDM is present and can get called. -So this is all rather complex, but it sort of works (except DPMI-stuff, -which doesn't seem to work too well or still crash for unknown resons) -with some patches to the operating system. It's enough as a -proof-of-concept and to use it for most business applications and even some -games. +So this is all rather complex, but it sort of works with some patches to +the operating system. It's enough as a proof-of-concept and to use it for +most business applications and even some games. Cool, where can I get it? ========================= @@ -151,7 +149,9 @@ There are various "flavours" of NTVDM that can be built: The original NT4 NTVDM. Maybe the easiest version to build, but it doesn't have multilanguage and lacks some features like LFN This has been the default repository until Feb/2020 where - development has been switches to MINNT tree. + development has been switched to MINNT tree. + This build method therefore is DEPRECATED in favour of the + MINNT build systemand will not receive any future updates! Please note that you need Windows XP for building. Build instructions in: doc\old-src.txt * HAXM @@ -225,6 +225,10 @@ I want to have a proper soundcard emulation MINNT build supports AdLib soundcard emulation by incorporating code parts of SoundFX2000 into NTVDM SB20 emulation. +To make it more clear: + As MUSIC device, select AdLib + As SOUND device, select Soundblaster 2.0 + But you can also try to use the real http://www.softsystem.co.uk/products/soundfx.htm @@ -234,7 +238,8 @@ see: https://github.com/leecher1337/ntvdmx64/issues/40#issuecomment-510697281 But it sometimes causes applications to hang and not react to keyboard -input. +input, so only try it if the NTVDM internal sound emulation isn't good +enough for your needs. The PC speaker output is choppy and generally inaccurate, I want my PC @@ -265,11 +270,33 @@ you are launching your 16 bit application from needs to be restarted. If unsure, you can reboot your machine after installation/uninstallation of WineVDM handlers. -To debug winevdm, before launching your application: +To debug wow32, before launching your application: set WOWTRACE=C:\log.txt set WOWLOGLVL=16 +Is there a way to enlarge the graphics window? +--------------------------------------------------------------------------- +You can use the EyeStrain parameter for this. +Just execute reg\eyestrain.reg from the release-folder of NTVDMx64 and +as soon as the parameter is set, you can switch between 3 variants of +graphics display (Standard - Big - Huge) by pressing the "Scroll Lock" key. +This only works in graphics mode! + +Here is how it works: +The .reg file creates a REG_SZ key named "EyeStrain" under +HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WOW\CpuEnv +which contains the string representatino of a hex value of the VK_ +virtual key code that needs to be checked for in order to switch between +magnificaton sizes. The .reg file contains "91" as value, as 0x91 is the +VK_SCROLL. +You can find a list of Virtual keycodes here and change it accordingly: +https://nehe.gamedev.net/article/msdn_virtualkey_codes/15009/ + +Further explanation how it used to work on MIPS/Alpha builds: +https://github.com/leecher1337/ntvdmx64/issues/95#issuecomment-637202206 + + I want to use my mouse in my textmode application and not select text --------------------------------------------------------------------------- You forgot to disable QuickEdit mode of the windows console. @@ -281,6 +308,11 @@ I want to print to my windows GDI printer Google "DOSPR.ZIP" +Why doesn't QUAKE work? +--------------------------------------------------------------------------- +http://www.delorie.com/djgpp/v2faq/faq18_6.html + + Are there any documents that describe the inner workings of the NTVDM subsystem? ---------------------------------------------------------------------------