MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / DoDeviceState

Method DoDeviceState

pcsx2/USB/USB.cpp:237–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237void USB::DoDeviceState(USBDevice* dev, StateWrapper& sw)
238{
239 if (!sw.DoMarker("USBDevice"))
240 return;
241
242 sw.Do(&dev->speed);
243 sw.Do(&dev->addr);
244 sw.Do(&dev->state);
245 sw.DoBytes(&dev->setup_buf, sizeof(dev->setup_buf));
246 sw.DoBytes(&dev->data_buf, sizeof(dev->data_buf));
247 sw.Do(&dev->remote_wakeup);
248 sw.Do(&dev->setup_state);
249 sw.Do(&dev->setup_len);
250 sw.Do(&dev->setup_index);
251
252 sw.Do(&dev->configuration);
253 if (sw.IsReading())
254 usb_desc_set_config(dev, dev->configuration);
255
256 int altsetting[USB_MAX_INTERFACES];
257 std::memcpy(altsetting, dev->altsetting, sizeof(altsetting));
258 sw.DoPODArray(altsetting, std::size(altsetting));
259 if (sw.IsReading())
260 {
261 for (u32 i = 0; i < USB_MAX_INTERFACES; i++)
262 {
263 dev->altsetting[i] = altsetting[i];
264 usb_desc_set_interface(dev, i, altsetting[i]);
265 }
266 }
267
268 DoEndpointState(&dev->ep_ctl, sw);
269 for (u32 i = 0; i < USB_MAX_ENDPOINTS; i++)
270 DoEndpointState(&dev->ep_in[i], sw);
271 for (u32 i = 0; i < USB_MAX_ENDPOINTS; i++)
272 DoEndpointState(&dev->ep_out[i], sw);
273}
274
275void USB::DoEndpointState(USBEndpoint* ep, StateWrapper& sw)
276{

Callers

nothing calls this directly

Calls 8

usb_desc_set_configFunction · 0.85
usb_desc_set_interfaceFunction · 0.85
DoMarkerMethod · 0.80
DoBytesMethod · 0.80
IsReadingMethod · 0.80
DoPODArrayMethod · 0.80
sizeFunction · 0.50
DoMethod · 0.45

Tested by

no test coverage detected