Commit graph

1169 commits

Author SHA1 Message Date
ManDude cf048a9e37
small cleanup to progress-draw.gc and set-font-color (#2653) 2023-05-15 20:45:28 +01:00
ManDude e30ecb361f
small jak 2 bug fixes (#2649)
- elec gates now always render at max quality if you have PS2 lods
disabled. the original render distances are so low that the one in
caspad is impossible to see in normal gameplay.
- `fort-entry-gate-11` and `com-airlock-outer-13` are specifically
banned from the all actors hack because they are placed in a bad spot
and Naughty Dog did not program the airlocks very well.
- fixed NPC talk distance being bad for 1 frame.
- fix `sew-scare-grunt` erroneously keeping its spool anim active if you
killed the enemy.
2023-05-15 17:26:25 +01:00
Hat Kid 2e9aa1f962
jak1: add back money starburst (#2650) 2023-05-15 13:06:49 +02:00
ManDude 01aa67798f
fix racer hud regression (#2648)
Fixes #2643
2023-05-15 03:18:02 +01:00
Tyler Wilding 08b9a631dc
New Crowdin updates (#2645) 2023-05-14 01:28:13 -04:00
Tyler Wilding 88517ef0c3
i18n: Lookup untranslated strings from a fallback language (english) instead of displaying Unknown... (#2637) 2023-05-14 00:53:27 -04:00
Hat Kid 8f742471a6
jak1: fix regression with npc NaNs (#2642) 2023-05-11 19:17:26 +02:00
water111 b79f28fe07
[jak2] combined shadow work PR (#2632)
This PR is a combination of
https://github.com/open-goal/jak-project/pull/2507 and some additional
changes to port Shadow VU1 to OpenGL. As far as I can tell, it's
working.

---------

Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
2023-05-07 12:12:21 -04:00
ManDude acae62c919
fix blit size being wrong most of the time (#2620) 2023-05-05 02:31:27 +01:00
ManDude 6884b0f73e
start blit-displays decomp & renderer + improve decompilation of some DMA macros (#2616)
Adds sprite distort, fixes buggy sprite rendering in progress, adds
scissoring support (used in various scrolling menus) and a very basic
implementation of `blit-displays`. This is enough to make the fade
effect in the progress menu work, along with all the menus working
properly without needing to use the REPL. This does not make screen
flipping and the filter when failing a mission work.

Added support in the decompiler for detecting `dma-buffer-add-gs-set`
and `dma-buffer-add-gs-set-flusha` and updated all of the Jak 2 code to
use it. Readability improved!

Fixes decompiler issue with `with-dma-buffer-add-bucket` not inlining
forms which broke syntax. Fixes store error warnings showing up for
non-existent stores, there is now a dedicated pass for this at the end.

I started work on making `BITBLTBUF` stuff work in the DirectRenderer,
but stopped for now because it wasn't strictly necessary. It will still
assert like before.
2023-05-04 18:34:09 -04:00
Hat Kid 3ce2edf4b6
decomp: ctywide-speech (#2612) 2023-05-03 09:09:39 +02:00
water111 ef23fecd90
[goalc] default to non-immediate lambdas if not requested (#2604)
This fixes a long time issue with `lambda`. The `lambda` is a bit
overloaded in OpenGOAL: it's used in the implementation of `let`, and
also to define local anonymous functions.

```
(defmacro let (bindings &rest body)
  `((lambda :inline #t ,(apply first bindings) ,@body)
    ,@(apply second bindings)))
```

```
(defmacro defun (name bindings &rest body)
  (let ((docstring ""))
    (when (and (> (length body) 1) (string? (first body)))
      (set! docstring (first body))
      (set! body (cdr body)))
    `(define ,name ,docstring (lambda :name ,name ,bindings ,@body))))
```

In the first case of a `let`, a `return` from inside the `let` should
return from the functioning containing the `let`, not the scope of the
`lambda`. In the second case, we should return from the lambda. The way
we told the different between these cases was if the `lambda` was used
"immeidately", in the head of an expression (like it would be for the
`let` macro). But, this falsely triggers when an anonymous function is
used immediately: eg
```
((lambda () (return #f)))
```
should generate and call a real x86 function that returns immediately.

This should fix some death/mission failed stuff in jak 2.
2023-04-30 19:00:27 -04:00
ManDude 34b4020569
alternate method for scaling screen warp effects with aspect ratio (#2603)
Changes the scaling method used for the fort turret cam and under cam
effects. It should be more "accurate" now while not getting nauseating.
2023-04-30 23:12:20 +01:00
ZedB0T 9bed693533
Initial Jak 2 Autosplit Support (#2239)
Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
Co-authored-by: Tyler Wilding <xTVaser@users.noreply.github.com>
2023-04-30 17:38:05 -04:00
water111 5c9aa3facd
[jak2] try to speed up compile a bit (#2596) 2023-04-30 14:13:52 -04:00
Tyler Wilding cb1daa032c
g/j2: remove temporary hack to allow the avalanche to play (#2599)
No longer needed after the latest changes in the overlord PR that
recently merged.

Fixes #2509
2023-04-30 18:58:45 +01:00
ManDude 19899f6e5a
[jak2] Fix temp stacks being created outside process stack (#2595)
Somehow this was only causing issues (afaik) with
`draw-decoration-load-save` getting corrupted, perhaps because other
processes either use the shared dram stack or the gigantic spr stack.
2023-04-30 12:17:42 -04:00
ManDude b37f255066
fix minimap stretch (#2593) 2023-04-30 04:23:56 +01:00
ManDude d67b95c68f
allow quoting :key symbols + further optimize defpart (#2592)
This should hopefully improve build times in general, especially for
files with `defpart`.
2023-04-30 02:46:14 +01:00
ManDude 44193caef0
[jak2] more specific cutscene detection (#2590)
Fixes some instances of the camera entering cutscene mode when we don't
want that.
2023-04-30 01:23:53 +01:00
ManDude bc30e00b2f
attempting to slightly optimize defpart (#2587) 2023-04-29 22:28:07 +01:00
Tyler Wilding 5e987cc0e2
jak2: overlord rework (#2544)
Fixes #2545
Fixes #2546
Fixes #2547
Fixes #2548
Fixes #2549
Fixes #2550
Fixes #2551
Fixes #2552
Fixes #2553
Fixes #2554
Fixes #2555
Fixes #2556
Fixes #2557
Fixes #2558
Fixes #2559
Fixes #2560
Fixes #2561
Fixes #2562
Fixes #2563
Fixes #2564
Fixes #2565
Fixes #2567
Fixes #2566
Fixes #2568
Fixes #2569
Fixes #2570
Fixes #2522
Fixes #2571

---------

Co-authored-by: water <awaterford111445@gmail.com>
Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
Co-authored-by: ManDude <7569514+ManDude@users.noreply.github.com>
2023-04-29 16:13:57 -04:00
ManDude 0d3e272876
fix many instances of bad bone data being used (#2580)
Fixes cutscenes starting way too early and various cutscene softlocks.

Fixes #2579
Fixes #2577 

Supersedes #2578
2023-04-29 11:13:56 -04:00
Hat Kid aff67d6bb7
jak2: fix warp effect for robotank and underb on other aspect ratios (#2574) 2023-04-29 11:03:13 -04:00
ManDude 0ce5835818
Create a new format for particle definitions (defpart) (#2572)
Updates the decompiler for the new format and there's new macros. This
new format should be easier to read/parse.

Also rewrote `sp-init-fields!` (both jak 1 and 2) from assembly to GOAL.

Hopefully I did not miss any regressions in Jak 1/2 while updating the
files, it's a lot.
2023-04-29 11:01:47 -04:00
Hat Kid 77123652b9
jak2: fix 3d hud elements not drawing (#2527)
The skull gem is not moving, but I'm assuming that's a texture
animation.

![image](https://user-images.githubusercontent.com/6624576/232855762-6c296419-a8b3-47b6-a02f-ab7079f145c6.png)
2023-04-25 18:57:38 -04:00
ManDude d84859e431
Fix bad lsack level borrow (#2540)
Fixes crash when completing city side missions with
`city-krew-collection-introduction` open.

Fixes #2539
2023-04-24 15:49:30 +01:00
ManDude 21b902cddf
Do not swap between clocks for airlocks speed (#2537)
Fixes crash at the end of various missions.

Fixes #2456
2023-04-24 01:53:40 +01:00
ManDude 4cc3430073
fix some decomp types and get rid of in-game frame time perception (#2535) 2023-04-24 00:21:12 +01:00
ManDude c44256144e
[jak2] bring other version fixes to source (#2528)
- [x] compare NTSC-K
- [x] compare NTSC-J
- [x] compare PAL
- [x] figure out version order
- [x] ~~write delta patch for spanish text~~ no need for now

Fixes #2530
2023-04-23 20:11:08 +01:00
Tyler Wilding 47d85f896e
d/jak2: temp fix for rewarding orbs from talker speeches (#2523) 2023-04-17 23:04:16 -04:00
Tyler Wilding 57508009df
d/jak2: decompile missing function in whack (#2521) 2023-04-17 22:26:46 -04:00
Tyler Wilding 138b1729ad
d/jak2: fix dig-sinking-plats in dig3 (#2519) 2023-04-17 21:20:54 -04:00
water111 9ba86c8b6a
more generic fixes (#2515)
Fixes issue where warp effect looks wrong near the edge of the screen -
there was an unhandled `REGION_CLAMP` texture setting.

Fixes a potential bug where "warp page" things wouldn't be drawn at all
because there is no PC warp bucket. Unclear if anything actually fits
this category, but it doesn't hurt.

Turn on PC-format texture uploads for the water page so the precursor
guy uses the right texture. It has to use generic because it abuses the
generic death query thing to spawn particles.

Workaround for some issues with rebuilding level files after changing
engine files. Not a perfect solution, but probably good enough.
2023-04-17 13:53:38 -04:00
Tyler Wilding bacacc0f99
g/j2: temporarily disable some gui-control code to fix rock avalanche (#2510)
Related to https://github.com/open-goal/jak-project/issues/2509
2023-04-17 13:52:49 -04:00
ManDude 7a0048872a
[jak2] Disable envmap hack if warp effect is enabled (#2511) 2023-04-17 06:10:51 +01:00
ManDude 50d93a3f79
update collision renderer for jak 2 (#2508)
Doesn't actually do anything in Jak 2 because the collide mesh isn't
extracted, but the functionality is all there. Also updated the renderer
a bit to keep the colors more readable.
2023-04-16 22:56:19 -04:00
water111 a27083f4ee
[jak 2] Add generic and warp (#2495) 2023-04-16 18:05:35 -04:00
ManDude ba12d804f7
jak 2 memcard support (#2482) 2023-04-14 20:39:58 +01:00
ManDude e004780f73
add a toggle for faster airlocks and elevators and enable by default (#2478) 2023-04-14 07:53:14 +01:00
ManDude 7d11c6e100
fix jak 2 text encoding/decoding + minor decomp type fixes (#2476)
Now all text in all non-Korean languages is built correctly.
2023-04-14 02:09:12 +01:00
water111 1f4872b25d
[jak2] fix hitting enemies after they die (#2475)
Closes #2473 

The return type of a method was wrong.
2023-04-12 20:43:04 -04:00
water111 6b6a565d1a
[jak2] more nav-related nan fixes (#2472)
Fixes citizens that disappear (permanently) when being pushed into a
"wall" which is the border of a nav mesh that is exactly aligned with
coordinate axes.
2023-04-12 19:43:31 -04:00
water111 7b2322777a
[jak2] fix disappearing guard (#2470)
This bug feels very similar to punch glitch, where code worked on PS2
only because some value didn't reach exactly 1.0 or 0.0 with ps2-style
floating rounding. It might be better to track down the source of the
"only 1.0 on PC" value, rather than patching downstream code to handle
it, but I can't easily find it in this case - there's a lot of code that
touches this heading value. (it's also possible this bug happens on ps2,
but the result is the guard appears to face the wrong direction, rather
than disappearing).

Detailed debug notes:
Ran a process that just calls this function:
```
(defun print-guard-info ()
  (let ((proc (process-by-name "crimson-guard-level-42" *active-pool*)))
    (when proc
      (format *stdcon* "PROC: ~A~%" (-> proc state))
      (let* ((pd (the process-drawable proc))
             (css (-> pd node-list))
             (cs (-> css data 15))
             )
        (format *stdcon* "joint: ~A~%" (-> cs joint))
        (format *stdcon* "pos: ~`vector`P~%" (-> cs bone position))
        )
      )
    )
  )
```
it prints out the state, and the bone position for some bone that
happens to be on the upper body. It goes to NaN when the upper half
disappears, in the state `tazer-hostile`.

Modified the code in this state to call this function in a bunch of
places:
```
(defun guard-nan-debug ((guard process-drawable) (info string))
  (when (string= (-> guard name) "crimson-guard-level-42")
    (format 0 "[guard-nan] ~S : ~`vector`P~%" info (-> guard node-list data 15 bone position))
    )
  )
```
which prints the bone position to stdout.

This shows that the problem happens after `post`, but before `trans`:
```
[guard-nan] post-end : #<vector 2723306.0000  269921.0312  388825.2187       1.0000 @ #x1f1350>
[guard-nan] trans-start : #<vector          NaN          NaN          NaN          NaN @ #x1f1350>
```
this is probably as part of the bone math.

To check, I added some prints to `execute-math-engine`, before and after
the call to `do-joint-math`:
```
[guard-nan-math] pre-math : #<vector 2722236.5000  268609.5312  385339.9062       1.0000 @ #x1f1350>
[guard-nan-math] post-math : #<vector          NaN          NaN          NaN          NaN @ #x1f1350>
```

The first part of `do-joint-math` is calling the
`generate-frame-function`, which does animation blending to compute a
bunch of joint transforms. I dumped these:
```
              (let ((jaf (the-as joint-anim-frame (+ 2400 (scratchpad-object int)))))
                (format 0 "generate frame:~%")
                (format 0 "~`matrix`I~%" (-> jaf matrices 0))
                (format 0 "~`matrix`I~%" (-> jaf matrices 1))
                (dotimes (i (-> obj mgeo num-joints))
                  (format 0 "~`transformq`P~%" (-> jaf data i))
                  )
                )
```
and confirmed that they always look good.

The next part is "prebind", which allows something to modify the
`joint-anim-frame`. Nothing does this on the guard.

The next part is what I've named the "root bind", which computes the
transform of the root bone based on the process-drawable root's
position.

```
                (when (the-as (function cspace transformq none) t9-3)
                    (when *djm-debug* (format 0 "djm: first bind func ptrs #x~X #x~X~%" cspace<-transformq! t9-3))
                    (when *djm-debug* (format 0 "djm: first bind func input: ~`transformq`P~%" (-> v1-20 param1)))

                    ((the-as (function object object object none) t9-3) v1-20 (-> v1-20 param1) (-> v1-20 param2))
                    (when *djm-debug* (format 0 "djm: first bind func result:~%~`matrix`I~%" (-> v1-20 bone transform)))

                    )
```
in this case, the first print confirms that we're using
`cspace<-transformq!` as the root binding function.

When the guard entirely disappears, it is caused by the root of the
process drawable having NaNs as its `quat`:
```
djm: first bind func input: #<transformq @ #x1f04f0
		trans:2724817.7500  262144.0000  388891.1875       1.0000 
		quat:           NaN          NaN          NaN          NaN 
		scale:      1.0000       1.0000       1.0000       1.0000>
djm: first bind func result:
[001f0e70] matrix
	[         NaN] [         NaN] [         NaN] [         NaN]
	[         NaN] [         NaN] [         NaN] [         NaN]
	[         NaN] [         NaN] [         NaN] [         NaN]
	[2724817.7500] [ 262144.0000] [ 388891.1875] [      1.0000]
```

After this, it's possible to get the lower half of the guard to return,
but I believe the real problem is this first `quat` being NaN. Then the
nans probably spread everywhere.

So now we now to look for the `(-> guard root quat)` becoming NaN:
```
(defun guard-nan-debug ((guard process-drawable) (info string))
  (when (string= (-> guard name) "crimson-guard-level-42")
    (format 0 "[guard-nan] ~S : ~`vector`P~%" info (-> guard root quat))
    )
  )
```

and we see this happens in post somewhere
```
[guard-nan] post-start : #<vector       0.0000      -1.0000       0.0000       0.0000 @ #x1f0500>
[guard-nan] post-end : #<vector          NaN          NaN          NaN          NaN @ #x1f0500>
```

Looking at individual methods
```
[guard-nan] before-142 : #<vector       0.0000      -1.0000       0.0000       0.0000 @ #x1f0500>
            heading: #<vector       0.0000       0.0000      -1.0000       0.0000 @ #x3432670>
[guard-nan] before-143 : #<vector          NaN          NaN          NaN          NaN @ #x1f0500>
            heading: #<vector       0.0000       0.0000      -1.0000       0.0000 @ #x3432670>
```
It looks like the problem is converting this heading to a quaternion.
2023-04-11 20:03:40 -04:00
Tyler Wilding 10ac78200b
repl: add gameVersionFolder to repl-config for running the non-default version (#2463)
Adds a decent way to customize the folders the project file expects the
iso data and decompiler data to be in. When you run any version other
than the default, for example Jak 1 PAL, it uses the `gameName`
decompiler config to consume and output it's results.

However the project file will assume `jak1` unless you hard-code it
differently -- basically, it needs to be explicitly told just the
decompiler is told what version to use.

We now have a per-user REPL Config json file, so that can be used to
override the default `jak1` behaviour.

Fixes #1993
2023-04-11 17:57:20 -04:00
ManDude 59e0c5e264
decomp bigmap (#2460)
Probably the last major missing file.

The bigmap fetches the correct level and map info, but doesn't actually
render anything right now.


![image](https://user-images.githubusercontent.com/7569514/230701921-e3fde09e-9faa-4725-b7e6-5a02a77346bd.png)

![image](https://user-images.githubusercontent.com/7569514/230701928-fbe0847b-b79a-4275-83ec-b9c1d847d17d.png)
2023-04-08 20:30:27 +01:00
ManDude 332326268a
make directrenderer in sprite work + rename game-text-id to text-id + move pc debug settings (#2459) 2023-04-08 04:32:35 +01:00
water111 15ab5d704d
fix alpha blend bit for jak 1 merc (#2458)
This fixes the sculptor's face shield and red rings on final boss.
2023-04-05 18:56:48 -04:00
Hat Kid f4085a4362
jak1: clean up all dummy methods (#2457)
Cleans up every `dummy-*` and `TODO-RENAME-*` method up with either
proper names or by renaming them to `[type-name]-method-[method-id]`
similar to Jak 2's `all-types`.

Also fixes the bad format string in `collide-cache` and adds the event
handler hack to Jak 1.

The game boots and runs fine, but I might have missed a PAL patch or
other manual patches here and there, please double-check if possible.
2023-04-05 18:41:05 -04:00
ZedB0T 366808d2f9
add a temporary gui-control hack to make boulder chase mission completable (#2455)
add a temporary gui-control hack to make boulder chase mission
completable
2023-04-05 18:23:55 -04:00
Hat Kid 37af812785
jak2: add some temporary gui-control hacks to make missions completable (#2454) 2023-04-03 23:02:38 +02:00
ManDude 6f1cb2a0a9
fix repl buffer overrun + use a different port for each game version (#2449)
Fixes #2313
2023-04-02 05:57:21 +01:00
Tyler Wilding 3c22eb061f
d/jak2: helldog (#2445)
The last of the missions that had a missing file.

I manually fixed some casting related to a `handle->process`, since this
is the last file...whatever not worth stressing about. But probably an
issue that will crop up in the future.

Co-authored-by: water <awaterford111445@gmail.com>
2023-03-31 18:38:34 -04:00
manuelx98 2c98c5a6e0
Italian subtitles (WIP) (#1568)
Draft until all the english subtitles are finished.
Many things still in WIP and everything is subject to change.

TODO:

* [x]  intro
* [x]  sidekick
* [x]  oracle
* [x]  training
* [x]  village1
* [x]  beach
* [x]  jungle
* [x]  misty
* [x]  firecanyon
* [x]  village2
* [x]  swamp
* [x]  rolling
* [x]  sunken
* [x]  ogre
* [x]  village3
* [x]  snowy
* [x]  spidercave
* [x]  lavatube
* [x]  citadel
* [x]  finalboss
_____________
* [x]  default
_____________
* [x]  timings
* [x]  game_text_it.gs

---------

Co-authored-by: pex93 <44973506+pex93@users.noreply.github.com>
Co-authored-by: OngakuGH <107898664+OngakuGH@users.noreply.github.com>
Co-authored-by: Vas0sky <13967613+Vas0sky@users.noreply.github.com>
Co-authored-by: XedoIT <107510301+XedoIT@users.noreply.github.com>
Co-authored-by: XedoIT <ciccio0152@gmail.com>
Co-authored-by: ManDude <7569514+ManDude@users.noreply.github.com>
2023-03-31 18:34:19 -04:00
Hat Kid 318c76775c
decomp: shuttle (#2444) 2023-03-31 18:17:47 -04:00
water111 57b5117cae
[jak2] decomp neon-baron-part, fix merc fog disable (#2443)
- decompile `neon-baron-part`, which also has the hideout door for some
reason
- improve a few error messages in static data decompilation
- fix bug with disabling fog in merc
2023-03-31 17:47:38 -04:00
ManDude 577382ad34
minor cleanup + update fmt + fix some jak 2 visual anomalies (#2442)
Disables the fog hack for Jak 2, where it's not useful and kind of
breaks in most levels which rely on dark vertices that aren't underwater
(e.g. city windows).
2023-03-30 17:49:07 -04:00
water111 976e08fe97
[jak2] add vortex renderer (#2441)
Add the vortex renderer. The vortex texture isn't there yet (it uses the
same texture as clouds), so it uses a checkerboard. But the
colors/vertices seem right.
2023-03-29 20:28:48 -04:00
ManDude 013a4f4612
[jak2] entity debug improvements and add a hack to make airlocks faster because we can + fix defend stadium (#2432) 2023-03-27 02:55:16 +01:00
water111 0b021d1be1
[jak2] fix nav typo (#2430)
add -> multiply.

Fixes https://github.com/open-goal/jak-project/issues/2429
2023-03-26 18:41:59 -04:00
water111 d208ceddce
[jak2] fix enter-state and sprite crash (#2428)
Fixes https://github.com/open-goal/jak-project/issues/2426 and other
sprite crashes with the `HUD` address assert.
Doesn't fix the other sprite issues.

Fixes https://github.com/open-goal/jak-project/issues/2427

Also removes the old sprite renderer, which doesn't work.
2023-03-26 15:41:10 -04:00
water111 9e087cbfcb
[jak2] a few small graphics fixes (#2424)
- better handling of the `disable-fog` settings for merc, should fix the
spotlights. There's a setting in the merc effect, and also a runtime
flag for the draw-control. I'm not actually sure what reads these, but
the draw-control one is definitely used to disable fog on the
spotlights.
- increase merc draw limit to try to fix the issue about partially drawn
citizens in the city
- remove useless debug prints (it's okay to die in init, and the medium
load buffer size mode is understood now)
2023-03-26 12:30:35 -04:00
ManDude 7170db51ea
fix bad defpartgroup decomp and improve entity debug display a bit (#2423)
- Makes very nasty bugs fixed in #2402 print onscreen when detected
instead of to the console.

![image](https://user-images.githubusercontent.com/7569514/227754516-d508376e-8b23-4af6-bc44-e4d33d586e17.png)
- Fixes `valid?` decomp
- Moves `entity-debug.gc` to the end of `COMMON.CGO` so we can check for
keys in a few more commonly-used actor types.
- Entity debug display (jak 2) now properly parses the `art-name` tag of
part spawners, which gets overwritten at runtime.
- Fixes #2422 . Decompiler was writing out part group rotation for the
scale part, so all of those part groups had a zero in one (or all) of
the axes. This "only" affected 38 groups, including all of the flame
pots in tomb, jetpack guard, wasp, onin tent seal of mar, dark eco pill
and a few other things.

![image](https://cdn.discordapp.com/attachments/995787558816595968/1089395776880390174/image.png)

![image](https://cdn.discordapp.com/attachments/995787558816595968/1089395777253671013/image.png)
2023-03-26 05:13:54 +01:00
water111 58654ce60b
[jak2] Fix degrees conversion for particle rotation (#2413)
Hopefully this will fix all the rotated particles
2023-03-25 18:01:43 -04:00
ManDude cc16f62428
[jak2] fix bad actors using unloaded types (#2402)
Actors that use types from a level that got unloaded should now get
killed immediately instead of continuing to exist and eventually crash
the game.

NOTE: Will spam the console whenever a bad actor tries to spawn. I would
like to document all instances of where this happens!
2023-03-24 07:18:43 +00:00
ManDude f56e807d75
[jak2] fix speed for spool anim hack (#2401)
Recent subtraction compiler bug fix exposed this.
2023-03-23 20:01:13 +00:00
ManDude 2e34514ee5
[jak2] increase size of DMA buffers + potentially fix print buffer bug (#2398)
The actor heap size was increased but not the DMA buffer because I
forgot.
2023-03-23 01:15:07 +00:00
ManDude 3b666beae2
[jak2] implement abandon-thread (#2396)
implements `abandon-thread` for when we want to return from a thread,
but are in a `post` thread which normally disallows this.
2023-03-23 00:41:51 +00:00
water111 b7fc7383b7
[jak2] fix dark things (#2393) 2023-03-22 20:09:50 -04:00
ManDude 217a979048
[decompiler] jak 2 cutscene file support (#2390)
fixes #2332 

also fills out the japanese character set
2023-03-22 21:31:13 +00:00
water111 df646282ab
[jak 2] fix texture lookup problem (#2373)
This should fix a bunch of texture-related issues by generating a table
of overlapping textures and just... adjusting them slightly so they
don't overlap. It's not the most elegant solution in the world, but I
think it's no worse than the existing hard-coded tpage dir stuff.
2023-03-21 19:41:14 -04:00
water111 f276251a3a
[jak1] use etie (#2329)
Use Jak 2's etie to render shiny background things.

To switch back to the old one:
```
(set! *use-etie* #f)
```
and also uncheck this box

![image](https://user-images.githubusercontent.com/48171810/226119270-8d1b8233-bc5f-4bc1-a09b-a6d3183ba2a4.png)
(same for `l1`)
2023-03-20 19:12:33 -04:00
ManDude d1260a0c0b
[jak2] double load dgo workaround (#2331)
fixes #2282
2023-03-19 20:30:23 +00:00
ManDude d46f790973
[jak2] un-hardcode level-related code a bit (#2330)
Makes it less of a headache to change level amounts.
2023-03-19 05:33:04 +00:00
ManDude 198c8e1946
[jak2] improve debugging tools for entity lights and regions (#2327)
also fixes some other random bugs
2023-03-18 06:29:40 +00:00
water111 2fa4a23ea1
[jak 2] ETIE (#2326)
Definitely needs a clean up pass, but I think the functionality is very
close.

There's a few "hacks" still:
- I am using the emerc logic for environment mapping, which doesn't care
about the length of the normals. I can't figure out how the normal
scaling worked in etie. I want to do a little bit more experimentation
with this before merging.
- There is some part about adgifs for TIE and ETIE that I don't
understand. The clearly correct behavior of TIE/ETIE is that the alpha
settings from the adgif shader are overwritten by the settings from the
renderer. But I can't figure out how this happens in all cases.
- Fade out is completely disabled. I think this is fine because the
performance difference isn't bad. But if you are comparing screenshots
with PCSX2, it will make things look a tiny bit different.
2023-03-17 20:35:26 -04:00
ManDude 6670124296
[jak2] use loop to make bucket renderers (less error-prone) (#2324) 2023-03-17 20:10:06 +00:00
Hat Kid a857061e96
jak2: focus-test? macro, fix (zero? (logand ...)) -> (not (logtest? ...)) detection (#2321)
There are *a lot* of file changes and while I have carefully gone
through every gsrc change to fix up manual patches, there might still be
spots that I missed.
2023-03-14 22:57:31 -04:00
ZedB0T 9a28cc5a79
Add a autosplit-flag-task-complete! macro (#2317)
Cuts out a little bit of repetition in the autosplit code. Also adds
some labels to the VS configurations.


090c497799/goal_src/jak1/pc/features/autosplit-h.gc (L167-L169)
2023-03-14 17:56:58 -04:00
ManDude 0cf285ef99
[jak2] decomp cleanup of traffic things + fix stadium crash (#2319) 2023-03-11 22:45:14 +00:00
ManDude 0c64d48b0d
[jak2] force-envmap? hack (#2316)
Also affects texscroll and ripple, but I'm not sure what would be good
places to test those.
2023-03-11 22:13:55 +00:00
Hat Kid a1dee19d0d
decomp: finish stadium-obs (#2294)
Co-authored-by: water <awaterford111445@gmail.com>
2023-03-11 15:55:39 -05:00
ManDude 77242bd12e
[jak2] script-eval macro (#2315)
turns
```lisp
      (eval! (new 'stack 'script-context (process->ppointer self) self (the-as vector #f)) '(teleport))
      (eval! (new 'stack 'script-context (process->ppointer self) self (the-as vector #f)) (-> arg0 on-goto))
```
into
```lisp
      (script-eval '(teleport))
      (script-eval (-> arg0 on-goto))
```
2023-03-11 10:45:16 -05:00
ManDude 70452a753f
[jak1] fix game-save debug printing (#2314) 2023-03-10 22:02:04 +00:00
ManDude 93992795f9
[jak1] disable auto-save-check (#2312)
Fixes unnecessary performance degradation when auto-save is enabled.
2023-03-10 05:22:50 +00:00
ManDude 3ce7f59989
[jak1] fix concerning game-save bug (#2311)
Not really sure if this actually caused any issues in-game, but better
safe thatn sorry.
2023-03-10 03:47:35 +00:00
ManDude 9cb2963cde
add debug joint renderer (#2309) 2023-03-10 03:12:44 +00:00
water111 9c7b86c595
[jak2] fix blerc profile bar issue (#2307)
Fix so the profile bar doesn't do something silly when
`merc-blend-shape` returns early, skipping the part where `end-time` is
set.
2023-03-10 02:10:43 +00:00
Tyler Wilding 021bae08ec
d/jak2: fix elevator issues and cleanup script-context new method (#2304)
This fixes the issue where elevators leave you behind (stack structure
related)

At the same time I cleaned up some things I found along the way, most
notably changing `script-context`'s `basic` field to `object` as
non-basics use this method as well.

Fixes #2305
2023-03-09 20:03:43 -05:00
water111 0db9b288e4
[merc2] Support texscroll, use in jak 1 in more places, fix envmap bug (#2303)
Three main changes:

- Adds support for the texture scrolling effect used on conveyor belts,
and turn it on for jak 2.
- Use merc instead of generic in jak 1 for ripple/water/texscroll stuff
(non-ocean water, lava, dark eco, etc). This is a pretty big speedup in
a lot of places.
- Fix a really old bug with blending mode used to draw environment maps.
The effect is that envmaps were half as bright as they should have been.

As usual, there's a flag to go back to the old behavior on jak 1. Set
these to `#t` to use generic like we used to.
```
*texscroll-force-generic*
*ripple-force-generic*
```

The format has changed, and everything must be rebuilt (C++, FR3's, GOAL
code)
2023-03-09 20:01:22 -05:00
Tyler Wilding 6d99f1bfc1
d/config: re-organize decompiler/config and eliminate most of the duplication (#2185)
Reasons for doing so include:
1. This should stop the confusion around editing the wrong config file's
flags -- when for example, extracting a level. Common settings can be in
one central place, with bespoke overrides being provided for each
version
2. Less verbose way of supporting multiple game versions. You don't have
to duplicate the entire `type_casts` file for example, just add or
override the json objects required.
3. Makes the folder structure consistent, Jak 1's `all-types` is now in
a `jak1` folder, etc.
2023-03-08 20:07:26 -05:00
water111 0b8b927315
[merc] support eyes through merc (#2300)
Support rendering eyes with merc for both jak 1 and jak 2.

For jak 1, everything should look the same, but merc will be used to
draw eyes. This means that jak is now fully drawn with merc!

For jak 2, eyes should draw, but there are still a few issues:
- the tbp/clut ptr trick is used a lot for these eye textures, so
there's a lot that use the wrong texture
- I had to enable a bunch more "texture uploads" (basically emulating
the ps2 texture system) in order to get the eyes to upload. It would be
much better if the eye renderer could somehow grab the texture from the
merc model info, skipping the vram addressing stuff entirely. I plan to
return to this.
- I disabled some sky draws in `sky-tng`. After turning on pris2
uploads, the sky flashed in a really annoying way.
2023-03-08 18:18:35 -05:00
ZedB0T 43da4088e6
Fix Bombbot crash (#2296) 2023-02-28 20:39:57 +01:00
water111 d6bd437ea1
[merc] support up to 64 effects (#2292) 2023-02-27 21:02:47 -05:00
water111 2c12a4e00b
[jak2] WIP minimap (#2280)
Work in progress minimap. Known issues:
- "path finding" doesn't appear to work - it gets stuck forever in many
cases
- some nasty patches around timer-based code
- jak arrow blending issues
- would be nice to make it higher resolution

if the search is forced to terminate due to iteration/time limits, the
icon is not in the right place

![image](https://user-images.githubusercontent.com/48171810/221432792-678d6124-a6a6-4875-a91f-7eceedbfec98.png)
2023-02-27 19:51:14 -05:00
ManDude 1d0a5ade8d
[jak2] minor decomp cleanup + add force actors and sprite pc hacks (#2291)
I didn't actually visually notice much of a difference with these hacks
unlike in Jak 1, but I also avoided checking the missions thoroughly
since the game crashes very often right now.
2023-02-28 00:35:57 +00:00
Tyler Wilding c3310e1833
docs: fix method docstrings and grab @file comment blocks to use as a file description (#2289) 2023-02-27 18:58:01 -05:00
Hat Kid adf929d18d
decomp: ruf-*, jinx-*, mog-*, grim-*, hosehead-* files, gun-buoy (#2279) 2023-02-27 18:53:57 -05:00
ManDude e1e6695e92
[jak2] merc lod hacks + region debugger + make level heap less massive (#2285) 2023-02-27 18:45:32 +00:00
Hat Kid 736a3a8b7c
jak2: fix jellyfish crash and temporarily disable underwater warp (#2270)
Fix crash when the game tries to spawn `jellyfish` in Underport and
temporarily disable the rendering of the warp effect until it's properly
implemented.
2023-02-26 17:24:05 -05:00
ManDude 63ff337169
[jak2] fix crash with *print-column* loading the wrong memory (#2281)
`inspect` also prints with the correct indent now as a result.
2023-02-26 21:04:05 +00:00
Matt Dallmeyer 9b80bca589
Add Speedrun Category Extensions (#2195) 2023-02-26 13:42:24 -05:00
water111 e48ae247c4
[jak2] fix palace rotation and sprite glow depth test (#2269)
- Disable depth test for sprite glow (VU1 programs only `sq.xy` and
leaves `z` alone, which has Z_MAX from the template)
- Fix tfrag/tie/shrub issues when `use-camera-other` is set.
2023-02-26 09:52:04 -05:00
Tyler Wilding 90d5e83d9e
d/jak2: finish forest-obs (#2266) 2023-02-26 09:49:16 -05:00
ManDude 190fa4bbe8
[windows] make the games start up in the user's preferred system UI language (#2267)
Where applicable, of course.

My system language is set to English so I actually can't test this. If
anyone has their Windows language (NOT LOCALE) set to Spanish, German,
French, Italian or Japanese please test this.

Fixes #1734 

Also fixes the opengoal debugger on Windows and fixes the decomp for
`menu` which was causing some crashes related to input handling.
2023-02-26 09:46:57 -05:00
water111 928dbebee4
[jak2] fix highly aggressive guard zoomer ambush (#2264)
`*alert-level-settings*` was actually an inline array and we were
indexing past the end of it.
I think this will fix some of the strange on-foot guard behavior too.
2023-02-26 01:31:21 -05:00
water111 8a363c2fc9
[jak2] fix foreground light calculation (#2254)
Fixes the abrupt change in lighting when walking around here

![image](https://user-images.githubusercontent.com/48171810/221382856-17f0ec18-1ce8-40f9-b65c-a59cf2d7d93f.png)
2023-02-25 17:55:55 -05:00
water111 3f1f443d58
[jak 2] fix boot, increase level heap sizes (#2252)
Increase level heaps and borrow heaps. The level heap increase was
likely not needed, but better safe than sorry. We allocate the 128 MB
main heap anyway so there's no harm.

Also fix the crash when using `-boot`. As I thought it was just a
one-line typo in the kernel.
2023-02-25 15:20:17 -05:00
ManDude ad9a532ff9
[jak2] text aspect ratio fixes (#2251)
Fixes the aspect ratio of the font renderer (Jak 2 does not need the
same hacks as Jak 1), the custom letterbox/pillarbox sizes and fixes the
heap display.

---------

Co-authored-by: water <awaterford111445@gmail.com>
2023-02-25 19:27:58 +00:00
water111 909da024fc
[decomp] ctywide-obs (#2250)
finish this up
2023-02-25 14:00:16 -05:00
ManDude 4b8b2abbed
port pckernel to Jak 2 (#2248)
Adds the `pckernel` system to Jak 2, allowing you to do the PC-specific
things that Jak 1 lets you do like change game resolution, etc.

In other to reduce the amount of code duplication for something that
we're gonna be changing a lot over time, I split it into a few more code
files. In this new system, `pckernel-h.gc`, `pckernel-common.gc`
(previously `pckernel.gc`) and `pc-debug-common.gc` are the files that
should be shared across all games (I hacked the Jak 2 project to pull
these files from the Jak 1 folder), while `pckernel-impl.gc`,
`pckernel.gc` and `pc-debug-methods.gc` are their respective
game-specific counterparts that should be loaded after. I'm not fully
happy with this, I think it's slightly messy, but it cleanly separates
code that should be game-specific and not accidentally copied around and
code that should be the same for all games anyway.
2023-02-25 10:19:32 -05:00
Matt Dallmeyer e89f0770dc
Fix Jak 2 warp gates (#2244) 2023-02-24 19:33:27 +01:00
Hat Kid 2d8ad39fea
jak2: add back some pc port debugging tools and add palace-scenes to gsrc (#2240)
Ports some of the custom PC port debugging code from Jak 1, such as the
entity debugger, Anim Tester X and part tester, to Jak 2 and gives the
PC menu code the same treatment Jak 1 received recently in #2216.
Some adjustments have been made to make things work in Jak 2 and some
stuff is still incomplete.
The majority of the default PC menu code has been left commented out in
preparation for @ManDude's plan to port the rest of the Jak 1 `pckernel`
features to Jak 2.

Also adds the code for `palace-scenes` to gsrc as that seems to have
been missed.
2023-02-23 21:39:02 +00:00
Dillon Pentz 66c680e8a3
[jak2] fix rare civilian flee crash (#2230)
Fixes a rare crash that can sometimes happen when civilians are picking
a direction to flee in, where a branch count may be 0, causing a divide
by 0 MATH_EXCEPTION.
2023-02-21 01:30:09 -05:00
water111 08ce65fd9b
[jak2] add sprite glow renderer (#2232)
Adds the "sprite glow" renderer, which is responsible for the glowing
lights.
2023-02-20 20:25:45 -05:00
Matt Dallmeyer f388898d7b
Speedrun verification text cleanup (#2229)
We only draw this text to the screen if we're in speedrunner mode
anyway, so the `#t` flag on this line doesn't really add any value imo

b130b2eac2/goal_src/jak1/pc/features/speedruns.gc (L248-L255)


![image](https://user-images.githubusercontent.com/2515356/220177466-4ecb8376-7953-4161-a6ca-a300b6978d3e.png)
2023-02-20 19:49:57 -05:00
Tyler Wilding 39658dfd71
docs: Automatically generate documentation from goal_src code (#2214)
This automatically generates documentation from goal_src docstrings,
think doxygen/java-docs/rust docs/etc. It mostly supports everything
already, but here are the following things that aren't yet complete:
- file descriptions
- high-level documentation to go along with this (think pure markdown
docs describing overall systems that would be co-located in goal_src for
organizational purposes)
- enums
- states
- std-lib functions (all have empty strings right now for docs anyway)

The job of the new `gen-docs` function is solely to generate a bunch of
JSON data which should give you everything you need to generate some
decent documentation (outputting markdown/html/pdf/etc). It is not it's
responsibility to do that nice formatting -- this is by design to
intentionally delegate that responsibility elsewhere. Side-note, this is
about 12-15MB of minified json for jak 2 so far :)

In our normal "goal_src has changed" action -- we will generate this
data, and the website can download it -- use the information to generate
the documentation at build time -- and it will be included in the site.
Likewise, if we wanted to include docs along with releases for offline
viewing, we could do so in a similar fashion (just write a formatting
script to generate said documentation).

Lastly this work somewhat paves the way for doing more interesting
things in the LSP like:
- whats the docstring for this symbol?
- autocompleting function arguments
- type checking function arguments
- where is this symbol defined?
- etc

Fixes #2215
2023-02-20 19:49:37 -05:00
Matt Dallmeyer b130b2eac2
Redundant (declare-file (debug)) (#2226)
Just noticed this while looking into #2225 , this line is repeated a few
lines later

b9cd17b20a/goal_src/jak1/engine/camera/cam-layout.gc (L8-L13)
2023-02-18 17:26:33 -05:00
water111 b9cd17b20a
[jak1] fix crash on startup (#2225) 2023-02-18 17:19:22 -05:00
Hat Kid d946a09a99
decomp: palcab-obs (#2222)
Co-authored-by: water <awaterford111445@gmail.com>
2023-02-18 15:59:34 -05:00
water111 b7cfd80b14
set up fog for jak 2 (#2223)
![image](https://user-images.githubusercontent.com/48171810/219878142-8ad7c154-9f52-4ad8-a315-1c932e24cd4b.png)
2023-02-18 15:45:13 -05:00
Hat Kid f452a504e6
decomp: race-* files (#2224) 2023-02-18 15:45:00 -05:00
Hat Kid d65d6233d9
decomp: kidesc-*|crocesc-* files, ash4-course (#2219)
Co-authored-by: water <awaterford111445@gmail.com>
2023-02-18 11:01:24 -05:00
Hat Kid 7a2575fd23
decomp: meet-brutter (#2218) 2023-02-18 10:30:29 -05:00
Matt Dallmeyer 4c812658f1
Easier combo for Speedrun Options (#2196)
Some people have complained about the button combo for entering the
speedrun menu, saying it's awkward to press Start.

This change lets you press Select instead (while holding L1+R1+X). The
old combo (pressing Start) still works as well.
2023-02-18 09:51:26 -05:00
ManDude ee3bc182e1
[jak1] force credits to use audio language instead of text language (#2220) 2023-02-14 20:12:45 +00:00
ManDude 324def1303
split new pc features in some files into their own code files + address some old issues + ripple graphics improvements (#2216)
Moves PC-specific entity and debug menu things to `entity-debug.gc` and
`default-menu-pc.gc` respectively and makes `(declare-file (debug))`
work as it should (no need to wrap the entire file in `(when
*debug-segment*` now!).

Also changes the DGO descriptor format so that it's less verbose. It
might break custom levels, but the format change is very simple so it
should not be difficult for anyone to update to the new format. Sadly,
you lose the completely useless ability to use DGO object names that
don't match the source file name. The horror!

I've also gone ahead and expanded the force envmap option to also force
the ripple effect to be active. I did not notice any performance or
visual drawbacks from this. Gets rid of some distracting LOD and some
water pools appearing super flat (and pitch back for dark eco).

Fixes #1424
2023-02-13 21:39:14 +00:00
water111 ed38adc2a7
[tie] support per-proto visibility flags (#2212)
Jak 2 adds a feature to disable protos in TIE. It's used to hide things
like steps for a future mission in ruins, and also to hide the static
version of the tower when it switches to the merc version for the
cutscene:


![image](https://user-images.githubusercontent.com/48171810/218270077-d8c52235-ddbf-4194-80f6-b8aa1eeeb7ec.png)
2023-02-11 12:00:05 -05:00
Hat Kid 7afa583bff
decomp: metalkor-* files (#2211)
Manual patches:

- `metalkor-egg-reaction`: Rewrote `(.mula.s)`

---------

Co-authored-by: water <awaterford111445@gmail.com>
2023-02-11 09:34:31 -05:00
Hat Kid 3f5898b5c2
decomp: castle-baron (#2208)
Manual patches:

`(trans idle krew-boss)`: `collide-shape` array created on the stack
changed to `(pointer collide-shape)`

---------

Co-authored-by: water <awaterford111445@gmail.com>
2023-02-11 09:24:40 -05:00
Hat Kid cd655ea916
jak2: fix drill-eggs crash (#2209)
Closes #2210
2023-02-11 09:08:08 -05:00
water111 e26efcc4f3
[jak 2] add lightning renderer (#2203)
Implements the jak 2 lightning renderer as an alternate path through
Generic2. Also set up some generic stuff in the goal code.

There is a problem with the texture pool, which doesn't support the case
where two textures have the same tbp, but different cluts. So lightning
is often the wrong color (usually red).
2023-02-09 19:11:13 -05:00
Tyler Wilding 65812f722c
d/jak2: seal-at-waterslums working, and do a pass through all missions (#2199)
I did a pass through all missions, fixing issues as they came up. Also
got `seal-at-waterslums` working -- the best mission in the game 🥳

Co-authored-by: water <awaterford111445@gmail.com>
2023-02-09 18:40:01 -05:00
Hat Kid 67d4eda169
decomp: hover-* files, wasp, crimson-guard-hover, flamer, target-turret, drill-turret, jellyfish (#2198)
Manual patches:

- `drill-turret`: The static data for `*turret-13-path*`,
`*turret-14-path*` and `*turret-15-path*` was decompiled by hand and the
integers in the `set-speed-mult` events have been replaced with boxed
integer arrays that contain only that integer in order to make the
compiler happy. To that effect, the event handler in `target-turret` was
changed to access that array instead of just accessing the int.
- `hover-nav-control`: In `hover-nav-control::10`, `arg2` is usually a
`vector`, but there are some places where it is called with `#t` as
`arg2` and, subsequently, crashes the game because it tries to access
the `quad` of `arg2` if `arg2` is truthy. To mitigate this, the
condition `arg2` has been replaced with `(and (!= arg2 #t) arg2)` (in
this case, it would jump to the `else` that just resets the `dest-vel`
and `transv` `quad`s)
- `drill-baron`: The static data for `*drill-ship-turret-speed-event*`
has been decompiled by hand.

TODOs:
- Jellyfish crash the game
- Destroying the metalhead eggs that are on the breakable wall crashes
the game (already happened with the Peacemaker before)
- Figure out why static data of type `turret-path-event` doesn't
decompile

The docs for all the hover-nav and nav-network code could use some love
in the future, I'm not smart enough to figure out what any of that code
actually means, but it seems to work...

Also threw in the fix for the ▲ that was accidentally left commented
out.
2023-02-09 18:22:56 -05:00
Hat Kid 4ee402984f
decomp: citizen-* files, metalhead-* files, civilian, guard, hal3-course (#2194)
No more ghost town!

Manual patches:

- `hal3-course`: In `(anon-function 17 hal3-course)`, the decompiler is
doing something strange with `s3-0` that fails to compile, so I just
removed the `set!` and inlined the condition in the `when`.
- `guard`: Rewrote `(.mula.s)` stuff
2023-02-07 19:56:06 -05:00
Matt Dallmeyer fc5c75534d
Autosplitter - add per-level fly & orb counts (#2192)
Adds fields to the autosplit struct for the number of orbs and scout
flies collected in each level. This can be used for autosplitting on
orb/fly counts

Tested together with https://github.com/open-goal/speedrunning/pull/8


[autosplit_orbs.mp4](https://user-images.githubusercontent.com/2515356/216900730-92b7b947-cc4a-4629-b7f2-1dc10248c9e9.mp4)

[autosplit_fly.mp4](https://user-images.githubusercontent.com/2515356/216900759-e3042426-7cb0-4cb9-ae05-9c44827df6a0.mp4)


![image](https://user-images.githubusercontent.com/2515356/216901323-ffae97c8-3557-45f8-91db-cd86d76dd498.png)

![image](https://user-images.githubusercontent.com/2515356/216901026-59eb3fb6-281d-489d-a50c-010760246072.png)
2023-02-07 19:41:48 -05:00
water111 45f7770ca2
[decomp] finish up nav-graph, traffic-engine, traffic-manager, height-map (#2191)
Some of these were almost done, just needed a few more types.
2023-02-05 18:16:58 -05:00
Tyler Wilding a83bd49426
d/jak2: finish onin-game and resolve type-hinting (array object) elements (#2188)
Fixes https://github.com/open-goal/jak-project/issues/2047
2023-02-04 20:36:30 -05:00
ChillyPepper fd6d59cd88
Jak2 decomp/hover formation (#2028)
This is a WIP while I'm learning the ins and outs of decompilation, but
putting up what I have for 2 reasons:

- Hoping someone can double check I'm on the right path (all functions
have signatures, all reasonably safe guesses for types have been put in,
using "object" for type where they're not)
- Might be blocked by not being able to run the offline-tests as a PAL
scrub

I'm going to look at what might be involved in making tests work for
PAL, but wouldn't be surprised if I have to wait to get a black label
version and come back to this after :(

---------

Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2023-02-04 20:03:46 -05:00
Luminar Light 89feb5d0f1
Create Hungarian translation of game text for Jak 1 (#2141)
This will probably take a while, since we also have to translate all the
text of the base game - Naughty Dog never translated this game to
Hungarian. This PR will stay a draft until it is complete.

We realized that every letter in our alphabet was already working, apart
from two: Ő and Ű (they are unique sounds, so leaving their marks
wouldn't be okay).
Since I did not find that double accent thing in the jak font, I decided
to use ~ (see my change in FontUtils.cpp). It is good enough, and my
memory tells me that I already saw this exact same "solution"
(workaround) somewhere in the past. If anyone knows a better solution,
please let us know.

We chose ID 14 for the Hungarian language, as it was the lowest free ID.

**Progress tracker**
A tick here means that everything was translated. It does not mean that
everything is perfect yet. We will review everything multiple times, to
have the best translations possible.

Game text:
- [x] base game text
- [x] pc port text
- [ ] credits text ?

[Sziloyoo](https://github.com/Sziloyoo) helped with reviewing my
changes, and gave advice/suggestions for some complicated translations.

Subtitles will be done in the future, not in this PR.
2023-02-04 20:01:22 -05:00
Matt Dallmeyer 2c5e456571
Minor fix for Rock Village IL speedrun (#2187) 2023-02-02 21:51:28 -05:00
water111 65eef8ff26
[jak2] pc-hook for pris texture upload (#2184)
Fixes a bunch of hud textures:


![image](https://user-images.githubusercontent.com/48171810/215919174-b6ff9af7-0408-4e97-b142-0fbbeafa196a.png)
2023-01-31 20:36:07 -05:00
Tyler Wilding b72383964f
d/jak2: cleaning up the remainder of unblocked / unclaimed files (#2171)
Co-authored-by: water <awaterford111445@gmail.com>
2023-01-31 18:32:50 -05:00
water111 71cb1aef6f
[merc2] support vertex updates, use this for blerc in jak 1 and jak 2 (#2179)
This PR adds a feature to merc2 to update vertices. This will be needed
to efficient do effects like blerc/ripple/texture scroll. It's enabled
for blerc in jak 1 and jak 2, but with a few disclaimers:
- currently we still use the mips2c blerc implementation, which is slow
and has some "jittering" because of integer precision. When porting to
PC, there was an additional synchronization problem because blerc
overwrites the merc data as its being read by the renderers. I _think_
this wasn't an issue on PS2 because the blerc dma is higher priority
than the VIF1 DMA, but I'm not certain. Either way, I had to add a mutex
for this on PC to avoid very slight flickering/gaps. This isn't ideal
for performance, but still beats generic by a significant amount in
every place I tested. If you see merc taking 2ms to draw, it is likely
because it is stuck waiting on blerc to finish. This will go away once
blerc itself is ported to C++.
- in jak 1, we end up using generic in some cases where we could use
merc. In particular maia in village3 hut. This will be fixed later once
we can use merc in more places. I don't want to mess with the
merc/generic selection logic when we're hopefully going to get rid of it
soon.
- There is no support for ripple or texture scroll. These use generic on
jak 1, and remain broken on jak 2.
- Like with `emerc`, jak 1 has a toggle to go back to the old behavior
`*blerc-hack*`.
- In most cases, toggling this causes no visual differences. One
exception is Gol's teeth. I believe this is caused by texture coordinate
rounding issues, where generic has an additional float -> int -> float
compared to PC merc. It is very hard to notice so I'm not going to worry
about it.
2023-01-31 18:23:39 -05:00
Tyler Wilding 22bae7fbe0
g/jak2: Add missing DGO files to game.gp lost in the shuffle (#2178)
When I cleaned up the `game.gp` some DGOs were no longer referenced
because my first dependency script omitted them -- thinking they weren't
required. From the perspective of the source files they indeed weren't
required but we still have to produce the DGO file.

also works around #2177
2023-01-30 20:45:45 -05:00
Matt Dallmeyer 2645fed47a
Jak 1 Checkpoint Select / IL Speedrun support (#2162) 2023-01-30 19:11:57 -05:00
Tyler Wilding 3d097e69e1
jak2: significantly reduce the verbosity of the game.gp file (#2103) 2023-01-28 20:15:58 -05:00
Tyler Wilding 18507bc78e
d/jak2: get portrun working and decompile a bunch of miscellaneous files (#2169) 2023-01-28 19:36:57 -05:00
Tyler Wilding 4876b6af21
g/jak2: cleanup target-board a bit, add a new feature (#2154) 2023-01-28 18:44:29 -05:00
Hat Kid be035181f0
decomp: squid-* files (#2170)
Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2023-01-28 18:44:10 -05:00
Tyler Wilding e6f55b9b55
d/jak2: decompile all *-texture files except castle-texture (#2149)
Fixes https://github.com/open-goal/jak-project/issues/2051
2023-01-28 17:37:37 -05:00
Hat Kid 8b21a55906
decomp: blerc, ripple, under-* files (#2163)
Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2023-01-28 16:02:58 -05:00
Hat Kid e0ee9b6a81
decomp: drill-obs, drill-obs2, drillmid-obs, drill-panel, drill-spool (#2152)
Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2023-01-28 15:41:48 -05:00
Hat Kid fa8c789dcd
decomp: eye (#2148) 2023-01-28 15:17:49 -05:00
Tyler Wilding fc3f4da370
scripts: update gsrc files with modifications using git merge (#2164) 2023-01-28 14:19:04 -05:00
ZedB0T 3b1e99cd3f
Hook Jak 1 into ImGUI actor filter (#2157) 2023-01-28 14:17:43 -05:00
ManDude 42780e8f8c
Fix a few errors in the entity debugger (#2166) 2023-01-27 22:50:54 +00:00
ManDude 213f3bad20
Add extended environment mapping option to progress and enable it by default + other bug fixes (#2161)
![image](https://user-images.githubusercontent.com/7569514/214192592-d584e955-9d54-4092-94ee-1cbe12b071e8.png)

Note: if you had the option disabled, it will be enabled when you first
start the game again. You will have to turn it off again if you want it
disabled.

Also fixes #2150 and fixes #1738 and fixes #2145
2023-01-24 20:22:47 +00:00
water111 f3526652ee
disable emerc for title effect (#2156) 2023-01-22 18:55:06 -05:00
water111 0fcc7eb8e9
[merc2] Support emerc (#2147)
This adds environment mapping support to `Merc2`, and turns it on for
Jak 1 and Jak 2.

- The performance is much better
- Jak 1 can be toggled back to the old behavior with `(set! *emerc-hack*
#f)`. The new environment mapping is identical to the old one everywhere
I checked.
- Jak 1 still falls back to generic for ripple/texscroll/blerc/eyes -
there's still no dynamic texture or vertex updating support. The eye
detection stuff will sometimes flag stuff as eyes which is not eyes,
which is fine, but means that generic will be used in some places where
emerc could be used. For example, the shiny plates on jak's arm will be
drawn with generic because jak has eyes.
- Jak 2 hasn't been checked super carefully against PCSX2 yet.
- Jak 2 still isn't technically using emerc, but instead putting emerc
models in the merc bucket.
- The interface to merc is a lot different now and totally custom
OpenGOAL DMA code. The original merc drawing asm doesn't run anymore.
- The FR3 format changed
- Something funky going on with foreground lighting in escape, but
doesn't seem to be related to this change?

Performance comparison, jak 1, in likely the most generic-merc heavy
spot:

![image](https://user-images.githubusercontent.com/48171810/213882718-feb2ab59-95a9-44a2-b0e5-95fba860c7b0.png)

![image](https://user-images.githubusercontent.com/48171810/213882736-8dbbf4c9-6bbf-4d0b-96ce-78d63274660c.png)
2023-01-22 18:30:31 -05:00
Tyler Wilding 50c57e23be
d/jak2: "finish" traffic-manager, vehicle-util and citizen-h (#2144)
Some more progress on vehicle code, the following files still remain:
- vehicle-guard (annoying stack types)
- traffic-engine (many issues, some which already have issues made for
them, other entirely new confusing things!)
2023-01-22 18:16:24 -05:00
Hat Kid 3d08d079c9
jak2: ocean renderer (#2142)
Initial implementation of the `ocean-mid`, `ocean-far` and `ocean-near`
renderers for Jak 2.

There's still a few things to sort out, mainly:

- [x] ~Backwards compatibility with Jak 1. The only thing that currently
stands in the way of that is figuring out a clean way to "un-hardcode"
the texture base pointer in C++ without creating a completely separate
`OceanTexture` class for Jak 2. One thing I thought of would be
modifying `BucketRenderer`'s virtual `init_textures` method to also pass
the `GameVersion`, but I'm not sure if there's a better way.~
- [x] ~The sudden transition from `ocean-near` to `ocean-mid`. Not sure
why it's happening or how to fix it.~
- [x] The ocean has two new methods in Jak 2, `ocean::89` and
`ocean::79`, one of which seems to be related to time of day sky colors.
~Even without them implemented, the end result looks quite close, so we
may be able to skip them?~ `ocean::89` generates `ocean-mid` envmap
textures, so it will likely be required, but will not be handled right
now.

Reverted the VU prologue removals because it made the tests fail.
2023-01-22 18:07:46 -05:00
Tyler Wilding 2ba07eb058
d/jak2: finish consite-obs and get almost all side-missions working (#2143)
Some side missions require cars, they don't work yet. Also the
ring-races and collection ones do not grant orbs. The hoaming beacon
collection one causes a `hud` crash
2023-01-22 09:31:39 -05:00
Tyler Wilding abf61a94fb
docs: add support for :override-doc in method declarations as well as documenting state handlers (#2139)
Adding support for better child-type method docstrings. This is a
problem unique to methods.

Usually, a child-type will have the same signature and a common name
will apply, but the implementation is different. This means, you
probably want a different docstring to describe what is happening.

Currently this is possible to do via `:replace`. The problem with
replace is two fold:
- a replaced method ends up in the generated `deftype`...because you
usually change the signature!
- we don't put docstrings in the `deftype` in normal GOAL, this is just
something we do for the `all-types` file (they go in the `defmethod`
instead)
- more importantly, this means anytime you now want to change the
parent's name/args/return type -- you have to apply that change
everywhere.

So this is a better design you can now just declare the method like so:
```clj
(:override-doc "my new docstring" <method_id>)
```

And internally a pseudo-replaced method will be added, but it will
inherit everything from the parent (except the docstring of course)

Unrelated - I also made all the keyword args for declaring methods not
depend on ordering

This also adds support for documenting virtual and non-virtual state
handlers. For example:

```clj
  (:states
    (part-tester-idle (:event "test") symbol))
```

or

```clj
(idle () _type_ :state (:event "test") 20)
```

I will probably add the ability to give some sort of over-view docstring
at a later date.

Co-authored-by: water <awaterford111445@gmail.com>
2023-01-21 20:45:45 -05:00
Tyler Wilding e5d6ac1c41
d/jak2: second documentation PR and finish forest-scenes and palace-scenes (#2136)
Also fixes #2135

Co-authored-by: water <awaterford111445@gmail.com>
2023-01-21 20:26:51 -05:00
Hat Kid 1d868a2bd9
decomp: kor-*|kid-*|widow-*|hal-*|atoll-* files, spyder, sniper, juicer and more (#2134)
Full list:

- `atoll-obs`
- `atoll-tank`
- `juicer`
- `sniper`
- `transport`
- `yakow`
- `kid-h`
- `kid-states`
- `kid-task`
- `kid3-course`
- `kid`
- `kor-h`
- `kor-states`
- `kor-task`
- `kor3-course`
- `kor`
- `spyder`
- `spydroid`
- `widow-baron`
- `widow-extras`
- `widow-more-extras`
- `widow2`
- `widow`
- `flying-spider`
- `mammoth`
- `mantis`
- `nest-obs`
- `hal-task`
- `hal`
- `hal3-course`

Manual patches:
- `widow`: `handle->process` stack var
- `nestb-scenes`: Commented out `nav-network` stuff, was causing crashes
in `nest`

Also fixes `ginsu` crash (`blade-part` had the wrong type)
2023-01-21 19:50:48 -05:00
Hat Kid 9889b638b3
jak2: tomb fixes (#2137) 2023-01-17 03:18:01 +01:00
water111 7d7625f4f8
[jak2] workaround for cutscene playing (#2131) 2023-01-16 13:37:29 -05:00
Luminar Light 7fdef1c509
Fix 'Load... border-mode' in default-menu (#2132)
This one was forgotten when the other similar menu entries were fixed.
So I fixed this now.
2023-01-16 13:37:16 -05:00
Tyler Wilding dd0a8a17b2
docs - first chunk of work documenting the files I glossed over (#2130)
- started documenting the files I glossed over, some are totally done,
others are just partially done
- I changed the decompiler to automatically initialize the
art-group-info from the json file. This makes updating gsrc, even a
single file at a time, have consistent naming
- Though I disabled this functionality for jak 1, as I have no idea if
using the ntsc art groups will cause a regression for different versions
- fix indentation for docstrings -- it still doesn't look great, but
this is now a formatting concern, rather than the docstring having a
bunch of happen-stance leading whitespace.
2023-01-15 11:33:39 -05:00
water111 a0d2bce27b
Minor bug fixes (#2128)
- make sure bsp is processed on `l` levels in extraction (caused missing
remaps)
- clean up a few prints in extraction
- handle the <15 byte differences in art group files automatically (no
more errors about file naming)
- fix potential exception thrown by merc2 in a few ways: fixed bad data
in FR3's, check texture index just in case, and handle exceptions a
little bit better (still a crash, but at least you get a print)
- fix mips2 ocean stuff causing ocean far crashes
2023-01-14 16:26:17 -05:00
Hat Kid 8a82c2225e
decomp: ai-task-h, whack, bot, sig, ash files (#2127)
`whack` is missing a single function (`birth-func-whack-score`) that I
couldn't figure out the right args for.

I was not able to test any of this code because I cannot get `atoll` to
extract.
2023-01-14 16:12:03 -05:00
Hat Kid 459d83f755
decomp: tomb-* files, target-indax, grunt-mech, breakable-wall, pillar-collapse, mechtest-obs, ruins-obs (#2114)
Manual patches in:

- `tomb-boulder`: a few `ppointer->handle`s (I think) were not being
decompiled properly (all used in combination with `clone-anim-once`)
- `ruins-obs`, `pillar-collapse`: `art-joint-anim` casts
- `tomb-beetle`: commented out a call to `shadow-control-method-14` that
was crashing the game when spawning the beetles
- `grunt-mech`: commented out `(.mula.s)` instruction

Notes:
- `enemy-info`'s `idle-anim-script` is most likely a `(pointer
idle-control-frame)`, however, some `nav-enemy-info` labels set it to
`#f` (first encountered in `tomb-beetle`, but also present in `hal`,
`roboguard` and `metalkor-setup`), which crashes the decompiler. This
may become a problem in the future when we eventually get to these
files. For this PR, I made `tomb-beetle` decompile with
`idle-anim-script` set to `#f` and have not noticed any issues/crashes
with that.
- `tomb-boulder` compiles and doesn't crash, but when trying to play the
Daxter chase sequence, the boulder sometimes either spawns at the origin
or spawns in the correct place, but doesn't move.

Co-authored-by: water <awaterford111445@gmail.com>
2023-01-14 13:53:31 -05:00
Tyler Wilding b072126764
d/jak2: some minor fixes and workarounds to make debugging easier (#2116)
- worked around audio code for gungame, the tutorials now function
- auto-exit cutscenes upon entry. This doesn't always work nicely (i
didnt want to cause any side-effects due to messing with load states)
but it atleast stops jak from being stuck forever waiting for the
cutscene to load
2023-01-14 12:36:41 -05:00
Tyler Wilding 8b12553d15
d/jak2: first pass at decompiling the core vehicle/traffic code (#2058)
Effects the following files:
- [x] vehicle-rider
- [x] vehicle-control
- [x] vehicle-effects
- [x] vehicle
~~- [ ] vehicle-util~~
- [x] vehicle-physics
- [x] vehicle-states
~~- [ ] vehicle-guard~~
~~- [ ] traffic-engine~~
~~- [ ] traffic-manager~~

With the exception of traffic-engine, most of these files are either
done or have 1-3 stubborn functions remaining. Draft while I try to
resolve as many as possible / cleanup names and such.

Co-authored-by: water <awaterford111445@gmail.com>
2023-01-14 12:01:33 -05:00
Tyler Wilding d6f9af7a20
d/jak2: finish strip mine files (#2111)
The level crashes similarly to drill-platform though, unclear what is
the root cause of it.

Co-authored-by: water <awaterford111445@gmail.com>
2023-01-14 11:30:58 -05:00
Tyler Wilding 88c39217e1
d/jak2: finish the remaining mountain temple related files (#2110)
There's some minor issues remaining, almost all of which pertain to
cutscene playing though.

Co-authored-by: water <awaterford111445@gmail.com>
2023-01-14 11:16:53 -05:00
water111 d65a1c365a
some bug fixes (#2125) 2023-01-14 11:04:15 -05:00
Tyler Wilding a75f4c187b
d/jak2: mostly complete sewer-enemy and sewer-board missions (#2108)
Finishes the following files:
- `sewer-scenes`
- `sewgun-turret`
- `fordumpc-part`
- `sewer-obs`
- `sewer-obs2`
- `gator`

Fixes #2052
2023-01-14 10:54:39 -05:00
Inirdin fa0f386bf0
Font colors comments (#2122) 2023-01-13 14:02:47 -05:00
water111 cb8cafa40a
[decomp] minimap (#2118) 2023-01-11 19:42:39 -05:00
Tyler Wilding f162d5ac31
d/jak2: finish wren and fish (#2106)
finish the forest's ambiance
2023-01-11 19:24:44 -05:00
water111 8dedfb682e
dig obs small fix (#2119)
was already right, goal src just needed updating.
2023-01-11 19:09:48 -05:00
Tyler Wilding e0d31a33bd
d/jak2 - initial crimson-guard-level decomp and also the dig missions (#2092)
Finishes a bunch of files related to crimson guards / early missions:
- `crimson-guard-level`
- `dig-digger`
- `fordumpa-obs`
- `fort-robotank`
- `fort-robotank-turret`
- `fort-turret`
- `transport-level`
- `fordumpb-obs`
- `fort-floor-spike`
- `fordumpc-obs`
2023-01-11 19:07:35 -05:00
EvelynTSMG 22adecc222
Make jungle mirrors respect first person camera settings (#2112)
QoL, I suppose
2023-01-11 18:16:27 -05:00
Hat Kid bdee98323d
decomp: add a bunch of enemy files (#2101)
Adds the following files:

- `amphibian`
- `centurion`
- `ginsu`
- `grenadier`
- `hopper`
- `metalmonk`
- `monster-frog`
- `predator-graph`
- `predator-h`
- `predator`
- `rapid-gunner`
- `rhino`
- `rhino-wall`
- `tomb-baby-spider`

Also adds the DGOs for the following levels:

- Mar's Tomb
- Mountain Temple
- Drill Platform
- Sacred Site (Sage Hut)

Manual patches:

- The decompiler emits `(b! #t cfg-17)` in `(trans hostile hopper)`
without putting a `(label cfg-17)` anywhere
- Added cast to `art-joint-anim` in `(code broken rhino-wall)` and
`(code hit rhino-wall)`

Other notes:

- `amphibian` seems to occasionally crash when using its tongue attack.
Haven't investigated this yet
- `ginsu` crashes after being killed somewhere in the `deactivate`
method, possibly because of its `part-spawner`
- Predators aren't spawning in the forest hunt mission, not sure if
`forest-obs` might be needed for that or if it's something else
- The `rhino-wall` STR animation seems to load (albeit a bit broken due
to missing VAG stream playback), but causes the viewport to shrink as
soon as it's played
- I added `pegasus::74` to the `event_handler_hack` bool in
`variable_naming.cpp` because I got a `none` cast after changing the
return value of `enemy::74`
2023-01-07 17:14:12 -05:00
Tyler Wilding 00ac12094e
goalc/repl: cleanup of goalc/REPL code and some QoL improvements (#2104)
- lets you split up your `startup.gc` file into two sections
  - one that runs on initial startup / reloads
  - the other that runs when you listen to a target
- allows for customization of the keybinds added a month or so ago
- removes a useless flag (--startup-cmd) and marks others for
deprecation.
- added another help prompt that lists all the keybinds and what they do

Co-authored-by: water <awaterford111445@gmail.com>
2023-01-07 11:24:02 -05:00
Tyler Wilding f699675ede
g/jak2: initial Discord RPC implementation (#2100)
Notable things:
- This assert is hit when trying to save the pc-settings file, NYI
e630b50690/game/kernel/common/Symbol4.h (L14)
so right now settings aren't persisted. But RPC defaults to on
- The existing functions can probably be made generic based off the game
version, but I didn't spend time refactoring them yet as they aren't
really ready to be used in jak 2 yet (we have no screenshots for the
levels for example)
2023-01-07 10:34:01 -05:00
water111 f50c0e56e9
[jak2] use art constants (#2097) 2023-01-07 10:32:03 -05:00
Tyler Wilding 5095b867b0
d/jak2: finish jetboard training mission (mostly) and scouts mission (#2090)
The things that aren't working right now:
- returning the board (maybe cutscene related?)
  - draft until i see if this can be sorted out
- seems to need streaming audio as well, the `scene-player` gets
properly initialized from what i can tell
- had to hack around the streaming audio parts.
2023-01-04 20:43:34 -05:00
Hat Kid 09d555b4a0
decomp: mech, mech-states, target-mech (#2091)
Everything relating to IK in `target-mech` was commented out as I
couldn't get a lambda to decompile properly, but the mech still seems to
work fine without it.

Co-authored-by: water <awaterford111445@gmail.com>
2023-01-04 19:42:26 -05:00
Ziemas f0ca0cbe6a
Overlord: mirror sound RPC command (#2094)
And replace the previous mechanism for mirroring the sound.
2023-01-04 18:22:18 -05:00
ManDude 15a8a9c8ef
add ja zero func (#2074)
fixes #2071
2023-01-02 18:23:33 +00:00
water111 77a3e4125c
[jak2] don't ignore disable-draw bits (#2089)
Same idea as what I did for jak 1, but now there's a mask that can be
set by the user. It's used on the gun course dummies, for example.
2023-01-02 13:09:30 -05:00
water111 20a6839e07
[jak2] fix hud and some particles (#2088)
Fixes:
- a very old bug in depth in DirectRenderer, probably from the original
tfrag stuff. Looked at PCSX2 source code to see how 32/24 bit depths are
handled. This fixes hud sprites being drawn behind level geometry.
- saturate `vftoi4` like the ps2 does when the float is too large,
fixing hidden text in `hud`. For now it's only using this in the font
code because this saturation is actually kinda slow and hasn't been a
problem in other places.
- fix crazy particle spawning issue with blue gun and dripping stuff.
This would happen if particles kill themselves while being processed
(through a callback)
2023-01-02 12:13:19 -05:00
water111 0e43c96e52
[decomp] hud, hud-classes, add some new basic alignment options, fix type bug (#2084) 2023-01-02 10:05:22 -05:00
Tyler Wilding 9f53edae7a
game/debugging: Add a new imgui menu to filter debug text and adjust imgui config settings (#2085)
This adds a new ImGUI menu to help filter out the clutter on screen.


https://user-images.githubusercontent.com/13153231/210192912-b1c28319-bacb-449c-ad7f-e7308fb75f50.mp4

This also:
- moves the imgui display bool into a game specific config file (you can
hide it in jak1, and not in jak2)
- the config file also persists the settings from this menu (except the
filters for now, future TODO)
- there is a new `ignore_imgui_hide_keybind` in this file to ignore
hiding it when you press Alt
2023-01-02 09:45:38 -05:00
Tyler Wilding f06fd9b9c5
lint: remove some debugging logs (#2086) 2023-01-02 01:11:05 -05:00
Tyler Wilding 284fb09997
d/jak2: decompile fodder and nav-enemy (#2080)
fixes #1983 

First functioning enemy!


https://user-images.githubusercontent.com/13153231/210184845-f1d93491-11f5-4a64-b69c-41e535992ebc.mp4
2023-01-01 21:03:07 -05:00
water111 308038a20f
[decomp] collectables, fix float bug in a few files (#2082)
Fixes https://github.com/open-goal/jak-project/issues/1931
Also decompile collectables.gc
2023-01-01 18:05:31 -05:00
Tyler Wilding 5333aa3fb2
d/jak2: finish decompiling gungame files and tomb-scenes (#2076) 2023-01-01 16:22:44 -05:00
water111 0cddf6b6a5
W/nav debugging (#2077)
Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2023-01-01 12:11:18 -05:00
Tyler Wilding 6aa15c897f
decomp: don't mutate allowed/banned object lists (#2073)
oops, leads to some very confusing behaviour
2022-12-30 23:57:01 -05:00
water111 602765db6e
[decomp] drawable, memory-usage (#2070) 2022-12-30 18:23:53 -05:00
Tyler Wilding 6406ba05a6
d/jak2: finish atoll-scenes (#2069) 2022-12-30 18:23:45 -05:00
water111 d454dfbcd8
add target-board-handler (#2068) 2022-12-30 15:23:46 -05:00
water111 f6c5504f6f
[decomp] fix up gun decomp (#2067)
I did some manual modifications in a few places to work around some
truly mysterious control flow, and some unsupported stack array stuff.

Also fixes a bug in decompiling static improper lists.

As far as I can tell, guns work, other than some graphical issues and
the crazy particle spawning issue, but I strongly suspect these are
problems with the sparticle/graphics side.
2022-12-30 14:07:32 -05:00
water111 e49e6548e0
[jak2] split up big dgos, some minor cleanup (#2066)
- Split up DGOs between threads in the multithreaded offline test
- fix some random warnings
- make the sig paths decompile a bit nicer to make some files smaller
2022-12-30 13:33:29 -05:00
Tyler Wilding 2eca614870
d/jak2: finish remaining *-h files that aren't in progress or spoken for (#2059)
This finishes off all the remaining "header" files that someone isn't
already working on.
2022-12-30 12:09:04 -05:00
Tyler Wilding fb11c162c1
jak1: fix debug menu regression around lambdas (#2065) 2022-12-27 23:04:26 -05:00
Hat Kid 98c2291102
jak2: misc fixes (#2050)
- Stub `target-board-handler` to prevent jetboard crash
- Increase stack size for `target` to fix dark bomb crash
- Uncomment some code in `target-darkjak` to make Dark Jak work (texture
morph still crashes, so it's commented out)
- Increase stack size for a `process-spawn-function` in
`target-send-attack` to fix a crash with giant Dark Jak
2022-12-22 13:59:24 -05:00
Tyler Wilding 1b2db09f51
d/jak2: pass through all simple / non-blocked *-part, *-ocean and *-scenes files (#2048)
A big one...

I figure even if we would like to change the way the particle/scene code
is output -- it'd be easier to find patterns with it all decompiled.

I've updated my script so it can easily be used to mass update these
files:
```bash
task update-gsrc-glob GLOB="**/*-part*.gc"
```
> for example will update gsrc files with `part` in their name -- if
they are in ref tests (so uncompleted ones aren't touched)

I found a few issues along the way that I'll have to make issues for
soon.
2022-12-22 13:57:57 -05:00
Ziemas 5b99929394
989snd: Support version >= 2 sound effects (#1991)
Supports most of the grain types now while maintaining compatibility
with the old stuff (at least the subset of things jak1 uses)

Would benefit from some testing in Jak 1 to make sure I didn't break
anything.

Sorry the git history is a mess, I'll do something about it later.
2022-12-02 18:08:44 -05:00
water111 80e9528e4e
lights, death, and rotation fix (#2042)
- decompile `lights.gc`
- decompile remaining `target-death` function, you can die now
- fix float issue with `matrix-from-two-vectors-smooth!` making jak face
the wrong way in the slide thing
2022-12-02 10:02:13 -05:00
Tyler Wilding 728b2689b6
d/jak2: decomp a bunch of files related to the beginning of the game (#2043)
Mostly easy / particle def files. I did a bit in `ruins` but CFG
failures and missing `drawable` functions make it untestable for now so
I've put that on pause.
2022-12-01 21:26:49 -05:00
water111 70e231fa72
[jak 2] merc (#2039) 2022-11-30 22:36:09 -05:00
Hat Kid ceebe3f7eb
decomp: target-tube (#2041) 2022-11-30 19:52:42 -05:00
water111 c983475751
[jak2] tiny fix to grunt (#2040) 2022-11-29 21:11:36 -05:00
Tyler Wilding cdb61f69f8
d/jak2: finish decompiling enemy-h | enemy | grunt and flitter (#2023) 2022-11-29 19:19:05 -05:00
Misagi c77925a8ad
French Subtitles & Game Text (#2024) 2022-11-26 18:49:23 -05:00
water111 7a1a64acba
target code bugfixes (#2034) 2022-11-21 20:25:20 -05:00
Tyler Wilding a0a85eb60a
repl: Add a few new quality of life improvements (#2030)
- You can define a `startup.gc` in your user folder, each line will be
executed on startup (deprecates the usefulness of some cli flags)
- You can define a `repl-config.json` file to override REPL settings.
Long-term this is a better approach than a bunch of CLI flags as well
- Via this, you can override the amount of time the repl will attempt to
listen for the target
- At the same time, I think i may have found why on Windows it can
sometimes take forever to timeout when the game dies, will dig into this
later
- Added some keybinds for common operations, shown here


https://user-images.githubusercontent.com/13153231/202890278-1ff2bb06-dddf-4bde-9178-aa0883799167.mp4
> builds the game, connects to it, attaches a debugger and continues,
launches it, gets the backtrace, stops the target -- all with only
keybinds.

If you want these keybinds to work inside VSCode's integrated terminal,
you need to add the following to your settings file
```json
"terminal.integrated.commandsToSkipShell": [
    "-workbench.action.quickOpen",
    "-workbench.action.quickOpenView"
  ]
```
2022-11-20 14:28:41 -05:00
water111 6298533eaa
[decomp] collide cache, other minor fixes (#2031) 2022-11-20 11:32:29 -05:00
water111 e0ebc5a68e
[decomp] target-handler (#2027) 2022-11-20 09:21:25 -05:00
Tyler Wilding bf83f2442d
d/jak2: cleanup more of editable and editable-player (#2029)
- Rough start of the SQLite integration to facilitate the SQL queries
- Cleanup and disable a little bit of code so the game no longer crashes
when entering the editor
- Implement some of the mouse data stuff


![image](https://user-images.githubusercontent.com/13153231/202881481-95bc0a2a-ac3d-4f65-aff1-b9f7ee5ee345.png)


https://user-images.githubusercontent.com/13153231/202881484-399747e7-dcdb-4e09-93e9-b561a45c8a18.mp4

This is a very old branch so best to get it merged now that it's at a
decent point so it can be iterated on.
2022-11-19 23:28:20 -05:00
water111 928b18f01c
clean up to target-handler (#2026) 2022-11-19 17:58:51 -05:00
water111 029983270e
[decomp] target cleanup (#2021)
everything up to collide-reaction-target (which is mostly done, but
could use a few more names)

Fixes issues with gun-part and target-part
2022-11-13 19:09:34 -05:00
water111 3c393845c7
[decomp] finish lightning-draw (#2019) 2022-11-13 12:05:49 -05:00
Tyler Wilding c8abafcb7a
d/jak2: partial cleanup pass from main -> gun-part (#2017) 2022-11-13 11:38:25 -05:00
water111 f39b993f79
[decommp] generic-obs (#2013) 2022-11-12 17:56:07 -05:00
Tyler Wilding 84ef64398e
d/jak2: finish process-drawable, collide-reaction-target, target-anim, almost target-part and gun-part (#2012)
- target-part
- ;; ERROR: Failed to convert to atomic ops: Variable could not be
constructed from register r0 in `process-drawable-shock-wall-effect`
- gun-part
  - missing sparticle decompiling case it seems related to `L155`

This is pretty rough but...im excited to see it working :)
2022-11-12 11:19:04 -05:00
water111 3909a251cc
[decomp] clean up some names/types (#2011)
cutting down on some of the most common `unknown` methods, before we add
too much gameplay code
2022-11-11 20:18:13 -05:00
water111 b90b6c9aff
small cleanup on camera code (#2010)
fixes https://github.com/open-goal/jak-project/issues/1960 and patches
scratchpad use in cam-debug
2022-11-11 17:27:09 -05:00
water111 b2b47eec5c
[decomp] spatial-hash (#2009) 2022-11-11 16:23:26 -05:00
water111 136136e498
[decomp] start work on collide (#2008)
Adds `collide-shape` and a few other related ones.
2022-11-11 12:01:45 -05:00
Tyler Wilding 190fe6968f
d/jak2: finish guard-projectile | metalhead-projectile | guard-conversation and start crimson-guard-level (#2006)
Related issue - https://github.com/open-goal/jak-project/issues/2005
2022-11-06 14:30:43 -05:00
Hat Kid 88eb45ab52
decomp: ocean, ocean-mid, ocean-near, ocean-texture, ocean-transition, ocean-vu0 (#1994)
The VU programs for the ocean renderer have changed a bit and
`ocean-texture` has a bunch of new stuff, otherwise things are
relatively similar to Jak 1.

This is the first time I used mips2c and I'm not sure I did it 100%
right, so that should be double-checked.
2022-10-30 19:09:35 -04:00
water111 811b5de6cb
[decomp] collide-mesh (#1999) 2022-10-30 15:54:10 -04:00
water111 8ae4829f48
[decomp] collide-hash, collide-frag, collide-probe (#1998)
The only interesting one is `collide-hash`, which is untested.
The other two are very likely unused. I skipped the annoying code in
`collide-probe` because it's not used and the same as jak 1.
2022-10-29 20:32:03 -04:00
Tyler Wilding 50076537b7
d/jak2: finish sidekick, target-carry and battle. Close to finishing target-death and warp-gate (#1990) 2022-10-29 18:27:31 -04:00
Tyler Wilding 760e11a087
d/jak2: finish scene-actor, scene-looper, race-part, rigid-body-plat, debug-part, voicebox (#1987)
Co-authored-by: water <awaterford111445@gmail.com>
2022-10-29 16:42:57 -04:00
Tyler Wilding d13155bfd0
d/jak2: Decompile palace-ocean, ctysluma-part, nav-enemy-h and a bunch of work on enemy and nav-mesh related files (#1984)
Couldn't finish any of the enemy/nav-enemy related files for one reason
or another, but quite a bit of work that will be easier to merge and
iterate on instead of keeping track of the branch.

enemy/idle-control has some very weird focus related code.

nav-mesh/nav-control still has a bunch of CFG resolution problems that
need to be manually resolved.

Co-authored-by: water <awaterford111445@gmail.com>
2022-10-29 16:28:52 -04:00
ManDude b0e8cba6f1
[decomp2] game-save (#1988)
memory card code was not done!
2022-10-29 16:08:04 -04:00
Tyler Wilding 84497712ff
d/jak2: finish task-arrow | carry-h | projectile | gun-[red|yellow|blue]-shot (#1864) 2022-10-29 15:22:57 -04:00
Xavier Siguero Mora 43b93cc204
Spanish Game Text (#1980)
Spanish subtitles are already merged, so this should be the only text
still missing for the language. The game compiles and it's playable
without problem

![imagen](https://user-images.githubusercontent.com/32161135/196548800-8eaad76d-6a16-4451-b22d-f2cb87fae6fe.png)
2022-10-22 13:26:50 -04:00
Tyler Wilding 41c3423767
d/jak2: finish viewer, texture-finish, process-taskable, main-collide, prototype and los-control (#1975) 2022-10-22 13:26:28 -04:00
water111 ddd60fca48
[decompiler] handle pointer to symbol value, clean up prints on offline test (#1978)
- fix issue described in
https://github.com/open-goal/jak-project/issues/1939
- fix `text`, which was manually patched with the wrong offset (was
reading the symbol value off by one byte)
- clean up some random useless prints
- make the offline tests keep trying if there's a comparison error,
clean up the output a bit so the diffs are all at the end.
2022-10-16 18:19:59 -04:00
Tyler Wilding e7bb0fb68d
d/jak2: decompile ambient | speech and bigmap-data (#1954)
fma-sphere not completed due to #1888
2022-10-16 18:09:15 -04:00
water111 e443676889
[decomp] sky-tng (#1972)
https://www.youtube.com/watch?v=fkAMvEYXOGc
2022-10-15 18:21:17 -04:00
Tyler Wilding fd7d9c3df5
d/jak2: finish scene (#1971)
`scene-player-init` has some weird `rtype-of` usage (mostly in the
`pair` clause)
2022-10-15 17:43:02 -04:00