Win32 specific problems

Hi

I’m working on a game using C++/SDL and have thereby met some problems when
I cross-compiled my project to the win32 platform (I develop in Linux).

First: The “Pause” and “PrintScreen” buttons does not work in Windows 98
(but there are no problems in Linux). To make it all even more strange: In
vmware 3.0 & windows 98 emulation the “Pause” button works but not the
"PrintScreen". Anyone have a clue?

Second: In windows fullscreen mode I always get a 60Hz mode on my monitor.
I do not understand why my monitor take this mode (no other game in
640x480) do this… I usually have 124Hz in 640x480.

Third: In windows sometimes the screen seems “blurred” (like using
"soften" i gimp) in the beginning. This usually changes back to normal
after 1-8 seconds inside the game.

I find these problems very odd, and would really appreciate it somebody
could give me some hints on how to solve them.

Regards,–

H?kon Skjelten  (@Hakon_Skjelten)
Student, Engineering Cybernetics
Norwegian University of Science and Technology

Hi

I’m working on a game using C++/SDL and have thereby met some problems
when
I cross-compiled my project to the win32 platform (I develop in Linux).

First: The “Pause” and “PrintScreen” buttons does not work in Windows 98
(but there are no problems in Linux). To make it all even more strange:
In
vmware 3.0 & windows 98 emulation the “Pause” button works but not the
"PrintScreen". Anyone have a clue?

Both Linux and Windows are sensitive to memory behavior in different
ways. I have seen things that run fine in windows and linux crash on
FreeBSD due to an obscure bug. i would say you may have one of those…

Second: In windows fullscreen mode I always get a 60Hz mode on my
monitor.
I do not understand why my monitor take this mode (no other game in
640x480) do this… I usually have 124Hz in 640x480.

I think 60Hz is a fairly “safe” refresh rate that won’t blow up anyone’s
monitor. This may be why it is chosen.

Third: In windows sometimes the screen seems “blurred” (like using
"soften" i gimp) in the beginning. This usually changes back to normal
after 1-8 seconds inside the game.

Bad monitor? Hard to say. Try on someone elses machine.On Thursday, February 28, 2002, at 03:44 PM, H?kon Skjelten wrote:

I find these problems very odd, and would really appreciate it somebody
could give me some hints on how to solve them.

Regards,

H?kon Skjelten  (skjelten at pvv.org)
Student, Engineering Cybernetics
Norwegian University of Science and Technology
_______________________________________________
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Hi!

At 22:44 28.02.2002 +0100, you wrote:

Second: In windows fullscreen mode I always get a 60Hz mode on my monitor.
I do not understand why my monitor take this mode (no other game in
640x480) do this… I usually have 124Hz in 640x480.
This looks like the famous NVIDIA-Refresh-Bug, but only under win2k/XP. If
you have the latest NVidia-Drivers installed, then you need
NVidiaRefreshRateFix to get a framerate around the perfect Sync-Rate of
your monitor @
http://www.fileplanet.com/dl/dl.asp?/planetquake/ztn/nvreffix-setup.exe

Best wishes,
St0fF.

ATI cards do this too, What I’ve found is that it only really does it if
the monitor is non-PnP. Non-PnP monitors default to 60hz unless the user
forces a higher refresh. However it doesn’t pass on to directdraw. In
Win98 you would have to go through every single resolution and color
depth the monitor was capable of setting it to the refresh rate you
wanted. In 2K/XP, it uses one refresh rate regardless of resolution or
color depth. So the two alternatives to this to either use dxdiag or
directx.cpl and force the refresh in that utility, or you can use a much
meaner trick and hack the registry deleting all the refresh rates that
you do not want to use. This has the added side effect of making tv-out
not work as far as I know (since tv-out requires 60hz on most cards.)
Look in the monitor.inf for the registry string of settings the monitor
is using if you really want to go this route.> ----- Original Message -----

From: sdl-admin@libsdl.org [mailto:sdl-admin at libsdl.org] On Behalf Of
St0fF 64
Sent: Thursday, February 28, 2002 7:49 PM
To: sdl at libsdl.org
Subject: Re: [SDL] Win32 specific problems

Hi!

At 22:44 28.02.2002 +0100, you wrote:

Second: In windows fullscreen mode I always get a 60Hz mode on my
monitor.
I do not understand why my monitor take this mode (no other game in
640x480) do this… I usually have 124Hz in 640x480.
This looks like the famous NVIDIA-Refresh-Bug, but only under win2k/XP.
If
you have the latest NVidia-Drivers installed, then you need
NVidiaRefreshRateFix to get a framerate around the perfect Sync-Rate of
your monitor @
http://www.fileplanet.com/dl/dl.asp?/planetquake/ztn/nvreffix-setup.exe

