VOGONS

Common searches


XCOM Apoc/WIn2k mouse problem

Topic actions

  • This topic is locked. You cannot reply or edit posts.

First post, by peter

User metadata
Rank Newbie
Rank
Newbie

ech; sorry to bother and for the new thread, but having read all the forums here at vogons and at xcomufo site didn't find anyone to solve it; the problem is with mouse under win2k in xcom apocalypse; it gets stuck in the upper left corner of the screen (when i launch the game it's in the middle then any move moves it to top left position); the box it's stuck to is ca 80x25 pixels; i tried numerous ways to fight it:
a) ps2 and serial mice (two different ones 😉 )
b) switching video cards (to give another driver a try to emulate vesa better)
c) mouseset and mousectl utilities (the adress an issue where a mouse is stuck in window 640x200 i think, both don't change anything)
d) setting mouse range via before the game in my own program (launched the xcom from it) via int33 functions 7 and 8 (or so, anyway didn't help anything)
e) changing deafult dimensions of console (from 80x25) to lauch the game
f) vdms (i don't know why it should help but tried 😉 )
g) tried to disasm the ufo2p.exe but was lost as it's encrypted?
help, help, help needed, any suggestions appreciated

Reply 1 of 12, by vladr

User metadata
Rank Oldbie
Rank
Oldbie

Yeah, 80x25 definitely looks like NTVDM.EXE thinks that the game is in text-mode. Can you check, from your TSR, if it's called? Your INT33 handler may be replaced by Windows when the game switches in p-mode, I really wouldn't know exactly.

V.

Reply 2 of 12, by peter

User metadata
Rank Newbie
Rank
Newbie

well, thanks for suggestion, i learned something; btw: your (vladr's 😉 ) mouseset was an invaluable help; the first program you asked about which set the range for cursor wasn't even resident (i execl-ed the xcomapoc.exe from it), it just did set the range and launched xcom; now i know how naive it was; so, here's the log of int 33h executions i managed to get (yes, it's from "heavily" modified mouseset 😉 ) (it only looks big and messy) :

no of events=12
int 33h called no= 0 cs:ip=161c:2e38 ax=0000/ 0 bx=0000/ 0 cx=0000/ 0 dx=0000/ 0
int 33h called no= 1 cs:ip=dbca:06ad ax=0015/ 21 bx=2dc4/11716 cx=05b8/ 1464 dx=039a/ 922
int 33h called no= 2 cs:ip=dbca:06ad ax=0015/ 21 bx=2dc4/11716 cx=05b8/ 1464 dx=039a/ 922
int 33h called no= 3 cs:ip=dbca:06ad ax=0000/ 0 bx=0209/ 521 cx=030f/ 783 dx=0008/ 8
int 33h called no= 4 cs:ip=dbca:06ad ax=0002/ 2 bx=0033/ 51 cx=0000/ 0 dx=2c7c/11388
int 33h called no= 5 cs:ip=dbca:06ad ax=0007/ 7 bx=0033/ 51 cx=0000/ 0 dx=1400/ 5120
int 33h called no= 6 cs:ip=dbca:06ad ax=0008/ 8 bx=0033/ 51 cx=0000/ 0 dx=0f00/ 3840
int 33h called no= 7 cs:ip=dbca:06ad ax=0004/ 4 bx=0033/ 51 cx=0a00/ 2560 dx=0780/ 1920
int 33h called no= 8 cs:ip=dbca:06ad ax=000f/ 15 bx=0033/ 51 cx=0001/ 1 dx=0001/ 1
int 33h called no= 9 cs:ip=dbca:0a7e ax=000c/ 12 bx=030f/ 783 cx=001f/ 31 dx=0574/ 1396
int 33h called no= 10 cs:ip=dbca:06ad ax=0004/ 4 bx=0033/ 51 cx=0a00/ 2560 dx=0780/ 1920
int 33h called no= 11 cs:ip=dbca:06ad ax=0000/ 0 bx=6b44/27460 cx=0000/ 0 dx=0000/ 0

well, with proportional font it looks better...[note from Snover: fixed 😀]
this log never changes (all executions brought me the same)
you probably know it better than me but ax==7 is the func for setting horiz range and ax==8 is for vertical, ax==4 sets the pointer position (it works even though it's out of bounds, i think), and ax==0 resets the mouse...
now i'm smarter than before but still know nothing; i tried to set the range for cursor every time a cursor was moved or on all except the first reset and it all just didn't help; what i can think of now is that the range for mouse is set later during a func/int which sets the video mode; it's quite tempting 'cos would explain why the cursor first is in the middle of screen (it was correct when the range was set but invalidated later during setting video) and it jumps to the horrible 80x25 range when any mouse action is taken; well, please suggest anything more - i'll try to intercept int 10 or whatever is responsible for vesa video but i'm really not sure...
help, help, help needed;
and thanks for last clue and a great mouseset (w/source) i'm finally not afraid of int handlers in bc31 😉

Reply 3 of 12, by Harekiet

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Hmm if this looks like it sets a resolution of 5120X2048, then use set position to the mouse in the middle somewhat.

Normally mouse drivers take over the int10 handler and then get max ranges again on a videomode set. It just shouldn't do that on the setting of vesa modes, but the crappy win2k ones seems to do.
Would set the res back to 640x200 looking like 80x25 box since the game expect such a high resolution 😀

Might have to make a special int10 and int33, the int33 handler storing the last set resolution and mickey ratio. The int10 handler putting those values back into the real int33 handler after a modeset.

Reply 4 of 12, by peter

User metadata
Rank Newbie
Rank
Newbie

yes, perheaps it's a little strange, cos' if it was a text mode then it'd be set correctly (in text both dimensions are multiplied by 8, so this one would be 640x480); of course the sad part is that it's graph mode; bt even worse: the set pos works correctly but it shouldn't; well, it was quite late yesterday, so it's very good that someone that still can think clearly makes me know the basic conclusions coming from that log 😉 thanks, i'll check it

Reply 5 of 12, by peter

User metadata
Rank Newbie
Rank
Newbie

well, sorry to spam the forum again with some ridiculous log but it's what i got when logged ints 10h and 33h; xcom does perfectly (imo) what it should; but i doesn't work; the ranges are set AFTER setting the vid mode; i tried to set 640x480 (and some other vals) without 8 multiplier in the boundary values for mouse in int 33h but it seemed to have NO effect; no matter if i set 10 or 640 or 640x8 or whatever - the mouse was always stuck inside the same 80x25 box; this time I really NEED HELP; any clues, suggestions?

oh, here's the stupid log (ripped the messages about printing single chars 😉 via int 10h):
no int cs:ip ax bx cx dx
0 33 179a:2e38 0000 0000 0000 0000
1 10 2187:6554 0f00 0001 3301 0a01
2 33 dbca:06ad 0015 2dc4 0736 039a
3 10 2134:6554 0f00 0001 3301 0a01
4 33 dbca:06ad 0015 2dc4 0736 039a
5 33 dbca:06ad 0000 0209 030f 0008
6 10 dbca:0a7e 4f00 0000 0000 0000
7 10 dbca:0a7e 4f01 0000 0101 0000
8 10 dbca:0a7e 4f02 8101 0101 0000
9 33 dbca:06ad 0002 0033 0000 2c7c
10 33 dbca:06ad 0007 0033 0000 1400
11 33 dbca:06ad 0008 0033 0000 0f00
12 33 dbca:06ad 0004 0033 0a00 0780
13 33 dbca:06ad 000f 0033 0001 0001
14 33 dbca:0a7e 000c 030f 001f 0574
15 33 dbca:06ad 0004 0033 0a00 0780
16 33 dbca:06ad 0000 6b44 0000 0000
17 10 179a:2dcf 0003 1b9e 03b8 14ba

ps.: the last int 10 is for setting back the text mode - i tried to disable it (just in case - it was the dreaded 80x25 res so it better was killed) but it didn't change anything

Reply 6 of 12, by Harekiet

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Well the problem has to be that the win2k mouse driver doesn't call the callback with the correct values. Might want to try and setup your own one, setup the ranges and then see what values you get from win2k.

If the error is there, you should takeover int33 and place your own handler and when the game tries to set his handler you'll call that one. Then have to keep track of resolution yourself and the mickie/ratio. Although i think the win2k mouse handler has correct support mickey/ratio.

Reply 7 of 12, by peter

User metadata
Rank Newbie
Rank
Newbie

that seems sensible and i'm trying to implement it; i intercept int33 function for setting a handler and set my own one which mangles the coordinates the way i want and then passes the execution to the handler defined by the game; the new problem is that it crashes(i get something similar in shape to dos4gw exception msg, i don't see much though in graph mode) probably because xcom is in protected mode (dos4gw) and my function is in ordinary >1M memory (the way i see memory in borland c for dos); i'm trying to figure it out but i don't have much exp in dealing with low level prot mode; please explain a little (at least url, please) how can it be done

Reply 8 of 12, by peter

User metadata
Rank Newbie
Rank
Newbie

well, thanks for all the help, it's finally (or partially 😉 ) solved; in general it works so i can play now (and so i will 😉 ) the only problem that remains is that when you move your mouse the game loses the track of time and speeds up a little (how much probably depends on system); in xcom it's not a problem as there is pause... anyway, big thanks for help; the files are attached but please remember that it's alway better to recompile it from source to be sure it's free of virii (borland c 3.1 for dos)

😎 xcom works... i'm not going to university tomorrow... 😎

Attachments

  • Filename
    mouse2kv_v01.zip
    File size
    11.85 KiB
    Downloads
    338 downloads
    File license
    Fair use/fair dealing exception

Reply 9 of 12, by Snover

User metadata
Rank l33t++
Rank
l33t++

peter, there isn't really a way for virii to infect files here unless someone manages to get the SQL password and inserts into the database a new file. 😀
You could always just make an MD5sum of it, anyway...😀

Good job on this fix. If someone with expertise on the VOGONS team would like to look over it and write a short write-up that would be fab.

Yes, it’s my fault.

Reply 10 of 12, by peter

User metadata
Rank Newbie
Rank
Newbie

😜 i was thinking about those "end-users" and infecting possibly system where they'll execute this exe 'cos i can't guarantee that i'm virii-free; but i'm sure you understood me (you don't think i'm that silly, do you? 😉 ) nevermind (and the zip checksum is sufficient, i think 😉 ) i've just finished xcom: apoc with this patch - the timer problems mentioned before were solved by vdms (vdms rules 😉 )

Last edited by peter on 2003-01-09, 02:21. Edited 1 time in total.

Reply 11 of 12, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

Good job!

Prog works for me for these game:

Magic Carpet 2
Mechwarrior 2
Mechwarrior 2: Mercs
Wing Commander 3

With that said. It looks like this game is fixed. So I'm closing this thread. Another thread can be opened on MouseSet if needed.

How To Ask Questions The Smart Way
Make your games work offline

Reply 12 of 12, by Snover

User metadata
Rank l33t++
Rank
l33t++

Mouse2KV also works for System Shock, which MOUSESET did NOT work for.
It would be nice if it could detect the screen resolution and adjust accordingly, since for games where menus are at 320x240 and the actual game is at 640x480, it makes it really hard to do stuff in the menu. 😀

Yes, it’s my fault.