Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions librecomp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ set(CMAKE_CXX_EXTENSIONS OFF)
add_library(librecomp STATIC
"${CMAKE_CURRENT_SOURCE_DIR}/src/ai.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/src/cont.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/src/config_option.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/src/config.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/src/dp.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/src/eep.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/src/euc-jp.cpp"
Expand Down
372 changes: 372 additions & 0 deletions librecomp/include/librecomp/config.hpp

Large diffs are not rendered by default.

19 changes: 17 additions & 2 deletions librecomp/include/librecomp/game.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ namespace recomp {
struct GameEntry {
uint64_t rom_hash;
std::string internal_name;
std::string display_name;
std::u8string game_id;
std::string mod_game_id;
SaveType save_type = SaveType::None;
std::span<const char> thumbnail_bytes;
bool is_enabled;
// Only needed for mod function hooking support, not needed if `has_compressed_code` is false.
std::vector<uint8_t> (*decompression_routine)(std::span<const uint8_t> compressed_rom) = nullptr;
Expand All @@ -44,6 +46,14 @@ namespace recomp {
int patch = -1;
std::string suffix;

Version() = default;
Version(int major, int minor, int patch, std::string suffix = std::string()) {
this->major = major;
this->minor = minor;
this->patch = patch;
this->suffix = suffix;
}

std::string to_string() const {
return std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(patch) + suffix;
}
Expand All @@ -58,7 +68,11 @@ namespace recomp {
return minor <=> rhs.minor;
}
return patch <=> rhs.patch;
}
}

bool is_null() const {
return (major == -1) && (minor == -1) && (patch == -1) && suffix.empty();
}
};
enum class RomValidationError {
Good,
Expand All @@ -70,6 +84,7 @@ namespace recomp {
OtherError
};
void register_config_path(std::filesystem::path path);
std::filesystem::path get_config_path();
bool register_game(const recomp::GameEntry& entry);
void check_all_stored_roms();
bool load_stored_rom(std::u8string& game_id);
Expand Down Expand Up @@ -114,7 +129,7 @@ namespace recomp {
bool sram_allowed();
bool flashram_allowed();

void start_game(const std::u8string& game_id);
void start_game(const std::u8string& game_id, const std::string& game_mode_id);
std::u8string current_game_id();
std::string current_mod_game_id();
}
Expand Down
133 changes: 71 additions & 62 deletions librecomp/include/librecomp/mods.hpp

Large diffs are not rendered by default.

Loading
Loading