- if (strcmp(fname + strlen(fname) - 3, ".gz") == 0) {\r
- file = gzopen(fname, "rb");\r
- emu_setSaveStateCbs(1);\r
- } else {\r
- file = fopen(fname, "rb");\r
- emu_setSaveStateCbs(0);\r
- }\r
-\r
- if (file) {\r
- if (PicoAHW & PAHW_MCD) {\r
- PicoCdLoadStateGfx(file);\r
- } else {\r
- areaSeek(file, 0x10020, SEEK_SET); // skip header and RAM in state file\r
- areaRead(Pico.vram, 1, sizeof(Pico.vram), file);\r
- areaSeek(file, 0x2000, SEEK_CUR);\r
- areaRead(Pico.cram, 1, sizeof(Pico.cram), file);\r
- areaRead(Pico.vsram, 1, sizeof(Pico.vsram), file);\r
- areaSeek(file, 0x221a0, SEEK_SET);\r
- areaRead(&Pico.video, 1, sizeof(Pico.video), file);\r
- }\r
- areaClose(file);\r
- }\r