Implemented proper ROM selection menu

This commit is contained in:
Mr-Wiseguy
2024-03-03 21:00:49 -05:00
parent 302d88fd84
commit ca66fdddbb
16 changed files with 387 additions and 97 deletions

View File

@@ -1,6 +1,7 @@
#ifndef __RECOMP_CONFIG_H__
#define __RECOMP_CONFIG_H__
#include <filesystem>
#include <string_view>
#include "../ultramodern/config.hpp"
@@ -12,6 +13,8 @@ namespace recomp {
void reset_input_bindings();
void reset_graphics_options();
std::filesystem::path get_app_folder_path();
};
#endif

39
include/recomp_game.h Normal file
View File

@@ -0,0 +1,39 @@
#ifndef __RECOMP_GAME__
#define __RECOMP_GAME__
#include <vector>
#include <filesystem>
#include "recomp.h"
#include "../ultramodern/ultramodern.hpp"
#include "rt64_layer.h"
namespace recomp {
enum class Game {
OoT,
MM,
None,
Quit
};
enum class RomValidationError {
Good,
FailedToOpen,
NotARom,
IncorrectRom,
NotYet,
IncorrectVersion,
OtherError
};
void check_all_stored_roms();
bool load_stored_rom(Game game);
RomValidationError select_rom(const std::filesystem::path& rom_path, Game game);
bool is_rom_valid(Game game);
bool is_rom_loaded();
void set_rom_contents(std::vector<uint8_t>&& new_rom);
void do_rom_read(uint8_t* rdram, gpr ram_address, uint32_t physical_addr, size_t num_bytes);
void start(ultramodern::WindowHandle window_handle, const ultramodern::audio_callbacks_t& audio_callbacks, const ultramodern::input_callbacks_t& input_callbacks, const ultramodern::gfx_callbacks_t& gfx_callbacks);
void start_game(Game game);
void message_box(const char* message);
}
#endif

View File

@@ -12,7 +12,7 @@ namespace ultramodern {
struct WindowHandle;
}
RT64::Application* RT64Init(uint8_t* rom, uint8_t* rdram, ultramodern::WindowHandle window_handle, bool developer_mode);
RT64::Application* RT64Init(uint8_t* rdram, ultramodern::WindowHandle window_handle, bool developer_mode);
void RT64UpdateConfig(RT64::Application* application, const ultramodern::GraphicsConfig& old_config, const ultramodern::GraphicsConfig& new_config);
void RT64EnableInstantPresent(RT64::Application* application);
void RT64SendDL(uint8_t* rdram, const OSTask* task);