[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 0 of 1] Fix for DOS keyboard problems

From: malc
Subject: Re: [Qemu-devel] [PATCH 0 of 1] Fix for DOS keyboard problems
Date: Tue, 25 Aug 2009 18:50:12 +0400 (MSD)

On Mon, 24 Aug 2009, Stefan Ring wrote:

> On Mon, Aug 24, 2009 at 5:34 PM, malc<address@hidden> wrote:
> > On Mon, 24 Aug 2009, Stefan Ring wrote:
> >
> >> > There's other DOS application that exhibits erroneous keyboard
> >> > beahviour and i was curious whether your hack "fixes" it too (alas
> >> > it doesn't) - Command and Conquer, the demo can be found at:
> >> >
> >> > http://www.dosgamesarchive.com/download/command-and-conquer/
> >> >
> >> > Keyboard is dysfunctional in both the setup and the game. What i'm
> >> > wondering now if this is a indeed pckbd or BIOS problem, but Bochs
> >> > where the former can be verified refuses to work on my machines,
> >> > perhaps someone could give it a try and report here?
> >>
> >> I just tried to run C&C on QEMU, VirtualBox and Bochs. Unfortunately,
> >> the game itself crashed immediately during startup, but the setup
> >> program worked. It also accepts keyboard input for specifying sound
> >> hardware parameters. The results:
> >
> > I'm confused. Should the above be interpreted as: keyboard works in
> > setup under Bochs, or?
> No. I just meant that there is a way to test keyboard input in the
> setup program because it would accept keyboard input if it worked. It
> does not work in any of the three.

Red herring, but good enough excuse to brush up my long forgotten re-ing
skils, C&C's code does this:

cseg01:0003550B                 mov     bl, 60h
cseg01:0003550D                 mov     bh, 6
cseg01:0003550F                 mov     eax, 200h
cseg01:00035514 loc_35514:                              ; CODE XREF: 
cseg01:00035514                 int     31h             ; DPMI Services   
ax=func xxxxh
cseg01:00035514                                         ; GET REAL MODE 
cseg01:00035514                                         ; BL = interrupt number
cseg01:00035514                                         ; Return: CF clear, 
CX:DX = segment:offset of real mode interrupt handler
cseg01:00035516                 jb      loc_356DC
cseg01:0003551C                 or      cx, dx
cseg01:0003551F                 jz      short loc_3552C
cseg01:00035521                 inc     bl
cseg01:00035523                 dec     bh
cseg01:00035525                 jnz     short loc_35514
cseg01:00035527                 jmp     loc_356DC

Basically iterating over interrupts 0x60..0x66 looking for an empty
slot if none was found it basically skips the whole installation of
keyboard handling routine and hence keyboard doesn't work.

Connecting gdbstub and doing "set *(long*)384 = 0" inside gdb prior
to running C&C's setup, made keyboard "functional".

So BIOS and some interesting expectations of C&C are to blame here
not pckbd.c.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]