struct Cartridge : property { enum class Region : unsigned { NTSC, PAL }; MappedRAM rom; MappedRAM ram; auto loaded() const -> bool { return _loaded; } auto sha256() const -> string { return _sha256; } auto region() const -> Region { return _region; } readonly hasICD2; readonly hasMCC; readonly hasNSSDIP; readonly hasEvent; readonly hasSA1; readonly hasSuperFX; readonly hasARMDSP; readonly hasHitachiDSP; readonly hasNECDSP; readonly hasEpsonRTC; readonly hasSharpRTC; readonly hasSPC7110; readonly hasSDD1; readonly hasOBC1; readonly hasMSU1; readonly hasSuperGameBoySlot; readonly hasSatellaviewSlot; readonly hasSufamiTurboSlots; struct Mapping { function reader; function writer; string addr; unsigned size = 0; unsigned base = 0; unsigned mask = 0; Mapping() = default; Mapping(const function&, const function&); Mapping(SuperFamicom::Memory&); }; vector mapping; struct Memory { unsigned id; string name; }; vector memory; struct Information { struct Markup { string cartridge; string gameBoy; string satellaview; string sufamiTurboA; string sufamiTurboB; } markup; struct Title { string cartridge; string gameBoy; string satellaview; string sufamiTurboA; string sufamiTurboB; } title; } information; Cartridge() = default; ~Cartridge() { unload(); } auto title() -> string; auto load() -> void; auto unload() -> void; auto serialize(serializer&) -> void; private: auto loadSuperGameBoy() -> void; auto loadSatellaview() -> void; auto loadSufamiTurboA() -> void; auto loadSufamiTurboB() -> void; friend class Interface; //markup.cpp auto parseMarkup(const string&) -> void; auto parseMarkupMap(Mapping&, Markup::Node) -> void; auto parseMarkupMemory(MappedRAM&, Markup::Node, unsigned id, bool writable) -> void; auto parseMarkupCartridge(Markup::Node) -> void; auto parseMarkupICD2(Markup::Node) -> void; auto parseMarkupMCC(Markup::Node) -> void; auto parseMarkupSatellaview(Markup::Node) -> void; auto parseMarkupSufamiTurbo(Markup::Node, bool slot) -> void; auto parseMarkupNSS(Markup::Node) -> void; auto parseMarkupEvent(Markup::Node) -> void; auto parseMarkupSA1(Markup::Node) -> void; auto parseMarkupSuperFX(Markup::Node) -> void; auto parseMarkupARMDSP(Markup::Node) -> void; auto parseMarkupHitachiDSP(Markup::Node, unsigned roms) -> void; auto parseMarkupNECDSP(Markup::Node) -> void; auto parseMarkupEpsonRTC(Markup::Node) -> void; auto parseMarkupSharpRTC(Markup::Node) -> void; auto parseMarkupSPC7110(Markup::Node) -> void; auto parseMarkupSDD1(Markup::Node) -> void; auto parseMarkupOBC1(Markup::Node) -> void; auto parseMarkupMSU1(Markup::Node) -> void; bool _loaded = false; string _sha256; Region _region = Region::NTSC; }; extern Cartridge cartridge;