Skip to content

Commit

Permalink
Add hash to manifest for remaining cartridge based systems (#1536)
Browse files Browse the repository at this point in the history
This originally added the N64, but after inspecting remaining
cartridge/card/fixed ROM based systems I have also added the additional
four so that hash is available in manifest. This should complete adding
this info for these types of consoles.

N64
Gameboy Advance
MyVision
SG-1000
Sufami-Turbo
  • Loading branch information
remutro authored Jun 17, 2024
1 parent b5ee412 commit 8c4af6a
Show file tree
Hide file tree
Showing 5 changed files with 415 additions and 406 deletions.
6 changes: 4 additions & 2 deletions mia/medium/game-boy-advance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ auto GameBoyAdvance::load(string location) -> bool {
}
if(!rom) return false;

this->sha256 = Hash::SHA256(rom).digest();
this->location = location;
this->manifest = analyze(rom);
auto document = BML::unserialize(manifest);
Expand Down Expand Up @@ -134,8 +135,9 @@ auto GameBoyAdvance::analyze(vector<u8>& rom) -> string {

string s;
s += "game\n";
s +={" name: ", Medium::name(location), "\n"};
s +={" title: ", Medium::name(location), "\n"};
s +={" name: ", Medium::name(location), "\n"};
s +={" title: ", Medium::name(location), "\n"};
s +={" sha256: ", sha256, "\n"};
s += " board\n";

s += " memory\n";
Expand Down
6 changes: 4 additions & 2 deletions mia/medium/myvision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ auto MyVision::load(string location) -> bool {
}
if(!rom) return false;

this->sha256 = Hash::SHA256(rom).digest();
this->location = location;
this->manifest = analyze(rom);
auto document = BML::unserialize(manifest);
Expand All @@ -40,8 +41,9 @@ auto MyVision::save(string location) -> bool {
auto MyVision::analyze(vector<u8>& rom) -> string {
string s;
s += "game\n";
s +={" name: ", Medium::name(location), "\n"};
s +={" title: ", Medium::name(location), "\n"};
s +={" name: ", Medium::name(location), "\n"};
s +={" title: ", Medium::name(location), "\n"};
s +={" sha256: ", sha256, "\n"};
s += " board\n";
s += " memory\n";
s += " type: ROM\n";
Expand Down
Loading

0 comments on commit 8c4af6a

Please sign in to comment.