Commit graph

1253 commits

Author SHA1 Message Date
ManDude 5705359df9
[jak3] fix some flag names and a wcar crash (#3498) 2024-05-01 08:44:26 +01:00
ManDude 8344ac6963
use only the real level name in the Loader (#3495)
This fixes issues with certain Jak 3 levels not rendering because there
is a mismatch between the DGO name, nickname and real level name (bsp
name).

FR3s use a different filename, so you can delete the ones you have after
this is merged.

This affects custom levels, but I don't have that toolchain set up so
someone else will have to test that.
2024-04-30 17:12:57 +01:00
Matt Dallmeyer 0d4e3928eb
decomp3 title-obs, credits-h (#3476) 2024-04-29 20:23:31 +02:00
ManDude e4c57d6ac9
more debug information when RPC buffers exhaust (#3490) 2024-04-29 16:37:04 +01:00
Hat Kid e2e5289788
decomp3: font widescreen and shadow hacks, generic renderer, misc files (#3483)
- `pecker-ingame`
- `des-bbush-tasks`
- `des-burning-bush`
- `des-bush-part`
- `des-bush`
- `mh-centipede`
- `mh-centipede-part`
- `mh-wasp`
- `mh-wasp-part`
- `needle-fish`
- `des-bush-time-chase`
- `timer-path`
- `mission-squad-control-h`
- `mh-bat`
- `hover-nav-factoryd`
- `hover-nav-factoryc`
- `conveyor`
- `fac-part`
- `factory-part`
- `factoryc-mood`
- `factoryc-obs`
- `factoryc-obs2`
- `lfaccar-init`
- `factory-boss-part`
- `factory-boss-scenes`
- `factory-boss-setup`
- `factory-boss-states`
- `factory-mood`
- `factoryc-manager`
- `lfacrm1-mood`
- `lfacrm2-mood`
- `missile-bot`
- `sew-laser-turret`
- `ai-task-h`
- `ash-h`
- `ash-shot`
- `ash-states`
- `ash-task`
- `ash`
- `bot-h`
- `bot-states`
- `bot`
- `ash-oasis-course`
- `oasis-defense`
- `comb-field`
- `comb-mood`
- `comb-obs`
- `comb-part`
- `comb-scenes`
- `comb-sentry`
- `comb-travel`
- `comba-init`
- `combx-scenes`
- `h-sled`
- `destroy-dark-eco`
- `fac-gunturret`
- `fac-robotank-turret`
- `fac-robotank`
- `fac-tower`
- `factory-h`
- `factory-hud`
- `factory-manager`
- `factorya-init`
- `ffight-projectile`
- `ftank-projectile`
- `fturret-projectile`
- `h-warf`
- `warf-projectile`
2024-04-28 08:59:46 -04:00
ManDude 1a058b418a
jak3: hack level heap sizes (#3487) 2024-04-27 21:48:49 +01:00
ManDude 889fdcd79c
jak3: fix some collide decomp + fix projectiles aiming at intangible objects (#3485)
Say goodbye to half of the laser needle shots spinning around doing
nothing. This is toggleable with `fix-projectile-focus` in the pc
settings.
2024-04-26 16:22:26 +01:00
ManDude 667553850d
jak2/3: re-implement screenshot system through goal (#3482) 2024-04-25 01:46:18 +01:00
ManDude d9d4cc5405
fix minimap icon misalign (#3481) 2024-04-23 18:20:31 +01:00
ManDude 728cb4b6c9
jak3 pc: math-camera, letterbox, led and auto-save (#3479) 2024-04-22 22:57:09 +01:00
Hat Kid 58a5440c8a
decomp3: more misc files (#3466)
Makes a bunch of missions mostly playable, including:
- `arena-training-1`
- `arena-fight-1`
- `wascity-chase`
- `arena-fight-2`
- `arena-fight-3`
- `volcano-darkeco`
- `desert-hover`
- `nest-eggs`
- `temple-climb`
- `temple-oracle`
- `temple-tests`
- `desert-beast-battle`
- `desert-turtle-training`
- `desert-course-race`
- `desert-artifact-race1`
- `wascity-leaper-race`
- `wascity-pre-game`
- `sewer-met-hum`
- `forest-kill-plants`
- `forest-ring-chase`
- `temple-defend`
- `tower-destroy`
- `desert-glide`

---
Files:

- `ripple`
- `waswide-mood`
- `sig-rider`
- `nst-tasks`
- `nst-part`
- `nst-gas`
- `nst-eggs-h`
- `nst-obs`
- `nst-mood`
- `egg-spider`
- `wasdoors-init`
- `wasall-tasks`
- `wvehicle-race`
- `wcar-marauder`
- `wcar-marauder-b`
- `turret-control`
- `was-squad-control`
- `turtle-training`
- `kleever-rider`
- `course-race`
- `artifact-race`
- `desert-hover`
- `desbeast-path-h`
- `des-beast`
- `desertg-obs`
- `desertf-obs`
- `desertd-obs`
- `desert-dust-storm`
- `des-cactus`
- `race-hud`
- `race-info`
- `race-manager`
- `tizard`
- `flyingsaw`
- `hover-training`
- `temple-mood`
- `temple-obs`
- `temple-obs2`
- `temple-part`
- `temple-scenes`
- `templex-mood`
- `templex-obs`
- `templex-part`
- `tomb-baby-spider`
- `target-turret-shot`
- `target-turret`
- `beast-battle-path`
- `des-beast-2`
- `mh-flyer`
- `scorpion-gun`
- `hover-enemy-h`
- `hover-enemy`
- `hover-formation-h`
- `hover-formation`
- `hover-nav-control-h`
- `hover-nav-control`
- `flamer-hover`
- `hover-nav-templea`
- `robo-hover`
- `hover-nav-sewb`
- `hover-nav-sewg`
- `hover-nav-sewj`
- `hover-nav-sewl`
- `hover-nav-sewo`
- `hover-nav-towera`
- `tower-mood`
- `tower-obs`
- `tower-scenes`
- `tower-part`
- `eco-green-collider`
- `forest-bridges`
- `forest-kill-plants`
- `forest-mood`
- `forest-ring-chase`
- `forest-tasks`
- `forest-part`
- `foresta-obs`
- `hover-nav-foresta`
- `mh-plant`
- `dp-bipedal-part`
- `dp-bipedal-shot`
- `dp-bipedal`
- `neo-spawner`
- `for-turret`
- `for-turret-shot`
- `neo-wasp`
- `neo-wasp-part`
- `volcanox-scenes`
- `volcanox-mood`
- `volcano-scenes`
- `volcano-mood`
- `volcano-obs`
- `volcano-obs2`
- `chain-physics`
- `rigid-body-plat`
- `volcano-part`
- `flamer-lava`
- `flitter`
- `spiky-frog`
- `flut-wild`
- `target-indax`
- `target-indax-hang`
- `mantis`
- `volcanox-obs`
- `spyder`
- `wcar-faccar`
- `mhcity-obs2`
- `mhcity-part`
- `mhcity-obs`
- `dm-mine-spider`
- `rapid-gunner`
- `stadium-mood`
- `stadium-scenes`
- `stadiuma-mood`
- `stadiuma-part`
- `kanga-lizard`
- `marauder`
- `arena-scenes`
- `wasstada-mood`
- `wasstada-obs`
- `wasstada-part`
- `wasstadb-obs`
- `wasstadc-obs`
- `dm-flyer`
- `maker-part`
- `maker-projectile`
- `skeet-part`
- `wascity-turret`
- `wasgun-h`
- `wasgun-hud`
- `wasgun-manager`
- `nav-graph-h`
- `traffic-engine-h`
- `waswide-init`
- `cty-borrow-manager-h`
- `cty-borrow-manager`
- `desert-part`
- `height-map-h`
- `height-map`
- `traffic-height-map`
- `vehicle-control`
- `hvehicle-h`
- `hvehicle`
- `hvehicle-effects`
- `hvehicle-physics`
- `hvehicle-util`
- `glider-h`
- `glider-hud`
- `glider-manager`
- `glider-ring`
- `glider-ring-part`
- `h-glider`
- `hanga-init`
- `was-pre-game`
- `was-leaper-race`
- `flut-racer`
- `desert-scenes`
- `desert-lizard-h`
- `desert-lizard-task`
- `desert-lizard`
- `throne-scenes`
- `waspal-mood`
- `waspala-obs`
- `waspala-part`
- `deswalk-obs`
- `deswalk-part`
- `terraformer-drone`
- `terraformer-head`
- `terraformer-part`
- `terraformer-setup`
2024-04-22 18:43:51 +02:00
ManDude 8e5830321c
[jak3] fix process stack overflow + collision renderer (#3473) 2024-04-16 04:26:01 +01:00
ManDude e601a3dcb3
[jak3] implement pckernel (#3472)
Most debug features do not work, but that's fine.
2024-04-15 19:26:48 +01:00
ManDude 20b76e318d
[jak3] remove some stubs and fix health bar (#3468) 2024-04-15 16:24:29 +01:00
Matt Dallmeyer ccd2c9eaf1
Fix bad speedrun Select pause behavior (#3464)
fixes this crap - happens if you use the Select variation of the
speedrun menu combo (hold L1+R1+X) during movies


https://github.com/open-goal/jak-project/assets/2515356/52ffe700-0662-42d5-aa7d-1d9d71bb94fb

With the changes in this PR, it now behaves as you'd expect - the same
as a normal Select pause

For reference, original changes adding the combo on Select -
https://github.com/open-goal/jak-project/pull/2196/files
2024-04-14 15:51:30 -04:00
water111 dd4f255260
[jak3] Minimap texture fix (#3465) 2024-04-13 09:47:23 -04:00
Hat Kid 36f1592b90
decomp3: lightning renderer, nav code, texture remap, fix progress menu crash (#3461)
Also adds:

- BLERC
- Minimap (with missing texture for the map, sprites work)
- Eco Mine files
- Precursor robot boss files
- Sewer files
- Vehicle files
2024-04-12 18:44:38 -04:00
water111 5299bc441f
[jak3] Fix defskelgroup (#3460)
Fixes https://github.com/open-goal/jak-project/issues/3459
2024-04-07 13:07:30 -04:00
water111 0124a0b9a1
[jak3] Support jaextern.str, stub for blue fog fix (#3455) 2024-04-07 11:09:56 -04:00
Hat Kid ae0f139667
decomp3: eye renderer and more files (#3457)
- `eye`
- `collision-editor`
- `simple-nav-sphere`
- `mech-part`
- `mech-states`
- `mech`
- `target-mech`
- `target-tube`
- `flut-part`
- `flut`
- `target-flut`
2024-04-07 10:49:45 -04:00
water111 376194a3e7
Jak 3, fixes for animation issues, rm debug print (#3453) 2024-04-06 15:09:02 -04:00
Hat Kid 23aeda1664
decomp3: add background data to pc renderers, get mood and time of day stuff running (#3450) 2024-04-06 14:27:36 -04:00
ZedB0T c5357f7ccd
Add fall back condition (#3452) 2024-04-06 12:39:02 -04:00
Hat Kid 93afb02cf4
decomp3: spawn target, add merc and particle buckets and some temporary hacks (#3445)
This includes all the collision stuff needed to spawn `target`,
decompiles the sparticle code and adds some of the PC hacks needed for
merc to run (it doesn't work quite right and looks bad, likely due to a
combination of code copied from Jak 2 and the time of day hacks).

There are a bunch of temporary hacks (see commits) in place to prevent
the game from crashing quite as much, but it is still extremely prone to
doing so due to lots of missing functions/potentially bad decomp.

---------

Co-authored-by: water <awaterford111445@gmail.com>
2024-04-05 00:07:39 -04:00
Hat Kid c96e44ab30
decomp3: support for virtual states inheriting from their own type's virtual states, gun-yellow-shot, gun-red-shot, gun-dark-shot (#3438) 2024-03-31 11:14:14 -04:00
Tyler Wilding afea4f7694
g/j1: remove the redundant graphics menu (#3421)
This was hiding options for people that only had 60hz monitors since the
two menus drifted -- it is not necessary for an entire separate menu,
just disable the option if applicable.

Don't merge this without testing it throughly
2024-03-30 20:00:53 -04:00
Hat Kid dacb704ef6
decomp3: more engine stuff, fix ja macro detection for jak 2/3, unmerged let matcher, part-tracker-spawn macro (#3436)
- `aligner`
- `effect-control`
- `pov-camera`
- `powerups`
- `los-control-h`
- `airlock`
- `water-anim`
- `blocking-plane`
- `proc-focusable-spawner`
- `idle-control`
- `enemy-h`
- `nav-enemy-h`
- `enemy`
- `enemy-states`
- `particle-curves`
- `base-plat`
- `plat`
- `bouncer`
- `elevator`
- `rigid-body`
- `rigid-body-queue`
- `process-taskable`
- `scene-actor`
- `warp-gate`
- `guard-projectile`
- `metalhead-projectile`
- `los-control`
- `joint-exploder`
- `ragdoll-test`
- `debris`
- `shield-sphere`
- `text`
- `target-launch`
2024-03-30 10:28:02 -04:00
water111 ee015e3b22
[jak3] A bunch of small fixes to get game.cgo to load (#3435)
The `test-play` macro is back, though it doesn't call `play` yet. We can
at least load all of `game.cgo`, which involves loading a lot of the
code we've decompiled, loading/linking objects files compiled by
OpenGOAL (like dir-tpages), and loading/linking Jak's art-groups (for
jak 3 they are stored v5 format that I added to the linker).

There were no major issues - just a few forgotten mips2c entries and
minor bugs/functions that needed stubs. Most of the work was updating
the linker. Hopefully I'll never have to touch that code again - I think
it supports everything we need for jak 3!
2024-03-24 16:30:28 -04:00
water111 9b4b54978a
decomp drawable, main (#3434) 2024-03-24 12:27:04 -04:00
water111 ffe01a352d
Decompile level (#3433) 2024-03-23 13:03:01 -04:00
Hat Kid 99866cec88
decomp3: more engine files, get-texture macro, use print method in autogenerated inspect, fix bitfield float print (#3432)
- `fma-sphere`
- `prim-beam-h`
- `cam-start`
- `ragdoll`
- `light-trails-h`
- `light-trails`
- `menu`
- `water`
- `water-flow`
- `hud`
- `hud-classes`
- `progress`
- `progress-draw`

---

The `get-texture` macro replaces calls to `lookup-texture-by-id` and
`lookup-texture-by-id-fast`. The `defpart` macro detection was modified
to print a pair like `(texture-name tpage-name)` for the texture field
that gets turned into a `texture-id` constant. Only used in Jak 3 at the
moment, I'll probably go through the other games at a later point.
2024-03-23 09:25:11 -04:00
water111 ea4820356c
Decompile tfrag, tie, prim (#3429)
These still need to be ported to PC.
2024-03-17 13:32:05 -04:00
water111 f7bfc8cab1
Decompile font, decomp, background, shrubbery (#3428) 2024-03-16 20:25:30 -04:00
water111 13def9a8b2
Decompile foreground and bones (#3427)
Small fix to decompiler when the original compiler uses `ra` register.
This seems to happen in "normal" code very rarely - perhaps they
manually specified this in an `rlet`.

Start figuring out buckets/textures for Jak 3.

The foreground code is not yet modified for PC - I want to wait until
the game is running, since it is too hard to do it now.
2024-03-16 14:50:41 -04:00
Brent Hickey df2f3da321
[goal] Add labels, break, and continue to loops (#3426)
Uses (block) and (return-from) to support (break) and (continue) with
labeling

Supports `(while) (until) (dotimes) (countdown) (loop) (doarray)`

Test cases:
``` lisp
(dotimes (i 5)
    (when (= i 2)
        (break)
    )
    (format #t "i: ~D~%" i)
)
;; Output:
;; i: 0
;; i: 1

(dotimes (i 5)
    (when (= i 2)
        (continue)
    )
    (format #t "i: ~D~%" i)
)
;; Output:
;; i: 0
;; i: 1
;; i: 3
;; i: 4

(dotimes (i 3)
    (when (= i 2)
        (continue)
    )
    (format #t "outer: ~D~%" i)
    (dotimes (i 3)
        (when (= i 0)
            (continue)
        )
        (format #t "inner: ~D~%" i)
    )
)
;; Output:
;; outer: 0
;; inner: 1
;; inner: 2
;; outer: 1
;; inner: 1
;; inner: 2

(dotimes (i 5) :label outer
    (when (= i 2)
        (continue :from outer)
    )
    (format #t "outer: ~D~%" i)
    (dotimes (i 3)
        (when (= i 1)
            (continue :from outer)
        )
        (format #t "inner: ~D~%" i)
    )
)
;; Output:
;; outer: 0
;; inner: 0
;; outer: 1
;; inner: 0
;; outer: 3
;; inner: 0
;; outer: 4
;; inner: 0

(dotimes (i 5) :label outer
    (when (= i 2)
        (continue :from outer)
    )
    (format #t "outer: ~D~%" i)
    (dotimes (i 3)
        (when (= i 0)
            (break :from outer)
        )
        (format #t "inner: ~D~%" i)
    )
)
;; Output:
;; outer: 0

(dotimes (i 5) :label outer
    (when (= i 2)
        (continue :from outer)
    )
    (format #t "outer2: ~D~%" i)
    (dotimes (i 3)
        (when (= i 1)
            (break)
        )
        (format #t "inner2: ~D~%" i)
    )
)
;; Output:
;; outer2: 0
;; inner2: 0
;; outer2: 1
;; inner2: 0
;; outer2: 3
;; inner2: 0
;; outer2: 4
;; inner2: 0

(countdown (i 5)
    (when (= i 2)
        (continue)
    )
    (format #t "i: ~D~%" i)
)
;; Output: 
;; i: 4
;; i: 3
;; i: 1
;; i: 0

(let ((i 0))
    (while (< i 5)
        (when (= i 1)
            (break)
        )
        (format #t "i: ~D~%" i)
        (1+! i)
    )
)
;; Output: 
;; i: 0

(let ((i 0))
    (until (> i 5) :label outer
        (loop
            (break :from outer)
        )
        (format #t "i: ~D~%" i)
        (1+! i)
    )
)
;; Output:
;; nothing

(define *array* (new 'global 'boxed-array uint32 3))
(doarray (i *array*)
   (break)
   (format #t "doarray")
)
;; Output:
;; nothing

(doarray (i *array*) :label arrayloop
    (dotimes (i 5)
        (when (= i 2)
            (continue :from arrayloop)
        )
        (format #t "i: ~D~%" i)
    )
    (format #t "doarray~%")
)
;; Output:
;; i: 0
;; i: 1
;; i: 0
;; i: 1
;; i: 0
;; i: 1
```
2024-03-16 14:47:36 -04:00
water111 82fb2cc26a
Port bones.gc math to GOAL (#3425)
Reverse engineer the skinning matrix calculation and port to GOAL. This
is about 3x faster than the MIPS2c version.

As usual, there is a `*use-new-bones*` flag to go back to the old
version.

Fix for a bug in the compiler's `.div.vf` implementation (only happens
if src/dst are the same), and fix for a typo in the register allocator
that would sometimes cause it not to consider xmm8-xmm15.
2024-03-15 20:31:11 -04:00
Hat Kid 5a8b4e81f9
decomp3: more engine stuff, support boxed stack arrays in compiler (#3424)
- `sync-info`
- `trajectory`
- `camera`
- `cam-update`
- `cam-states`
- `cam-states-dbg`
- `cam-master`
- `cam-layout`
- `cam-interface`
- `cam-combiner`

Closes #2016
2024-03-15 20:28:26 -04:00
water111 fae20a19fc
[jak3] Decompile sprite and debug files (#3420) 2024-03-10 21:11:41 -04:00
Tyler Wilding d9d09a8bc2
g/j2: Update some vehicle related naming (#3419)
While looking into https://github.com/open-goal/jak-project/issues/3289
I renamed a few things
2024-03-09 19:30:44 -05:00
Tyler Wilding 4ca84f9a97
d/j3: ensure type-tests pass (#3414)
Make this test run in CI as the game is not done yet, CI in master is
failing because something was missed (forward declaration)
2024-03-09 14:45:57 -05:00
Tyler Wilding 62fa9d80e1
Fix minor issues related to the speedrunner mode menu, also stop saving the pc-settings every frame when sr mode is on (#3413)
Fixes #3209
2024-03-09 14:45:49 -05:00
water111 390a511055
[jak3] Decompile sprite (#3412)
Decompile `sprite.gc`. Also update the DMA macro for a small change in
Jak 3: a check to see if nothing was added to the bucket.
2024-03-09 12:14:12 -05:00
Tyler Wilding 0626862a8c
Fix issues with camera movement with controller when mouse tracking is also enabled (#3409)
Fixes #3408
2024-03-07 23:35:38 -05:00
ManDude 7b926b5283
jak2 pckernel: save pc-settings on cheat progress and regular auto-saves (#3396)
Fixes #3392
2024-03-04 02:10:03 +00:00
water111 9f55e41146
[joint] fix missing matrix interpolation (#3394)
I was missing one of the ways that the joint animation was interpolated.
In particular - the `matrix` that defines the root position of the
object.
2024-03-03 15:15:37 -05:00
Hat Kid 2969833b2d
decomp3: more engine stuff, detect non-virtual state inheritance (#3377)
- `speech`
- `ambient`
- `water-h`
- `vol-h`
- `generic-obs`
- `carry-h`
- `pilot-h`
- `board-h`
- `gun-h`
- `flut-h`
- `indax-h`
- `lightjak-h`
- `darkjak-h`
- `target-util`
- `history`
- `collide-reaction-target`
- `logic-target`
- `sidekick`
- `projectile`
- `voicebox`
- `ragdoll-edit`
- most of `ragdoll` (not added to gsrc yet)
- `curves`
- `find-nearest`
- `lightjak-wings`
- `target-handler`
- `target-anim`
- `target`
- `target2`
- `target-swim`
- `target-lightjak`
- `target-invisible`
- `target-death`
- `target-gun`
- `gun-util`
- `board-util`
- `target-board`
- `board-states`
- `mech-h`
- `vol`
- `vent`
- `viewer`
- `gem-pool`
- `collectables`
- `crates`
- `secrets-menu`

Additionally:

- Detection of non-virtual state inheritance
- Added a config file that allows overriding the process stack size set
by `stack-size-set!` calls
- Fix for integer multiplication with `r0`
- Fixed detection for the following macros:
	- `static-attack-info`
- `defpart` and `defpartgroup` (probably still needs adjustments, uses
Jak 2 implementation at the moment)
- `sound-play` (Jak 3 seems to always call `sound-play-by-name` with a
`sound-group` of 0, so the macro has been temporarily defaulted to use
that)

One somewhat significant change made here that should be noted is that
the return type of `process::init-from-entity!` was changed to `object`.
I've been thinking about this for a while, since it looks a bit nicer
without the `(none)` at the end and I have recently encountered init
methods that early return `0`.
2024-03-03 15:15:27 -05:00
ZedB0T 6822e5cc71
Fix (-> *autosplit-info-jak1* training-num-orbs) when blacked out (#3297)
When loading a save, these values are temporarily 0, and it messes with
the autosplitter so we want to ignore them then.
2024-02-28 19:14:50 -05:00
Tyler Wilding ccd47f8465
formatter: Format deftype correctly (#3391)
New configuration options to format column widths in deftype field
definitions. Also force each field/method/state to be inlined.
2024-02-27 20:12:44 -05:00
Tyler Wilding 5eeaffcde0
scripts: new linter script to detect goal_src files with trailing whitespace (#3387)
Removes trailing whitespace from goal_src files, eventually the
formatter will do this as well but it's not ready yet so this is a
decent interim solution.

A competent text editor will also do this / flag it for you.
2024-02-24 14:27:56 -05:00
Tyler Wilding db66ae4627
g/j2: Dynamic speedrun mode categories and implement a significant amount of a practice mode (#3378)
For example, `AppData/OpenGOAL/jak2/features/speedrun-categories.json`
is defined as such:
```json
[
  {
    "cheats": 0,
    "completed_task": 0,
    "continue_point_name": "",
    "features": 0,
    "forbidden_features": 992,
    "name": "Gunless",
    "secrets": 0
  },
  {
    "cheats": 1,
    "completed_task": 29,
    "continue_point_name": "ctypal-shaft",
    "features": 1024,
    "forbidden_features": 0,
    "name": "Turbo Jetboard - After Praxis 1",
    "secrets": 0
  }
]
```
> These entries can be created using the in-game menu as well.


https://github.com/open-goal/jak-project/assets/13153231/9b17a116-4aa9-40ad-b9f5-02b04e0ad4f3

---------

Co-authored-by: dallmeyer <2515356+dallmeyer@users.noreply.github.com>
2024-02-23 19:04:44 -05:00