mirror of
https://github.com/N64Recomp/N64ModernRuntime.git
synced 2025-10-30 08:02:29 +00:00
* Start setting up user callbacks system * Implement RSP callbacks * move RSP callbacks (and related RSP stuff) to its own file * Move destroy_ui to gfx_callbacks_t and change recomp::start to require rsp_callbacks_t * error_handling.hpp * Remove UserCallbacks in favor of threads_callbacks_t * Add `ultramodern::set_callbacks` and some other cleanups * Move most RSP stuff to librecomp * Rename rsp_stuff.hpp to rsp.hpp * Add rsp.cpp to librecomp cmake file * review * Remove `recomp::message_box` * Fix missing rename
52 lines
1.8 KiB
C++
52 lines
1.8 KiB
C++
#ifndef __RECOMP_GAME__
|
|
#define __RECOMP_GAME__
|
|
|
|
#include <vector>
|
|
#include <filesystem>
|
|
|
|
#include "recomp.h"
|
|
#include "rsp.h"
|
|
#include <ultramodern/ultramodern.hpp>
|
|
|
|
namespace recomp {
|
|
struct GameEntry {
|
|
uint64_t rom_hash;
|
|
std::string internal_name;
|
|
std::u8string game_id;
|
|
std::span<const char> cache_data;
|
|
bool is_enabled;
|
|
|
|
void (*entrypoint)();
|
|
|
|
std::u8string stored_filename() const;
|
|
};
|
|
enum class RomValidationError {
|
|
Good,
|
|
FailedToOpen,
|
|
NotARom,
|
|
IncorrectRom,
|
|
NotYet,
|
|
IncorrectVersion,
|
|
OtherError
|
|
};
|
|
bool register_game(const recomp::GameEntry& entry);
|
|
void register_patch(const char* patch, std::size_t size);
|
|
void check_all_stored_roms();
|
|
bool load_stored_rom(std::u8string& game_id);
|
|
RomValidationError select_rom(const std::filesystem::path& rom_path, std::u8string& game_id);
|
|
bool is_rom_valid(std::u8string& game_id);
|
|
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 do_rom_pio(uint8_t* rdram, gpr ram_address, uint32_t physical_addr);
|
|
void start(ultramodern::WindowHandle window_handle, const recomp::rsp::callbacks_t& rsp_callbacks, const ultramodern::audio_callbacks_t& audio_callbacks, const ultramodern::input_callbacks_t& input_callbacks, const ultramodern::gfx_callbacks_t& gfx_callbacks, const ultramodern::events::callbacks_t& thread_callbacks, const ultramodern::error_handling::callbacks_t& error_handling_callbacks_);
|
|
void start_game(const std::u8string& game_id);
|
|
std::filesystem::path get_app_folder_path();
|
|
std::u8string current_game_id();
|
|
|
|
// TODO: implement both
|
|
const std::u8string& get_program_id();
|
|
void set_program_id(const std::u8string& program_id);
|
|
}
|
|
|
|
#endif
|