mirror of https://github.com/stella-emu/stella.git
CX22/CX80 trakball controller has half the resolution of an
Atari/Amiga mouse, so do an extra divide by 2 for the counters.
This commit is contained in:
parent
38b452e1a0
commit
5114a8e88e
|
@ -101,9 +101,9 @@ void AmigaMouse::update()
|
||||||
else myTrakBallDown = 1;
|
else myTrakBallDown = 1;
|
||||||
myTrakBallCountH = abs(myVCounter >> 1);
|
myTrakBallCountH = abs(myVCounter >> 1);
|
||||||
myTrakBallCountV = abs(myHCounter >> 1);
|
myTrakBallCountV = abs(myHCounter >> 1);
|
||||||
myTrakBallLinesH = 200 /*LinesInFrame*/ / (myTrakBallCountH + 1);
|
myTrakBallLinesH = mySystem.tia().height() / (myTrakBallCountH + 1);
|
||||||
if(myTrakBallLinesH == 0) myTrakBallLinesH = 1;
|
if(myTrakBallLinesH == 0) myTrakBallLinesH = 1;
|
||||||
myTrakBallLinesV = 200 /*LinesInFrame*/ / (myTrakBallCountV + 1);
|
myTrakBallLinesV = mySystem.tia().height() / (myTrakBallCountV + 1);
|
||||||
if(myTrakBallLinesV == 0) myTrakBallLinesV = 1;
|
if(myTrakBallLinesV == 0) myTrakBallLinesV = 1;
|
||||||
|
|
||||||
// Get mouse button state
|
// Get mouse button state
|
||||||
|
|
|
@ -101,9 +101,9 @@ void AtariMouse::update()
|
||||||
else myTrakBallDown = 1;
|
else myTrakBallDown = 1;
|
||||||
myTrakBallCountH = abs(myVCounter >> 1);
|
myTrakBallCountH = abs(myVCounter >> 1);
|
||||||
myTrakBallCountV = abs(myHCounter >> 1);
|
myTrakBallCountV = abs(myHCounter >> 1);
|
||||||
myTrakBallLinesH = 200 /*LinesInFrame*/ / (myTrakBallCountH + 1);
|
myTrakBallLinesH = mySystem.tia().height() / (myTrakBallCountH + 1);
|
||||||
if(myTrakBallLinesH == 0) myTrakBallLinesH = 1;
|
if(myTrakBallLinesH == 0) myTrakBallLinesH = 1;
|
||||||
myTrakBallLinesV = 200 /*LinesInFrame*/ / (myTrakBallCountV + 1);
|
myTrakBallLinesV = mySystem.tia().height() / (myTrakBallCountV + 1);
|
||||||
if(myTrakBallLinesV == 0) myTrakBallLinesV = 1;
|
if(myTrakBallLinesV == 0) myTrakBallLinesV = 1;
|
||||||
|
|
||||||
// Get mouse button state
|
// Get mouse button state
|
||||||
|
|
|
@ -102,11 +102,11 @@ void TrakBall::update()
|
||||||
else myTrakBallLeft = 0;
|
else myTrakBallLeft = 0;
|
||||||
if(myHCounter < 0) myTrakBallDown = 0;
|
if(myHCounter < 0) myTrakBallDown = 0;
|
||||||
else myTrakBallDown = 1;
|
else myTrakBallDown = 1;
|
||||||
myTrakBallCountH = abs(myVCounter >> 1);
|
myTrakBallCountH = abs(myVCounter >> 2); // Extra div by 2, since trakball has
|
||||||
myTrakBallCountV = abs(myHCounter >> 1);
|
myTrakBallCountV = abs(myHCounter >> 2); // half spatial resolution as ST/Amiga mouse
|
||||||
myTrakBallLinesH = 200 /*LinesInFrame*/ / (myTrakBallCountH + 1);
|
myTrakBallLinesH = mySystem.tia().height() / (myTrakBallCountH + 1);
|
||||||
if(myTrakBallLinesH == 0) myTrakBallLinesH = 1;
|
if(myTrakBallLinesH == 0) myTrakBallLinesH = 1;
|
||||||
myTrakBallLinesV = 200 /*LinesInFrame*/ / (myTrakBallCountV + 1);
|
myTrakBallLinesV = mySystem.tia().height() / (myTrakBallCountV + 1);
|
||||||
if(myTrakBallLinesV == 0) myTrakBallLinesV = 1;
|
if(myTrakBallLinesV == 0) myTrakBallLinesV = 1;
|
||||||
|
|
||||||
// Get mouse button state
|
// Get mouse button state
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "Event.hxx"
|
#include "Event.hxx"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
CS22/CX80 trakball controller. This code was heavily borrowed from z26.
|
CX22/CX80 trakball controller. This code was heavily borrowed from z26.
|
||||||
|
|
||||||
@author Stephen Anthony & z26 team
|
@author Stephen Anthony & z26 team
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue