PS2 Mouse
Posted: Sun Jul 13, 2008 9:59 pm
Hi. I am putting my HDD driver on hold to mess with this mouse driver I built. Everything works good, but I want to steal the TASM install screen mouse thing idea. Basically, the program writes the block cursor to the position of the mouse on screen to simulate the GUI cursor. I figured out that I could do the same with printf and undo my write with the opposite char code, but I cannot figure out how to calibrate the position of my cursor.
What happens is I receive negative values, so I wrote quick abs function but it must be bunk:
However, it seems to be returning OK values. However, when i use the abs function I don't see the printed char anywhere. When I don't use the ABS function I wrote, I do see the char, but it seems like my calibration is bass ackwards because if I scroll up, it scrolls down, left it goes right, right it goes left, down it goes up. I think this is due to the negative values. Any ideas?
What happens is I receive negative values, so I wrote quick abs function but it must be bunk:
Code: Select all
int abs(int num)
{
if(num<0) {
int sqrd=num*num;
int prod=num/sqrd;
return prod;
} else {
return num;
}
}