Commit graph

238 commits

Author SHA1 Message Date
water111 6f244b11ef
[jak2] Work-in-progress texture animations (#2819) 2023-07-14 18:17:54 -04:00
ManDude 4185123bd8
fix mouse mispositioning when letterboxed (#2818)
Not sure if this is the best way to go about it.

Fixes #2259
2023-07-08 23:05:03 +01:00
Fabian Bergström cf295952b6
Make all project targets compile on Intel MacOS (#2780) 2023-07-01 13:30:11 -04:00
Himham e3fb7c9467
Typo fix LTT_MSG_INSEPCT (#2778)
Co-authored-by: ManDude <7569514+ManDude@users.noreply.github.com>
2023-06-29 16:45:53 -04:00
Tyler Wilding 10934f6746
d/j2: Some work on the SQL editors (#2771) 2023-06-25 16:51:46 -04:00
water111 2fc943977f
[jak2] GOAL side texture animation stuff (#2766)
It turns out we didn't decompile any of this stuff yet.
2023-06-24 10:11:47 -04:00
Tyler Wilding 679986e79f
sdl: safer code to resolve intermittent controller crashes related to disconnections (#2755) 2023-06-23 15:35:32 -04:00
Tyler Wilding 95904903a6
sdl: only call SDL video functions from the gfx thread (#2748)
Co-authored-by: ManDude <7569514+ManDude@users.noreply.github.com>
2023-06-19 16:32:39 -04:00
water111 6e779d1f1c
[jak2] faster startup (#2738)
Trying to make up for some of the startup speed lost in the SDL
transition. This saves about 1s from start (from ~3s), and about 500 MB
of RAM.

- Faster TIE unpack by merging matrix groups, more efficient vertex
transforms, and skipping normal transforms on groups with no normals.
- Refactor generic merc and merc to use a single renderer with multiple
interfaces, rather than many renderers. Removed "LightningRenderer" as a
special thing, but Warp is still special
- Add more profiling stuff to startup and the loader.
- Remove `SDL_INIT_HAPTIC` - this turned out to be needed for
force-feedback steering wheels, and not needed for controller vibration
- Switched `vag-player` to use quicksort instead of the default GOAL
sort (very slow)
2023-06-17 17:23:25 -04:00
Hat Kid d8cca2bf83
game: refactor discord code and improve jak 2 support (#2714)
The Discord RPC code has been cleaned up and split up between game
versions.

For Jak 2, the Discord integration now shows large images for all levels
(with corresponding day and nighttime variants if required) and small
images for time of day and various states like being on the jetboard,
driving a zoomer, playing as Daxter, etc.

TODO:
- [x] mission specific images and detection
- [x] detect side missions properly
- [x] `onin-game` detection


![image](https://github.com/open-goal/jak-project/assets/6624576/35ec273f-404c-4475-a7c7-06121a17b1a5)

![image](https://github.com/open-goal/jak-project/assets/6624576/8456f5e2-4f96-4c72-ae9e-d930d76c93af)

![image](https://github.com/open-goal/jak-project/assets/6624576/9a17a0ec-c9bd-40fa-8556-f139712d8f07)

---------

Co-authored-by: ManDude <7569514+ManDude@users.noreply.github.com>
2023-06-17 05:16:40 +01:00
ManDude e2c84d7635
revamp controller LED in jak 1 + reorganize some pc-settings things + fix some jak 2 decomp (#2719) 2023-06-13 19:26:44 +01:00
water111 3bb6bd0e3a
[jak2] fix missing drill crane center part (#2692)
We were forcing the drill crane to draw at lod 0, but we should have
listened to the game and drawn it at lod 1.
2023-06-05 18:56:26 -04:00
Tyler Wilding bdaf088d4b
game: Migrate from GLFW to SDL2 & attempt to rewrite / simplify display and input code (#2397)
Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
2023-06-04 15:34:37 -04:00
ManDude 7c9c956808
vag player + skill tracker debug tools and fix some decomp (#2664)
Also fixed an original game bug in `loader.gc` on a method that's called
quite often, though I have no clue what erroneous behavior it could have
even caused.
2023-05-18 23:12:23 +01: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
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
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 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
Tyler Wilding a264b6539b
game: Remove temporary CLI arg shim in gk (#2532) 2023-04-22 14:13:57 -04:00
ManDude ba12d804f7
jak 2 memcard support (#2482) 2023-04-14 20:39:58 +01: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
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
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
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
Tyler Wilding 630388229e
cleanup gk CLI and fix issue that caused revert (#2310)
My mistake -- testing focused too much on preserving the existing
behaviour I clearly forgot to make sure the new stuff worked properly.

Just had to early out and not modify the args if they were in the new
format.
2023-03-09 23:13:01 -05:00
water111 15bf281377
Revert "game: cleanup gk's CLI documentation" (#2306)
Reverts open-goal/jak-project#2189

can't figure out how to use the new options yet
2023-03-09 20:24:43 -05:00
Tyler Wilding 2f6bfd2e64
game: cleanup gk's CLI documentation (#2189)
An attempt to cleanup the last CLI interface we have left to cleanup. 
- `gk` args now follow the typical convention ie. `--proj-path` instead
of `-proj-path`.
- args that are passed through to the rest of the application / the
game's runtime use the typical convention of following a `--`
- I'm thinking some args shouldn't be handled at this level ie
(`-nodisplay`, `-vm`, `-novm` or `-jak2`) These could be better
documented as legitimate flags and passed in via a nice struct. They
don't seem to be used in `InitParams` but I'll triple check.

There's a temporary shim here so there is no coupled release with the
launcher (right now it executes `gk` with a few args). So I just change
the old args into the new format. After one release cycle, I can change
it in the launcher and delete it here.

I am unsure if this will break the bash shellscript usages -- not sure
which args were usually passed into `$@`


![image](https://user-images.githubusercontent.com/13153231/222035309-b6601719-cdc9-40ee-b36e-e4b135d3f128.png)
2023-03-09 20:02:25 -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
ManDude e1e6695e92
[jak2] merc lod hacks + region debugger + make level heap less massive (#2285) 2023-02-27 18:45:32 +00: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
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 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 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
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
ZedB0T 3b1e99cd3f
Hook Jak 1 into ImGUI actor filter (#2157) 2023-01-28 14:17:43 -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
Tyler Wilding 2f4146d469
tests: make the offline tests aware of the current terminals row count (#2105)
This fixes the hideous output when your terminal would be too small to
hold all the threads.
2023-01-07 10:35:12 -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
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
water111 73561f10a3
support c++ tools on macos (#2063)
Running reference tests/decompiler should now be possible on macos
(arm). Most of the changes were just cleaning up places where we were
sloppy with ifdefs, but there were two interesting ones:
- `Printer.cpp` was updated to not use a recursive function for printing
lists, to avoid stack overflow
- I replaced xxhash with another version of the same library that
supports arm (the one that comes in zstd). The interface is C instead of
C++ but it's not bad to use. I confirmed that the extractor succeeds on
jak 1 iso so it looks like this gives us the same results as the old
library.
2022-12-22 17:12:05 -05:00
water111 70e231fa72
[jak 2] merc (#2039) 2022-11-30 22:36:09 -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
Tyler Wilding f6bdc07990
d/jak2: finish progress menu code and initialize the camera (#1945)
This PR does a few main things:
- finish decompiling the progress related code
- implemented changes necessary to load the text files end-to-end
   - japanese/korean character encodings were not added
- finish more camera code, which is required to spawn the progress menu
/ init the default language settings needed for text
  - initialized the camera as well

Still havn't opened the menu as there are a lot of checks around
`*target*` which I havn't yet gone through and attempted to comment out.
2022-10-11 18:30:26 -04:00
water111 3d4dfb2077
[decomp] Decompile some time-of-day stuff, support new style Jak 2 time of day (#1943)
- Add "tfrag-water" tfrag tree support (may just be the same as Jak 1's
'dirt' for the settings)
- Add "tfrag-trans" tfrag tree support, reusing "trans-tfrag" from jak
1.
- Add a hack to `LinkedObjectFileCreation` to handle `oracle`, which is
accidentally multiply defined as a type leftover from jak 1 (an entity
in village1), and level info for jak 2.
- Add `VI1.DGO`
- add `time-of-day.gc`, and a few other stub functions so it works
- Set up some time of day stuff in GOAL for jak 2/PC renderers
- Clean up time of day in c++ renderers, support the more complicated
weight system used by jak 2 (backward compatible with jak 1, thankfully)

The mood functions now run, so this could cause problems if they rely on
stuff we don't have yet. But it seems fine for ctysluma and prison for
now.


![image](https://user-images.githubusercontent.com/48171810/194719441-d185f59c-19dc-4cd3-a5c4-00b0cfe1d6c3.png)


![image](https://user-images.githubusercontent.com/48171810/194719449-6e051bf3-0750-42e5-a654-901313dbe479.png)


![image](https://user-images.githubusercontent.com/48171810/194719455-3ca6793e-873a-449a-8e85-9c20ffeb4da3.png)


![image](https://user-images.githubusercontent.com/48171810/194719461-8f27af17-4434-4492-96cd-8c5eec6eafdf.png)


![image](https://user-images.githubusercontent.com/48171810/194719468-720715b9-985a-4acf-928c-eab948cfcb03.png)


![image](https://user-images.githubusercontent.com/48171810/194719486-bfb91e83-f6ca-4585-80ad-3b2c0cbbd5af.png)


![image](https://user-images.githubusercontent.com/48171810/194719492-df065d2f-cb5a-47e3-a248-f5317c42082f.png)


![image](https://user-images.githubusercontent.com/48171810/194719507-91e1f477-ecfe-4d6c-b744-5f24646255ca.png)
2022-10-08 13:33:03 -04:00
water111 d52739226c
[decomp] decompile decomp.gc (#1936)
A few issues:
- lwidea's fr3 is getting loaded and unloaded all the time
- the debug line drawing clipping is wrong (doesn't seem wrong in pcsx2,
so I think this is on us)
- nothing actually using vis data yet
- at a large distance, our view frustum culling seems slightly too
aggressive (might be that viewport scissoring is wrong)
- in the city, things seem darker as you move away. unclear how this is
happening (fog?)
2022-10-01 13:39:56 -04:00
ManDude 9351bf782e
[decomp2] game-info, game-task and task-control (#1884)
And everything else needed for them!

A couple functions are bad currently.

- fixes #1929 - untested on linux
- fixes #1924 - now you need to type `,` before a lambda you want to put
in a pair.
- fix debugger symbol table in jak 2
- made the decompiler output `(meters 2)` instead of `(meters 2.0)`
- fixed a bug with the bitfield enum special -1 case
- made bad game text decomp not exit the decompiler
- added `editable-player` and `script`
2022-09-27 19:44:20 -04:00
water111 80cefb9575
[decomp] background and tfrag (#1909) 2022-09-24 14:30:44 -04:00
water111 6a1bde4168
[decomp] fix up debug menu rendering, add a few others (#1892)
![image](https://user-images.githubusercontent.com/48171810/190832869-e609d346-9c4a-43fb-ad94-2a9690521adc.png)
actor vis boxes for PRI.DGO
2022-09-16 20:42:33 -04:00