Commit graph

1672 commits

Author SHA1 Message Date
Tyler Wilding 92105bb696
ci: update buildcache back now that things have stabilized (#1997)
My changes for allowing an explicit tag have now been merged to the
original action, so no need to use my fork.

Additionally, buildcache itself reverted to using ubuntu 20.04 to fix
this issue, but we'll leave the explicit tag there anyway to avoid
sudden breakage in the future.
2022-10-29 18:22:02 -04:00
Tyler Wilding e8c723c265
tests: don't strip comments from the dumped failures code (#1996)
Offline tests ignore comments in their comparison, but there's no reason
to strip them from the file that goes into the reference test folder
when doing the typical update routine.

This just generates superfluous diffs for all the files already done
prior to this change and is meaningless (the lines are dropped anyway)
2022-10-29 18:21:51 -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
Ziemas 3b3ed9efbe
Fix GCC build (#1992)
Not sure why but using the static members here caused a linker error,
but they're only used in one place so I just passed them as constants.
2022-10-29 15:25:21 -04:00
ChillyPepper b9924e5501
Adding notes for building non black label versions (#1995) 2022-10-29 15:25:03 -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
Tyler Wilding b602b83d17
ci: rollback to previous buildcache version (#1981)
buildcache's latest release changes to be built on Ubuntu22.04, which
breaks our 20.04 runners
2022-10-20 09:07:50 -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
Tyler Wilding d402ad8918
tests: parallelize offline-test execution (#1974)
The offline-tests are going to end up taking too long for jak 2, I did
some rough math and by the end of it we'll be spending almost 2 minutes
for a full offline test on my machine.

These changes allow us to throw hardware at the problem

Still some work to do to make the output nicer, but seems to be fairly
reliable. By default it still uses 1 thread, use `num_threads` to change
this.
2022-10-16 17:20:44 -04:00
water111 0712e6d4db
remove casts that were only needed to prevent hangs (#1977) 2022-10-16 17:14:35 -04:00
water111 46f11b1b47
add level ref test (#1973)
There's a few functions that have to be excluded, but I think it's still
useful to have this.
2022-10-15 18:36:32 -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
water111 a10d60c42c
[decompiler] nicer static giftags (#1970)
```
      :gif0 (new 'static 'gif-tag64
        :nloop #x4
        :eop #x1
        :pre #x1
        :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1)
        :nreg #x3
        )
      :gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
```
instead of
```
:gif (new 'static 'array uint64 2 #x303e400000008004 #x412)
```
2022-10-15 10:59:09 -04:00
water111 b6f0ef52b3
[decomp] fixes for loader and game-info (#1968)
Fixes for the functions that weren't decompiled. `initialize` in
`game-info.gc` was fixed manually.
2022-10-14 20:47:59 -04:00
Hat Kid da5aef8d60
decomp: finish target-[util|darkjak|swim|gun] | water | water-anim | crates | dark-eco-pool, fix skelgroup detection, add failed store/load warnings and clean up jak 3 config (#1958)
Almost done:
- `target-handler` (`(none)` event handler casts and CFG error)
- `target2` (`(none)` event handler casts)
- `powerups` (`cloud-track` does some weird stuff with `handle`s)
- `gun-states` (CFG error)

Some progress in:
- `water-flow`

Additionally:

- Clean up the two year old Jak 3 config file and add a config skeleton
(disassembling seems to not have worked, but I was able to dump obj
files and the `all_scripts` file)
- Fix automatic skelgroup detection and `defskelgroup` macro for Jak 2
(closes #1950)
- When a function decompiles without any major errors, a warning is
generated with the op id for each unresolved load and store that will
likely fail to compile (closes #1933)
2022-10-14 19:35:57 -04:00
Tyler Wilding 7dd716ded5
vscode: add snippets for supported ;; og:... comments (#1963)
Better documentation on what is supported / makes it faster to type them
without making mistakes.


![image](https://user-images.githubusercontent.com/13153231/195737915-1ed0fc15-e91d-4b35-a7df-0c31ebdc07d1.png)
2022-10-14 19:10:57 -04:00
Tyler Wilding da82cb87e7
tools: add the ability to search by method id (#1964)
Useful when you are trying to find a type with atleast a method at a
given id.
2022-10-14 19:10:38 -04:00
Tyler Wilding 9c390e1461
scripts: add a script to generate game.gp code, comment out generated code for now (#1966)
Generates the `game.gp` code for all DGOs, code added to the project
file has been commented out for now.

In my opinion, this is way too much in a single file -- it would be nice
if this code would live directly inside the `.gd` files themselves, then
everything is nicely organized. But this approach might have issues I'm
not aware of.
2022-10-14 19:10:05 -04:00
Matt Dallmeyer 17a854b148
allow daxter/naughtydog intro cutscene skip (#1965)
I think this got removed awhile back, not sure if it was intentional,
but thought it was nice to have. Feel free to close if it's not
supported for a good reason 👍
2022-10-14 19:06:41 -04:00
Tyler Wilding c95a9a0a5a
tests: run tests in gcc runner again (#1962) 2022-10-12 19:53:02 -04:00
Tyler Wilding e3473c1902
d/jak2: finish cty-guard-turret-button | race-h | height-map-h and a lot of rigid-body (#1957)
Also cleaned up `data_decompiler.cpp` to make it a lot less verbose to
add a special case for an array field.
2022-10-11 23:20:36 -04:00
Brent Hickey f7e1e73809
Decompile los-control-h (#1844)
Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2022-10-11 19:39:45 -04:00
water111 8827af5efd
add workaround for menu-option-list weirdness (#1961)
The type makes no sense when compared to the actual data there. This
modifies the type slightly, which I think is better than spending a
bunch of effort to special case this in the compiler/decompiler.

If we try this, and it turns out it doesn't work, we can always revisit
it. But I think this will work.
2022-10-11 19:21:10 -04: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
himham-jak 18fa543621
Ignore backups from OpenMaya (#1955)
For the level builder, I use .bak files whenever I modify a core file in
the project. These let you undo changes, but they don't need to be
pushed. I also couldn't find a nice way to do this, but we should also
ignore all contents of custom_levels besides test-zone.
2022-10-11 18:18:19 -04:00
water111 9a04c7e311
[decomp] sparticle, sparticle-launcher, set up sprite (#1949)
- fix crash with unhandled sparticle definition (happens with the weird
array int32s that I don't understand yet)
- update mips2c stuff
- add part-tester
- fix some issues around texture uploads
 

![image](https://user-images.githubusercontent.com/48171810/194784675-54e3dc58-7846-450d-a1e9-cefd841dda94.png)
2022-10-09 19:56:07 -04:00
ManDude af5009a29e
[decomp] make defpart and defpartgroup work in jak 2 (#1947) 2022-10-09 12:53:44 -04:00
Tyler Wilding 1d1ea907c9
scripts: prevent infinite loop when preserved block can't be found (#1946) 2022-10-08 21:53:23 -04:00
water111 405a144815
[decomp] finish up debug.gc, get boundary rendering working (#1944)
![image](https://user-images.githubusercontent.com/48171810/194726152-74167185-0297-4982-8ed9-42936ad80fe7.png)
2022-10-08 17:02:40 -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
Tyler Wilding be1e40a041
d/jak2: decompile conveyor | elevator | plat | bouncer | basebutton | base-plat | most of sampler | simple-nav-sphere | simple-focus | elec-gate and blocking-plane (#1942)
Most of these have been atleast partially documented / named / cleaned
up as well.

Co-authored-by: water <awaterford111445@gmail.com>
2022-10-08 12:42:52 -04:00
Tyler Wilding 2d1b5fa57c
d/jak2: finish region as well as some typedef files - ctywide-obs-h | vehicle-h | rigid-body-h (#1935) 2022-10-08 11:45:41 -04:00
water111 f1682867af
[graphics] hook up visibility data for jak 2 (#1938)
It works!

Visibility off:

![image](https://user-images.githubusercontent.com/48171810/193422627-c5560519-6d20-4645-baa5-5236c7969d6e.png)

On:

![image](https://user-images.githubusercontent.com/48171810/193422631-716fff10-9ad7-486f-ad35-9ddcddf2c4eb.png)

Overall the visibility data looks a lot better than in jak 1.
2022-10-01 17:12:12 -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
water111 6bd4649fd0
fix deadlock on shutdown (#1937) 2022-10-01 12:29:08 -04:00
Tyler Wilding 4d751af38e
logs: replace every fmt::print with a lg call instead (#1368)
Favors the `lg` namespace over `fmt` directly, as this will output the
logs to a file / has log levels.

I also made assertion errors go to a file, this unfortunately means
importing `lg` and hence `fmt` which was attempted to be avoided before.
But I'm not sure how else to do this aspect without re-inventing the
file logging.

We have a lot of commented out prints as well that we should probably
cleanup at some point / switch them to trace level and default to `info`
level.

I noticed the pattern of disabling debug logs behind some boolean,
something to consider cleaning up in the future -- if our logs were more
structured (knowing where they are coming from) then a lot this
boilerplate could be eliminated.

Closes #1358
2022-10-01 11:58:36 -04:00
ManDude 4e48ba21c1
[decompiler] make (not (logtest? work (#1934) 2022-09-30 18:26:52 -04:00
ManDude 11ec9d5d14
write a function that outputs a dot graph of the jak 2 tasks (#1932) 2022-09-29 19:10:58 +01: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 e3a4627eeb
[decompiler] recognize jak 2 vector-float*!, fix some vector inline casting bugs (#1926) 2022-09-26 20:57:44 -04:00
water111 bdf63b9048
[decomp] sync-info, fix some looping type pass bugs (#1925) 2022-09-26 19:40:46 -04:00
water111 a22d49ab11
[decompiler] fix rare bug with casts (#1920) 2022-09-26 18:14:54 -04:00
water111 5c7a3384e5
[jak2] static sound macro (#1919)
eg
```
(set! (-> obj sound-pre-open) (static-sound-spec "airlock-slider"))
```
it is the same as jak 1, but the `fo-curve` option is set to 1
sometimes.
2022-09-25 16:19:06 -04:00
water111 b5705bde96
[decomp] Partial implementation of tie (#1916)
Some stuff isn't working fully yet:
- fog color
- time of day
- draw order for multiple passes (currently all draws in the default tie
bucket)
- possibly settings for transparent stuff (untested, but might work)
- the "vanish" effect (we might not want this anyway?)
- environment mapping/etie completely not implemented.


![image](https://user-images.githubusercontent.com/48171810/192154314-2cc8ac51-9dad-474f-a84b-3a1d98973215.png)

![image](https://user-images.githubusercontent.com/48171810/192154316-457a7ee0-b5a4-4a40-b48e-8863114da735.png)
2022-09-25 12:50:51 -04:00