Skip to content

Commit

Permalink
gb: use "Game Boy" save path for both GB and GBC
Browse files Browse the repository at this point in the history
Fixes using the same rom file on both GB and GBC hardware without losing save-data between them
Fixes Pokemon Stadium when loading a .gbc rom (the Transfer Pak only used the GB path)

Existing users using a custom save game path will have to manually move their saves from "Game Boy Color" to "Game Boy"
Users using the default "Save alongside rom files" will not have to take any action.
  • Loading branch information
LukeUsher committed Feb 10, 2025
1 parent d6c8d36 commit 9bbcf63
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions mia/medium/game-boy-color.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
struct GameBoyColor : GameBoy {
auto name() -> string override { return "Game Boy Color"; }
auto saveName() -> string override { return "Game Boy"; }
auto extensions() -> vector<string> override { return {"gb", "gbc"}; }
};
2 changes: 1 addition & 1 deletion mia/pak/pak.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ auto Pak::saveLocation(string location, string name, string extension) -> string
string saveLocation;
if(auto path = mia::saveLocation()) {
//if the user has chosen a specific location to save files to ...
saveLocation = {path, this->name(), "/", Location::prefix(location), extension};
saveLocation = {path, this->saveName(), "/", Location::prefix(location), extension};
} else if(directory::exists(location)) {
//if this is a pak ...
saveLocation = {location, name};
Expand Down
1 change: 1 addition & 0 deletions mia/pak/pak.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ struct Pak {
virtual ~Pak() = default;
virtual auto type() -> string { return pak->attribute("type"); }
virtual auto name() -> string { return pak->attribute("name"); }
virtual auto saveName() -> string { return pak->attribute("name"); }
virtual auto extensions() -> vector<string> { return {}; }
virtual auto load(string location = {}) -> LoadResult { return successful; }
virtual auto loadMultiple(vector<string> location = {}) -> bool { return true; }
Expand Down

0 comments on commit 9bbcf63

Please sign in to comment.