static void loadState(RomMapperKonami5* rm) { SaveState* state = saveStateOpenForRead("mapperKonami5"); char tag[16]; int i; for (i = 0; i < 4; i++) { sprintf(tag, "romMapper%d", i); rm->romMapper[i] = saveStateGet(state, tag, 0); } rm->sccEnable = saveStateGet(state, "sccEnable", 0); saveStateClose(state); sccLoadState(rm->scc); for (i = 0; i < 4; i++) { slotMapPage(rm->slot, rm->sslot, rm->startPage + i, rm->romData + rm->romMapper[i] * 0x2000, 1, 0); } if (rm->sccEnable) { slotMapPage(rm->slot, rm->sslot, rm->startPage + 2, rm->romData + rm->romMapper[2] * 0x2000, 0, 0); } else { slotMapPage(rm->slot, rm->sslot, rm->startPage + 2, rm->romData + rm->romMapper[2] * 0x2000, 1, 0); } }
void moonsoundLoadState(Moonsound* moonsound) { SaveState* state = saveStateOpenForRead("moonsound"); moonsound->timerValue1 = saveStateGet(state, "timerValue1", 0); moonsound->timeout1 = saveStateGet(state, "timeout1", 0); moonsound->timerStarted1 = saveStateGet(state, "timerStarted1", 0); moonsound->timerRef1 = (UInt8)saveStateGet(state, "timerRef1", 0); moonsound->timerValue2 = saveStateGet(state, "timerValue2", 0); moonsound->timeout2 = saveStateGet(state, "timeout2", 0); moonsound->timerStarted2 = saveStateGet(state, "timerStarted2", 0); moonsound->timerRef2 = (UInt8)saveStateGet(state, "timerRef2", 0); moonsound->opl3latch = saveStateGet(state, "opl3latch", 0); moonsound->opl4latch = (UInt8)saveStateGet(state, "opl4latch", 0); saveStateClose(state); moonsound->ymf262->loadState(); moonsound->ymf278->loadState(); if (moonsound->timerStarted1) { boardTimerAdd(moonsound->timer1, moonsound->timeout1); } if (moonsound->timerStarted2) { boardTimerAdd(moonsound->timer2, moonsound->timeout2); } }
static void loadState(RomMapperS1990* rm) { SaveState* state = saveStateOpenForRead("mapperS1990"); rm->registerSelect = (UInt8)saveStateGet(state, "registerSelect", 0); rm->cpuStatus = (UInt8)saveStateGet(state, "cpuStatus", 0); saveStateClose(state); }
static void ym2148LoadState(YM2148* midi) { SaveState* state = saveStateOpenForRead("ym2148"); midi->command = (UInt8)saveStateGet(state, "command", 0); midi->vector = (UInt8)saveStateGet(state, "vector", 0); saveStateClose(state); }
void ym2151LoadState(YM2151* ym2151) { SaveState* state = saveStateOpenForRead("ym2151"); ym2151->address = (UInt8)saveStateGet(state, "address", 0); ym2151->latch = (UInt8)saveStateGet(state, "latch", 0); ym2151->timerValue1 = saveStateGet(state, "timerValue1", 0); ym2151->timerRunning1 = saveStateGet(state, "timerRunning1", 0); ym2151->timeout1 = saveStateGet(state, "timeout1", 0); ym2151->timerValue2 = saveStateGet(state, "timerValue2", 0); ym2151->timerRunning2 = saveStateGet(state, "timerRunning2", 0); ym2151->timeout2 = saveStateGet(state, "timeout2", 0); ym2151->irqVector = (UInt8)saveStateGet(state, "irqVector", 0); saveStateClose(state); YM2151LoadState(ym2151->opl); if (ym2151->timerRunning1) { boardTimerAdd(ym2151->timer1, ym2151->timeout1); } if (ym2151->timerRunning2) { boardTimerAdd(ym2151->timer2, ym2151->timeout2); } }
static void loadState(RomMapperSvi328Rs232* rs232) { SaveState* state = saveStateOpenForRead("Svi328Rs232"); rs232->connector = saveStateGet(state, "connector", 0); rs232->deviceHandle = (UInt8)saveStateGet(state, "deviceHandle", 0); saveStateClose(state); i8250LoadState(rs232->i8250); }
static void loadState(RomMapperPhilipsFdc* rm) { SaveState* state = saveStateOpenForRead("mapperPhilipsFdc"); rm->sideReg = (UInt8)saveStateGet(state, "sideReg", 0); rm->driveReg = (UInt8)saveStateGet(state, "driveReg", 0); saveStateClose(state); wd2793LoadState(rm->fdc); }
static void loadState(SviPPI* ppi) { SaveState* state = saveStateOpenForRead("SviPPI"); ppi->row = (UInt8)saveStateGet(state, "row", 0); ppi->regCHi = saveStateGet(state, "regCHi", -1); saveStateClose(state); i8255LoadState(ppi->i8255); }
void vlm5030LoadState(VLM5030* vlm5030) { SaveState* state = saveStateOpenForRead("vlm5030"); vlm5030->timer = saveStateGet(state, "timer", 0); vlm5030->ctrlVolume = saveStateGet(state, "ctrlVolume", 0); vlm5030->oldSampleVolume = saveStateGet(state, "oldSampleVolume", 0); vlm5030->sampleVolume = saveStateGet(state, "sampleVolume", 0); vlm5030->daVolume = saveStateGet(state, "daVolume", 0); saveStateClose(state); }
static void loadState(MSXRs232* msxRs232) { SaveState* state = saveStateOpenForRead("MSXRs232"); msxRs232->status = (UInt8)saveStateGet(state, "status", 0); msxRs232->intmask = (UInt8)saveStateGet(state, "intmask", 0); saveStateClose(state); i8251LoadState(msxRs232->i8251); i8254LoadState(msxRs232->i8254); }
static void loadState(RamMapperIo* rm) { SaveState* state = saveStateOpenForRead("mapperRamIo"); rm->port[0] = saveStateGet(state, "port0", 3); rm->port[1] = saveStateGet(state, "port1", 2); rm->port[2] = saveStateGet(state, "port2", 1); rm->port[3] = saveStateGet(state, "port3", 0); rm->mask = ramMapperIoGetMask(rm); saveStateClose(state); }
static void loadState(RomMapperGIde* rm) { SaveState* state = saveStateOpenForRead("RomMapperGIde"); rm->intEnable = (UInt8)saveStateGet(state, "intEnable", 0); rm->drvSelect = (UInt8)saveStateGet(state, "drvSelect", 0); rm->altStatus = (UInt8)saveStateGet(state, "altStatus", 0); saveStateClose(state); harddiskIdeLoadState(rm->hdide); }
static void loadState(RomMapperSunriseIde* rm) { SaveState* state = saveStateOpenForRead("mapperSunriseIde"); rm->ideEnabled = saveStateGet(state, "ideEnabled", 0); rm->readLatch = (UInt8)saveStateGet(state, "readLatch", 0); rm->writeLatch = (UInt8)saveStateGet(state, "writeLatch", 0); rm->romMapper = saveStateGet(state, "romMapper", 0); saveStateClose(state); sunriseIdeLoadState(rm->ide); }
static void loadState(RomMapperRsIde* rm) { SaveState* state = saveStateOpenForRead("RomMapperRsIde"); rm->ideAddress = (UInt8)saveStateGet(state, "ideAddress", 0); rm->ideIoRead = (UInt8)saveStateGet(state, "ideIoRead", 0); rm->ideIoWrite = (UInt8)saveStateGet(state, "ideIoWrite", 0); rm->ideData = (UInt8)saveStateGet(state, "ideData", 0); saveStateClose(state); harddiskIdeLoadState(rm->hdide); i8255LoadState(rm->i8255); }
static void loadState(RomMapperTurboRPcm* rm) { SaveState* state = saveStateOpenForRead("mapperTurboRPcm"); rm->sample = (UInt8)saveStateGet(state, "sample", 0); rm->status = (UInt8)saveStateGet(state, "status", 0); rm->time = (UInt8)saveStateGet(state, "time", 0); rm->refTime = saveStateGet(state, "refTime", 0); rm->refFrag = saveStateGet(state, "refFrag", 0); mixerSetEnable(rm->mixer, rm->status & 1); saveStateClose(state); }
static void loadState(SonyHBI55* rm) { SaveState* state = saveStateOpenForRead("SonyHBI55"); rm->mode = (UInt8) saveStateGet(state, "mode", 0); rm->addrLatch = (UInt8) saveStateGet(state, "addrLatch", 0); rm->writeLatch = (UInt8) saveStateGet(state, "writeLatch", 0); rm->writeAddr = (UInt16)saveStateGet(state, "writeAddr", 0); rm->readAddr = (UInt16)saveStateGet(state, "readAddr", 0); saveStateClose(state); i8255LoadState(rm->i8255); }
static void loadState(RomMapperSCCplus* rm) { SaveState* state = saveStateOpenForRead("mapperSCCplus"); char tag[16]; int bank; int i; for (i = 0; i < 4; i++) { sprintf(tag, "romMapper%d", i); rm->romMapper[i] = saveStateGet(state, tag, 0); sprintf(tag, "isRamSegment%d", i); rm->isRamSegment[i] = saveStateGet(state, tag, 0); sprintf(tag, "isMapped%d", i); rm->isMapped[i] = saveStateGet(state, tag, 0); } rm->modeRegister = (UInt8)saveStateGet(state, "modeRegister", 0); rm->sccMode = saveStateGet(state, "sccMode", 0); saveStateGetBuffer(state, "romData", rm->romData, sizeof(rm->romData)); saveStateClose(state); sccLoadState(rm->scc); for (bank = 0; bank < 4; bank++) { if (rm->isMapped[bank]) { slotMapPage(rm->slot, rm->sslot, rm->startPage + bank, rm->romData + 0x2000 * rm->romMapper[bank], 1, 0); } else { slotMapPage(rm->slot, rm->sslot, rm->startPage + bank, rm->romData + 0x20000, 1, 0); } } if (rm->sccMode == SCC_PLUS) { slotMapPage(rm->slot, rm->sslot, rm->startPage + 2, NULL, 1, 0); slotMapPage(rm->slot, rm->sslot, rm->startPage + 3, NULL, 0, 0); } else if (rm->sccMode = SCC_COMPATIBLE) { slotMapPage(rm->slot, rm->sslot, rm->startPage + 2, NULL, 0, 0); slotMapPage(rm->slot, rm->sslot, rm->startPage + 3, NULL, 1, 0); } else { slotMapPage(rm->slot, rm->sslot, rm->startPage + 2, NULL, 1, 0); slotMapPage(rm->slot, rm->sslot, rm->startPage + 3, NULL, 1, 0); } }
static void loadState() { SaveState* state = saveStateOpenForRead("svi"); svi80ColEnabled = saveStateGet(state, "svi80ColEnabled", 0); psgAYReg15 = (UInt8)saveStateGet(state, "psgAYReg15", 0); saveStateClose(state); r800LoadState(r800); boardInit(&r800->systemTime); deviceManagerLoadState(); slotLoadState(); ay8910LoadState(ay8910); }
static void loadState(RomMapperOpcodeMegaRam* rm) { SaveState* state = saveStateOpenForRead("mapperOpcodeMegaRam"); rm->megaRamLatch[0] = (UInt8)saveStateGet(state, "megaRamLatch0", 0); rm->megaRamLatch[1] = (UInt8)saveStateGet(state, "megaRamLatch1", 0); rm->megaRamLatch[2] = (UInt8)saveStateGet(state, "megaRamLatch2", 0); rm->megaRamLatch[3] = (UInt8)saveStateGet(state, "megaRamLatch3", 0); saveStateGetBuffer(state, "megaRam", rm->megaRam, 0x20000); saveStateClose(state); slotUpdate(rm); }
static void loadState(MSXMidi* msxMidi) { SaveState* state = saveStateOpenForRead("MSXMidi"); msxMidi->timerIRQlatch = saveStateGet(state, "timerIRQlatch", 0); msxMidi->timerIRQenabled = saveStateGet(state, "timerIRQenabled", 0); msxMidi->rxrdyIRQlatch = saveStateGet(state, "rxrdyIRQlatch", 0); msxMidi->rxrdyIRQenabled = saveStateGet(state, "rxrdyIRQenabled", 0); saveStateClose(state); i8251LoadState(msxMidi->i8251); i8254LoadState(msxMidi->i8254); archMidiLoadState(); }
static void loadState(RomMapperObsonet* rm) { SaveState* state = saveStateOpenForRead("mapperObsonet"); rm->romMapper = (UInt8)saveStateGet(state, "romMapper", 0); rm->regBank = (UInt8)saveStateGet(state, "regBank", 0); saveStateClose(state); amdFlashLoadState(rm->amdFlash); rtl8019LoadState(rm->rtl8019); rm->flashPage = amdFlashGetPage(rm->amdFlash, rm->romMapper * 0x4000); slotMapPage(rm->slot, rm->sslot, rm->startPage + 0, rm->flashPage, 1, 0); }
void archMidiLoadState(void) { SaveState* state = saveStateOpenForRead("ArchMidi"); char buf[64]; int i; // Get history for (i = 0; i < HISTORY_SIZE; i++) { char buf[32]; sprintf(buf, "history_%d", i); midi.out.history.data[i] = saveStateGet(state, buf, 0); } midi.out.history.head = saveStateGet(state, "history_head", 0); for (i = 0; i < 4; i++) { DevInfo* di = NULL; switch (i) { case 0: di = midi.out.current[0]; break; case 1: di = midi.out.current[1]; break; case 2: di = midi.in.current[0]; break; case 3: di = midi.in.current[1]; break; } if (di != NULL) { sprintf(buf, "buffer_%d_count", i); di->buffer.count = saveStateGet(state, buf, 0); sprintf(buf, "buffer_%d_remain", i); di->buffer.remain = saveStateGet(state, buf, 0); // status byte must be resent from di->buffer.data[0] // even if di->buffer.runningStatus was 1 when state saved. di->buffer.runningStatus = 0; sprintf(buf, "buffer_%d_data", i); saveStateGetBuffer(state, buf, di->buffer.data, sizeof(di->buffer.data)); } } saveStateClose(state); midiEnableMt32ToGmMapping(midi.out.mt32ToGm); }
static void loadState(RomMapperSvi328Col80* svi328col80) { SaveState* state = saveStateOpenForRead("Svi80Col"); svi328col80->memBankCtrl = (UInt8)saveStateGet(state, "memBankCtrl", 0); saveStateClose(state); }
static void loadState(RomMapperKanji12* rm) { SaveState* state = saveStateOpenForRead("mapperKanji12"); rm->address = saveStateGet(state, "address", 0); saveStateClose(state); }
static void loadState(RomMapperF4device* rm) { SaveState* state = saveStateOpenForRead("mapperF4device"); rm->status = saveStateGet(state, "status", 0); saveStateClose(state); }
static void loadState(Ram1kBMirrored* rm) { SaveState* state = saveStateOpenForRead("mapperMirroredRam"); rm->mask = saveStateGet(state, "mask", 0x400); saveStateGetBuffer(state, "ramData", rm->ramData, rm->mask + 1); saveStateClose(state); }
static void loadState(RomMapperA1FMModem* rm) { SaveState* state = saveStateOpenForRead("mapperPanasonicA1FM"); rm->romMapper = saveStateGet(state, "romMapper", 0); saveStateClose(state); slotMapPage(rm->slot, rm->sslot, rm->startPage, rm->romData + rm->romMapper * 0x2000, 1, 0); }
void tapeLoadState() { SaveState* state = saveStateOpenForRead("tape"); ramImagePos = saveStateGet(state, "ramImagePos", 0); if (ramImagePos >= ramImageSize) { ramImagePos = 0; } saveStateClose(state); }
static void loadState(RomMapperNationalFdc* rm) { SaveState* state = saveStateOpenForRead("mapperNationalFdc"); rm->reg = (UInt8)saveStateGet(state, "reg", 0); saveStateClose(state); wd2793LoadState(rm->fdc); }
static void loadState(Svi328Fdc* rm) { SaveState* state = saveStateOpenForRead("Svi328Fdc"); rm->drvSelect = (UInt8)saveStateGet(state, "drvSelect", 0); saveStateClose(state); wd2793LoadState(rm->fdc); }