VOGONS


First post, by dvwjr

User metadata
Rank Member
Rank
Member

I tried to use the Num Pad '5' key the other day while comparing the functionality of the game "Silent Hunter" under the DOSBOX v0.63 environment versus the native WinXP NTVDM DOS emulation. The keyboard did not function the same as it did under the WinXP NTVDM emulation environment.

I decided to check out any more anomalies in the scan code table built into DOSBOX v0.63 as compared to both an actual DOS and a WinXP NTVDM environment. There are some differences which are not due to the documented dedicated DOSBOX function keys, in fact there are 52 of them.

This will represent the differences between the scan-code recognition of the Windows XP (SP2) NTVDM console and the DOSBOX version 0.63 Win32 release.

There are 52 pair-differences listed below. These are just the scan-codes results from the utility program SCODE.COM which were performed on an IBM 101 key "M"-style keyboard . The testing as performed on the same computer under MSDOS v8.0, the NTVDM DOS emulation environment of Windows XP (SP2) and of course DOSBOX v0.63 on Windows XP (SP2).

This message has an attached ZIP file which contains the following documents and utility program:

a.) Complete scan-code list for IBM keyboard under MsDOS v8.0 and the WinXP (SP2) NTVDM console. The results were identical as for both operating systems long as all seven Windows 'shortcut' key definitions are disabled. There are 363 listed scan-code combinations detailed.

b.) Complete scan-code list for IBM keyboard under DOSBOX v0.63 running under Windows XP (SP2). There are 363 listed scan-code combinations detailed.

c.) Complete listing of the difference between a.) and b.) listed above, minus the dedicated DOSBOX v0.63 function keys. There are 52 pair-differences between the Windows/DOS standard and what appears to be the scan-code table implemented in the current DOSBOX release.

d.) The DOS scan-code utility program SCODE.COM (version 2.2) and documentation freeware by author/programmer Paul Postuma. Many thanks for his utility. Just load it at the DOS prompt and start hitting the keys...

It appears that DOSBOX v0.63 does not define scan-codes for some key combinations or individual keys. In some cases it appears to provide too much information in the AX registers when that particular scan-code information should be restricted to the BIOS data area. There are a few cases where the incorrect scan-codes are provided.

Here are the anomalies:

  Key-stroke:      Scan code:    ASCII code:     Code in:
hex dec hex dec AX BIOS
-------------------------------------------------------------------------------
1) F11 00 00 00 00 0000 8500 (MSDOS 8 & WinXP)
F11 Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

2) F12 00 00 00 00 0000 8600 (MSDOS 8 & WinXP)
F12 Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

3) NUM pad 5 00 00 00 00 0000 4CF0 (MSDOS 8 & WinXP)
NUM pad 5 4C 76 00 00 4C00 4C00 (DOSBOX v0.63)

4) NUM pad / 35 53 2F 47 352F E02F (MSDOS 8 & WinXP)
NUM pad / 35 53 2F 47 352F 352F (DOSBOX v0.63)

5) NUM pad Enter 1C 28 0D 13 1C0D E00D (MSDOS 8 & WinXP)
NUM pad Enter 1C 28 0D 13 1C0D 1C0D (DOSBOX v0.63)

6) SHFT - F11 00 00 00 00 0000 8700 (MSDOS 8 & WinXP)
SHFT - F11 Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

7) SHFT - F12 00 00 00 00 0000 8800 (MSDOS 8 & WinXP)
SHFT - F12 Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

8) SHFT Num / 35 53 2F 47 352F E02F (MSDOS 8 & WinXP)
SHFT Num / 35 53 3F 63 353F 353F (DOSBOX v0.63)

9) SHFT Num Enter 1C 28 0D 13 1C0D E00D (MSDOS 8 & WinXP)
SHFT Num Enter 1C 28 0D 13 1C0D 1C0D (DOSBOX v0.63)

10) CTRL - Tab 00 00 00 00 0000 9400 (MSDOS 8 & WinXP)
CTRL - Tab Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

11) CTRL - Esc 01 1 1B 27 011B 011B (MSDOS 8 & WinXP)
CTRL - Esc Intecepted by WinXP, exit DOSBOX xxxx (DOSBOX v0.63)

12) CTRL - TU 00 00 00 00 0000 8DE0 (MSDOS 8 & WinXP)
CTRL - TU 00 00 00 00 0000 00E0 (DOSBOX v0.63)

13) CTRL - TD 00 00 00 00 0000 91E0 (MSDOS 8 & WinXP)
CTRL - TD 00 00 00 00 0000 00E0 (DOSBOX v0.63)

14) CTRL - Ins 00 00 00 00 0000 92E0 (MSDOS 8 & WinXP)
CTRL - Ins 00 00 00 00 0000 00E0 (DOSBOX v0.63)