Best wishes,
St0fF.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Hi,

in SDL1.2.3, the pause button doesn’t work when using the “directx” drivers
because this line :

740 DIK_keymap[DIK_PAUSE] = SDLK_PAUSE;

is missing from “SDL_dx5events.c”

The pause button does work when using the “windib” drivers
(using set SDL_VIDEODRIVER=windib) which the emulation is probably
emulating.

There is a ‘fix’ in CVS but it maps onto SDLK_BREAK rather than
SDLK_PAUSE (“windib” uses SDLK_PAUSE).

In fact, using CVS and the “checkkeys” test application I find that for
the “directx” drivers :

PAUSE - “Key pressed: 318-break modifiers: NUM”
\ - "Unknown Key (scancode = 86) pressed () modifiers: NUM"
NUMLOCK - is erratic sometimes works, sometimes doesn’t.

and for the “windib” drivers :

PAUSE - "Key pressed: 19-pause modifiers: NUM"
PRINTSCREEN - no response!
BACKQUOTE - "Unknown Key (scancode = 41) pressed (`) modifiers: NUM"
ALT-GR - does left-ctrl and right-alt!

How about making the pause key consistent, Sam?

Its useful for those “putting the kettle on” moments in the middle of a
space battle. I’m going to look into the other behaviours,

cheers,
John.
PS [Language: English (British), Layout: British] on Win98SE> ----- Original Message -----

From: leimbacd@bellsouth.net (David Leimbach)
To:
Sent: Friday, March 01, 2002 12:31 AM
Subject: Re: [SDL] Win32 specific problems

On Thursday, February 28, 2002, at 03:44 PM, H?kon Skjelten wrote:

Hi

I’m working on a game using C++/SDL and have thereby met some problems
when
I cross-compiled my project to the win32 platform (I develop in Linux).

First: The “Pause” and “PrintScreen” buttons does not work in Windows 98
(but there are no problems in Linux). To make it all even more strange:
In
vmware 3.0 & windows 98 emulation the “Pause” button works but not the
"PrintScreen". Anyone have a clue?

Both Linux and Windows are sensitive to memory behavior in different
ways. I have seen things that run fine in windows and linux crash on
FreeBSD due to an obscure bug. i would say you may have one of those…

Second: In windows fullscreen mode I always get a 60Hz mode on my
monitor.
I do not understand why my monitor take this mode (no other game in
640x480) do this… I usually have 124Hz in 640x480.

I think 60Hz is a fairly “safe” refresh rate that won’t blow up anyone’s
monitor. This may be why it is chosen.

Third: In windows sometimes the screen seems “blurred” (like using
"soften" i gimp) in the beginning. This usually changes back to normal
after 1-8 seconds inside the game.

Bad monitor? Hard to say. Try on someone elses machine.

I find these problems very odd, and would really appreciate it somebody
could give me some hints on how to solve them.

Regards,

H?kon Skjelten  (skjelten at pvv.org)
Student, Engineering Cybernetics
Norwegian University of Science and Technology
_______________________________________________
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Hi,

with the “directx” drivers and “checkkeys.exe” :
CAPSLOCK and NUMLOCK work if, when the application is started,
CAPSLOCK and NUMLOCK are off.

Otherwise, they are detected as being on, but remain on even when
toggled (the keyboard LEDS work correctly).

Still investigating …

cheers,
John.> ----- Original Message -----

From: @John_Popplewell (John Popplewell)
To:
Sent: Friday, March 01, 2002 4:31 AM
Subject: Re: [SDL] Win32 specific problems

Hi,

in SDL1.2.3, the pause button doesn’t work when using the "directx"
drivers
because this line :

740 DIK_keymap[DIK_PAUSE] = SDLK_PAUSE;

is missing from “SDL_dx5events.c”

The pause button does work when using the “windib” drivers
(using set SDL_VIDEODRIVER=windib) which the emulation is probably
emulating.

There is a ‘fix’ in CVS but it maps onto SDLK_BREAK rather than
SDLK_PAUSE (“windib” uses SDLK_PAUSE).

In fact, using CVS and the “checkkeys” test application I find that for
the “directx” drivers :

PAUSE - “Key pressed: 318-break modifiers: NUM”
\ - "Unknown Key (scancode = 86) pressed () modifiers: NUM"
NUMLOCK - is erratic sometimes works, sometimes doesn’t.

and for the “windib” drivers :

PAUSE - "Key pressed: 19-pause modifiers: NUM"
PRINTSCREEN - no response!
BACKQUOTE - "Unknown Key (scancode = 41) pressed (`) modifiers: NUM"
ALT-GR - does left-ctrl and right-alt!

