Commit graph

1668 commits

Author SHA1 Message Date
Tyler Wilding 332f0b2f2b
tools: add a tool to search for types based on size / type chain / fields (#1906)
Just a small simple tool that can search through `all-types` for a type
based on a bunch of criteria.

For example:

![image](https://user-images.githubusercontent.com/13153231/192043561-181e5c5d-d5b1-41a9-8891-5cc3ed1a0efa.png)

The results are printed to stdout, as well as output to a json file so
they can be consumed by another tool (in my plans, the VSCode extension)
2022-09-24 16:04:52 -04:00
Tyler Wilding 7dd8053697
fix test failure and stop running manual tests in CI (#1912) 2022-09-24 15:56:53 -04:00
water111 903450b878
[decompiler] recognize mfc nop (#1911)
Forgot to include in previous PR.
2022-09-24 14:56:22 -04:00
Tyler Wilding 123e7fd87b
d/jak2: some work in memory-usage | nav-graph-h and finish pov-camera and aligner (#1901) 2022-09-24 14:47:03 -04:00
water111 80cefb9575
[decomp] background and tfrag (#1909) 2022-09-24 14:30:44 -04:00
Tyler Wilding d00ebe5397
tests: allow for a single file to be tested in the offline-tests at a time (#1907)
A small quality of life increase that is more impactful since jak 2 has
double the file count.

I often use the offline-tests to find compiler errors / automatically
resolve them when i am finalizing a file. As more and more files are
completed this becomes increasingly more inefficient. When I know that
only 1 file needs to be decompiled / compared / compiled, I'd prefer to
have a feature like this.
2022-09-24 13:04:52 -04:00
Matt Dallmeyer d30c635089
Fix infinite pause buffer bug (#1900)
Fixes #1886 which was introduced in #1756 
 
Changed to only read the dpad inputs for hud toggle if L2/R2 were
considered held (they're not read during a pause buffer)
2022-09-24 12:27:44 -04:00
Tyler Wilding e64414d9d0
d/jak2: finish drawable-group | drawable-inline-array | drawable-tree and path (#1899) 2022-09-24 12:27:02 -04:00
tripp 66b19296ef
add project path option to the compiler (#1826) 2022-09-24 12:06:26 -04:00
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 80526dfca0
[decompiler] fix local_vars assert on static lambda (#1895)
Fixes a crash when there's a `(new 'static 'something :field <some
anonymous function with a particular set of errors in the decompler>)`.
The output will now be
```
 (set! *duck-mods* (new 'static 'surface
                      :name 'duck
...
                      :mult-hook <lambda at L615>
                      :flags (surface-flag duck)
                      )
```

fixes https://github.com/open-goal/jak-project/issues/1882
2022-09-16 23:40:16 -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 d95ff2d2fb
lsp: improve LSP IR2 hovers (#1891)
Some new hover features:

docstrings (`@param/@return` syntax is not yet supported, nor is a
syntax-highlighted preview, will do later)

![image](https://user-images.githubusercontent.com/13153231/190830490-d0ef774c-e7e5-4bb9-8007-b366be0f491e.png)

better MIPs instruction descriptions

![image](https://user-images.githubusercontent.com/13153231/190830507-0bb35c13-7e88-4b74-a63b-b7fb3587b82e.png)

numeric hovers convert to different bases / tell you the OpenGOAL method
id (i can't tell you the amount of times ive done -16 / 4 manually
myself...)

![image](https://user-images.githubusercontent.com/13153231/190830674-f66ed15a-f983-48ff-b251-259374dfbcac.png)

Closes https://github.com/open-goal/opengoal-vscode/issues/33
Closes https://github.com/open-goal/opengoal-vscode/issues/31
Related to https://github.com/open-goal/opengoal-vscode/issues/29
2022-09-16 20:28:44 -04:00
Tyler Wilding 4e3c44294e
lsp: re-process all-types file when it changes (#1889)
Found the reason why this wasn't happening -- the path included by the
decompiler isn't a proper URL encoded URI -- so I have to convert it
appropriately so when vscode sends it's "this file with this URI has
changed" event it actually matches the tracked all-types file.

This will make jump-to-defs not drift as the file changes, and new
uncommented symbols will actually get picked up
2022-09-16 20:28:09 -04:00
Tyler Wilding 0f4f70e66d
logs: prefer exceptions over stdout logs around defenums (#1887)
This was causing an issue in the LSP because the `fmt::print`s clash
with the transport over stdin/out
2022-09-16 20:27:22 -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 8117ed3bc7
scripts: make update_decomp_ref.py respect the game we are operating on (#1880) 2022-09-13 20:03:00 -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
Alexis Lefebvre b2f7f15cb5
README: fix a typo (#1881) 2022-09-13 17:37:10 -04:00
Alexis Lefebvre ef22563d36
README: update the Docker part (#1870)
It was written:

> If you the build directory you'll need…

I tried to fix it, hopefully I found the correct wording. Otherwise
please let me know what was missing.
2022-09-12 18:08:03 -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
animalstyletaco 813611e0b2
Fixed typo in gfx.cpp (#1868)
Co-authored-by: animalstyletaco <animalstyletaco95@gmail.com>
2022-09-11 18:31:41 +01: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
ManDude cfb6abb24d
[decompiler] rewrite set lets as just sets (#1858)
Rewrites specific kinds of lets where the return value of the `set!`
itself is meant to be used to just be `set!`s. Implemented at the let
rewrite level. Seems to work for Jak 2 so far.

Fixes #1854 .
2022-09-07 18:28:01 -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
Tyler Wilding 71871595da
lsp: re-analyze IR2 files when they change (#1841)
* lsp: re-analyze IR2 files when they change

* tests: update ref tests
2022-09-05 17:45:41 -04:00
ManDude 9f90a7c2db
small jak1 decomp cleanup (#1843)
small cleanup
2022-09-05 17:43:59 -04:00
OpenGOALBot 7177cb5bdc Updating Controller Database 2022-09-05 16:23:09 +00: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
water111 97637d7902
fix for windows newlines (#1834) 2022-09-01 22:44:43 -04:00
himham-jak 5a21c823f5
Added JML95's Spanish Subtitles (#1828)
* 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

* Added JML95's Spanish Subtitles
2022-09-01 18:27:39 -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