void Interface::load(unsigned id, const stream& stream) { if(id == ID::SystemManifest) { system.information.manifest = stream.text(); } if(id == ID::Manifest) { cartridge.information.markup = stream.text(); } if(id == ID::ProgramROM) { stream.read(cartridge.board->prgrom.data, min(cartridge.board->prgrom.size, stream.size())); } if(id == ID::ProgramRAM) { stream.read(cartridge.board->prgram.data, min(cartridge.board->prgram.size, stream.size())); } if(id == ID::CharacterROM) { stream.read(cartridge.board->chrrom.data, min(cartridge.board->chrrom.size, stream.size())); } if(id == ID::CharacterRAM) { stream.read(cartridge.board->chrram.data, min(cartridge.board->chrram.size, stream.size())); } }
void Interface::load(unsigned id, const stream& stream) { if(id == ID::GameBoyBootROM) { stream.read(system.bootROM.dmg, min( 256u, stream.size())); } if(id == ID::SuperGameBoyBootROM) { stream.read(system.bootROM.sgb, min( 256u, stream.size())); } if(id == ID::GameBoyColorBootROM) { stream.read(system.bootROM.cgb, min(2048u, stream.size())); } if(id == ID::Manifest) cartridge.information.markup = stream.text(); if(id == ID::ROM) { stream.read(cartridge.romdata, min(cartridge.romsize, stream.size())); } if(id == ID::RAM) { stream.read(cartridge.ramdata, min(stream.size(), cartridge.ramsize)); } }
void Interface::load(unsigned id, const stream& stream) { if(id == ID::BIOS) { stream.read(bios.data, min(bios.size, stream.size())); } if(id == ID::Manifest) cartridge.information.markup = stream.text(); if(id == ID::ROM) { stream.read(cartridge.rom.data, min(cartridge.rom.size, stream.size())); } if(id == ID::RAM) { stream.read(cartridge.ram.data, min(cartridge.ram.size, stream.size())); } if(id == ID::EEPROM) { stream.read(cartridge.eeprom.data, min(cartridge.eeprom.size, stream.size())); } if(id == ID::FlashROM) { stream.read(cartridge.flashrom.data, min(cartridge.flashrom.size, stream.size())); } }
void Interface::load(unsigned id, const stream& stream) { if(id == ID::IPLROM) { stream.read(smp.iplrom, min(64u, stream.size())); } if(id == ID::Manifest) cartridge.information.markup.cartridge = stream.text(); if(id == ID::ROM) cartridge.rom.read(stream); if(id == ID::RAM) cartridge.ram.read(stream); if(id == ID::EventROM0) event.rom[0].read(stream); if(id == ID::EventROM1) event.rom[1].read(stream); if(id == ID::EventROM2) event.rom[2].read(stream); if(id == ID::EventROM3) event.rom[3].read(stream); if(id == ID::EventRAM) event.ram.read(stream); if(id == ID::SA1ROM) sa1.rom.read(stream); if(id == ID::SA1IRAM) sa1.iram.read(stream); if(id == ID::SA1BWRAM) sa1.bwram.read(stream); if(id == ID::SuperFXROM) superfx.rom.read(stream); if(id == ID::SuperFXRAM) superfx.ram.read(stream); if(id == ID::ArmDSPPROM) { for(unsigned n = 0; n < 128 * 1024; n++) armdsp.programROM[n] = stream.read(); } if(id == ID::ArmDSPDROM) { for(unsigned n = 0; n < 32 * 1024; n++) armdsp.dataROM[n] = stream.read(); } if(id == ID::ArmDSPRAM) { for(unsigned n = 0; n < 16 * 1024; n++) armdsp.programRAM[n] = stream.read(); } if(id == ID::HitachiDSPROM) hitachidsp.rom.read(stream); if(id == ID::HitachiDSPRAM) hitachidsp.ram.read(stream); if(id == ID::HitachiDSPDROM) { for(unsigned n = 0; n < 1024; n++) hitachidsp.dataROM[n] = stream.readl(3); } if(id == ID::HitachiDSPDRAM) { for(unsigned n = 0; n < 3072; n++) hitachidsp.dataRAM[n] = stream.readl(1); } if(id == ID::Nec7725DSPPROM) { for(unsigned n = 0; n < 2048; n++) necdsp.programROM[n] = stream.readl(3); } if(id == ID::Nec7725DSPDROM) { for(unsigned n = 0; n < 1024; n++) necdsp.dataROM[n] = stream.readl(2); } if(id == ID::Nec7725DSPRAM) { for(unsigned n = 0; n < 256; n++) necdsp.dataRAM[n] = stream.readl(2); } if(id == ID::Nec96050DSPPROM) { for(unsigned n = 0; n < 16384; n++) necdsp.programROM[n] = stream.readl(3); } if(id == ID::Nec96050DSPDROM) { for(unsigned n = 0; n < 2048; n++) necdsp.dataROM[n] = stream.readl(2); } if(id == ID::Nec96050DSPRAM) { for(unsigned n = 0; n < 2048; n++) necdsp.dataRAM[n] = stream.readl(2); } if(id == ID::EpsonRTC) { uint8 data[16] = {0}; stream.read(data, min(stream.size(), sizeof data)); epsonrtc.load(data); } if(id == ID::SharpRTC) { uint8 data[16] = {0}; stream.read(data, min(stream.size(), sizeof data)); sharprtc.load(data); } if(id == ID::SPC7110PROM) spc7110.prom.read(stream); if(id == ID::SPC7110DROM) spc7110.drom.read(stream); if(id == ID::SPC7110RAM) spc7110.ram.read(stream); if(id == ID::SDD1ROM) sdd1.rom.read(stream); if(id == ID::SDD1RAM) sdd1.ram.read(stream); if(id == ID::OBC1RAM) obc1.ram.read(stream); if(id == ID::SuperGameBoyBootROM) { stream.read(GameBoy::system.bootROM.sgb, min(stream.size(), 256u)); } if(id == ID::BsxROM) bsxcartridge.rom.read(stream); if(id == ID::BsxRAM) bsxcartridge.ram.read(stream); if(id == ID::BsxPSRAM) bsxcartridge.psram.read(stream); if(id == ID::SuperGameBoyManifest) cartridge.information.markup.gameBoy = stream.text(); if(id == ID::SuperGameBoyROM) { stream.read(GameBoy::cartridge.romdata, min(GameBoy::cartridge.romsize, stream.size())); } if(id == ID::SuperGameBoyRAM) { stream.read(GameBoy::cartridge.ramdata, min(GameBoy::cartridge.ramsize, stream.size())); } if(id == ID::SatellaviewManifest) cartridge.information.markup.satellaview = stream.text(); if(id == ID::SatellaviewROM) satellaviewcartridge.memory.read(stream); if(id == ID::SufamiTurboSlotAManifest) cartridge.information.markup.sufamiTurboA = stream.text(); if(id == ID::SufamiTurboSlotAROM) sufamiturboA.rom.read(stream); if(id == ID::SufamiTurboSlotBROM) sufamiturboB.rom.read(stream); if(id == ID::SufamiTurboSlotBManifest) cartridge.information.markup.sufamiTurboB = stream.text(); if(id == ID::SufamiTurboSlotARAM) sufamiturboA.ram.read(stream); if(id == ID::SufamiTurboSlotBRAM) sufamiturboB.ram.read(stream); }