VOGONS

Common searches


Dosbox, UMPC and touchscreen

Topic actions

First post, by gates007ca

User metadata
Rank Newbie
Rank
Newbie

Greetings all,

I have searched the forum and did not find anything specifically useful so I will post my question here. Specific, I have recently bought an UMPC Aigo 8860 and ran dosbox in it. It works except the mouse is going all over the place. I know this may relates to the relative vs, absolute value of the mouse placement but not being computer incline I don't really know how to fix it. I searched and found the following thread:

dosbox and touchscreen

but it talks about recompiling SDL for a new version of dosbox which is well beyond my skill. Given touchscreen UPMC will be more and more populate, does anyone have a solution to get dosbox working on touchscreen UPMC? Or alternative, can someone please post a guide on how to recompile using the right SDL?

I know GP2X F-200 (got the F100 and have been hitting myself missing out on the F200) got the touchscreen support but if someone can post a solution that would be great.... Viliv S5, mbook M1 and other touchscreen UMPC will be benefiting from this!

Thanks!

Gates

Reply 1 of 24, by gates007ca

User metadata
Rank Newbie
Rank
Newbie

No takers? Would touchscreen support be included in the next release of DOSBOX? If not, and if some one can guide me to recompile dosbox, which SDL should I obtain for the compilation? Thanks in advance for your help!

Reply 2 of 24, by Pickle

User metadata
Rank Member
Rank
Member

Dosbox uses the relative coordinates from SDL. You should add some console output that spits out the relative and absolute data from your touchscreen motion. Make sure the data makes sense.
You can then decide if you can correct the data directly in HandleMouseMotion, or try and fix SDL to give the correct information in the first place.

http://www.libsdl.org/cgi/docwiki.cgi/SDL_MouseMotionEvent

sdlmain.c

 1300 		case SDL_MOUSEMOTION:
1301 HandleMouseMotion(&event.motion);
1302 break;
 1161 static void HandleMouseMotion(SDL_MouseMotionEvent * motion) {
1162 if (sdl.mouse.locked || !sdl.mouse.autoenable)
1163 Mouse_CursorMoved((float)motion->xrel*sdl.mouse.sensitivity/100.0f,
1164 (float)motion->yrel*sdl.mouse.sensitivity/100.0f,
1165 (float)(motion->x-sdl.clip.x)/(sdl.clip.w-1)*sdl.mouse.sensitivity/100.0f,
1166 (float)(motion->y-sdl.clip.y)/(sdl.clip.h-1)*sdl.mouse.sensitivity/100.0f,
1167 sdl.mouse.locked);
1168 }

Reply 3 of 24, by gates007ca

User metadata
Rank Newbie
Rank
Newbie

