VOGONS

Common searches


First post, by baer

User metadata
Rank Newbie
Rank
Newbie

I recently upgraded from 0.73 to 0.74 and for some reason there seems to be a problem regarding the initial numlock state.
I'm running DOSBox in Windows Vista x86 SP2. My keyboard numlock is always on. When I launch 0.73, the numlock works fine right off the start (ie it is active in DOSBox too). With 0.74 however, the keyboard led is lit but DOSBox behaves as if numlock is off. I have to push the numlock key twice to 'sync' the led with with DOSBox's internal numlock state.

Furthermore there is another problem with the mouse support. The middle button only works as long as DOSBox's internal mouse driver is used. I'm running a configuration that boots a real DOS off a harddisk image and therefore I have to use my own mouse driver. In this configuration the middle mouse button does not work.
I found the problem in mouse.cpp, line 158. It SHOULD be:

Bit16u mdat = (data & 0x07) | 0x08;

The original 'and' mask of 0x03 destroys the middle button state information!

Ok, so that is solved! Now back to the first problem: the numlock thing. For a reason which I don't know, my build does not show that numlock problem! I used the information on the Wiki to configure the source code and my development environment is MS Visual C++ 2008 Professional.
Regarding the numlock problem, I think the first step would be to create a build with exactly the same settings as the binary download was done. Where can I find information on how to configure the source so that I achieve exactly the same build as the one which is available for download? Or has the numlock problem in 0.74 already been solved? Again, it was no problem in 0.73.
The middle mouse button problem has been there forever, I guess. But the fix for that is here in this post!

Thank you for the good work and thanks for any info on how to configure the sources.

Reply 2 of 6, by baer

User metadata
Rank Newbie
Rank
Newbie

hmmm ... for my first selfmade build I used the sdl.dll supplied with the 0.74 installer. Nevertheless, with my build the numlock worked right off the start.

I could not find any information about how to build a full featured DOSBox using Visual Studio 2008, so I started on my own and after having spent some hours today, I have a full featured DOSBox (well, without Heavy Debug) which I have completely built from scratch, including zlib 1.2.5, libpng 1.4.3, sdl_net 1.2.7 and sdl 1.2.14!
So if anybody is interested then I'll sit down and write a HowTo for this job. My development environment is Visual Studio 2008 Professional but I think it can be done with the free Express Edition as well.

My middle mouse button works perfect now due to my little bugfix mentioned in the first post of this thread. The numlock startup problem, however, is gone using my build. So I'm unable to track it down.

Reply 3 of 6, by TraxxAmigaEP

User metadata
Rank Newbie
Rank
Newbie

Hmmm

In the source 0.74 bios_keyboard.cpp is disabled
//if(startup_state_numlock){ flag1|=0x20; leds|=0x02;}

in 0.73 not. I removed the slashs and numlock get state from the host and it worked !?!

Reply 5 of 6, by ari

User metadata
Rank Newbie
Rank
Newbie

There definitelely still is a bug in many versions of SDL, including the latest SDL1.2 versions on Windows - They fail to get the initial Numlock and Capslock state from the OS on startup correctly.
This bug was fixed in SDL2 somewhere between 2.04 and now, but at least on my very current mingw cross compiler SVN trunk still uses SDL1.
I don't know why the SDL developers don't care about fixing SDL1 as well, but luckily there is a simple work around that make DOSBox happy even with broken SDL.dll.

The patch is attached.

Note that it just reads the keystates from Windows on startup and feeds it back into SDL's state using a defined public interface, so that works with the keymapper correctly.

Attachments