How about making the pause key consistent, Sam?

Its useful for those “putting the kettle on” moments in the middle of a
space battle. I’m going to look into the other behaviours,

cheers,
John.
PS [Language: English (British), Layout: British] on Win98SE

----- Original Message -----
From: “David Leimbach”
To:
Sent: Friday, March 01, 2002 12:31 AM
Subject: Re: [SDL] Win32 specific problems

On Thursday, February 28, 2002, at 03:44 PM, Hkon Skjelten wrote:

Hi

I’m working on a game using C++/SDL and have thereby met some problems
when
I cross-compiled my project to the win32 platform (I develop in Linux).

First: The “Pause” and “PrintScreen” buttons does not work in Windows 98
(but there are no problems in Linux). To make it all even more strange:
In
vmware 3.0 & windows 98 emulation the “Pause” button works but not the
"PrintScreen". Anyone have a clue?

Both Linux and Windows are sensitive to memory behavior in different
ways. I have seen things that run fine in windows and linux crash on
FreeBSD due to an obscure bug. i would say you may have one of those…

Second: In windows fullscreen mode I always get a 60Hz mode on my
monitor.
I do not understand why my monitor take this mode (no other game in
640x480) do this… I usually have 124Hz in 640x480.

I think 60Hz is a fairly “safe” refresh rate that won’t blow up anyone’s
monitor. This may be why it is chosen.

Third: In windows sometimes the screen seems “blurred” (like using
"soften" i gimp) in the beginning. This usually changes back to normal
after 1-8 seconds inside the game.

Bad monitor? Hard to say. Try on someone elses machine.

I find these problems very odd, and would really appreciate it somebody
could give me some hints on how to solve them.

Regards,

Hkon Skjelten  (skjelten at pvv.org)
Student, Engineering Cybernetics
Norwegian University of Science and Technology
_______________________________________________
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Hi again,

Ok. In “SDL_keyboard.c” there is an array, SDL_KeyState[], that
holds the pressed/released state of every key. In the case of NUM
and CAPS this can be imagined to be the state of the keyboard LED.

Unfortunately, when this array is initialised, the state of NUM
and CAPS is assumed to be ‘off’, although SDL_ModState which holds
the state of all modifier keys is initialised correctly.

The special code that handles NUM and CAPS key transitions then
causes a discard of what is considered to be an invalid transition.

The fix (bodge) is to initialise SDL_KeyState[] correctly for the
NUM and CAPS keys.

File : "wincommon/SDL_sysevents.c"
Function: “static void WIN_GetKeyboardState(void)”

114 SDLMod state;
115 BYTE keyboard[256];

Uint8 *kstate = SDL_GetKeyState(NULL);
116
117 state = KMOD_NONE;

137 if ( keyboard[VK_NUMLOCK] & 0x01) {
138 state |= KMOD_NUM;
kstate[SDLK_NUMLOCK] = SDL_PRESSED;
139 }
140 if ( keyboard[VK_CAPITAL] & 0x01) {
141 state |= KMOD_CAPS;
kstate[SDLK_CAPSLOCK] = SDL_PRESSED;
142 }

Things also get a bit confused if the keyboard is ‘lost’ and
SDL_ResetKeyboard() (in events/SDL_keyboard.c) is called.
Not sure what to do about this though.

Maybe not reset NUM and CAPS ? Hmmmm …

cheers for now,
John.> ----- Original Message -----

From: @John_Popplewell (John Popplewell)
To:
Sent: Friday, March 01, 2002 4:20 PM
Subject: Re: [SDL] Win32 specific problems

Hi,

with the “directx” drivers and “checkkeys.exe” :
CAPSLOCK and NUMLOCK work if, when the application is started,
CAPSLOCK and NUMLOCK are off.

Otherwise, they are detected as being on, but remain on even when
toggled (the keyboard LEDS work correctly).

Still investigating …

cheers,
John.

----- Original Message -----
From: “John Popplewell” <@John_Popplewell>
To:
Sent: Friday, March 01, 2002 4:31 AM
Subject: Re: [SDL] Win32 specific problems

Hi,

in SDL1.2.3, the pause button doesn’t work when using the "directx"
drivers
because this line :

740 DIK_keymap[DIK_PAUSE] = SDLK_PAUSE;

is missing from “SDL_dx5events.c”

The pause button does work when using the “windib” drivers
(using set SDL_VIDEODRIVER=windib) which the emulation is probably
emulating.

There is a ‘fix’ in CVS but it maps onto SDLK_BREAK rather than
SDLK_PAUSE (“windib” uses SDLK_PAUSE).

