From eda4bcfb66b39e5d090cc2059f307525e6e81f01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo?= Date: Sun, 18 Jan 2026 22:43:17 -0300 Subject: [PATCH] Fix thumbnails on game mode and add game icon. (#111) * Add display name and thumbnail bytes to the game. * Update modern runtime for verification. * Update RecompFrontend to point to main. --- CMakeLists.txt | 15 ++++++++------- lib/N64ModernRuntime | 2 +- lib/RecompFrontend | 2 +- src/main/main.cpp | 6 +++++- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ab959d..796df0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -175,6 +175,14 @@ target_include_directories(BanjoRecompiled PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ) +# 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 + COMMAND file_to_c ${CMAKE_SOURCE_DIR}/icons/app.png icon_bytes ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.c ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.h + DEPENDS ${CMAKE_SOURCE_DIR}/icons/app.png +) + +target_sources(BanjoRecompiled PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.c) + if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64") target_compile_options(BanjoRecompiled PRIVATE -march=nehalem @@ -262,13 +270,6 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux") add_compile_definitions("PLUME_SDL_VULKAN_ENABLED") add_compile_definitions("RT64_SDL_WINDOW_VULKAN") - # 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 - COMMAND file_to_c ${CMAKE_SOURCE_DIR}/icons/app.png icon_bytes ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.c ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.h - DEPENDS ${CMAKE_SOURCE_DIR}/icons/app.png - ) - target_sources(BanjoRecompiled PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.c) - message(STATUS "SDL2_FOUND = ${SDL2_FOUND}") message(STATUS "SDL2_INCLUDE_DIRS = ${SDL2_INCLUDE_DIRS}") diff --git a/lib/N64ModernRuntime b/lib/N64ModernRuntime index 8b3bae4..4942178 160000 --- a/lib/N64ModernRuntime +++ b/lib/N64ModernRuntime @@ -1 +1 @@ -Subproject commit 8b3bae4cf3045c53c5fae89bc5dd9235b5b2997a +Subproject commit 494217848ab57516a7e224422ee0086fc72cc951 diff --git a/lib/RecompFrontend b/lib/RecompFrontend index 5f0b11a..0f35fb4 160000 --- a/lib/RecompFrontend +++ b/lib/RecompFrontend @@ -1 +1 @@ -Subproject commit 5f0b11a8d744fd935671af20a22fced2217ecb92 +Subproject commit 0f35fb46b1db5c96bf122bef0397bc316be654fc diff --git a/src/main/main.cpp b/src/main/main.cpp index f7c069d..825b73c 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -106,9 +106,9 @@ ultramodern::input::connected_device_info_t get_connected_device_info(int contro }; } -#if defined(__gnu_linux__) #include "icon_bytes.h" +#if defined(__gnu_linux__) bool SetImageAsIcon(const char* filename, SDL_Window* window) { // Read data @@ -371,10 +371,12 @@ std::vector supported_games = { { .rom_hash = 0x1B67585D56E07F8CULL, .internal_name = "Banjo-Kazooie", + .display_name = "Banjo-Kazooie", .game_id = u8"bk.n64.us.1.0", .mod_game_id = "bk", // Eep16k instead of Eep4k to have room for extra save file data. .save_type = recomp::SaveType::Eep16k, + .thumbnail_bytes = std::span(icon_bytes), .is_enabled = false, .decompression_routine = banjo::decompress_bk, .has_compressed_code = true, @@ -571,6 +573,8 @@ void on_launcher_init(recompui::LauncherMenu *menu) { auto game_options_menu = menu->init_game_options_menu( supported_games[0].game_id, supported_games[0].mod_game_id, + supported_games[0].display_name, + supported_games[0].thumbnail_bytes, recompui::GameOptionsMenuLayout::Center );