Commit graph

20 commits

Author SHA1 Message Date
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 4161ef68cc Made recompilation header include configurable 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
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
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
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
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 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 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 602be9c2c6 Implemented relocatable overlays (OoT runs) 2023-02-04 00:14:03 -05:00
Mr-Wiseguy c6de2b6189 WIP overlay support and some libultra function implementations for other games 2023-01-12 23:39:49 -05:00
Mr-Wiseguy 5d9ea96abc Added temp for switch case operand, fixed compilation issues in output 2022-11-15 19:55:48 -05:00
Mr-Wiseguy 2300a4b6c9 Implemented register state tracking to identify jump tables for jr instructions 2022-11-15 19:55:48 -05:00
Mr-Wiseguy 84fd433dcc Implemented jal function lookup 2022-11-15 19:55:48 -05:00
Mr-Wiseguy 8a0f0da0cc Implemented initial set of instructions and ignored functions 2022-11-15 19:55:48 -05:00