Check RT64 initialization return status

This commit is contained in:
Mr-Wiseguy 2023-11-24 14:49:23 -05:00
parent 5e4d826760
commit 3b06ad52f0
2 changed files with 7 additions and 5 deletions

View File

@ -45,7 +45,7 @@ void dummy_check_interrupts() {
}
void RT64Init(uint8_t* rom, uint8_t* rdram, ultramodern::WindowHandle window_handle) {
bool RT64Init(uint8_t* rom, uint8_t* rdram, ultramodern::WindowHandle window_handle) {
set_rt64_hooks();
// Dynamic loading
//auto RT64 = LoadLibrary("RT64.dll");
@ -100,11 +100,11 @@ void RT64Init(uint8_t* rom, uint8_t* rdram, ultramodern::WindowHandle window_han
gfx_info.RDRAM_SIZE = &RDRAM_SIZE;
#if defined(_WIN32)
InitiateGFXWindows(gfx_info, window_handle.window, window_handle.thread_id);
return InitiateGFXWindows(gfx_info, window_handle.window, window_handle.thread_id);
#elif defined(__ANDROID__)
static_assert(false && "Unimplemented");
#elif defined(__linux__)
InitiateGFXLinux(gfx_info, window_handle.window, window_handle.display);
return InitiateGFXLinux(gfx_info, window_handle.window, window_handle.display);
#else
static_assert(false && "Unimplemented");
#endif

View File

@ -174,7 +174,7 @@ void dp_complete() {
osSendMesg(PASS_RDRAM events_context.dp.mq, events_context.dp.msg, OS_MESG_NOBLOCK);
}
void RT64Init(uint8_t* rom, uint8_t* rdram, ultramodern::WindowHandle window_handle);
bool RT64Init(uint8_t* rom, uint8_t* rdram, ultramodern::WindowHandle window_handle);
void RT64SendDL(uint8_t* rdram, const OSTask* task);
void RT64UpdateScreen(uint32_t vi_origin);
void RT64ChangeWindow();
@ -263,7 +263,9 @@ void gfx_thread_func(uint8_t* rdram, uint8_t* rom, std::atomic_flag* thread_read
ultramodern::set_native_thread_name("Gfx Thread");
ultramodern::set_native_thread_priority(ultramodern::ThreadPriority::Normal);
RT64Init(rom, rdram, window_handle);
if (!RT64Init(rom, rdram, window_handle)) {
throw std::runtime_error("Failed to initialize RT64!");
}
rsp_constants_init();