sg-1000.cpp 933 B

123456789101112131415161718192021222324252627282930
  1. struct SG1000 : Cartridge {
  2. auto name() -> string override { return "SG-1000"; }
  3. auto extensions() -> vector<string> override { return {"sg1000", "sg"}; }
  4. auto export(string location) -> vector<uint8_t> override;
  5. auto heuristics(vector<uint8_t>& data, string location) -> string override;
  6. };
  7. auto SG1000::export(string location) -> vector<uint8_t> {
  8. vector<uint8_t> data;
  9. append(data, {location, "program.rom"});
  10. return data;
  11. }
  12. auto SG1000::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: 0x4000\n";
  25. s += " content: Save\n";
  26. return s;
  27. }