mirror of
https://github.com/Zelda64Recomp/Zelda64Recomp
synced 2025-10-06 00:22:39 +02:00
Add support for built-in mods and convert D-Pad to a built-in mod (#567)
* Add embedded mod (using mm_recomp_draw_distance as an example). * Update runtime after merge * Experiment with removing the D-Pad. * Add event needed for dpad as mod, revert remaining changes in built-in patches for dpad * Add built-in dpad mod, add remaining event calls to input.c * Add built-in mods readme --------- Co-authored-by: Dario <dariosamo@gmail.com>
This commit is contained in:
@@ -388,6 +388,27 @@ endif()
|
||||
build_vertex_shader(Zelda64Recompiled "shaders/InterfaceVS.hlsl" "shaders/InterfaceVS.hlsl")
|
||||
build_pixel_shader(Zelda64Recompiled "shaders/InterfacePS.hlsl" "shaders/InterfacePS.hlsl")
|
||||
|
||||
# Embed all .nrm files in the "mods" directory
|
||||
file(GLOB NRM_FILES "${CMAKE_SOURCE_DIR}/mods/*.nrm")
|
||||
|
||||
set(GENERATED_NRM_SOURCES "")
|
||||
|
||||
foreach(NRM_FILE ${NRM_FILES})
|
||||
get_filename_component(NRM_NAME ${NRM_FILE} NAME_WE)
|
||||
set(OUT_C "${CMAKE_CURRENT_BINARY_DIR}/mods/${NRM_NAME}.c")
|
||||
set(OUT_H "${CMAKE_CURRENT_BINARY_DIR}/mods/${NRM_NAME}.h")
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${OUT_C} ${OUT_H}
|
||||
COMMAND file_to_c ${NRM_FILE} ${NRM_NAME} ${OUT_C} ${OUT_H}
|
||||
DEPENDS ${NRM_FILE}
|
||||
)
|
||||
|
||||
list(APPEND GENERATED_NRM_SOURCES ${OUT_C})
|
||||
endforeach()
|
||||
|
||||
target_sources(Zelda64Recompiled PRIVATE ${GENERATED_NRM_SOURCES})
|
||||
|
||||
target_sources(Zelda64Recompiled PRIVATE ${SOURCES})
|
||||
|
||||
set_property(TARGET Zelda64Recompiled PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
|
||||
|
Submodule lib/N64ModernRuntime updated: 4b57f50722...02d797aedc
6
mods/BUILTIN_MODS.md
Normal file
6
mods/BUILTIN_MODS.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# Built-in Mods
|
||||
|
||||
This folder contains mods that are built into the Zelda 64: Recompiled project. Built-in mods behave like normal mods but are present in a clean installation of the project. They can be updated or downgraded by placing the .nrm file for the mod in the appdata mods folder in the same way a normal mod would be, which overrides the built-in version with the manually installed version.
|
||||
|
||||
The list of built-in mods is as follows:
|
||||
* Majora's Mask: Recompiled D-Pad Mod - https://github.com/Zelda64Recomp/MMRecompDpadMod
|
BIN
mods/mm_recomp_dpad_builtin.nrm
Normal file
BIN
mods/mm_recomp_dpad_builtin.nrm
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 955 B |
1640
patches/input.c
1640
patches/input.c
File diff suppressed because it is too large
Load Diff
@@ -92,9 +92,6 @@ typedef enum {
|
||||
"\t.popsection\n"); \
|
||||
extern u8 identifier[]
|
||||
|
||||
void draw_dpad(PlayState* play);
|
||||
void draw_dpad_icons(PlayState* play);
|
||||
|
||||
void View_ApplyInterpolate(View* view, s32 mask, bool reset_interpolation_state);
|
||||
|
||||
void set_camera_skipped(bool skipped);
|
||||
|
@@ -487,10 +487,8 @@ RECOMP_PATCH void Interface_Draw(PlayState* play) {
|
||||
|
||||
Magic_DrawMeter(play);
|
||||
|
||||
// @recomp Draw the D-Pad and its item icons as well as the autosave icon if the game is unpaused.
|
||||
// @recomp Draw the autosave icon if the game is unpaused.
|
||||
if (pauseCtx->state != PAUSE_STATE_MAIN) {
|
||||
draw_dpad(play);
|
||||
draw_dpad_icons(play);
|
||||
draw_autosave_icon(play);
|
||||
}
|
||||
|
||||
|
@@ -38,6 +38,8 @@
|
||||
#include "../../patches/sound.h"
|
||||
#include "../../patches/misc_funcs.h"
|
||||
|
||||
#include "mods/mm_recomp_dpad_builtin.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
@@ -617,6 +619,8 @@ int main(int argc, char** argv) {
|
||||
recomp::register_game(game);
|
||||
}
|
||||
|
||||
recomp::mods::register_embedded_mod("mm_recomp_dpad_builtin", { (const uint8_t*)(mm_recomp_dpad_builtin), std::size(mm_recomp_dpad_builtin)});
|
||||
|
||||
REGISTER_FUNC(recomp_get_window_resolution);
|
||||
REGISTER_FUNC(recomp_get_target_aspect_ratio);
|
||||
REGISTER_FUNC(recomp_get_target_framerate);
|
||||
|
Reference in New Issue
Block a user