Commit graph

19 commits

Author SHA1 Message Date
Wiseguy
d2f9a32b90
Add default enabled state to mod manifest (#104)
Some checks are pending
validate / ubuntu (arm64, Debug) (push) Waiting to run
validate / ubuntu (arm64, Release) (push) Waiting to run
validate / ubuntu (x64, Debug) (push) Waiting to run
validate / ubuntu (x64, Release) (push) Waiting to run
validate / windows (x64, Debug) (push) Waiting to run
validate / windows (x64, Release) (push) Waiting to run
validate / macos (arm64, Debug) (push) Waiting to run
validate / macos (arm64, Release) (push) Waiting to run
validate / macos (x64, Debug) (push) Waiting to run
validate / macos (x64, Release) (push) Waiting to run
2025-04-09 04:35:21 -04:00
Wiseguy
234ed4a95e
Make mod config value getters const (#103) 2025-04-09 03:39:14 -04:00
Wiseguy
cacb14fee5
Add mod API export to let a mod get its own version (#100) 2025-04-08 01:04:37 -04:00
Wiseguy
af075623dc
Add callback for mod reordering and functions to get mod file path and order index (#99)
Some checks failed
validate / windows (x64, Release) (push) Has been cancelled
validate / ubuntu (arm64, Debug) (push) Has been cancelled
validate / ubuntu (arm64, Release) (push) Has been cancelled
validate / ubuntu (x64, Debug) (push) Has been cancelled
validate / ubuntu (x64, Release) (push) Has been cancelled
validate / windows (x64, Debug) (push) Has been cancelled
validate / macos (arm64, Debug) (push) Has been cancelled
validate / macos (arm64, Release) (push) Has been cancelled
validate / macos (x64, Debug) (push) Has been cancelled
validate / macos (x64, Release) (push) Has been cancelled
2025-04-06 22:14:13 -04:00
Wiseguy
db1b1a1082
Expose functionality needed for runtime mod installation (#97)
Some checks are pending
validate / ubuntu (arm64, Release) (push) Waiting to run
validate / ubuntu (x64, Debug) (push) Waiting to run
validate / ubuntu (x64, Release) (push) Waiting to run
validate / ubuntu (arm64, Debug) (push) Waiting to run
validate / windows (x64, Debug) (push) Waiting to run
validate / windows (x64, Release) (push) Waiting to run
validate / macos (arm64, Debug) (push) Waiting to run
validate / macos (arm64, Release) (push) Waiting to run
validate / macos (x64, Debug) (push) Waiting to run
validate / macos (x64, Release) (push) Waiting to run
* DnD prototype.

* Remaining changes needed for runtime mod installation

* Change path unordered map to use strings as keys instead to fix MacOS compilation

---------

Co-authored-by: Dario <dariosamo@gmail.com>
2025-04-06 03:53:28 -04:00
Wiseguy
2ed84f46c5
Implement mod configuration, mod reordering, and extended exports (#95)
* init recomp config_store

* Use a custom hash class to enable hetereogenous lookup

* Added config registry/option files

* switch to using usings

* dropdown config type

* Added TextField option type

* parse/validate button config type

* wip callback registry

* Add auto enabled.

* Cleanup.

* Add support for config schema.

* Add float arg1 helpers

* Config storage for mods.

* Proper enum parsing.

* Persist mod order and enable.

* Enable new mods by default.

* Mods directory.

* Parse thumbnail when opening mods.

* Auto-enabled mods.

* Implement extended function exports that pass the caller mod's index as an extra argument

* Fix mod configs not saving and default value not getting parsed

* Implement API to allow mods to read their config values

* Fix config value parsing to allow integral values for double fields

* Change construction of ModConfigQueueSaveMod.

* Fix N64Recomp commit after rebase

---------

Co-authored-by: Dario <dariosamo@gmail.com>
Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com>
2025-03-23 21:30:27 -04:00
Wiseguy
0afeb089a5
Fix jump table handling in regenerated relocatable functions (#86) 2025-02-11 22:45:45 -05:00
Wiseguy
5360099ee2
Fix issues with hooking functions that were patched by the base recomp (#85) 2025-02-11 01:11:24 -05:00
Wiseguy
7319630e2e
Fix issue with regenerating patched functions with no base functions regenerated, add 1kB of padding between mods to mitigate OOB accesses in mods, update N64Recomp (#84) 2025-01-30 03:02:40 -05:00
Wiseguy
5eada509c0
Rename manifest to mod.json, refactor config parsing, add display_name, description, short_description fields (#81) 2025-01-26 22:14:08 -05:00
Wiseguy
cdfe416809
Mod function hooking (#80)
* Prevent mods from replacing functions patched by the base recomp unless they're marked as Force

* Implement function hooking for functions replaced by mods

* Add support for hooking non-relocated functions that aren't replaced by a mod

* Only create the regenerated code handle if any functions need to be regenerated

* Implement relocs for function regeneration in hooking

* Implement hooking of functions patched by the base recomp

* Fix base event index tracking when loading mods

* Update to N64Recomp main branch after merge
2025-01-26 22:03:36 -05:00
Wiseguy
d17a3f34cb
Integrate the live recompiler for mod loading (#76) 2025-01-02 21:25:20 -05:00
Wiseguy
576fed6cfc
Fix mods getting duplicated when scanning multiple times, fix incorrect mmap for rdram (#71) 2024-12-04 18:41:35 -05:00
Wiseguy
9e9ae173ee
Fixed incorrect alignment during mod section loading (#65) 2024-10-12 01:10:59 -04:00
Wiseguy
25e8bcc1e1
Added mechanism for recomps to declare custom mod content types and container formats (#64)
Also adds a way to specify whether a given content type can be toggled at runtime. The built-in mod code content type has this setting disabled.
2024-09-28 16:47:00 -04:00
Wiseguy
46797d6cad
Made DLL loading also search the DLL's path for dependency resolution (#63) 2024-09-27 00:50:07 -04:00
David Chavez
b80bb216b2
fix(macos): Add support for macos and ARM64 patching (#62) 2024-09-17 18:15:24 -04:00
Wiseguy
356b9f901e
Fix populating reference symbol pointers and add missing runtime function pointers in offline compiled mod loading (#61)
* Fixed reference symbol pointers not being populated in offline compiled mods

* Add populating missing runtime function pointers in offline compiled mods

* Update N64Recomp after merge
2024-09-12 19:00:02 -04:00
Wiseguy
45e9f7a6cb
Runtime Mod Support PR 1 (Mod framework and mod loading) (#60)
* Added miniz and implemented mod manifest loading from zip

* Add more mod loading error enums

* Added ability to load mods from directories instead of zip files

* Added validation for mod contents and mod load error strings

* Add checks for required fields existing in manifest

* Renamed load_mod to open_mod and ModLoadError to ModOpenError

* Made rdram size an argument in recomp::start, reorganized some PI address constants

* Add N64Recomp as submodule and initial mod loading (temporarily using a DLL instead of Lua recompilation)

* Created ModContext and exposed functionality for searching mod folders, activating mods, and loading active mods

* Implemented per-game mod contexts

* Add duplicate mod detection

* Added function conflict detection, recovery from failed mod loading and message box with load errors

* Update N64Recomp for new modding infrastructure, begin adding support for offline compiled mods

* Reorganized mod loading, added mod dependency validation

* Reorganized mod code handle code

* Implement importing functions from other mods

* Implement mod events and callbacks

* Add support for creating events in patches

* Add support for exporting functions from native libraries in mods

* Removed per-game mod subdirectories and added the mod's corresponding game id to the manifest

* Added version parsing with version number as argument to recomp initialization and minimum recomp versions for mods

* Changed mod binary and mod symbol files to use fixed paths, removed them from the manifest

* Expose function for getting the details for currently opened mods

* Add dependencies and authors to manifest and update N64Recomp submodule

* Implement mod loading on posix systems

* Implement mip32 relocs for mod loading and add mod functions to function lookup table

* Add CPU architecture detection and gate current mod function hooking behind x86_64 define

* Fix build on compilers that don't properly support aggregate initialization

* Fix compilation on ARM64 and Apple

* Fix compilation on MacOS x86_64

* Update N64Recomp commit after merge

* Fix whitespace in game.hpp
2024-09-09 23:16:07 -04:00