master-system.cpp 954 B

123456789101112131415161718192021222324252627282930
  1. struct MasterSystem : Cartridge {
  2. auto name() -> string override { return "Master System"; }
  3. auto extensions() -> vector<string> override { return {"ms", "sms"}; }
  4. auto export(string location) -> vector<uint8_t> override;
  5. auto heuristics(vector<uint8_t>& data, string location) -> string override;
  6. };
  7. auto MasterSystem::export(string location) -> vector<uint8_t> {
  8. vector<uint8_t> data;
  9. append(data, {location, "program.rom"});
  10. return data;
  11. }
  12. auto MasterSystem::heuristics(vector<uint8_t>& data, string location) -> string {
  13. string s;
  14. s += "game\n";
  15. s +={" name: ", Media::name(location), "\n"};
  16. s +={" label: ", Media::name(location), "\n"};
  17. s += " board\n";
  18. s += " memory\n";
  19. s += " type: ROM\n";
  20. s +={" size: 0x", hex(data.size()), "\n"};
  21. s += " content: Program\n";
  22. s += " memory\n";
  23. s += " type: RAM\n";
  24. s += " size: 0x8000\n";
  25. s += " content: Save\n";
  26. return s;
  27. }