Commit graph

1245 commits

Author SHA1 Message Date
water111 79d14af0b5
Decompile joint, collide-func, clean up joint decompression code for all games (#3369)
I finally read through all the joint code and wrote up some
documentation. I think this will be really helpful when we try to
understand all the functions in `process-drawable`, or if somebody ever
wants to import/export animations.

This switches all three games to using a new faster GOAL joint
decompressor. It is on by default, but you can go back to the old
version by setting `*use-new-decompressor*` to false.

Also fix the log-related crash, fix the clock speed used in timer math.
2024-02-11 09:50:07 -05:00
Hat Kid a4e629ebf9
decompiler: defskelgroup macro detection for jak 3, fix art group dumping for jak 3 and some more decomp work (#3370)
- `transformq`
- `wind-work`
- `progress-static`
- `merc-vu1`
- `emerc-vu1`
- `merc`
- `emerc`
- `cloth-h`
- Most of `cloth`, not added to gsrc yet

Art group dumps were incorrect for Jak 3 because the master art group
fields were at different offsets.
2024-02-11 09:32:06 -05:00
Tyler Wilding 18903f0561
decomp: Copy over new docstrings back to jak 2's common code, write some scripts to help automate this (#3366) 2024-02-04 13:53:06 -05:00
Tyler Wilding 314f488377
d/j3: do a few mood related files and fix some issues along the way (#3365) 2024-02-04 08:40:43 -05:00
water111 221360270a
[jak3] decomp gsound (#3364)
Decompile `gsound.gc`
2024-02-03 17:16:23 -05:00
water111 8b1c7759ea
[jak3] More headers, up to load-dgo (#3363)
path-h, sparticle-h, load-dgo, nav-control-h, nav-mesh-h, rigid-body-h,
actor-hash-h, spatial-hash-h
2024-02-03 15:03:10 -05:00
water111 af2fa6acbc
[jak3] More headers again again (#3359)
collide-cache-h, collide-h, projectile-h, background-h, subdivide-h,
hfrag-h, shrubbery-h, tfrag-h, tie-h
2024-02-03 12:15:51 -05:00
Hat Kid 9e8bee5b42
decomp3: more headers (again) (#3362)
- `entity-h`
- `eye-h`
- `simple-sprite-h`
- `sprite-h`
- `cam-debug-h`
- `cam-update-h`
- `cam-interface-h`
- `hud-h`
- `actor-link-h`
- `camera-h`
- `progress-h`

Also fills out a lot of the `text-id` enum. `progress-static` is also
very close to ready, only being blocked by #3361.
2024-02-03 11:39:29 -05:00
Tyler Wilding 94585e7f87
game: fix intermittent sprite_distort related crash (#3357)
Apparently a long standing bug, with
https://github.com/open-goal/jak-project/pull/3194 making it more likely
to occur.
2024-02-02 17:51:21 -05:00
ManDude bc32e635ee
seriously fix music player in title screen (#3358) 2024-02-02 12:24:57 +00:00
water111 b1b5cbb143
[jak3] More headers again (#3352)
joint-mod-h
collide-frag-h
projectile-h
stats-h
bsp-h
chain-physics-h
ragdoll-h
collide-hash-h
2024-02-01 18:46:54 -05:00
Hat Kid 7e5541d793
decomp3: more headers (#3356)
- `pov-camera-h`
- `sync-info-h`
- `trajectory-h`
- `collide-target-h` (`control-info` just padded out for now)
- `water-info-h`
- `process-drawable-h`
- `process-focusable`
- `focus`
- `effect-control-h`
- `process-taskable-h`
- `generic-obs-h`
- `target-h`
2024-02-01 17:58:10 -05:00
water111 1cccfbbf78
[jak3] More headers! (#3351)
Decomp aligner-h, joint-h, prim-h, debug-h, game-h, penetrate-h,
bones-h, foreground-h, scene-h, script-h.

Also, has a little bit of the joint-mod-h file, but it's not finished
yet.
2024-01-31 19:05:12 -05:00
Hat Kid ea93d32acc
decomp3: more misc files (#3349)
- `pat-h`
- `engines`
- `res-h`
- `res`
- `fact-h`
- `game-info-h`
- `wind-h`
- `merc-h`
- `shadow-vu1-h`
- `shadow-cpu-h`
- `dynamics-h`
- `memcard-h`
- `surface-h`
- part of `gui-h`
- `ambient-h`
- `speech-h`
- `prototype-h`
- `smush-control-h`
- `generic-merc-h`
- `generic-work-h`
- `collide-func-h`
- `collide-mesh-h`
- `collide-shape-h` (only missing the `new` method for `collide-shape`
because we don't have `process-drawable` yet and that also needs joint
stuff etc.)
- `collide-touch-h`
- `collide-edge-grab-h`
- `lightning-h`

This also adds argument name remaps for the `relocate` and `mem-usage`
methods (Jak 1 and 2 ref tests were updated, but not the gsrc).
2024-01-31 18:25:06 -05:00
water111 ba8d4c2903
[jak3] Drawable header decomp (#3347) 2024-01-28 14:23:41 -05:00
water111 bfe0a72ae7
[jak3] decompile (but not port) texture (#3346)
For now - just a plain decompilation, with no PC port changes. I think
it'll be easier to do those once we have a little bit more decompiled.
2024-01-27 16:30:18 -05:00
water111 8d0d05717f
[jak3] misc. headers (#3345)
trail-h, minimap-h, bigmap-h, capture, memory-usage-h, blit-displays-h,
sky-h, rest of ocean-h
2024-01-27 14:06:21 -05:00
water111 5fe4d12f70
[jak3] dma-disasm, time-of-day-h, texture-anim-h, level-h (#3344) 2024-01-27 13:09:37 -05:00
water111 4bd5111280
[jak3] dma, dma-bucket, dma-buffer (#3331) 2024-01-27 11:44:08 -05:00
Hat Kid f045e6cef1
decomp3: font-h, display, profile, settings-h, camera-defs-h, text-h (#3335) 2024-01-27 11:27:34 -05:00
Hat Kid 0ea718a5ee
decomp3: loader-h, capture-h, math-camera-h, math-camera, connect, gs, texture-h (#3333) 2024-01-25 15:44:26 +01:00
Hat Kid 3a2c57c091
decomp3: timer, display-h, decomp-h, file-io, pad (#3332) 2024-01-23 23:52:15 -05:00
water111 b130c2f439
[jak3] A few early files (#3330)
types-h, vu1-macros, gsound-h, dma-h, video-h, vu1-user-h, profile-h

The `gsound-h` is very simple, but the rest have decent docs and all the
macros we had from jak 2.

So far, barely any differences! (there's a few in gsound-h)
2024-01-22 21:09:48 -05:00
Hat Kid d4c21c784f
decomp3: geometry, vector, timer-h, ocean table files and game-task related enums (#3329) 2024-01-22 20:45:53 -05:00
water111 01d5fc2bbb
[jak3] Decomp for gkernel, gkernel-h, gstate, gstring (#3326)
I ported the kernel test from jak1/jak2 to jak 3, and it's passing!
2024-01-21 18:08:05 -05:00
ManDude 076f8aa6dd
[jak2] fix music player option (#3323) 2024-01-20 23:28:21 +00:00
water111 1c0038294f
[jak3] Decompile gcommon (#3321)
Decompile `gcommon`. I adjusted the spacing of docstring comments, and
removed some spammy decompiler warning prints.

I also added some random notes I had on VU programs from jak1/jak2. They
are not polished, but I think it's still worth including since we'll
have to go through them again for jak 3.
2024-01-20 12:33:39 -05:00
Hat Kid 9a4929ac0c
decomp3: some engine files (#3319)
- `vector-h`
- `gravity-h`
- `bounding-box-h`
- `matrix-h`
- `quaternion-h`
- `euler-h`
- `transform-h`
- `geometry-h`
- `trigonometry-h`
- `transformq-h`
- `bounding-box`
- `matrix`
- `matrix-compose`
- `transform`
- `quaternion`
- `euler`
- `trigonometry`

Not a whole lot of changes, just a couple of new functions and one new
file (`matrix-compose`).
2024-01-20 10:42:51 -05:00
ManDude ba7b0397b1
[pckernel] fix settings not being applied if file isn't found (#3313) 2024-01-17 15:43:53 +00:00
water111 4f537d4a71
[jak3] Set up ckernel (#3308)
This sets up the C Kernel for Jak 3, and makes it possible to build and
load code built with `goalc --jak3`.

There's not too much interesting here, other than they switched to a
system where symbol IDs (unique numbers less than 2^14) are generated at
compile time, and those get included in the object file itself.

This is kind of annoying, since it means all tools that produce a GOAL
object file need to work together to assign unique symbol IDs. And since
the symbol IDs can't conflict, and are only a number between 0 and 2^14,
you can't just hash and hope for no collisions.

We work around this by ignoring the IDs and re-assigning our own. I
think this is very similar to what the C Kernel did on early builds of
Jak 3 which supported loading old format level files, which didn't have
the IDs included.

As far as I can tell, this shouldn't cause any problems. It defeats all
of their fancy tricks to save memory by not storing the symbol string,
but we don't care.
2024-01-16 19:24:02 -05:00
jabermony 07427799a6
Jak3 Build Environment (#3098)
This sets out the bones of a Jak 3 build, many things are stubbed out,
guessed, or copied from Jak 2 but it should at least be good enough to:
run `task set-game-jak3`
launch the repl
run builds from the repl

build outputs themselves are untested but the build itself runs without
errors

---------

Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2024-01-15 20:37:16 -05:00
ManDude 46db6a36da
[pckernel] use pc-get-resolution to fetch initial fullscreen resolution (#3307)
This is the more correct way of doing what that code is trying to do.
Fixes #3296

Also fixed some type inconsistencies with related code, probably wasn't
causing issues though.

May also fix the "black screen on startup" issues people keep having,
but that would simply be a nice bonus and isn't the aim of this PR.
2024-01-15 18:53:49 +00:00
ManDude 7a8aa71204
[jak2] implement statistics tracker (#3288)
Currently only tracks enemy kills, and how they were killed. There is
currently no menu for this, but I've already added most of the text for
it. Also did a bunch of misc decompilation fixes and renamed some
methods.

Fixes #3277 
Fixes #3278
2024-01-11 22:49:41 +00:00
ManDude 349919f788
[jak2] implement pc cheats in menu (#3275)
Adds the opengoal cheats to the secrets menu. Only cheats that are fully
functional and unlockable are there right now, which is eight cheats.

This update will reset most Jak 2 settings.

Also fixes #3274 .
2023-12-28 11:14:10 +00:00
ManDude a01d78c7d4
[jak2] fix shadow origin using wrong joint (#3271)
Copypasta. Fixes #3269
2023-12-22 16:52:53 +00:00
Tyler Wilding 6cfb89a78a
g/j2: fix interleaving of local and external highscores (#3264)
Local scores weren't going above external scores even if they were
higher, a few test cases:

![Screenshot 2023-12-19
182412](https://github.com/open-goal/jak-project/assets/13153231/bf3c700d-0f23-441e-b537-88794532523b)
![Screenshot 2023-12-19
182446](https://github.com/open-goal/jak-project/assets/13153231/18d5d6eb-54b1-466e-8302-ca629677344f)
![Screenshot 2023-12-19
182442](https://github.com/open-goal/jak-project/assets/13153231/7de763a5-3587-416f-8755-1868049b92ed)
![Screenshot 2023-12-19
182421](https://github.com/open-goal/jak-project/assets/13153231/d44c1b5b-5f4f-4151-a1f0-e28d7612ed9d)
2023-12-19 18:58:25 -05:00
Tyler Wilding 99da5da441
g/j2: save window-size to pc-settings when it's changed (#3263)
Fixes #3262
2023-12-19 18:56:49 -05:00
ManDude 897e9c588b
fix weird potential initialization bug with the music log (#3258) 2023-12-12 23:34:14 +00:00
Hat Kid 9b6f16f561
jak2: 90 fps menu option (#3245)
Closes #3223
2023-12-03 21:32:21 +01:00
ManDude 1808596679
save & load game territory setting (#3243) 2023-12-03 18:19:38 +00:00
ManDude 94b984326f
[jak2] add game territory menu option (#3242) 2023-12-03 16:16:05 +00:00
ManDude 2795d3aa67
[jak2] fix health bar color fading (#3241)
Fixes #3237
2023-12-03 09:42:01 +00:00
ManDude be6a6dead4
[jak2] fix use-after-free bug in nav enemies (#3240)
Fixes #3153
2023-12-03 09:24:34 +00:00
ManDude 974f5931de
[jak2] add resolutions menu (#3238) 2023-12-03 08:11:18 +00:00
Brent Hickey e119a66788
[jak2] Support STICK_DEADZONE (#3239)
fixes #3235
2023-12-03 08:11:10 +00:00
SuperSamus 37069e2f8e
[jak2] Fix "Select controller" (#3191)
Co-authored-by: Martino Fontana <tinozzo123@gmail.com>
2023-12-02 15:20:26 -05:00
Hat Kid dfa6622544
jak2: add vehicle hijack lines PC cheat (#3205)
Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2023-12-02 15:17:54 -05:00
water111 a01182315b
[jak2] Support per-proto shrub visibility (#3228)
Fixes the issue reported in
https://github.com/open-goal/jak-project/issues/3168,
https://github.com/open-goal/jak-project/issues/3189,
https://github.com/open-goal/jak-project/issues/3166,
https://github.com/open-goal/jak-project/issues/3152,
https://github.com/open-goal/jak-project/issues/3224 where a small part
of the pipes in the `strip-grenade` mission appear, but shouldn't.
2023-12-02 12:16:14 -05:00
ManDude e38fe70ac4
[jak2] split language and text language (#3233) 2023-11-29 23:28:53 +00:00
ManDude 956645bdb9
[jak2] adjust progress generic item sizes + add scrolling effect (#3231)
Makes most of the options larger to reduce the amount of dead space and
adds a smooth scrolling effect instead of having "pages".


![imagem](https://github.com/open-goal/jak-project/assets/7569514/fc483dea-226c-44ff-96e0-680e89a6df81)

Button remap menu has no scrolling. Fixes #2984
2023-11-29 18:27:02 +00:00
ManDude a7f2776782
fix dark jak punch sound and some samos sounds (#3214) 2023-11-19 11:35:07 +00:00
ManDude 7f1bf1f892
[jak2] extended shadows hack + add/fix progress options (#3213) 2023-11-19 10:57:56 +00:00
Tyler Wilding 8258c409d5
New Crowdin updates (#3211) 2023-11-18 14:52:49 -05:00
Tyler Wilding 014cbb04da
i18n: transcribe missing english subtitles (#3199)
Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
Co-authored-by: ManDude <7569514+ManDude@users.noreply.github.com>
Co-authored-by: blahpy <68830177+blahpy@users.noreply.github.com>
2023-11-18 14:06:01 -05:00
Ziemas cca829aecd
j2: fix enemy-method-135 (#3206)
Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
2023-11-15 22:29:51 +01:00
ManDude 0b1639c8c0
fix forest youngsamos crash when he runs out of health (#3197)
Thought this may have been a regression but apparently we never patched
this one.

Fixes #3196
2023-11-12 18:35:58 +00:00
ManDude 42f995b059
reduce glow renderer vram usage + raise glow sprite limit (#3194)
Makes the glow sprite renderer flush when full capacity is reached,
instead of at the end. Also allows us to reduce the textures used for it
(finally). Worst case scenario there's 4-5 flushes per frame.

Fixes incessant flickering in the dig.
2023-11-12 00:11:50 +00:00
Tyler Wilding 2b1876f862
formatter: Add support for a few common functions and fix an LSP startup issue (#3190) 2023-11-11 17:51:55 -05:00
ManDude 288624b90f
fix mistakes in projectiles.gc (#3187)
Fixes #3184
2023-11-11 11:40:29 +00:00
Tyler Wilding 55611169ee
g/j2: Speedrunner mode improvements for Jak 2 (#3182) 2023-11-10 18:25:55 -05:00
ManDude a150e59e38
automatically re-enable autosave safely when starting a speedrun (#3181) 2023-11-09 17:48:47 +00:00
Hat Kid b2453fe23b
jak2: add missing pc options to progress menu (#3167) 2023-11-09 17:24:50 +01:00
Hat Kid a80b4f1b97
jak2: some high fps fixes (#3177) 2023-11-08 23:34:58 +01:00
Hat Kid 4e3d35e97c
jak2: fix discord rpc mission images in retail (#3176) 2023-11-07 00:39:58 +01:00
ManDude 8179d0aee3
[jak2] Localize board trick names (#3161)
It also looks like this now which I think is a bit cleaner:


![image](https://github.com/open-goal/jak-project/assets/7569514/0bed1d82-3407-4ca5-be1f-712ca8f96bcc)
2023-11-06 04:14:28 +00:00
Tyler Wilding f44f4dbe49
g/j2: use the large font for the jetboard trick combo display (#3157) 2023-11-05 01:32:01 -04:00
Tyler Wilding 595bc83105
g/j2: Add ending condition checks to the autosplitter struct (#3155) 2023-11-04 22:16:48 -04:00
water111 2a7016be6a
[jak2] Fix palace rotation at high fps (#3147) 2023-11-04 20:02:13 -04:00
ManDude 8d1fec34b4
allow per-file override of type-to-artgroup map + use correct divide by zero handler in civilian.gc (#3148) 2023-11-04 18:25:13 +00:00
Tyler Wilding 959921e988
i18n: Add jak 2 custom text to Crowdin (#3141) 2023-11-04 13:14:14 -04:00
ManDude adada4751d
[jak2]do not force UK english on PAL (#3142) 2023-11-04 11:17:40 +00:00
ZedB0T c1e81e1b4b
Add fallback text functionality to Jak 2 (#3128) 2023-11-03 21:45:10 -04:00
Tyler Wilding cca2897e3e
g/jak2: disable speech volume when starting a new speedrun (#3132) 2023-11-02 23:35:52 -04:00
Tyler Wilding fff3a85531
g/jak2: allow L1 + R1 + Start to open speedrun menu as well (#3131) 2023-11-02 20:42:51 -04:00
ManDude a949dada93
rename joint node and art element macros (#3111) 2023-11-01 23:16:00 +00:00
ManDude 5587593204
fps selection fixes i missed (#3109) 2023-10-30 19:55:16 +00:00
ManDude 99cb51ff57
[jak2] simplify fps disclaimer (#3108) 2023-10-30 18:17:11 +00:00
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
ManDude 09536c68ac
[compiler] asm-only disasm output + fix spacing bug (#3104) 2023-10-29 10:16:14 +00:00
Matt Dallmeyer 7c74b0c999
Fix starting continue point for Hub 2/3 category extensions (#3103) 2023-10-29 02:17:32 +01:00
Hat Kid c7c615a043
custom levels: refactor level building code and jak 2 support (#3090)
Co-authored-by: water <awaterford111445@gmail.com>
2023-10-21 06:07:43 +02:00
Hat Kid 2c825ab7bf
jak2: add warning text when changing frame rate for the first time (#3092) 2023-10-17 18:29:02 +02:00
Hat Kid 598ba1aaa3
jak3: add missing files and implement pexcw (#3084)
Some files were in the `banned_objects` list and were thus excluded from
the `all_objs` file.

Also implements the `pexcw` instruction which is only used in `hfrag`
code.
2023-10-12 18:07:37 -04:00
Aloqas ce1c2eb7c2
[jak1] Finnish base game strings (#3058)
Finnish translations for the remaining UI texts

---------

Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2023-10-12 18:05:40 -04:00
Tyler Wilding 8b3b96761d
g/j2: Integrate highscores with Speedrun.com/JakSpeedruns.com when speedrunner mode is enabled (#3037) 2023-10-11 20:43:55 -04:00
Hat Kid 6285c61662
decompiler: fix for v5 art group info dump, update taskfile for jak 3 (#3077) 2023-10-11 10:17:46 +02:00
Hat Kid 5a6aab4fab
jak3: add goal_src skeleton (#3069) 2023-10-10 15:41:05 +02:00
ManDude 27980218aa
[jak2] fix minor original game visual bugs (#3072)
Fixes #2994 the underport and consite icons being green (same color as
the goal, likely copy-pasta).

Fixes the hundredths timer in the race timer actually being a 60ths
timer.
2023-10-09 22:39:35 +01:00
Hat Kid bf961a36f4
decompiler: some hacks to allow running decompiler on jak 3 v5 code files, improve all-types generation (#2526)
Co-authored-by: water <awaterford111445@gmail.com>
2023-10-07 22:14:12 +02:00
water111 395c98db19
[goalc] Cleaned up speedups (#3066)
Started at 349,880,038 allocations and 42s

- Switched to making `Symbol` in GOOS be a "fixed type", just a wrapper
around a `const char*` pointing to the string in the symbol table. This
is a step toward making a lot of things better, but by itself not a huge
improvement. Some things may be worse due to more temp `std::string`
allocations, but one day all these can be removed. On linux it saved
allocations (347,685,429), and saved a second or two (41 s).
- cache `#t` and `#f` in interpreter, better lookup for special
forms/builtins (hashtable of pointers instead of strings, vector for the
small special form list). Dropped time to 38s.
- special-case in quasiquote when splicing is the last thing in a list.
Allocation dropped to 340,603,082
- custom hash table for environment lookups (lexical vars). Dropped to
36s and 314,637,194
- less allocation in `read_list` 311,613,616. Time about the same.
- `let` and `let*` in Interpreter.cpp 191,988,083, time down to 28s.
2023-10-07 10:48:17 -04:00
Hat Kid 3c27b3942b
decompiler: better automatic detection of art groups and joint-node-index macro detection (#3061) 2023-10-06 16:42:16 +02:00
ManDude 1338fed9c9
fix eco pickup time bug (#3056) 2023-10-02 01:22:05 +01:00
Tyler Wilding 42e3b7f89c
g/j2: don't force auto-save on in jak 2 when starting a speedrun (#3048) 2023-09-30 23:40:00 -04:00
ManDude dfeb88b35d
[jak2] fully implement *user* (#3046)
Fixes #1918
2023-10-01 04:28:30 +01:00
Matt Dallmeyer d149838485
fix draw-string-xy-scaled cropping (#3041)
fixes #3038 


https://github.com/open-goal/jak-project/assets/2515356/5b7a490f-e1fb-4a12-a3d9-b576a2c1d574
2023-10-01 00:17:50 +01:00
ManDude e130244271
[jak2] scalable debug font + fix debug menu widescreen bugs (#3044)
also hides empty (no commands) regions from the viewers by default now.
2023-09-30 21:19:47 +01:00
water111 0e31a9c407
[decompiler] Handle find-parent-method (#3018)
This change adds a few new features:
- Decompiler automatically knows the type of `find-parent-method` use in
jak 1 and jak2 when used in a method or virtual state handler.
- Decompiler inserts a call to `call-parent-method` or
`find-parent-state`
- Removed most casts related to these functions

There are still a few minor issues around this:
- There are still some casts needed when using `post` methods, as `post`
is just a `function`, and needs a cast to `(function none)` or similar.
It didn't seem easy to change the type of `post`, so I'm not going to
worry about it for this PR. It only shows up in like 3 places in jak 2.
(and 0 in jak 1)
- If "call the handler if it's not #f" logic should probably be another
macro.

Fixes #805
2023-09-30 11:06:09 -04:00
ManDude 15fb677f5f
[jak2] un-mips2c draw-string (#3040)
It's not an asm function.
2023-09-30 00:07:55 +01:00
ManDude 1f4044b9ff
Jak 2 controller LED implementation (#3035)
Adds controller LED features to Jak 2:
- progressive flickering denoting health
- copies tomb simon says puzzle colors
- unique colors for each gun
- orange color for being indax
- yellow color for being in mech
- purple color for being darkjak
- blue color for being in board
- red flash when wanted.

May add more features later?

Also did some minor clean-up on some types.
2023-09-28 02:47:09 +01:00
ManDude 170cbd7e6c
misc low hanging fruit fixes (#3034)
Fixes #2235 
Fixes #2236 
Fixes #2963 
Fixes #3027
2023-09-27 00:59:07 +01:00