Commit graph

70 commits

Author SHA1 Message Date
LittleCube 17438755a1
Implement nrm filename toml input, renaming list, trace mode, and context dumping flag (#111)
* implement nrm filename toml input

* change name of mod toml setting to 'mod_filename'

* add renaming and re mode

* fix --dump-context arg, fix entrypoint detection

* refactor re_mode to function_trace_mode

* adjust trace mode to use a general TRACE_ENTRY() macro

* fix some renaming and trace mode comments, revert no toml entrypoint code, add TODO to broken block

* fix arg2 check and usage string
2024-12-24 02:10:26 -05:00
LittleCube d33d381617
Show error when zip command is not found by linux (#94)
* Show error when zip command is not found by linux

* Exit on linux if zip command is not found
2024-09-15 17:59:19 -04:00
Wiseguy d5ab74220d
Various mod fixes (#95)
* Terminate offline mod recompilation if any functions fail to recompile

* Fixed edge case with switch case jump table detection when lo16 immediate is exactly 0

* Prevent emitting duplicate reference symbol defines in offline mod recompilation

* Fix function calls and add missing runtime function pointers in offline mod recompiler
2024-09-12 18:54:08 -04:00
Wiseguy cc71b31b09
Modding Support PR 2 (Finished mod tool base feature set and improvements for use in N64ModernRuntime) (#93)
* Remove reference context from parse_mod_symbols argument

* Add support for special dependency names (self and base recomp), fix non-compliant offline mod recompiler output

* Fix export names not being set on functions when parsing mod syms, add missing returns to mod parsing

* Switch offline mod recompilation to use a base global event index instead of per-event global indices

* Add support for creating events in normal recompilation

* Output recomp API version in offline mod recompiler

* Removed dependency version from mod symbols (moved to manifest)

* Added mod manifest generation to mod tool

* Implement mod file creation in Windows

* Fixed some error prints not using stderr

* Implement mod file creation on posix systems

* De-hardcode symbol file path for offline mod recompiler

* Fix duplicate import symbols issue and prevent emitting unused imports
2024-09-09 22:49:57 -04:00
Wiseguy 5b17bf8bb5
Modding Support PR 1 (Instruction tables, modding support, mod symbol format, library conversion) (#89)
* Initial implementation of binary operation table

* Initial implementation of unary operation table

* More binary op types, moved binary expression string generation into separate function

* Added and implemented conditional branch instruction table

* Fixed likely swap on bgezal, fixed extra indent branch close and missing
indent on branch statement

* Add operands for other uses of float registers

* Added CHECK_FR generation to binary operation processing, moved float comparison instructions to binary op table

* Finished moving float arithmetic instructions to operation tables

* Added store instruction operation table

* Created Generator interface, separated operation types and tables and C generation code into new files

* Fix mov.d using the wrong input operand

* Move recompiler core logic into a core library and make the existing CLI consume the core library

* Removed unnecessary config input to recompilation functions

* Moved parts of recomp_port.h into new internal headers in src folder

* Changed recomp port naming to N64Recomp

* Remove some unused code and document which Context fields are actually required for recompilation

* Implement mod symbol parsing

* Restructure mod symbols to make replacements global instead of per-section

* Refactor elf parsing into static Context method for reusability

* Move elf parsing into a separate library

* WIP elf to mod tool, currently working without relocations or API exports/imports

* Make mod tool emit relocs and patch binary for non-relocatable symbol references as needed

* Implemented writing import and exports in the mod tool

* Add dependencies to the mod symbol format, finish exporting and importing of mod symbols

* Add first pass offline mod recompiler (generates C from mods that can be compiled and linked into a dynamic library)

* Add strict mode and ability to generate exports for normal recompilation (for patches)

* Move mod context fields into base context, move import symbols into separate vector, misc cleanup

* Some cleanup by making some Context members private

* Add events (from dependencies and exported) and callbacks to the mod symbol format and add support to them in elf parsing

* Add runtime-driven fields to offline mod recompiler, fix event symbol relocs using the wrong section in the mod tool

* Move file header writing outside of function recompilation

* Allow cross-section relocations, encode exact target section in mod relocations, add way to tag reference symbol relocations

* Add local symbol addresses array to offline mod recompiler output and rename original one to reference section addresses

* Add more comments to the offline mod recompiler's output

* Fix handling of section load addresses to match objcopy behavior, added event parsing to dependency tomls, minor cleanup

* Fixed incorrect size used for finding section segments

* Add missing includes for libstdc++

* Rework callbacks and imports to use the section name for identifying the dependency instead of relying on per-dependency tomls
2024-08-26 23:06:34 -04:00
Wiseguy f8d439aeee
Add option to output multiple functions per file, defaults to 50 (#88) 2024-08-15 00:17:09 -04:00
Mr-Wiseguy 424a509b22 Allow zero-sized symbols in a specific range for patches, fixed cases where errors didn't terminate the recompiler 2024-08-15 00:00:25 -04:00
Mr-Wiseguy 4161ef68cc Made recompilation header include configurable 2024-08-15 00:00:25 -04:00
Mr-Wiseguy dfd90057c9 Rewrote jal resolution to improve handling for overlapping overlays 2024-08-15 00:00:25 -04:00
Wiseguy ba4aede49c
Add symbol reference file mechanism for elf recompilation (#82)
* Consolidate context dumping toggle into a single bool, begin work on data symbol context dumping
* Added data symbol context dumping
* Fix mthi/mtlo implementation
* Add option to control unpaired LO16 warnings
2024-07-02 21:42:22 -04:00
Anghelo Carvajal 16819a0515
Add libgultra_d functions to ignored_funcs (#60) 2024-06-21 08:38:15 -04:00
Scott Brenner ecc9dc49e5
Bump actions/checkout to v4 (#76) 2024-06-10 12:31:50 +02:00
dcvz ca096fd078 CI: Fix Windows CI after image updates 2024-06-07 10:42:47 +02:00
David Chavez 2a2df89349
Remove disable_warnings header include (#75) 2024-06-05 00:02:37 +02:00
David Chavez 8dfed04919
Update headers to use new namespace in N64ModernRuntime (#74) 2024-06-03 21:46:42 +02:00
Gilles Siberlin 6eb7d5bd3e
Implement hook insertion (#73)
* Implement function hook insertion

* Fix recompiled code indentation

* Add _matherr to renamed_funcs

* Replace after_vram by before_vram

* Emit dummy value if relocatable_sections_ordered is empty
2024-05-31 23:31:50 -04:00
David Chavez 5c687ee962
CI: Add Linux arm64 (#69) 2024-05-31 22:48:42 +02:00
Anghelo Carvajal 94b59d56f7
Mask the lower 3 bits of the de RSP operand (#55) 2024-05-17 22:38:19 -04:00
Mr-Wiseguy e0e52d1fc3
Symbol file toml update (#52)
* Symbol input file mechanism

* Migration to new toml lib

---------

Co-authored-by: dcvz <david@dcvz.io>
2024-05-16 22:33:08 -04:00
Anghelo Carvajal 26c5c2cbb8
Implement tail calls in the middle of functions and allow recomping libgcc math routines (#43) 2024-05-14 18:56:23 -04:00
Anghelo Carvajal 5d46de6de0
Add more renamed_funcs (#35) 2024-05-14 15:06:47 -04:00
Tharo d4fab15fcc
RSPRecomp: Add some features to help debug unhandled indirect jump targets (file+line of instruction and register dump) (#33) 2024-05-13 21:00:00 -04:00
David Chavez 706e7c5069
Add Initializers for Structs - Fix issue with Apple Clang (#31)
Fixes #30 also adds CI
2024-05-13 20:55:43 -04:00
Anghelo Carvajal d7b223fde5
Implement bgezal/bgezall (#23) 2024-05-12 22:07:46 -04:00
Mr-Wiseguy 3ab0edf18a Changed RSPRecomp to take a toml config file instead of using hardcoded options 2024-05-12 20:30:02 -04:00
Tharo dbf0e623c8
Implement doubleword multiply and divide, and conversions between doubleword and single/double precision floats (#16) 2024-05-11 14:08:15 -04:00
Mr-Wiseguy 5838e4223a Add license and readme 2024-05-10 17:19:30 -04:00
Mr-Wiseguy 0f813247a1 Added CMake build system, fixed warnings on clang, removed VS solution/projects 2024-04-20 21:05:50 -04:00
Mr-Wiseguy 32841e85b4 Changed RSP recompiler to emit different macros for loads and stores to handle unaligned access 2024-04-20 20:02:28 -04:00
Mr-Wiseguy 47c9033b61 Improved reloc pairing 2024-04-20 20:00:48 -04:00
Mr-Wiseguy 50d55bd171 Added manual sections input option, fixed bug with multiplications and added mthi/lo instructions 2024-04-20 20:00:29 -04:00
Mr-Wiseguy 72fe4ed79c Added some missing float comparison instructions and fixed functions incorrectly getting detected as the entrypoint 2024-03-11 00:15:31 -04:00
Mr-Wiseguy 9a4f650c9b Fixed relocatable section file path error using the wrong value, added an include for funcs.h to single-file output mode 2023-11-24 15:11:36 -05:00
Mr-Wiseguy be275c198a Added single-file mode and absolute symbol options (for patch recompilation) 2023-11-12 14:50:50 -05:00
Mr-Wiseguy d249363fe5 Misc upgrades including mips3 float mode support, skip overwriting existing files if they're identical to the current recompiled output 2023-10-29 20:53:17 -04:00
Mr-Wiseguy 9321a60f28 Properly implement unaligned load/store instructions 2023-05-21 17:42:25 -04:00
Mr-Wiseguy 3db07f5b26 Fixed signedness issue in formatted entrypoint address 2023-04-27 23:17:26 -04:00
Mr-Wiseguy 54b6825d63
Merge pull request #10 from M0liusX/main
Fix MSVC v143 errors with fmt
2023-04-27 23:16:18 -04:00
M0liusX 30b1fceaf2 Fix MSVC v143 errors with fmt 2023-04-27 12:53:43 -05:00
Mr-Wiseguy 302dd091c2 Implement application of single-instruction patches 2023-03-24 20:28:36 -04:00
Mr-Wiseguy 9949813018 Implemented parsing of instruction patches in config file 2023-03-24 19:22:30 -04:00
Mr-Wiseguy 7df3e28c76 Implemented function stubbing 2023-03-24 18:04:21 -04:00
Mr-Wiseguy fba0085946 Added toml11 and implemented initial config file parsing, replaces command-line arg inputs 2023-03-24 17:11:17 -04:00
Mr-Wiseguy f4324ee599 Split OoT into its own repo 2023-03-22 01:15:04 -04:00
Mr-Wiseguy 85a04d74e7 Fixed missing rounding_mode variable in generated code 2023-03-21 23:37:52 -04:00
Mr-Wiseguy 52644095f0 Added MM aspMain parameters to rsp recomp, added voice and flash to special function lists 2023-02-19 22:43:08 -05:00
Mr-Wiseguy 5c5f6a51ad Fixed an occasional startup crash caused by the game running before the events thread was finished initializing 2023-02-15 23:41:46 -05:00
Mr-Wiseguy 38f6304d44 Modified audio handling to use SDL_QueueAudio to simplify code and changed remaining bytes calculation to reduce audio latency 2023-02-15 23:41:14 -05:00
Mr-Wiseguy 7babd24bd1 Implemented audio ucode recomp and audio interface, removed restrict usage due to issues with release builds 2023-02-15 17:59:25 -05:00
Mr-Wiseguy 217a30b032 Implemented RSP microcode recompilation 2023-02-14 01:06:41 -05:00