Hi!
Thinking accuse VirtualBox I've posted my question here https://forums.virtualbox.org/viewtopic.php?f=4&t=79917
Apparently, this problem "is not in VirtualBox", but FreeBasic compiler ? GFX ? If someone can take his time to resolve this strange bug :/
Thank you
Regards
Mouse horrible resolution (8x8)
Re: Mouse horrible resolution (8x8)
I'm going to make a guess because I had a problem that looked like that, but had a completely different nature from what I expected:
Make sure you're not using ScreenLock or ScreenUnlock. These statements mess with your mouse pointer in DOS!!!
What happens is that in DOS, FBGFX draws the cursor, not the OS. The mouse driver can draw a cursor, but only for VGA modes, so FB takes care of this by drawing its own pointer. The problem is that ScreenLock stops all graphics from rendering, including the mouse pointer. Besides, it appears to me that ScreenLock causes a delay probably having to do with VSync or with the timer interrupt in DOS that does not seem to happen in other platforms. The result is that, if you have a loop and within that loop, you have part of the code executing inside a ScreenLock-ScreenUnlock pair, during that part of the time, the mouse pointer will not be drawn and therefore, you'll see it jumping. Even if you think it's a very brief moment, it seems these statements are slow enough to make it apparent in DOS. I recommend you to just not use them in that platform.
Make sure you're not using ScreenLock or ScreenUnlock. These statements mess with your mouse pointer in DOS!!!
What happens is that in DOS, FBGFX draws the cursor, not the OS. The mouse driver can draw a cursor, but only for VGA modes, so FB takes care of this by drawing its own pointer. The problem is that ScreenLock stops all graphics from rendering, including the mouse pointer. Besides, it appears to me that ScreenLock causes a delay probably having to do with VSync or with the timer interrupt in DOS that does not seem to happen in other platforms. The result is that, if you have a loop and within that loop, you have part of the code executing inside a ScreenLock-ScreenUnlock pair, during that part of the time, the mouse pointer will not be drawn and therefore, you'll see it jumping. Even if you think it's a very brief moment, it seems these statements are slow enough to make it apparent in DOS. I recommend you to just not use them in that platform.
Re: Mouse horrible resolution (8x8)
Thank you for your reply :)
I not have any problem with screenlock, is not a jump effect i'm sure! When I set manually my mouse position, never he can be placed between 8 pixels. He move respectively 8 by 8, same problem if I not use "Screenlock".
The problem is only on VirtualBox!
Not on DosBox, physical computer, Qemu or VMWare
In compiler source, there are :
- fb_ConsoleGetMouse() (Console mode --> 8x8 movement)
- fb_GfxGetMouse() (Graphic mode, so.. 1x1 movement ?)
I think FBGFX uses fb_ConsoleGetMouse() function because he can't found correctly register values of VESA/VGA driver ?
I think that FBGFX can't detect if "virtualbox", displays VESA mode with successful by driver registers ?
Maybe their virtualbox BIOS not work correctly ? Registers is not correctly handled , for FBGFX detect this values ?
I not have any problem with screenlock, is not a jump effect i'm sure! When I set manually my mouse position, never he can be placed between 8 pixels. He move respectively 8 by 8, same problem if I not use "Screenlock".
The problem is only on VirtualBox!
Not on DosBox, physical computer, Qemu or VMWare
In compiler source, there are :
- fb_ConsoleGetMouse() (Console mode --> 8x8 movement)
- fb_GfxGetMouse() (Graphic mode, so.. 1x1 movement ?)
I think FBGFX uses fb_ConsoleGetMouse() function because he can't found correctly register values of VESA/VGA driver ?
I think that FBGFX can't detect if "virtualbox", displays VESA mode with successful by driver registers ?
Maybe their virtualbox BIOS not work correctly ? Registers is not correctly handled , for FBGFX detect this values ?
Re: Mouse horrible resolution (8x8)
You can test that. Try doing the same thing with a standard VGA mode like 640x480x16 (Screen 12) and see if the mouse pointer still snaps. Also, you can call VESA functions with a test program (real mode would be easier, say, in QB) to get the VESA version VirtualBox gives you.
Anyway, if FB is able to set up the video mode, then it means it's aware of the resolution and it shouldn't be snapping the mouse pointer. The problem might have to do with VirtualBox's "mouse driver". VESA does not handle the mouse pointer at all. The mouse driver (at int 33h) provides functions to change the resolution, which is reset automatically when you change a mode with int 10h. If the mouse driver does not take VESA into account and only VGA, then it may just "stretch the mouse grid" and you'll get this snapping. Try using a different mouse driver (CuteMouse?). For tweaked modes (like 320x240 or 400x300), expect the mouse driver to get completely lost. On a classical real-mode DOS program, I would call special mouse driver functions to manually set up mouse resolution on such modes. I don't know if FB does this or if it just hooks the COM1 or PS/2 IRQ to handle the input itself. Can be tested by restarting without a mouse driver and seeing if FB does anything.
Anyway, if FB is able to set up the video mode, then it means it's aware of the resolution and it shouldn't be snapping the mouse pointer. The problem might have to do with VirtualBox's "mouse driver". VESA does not handle the mouse pointer at all. The mouse driver (at int 33h) provides functions to change the resolution, which is reset automatically when you change a mode with int 10h. If the mouse driver does not take VESA into account and only VGA, then it may just "stretch the mouse grid" and you'll get this snapping. Try using a different mouse driver (CuteMouse?). For tweaked modes (like 320x240 or 400x300), expect the mouse driver to get completely lost. On a classical real-mode DOS program, I would call special mouse driver functions to manually set up mouse resolution on such modes. I don't know if FB does this or if it just hooks the COM1 or PS/2 IRQ to handle the input itself. Can be tested by restarting without a mouse driver and seeing if FB does anything.
Re: Mouse horrible resolution (8x8)
Hi,
I appreciate your help!
I've took my time for testing your solutions, and i've same problem for all solutions ! other mouse driver, other screen resolutions, .... ALL, VGA also ! :(
I conclude that is VirtualBox the problem, or "virtualbox bios mouse emulation", i will sending this FreeBASIC thread by message in VirtualBox forum for repair this problem.
Thank you very much xlucas! :)
Regards
Sebastien FAVIER
I appreciate your help!
I've took my time for testing your solutions, and i've same problem for all solutions ! other mouse driver, other screen resolutions, .... ALL, VGA also ! :(
I conclude that is VirtualBox the problem, or "virtualbox bios mouse emulation", i will sending this FreeBASIC thread by message in VirtualBox forum for repair this problem.
Thank you very much xlucas! :)
Regards
Sebastien FAVIER