Skip to content

Commit

Permalink
Implement Regkey to re-enable possibility to switch between window ma…
Browse files Browse the repository at this point in the history
…gnification sizes. #95
  • Loading branch information
leecher1337 committed Jun 2, 2020
1 parent f5696f4 commit e3bd18a
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 17 deletions.
3 changes: 3 additions & 0 deletions ntvdmpatch/doc/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
66 changes: 57 additions & 9 deletions ntvdmpatch/patches/minnt/ega_crash.patch
Original file line number Diff line number Diff line change
@@ -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);
11 changes: 11 additions & 0 deletions ntvdmpatch/patches/minnt/eyestrain.patch
Original file line number Diff line number Diff line change
@@ -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
Binary file added ntvdmpatch/release/reg/eyestrain.reg
Binary file not shown.
48 changes: 40 additions & 8 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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?
=========================
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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?
---------------------------------------------------------------------------
Expand Down

0 comments on commit e3bd18a

Please sign in to comment.