Commit graph

687 commits

Author SHA1 Message Date
Ethan Lafrenais dc5dc9c76c
[decomp] jak2: shrubbery (#1898)
Some notes:
- `draw-prototype-inline-array-shrub` can probably be decompiled but I'm
not comfortable doing this function myself. It's got a ton of inline
assembly (or at least I think it's inline assembly) and is very long. I
left this marked as asm for now but I am confident in the function
definition.
- The VU program is identical to Jak 1 (yay)
- There's some new `dma-test` stuff at the end of the file, not really
sure what it's doing but it runs in the top-level.
2022-09-18 12:19:16 -04:00
water111 1b45aab3cc
[decompile] subdivide, wind-work, tie-work, bsp, focus (#1897)
- decompile `subdivide`, `wind-work`, `tie-work`, `bsp`, `focus`
- support `ppacb` in compiler
- don't assert when bitfield stuff fails due to constant propgataion
weirdness
- finish up history
- div/mod unsigned assert fix in decompiler
- empty assert fix in decompiler for failed `add` type prop
- make jak 1 performance counters "work" (just measure time)
- fix cast/typos on pcgtb/vftoi15
2022-09-17 14:58:25 -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
Tyler Wilding 82e0517275
d/jak2: get script decompiling, no ref tests yet (#1877)
Has boxed array accessing that prevents me from adding anything to ref
tests (the entire file is lambdas so the access pattern that i would
like to ignore happens at the top-level, can't ignore it.

This code actually already has quite a bit of original docstrings so
it's not too bad in that regard considering a `script-context` can have
16 arbitrary objects. It seems they rarely put more than a single object
in the context and the types are usually obvious / are actually type
checked!
2022-09-14 19:37:12 -04:00
Tyler Wilding 4620f96574
d/jak2: mostly finish mysql-nav-graph and fix docstring handling around with-pp/local-vars (#1869) 2022-09-13 18:15:02 -04:00
water111 4eea31c3e9
[jak 2] texture (#1866)
- Decompile and patch `texture.gc` for PC
- Improve decompiler when offset doesn't fit in immediate (for types
larger than 8k and some scratchpad accesses)
- Fix symbol->string issues in both jak 1 and 2
- Fix bug with VIF interrupt used to profile VU code (hooked up to
OpenGLRenderer BucketRenderers in PC port)
- Support `~o` in `format`.
- Uncomment stuff in `merc.gc` that now works!

![image](https://user-images.githubusercontent.com/48171810/189505469-941b4a3e-23c7-4740-aa1b-2e461ed19fa9.png)

fixes https://github.com/open-goal/jak-project/issues/1850
2022-09-11 14:17:55 -04:00
Tyler Wilding 017070525a
d/jak2: finish vol | cam-layout | menu | default-menu and start working on nav code (#1867)
I also added font-color names since this PR adds quite a few:

![image](https://user-images.githubusercontent.com/13153231/189508209-c8849672-fac5-47cb-9652-f1d4648f0af8.png)
2022-09-11 13:42:46 -04:00
Hat Kid 7339b2b965
decomp: merc, merc-vu1 (#1865)
The merc VU1 program is identical to Jak 1. Jak 2's merc is doing some
new texture login stuff and the DMA buffer setup is a bit different, but
overall very similar.
2022-09-10 19:02:58 -04:00
Tyler Wilding 81b6d5fe08
d/jak2: finish find-nearest | trajectory | editable-h and most of editable and editable-player (#1847)
Also made a first-pass of their SQL schema in preparation for getting
that working.
2022-09-10 18:03:17 -04:00
Tyler Wilding 7baf253a1a
jak1: fix the flickering driller-lurkers on >60 fps (#1862) 2022-09-08 18:34:53 -04:00
Hat Kid bb777e4bac
decomp: logic-target (#1861)
Also adds all names for `focus-status`.

Closes #1859 and updates ref tests for Jak 1 for this edge case.
2022-09-08 18:26:33 -04:00
water111 f3c63f26bb
fix let* format, new on stack guessing case, type failure, handle casts (#1860)
Fixes https://github.com/open-goal/jak-project/issues/1821 by adding a
special case for `new` method calls where the argument with type
`symbol` is actually an address to uninitialized structure on the stack.

Fixes https://github.com/open-goal/jak-project/issues/1849 (or at least
the cause of the issue Vaser gave in chat, and one random one I found in
`debug-sphere`)

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

Fixes https://github.com/open-goal/jak-project/issues/1857 by moving the
cast into the cond if the body is a single form and the destination type
is a bitfield/enum which is likely to work well. Seems to work on the
examples we could find in jak 1 and jak 2.

Also fixes an issue with casts on the result of `handle->process` (a
common place to use casts)

the output of process->handle is a plain process. Most of the time, you
end up casting this to a more specific. If you add a cast on every use
of the variable, the decompiler will decide to change the type of that
variable to the more specific type, and this breaks the handle cast.

so previously it was impossible to get code like
```
    (let* ((s2-0 (the-as swingpole (handle->process (-> self control hack))))
           (gp-0 (-> s2-0 dir))
           )
```
But now it will work
2022-09-07 21:58:09 -04:00
ZedB0T 97c12ebaf4
[speedrun] Show speedrun information at start of run (#1848)
This shows the current settings needed to help provide information when
verifying a run, also it removes the two calls to show the version in
main.gc and instead does it within the speedrun/auto splitting scope.

- Shows Version
- Shows if Speedrunner mode is on (technically pointless since the text
only displays when it is enabled this more just serves to show that
there IS a speedrunner mode to viewers and stuff (josh) So hopefully it
may cut down on submissions with the mode off)
- Shows if cutscene skips is enabled/disabled.

Tested on 16x9 4x3 the really weird one and borderless/fullscreen

[![IMAGE ALT TEXT
HERE](https://img.youtube.com/vi/qDC-beEg5Es/0.jpg)](https://www.youtube.com/watch?v=qDC-beEg5Es)

Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2022-09-07 18:18:37 -04:00
Ethan Lafrenais 22982d2750
[decomp] jak2: debug, debug-sphere (#1846)
I wasn't able to 100% complete `debug` due to a bunch of level boundary
debug stuff I couldn't figure out. But, I added a ref test and
documented/copied over everything else into goal_src.

Most of the functions that existed in Jak 1 are identical, others got an
extra param or 2 and some now make copies of arguments instead of
modifying them. There's a bunch of new functions, including all of the
debug functions that used to be in `level-boundary` are now in `debug`.
At the very end of `debug` there's also some weird asm functions
checking for some EE memory controller bug (not sure what's up with
that)?
2022-09-07 18:14:34 -04:00
Tyler Wilding 44d59e6b33
d/jak2: finish mood-funcs | mood-funcs2 | almost all of mood and airlock (#1842) 2022-09-06 20:35:00 -04:00
water111 b5d21be9c5
W/misc fixes (#1838)
* temp

* temp

* before cleaning up

* cleanup merge

* fix warnings

* merge fix

* clang format
2022-09-05 20:29:12 -04:00
Tyler Wilding 80d0137dba
d/jak2: finish the majority of sparticle and sparticle-launcher (#1840)
* sparticle-launcher

* d/jak2: large amount of `sparticle-launcher` done

* d/jak2: finish the majority of `sparticle`

* decomp: improve format code ignoring

* d/jak2: make bits unique in `sp-cpuinfo-flag`

* d/jak1: revert config change
2022-09-05 18:03:46 -04:00
ManDude 9f90a7c2db
small jak1 decomp cleanup (#1843)
small cleanup
2022-09-05 17:43:59 -04:00
Matt Dallmeyer 6c52905860
Fix crash in light jak cutscene skip (#1839) 2022-09-03 14:53:56 -04:00
Hat Kid 2a1dc7bd2b
decomp: emerc, emerc-vu1 (#1833)
* decompiler: add support for `MADDq` in VU disassembler, add `emerc-vu1` program

* decomp: `emerc`, `emerc-vu1`
2022-09-02 18:29:30 -04:00
ZedB0T 59617c2ee0
Make the citadel elevator come up when cutscene is skipped (#1832)
Still comes up from the bottom, but its probably the "correct" way to do it?

The other alternative would be killing Jak when the cutscene is skipped instead of `(start 'play (get-continue-by-name *game-info* "citadel-elevator"))` This would make the elevator at the top instantly, however it might mess with hp values and stored levels.

Credit to Barg/dallmeyer
2022-09-02 18:26:10 -04:00
Tyler Wilding 0896bef2bf
jak1/speedruns: Some final touches for speedrunning in jak 1 (#1830)
* jak1: put common speedrunning code into it's own file

* jak1: enforce `60` fps while in speedrunning mode

* jak1: when speedrunning, display the version until you get the first powercell

* jak1: add an explicit option for skipping cutscenes

* jak1: extend `game-option` to allow any menu option to be disabled

* tests/jak1: allow whitelisting types to be redefined to satisfy typeconsistency checks

* jak1: add file headers

* jak1: cleanup bool checking

* test: delete the es substitle file

* test: add it back

* jak1: missed one cleanup spot related to bool comparisons
2022-09-02 18:15:42 -04:00
ManDude f1f18e7e05
[decomp2] joint-mod, chain-physics, loader (#1816)
* prep

* Update repo-settings-mark.bat

* Update repo-settings-unmark.bat

* decomp `joint-mod`

* add `joint-mod-ik-callback` to ref exceptions

* `chain-physics`

* Update jak2_ntsc_v1.jsonc

* update bat scripts

* `loader`

* pretty

* refs

* support `process->handle` (and `ppointer->handle`?)

* refs

* source and fixes

* fix `ja` detect

* `ja` macro implement

* fix a method

* update source

* merge fixes

* annoying fixes

* format

* arg

* hack

* fix test
2022-09-02 18:13:38 -04:00
water111 909bde8b1e
add menu option for ptbr (#1835) 2022-09-02 11:50:10 -04:00
Hat Kid 52bb1c4915
decomp: board-h, board-util, gun-util, darkjak-h (#1817)
* decomp: `board-util`, `gun-util`, `darkjak-h`

* address changes and decompile `board-h`

* fix `board-util`

* remove `_type_` from `projectile` method

* fix `gun-h.gc`

* Update gun-h.gc
2022-09-01 18:25:42 -04:00
water111 937ae0cb97
[decomp] fix joint type (#1827)
* fix joint type

* fix relocate hack bug

* update
2022-08-31 19:48:06 -04:00
Tyler Wilding d264779173
d/jak2: finish glist | glist-h | camera | cam-interface | cam-states-dbg | cam-combiner | cam-debug | cam-start (#1829)
* d/jak2: finish `glist` and `glist-h` partially done `time-of-day`

* d/jak2: finish `camera` and `cam-interface`

* d/jak2: partially finish `cam-master` `cam-states`, and `cam-update` finish `cam-states-dbg` `cam-combiner` `cam-debug` and `cam-start`

* tests: update ref tests

* scripts: add scripts to automatically update gsrc files

* d/jak2: update gsrc
2022-08-31 19:22:47 -04:00
ManDude 0d16a52854
fix some pc settings not being saved/loaded correctly (#1815)
* Update default-menu.gc

* make fog hack slightly less aggressive

* add `reload-text` back but kinda fixed

* more unlocks for non-guaranteed musics

* smarter language save & load

* also save pc settings on autosave

* more special music log cases

* one more
2022-08-29 19:05:36 -04:00
Ethan Lafrenais e7b1a2d292
[decomp] jak2: sprite, sprite-distort, some of sprite-glow (#1814)
* Decompile sprite-distort

* Revert matrix, sprite-vec-data-2d changes

* Sprite distort ref test

* Sprite distort docs

* Better sprite-distort docs

* Jak2 sprite distort VU

* sprite decomp

* Some of sprite-glow

* Clean up
2022-08-29 19:04:54 -04:00
Tyler Wilding d176b294b9
d/jak2: finish entity-table | sky-data | relocate | and the majority of default-menu (#1812)
* d/jak2: finish `entity-table`

* d/jak2: finish `sky-data`

* d/jak2: finish `relocate`

* d/jak2: halfway through `default-menu`

* d/jak2: 75% done `default-menu`....

* d/jak2: add `default-menu` to ref tests (partially)

* d/jak2: finish updating related code

* scripts: add tooling to automatically keep code from `all-types` up to date

* d/jak2: fixed vector types
2022-08-29 18:49:57 -04:00
water111 2bead6db97
[decompile] Joint (#1813)
* temp

* decompile joints

* fix merge
2022-08-28 16:38:58 -04:00
Tyler Wilding d4a065a4e5
d/jak2: finish level-info (#1807) 2022-08-28 16:13:42 -04:00
Tyler Wilding b9c6a840ad
d/jak2: finish settings (#1803)
* d/jak2: finish `settings`

* add `settings` related macros to goal_src
2022-08-28 16:13:26 -04:00
Tyler Wilding 799e10a0ae
d/jak2: finish cylinder | mech-h | font-data most of text and history and chip away at a bunch of other files (#1802)
* d/jak2: finish `cylinder`

* d/jak2: mostly finish `history`

* d/jak2: finish a bit of `ripple` and `sync-info`

* d/jak2: finish `font-data` and chip away at some other files

* d/jak2: most of `text` done, a bit of `script` - symbol arr issue in `level-info`

* d/jak2: finish `mech-h`

* lint: format

* tests: fix typeconsistency

* d/jak2: address feedback
2022-08-28 10:45:07 -04:00
water111 f8007cc84b
[decomp] Jak 2 mips2c, collide-func (#1805) 2022-08-26 18:03:48 -04:00
Hat Kid 24590ec670
decomp: water-h, pilot-h, gun-h and board-h types (#1801)
* decomp: `water-h`, `pilot-h`, `gun-h` and `board-h` types

* update ref test

* fix arg type

* address changes
2022-08-26 14:57:32 -04:00
himham-jak 851d850966
Added Lightbell18's Brazilian Portuguese Subtitles (#1759)
* added br-portuguese to subtitle language list

* Added br-portuguese to sub and text list

* Create game_subtitle_ptbr

* Create game_subtitle_ptbr.gd

* Delete game_subtitle_ptbr

* Added Brazilian Portuguese

* Added Brazilian Portuguese

* Create game_text_ptbr.gs

* Update progress-pc.gc

* Update target.gc

* Update game_subtitle_ptbr.gd

* Update game_text_ptbr.gs

* Update game_text_ptbr.gs

* Update target.gc

* Update progress-pc.gc

* Update game_text_ptbr.gs

* Update game_text_ptbr.gs

* Update game_subtitle_ptbr.gd

* Update game_subtitle_ptbr.gd
2022-08-26 12:51:53 -04:00
water111 7443520e88
[decomp] load-dgo, ramdisk, gsound, transformq (#1798)
* temp

* cleanup after merge

* transformq too
2022-08-24 21:57:13 -04:00
ManDude c441e209d2
use 2x msaa by default instead of 4x (#1797) 2022-08-24 19:34:23 -04:00
Tyler Wilding 01abde35d8
d/jak2: First few files, mood-tables and vol-h (#1796)
* decomp: format jak1 cast files

* decomp: finish `mood-tables` and `mood-tables2`

* jak2: stop disasm'ing

* jak2: format jak2 cast files, start working on the rest of the `mood` files

* scripts: fix running pcsx2 watcher

* d/jak2: finish `vol-h`

* d/jak2: address feedback
2022-08-24 19:34:09 -04:00
water111 f7bd0752f8
[decomp] Decompile first batch of files in engine (#1787)
* wip

* getting stuff set up so we can actually run test cases

* better handle block entry stuff

* types2 working on gstring

* comments

* math ref working

* up to first stack stuff

* stack fixes

* bounding box

* math stuff is working

* float fixes

* temp debug for (method 9 profile-array)

* stupid stupid bug

* debugging

* everything is broken

* some amount of type stuff works

* bitfield

* texture bitfields not working

* temp

* types

* more stuff

* type check

* temp

* float related fixes for light and res problems

* revisit broken files, fix bugs

* more types

* vector debug

* bug fixes for decompiler crashes in harder functions

* update goal_src
2022-08-24 00:29:51 -04:00
water111 be654b9398
fix tie lod and intro cutscene linux crash (#1794) 2022-08-23 19:14:21 -04:00
Tyler Wilding 3dd10d0989
jak1: put the auto-splitting marker in C++ so it can be quickly found (#1791) 2022-08-23 19:14:15 -04:00
Tyler Wilding 346a258902
game/speedrunning: Add struct with relevant information to facilitate Auto Splitting (#1775)
* game: add auto-splitter structs

* game/jak1: wire up auto-splitter updating to game when in SR mode

* game/jak1: add info to split on picking up white eco

* game/jak1: add another two tasks for fish and finalboss

* game/jak1: autosplitting code entirely in GOAL
2022-08-22 18:55:08 -04:00
water111 06ef52cd25
[decompiler] support for jak 2 (#1781)
* [decompiler] suppport jak 2

* cleanpu

* remove brief from gtest options

* fix test
2022-08-22 18:53:51 -04:00
water111 5af36ac610
maybe fix bridge blast (#1784) 2022-08-22 23:02:31 +01:00
Hat Kid a3dac2ab24
game: add new cheats to debug menu (#1780)
add new cheats to debug menu
2022-08-21 18:14:39 -04:00
ManDude 665c578ccf
[game] cutscene skipping (#1779)
* split some subtitles

* allow cutscene skipping in retail and fix softlock

* formatting

* make intro skipping work?

* citadel sagecage skipping

* finalboss sage skipping

* quicker quit to title

* uk text fixes

* fisher cutscene skipping

* fix test
2022-08-21 18:13:47 -04:00
Tyler Wilding dec7da2110
game: windowed mode related fixes (#1778)
* game: restore windowed mode settings properly

* game: use the game version for saving settings/saves

* game: prevent windowed mode from being auto-centered on initial init

* game: save and restore window coordinates

* lint: formatting
2022-08-21 18:13:27 -04:00
Tyler Wilding 7fd206be9c
game: add a speedrunner mode which enables a faster new-game/resetting experience (#1773)
game: add a speedrunner mode which enables a faster new-game

- skips intro cutscene
- removes auto-save prompt
2022-08-20 10:41:03 -04:00