Merge branch 'live-recomp' into reset-game-from-menu-PLUS-live-recomp

This commit is contained in:
LT-Schmiddy 2025-01-01 13:11:42 -05:00
commit ba06b399eb
9 changed files with 26 additions and 29 deletions

View file

@ -9,7 +9,7 @@ on:
N64RECOMP_COMMIT: N64RECOMP_COMMIT:
type: string type: string
required: false required: false
default: 'd33d38161798167929b114c2b0fd445f9670e10a' default: 'fc696046da3e703450559154d9370ca74c197f8b'
DXC_CHECKSUM: DXC_CHECKSUM:
type: string type: string
required: false required: false

View file

@ -28,6 +28,7 @@ if (WIN32)
endif() endif()
set(RT64_STATIC TRUE) set(RT64_STATIC TRUE)
set(RT64_SDL_WINDOW_VULKAN TRUE)
add_subdirectory(${CMAKE_SOURCE_DIR}/lib/rt64 ${CMAKE_BINARY_DIR}/rt64) add_subdirectory(${CMAKE_SOURCE_DIR}/lib/rt64 ${CMAKE_BINARY_DIR}/rt64)
# set(BUILD_SHARED_LIBS_SAVED "${BUILD_SHARED_LIBS}") # set(BUILD_SHARED_LIBS_SAVED "${BUILD_SHARED_LIBS}")
@ -57,6 +58,7 @@ target_include_directories(RecompiledFuncs PRIVATE
${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/ultramodern/include ${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/ultramodern/include
${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/librecomp/include ${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/librecomp/include
${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/N64Recomp/include
) )
file(GLOB FUNC_C_SOURCES ${CMAKE_SOURCE_DIR}/RecompiledFuncs/*.c) file(GLOB FUNC_C_SOURCES ${CMAKE_SOURCE_DIR}/RecompiledFuncs/*.c)
@ -78,6 +80,7 @@ target_include_directories(PatchesLib PRIVATE
${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/ultramodern/include ${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/ultramodern/include
${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/librecomp/include ${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/librecomp/include
${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/N64Recomp/include
) )
target_sources(PatchesLib PRIVATE target_sources(PatchesLib PRIVATE
@ -96,12 +99,8 @@ if(NOT DEFINED PATCHES_LD)
set(PATCHES_LD ld.lld) set(PATCHES_LD ld.lld)
endif() endif()
if(NOT DEFINED PATCHES_OBJCOPY)
set(PATCHES_OBJCOPY llvm-objcopy)
endif()
add_custom_target(PatchesBin add_custom_target(PatchesBin
COMMAND ${CMAKE_COMMAND} -E env CC=${PATCHES_C_COMPILER} LD=${PATCHES_LD} OBJCOPY=${PATCHES_OBJCOPY} make COMMAND ${CMAKE_COMMAND} -E env CC=${PATCHES_C_COMPILER} LD=${PATCHES_LD} make
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/patches WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/patches
BYPRODUCTS ${CMAKE_SOURCE_DIR}/patches/patches.elf BYPRODUCTS ${CMAKE_SOURCE_DIR}/patches/patches.elf
) )
@ -166,6 +165,7 @@ set (SOURCES
target_include_directories(Zelda64Recompiled PRIVATE target_include_directories(Zelda64Recompiled PRIVATE
${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/N64Recomp/include
${CMAKE_SOURCE_DIR}/lib/concurrentqueue ${CMAKE_SOURCE_DIR}/lib/concurrentqueue
${CMAKE_SOURCE_DIR}/lib/GamepadMotionHelpers ${CMAKE_SOURCE_DIR}/lib/GamepadMotionHelpers
${CMAKE_SOURCE_DIR}/lib/RmlUi/Include ${CMAKE_SOURCE_DIR}/lib/RmlUi/Include
@ -247,6 +247,8 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux")
find_package(SDL2 REQUIRED) find_package(SDL2 REQUIRED)
find_package(X11 REQUIRED) find_package(X11 REQUIRED)
add_compile_definitions("RT64_SDL_WINDOW_VULKAN")
# Generate icon_bytes.c from the app icon PNG. # Generate icon_bytes.c from the app icon PNG.
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.c ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.h add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.c ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.h
COMMAND file_to_c ${CMAKE_SOURCE_DIR}/icons/512.png icon_bytes ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.c ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.h COMMAND file_to_c ${CMAKE_SOURCE_DIR}/icons/512.png icon_bytes ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.c ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.h

@ -1 +1 @@
Subproject commit d5c81d0a6bf2e5f36747a095a7a060d7623bbf58 Subproject commit 43790db072e0e599cc14860c215d79569387a3ed

@ -1 +1 @@
Subproject commit 67422c3b647058d3d38f2813a2abe79cf1638f13 Subproject commit 0ca92eeb6c2f58ce3581c65f87f7261b8ac0fea0

View file

@ -4,7 +4,7 @@
#ifdef MIPS #ifdef MIPS
#include "ultra64.h" #include "ultra64.h"
#else #else
#include "librecomp/recomp.h" #include "recomp.h"
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -2,7 +2,7 @@
#include <mutex> #include <mutex>
#include "ultramodern/ultramodern.hpp" #include "ultramodern/ultramodern.hpp"
#include "librecomp/recomp.h" #include "recomp.h"
#include "recomp_input.h" #include "recomp_input.h"
#include "zelda_config.h" #include "zelda_config.h"
#include "recomp_ui.h" #include "recomp_ui.h"

View file

@ -1,7 +1,7 @@
#include <cmath> #include <cmath>
#include <iostream> #include <iostream>
#include "librecomp/recomp.h" #include "recomp.h"
#include "librecomp/overlays.hpp" #include "librecomp/overlays.hpp"
#include "zelda_config.h" #include "zelda_config.h"
#include "zelda_game.h" #include "zelda_game.h"

View file

@ -55,14 +55,12 @@ ultramodern::gfx_callbacks_t::gfx_data_t create_gfx() {
SDL_SetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, "1"); SDL_SetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, "1");
SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1");
#if defined(__linux__)
SDL_SetHint(SDL_HINT_VIDEODRIVER, "x11");
#endif
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER) > 0) { if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER) > 0) {
exit_error("Failed to initialize SDL2: %s\n", SDL_GetError()); exit_error("Failed to initialize SDL2: %s\n", SDL_GetError());
} }
fprintf(stdout, "SDL Video Driver: %s\n", SDL_GetCurrentVideoDriver());
return {}; return {};
} }
@ -118,7 +116,13 @@ bool SetImageAsIcon(const char* filename, SDL_Window* window)
SDL_Window* window; SDL_Window* window;
ultramodern::renderer::WindowHandle create_window(ultramodern::gfx_callbacks_t::gfx_data_t) { ultramodern::renderer::WindowHandle create_window(ultramodern::gfx_callbacks_t::gfx_data_t) {
window = SDL_CreateWindow("Zelda 64: Recompiled", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1600, 960, SDL_WINDOW_RESIZABLE ); uint32_t flags = SDL_WINDOW_RESIZABLE;
#if defined(RT64_SDL_WINDOW_VULKAN)
flags |= SDL_WINDOW_VULKAN;
#endif
window = SDL_CreateWindow("Zelda 64: Recompiled", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1600, 960, flags);
#if defined(__linux__) #if defined(__linux__)
SetImageAsIcon("icons/512.png",window); SetImageAsIcon("icons/512.png",window);
if (ultramodern::renderer::get_graphics_config().wm_option == ultramodern::renderer::WindowMode::Fullscreen) { // TODO: Remove once RT64 gets native fullscreen support on Linux if (ultramodern::renderer::get_graphics_config().wm_option == ultramodern::renderer::WindowMode::Fullscreen) { // TODO: Remove once RT64 gets native fullscreen support on Linux
@ -138,14 +142,8 @@ ultramodern::renderer::WindowHandle create_window(ultramodern::gfx_callbacks_t::
#if defined(_WIN32) #if defined(_WIN32)
return ultramodern::renderer::WindowHandle{ wmInfo.info.win.window, GetCurrentThreadId() }; return ultramodern::renderer::WindowHandle{ wmInfo.info.win.window, GetCurrentThreadId() };
#elif defined(__ANDROID__) #elif defined(__linux__) || defined(__ANDROID__)
static_assert(false && "Unimplemented"); return ultramodern::renderer::WindowHandle{ window };
#elif defined(__linux__)
if (wmInfo.subsystem != SDL_SYSWM_X11) {
exit_error("Unsupported SDL2 video driver \"%s\". Only X11 is supported on Linux.\n", SDL_GetCurrentVideoDriver());
}
return ultramodern::renderer::WindowHandle{ wmInfo.info.x11.display, wmInfo.info.x11.window };
#else #else
static_assert(false && "Unimplemented"); static_assert(false && "Unimplemented");
#endif #endif

View file

@ -200,11 +200,8 @@ zelda64::renderer::RT64Context::RT64Context(uint8_t* rdram, ultramodern::rendere
RT64::Application::Core appCore{}; RT64::Application::Core appCore{};
#if defined(_WIN32) #if defined(_WIN32)
appCore.window = window_handle.window; appCore.window = window_handle.window;
#elif defined(__ANDROID__) #elif defined(__linux__) || defined(__ANDROID__)
assert(false && "Unimplemented"); appCore.window = window_handle;
#elif defined(__linux__)
appCore.window.display = window_handle.display;
appCore.window.window = window_handle.window;
#elif defined(__APPLE__) #elif defined(__APPLE__)
appCore.window.window = window_handle.window; appCore.window.window = window_handle.window;
appCore.window.view = window_handle.view; appCore.window.view = window_handle.view;