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

Method Freeze

pcsx2/USB/usb-printer/usb-printer.cpp:340–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338 }
339
340 bool PrinterDevice::Freeze(USBDevice* dev, StateWrapper& sw) const
341 {
342 PrinterState* s = USB_CONTAINER_OF(dev, PrinterState, dev);
343
344 if (!sw.DoMarker("PrinterDevice"))
345 return false;
346
347 sw.Do(&s->selected_printer);
348 sw.Do(&s->cmd_state);
349 sw.DoBytes(&s->last_command, sizeof(s->last_command));
350 sw.Do(&s->last_command_size);
351 sw.Do(&s->width);
352 sw.Do(&s->height);
353 sw.Do(&s->stride);
354 sw.Do(&s->data_size);
355 sw.Do(&s->data_pos);
356
357 // toss any file being saved when we're loading, since we'd probably
358 // end up with a corrupted file otherwise
359 if (sw.IsReading())
360 sony_cancel_file(s);
361
362 return true;
363 }
364
365 std::span<const char*> PrinterDevice::SubTypes() const
366 {

Callers

nothing calls this directly

Calls 5

sony_cancel_fileFunction · 0.85
DoMarkerMethod · 0.80
DoBytesMethod · 0.80
IsReadingMethod · 0.80
DoMethod · 0.45

Tested by

no test coverage detected