Thanks Pickle! I also really appreciate what you have done for the GP2X community as I also owned a GP2X F100 (unfortunately don't have a F200 with the touch screen). Judging from what you have wrote, I think it is way, way over my head... I would do it and start making the changes if I have the skills but I will unlikely be able to pull it off in a million years, sadly 🙁

Would there be any takers? I am will to make a bounty to make a functionable touchscreen friendly dosbox... until the next version come out!

Any takers?

Pickle, would you be interested?

~Gates

Reply 5 of 24, by gates007ca

User metadata
Rank Newbie
Rank
Newbie

Hi WD,

Thanks for your reply and much appreciated for what you have done for DOSBOX. I have tried Exult and Atari800 emulator and it worked. It is the DOSBOX that is giving much trouble. I am really not a computer person so making the changes are definitely beyond my skill. Would you consider adding touchscreen support in the next version of dosbox or make some changes in the current one?

I think given there are going to be huge number of MIDs and touchscreen low-price UMPC coming to the market, it would be great for people like us to enjoy some of the old DOS game treasures on the go with touch screen support.

Would you be able to consider it?

~Gates

Reply 6 of 24, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

No clue what you want with "touchscreen support", for dosbox there's absolutely
no difference between a mouse and a touchscreen regarding the input data.

Check out stuff like
http://www.mail-archive.com/ubuntu-bugs@lists … msg1275220.html
as this is way more likely an sdl bug.

Exult uses absolute mouse position, dosbox uses relative.

Reply 7 of 24, by gates007ca

User metadata
Rank Newbie
Rank
Newbie

Hi Wd,

Thanks again for your reply. Forgive my ignorance, but would it be possible to add an option in Dosbox to choose Absolute vs. Relative Position?

I will try to bug the SDL forum as well (although I am not familiar with it at all!) but let's say they "fix it" I don't even know how to integrate with the dosbox. I have been googling over the last few week trying to see if they may be a workaround or an answer but none came up. I did see some "solutions" come up in the linux/ubuntu community but none seems to be windows and I have to admit I am not familiar enough to even understand the concept of the proposed solution.

Is there anyway you may be able to help? I do see more and more problem encountered out there with touchscreen but few came up to discuss and try to find a possible solution. Your help is much appreciated.

Gates

Reply 8 of 24, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

If the SDL folks fix their code, then it will(?) automatically become part of the next version of DOSBox.

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 9 of 24, by gates007ca

User metadata
Rank Newbie
Rank
Newbie

Thanks MinMax,

I have sent the SDL folks an email and hope they will help out. I'm still wondering if it would be possible to include an option in dosbox to choose relative vs. absolute value and whether this may solve the issue? May be this is not the right solution, but is there anything you can do that may help out?

It appears other have experience the same issue but no one was able to help out:

http://www.umpcportal.com/modules/newbb/viewt … 2&post_id=13296

I wrote an email to SDL and see if they can help out:

from XXX <XXX@gmail.com>
to"slouken@libsdl.org" <slouken@libsdl.org>

dateSat, May 9, 2009 at 2:54 AM
subjectSDL Mouse Emulation as it relates to DOSBOX
mailed-bygmail.com

hide details 2:54 AM (16 minutes ago) Reply

Hello,

Greetings and hope this email finds you well. I have been directed to SDL for this query by the folks at Vogon Zetafleet / DOSBOX. They said it may be more of a SDL issue and my advance apologies if you are not the right person to ask the question. If this question should be more appropriate to go to another person, please let me know.

I was using dosbox on an UPMC (Fujitsu, Aigo, Viliv S5) and all the touchscreen have problem with the emulating mouse on touchscreeen in DOSBOX. Specifically, the mouse would go erractically and stuck to any one of the four edges. I have been told this is a SDL problem and coding is required at the SDL side to fix, not the dosbox side. I know it may have something to do with the relative vs. absolute position of the mouse value but not being a computer savvy person I would not able to do anything about this. Here's the thread I post on Vogon and see if it makes sense to you:

Re: Dosbox, UMPC and touchscreen

I really hope you can fix this as there are more and more people out there using UMPC touchscreen and it would be wonderful for people to enjoy the old games emulated under dosbox in the mobile device.

Hope they get back and have a reasonable solution but in the mean time if you have some suggestions that would be great as well. Many thanks in advance.

Gates

Reply 11 of 24, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Does not work correctly for me on my Tablet (with wacom pen input).
But then even Exult does only work in windowed mode with the pen input. Fullscreen is as bad as it is for Dosbox (Dosbox doesn't work correctly in either window or fullscreen).
I tried with setting SDL_MOUSE_RELATIVE=0 (or 1) before starting each game (Rover, Exult, Dosbox (I'm trying with Tyrian2k)).
Rover is working the best but the pen control is by far not as reliable as the mouse control, but at least it doesn't get worse when in fullscreen 😀

So, uhm, if anyone has some more ideas, I can try stuff out since, I can (normally 😀) easily compile SDL and Dosbox myself.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 12 of 24, by gates007ca

User metadata
Rank Newbie
Rank
Newbie

Hello Dominus and WD,

Rover doesn't work for me... it has black screen and resolution changed to about 320x240 and only the window task bar appears and the mouse only "show up" when scroll to the taskbar area and disappear when scroll to the main screen.

WD- again my apologies about my previous comments.

Dominus - can you tell me how to set the SDL_mouse_relative= 0? I'm not computer savvy so appreciate you can bear wih me. If you have a recompiled DOSBOX with the fixed SDL, I would greatly appreciate and will also test it out.

Thanks.

~Gates

Reply 13 of 24, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Dominus - can you tell me how to set the SDL_mouse_relative= 0?

start a command prompt (run->cmd.exe), type in
SET SDL_mouse_relative= 0

then hit enter, and now change directories (on the command prompt) to where you have installed Dosbox. To change directories, use the cd command.
When you are there, start dosbox via the command prompt (dosbox.exe).

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 14 of 24, by gates007ca

User metadata
Rank Newbie
Rank
Newbie

Thanks Dominus! It works only if fullscreen=0 (in window mode). The cursor goes crazy if it is in fullscreen.

Also, like you said, calibration may be off, but it may be the issue of touchscreen, not Dosbox or SDL.

Thanks again for your help!

Reply 15 of 24, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

fullscreen and relative mouse mode problems are related, think this was
the result of another thread as well.
Dominus, maybe you can log the mouse.rel and x/y stuff that's used in
sdlmain.cpp, if you can make something out of it. I'll see about setting up
a build as well.

Reply 16 of 24, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Dominus, maybe you can log the mouse.rel and x/y stuff that's used in
sdlmain.cpp

you'd need to talk me through a bit, since I have as always no clue on how to log this. But I can follow commands 😀

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 17 of 24, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

sdlmain.cpp, look for the function HandleMouseMotion().
motion->xrel (yrel) and motion->x are the interesting variables there
(should be signed integer??).

Try to do some sort of comparison of what happens with the mouse against
what happens to a matching touchpad action, like "slowly move the mouse
from the top left to the bottom right" or so.

Reply 18 of 24, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

x/y are unsigned even.

Use something like this right after the function header:

	LOG_MSG("relx %d, rely %d, x %d, y %d",motion->xrel,motion->yrel,motion->x,motion->y);

Reply 19 of 24, by gates007ca

User metadata
Rank Newbie
Rank
Newbie

Not sure if I am adding to the discussion but if I set the mouse to autolock=1 the mouse cursor becomes uncontrollable again. In order to work in touchscreen, it has to been:

SDL_Mouse_Relative=0
Fullscreen=0
Autolock=0

Somehow Autolock screw up the cursor as well.

Gates