MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / inputdevice_get_unplugged_device

Function inputdevice_get_unplugged_device

src/inputdevice.cpp:589–604  ·  view source on GitHub ↗

return port where idc was previously plugged if any and forgot it.

Source from the content-addressed store, hash-verified

587
588// return port where idc was previously plugged if any and forgot it.
589static int inputdevice_get_unplugged_device(struct inputdevconfig *idc, struct stored_jport **sjp)
590{
591 for (int portnum = 0; portnum < MAX_JPORTS; portnum++) {
592 for (int i = 0; i < MAX_STORED_JPORTS; i++) {
593 struct stored_jport *jp = &stored_jports[portnum][i];
594 if (jp->inuse && jp->jp.id == JPORT_UNPLUGGED) {
595 if (!_tcscmp(idc->name, jp->jp.idc.name) && !_tcscmp(idc->configname, jp->jp.idc.configname)) {
596 jp->inuse = false;
597 *sjp = jp;
598 return portnum;
599 }
600 }
601 }
602 }
603 return -1;
604}
605
606// forget port's unplugged device
607void inputdevice_forget_unplugged_device(int portnum)

Callers 1

inputdevice_devicechangeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected