mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-09 23:41:09 -04:00
DOS: Fix cursor position
This commit is contained in:
parent
d75c537d81
commit
56f79192e7
@ -549,9 +549,6 @@ static void InitSockets(void) {
|
|||||||
char localip[16] = {0};
|
char localip[16] = {0};
|
||||||
char netmask[16] = {0};
|
char netmask[16] = {0};
|
||||||
char gateway[16] = {0};
|
char gateway[16] = {0};
|
||||||
|
|
||||||
u32 addr = inet_addr(localip);
|
|
||||||
Platform_Log1("ADDR: %h", &addr);
|
|
||||||
|
|
||||||
int ret = if_config(localip, netmask, gateway, TRUE, 20);
|
int ret = if_config(localip, netmask, gateway, TRUE, 20);
|
||||||
if (ret >= 0) {
|
if (ret >= 0) {
|
||||||
|
@ -22,6 +22,9 @@
|
|||||||
#define MOUSE_CMD_HIDE 0x0002
|
#define MOUSE_CMD_HIDE 0x0002
|
||||||
#define MOUSE_CMD_POLL 0x0003
|
#define MOUSE_CMD_POLL 0x0003
|
||||||
|
|
||||||
|
#define MOUSE_X(x) ((x) / 2)
|
||||||
|
#define MOUSE_Y(y) (y)
|
||||||
|
|
||||||
|
|
||||||
/*########################################################################################################################*
|
/*########################################################################################################################*
|
||||||
*------------------------------------------------------Mouse support------------------------------------------------------*
|
*------------------------------------------------------Mouse support------------------------------------------------------*
|
||||||
@ -45,8 +48,8 @@ static void Mouse_Poll(void) {
|
|||||||
__dpmi_int(INT_MOUSE, ®s);
|
__dpmi_int(INT_MOUSE, ®s);
|
||||||
|
|
||||||
int b = regs.x.bx;
|
int b = regs.x.bx;
|
||||||
int x = regs.x.cx;
|
int x = MOUSE_X(regs.x.cx);
|
||||||
int y = regs.x.dx;
|
int y = MOUSE_Y(regs.x.dx);
|
||||||
|
|
||||||
Input_SetNonRepeatable(CCMOUSE_L, b & 0x01);
|
Input_SetNonRepeatable(CCMOUSE_L, b & 0x01);
|
||||||
Input_SetNonRepeatable(CCMOUSE_R, b & 0x02);
|
Input_SetNonRepeatable(CCMOUSE_R, b & 0x02);
|
||||||
@ -64,8 +67,8 @@ static void Cursor_GetRawPos(int* x, int* y) {
|
|||||||
regs.x.ax = MOUSE_CMD_POLL;
|
regs.x.ax = MOUSE_CMD_POLL;
|
||||||
__dpmi_int(INT_MOUSE, ®s);
|
__dpmi_int(INT_MOUSE, ®s);
|
||||||
|
|
||||||
*x = regs.x.cx;
|
*x = MOUSE_X(regs.x.cx);
|
||||||
*y = regs.x.dx;
|
*y = MOUSE_Y(regs.x.dx);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Cursor_SetPosition(int x, int y) {
|
void Cursor_SetPosition(int x, int y) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user