VOGONS


First post, by IanBrown

User metadata
Rank Newbie
Rank
Newbie

Hello,

(Background: I've used a modified build of dosbox (vc++.net 2003) to get a dos text editor running in windows xp 64 bit, nearly everything runs fine but I'm a bit puzzled by one missing character.)

This problem also appears on the release build of dosbox 0.63 in 32 bit Windows XP

on the dosbox command line, when you hold down the left alt key and type 224 using the numeric keypad to input character 224 (an alpha), dosbox doesn't appear to do anything, however it seems to switch into a waiting state as it then ignores the next key pressed until going back to normal. (oddly when running my text editor it doesn't then wait, it just ignores alt-224 completely)

alt-223 gives a block character, and alt-225 gives a beta, as expected, all other alt combinations seem to work fine too.

I've tried running dosbox with a custom keyboard mapper and with no mapper and this doesn't seem to have any effect. This behaviour also appears whatever screen mode is selected.

I've done a search on all the source files for 224 and for E0 (hex for 224) and can't see anything that gives a clue to explain this behaviour. In bios_keyboard.cpp E0 is a scancode for an extended key, but commenting that out doesn't change the behaviour, as this is a character code not a scancode.

If character 224 exists in a file to be displayed, it displays fine (as an alpha), I just can't seem to enter it from the keyboard.

Thanks, Ian.

Reply 1 of 2, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

hmm that is indeed a bit odd. although that extended key thing is probably the clue.

Water flows down the stream
How to ask questions the smart way!

Reply 2 of 2, by IanBrown

User metadata
Rank Newbie
Rank
Newbie

Yes, it was the extended mode, I've included some sample logging to
illustrate what was passing through bios_keyboard.cpp, along with a
fix that enables alt-224 to work, as well as retaining the use of
the extended mode for cursor keys etc. This applies to version 0.63.

Cheers, Ian.

bios_keyboard.cpp

static Bitu INT16_Handler(void) {
Bit16u temp;
switch (reg_ah) {
case 0x00: /* GET KEYSTROKE */
case 0x10:
{
//TODO find a more elegant way to do this
do {
temp=get_key();
if (temp==0) { CALLBACK_Idle();};
} while (temp==0);
reg_ax=temp;


/* reg_al 223 reg_ax 223 alt-223
* reg_al 224 reg_ax 224 alt-224
* reg_al 225 reg_ax 225 alt-225
*
* reg_al 224 reg_ax 18656 up arrow
* reg_al 224 reg_ax 20704 down arrow
* reg_al 224 reg_ax 19424 left arrow
* reg_al 224 reg_ax 19936 right arrow
*
* reg_al 97 reg_ax 7777 a
* reg_al 98 reg_ax 12386 b
* reg_al 99 reg_ax 11875 c
*
* reg_al 49 reg_ax 20273 1 (numeric keypad)
* reg_al 50 reg_ax 20530 2 (numeric keypad)
* reg_al 51 reg_ax 20787 3 (numeric keypad)
*
* reg_al 49 reg_ax 561 1
* reg_al 50 reg_ax 818 2
* reg_al 51 reg_ax 1075 3
*/
//old if(reg_al==0xe0) reg_al=0; //extended key
if(reg_al==0xe0 && reg_ax!=0xe0) reg_al=0; //extended key and not alt-224

break;
}
case 0x01: /* CHECK FOR KEYSTROKE */
case 0x11:
temp=check_key();
if (temp==0) {
CALLBACK_SZF(true);
} else {
CALLBACK_SZF(false);
reg_ax=temp;
//old if(reg_al==0xe0) reg_al=0; //extended key
if(reg_al==0xe0 && reg_ax!=0xe0) reg_al=0; //extended key and not alt-224
}
break;