55d54
< lastCommand(NoCommand),
67d65
< SERIALIZE_SCALAR(lastCommand);
76d73
< UNSERIALIZE_SCALAR(lastCommand);
81,82c78,79
< void
< PS2Keyboard::recv(uint8_t data)
---
> bool
> PS2Keyboard::recv(const std::vector<uint8_t> &data)
84,86c81,87
< if (lastCommand != NoCommand) {
< switch (lastCommand) {
< case LEDWrite:
---
> switch (data[0]) {
> case LEDWrite:
> if (data.size() == 1) {
> DPRINTF(PS2, "Got LED write command.\n");
> sendAck();
> return false;
> } else {
89,91c90,92
< bits(data, 2) ? "on" : "off",
< bits(data, 1) ? "on" : "off",
< bits(data, 0) ? "on" : "off");
---
> bits(data[1], 2) ? "on" : "off",
> bits(data[1], 1) ? "on" : "off",
> bits(data[1], 0) ? "on" : "off");
93,99c94
< lastCommand = NoCommand;
< break;
< case TypematicInfo:
< DPRINTF(PS2, "Setting typematic info to %#02x.\n", data);
< sendAck();
< lastCommand = NoCommand;
< break;
---
> return true;
101,109d95
< return;
< }
<
< switch (data) {
< case LEDWrite:
< DPRINTF(PS2, "Got LED write command.\n");
< sendAck();
< lastCommand = LEDWrite;
< break;
118c104
< break;
---
> return true;
120,123c106,114
< DPRINTF(PS2, "Setting typematic info.\n");
< sendAck();
< lastCommand = TypematicInfo;
< break;
---
> if (data.size() == 1) {
> DPRINTF(PS2, "Setting typematic info.\n");
> sendAck();
> return false;
> } else {
> DPRINTF(PS2, "Setting typematic info to %#02x.\n", data[1]);
> sendAck();
> return true;
> }
128c119
< break;
---
> return true;
133c124
< break;
---
> return true;
138c129
< break;
---
> return true;
159c150
< panic("Unknown keyboard command %#02x.\n", data);
---
> panic("Unknown keyboard command %#02x.\n", data[0]);