Input: Selective updates based on latest source

This commit is contained in:
negativeExponent 2019-12-28 09:22:32 +08:00
parent 4364a501ee
commit 5a1cfa475f
2 changed files with 8 additions and 12 deletions

View File

@ -51,11 +51,11 @@ void PCEINPUT_Init(void)
SyncSettings();
}
void PCEINPUT_SetInput(int port, const char *type, void *ptr)
void PCEINPUT_SetInput(unsigned port, const char *type, uint8 *ptr)
{
if(!strcasecmp(type, "gamepad"))
if(!strcmp(type, "gamepad"))
InputTypes[port] = 1;
else if(!strcasecmp(type, "mouse"))
else if(!strcmp(type, "mouse"))
InputTypes[port] = 2;
else
InputTypes[port] = 0;
@ -82,9 +82,9 @@ void INPUT_Frame(void)
}
else if(InputTypes[x] == 2)
{
mouse_x[x] += (int32)MDFN_de32lsb(data_ptr[x] + 0);
mouse_y[x] += (int32)MDFN_de32lsb(data_ptr[x] + 4);
pce_mouse_button[x] = *(uint8 *)(data_ptr[x] + 8);
mouse_x[x] += (int16)MDFN_de16lsb(data_ptr[x] + 0);
mouse_y[x] += (int16)MDFN_de16lsb(data_ptr[x] + 2);
pce_mouse_button[x] = *(uint8 *)(data_ptr[x] + 4);
}
}
}
@ -148,11 +148,7 @@ uint8 INPUT_Read(unsigned int A)
}
else
{
if(pce_mouse_button[tmp_ri] & 1)
ret ^= 0x3; //pce_mouse_button[tmp_ri];
if(pce_mouse_button[tmp_ri] & 0x2)
ret ^= 0x8;
ret ^= pce_mouse_button[tmp_ri] & 0xF;
}
}
else

View File

@ -3,7 +3,7 @@
void PCEINPUT_Init(void);
void PCEINPUT_SettingChanged(const char *name);
void PCEINPUT_SetInput(int port, const char *type, void *ptr);
void PCEINPUT_SetInput(unsigned port, const char *type, uint8 *ptr);
uint8 INPUT_Read(unsigned int A);
void INPUT_Write(unsigned int A, uint8 V);
void INPUT_Frame(void);