15) CTRL - Del 00 00 00 00 0000 93E0 (MSDOS 8 & WinXP)
CTRL - Del 00 00 00 00 0000 00E0 (DOSBOX v0.63)

16) CTRL - NUM Ins 00 00 00 00 0000 9200 (MSDOS 8 & WinXP)
CTRL - NUM Ins Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

17) CTRL - NUM Del 00 00 00 00 0000 9300 (MSDOS 8 & WinXP)
CTRL - NUM Del Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

18) CTRL - NUM ND 00 00 00 00 0000 9100 (MSDOS 8 & WinXP)
CTRL - NUM ND Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

19) CTRL Num 5 00 00 00 00 0000 8F00 (MSDOS 8 & WinXP)
CTRL Num 5 Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

Show last 99 lines
20) CTRL - NUM NU   00   00       00   00        0000   8D00 (MSDOS 8 & WinXP)
CTRL - NUM NU Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

21) CTRL - Num / 00 00 00 00 0000 9500 (MSDOS 8 & WinXP)
CTRL - Num / Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

22) CTRL - Num * 00 00 00 00 0000 9600 (MSDOS 8 & WinXP)
CTRL - Num * Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

23) CTRL - Num - 00 00 00 00 0000 8E00 (MSDOS 8 & WinXP)
CTRL - Num - Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

24) CTRL - Num + 00 00 00 00 0000 9000 (MSDOS 8 & WinXP)
CTRL - Num + Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

25) CTRL - Enter 1C 28 0A 10 1C0A E00A (MSDOS 8 & WinXP)
CTRL - Enter 1C 28 0A 10 1C0A 1C0A (DOSBOX v0.63)

26) ALT - ` 00 00 00 00 0000 29F0 (MSDOS 8 & WinXP)
ALT - ` Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

27) ALT - BckSp 00 00 00 00 0000 0EF0 (MSDOS 8 & WinXP)
ALT - BckSp Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

28) ALT - [ 00 00 00 00 0000 1AF0 (MSDOS 8 & WinXP)
ALT - [ Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

29) ALT - ] 00 00 00 00 0000 1BF0 (MSDOS 8 & WinXP)
ALT - ] Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

30) ALT - \ 00 00 00 00 0000 2BF0 (MSDOS 8 & WinXP)
ALT - \ Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

31) ALT - ; 00 00 00 00 0000 27F0 (MSDOS 8 & WinXP)
ALT - ; Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

32) ALT - ' 00 00 00 00 0000 28F0 (MSDOS 8 & WinXP)
ALT - ' Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

33) ALT - , 00 00 00 00 0000 33F0 (MSDOS 8 & WinXP)
ALT - , Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

34) ALT - . 00 00 00 00 0000 34F0 (MSDOS 8 & WinXP)
ALT - . Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

35) ALT - / 00 00 00 00 0000 35F0 (MSDOS 8 & WinXP)
ALT - / Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

36) ALT - F11 00 00 00 00 0000 8B00 (MSDOS 8 & WinXP)
ALT - F11 Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

37) ALT - F12 00 00 00 00 0000 8C00 (MSDOS 8 & WinXP)
ALT - F12 Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

38) ALT - TL 00 000 00 00 0000 9B00 (MSDOS 8 & WinXP)
ALT - TL 9B 155 00 00 9B00 9B00 (DOSBOX v0.63)

39) ALT - TR 00 000 00 00 0000 9D00 (MSDOS 8 & WinXP)
ALT - TR 9D 157 00 00 9D00 9D00 (DOSBOX v0.63)

40) ALT - TU 00 000 00 00 0000 9800 (MSDOS 8 & WinXP)
ALT - TU 98 152 00 00 9800 9800 (DOSBOX v0.63)

41) ALT - TD 00 000 00 00 0000 A000 (MSDOS 8 & WinXP)
ALT - TD A0 160 00 00 A000 A000 (DOSBOX v0.63)

42) ALT - Ins 00 000 00 00 00000 A200 (MSDOS 8 & WinXP)
ALT - Ins A2 162 00 00 A200 A200 (DOSBOX v0.63)

43) ALT - Del 00 000 00 00 0000 A300 (MSDOS 8 & WinXP)
ALT - Del A3 163 00 00 A300 A300 (DOSBOX v0.63)

44) ALT - Home 00 000 00 00 0000 9700 (MSDOS 8 & WinXP)
ALT - Home 97 151 00 00 9700 9700 (DOSBOX v0.63)

45) ALT - End 00 000 00 00 0000 9F00 (MSDOS 8 & WinXP)
ALT - End 9F 159 00 00 9F00 9F00 (DOSBOX v0.63)

