Skip to content

Commit 9bbcf63

Browse files
committed
gb: use "Game Boy" save path for both GB and GBC
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.
1 parent d6c8d36 commit 9bbcf63

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

mia/medium/game-boy-color.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
struct GameBoyColor : GameBoy {
22
auto name() -> string override { return "Game Boy Color"; }
3+
auto saveName() -> string override { return "Game Boy"; }
34
auto extensions() -> vector<string> override { return {"gb", "gbc"}; }
45
};

mia/pak/pak.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ auto Pak::saveLocation(string location, string name, string extension) -> string
149149
string saveLocation;
150150
if(auto path = mia::saveLocation()) {
151151
//if the user has chosen a specific location to save files to ...
152-
saveLocation = {path, this->name(), "/", Location::prefix(location), extension};
152+
saveLocation = {path, this->saveName(), "/", Location::prefix(location), extension};
153153
} else if(directory::exists(location)) {
154154
//if this is a pak ...
155155
saveLocation = {location, name};

mia/pak/pak.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ struct Pak {
44
virtual ~Pak() = default;
55
virtual auto type() -> string { return pak->attribute("type"); }
66
virtual auto name() -> string { return pak->attribute("name"); }
7+
virtual auto saveName() -> string { return pak->attribute("name"); }
78
virtual auto extensions() -> vector<string> { return {}; }
89
virtual auto load(string location = {}) -> LoadResult { return successful; }
910
virtual auto loadMultiple(vector<string> location = {}) -> bool { return true; }

0 commit comments

Comments
 (0)