diff --git a/librecomp/include/librecomp/game.hpp b/librecomp/include/librecomp/game.hpp index 64254a2..da59743 100644 --- a/librecomp/include/librecomp/game.hpp +++ b/librecomp/include/librecomp/game.hpp @@ -101,10 +101,6 @@ namespace recomp { /// void start(const Configuration& cfg); - bool eeprom_allowed(); - bool sram_allowed(); - bool flashram_allowed(); - void start_game(const std::u8string& game_id); std::u8string current_game_id(); std::string current_mod_game_id(); diff --git a/librecomp/src/pi.cpp b/librecomp/src/pi.cpp index 378d3d8..d1d9dab 100644 --- a/librecomp/src/pi.cpp +++ b/librecomp/src/pi.cpp @@ -95,7 +95,7 @@ void do_dma(RDRAM_ARG PTR(OSMesgQueue) mq, gpr rdram_address, uint32_t physical_ // Send a message to the mq to indicate that the transfer completed ultramodern::enqueue_external_message_src(mq, 0, false, ultramodern::EventMessageSource::Pi); } else if (physical_addr >= recomp::sram_base) { - if (!recomp::sram_allowed()) { + if (!ultramodern::sram_allowed()) { ultramodern::error_handling::message_box("Attempted to use SRAM saving with other save type"); ULTRAMODERN_QUICK_EXIT(); } @@ -112,7 +112,7 @@ void do_dma(RDRAM_ARG PTR(OSMesgQueue) mq, gpr rdram_address, uint32_t physical_ // write cart rom throw std::runtime_error("ROM DMA write unimplemented"); } else if (physical_addr >= recomp::sram_base) { - if (!recomp::sram_allowed()) { + if (!ultramodern::sram_allowed()) { ultramodern::error_handling::message_box("Attempted to use SRAM saving with other save type"); ULTRAMODERN_QUICK_EXIT(); } diff --git a/librecomp/src/recomp.cpp b/librecomp/src/recomp.cpp index e48d85e..a166c85 100644 --- a/librecomp/src/recomp.cpp +++ b/librecomp/src/recomp.cpp @@ -687,7 +687,7 @@ bool wait_for_game_started(uint8_t* rdram, recomp_context* context) { recomp::init_heap(rdram, recomp::mod_rdram_start + mod_ram_used); ultramodern::set_save_type(game_entry.save_type); - ultramodern::init_saving(rdram); + ultramodern::init_saving(rdram, recomp::current_game_id()); try { game_entry.entrypoint(rdram, context); diff --git a/ultramodern/include/ultramodern/save.hpp b/ultramodern/include/ultramodern/save.hpp index c0489f1..74dc683 100644 --- a/ultramodern/include/ultramodern/save.hpp +++ b/ultramodern/include/ultramodern/save.hpp @@ -18,7 +18,7 @@ namespace ultramodern { void set_save_file_path(const std::u8string& subfolder, const std::u8string& name); - void init_saving(RDRAM_ARG1); + void init_saving(RDRAM_ARG const std::u8string& name); void change_save_file(const std::u8string& subfolder, const std::u8string& name); diff --git a/ultramodern/src/save.cpp b/ultramodern/src/save.cpp index 951dc8e..c1199cb 100644 --- a/ultramodern/src/save.cpp +++ b/ultramodern/src/save.cpp @@ -189,8 +189,8 @@ void read_save_file() { } } -void ultramodern::init_saving(RDRAM_ARG1) { - set_save_file_path(u8"", ultramodern::current_game_id()); +void ultramodern::init_saving(RDRAM_ARG const std::u8string& name) { + set_save_file_path(u8"", name); save_context.save_buffer.resize(get_save_size(ultramodern::get_save_type()));