Commit Graph

763 Commits

Author SHA1 Message Date
Hat Kid 46a4b9d0ad increase stack for tpl-holo-eye 2026-04-18 15:04:47 +02:00
Hat Kid 44888c752f jak3 ref 2026-04-15 20:33:35 +02:00
Hat Kid 9f66a69859 always set vu function length to 0 2026-04-15 02:31:17 +02:00
Hat Kid c8653b2d51 jak2 ref 2026-04-15 02:29:58 +02:00
Hat Kid 2ef5f8313a jak1 ref 2026-04-14 09:23:08 +02:00
water111 0da265f87b more fixes 2026-04-13 19:47:54 -04:00
Hat Kid cfe3ec9229 decomp3: cam-debug, hover-nav-edit, pilot-recorder (#4203)
Should be the last remaining files aside from `anim-tester` which we
already have a better replacement for.
2026-04-09 06:27:00 +02:00
Hat Kid 3f686854e6 decomp3: vivsol-edit, editable and nav mesh editor files (#4200)
- `visvol-edit`
- `editable`
- `editable-player`
- `mysql-nav-graph`
- `nav-graph-editor`
- `nav-mesh-editor-h`
- `nav-mesh-editor`

The SQL data is not filled in yet.
2026-04-08 17:42:13 +02:00
Tyler Wilding 1f1fdf834b jak3: support mirror mode (#4170)
Similar changes as have been done in the previous two games. Test the
following things:
- normal gameplay
- defend spargus turret
- satellite
- that desert mission where you shoot the gun
- that turret mission in haven forest

At a glance, i think that's everything...?

~~Didn't debug the crash yet either, hoping this is sufficient~~ (fixed,
thanks hatkid, needed to disable some blit related code)

Closes #4160
2026-04-05 17:52:15 -04:00
Hat Kid dc203502fc jak3: fix potential wascity-defend softlock, stick sens setting, fix freeze-screen regression (#4182)
There was some bad manual decomp in `wasdef-manager` that caused the
mission to sometimes softlock, preventing Jak from exiting the turret
after destroying all Makers.

Also adds stick sensitivity setting from Jak 2 and fixes a regression
with the Light Jak freeze screen overlay on PC aspect ratios.

Closes #4179 
Closes #4154
2026-04-05 16:58:19 +02:00
Tyler Wilding c3cc91c9ba jak2/3: update enemy method name related to playing sound effects (#4176)
Was investigating https://github.com/open-goal/jak-project/issues/3012
and found out it's no longer an issue, fixed at some point.

Updated the method name, it actually looks like quite a few methods were
nicely named / documented in jak 3, so i might automate backporting that
documentation (likely a bunch that can go all the way back to jak 1 as
well).

Closes #3012
2026-04-05 01:14:14 -04:00
Hat Kid 0385c76811 decomp: support part-tracker-spawn in jak2, part group constants (#4082) 2025-11-20 16:22:29 +01:00
Hat Kid 73dd982fdc jak3: misc high fps fixes (#4055)
Fixes for:

- `prebot` sword attack and projectile speed (fixes #4050)
- Fast first person camera turning speed (fixes #4051)
- Slow turret camera turning speed (fixes #4052)
- `flyingsaw` movement and rotation speed (fixes #4053)
- Green eco drain rate on jetboard during `forest-kill-plants` mission
(fixes #4054)
- `skeet` rotation speed
- `maker-grenade` tumble speed
- Jetboard spin speed
- `hud-skill` rotation speed (also for jak2)
- `gun-dark-shot` projectile speed (also for jak2)
- `target-float` up/down speed (also for jak2)
- Texscroll speed
- Slow walk anim after landing from a jump
2025-10-17 14:28:22 +02:00
Alex 48903fc6f8 [jak3] fix stereo vag commands causing memory corruption (#4040)
All stereo VAG commands would write to an out-of-bounds array element
and corrupt the whole VAG queue list.

Fixes random sound-related crashes including a consistent Light Jak
Freeze crash.
2025-10-07 01:34:51 +01:00
water111 c8a1643e9f [jak3] Add zoom blur and color filter effect (#4031)
Add the zoom blur effect, used by cutscene effects and a few weapons:


https://github.com/user-attachments/assets/8d231b34-faf8-4b88-a636-edf2b5477ff9

And color filtering


https://github.com/user-attachments/assets/67db5933-4b29-4c77-ad56-5025cbefa328

There's still two blit-displays not covered: scanlines and the light jak
slow motion effect.
2025-10-04 17:06:18 -04:00
Hat Kid c61a69d751 jak3: wip pc progress code (#3898) 2025-04-16 20:57:43 +02:00
water111 23118be428 [jak3] Fix crash in subrails (#3863)
After the change to vector ops, subrails was crashing. This fixes the
crash by fixing a stack type and also marks those new vector op
functions as inline.

Co-authored-by: water111 <awaterford1111445@gmail.com>
2025-02-16 17:40:23 -05:00
water111 2a4d3d7a4a [decompiler] More inline vector functions (#3861)
This adds more recognition for inlined vector functions to the
decompiler, which can clean up a bunch of ugly looking code/`rlet`s.


![image](https://github.com/user-attachments/assets/1f7b4627-81bd-481b-b828-76b9f7ba13b3)

Unfortunately, this changes the numbering of ops in the decomp, since
all the vector instructions get combined in a single "operation" by the
decompiler. I really tried to avoid having this ever happen in the
decompiler and this is one of the few cases where it has. So I had to
update a bunch of type casts.

For that reason I haven't turned this on in Jak 2 yet, although I am
planning to do that at some point. (probably at the same time as porting
back a bunch of jak 3 improvements to jak 2)

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
2025-02-16 15:59:17 -05:00
water111 48cb9bb787 [decompiler] as-type and font method support (#3855)
Add support for `as-type` macro, and detecting inline font methods. This
works in all three games but I've only updated jak 3's goal_src for now.
Eventually I will go back and work through the others, but I want to get
more decompiler features in first.


![image](https://github.com/user-attachments/assets/5c31bf85-97b4-437c-bc4b-dc054e60551e)

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
2025-02-01 21:23:11 -05:00
water111 7348e6a4ff [decompiler] Update vector ops, reduce casts (#3849)
Update the decompiler to use the new vf macros.

Also, fix a bunch of silly casting issues where accessing inline fields
with an offset of 0 would be better than a cast:

![image](https://github.com/user-attachments/assets/885bbb07-634f-47b8-99f5-5a947941cdde)

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
2025-01-20 16:32:58 -05:00
water111 98d6618a8b [decompiler] Detect vector*! (#3846)
Detect use of `vector*!`, which is inlined in jak 2 and jak 3.

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
2025-01-20 12:21:28 -05:00
water111 3ee2b4423c [decompiler] Cleanup for Jak 3 (#3845)
This PR does a few cleanups:
- improve method names/comments/flags for `enemy.gc` and a few other
files
- fix `new-stack-matrix0` not working for jak 3
- add `matrix-copy!` detection for jak 3
- add `vector-copy!` detection

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
2025-01-20 10:31:29 -05:00
Hat Kid 51d008f9ab decompiler: detect and turn inverse mult to div (#3795)
Co-authored-by: ManDude <7569514+ManDude@users.noreply.github.com>
2024-12-07 23:10:49 +01:00
Hat Kid 6a06291e6e jak1, jak2: add get-texture macro (#3778)
Ports the `get-texture` macro added in Jak 3 to Jak 1 and 2.
2024-11-26 11:29:34 +01:00
Hat Kid 2ff49b9905 jak3: fix ragdolls settling too early (#3775)
`none` methods strike again

Fixes #3774
2024-11-22 02:36:50 +01:00
water111 5e3cb8faa6 [jak3] Fix stack layout for car spawn (#3765)
Fix for cars spawning under ground or in weird places

Co-authored-by: water111 <awaterford1111445@gmail.com>
2024-11-16 17:52:14 -05:00
Hat Kid af5cb9b1cb jak3: subtitle3, vag-player (#3758) 2024-11-12 02:45:16 +01:00
Hat Kid 7de5eb9fc0 jak3: misc fixes (#3686)
- Fix global heap display in cheat mode
- Fix `tpl-watcher` NaNs after they fire their laser (`vf0` was being
clobbered) (Fixes #3684)
- Fix `artifact-race` talkers (Fixes #3685)
2024-09-23 18:41:34 +02:00
water111 f60a155c0f [jak3] Fix crash with volcano platforms (#3676)
Ended up being a simple fix to a stack type in rigid-body.

Co-authored-by: water111 <awaterford1111445@gmail.com>
2024-09-22 13:09:41 -04:00
Hat Kid 7053090541 jak3: decomp bigmap, blit-displays, fix progress crash (#3657)
`bigmap` and `blit-displays` mostly work. `blit-displays` is still
missing all of the special effects that were added in Jak 3 (brightness
and contrast settings, screen blur effect, etc.).

`bigmap` is missing the player marker texture (`hud-target-marker`) for
some reason, it's part of `tpage-17` which is coming from
`progress-minimap` and should already be included. The icons also
currently stretch when using aspect ratios other than 4:3.

The progress menu now also works for the most part. The draw order is a
bit messed up because some code was initially drawing things with the
ocean bucket, which was changed to use `hud-draw-hud-alpha` instead for
now. The texture for the volume and brightness/contrast sliders still
looks wrong.

Fixes #3653
Fixes #3656
2024-09-07 14:18:30 +02:00
Hat Kid bc66d416b4 decompiler: call-parent-state-handler and suspend-for macros (#3625)
Also fix `hud-draw-pris2` bucket in Jak 3 to make subtitles work and
foreground HUD envmap.
2024-09-04 19:35:54 +02:00
Tyler Wilding c72a086e49 jak2: support mirror mode (#3616)
Fixes #3210


![image](https://github.com/user-attachments/assets/86bb6a67-bc6a-4169-aa82-d6a46ecd43d7)

TIL that on the PS4/PS5, mirror mode breaks the upscaling
2024-07-30 23:30:53 -04:00
Tyler Wilding e975eab15a decompiler: Apply docstring indentation fix to all game versions (#3614)
Previously was only applying to game versions above Jak 2, Fixes #3342
2024-07-29 21:57:07 -04:00
water111 9d0009715e [jak3] Fix alpha for prims, entity-table (#3609)
Fix issue where light-trail is invisible and some actors not spawning
due to out of memory.
2024-07-27 12:46:33 -04:00
water111 3856ae505a [jak3] Some cleanup/fixes around curve and light-trail (#3608)
They still don't work yet, this is just naming/comments to help with
debug.

The vehicle tracks are now at least trying to draw, but like the others,
don't actually show up.
2024-07-27 11:17:39 -04:00
Tyler Wilding 92c4390f0a jak1: Adjust sprite positioning or hide them where appropriate when using non-standard aspect ratios (#3596)
This attempts to do a best-effort quick fix for the sprite alignment in
the menus and first person views on higher aspect ratios. This:
- Hides the binocular borders completely when using a non-standard ratio
![Screenshot 2024-07-20
021430](https://github.com/user-attachments/assets/c56d3a6c-13b0-43e1-b99b-83292993728c)
- Hides the borders in jak's first person view when using a non-standard
ratio
![Screenshot 2024-07-20
021310](https://github.com/user-attachments/assets/fefca993-960b-4741-87b7-6d7c17efe89d)
- Uses a combination of manual alignment and approximation to get the
pause menu closer.
![Screenshot 2024-07-20
151725](https://github.com/user-attachments/assets/2c8aa759-b33a-4fbe-abc6-b5861fc33208)
> 32:9 screenshot.

I accomplished the last one by manually aligning all of the core sprites
and text for the most popular aspect ratios. This means that from a
practical standpoint, things should align "perfectly". However, I then
used all of those values to derive a polynomial for each adjustment
based on the aspect ratio. This allows the game to do a half-decent
approximation/interpolation for every aspect ratio in-between the common
ones. It won't be perfect, but it will be better than this:

![image](https://github.com/user-attachments/assets/420b1e38-6f88-436a-8e8c-21df6b49428e)
2024-07-26 23:15:51 -04:00
water111 82a23c747e [jak3] prim rendering for cloth (#3607) 2024-07-26 20:31:32 -04:00
water111 e81431bd21 [wip] Jak 3 Overlord (#3567) 2024-07-26 09:42:28 -04:00
Hat Kid 365fae4913 jak3: fix bbush rings (#3593)
Fixes #3592
2024-07-17 21:49:07 +02:00
Hat Kid bdded9ad8c jak3: add missing texture animations (#3577)
This refactors some of the texture animation code a bit to better
support multiple games and adds most of the missing texture animations
for Jak 3 with a couple of exceptions/bugs:

- `hanga-sprite`: Despite `move_to_pool` being set for this anim, it's
not showing up in-game, but it does display properly in the ImGUI debug
window.

![image](https://github.com/open-goal/jak-project/assets/6624576/29df8e17-8831-412b-b9b7-7704d6bd7813)
- `factoryc-alpha`: Some conveyors do not have the animation for some
reason.

![image](https://github.com/open-goal/jak-project/assets/6624576/209ef073-2a81-4e2c-b020-dc2ae0b01196)
- This spot in Spargus seems to use texture animations, but it looks
like it maps to the `fora-water-dest` texture/slot, which comes from
`foresta-water`. Because the texture is not initialized, the texture
shows up black on first load, but it does show up after loading
`foresta`.

![image](https://github.com/open-goal/jak-project/assets/6624576/1e54bab2-f97c-47d5-a92a-a98a52c30178)

![image](https://github.com/open-goal/jak-project/assets/6624576/240b0137-1e9e-4e65-8446-0f78df9802dd)
- `hfrag` texture anim is not handled yet. Probably needs some special
casing.
2024-07-15 02:25:18 +02:00
ManDude 37762c5fb7 wrap sprite rgba to 0-255 (#3549) 2024-06-04 07:57:52 +01:00
ManDude ea1271cfd0 [jak3] implement autocollect and city turbo board cheats, fix actor heap and level flags (#3541) 2024-05-31 16:41:35 +01:00
Matt Dallmeyer 70ea2a1f67 jak3 - fill out some text-id entries (#3494)
Slam Dozer > Ram Rod
2024-05-30 21:49:10 -04:00
ManDude 645e649a9c jak3: shadow culling hack + finish region debugging tools + fix bigmap crashes (#3532) 2024-05-23 23:43:38 +01:00
water111 271007e552 Start setting up texture animation for jak 3. (#3524)
For now, this just adds sky (clouds and fog), darkjak, and skull gem.

There are some unknown issues with drawing the skull gems still, but I
think it's unrelated to texture animations.

Also fixes https://github.com/open-goal/jak-project/issues/3523
2024-05-18 11:23:48 -04:00
Hat Kid c12a5d777c decomp3: decompile remaining mission code (#3515)
This should make all missions playable with the exception of the end of
`precursor-destroy-ship` because `precurd` asserts on level extraction.

- `trail`
- `trail-graph`
- `wastrail-graph`
- `cty-protect`
- `protect-gunship`
- `protect-path`
- `protect-script`
- `assault-cams`
- `assault-enemies`
- `assault-path`
- `assault-script`
- `assault-shared`
- `assault-task`
- `hover-nav-precura`
- `precura-mood`
- `precura-obs`
- `precura-obs2`
- `precura-part`
- `precurc-mood`
- `precurc-obs`
- `precurc-part`
- `precurd-obs`
- `precurd-part`
- `precurd-scenes`
2024-05-16 16:21:44 +02:00
ManDude ebbbedabc5 jak3: fix hud sprite crash + add entity debugger (#3516) 2024-05-13 04:09:25 +01:00
Tyler Wilding d1ece445d4 Dependency graph work - Part 1 - Preliminary work (#3505)
Relates to #1353 

This adds no new functionality or overhead to the compiler, yet. This is
the preliminary work that has:
- added code to the compiler in several spots to flag when something is
used without being properly required/imported/whatever (disabled by
default)
- that was used to generate project wide file dependencies (some
circulars were manually fixed)
- then that graph underwent a transitive reduction and the result was
written to all `jak1` source files.

The next step will be making this actually produce and use a dependency
graph. Some of the reasons why I'm working on this:
- eliminates more `game.gp` boilerplate. This includes the `.gd` files
to some extent (`*-ag` files and `tpage` files will still need to be
handled) this is the point of the new `bundles` form. This should make
it even easier to add a new file into the source tree.
- a build order that is actually informed from something real and
compiler warnings that tell you when you are using something that won't
be available at build time.
- narrows the search space for doing LSP actions -- like searching for
references. Since it would be way too much work to store in the compiler
every location where every symbol/function/etc is used, I have to do
ad-hoc searches. By having a dependency graph i can significantly reduce
that search space.
- opens the doors for common shared code with a legitimate pattern.
Right now jak 2 shares code from the jak 1 folder. This is basically a
hack -- but by having an explicit require syntax, it would be possible
to reference arbitrary file paths, such as a `common` folder.

Some stats:
- Jak 1 has about 2500 edges between files, including transitives
- With transitives reduced at the source code level, each file seems to
have a modest amount of explicit requirements.

Known issues:
- Tracking the location for where `defmacro`s and virtual state
definitions were defined (and therefore the file) is still problematic.
Because those forms are in a macro environment, the reader does not
track them. I'm wondering if a workaround could be to search the
reader's text_db by not just the `goos::Object` but by the text
position. But for the purposes of finishing this work, I just statically
analyzed and searched the code with throwaway python code.
2024-05-12 12:37:59 -04:00
water111 e0b1d8c21e Jak3 sky (#3514) 2024-05-12 09:36:50 -04:00
Hat Kid 6b3844bf99 decomp3: more misc files (#3513)
4 missions to go!

- `ctygenb-part`
- `power-game`
- `vinroom-part`
- `vinroom-scenes`
- `gungame-part`
- `gungame-scenes`
- `hiphog-obs`
- `hiphog-part`
- `hiphog-scenes`
- `hover-nav-lpattack`
- `king-rider`
- `rubble-attack`
- `rubble-obs`
- `rubble-part`
- `rubblea-init`
- `rublcst-scenes`
- `mood-funcs2`
- `gun-dummy-art`
- `gun-dummy-part`
- `gun-dummy`
- `gungame-data`
- `gungame-manager`
- `gungame-obs`
- `blow-tower-data`
- `blow-tower-extra`
- `blow-tower-obs2`
- `blow-tower-obs`
- `blow-tower-part`
- `blow-tower-script`
- `blow-tower-shared`
- `blow-tower-speech`
- `cty-blow-tower`
2024-05-11 17:57:26 -04:00