nanogui: Thread: Re: mwin


[<<] [<] Page 1 of 1 [>] [>>]
Subject: Re: mwin
From: "Greg Haerr" ####@####.####
Date: 20 Jan 2000 20:38:00 -0000
Message-Id: <033501bf6384$29f63f20$15320cd0@gregh>

Victor,
    I think I have finally figured out this "short" madness in your
DJGPP port, by looking at it.  I can't run it, so you'll have to test.

The only call that could possibly make a difference is line 221
of devmouse.c, in function GdReadMouse - 

    GdMoveMouse(xpos + x, ypos + y);

Now, I think what the problem is, is that x and y are NOT sign
extended, and that's why you need to declare the parms as shorts.
However, this is NOT the fix.  The real problem is that x and y
are read from the mouse driver on line 186:

    status = mousedev.Read(&x, &y, &z, &newbuttons);

Now, it turns out that you're using the MSDOS mouse driver,
which I have only tested compiled with a 16 bit driver.  So if
you look at mou_dos.c, line 100:

    *x = regset.x.cx;
    *y = regset.x.dx;

I think the compiler is copying an unsigned short value into a 32 bit
int.  It needs sign extension.  I'll bet that the following fixes the whole
damn mess:

    *x = (short)regset.x.cx;
    *y = (short)regset.x.dx;

Try it.  Let me know.  If this works, I'll remove your other patches
and we'll have a clean DJGPP port.

Regards,

Greg


[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.