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:
Stephen Anthony 2017-02-24 18:38:26 -03:30
parent 38b452e1a0
commit 5114a8e88e
4 changed files with 9 additions and 9 deletions

View File

@ -101,9 +101,9 @@ void AmigaMouse::update()
else myTrakBallDown = 1;
myTrakBallCountH = abs(myVCounter >> 1);
myTrakBallCountV = abs(myHCounter >> 1);
myTrakBallLinesH = 200 /*LinesInFrame*/ / (myTrakBallCountH + 1);
myTrakBallLinesH = mySystem.tia().height() / (myTrakBallCountH + 1);
if(myTrakBallLinesH == 0) myTrakBallLinesH = 1;
myTrakBallLinesV = 200 /*LinesInFrame*/ / (myTrakBallCountV + 1);
myTrakBallLinesV = mySystem.tia().height() / (myTrakBallCountV + 1);
if(myTrakBallLinesV == 0) myTrakBallLinesV = 1;
// Get mouse button state

View File

@ -101,9 +101,9 @@ void AtariMouse::update()
else myTrakBallDown = 1;
myTrakBallCountH = abs(myVCounter >> 1);
myTrakBallCountV = abs(myHCounter >> 1);
myTrakBallLinesH = 200 /*LinesInFrame*/ / (myTrakBallCountH + 1);
myTrakBallLinesH = mySystem.tia().height() / (myTrakBallCountH + 1);
if(myTrakBallLinesH == 0) myTrakBallLinesH = 1;
myTrakBallLinesV = 200 /*LinesInFrame*/ / (myTrakBallCountV + 1);
myTrakBallLinesV = mySystem.tia().height() / (myTrakBallCountV + 1);
if(myTrakBallLinesV == 0) myTrakBallLinesV = 1;
// Get mouse button state

View File

@ -102,11 +102,11 @@ void TrakBall::update()
else myTrakBallLeft = 0;
if(myHCounter < 0) myTrakBallDown = 0;
else myTrakBallDown = 1;
myTrakBallCountH = abs(myVCounter >> 1);
myTrakBallCountV = abs(myHCounter >> 1);
myTrakBallLinesH = 200 /*LinesInFrame*/ / (myTrakBallCountH + 1);
myTrakBallCountH = abs(myVCounter >> 2); // Extra div by 2, since trakball has
myTrakBallCountV = abs(myHCounter >> 2); // half spatial resolution as ST/Amiga mouse
myTrakBallLinesH = mySystem.tia().height() / (myTrakBallCountH + 1);
if(myTrakBallLinesH == 0) myTrakBallLinesH = 1;
myTrakBallLinesV = 200 /*LinesInFrame*/ / (myTrakBallCountV + 1);
myTrakBallLinesV = mySystem.tia().height() / (myTrakBallCountV + 1);
if(myTrakBallLinesV == 0) myTrakBallLinesV = 1;
// Get mouse button state

View File

@ -23,7 +23,7 @@
#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
*/