VOGONS


First post, by pantercat

User metadata
Rank Newbie
Rank
Newbie

Hi, in Pereda Connection, a spanish graphic adventure, the internal mouse position is not correct (the mouse click is not sent where the mouse is displayed).

DOSBox >= 0.60 ...NOT OK
DOSBox = 0.58 ....OK

Related -> Bug #126 Mouse position problem in CM93 (fixed in 0.60) https://sourceforge.net/p/dosbox/bugs/126/

So I opened dosbox-0.58/src/ints/mouse.cpp and dosbox-0.60/src/ints/mouse.cpp in meld to see the differences. Here's a patch.

--- dosbox-r4275/src/ints/mouse.cpp	2019-04-21 00:50:31.000000000 +0200
+++ dosbox-r4275-patched/src/ints/mouse.cpp 2019-10-27 02:47:56.486745771 +0200
@@ -421,7 +421,7 @@
Bit16s x,y;
Bit16u addx1,addx2,addy;
Bit16u dataPos = 0;
- Bit16s x1 = POS_X / xratio - mouse.hotx;
+ Bit16s x1 = POS_X - mouse.hotx;
Bit16s y1 = POS_Y - mouse.hoty;
Bit16s x2 = x1 + CURSORX - 1;
Bit16s y2 = y1 + CURSORY - 1;
@@ -437,7 +437,7 @@
dataPos += addx2;
};
mouse.background= true;
- mouse.backposx = POS_X / xratio - mouse.hotx;
+ mouse.backposx = POS_X - mouse.hotx;
mouse.backposy = POS_Y - mouse.hoty;

// Draw Mousecursor

With this patch applied on top of vanilla r4275 mouse behaviour is fine again in Pereda Connection, but obviously mouse position in CM93 is wrong again. It would be possible to make it work in both cases?

Anything you need just ask 😀 Thank you very much.

Last edited by pantercat on 2019-10-29, 00:04. Edited 1 time in total.

Reply 1 of 2, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I see the same behavior as current source when loading mouse drivers (MS Mouse, CuteMouse, QTronix, et al.) The MANUAL.TXT file included with the game recommends not using the mouse, and one has to wonder why that would be recommended... In any case, I'm leaning toward this being an issue with the game itself and not with the internal mouse driver emulation of DOSBox.

Reply 2 of 2, by pantercat

User metadata
Rank Newbie
Rank
Newbie

I agree. I forgot to try other mouse drivers. Anyway here is a patch to adapt cutemouse v1.9 to the game for anyone interested.

--- CTMOUSE.ASM	2002-10-01 02:09:00.000000000 +0200
+++ CTMOUSE.ASM.PATCHED 2019-10-28 22:07:11.006362000 +0100
@@ -1279,6 +1279,7 @@
;ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ

graphcursor proc
+ shl ax,1
sub ax,[hotspot.X] ; virtual X
sub bx,[hotspot.Y] ; virtual Y
mov si,16 ; cursor height