jak-project/decompiler/analysis
ManDude cd68cb671e
deftype and defmethod syntax major changes (#3094)
Major change to how `deftype` shows up in our code:
- the decompiler will no longer emit the `offset-assert`,
`method-count-assert`, `size-assert` and `flag-assert` parameters. There
are extremely few cases where having this in the decompiled code is
helpful, as the types there come from `all-types` which already has
those parameters. This also doesn't break type consistency because:
  - the asserts aren't compared.
- the first step of the test uses `all-types`, which has the asserts,
which will throw an error if they're bad.
- the decompiler won't emit the `heap-base` parameter unless necessary
now.
- the decompiler will try its hardest to turn a fixed-offset field into
an `overlay-at` field. It falls back to the old offset if all else
fails.
- `overlay-at` now supports field "dereferencing" to specify the offset
that's within a field that's a structure, e.g.:
```lisp
(deftype foobar (structure)
  ((vec    vector  :inline)
   (flags  int32   :overlay-at (-> vec w))
   )
  )
```
in this structure, the offset of `flags` will be 12 because that is the
final offset of `vec`'s `w` field within this structure.
- **removed ID from all method declarations.** IDs are only ever
automatically assigned now. Fixes #3068.
- added an `:overlay` parameter to method declarations, in order to
declare a new method that goes on top of a previously-defined method.
Syntax is `:overlay <method-name>`. Please do not ever use this.
- added `state-methods` list parameter. This lets you quickly specify a
list of states to be put in the method table. Same syntax as the
`states` list parameter. The decompiler will try to put as many states
in this as it can without messing with the method ID order.

Also changes `defmethod` to make the first type definition (before the
arguments) optional. The type can now be inferred from the first
argument. Fixes #3093.

---------

Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
2023-10-30 03:20:02 +00:00
..
.clang-format [decomp] add mips2c converter (#842) 2021-09-11 20:52:35 -04:00
analyze_inspect_method.cpp deftype and defmethod syntax major changes (#3094) 2023-10-30 03:20:02 +00:00
analyze_inspect_method.h formatter: add tree-sitter dependency and commit early draft work on a proper code formatter (#2536) 2023-04-24 23:46:55 -04:00
atomic_op_builder.cpp jak3: add missing files and implement pexcw (#3084) 2023-10-12 18:07:37 -04:00
atomic_op_builder.h [decompiler] cleanup to get atomic ops working on jak2 inputs (#1426) 2022-06-08 18:34:52 -04:00
cfg_builder.cpp decompiler: some hacks to allow running decompiler on jak 3 v5 code files, improve all-types generation (#2526) 2023-10-07 22:14:12 +02:00
cfg_builder.h [Decompiler] Expression Building (#211) 2021-01-24 16:39:15 -05:00
expression_build.cpp improve decomp of state handlers and art groups (#3014) 2023-09-23 09:53:50 -04:00
expression_build.h [decomp] add mips2c converter (#842) 2021-09-11 20:52:35 -04:00
final_output.cpp deftype and defmethod syntax major changes (#3094) 2023-10-30 03:20:02 +00:00
final_output.h docs: add support for :override-doc in method declarations as well as documenting state handlers (#2139) 2023-01-21 20:45:45 -05:00
find_defpartgroup.cpp Create a new format for particle definitions (defpart) (#2572) 2023-04-29 11:01:47 -04:00
find_defpartgroup.h [decompiler] decompile particle defs using specialized macros (#1077) 2022-01-15 20:01:38 -05:00
find_defstates.cpp improve decomp of state handlers and art groups (#3014) 2023-09-23 09:53:50 -04:00
find_defstates.h decomp: finish _almost all of_ the remaining camera code (#845) 2021-10-16 21:01:23 -04:00
find_skelgroups.cpp decomp: finish target-[util|darkjak|swim|gun] | water | water-anim | crates | dark-eco-pool, fix skelgroup detection, add failed store/load warnings and clean up jak 3 config (#1958) 2022-10-14 19:35:57 -04:00
find_skelgroups.h [decompiler] implement defskelgroup (#955) 2021-11-04 19:10:39 -04:00
inline_asm_rewrite.cpp logs: replace every fmt::print with a lg call instead (#1368) 2022-10-01 11:58:36 -04:00
inline_asm_rewrite.h decomp - vector.gc - Decompile vector.gc (#289) 2021-03-06 10:46:26 -05:00
insert_lets.cpp [goalc] Cleaned up speedups (#3066) 2023-10-07 10:48:17 -04:00
insert_lets.h [decomp] better handling of animation code and art files (#1352) 2022-05-20 02:30:14 +01:00
label_types.cpp d/jak2: get portrun working and decompile a bunch of miscellaneous files (#2169) 2023-01-28 19:36:57 -05:00
label_types.h [decompiler] automatically label things when possible (#784) 2021-08-29 11:13:06 -04:00
mips2c.cpp jak3: add missing files and implement pexcw (#3084) 2023-10-12 18:07:37 -04:00
mips2c.h game: Remove temporary CLI arg shim in gk (#2532) 2023-04-22 14:13:57 -04:00
reg_usage.cpp logs: replace every fmt::print with a lg call instead (#1368) 2022-10-01 11:58:36 -04:00
reg_usage.h [decomp] add mips2c converter (#842) 2021-09-11 20:52:35 -04:00
stack_spill.cpp update readme and fix always playing str (#1139) 2022-02-08 19:02:47 -05:00
stack_spill.h [decomp] add mips2c converter (#842) 2021-09-11 20:52:35 -04:00
static_refs.cpp d/jak2: finish onin-game and resolve type-hinting (array object) elements (#2188) 2023-02-04 20:36:30 -05:00
static_refs.h [decompiler/compiler] Fixes for task-control (#668) 2021-07-01 21:38:19 -04:00
symbol_def_map.cpp logs: replace every fmt::print with a lg call instead (#1368) 2022-10-01 11:58:36 -04:00
symbol_def_map.h [decomp] add mips2c converter (#842) 2021-09-11 20:52:35 -04:00
type_analysis.cpp logs: replace every fmt::print with a lg call instead (#1368) 2022-10-01 11:58:36 -04:00
type_analysis.h [decomp] add mips2c converter (#842) 2021-09-11 20:52:35 -04:00
variable_naming.cpp [opengoal] make none a child of object (#3001) 2023-09-22 10:54:49 +01:00
variable_naming.h update readme and fix always playing str (#1139) 2022-02-08 19:02:47 -05:00