Update RT64 for HD texture framework and DXIL linker (#262)

* WIP HD texture support

* Remove STB implementation as it's already defined in RT64

* Fix texcoords for seamless pause background patch

* Fix RT64 compilation error and temporarily disable shader cache

* Fix vertices for bottom strip in seamless pause background patch

* Update RT64 for mip preloading and alignment fixes

* Update RT64 for zipped texture pack support and fix CMake warning flags for clang-cl

* Update RT64 to have multiple pack loading and texture memory stats in the debugger

* Update RT64 to fix replace button crash

* Update to RT64 main as HD textures were merged and completely removed shader cache as it's not needed

---------

Co-authored-by: Wiseguy <68165316+Mr-Wiseguy@users.noreply.github.com>
This commit is contained in:
Reonu 2024-07-26 04:08:23 +01:00 committed by GitHub
parent a8a5e216fe
commit 5aa650bffa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 13 deletions

View File

@ -6,7 +6,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)
# set(CMAKE_CXX_VISIBILITY_PRESET hidden) # set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-everything -Wall -Wextra") if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-everything /W4")
endif()
# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24: # Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24:
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0") if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
@ -29,6 +31,7 @@ SET(LUNASVG_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
add_subdirectory(${CMAKE_SOURCE_DIR}/lib/lunasvg) add_subdirectory(${CMAKE_SOURCE_DIR}/lib/lunasvg)
# set(BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS_SAVED}") # set(BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS_SAVED}")
SET(ENABLE_SVG_PLUGIN ON CACHE BOOL "" FORCE) SET(ENABLE_SVG_PLUGIN ON CACHE BOOL "" FORCE)
SET(RMLUI_TESTS_ENABLED OFF CACHE BOOL "" FORCE)
add_subdirectory(${CMAKE_SOURCE_DIR}/lib/RmlUi) add_subdirectory(${CMAKE_SOURCE_DIR}/lib/RmlUi)
add_subdirectory(${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime) add_subdirectory(${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime)

@ -1 +1 @@
Subproject commit 36e3114cd23a80683504c257729ff7a419735f50 Subproject commit 0fd6d05b8a0ec5daae313ad9e8504812ec31775d

View File

@ -35,11 +35,11 @@ RECOMP_PATCH s16 KaleidoScope_SetPageVertices(PlayState* play, Vtx* vtx, s16 vtx
s32 cur_y; s32 cur_y;
u32 row; u32 row;
cur_y = PAGE_BG_HEIGHT / 2; cur_y = (PAGE_BG_HEIGHT + 2) / 2;
// 2 verts per row plus 2 extra verts at the start and the end. // 2 verts per row plus 2 extra verts at the start and the end.
for (row = 0; row < RECOMP_PAGE_ROW_COUNT + 2; row++) { for (row = 0; row < RECOMP_PAGE_ROW_COUNT + 2; row++) {
s32 next_y = MAX(cur_y - RECOMP_PAGE_ROW_HEIGHT, -PAGE_BG_HEIGHT / 2); s32 next_y = MAX(cur_y - RECOMP_PAGE_ROW_HEIGHT, -(PAGE_BG_HEIGHT + 2) / 2);
vtx[4 * row + 0].v.ob[0] = -PAGE_BG_WIDTH / 2; vtx[4 * row + 0].v.ob[0] = -PAGE_BG_WIDTH / 2;
vtx[4 * row + 1].v.ob[0] = PAGE_BG_WIDTH / 2; vtx[4 * row + 1].v.ob[0] = PAGE_BG_WIDTH / 2;
@ -234,7 +234,7 @@ RECOMP_PATCH Gfx* KaleidoScope_DrawPageSections(Gfx* gfx, Vtx* vertices, Texture
// Draw the rows. // Draw the rows.
for (u32 bg_row = 0; bg_row < RECOMP_PAGE_ROW_COUNT; bg_row++) { for (u32 bg_row = 0; bg_row < RECOMP_PAGE_ROW_COUNT; bg_row++) {
u32 cur_row_height = MIN(RECOMP_PAGE_ROW_HEIGHT, PAGE_BG_HEIGHT - bg_row * RECOMP_PAGE_ROW_HEIGHT); u32 cur_row_height = MIN(RECOMP_PAGE_ROW_HEIGHT, PAGE_BG_HEIGHT + 1 - bg_row * RECOMP_PAGE_ROW_HEIGHT);
gDPLoadTextureTile(gfx++, *cur_image, gDPLoadTextureTile(gfx++, *cur_image,
G_IM_FMT_IA, G_IM_SIZ_8b, // fmt, siz G_IM_FMT_IA, G_IM_SIZ_8b, // fmt, siz
PAGE_BG_WIDTH + 2, PAGE_BG_HEIGHT + 2, // width, height PAGE_BG_WIDTH + 2, PAGE_BG_HEIGHT + 2, // width, height

View File

@ -28,17 +28,12 @@
#include "ovl_patches.hpp" #include "ovl_patches.hpp"
#include "librecomp/game.hpp" #include "librecomp/game.hpp"
#ifdef HAS_MM_SHADER_CACHE
#include "mm_shader_cache.h"
#endif
#ifdef _WIN32 #ifdef _WIN32
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <Windows.h> #include <Windows.h>
#include "SDL_syswm.h" #include "SDL_syswm.h"
#endif #endif
#define STB_IMAGE_IMPLEMENTATION
#include "../../lib/rt64/src/contrib/stb/stb_image.h" #include "../../lib/rt64/src/contrib/stb/stb_image.h"
template<typename... Ts> template<typename... Ts>
@ -332,9 +327,6 @@ std::vector<recomp::GameEntry> supported_games = {
.rom_hash = 0xEF18B4A9E2386169ULL, .rom_hash = 0xEF18B4A9E2386169ULL,
.internal_name = "ZELDA MAJORA'S MASK", .internal_name = "ZELDA MAJORA'S MASK",
.game_id = u8"mm.n64.us.1.0", .game_id = u8"mm.n64.us.1.0",
#ifdef HAS_MM_SHADER_CACHE
.cache_data = {mm_shader_cache_bytes, sizeof(mm_shader_cache_bytes)},
#endif
.is_enabled = true, .is_enabled = true,
.entrypoint_address = get_entrypoint_address(), .entrypoint_address = get_entrypoint_address(),
.entrypoint = recomp_entrypoint, .entrypoint = recomp_entrypoint,