Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mouse in SVGA modes ?
#1
The conventionnal mouse routines won't work when you activate the true-colour modes with a VESA graphic card :
Mode = &H10F, 320x200
Mode = &H112, 640x480
Mode = &H115, 800x600
Mode = &H118, 1024x768
Mode = &H11B, 1280x1024

I fact, I think "only" cursor display does not work, the detection, hide&show and Status functions being probably OK even when changing graphic mode.

Can anybody confirm and "put me on the rails" (free translation from a french expression) for this issue ?
hink Global, Make Symp' All ! ®
[Image: Banner.gif]
Reply
#2
I confirm "only" mouse functions 1 & 2 don't work and need to be reprogrammed (show & hide).

But I have an issue : I can plot a pixel controlled by the mouse pointer, but the coordinates of the pointer range step by step on a grid which is 8 pixels x 8 pixels.

I know the standard mouse pointer ranges within a 0-639,0-199 frame, but I cannot solve that grid stuff...

Antoni, in case you read me, I know you know these subjects in detail... Help !
hink Global, Make Symp' All ! ®
[Image: Banner.gif]
Reply
#3
You should use other mouse functions which return the dx and dy of the mouse from the last poll (polling mouse).
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#4
correctly in SVGA modes and so the correspondence between rodent coordinates ("mickies") and screen coordinates gets mixed up. This is a routine I wrote to correct for that.


'
' This subroutine calculates the horizontal (MDX) and vertical (MDY)
' (MDY) cursor motion scale factors in the current video mode. (There
' are MDX mouse movement pixels (or "mickeys") for each horizontal screen
' pixel and MDY mouse mickyes for each vertical screen pixel. The primary
' use of this routine is with an SVGA video mode, since the standard
' rodent driver has a problem diagnosing SVGA video characterteristics.
'
' The way you'd use the outputs depends on what you're doing. If you're
' using one of the rodent functions (3 or 5, for example) to read the
' mouse coordinates and you want to get the corresponding screen
' coordinates, you'd use MDX and MDY. Let's say X and Y are the
' horizontal and vertical coordinates returned by your mouse function.
' The screen coordinates are INT(X / MDX) and INT(Y / MDY). (You
' shouldn't really need the INT functions; I'm just "being safe.")
'
' If you want to use the mouse functions that set the mouse position or
' constrain it's motion and you want to calculate the setting or
' constraints based on *screen* coordinates X and Y, you would also use
' MDX and MDY. This time, however, you multiply: mouse horizontal
' coordinate = X * MDX and mouse vertical coordinate = Y * MDY.
'
' (The routine makes the ludicrous allowance for there to be up to 8000
' mickeys per horizontal screen pixel and 5000 per vertical pixel. Feel
' free to drastically decrease those numbers in the FOR/NEXT loops.)
'
SUB MICKEY(MDX AS INTEGER,MDY AS INTEGER)
DIM I AS INTEGER,KX AS INTEGER,KY AS INTEGER,MXMAX AS INTEGER,MYMAX AS INTEGER
'
' Set up machine code.
'
DIM RODCODE(1 TO 10) AS LONG,OS AS INTEGER,CX AS INTEGER,DX AS INTEGER
DEF SEG=VARSEG(RODCODE(1))
OS=VARPTR(RODCODE(1))
POKE OS,&HB8 : POKE OS+1,&H00 : POKE OS+2,0 'MOV AX,0
POKE OS+3,&HCD : POKE OS+4,&H33 'INT 33
POKE OS+5,&HCB 'RETF
POKE OS+6,&H55 'PUSH BP
POKE OS+7,&H89 : POKE OS+8,&HE5 'MOV BP,SP
POKE OS+9,&HB8 : POKE OS+10,4 : POKE OS+11,0 'MOV AX,4
POKE OS+12,&HB9 : POKE OS+13,&HBB : POKE OS+14,&HAA 'MOV CX,[RODENT X]
POKE OS+15,&HBA : POKE OS+16,&HDD : POKE OS+17,&HCC 'MOV DX,[RODENT Y]
POKE OS+18,&HCD : POKE OS+19,&H33 'INT 33
POKE OS+20,&HB8 : POKE OS+21,3 : POKE OS+22,0 'MOV AX,3
POKE OS+23,&HCD : POKE OS+24,&H33 'INT 33
POKE OS+25,&H8B : POKE OS+26,&H5E : POKE OS+27,6 'MOV BX,[BP+6]
POKE OS+28,&H89 : POKE OS+29,&H17 'MOV [BX],DX
POKE OS+30,&H8B : POKE OS+31,&H5E : POKE OS+32,8 'MOV BX,[BP+8]
POKE OS+33,&H89 : POKE OS+34,&HF 'MOV [BX],CX
POKE OS+35,&H5D 'POP BP
POKE OS+36,&HCA : POKE OS+37,4 : POKE OS+38,0 'RETF 4
'
' Initialize rodent before doing anything.
'
CALL ABSOLUTE(OS)
'
' For 8001 successive mouse mickeys, attempt to set the horizontal
' position and then read that position. When the detected position fails
' to agree with what it was set to, the horizontal limit on the mouse
' motion must have been found.
'
MXMAX=0
KX=0
FOR I=0 TO 8000
POKE OS+13,I AND &HFF : POKE OS+14,(I AND &HFF00&)/256
POKE OS+16,0 : POKE OS+17,0
CALL ABSOLUTE(CX,DX,OS+6)
IF CX=I THEN
KX=KX+1
MXMAX=I
END IF
NEXT I
'
' Repeat above process to find the vertical limit.
'
MYMAX=0
KY=0
FOR I=0 TO 5000
POKE OS+13,0 : POKE OS+14,0
POKE OS+16,I AND &HFF : POKE OS+17,(I AND &HFF00&)/256
CALL ABSOLUTE(CX,DX,OS+6)
IF DX=I THEN
KY=KY+1
MYMAX=I
END IF
NEXT I
DEF SEG
'
' Get mickey/screen pixel ratio. (First set default, possibly erroneous,
' values in case above process screwed up for some reason.)
'
MDX=1 : MDY=1
IF KX>1 THEN MDX=CSNG(MXMAX)/(KX-1)
IF KY>1 THEN MDY=CSNG(MYMAX)/(KY-1)
END SUB
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Reply
#5
Jark:
Unfortunately i tested mouse in SVGA in one of my thousand unfinished projects, so probably what I will say is not complete.

Show and hide don't work so you must keep polling the mouse coordinates and mask/draw/undraw the cursor by yourself.
You have a function allowing you to set the mouse limits, you can set them to the screen limits, to have the exact position returned.
You can do this because you are not using the driver cursor updating (who supposes the screen width to be 639)
Antoni
Reply
#6
Glenn, do you mind if that routine is included in http://faq.qbasicnews.com ?
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#7
Quote:Glenn, do you mind if that routine is included in http://faq.qbasicnews.com ?
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Reply
#8
OK, dividing the mouse coordinates suppressed the 8x8 grid, but now, I just cannot set the max coordinates to the screen (e.g. 800x600). Functions 7 and 8 just won't do it...

I can handle the cursor issue, but, still, if the mouse moves only in the upper left corner of the screen...
hink Global, Make Symp' All ! ®
[Image: Banner.gif]
Reply
#9
.
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Reply
#10
It just returns the Mickey values (8,8), without allowing going beyond the 632-192 (ie 640-8 and 200-8) mouse coordinates...

I checked the MXMAX value inside your prog, and it's stuck to 632 Cry
hink Global, Make Symp' All ! ®
[Image: Banner.gif]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)