USBqemu: Some small changes to init & savestates. The savestates are still incomplete though.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4907 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gigaherz 2011-09-04 16:10:00 +00:00
parent 2e6a0eaf46
commit 537dbcc58c
1 changed files with 12 additions and 2 deletions

View File

@ -61,7 +61,7 @@ void __Log(char *fmt, ...) {
static void InitLibraryName()
{
#ifdef SPU2X_PUBLIC_RELEASE
#ifdef USBQEMU_PUBLIC_RELEASE
// Public Release!
// Output a simplified string that's just our name:
@ -145,6 +145,9 @@ s32 CALLBACK USBinit() {
qemu_ohci->rhport[0].port.dev = usb_keyboard_init();
qemu_ohci->rhport[0].port.ops->attach(&(qemu_ohci->rhport[0].port));
clocks = 0;
remaining = 0;
return 0;
}
@ -245,6 +248,8 @@ char USBfreezeID[] = "USBqemu01";
typedef struct {
char freezeID[10];
int cycles;
int remaining;
OHCIState t;
int extraData; // for future expansion with the device state
} USBfreezeData;
@ -262,6 +267,8 @@ s32 CALLBACK USBfreeze(int mode, freezeData *data) {
usbd = *(USBfreezeData*)data->data;
usbd.freezeID[9] = 0;
usbd.cycles = clocks;
usbd.remaining = remaining;
if( strcmp(usbd.freezeID, USBfreezeID) != 0)
{
@ -300,6 +307,9 @@ s32 CALLBACK USBfreeze(int mode, freezeData *data) {
usbd.t.rhport[i].port.dev = NULL; // pointers
}
clocks = usbd.cycles;
remaining = usbd.remaining;
// WARNING: TODO: Save the state of the attached devices!
}