46) ALT - PgUp 00 000 00 00 0000 9900 (MSDOS 8 & WinXP)
ALT - PgUp 99 153 00 00 9900 9900 (DOSBOX v0.63)

47) ALT - PgDn 00 000 00 00 0000 A100 (MSDOS 8 & WinXP)
ALT - PgDn A1 161 00 00 A100 A100 (DOSBOX v0.63)

48) ALT - Num / 00 000 00 00 0000 A400 (MSDOS 8 & WinXP)
ALT - Num / Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

49) ALT - Num * 00 000 00 00 0000 37F0 (MSDOS 8 & WinXP)
ALT - Num * Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

50) ALT - Num - 00 000 00 00 0000 4AF0 (MSDOS 8 & WinXP)
ALT - Num - Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

51) ALT - Num + 00 000 00 00 0000 4EF0 (MSDOS 8 & WinXP)
ALT - Num + Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

52) ALT - Num Enter 00 000 00 00 0000 A600 (MSDOS 8 & WinXP)
ALT - Num Enter Not Defined Not Defined 0000 0000 (DOSBOX v0.63)

This may be of some help to the DOSBOX authors/programmers, perhaps
also to those who might have run into their own keyboard glitches...

Hope this helps,

dvwjr

Attachments

  • Filename
    ScanCodeInfo.zip
    File size
    28.31 KiB
    Downloads
    394 downloads
    File comment
    Text file with scan codes and DOS utility program.
    File license
    Fair use/fair dealing exception

Reply 1 of 9, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

Thanks dvwjr - I am sure that list will prove useful.

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 2 of 9, by dvwjr

User metadata
Rank Member
Rank
Member

I should have added:

Windows XP (SP2) NTVDM, MSDOS v8.0, DOSBOX v0.63
Scancodes for IBM 101 keyboard.

There are 363 possible scan-codes, of which 13 are undefined
and 10 are used for special character entry.

Abbreviations used:

TL = Tee-Arrow Left NL = Num Pad Arrow Left
TR = Tee-Arrow Right NR = Num Pad Arrow Right
TU = Tee-Arrow Up NU = Num Pad Arrow Up
TD = Tee-Arrow Down ND = Num Pad Arrow Down

dvwjr

Reply 3 of 9, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

At least win9x did some remapping to the keys, so you
should NOT use anything else than real dos on a
real machine to check keyboard things.
This does not mean that dosbox has all scancodes
100% correct though.

wd

Reply 4 of 9, by dvwjr

User metadata
Rank Member
Rank
Member

At least win9x did some remapping to the keys, so you
should NOT use anything else than real dos on a
real machine to check keyboard things.

True, that is why the IBM keyboard scan-codes were checked in three cases:

1.) MSDOS v8.0 (the DOS from WinXP when you create a boot floppy, it is from Windows ME put there by Microsoft)

2.) The Windows XP (SP2) NTVDM native DOS emulation

3.) The DOSBOX v0.63 DOS/PC emulation environment.

The results were that MSDOS v8.0 and WinXP NTVDM provided identical results, that is Microsoft provides an exact duplication of a real DOS keyboard environment in their WinXP NTVDM subsystem. This means that all programs written to the DOS keyboard standard will function as far as the keyboard inputs in the NTVDM environment.

DOSBOX v0.63 however has some changes needed to be exactly compatible with the DOS keyboard standard. They are listed in the first message in this thread and in the attached ZIP file. Perhaps also it might be possible to put a syncronization routine in the DOSBOX product or its underlying libraries to support the Num Lock, Caps Lock and Scroll lock keys. If the focus is taken off a DOSBOX window and the status of the NumLock key is changed the sync is lost. The other thing to consider would to copy the Windows NT/2K/XP/2003 NTVDM idea of being able to have an option to disable the so called seven "windows shortcut keys" (ALT-ENTER, ALT-TAB, etc) so that the dedicated DOSBOX function keys (CTRL-F7, CTRL-F8, etc) are no longer functional and trapped by DOSBOX for a particular session.

When DOSBOX has exact compatibility with the DOS keyboard standard it will be well positioned to be THE Dos/PC emulation environment when Windows transistions to a 64-bit code-base and finally dumps any 16-bit compatibility overboard.

dvwjr

Reply 7 of 9, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

Regardless, there's no reason to add the extra variable of using dos from xp/me/etc with original dos images readily available.

Last edited by ih8registrations on 2005-10-18, 21:28. Edited 1 time in total.

Reply 9 of 9, by `Moe`

User metadata
Rank Oldbie
Rank
Oldbie
fish wrote:

I thought the winxp boot console was derived from win NT cmd rather than dos/win9x command.com/io.sys et al.

The boot console (also known as recovery mode) is NT-based. Bootable _diskettes_ (as created by the disk formatting program) are good old DOS, and thus yield perfectly valid results.