In fact, using CVS and the “checkkeys” test application I find that for
the “directx” drivers :

PAUSE - “Key pressed: 318-break modifiers: NUM”
\ - "Unknown Key (scancode = 86) pressed () modifiers: NUM"
NUMLOCK - is erratic sometimes works, sometimes doesn’t.

and for the “windib” drivers :

PAUSE - "Key pressed: 19-pause modifiers: NUM"
PRINTSCREEN - no response!
BACKQUOTE - "Unknown Key (scancode = 41) pressed (`) modifiers: NUM"
ALT-GR - does left-ctrl and right-alt!

How about making the pause key consistent, Sam?

Its useful for those “putting the kettle on” moments in the middle of a
space battle. I’m going to look into the other behaviours,

cheers,
John.
PS [Language: English (British), Layout: British] on Win98SE

----- Original Message -----
From: “David Leimbach”
To:
Sent: Friday, March 01, 2002 12:31 AM
Subject: Re: [SDL] Win32 specific problems

On Thursday, February 28, 2002, at 03:44 PM, Hkon Skjelten wrote:

Hi

I’m working on a game using C++/SDL and have thereby met some problems
when
I cross-compiled my project to the win32 platform (I develop in
Linux).

First: The “Pause” and “PrintScreen” buttons does not work in Windows
98

(but there are no problems in Linux). To make it all even more
strange:

In
vmware 3.0 & windows 98 emulation the “Pause” button works but not the
"PrintScreen". Anyone have a clue?

Both Linux and Windows are sensitive to memory behavior in different
ways. I have seen things that run fine in windows and linux crash on
FreeBSD due to an obscure bug. i would say you may have one of those…

Second: In windows fullscreen mode I always get a 60Hz mode on my
monitor.
I do not understand why my monitor take this mode (no other game in
640x480) do this… I usually have 124Hz in 640x480.

I think 60Hz is a fairly “safe” refresh rate that won’t blow up anyone’s
monitor. This may be why it is chosen.

Third: In windows sometimes the screen seems “blurred” (like using
"soften" i gimp) in the beginning. This usually changes back to normal
after 1-8 seconds inside the game.

Bad monitor? Hard to say. Try on someone elses machine.

I find these problems very odd, and would really appreciate it
somebody

could give me some hints on how to solve them.

Regards,

Hkon Skjelten  (skjelten at pvv.org)
Student, Engineering Cybernetics
Norwegian University of Science and Technology
_______________________________________________
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

In fact, using CVS and the “checkkeys” test application I find that for
the “directx” drivers :

PAUSE - “Key pressed: 318-break modifiers: NUM”
\ - "Unknown Key (scancode = 86) pressed () modifiers: NUM"
NUMLOCK - is erratic sometimes works, sometimes doesn’t.

and for the “windib” drivers :

PAUSE - "Key pressed: 19-pause modifiers: NUM"
PRINTSCREEN - no response!
BACKQUOTE - "Unknown Key (scancode = 41) pressed (`) modifiers: NUM"
ALT-GR - does left-ctrl and right-alt!

How about making the pause key consistent, Sam?

Yes, I can do that. I’m not sure what to do about backslash and backquote
though…

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Hi!

At 22:44 28.02.2002 +0100, you wrote:

Second: In windows fullscreen mode I always get a 60Hz mode on my
monitor. I do not understand why my monitor take this mode (no other
game in 640x480) do this… I usually have 124Hz in 640x480.
This looks like the famous NVIDIA-Refresh-Bug, but only under win2k/XP.
If you have the latest NVidia-Drivers installed, then you need
NVidiaRefreshRateFix to get a framerate around the perfect Sync-Rate of
your monitor @
http://www.fileplanet.com/dl/dl.asp?/planetquake/ztn/nvreffix-setup.exe

Best wishes,
St0fF.

You’re right! I downloaded the latest Nvidia drivers and tried again:
150Hz in 640x480 and no “blurring” error in the picture.

Marvellous what a buggy videodriver can do.

Regards,On Fri, 01 Mar 2002 04:49:10 +0100, St0fF 64 wrote:

H?kon Skjelten  (@Hakon_Skjelten)
Student, Engineering Cybernetics
Norwegian University of Science and Technology

At 00:40 02.03.2002 +0100, you wrote:

You’re right! I downloaded the latest Nvidia drivers and tried again:
150Hz in 640x480 and no “blurring” error in the picture.

Marvellous what a buggy videodriver can do.

Glad this helped …
St0fF 64
/**********************************************
coding & hacking are the same - a state of mind
**********************************************/
Der Spinner und Bitschmied, der dies schrieb,
studiert Mechatronik an der TU-Ilmenau …