mirror of https://github.com/PCSX2/pcsx2.git
USB: restore qemu hid event handler after savestate load
This commit is contained in:
parent
b3b272e2e2
commit
b5e561e68f
|
@ -807,6 +807,8 @@ namespace usb_hid
|
|||
if (!s)
|
||||
return -1;
|
||||
s->f = *freezed;
|
||||
hid_init(&s->f.hid, HID_KEYBOARD, usb_hid_changed);
|
||||
|
||||
return sizeof(UsbHIDState::freeze);
|
||||
case FREEZE_SAVE:
|
||||
if (!s)
|
||||
|
@ -893,7 +895,31 @@ namespace usb_hid
|
|||
|
||||
int HIDMouseDevice::Freeze(int mode, USBDevice* dev, void* data)
|
||||
{
|
||||
return HIDKbdDevice::Freeze(mode, dev, data);
|
||||
auto s = reinterpret_cast<UsbHIDState*>(dev);
|
||||
auto freezed = reinterpret_cast<UsbHIDState::freeze*>(data);
|
||||
|
||||
if (!s)
|
||||
return 0;
|
||||
switch (mode)
|
||||
{
|
||||
case FREEZE_LOAD:
|
||||
if (!s)
|
||||
return -1;
|
||||
s->f = *freezed;
|
||||
hid_init(&s->f.hid, HID_MOUSE, usb_hid_changed);
|
||||
|
||||
return sizeof(UsbHIDState::freeze);
|
||||
case FREEZE_SAVE:
|
||||
if (!s)
|
||||
return -1;
|
||||
*freezed = s->f;
|
||||
return sizeof(UsbHIDState::freeze);
|
||||
case FREEZE_SIZE:
|
||||
return sizeof(UsbHIDState::freeze);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ---- BeatMania Da Da Da!! ----
|
||||
|
|
Loading…
Reference in New Issue