diff --git a/VoodooRMI/Functions/F17.cpp b/VoodooRMI/Functions/F17.cpp index e7583e9..16c7060 100644 --- a/VoodooRMI/Functions/F17.cpp +++ b/VoodooRMI/Functions/F17.cpp @@ -244,8 +244,8 @@ int F17::rmi_f17_process_stick(struct rmi_f17_stick_data *stick) { } else { IOLogDebug("%s: Reporting dx: %d, dy: %d\n", __func__, stick->data.rel.x_delta, stick->data.rel.y_delta); - report.dx = (SInt32)((SInt64)stick->data.rel.x_delta; - report.dy = -(SInt32)((SInt64)stick->data.rel.y_delta; + report.dx = (SInt32)((SInt64)stick->data.rel.x_delta); + report.dy = -(SInt32)((SInt64)stick->data.rel.y_delta); report.buttons = 0; handleReport(&report); diff --git a/VoodooRMI/RMIBus.cpp b/VoodooRMI/RMIBus.cpp index 9f2ecd8..963e7ad 100644 --- a/VoodooRMI/RMIBus.cpp +++ b/VoodooRMI/RMIBus.cpp @@ -108,6 +108,7 @@ bool RMIBus::start(IOService *provider) { void RMIBus::handleHostNotify(AbsoluteTime time, UInt8 *data, size_t size) { UInt32 irqStatus; + UInt8 *dataPtr = nullptr; if (controlFunction == nullptr) { IOLogError("Interrupt - No F01"); return; @@ -115,6 +116,8 @@ void RMIBus::handleHostNotify(AbsoluteTime time, UInt8 *data, size_t size) { if (data) { irqStatus = data[0]; + dataPtr = &data[1]; + size -= sizeof(UInt8); } else { IOReturn error = controlFunction->readIRQ(irqStatus); if (error != kIOReturnSuccess){ @@ -129,7 +132,6 @@ void RMIBus::handleHostNotify(AbsoluteTime time, UInt8 *data, size_t size) { return; } - UInt8 *dataPtr = &data[1]; while(RMIFunction *func = OSDynamicCast(RMIFunction, iter->getNextObject())) { if (func->hasAttnSig(irqStatus)) { func->attention(time, &dataPtr, &size);