qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: malc <av1474@comtv.ru>
To: Stefan Ring <stefanrin@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 0 of 1] Fix for DOS keyboard problems
Date: Tue, 25 Aug 2009 18:50:12 +0400 (MSD)	[thread overview]
Message-ID: <Pine.LNX.4.64.0908251838060.3529@linmac.oyster.ru> (raw)
In-Reply-To: <53e878390908240838gf96e19ev4f486f6c3a90d50b@mail.gmail.com>

On Mon, 24 Aug 2009, Stefan Ring wrote:

> On Mon, Aug 24, 2009 at 5:34 PM, malc<av1474@comtv.ru> 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
cseg01:00035514 loc_35514:                              ; CODE XREF: sub_35410+115\x19j
cseg01:00035514                 int     31h             ; DPMI Services   ax=func xxxxh
cseg01:00035514                                         ; GET REAL MODE INTERRUPT VECTOR
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.

-- 
mailto:av1474@comtv.ru

  parent reply	other threads:[~2009-08-25 14:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-23 10:54 [Qemu-devel] [PATCH 0 of 1] Fix for DOS keyboard problems Stefan Ring
2009-08-23 10:54 ` [Qemu-devel] [PATCH 1 " Stefan Ring
2009-08-23 12:44 ` [Qemu-devel] [PATCH 0 " Jamie Lokier
2009-08-23 17:20   ` Stefan Ring
2009-08-23 21:55     ` Jamie Lokier
2009-08-23 22:54       ` Stefan Ring
2009-08-24  7:50         ` Hans de Bruin
2009-08-24  9:24           ` Jamie Lokier
2009-08-24  9:41             ` Hans de Bruin
2009-08-24  8:21         ` malc
2009-08-24  8:44           ` Stefan Ring
2009-08-24  8:49             ` malc
2009-08-24  9:22             ` Jamie Lokier
2009-08-24  9:27               ` Stefan Ring
2009-08-24  9:31               ` Stefan Ring
2009-08-24 15:11           ` Stefan Ring
2009-08-24 15:34             ` malc
2009-08-24 15:38               ` Stefan Ring
2009-08-24 15:40                 ` malc
2009-08-25 14:50                 ` malc [this message]
2009-08-24 13:03         ` Stefan Ring
2009-08-24 13:07           ` Stefan Ring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0908251838060.3529@linmac.oyster.ru \
    --to=av1474@comtv.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanrin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).