First post, by superfury
I notice something odd: UniPCemu generates serial mouse packets, but the MOUSE.SYS(from Windows 3.0) only seems to go up and down? The packets themselves seem 'OK'?
//Translate our movement to valid values if needed!
xmove = signed2unsigned8(MAX(MIN(packet->xmove,0x7F),-0x80)); //Limit!
ymove = signed2unsigned8(MAX(MIN(packet->ymove,0x7F),-0x80)); //Limit!
if (SERMouse.movement==0) //Not gotten movement masked?
{
xmove = ymove = 0; //No movement!
}
//Bits 0-1 are X6&X7. Bits 2-3 are Y6&Y7. They're signed values.
highbits = ((xmove >> 6) & 0x3); //X6&X7 to bits 0-1!
highbits |= ((ymove >> 4) & 0xC); //Y6&7 to bits 2-3!
byte p[3];
p[0] = 0x40 | (buttons << 4) | highbits; //First packet byte!
p[1] = (xmove&0x3F);
p[2] = (ymove&0x3F);
signed2unsigned simply executes a typecast by union{sbyte s; byte u;}.
Are those resulting packets correct?
Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io