Commit Graph

22 Commits

Author SHA1 Message Date
Tyler Wilding 6c719ae000 d/jx: Disassemble and compare VU programs, add reference tests, create a diff report (#4406)
All VU programs are unchanged except:

- `ocean-near-vu1` DIFFERENT
- `sparks-vu1` NEW
- `sprite-glow-vu1` DIFFERENT
- `tnear-vu1` DIFFERENT

And `hfrag`, `ocean` and `ocean-texture` have been removed.

A full breakdown:
```
================================================================================
Checking: background-vu0.txt
================================================================================
OK: Files are the same.

================================================================================
Checking: bones-vu0.txt
================================================================================
OK: Files are the same.

================================================================================
Checking: collide-vu0.txt
================================================================================
OK: Files are the same.

================================================================================
Checking: emerc-vu1.txt
================================================================================
OK: Files are the same.

================================================================================
Checking: etie-vu1.txt
================================================================================
OK: Files are the same.

================================================================================
Checking: etn-vu1.txt
================================================================================
OK: Files are the same.

================================================================================
Checking: foreground-vu0.txt
================================================================================
OK: Files are the same.

================================================================================
Checking: generic-vu0.txt
================================================================================
OK: Files are the same.

================================================================================
Checking: generic-vu1.txt
================================================================================
OK: Files are the same.

================================================================================
Checking: merc-vu1.txt
================================================================================
OK: Files are the same.

================================================================================
Checking: mercneric-vu0.txt
================================================================================
OK: Files are the same.

================================================================================
Checking: ocean-mid-vu1.txt
================================================================================
OK: Files are the same.

================================================================================
Checking: ocean-near-vu1.txt
================================================================================
!!! DIFFERENT !!!

--- ocean-near-vu1.txt
+++ ../jak3/ocean-near-vu1.txt
@@ -78,10 +78,20 @@
 .word 0x2ff
 .word 0x800206bc
 .word 0x2ff
+.word 0x903100a
+.word 0x2ff
+.word 0x884100a
+.word 0x2ff
 .word 0x80050032
 .word 0x2ff
 .word 0x800701f2
 .word 0x2ff
+.word 0x1fc1820
+.word 0x2ff
+.word 0x1fd1821
+.word 0x2ff
+.word 0x1fe2020
+.word 0x2ff
 .word 0x1f82922
 .word 0x2ff
 .word 0x1f92925
@@ -91,23 +101,23 @@
 .word 0x1fb292b
 .word 0x2ff
 .word 0x1ec292e
-.word 0x800601
+.word 0x9c0600
 .word 0x1ed2931
-.word 0x800641
+.word 0x9c0641
 .word 0x1ee2934
-.word 0x800681
+.word 0x9c0682
 .word 0x1ef2937
-.word 0x8006c1
+.word 0x9c06c3
 .word 0x1e8293a
-.word 0x800301
+.word 0x9d0300
 .word 0x3e5c122
-.word 0x800341
+.word 0x9d0341
 .word 0x3e5c925
-.word 0x800381
+.word 0x9d0382
 .word 0x3e5d128
-.word 0x8003c1
+.word 0x9d03c3
 .word 0x3e5d92b
-.word 0x800201
+.word 0x9e0200
 .word 0x3e5612e
 .word 0x2ff
 .word 0x3e56931
@@ -118,12 +128,26 @@
 .word 0x2ff
 .word 0x3e5413a
 .word 0x2ff
+.word 0x80031a32
+.word 0x2ff
+.word 0x80042232
+.word 0x2ff
 .word 0x1005281b
 .word 0x2ff
-.word 0x5a003fec
+.word 0x5a003fe7
 .word 0x2ff
 .word 0x80073ff2
 .word 0x2ff
+.word 0x843100a
+.word 0x2ff
+.word 0x824100a
+.word 0x2ff
+.word 0x1fc1820
+.word 0x2ff
+.word 0x1fd1821
+.word 0x2ff
+.word 0x1fe2020
+.word 0x2ff
 .word 0x1f82922
 .word 0x2ff
 .word 0x1f92925
@@ -133,23 +157,23 @@
 .word 0x1fb292b
 .word 0x2ff
 .word 0x1ec292e
-.word 0x800601
+.word 0x9c0600
 .word 0x1ed2931
-.word 0x800641
+.word 0x9c0641
 .word 0x1ee2934
-.word 0x800681
+.word 0x9c0682
 .word 0x1ef2937
-.word 0x8006c1
+.word 0x9c06c3
 .word 0x1e8293a
-.word 0x800301
+.word 0x9d0300
 .word 0x3e5c122
-.word 0x800341
+.word 0x9d0341
 .word 0x3e5c925
-.word 0x800381
+.word 0x9d0382
 .word 0x3e5d128
-.word 0x8003c1
+.word 0x9d03c3
 .word 0x3e5d92b
-.word 0x800201
+.word 0x9e0200
 .word 0x3e5612e
 .word 0x2ff
 .word 0x3e56931

================================================================================
Checking: shadow-vu0.txt
================================================================================
OK: Files are the same.

================================================================================
Checking: shadow-vu1.txt
================================================================================
OK: Files are the same.

================================================================================
Checking: shrub-vu1.txt
================================================================================
OK: Files are the same.

================================================================================
Checking: sparks-vu1.txt
================================================================================
!!! MISSING: ../jak3/sparks-vu1.txt
!!! MISSING: sparks-vu1.txt does not exist in ../jak3

================================================================================
Checking: sprite-distort-vu1.txt
================================================================================
OK: Files are the same.

================================================================================
Checking: sprite-glow-vu1.txt
================================================================================
!!! DIFFERENT !!!

--- sprite-glow-vu1.txt
+++ ../jak3/sprite-glow-vu1.txt
@@ -1,4 +1,4 @@
-.word 0x1005031e
+.word 0x10050320
 .word 0x2ff
 .word 0x1f903dc
 .word 0x2ff
@@ -66,17 +66,17 @@
 .word 0x2ff
 .word 0x1ed2004
 .word 0x1042101
-.word 0x3e54845
+.word 0x3e54844
 .word 0x5b1159
 .word 0x8025033c
 .word 0x410083
-.word 0x3e55046
+.word 0x3e55045
 .word 0x20025c
-.word 0x3e55847
-.word 0x2ff
-.word 0x3e56048
+.word 0x3e55846
+.word 0x2ff
+.word 0x3e56047
 .word 0x1002117
-.word 0x3e56849
+.word 0x3e56848
 .word 0x2ff
 .word 0x80000030
 .word 0x290247
@@ -178,7 +178,7 @@
 .word 0x18aa52f
 .word 0x80000030
 .word 0x1e5f1bf
-.word 0x3e5184c
+.word 0x3e5184b
 .word 0x1e5fc0a
 .word 0x3c5580b
 .word 0x191a46c
@@ -230,33 +230,33 @@
 .word 0x1ed697d
 .word 0x80000030
 .word 0x1ee717d
-.word 0x385583e
+.word 0x385583d
 .word 0x1f1897d
-.word 0x385603f
+.word 0x385603e
 .word 0x1f2917d
-.word 0x3856840
+.word 0x385683f
 .word 0x1f3997d
-.word 0x3857041
+.word 0x3857040
 .word 0x1f4a17d
-.word 0x3858819
-.word 0x2ff
-.word 0x385901b
+.word 0x3858818
+.word 0x2ff
+.word 0x385901a
 .word 0x2ff
 .word 0x3859808
 .word 0x2ff
 .word 0x385a009
 .word 0x2ff
-.word 0x385584e
-.word 0x2ff
-.word 0x3856050
-.word 0x2ff
-.word 0x3856852
-.word 0x2ff
-.word 0x3857054
+.word 0x385584d
+.word 0x2ff
+.word 0x385604f
+.word 0x2ff
+.word 0x3856851
+.word 0x2ff
+.word 0x3857053
 .word 0x2ff
 .word 0x80002efc
 .word 0x2ff
-.word 0x10010691
+.word 0x10010694
 .word 0x2ff
 .word 0x52001f8c
 .word 0x2ff

================================================================================
Checking: sprite-vu1.txt
================================================================================
OK: Files are the same.

================================================================================
Checking: tfrag-vu1.txt
================================================================================
OK: Files are the same.

================================================================================
Checking: tie-near-vu1.txt
================================================================================
OK: Files are the same.

================================================================================
Checking: tie-vu1.txt
================================================================================
OK: Files are the same.

================================================================================
Checking: tnear-vu1.txt
================================================================================
!!! DIFFERENT !!!

--- tnear-vu1.txt
+++ ../jak3/tnear-vu1.txt
@@ -1421,9 +1421,9 @@
 .word 0x1916800
 .word 0x400403
 .word 0x40000008
+.word 0x2ff
+.word 0x1927000
 .word 0x400443
-.word 0x1927000
-.word 0x2ff
 .word 0x3eb802d
 .word 0x2ff
 .word 0x3eb882e
@@ -1435,39 +1435,39 @@
 .word 0x1916948
 .word 0x400403
 .word 0x40000001
+.word 0x2ff
+.word 0x1927148
 .word 0x400443
-.word 0x1927148
-.word 0x2ff
 .word 0x3eba02a
 .word 0x400483
 .word 0x3eba82b
+.word 0x2ff
+.word 0x3ebb02c
+.word 0x2ff
+.word 0x1f4581d
 .word 0x1998407
-.word 0x3ebb02c
+.word 0x1f55820
 .word 0x1998c47
-.word 0x1f4581d
-.word 0x1f6e93c
-.word 0x1f55820
+.word 0x3eb6027
 .word 0x1999487
-.word 0x3eb6027
-.word 0x191876f
 .word 0x3eb6828
-.word 0x19187ab
+.word 0x2ff
 .word 0x3eb801e
 .word 0x1f4a13c
 .word 0x3eb8821
 .word 0x1f5a93c
 .word 0x3eb9024
-.word 0x192ef6f
+.word 0x1f6e93c
 .word 0x3eb7029
-.word 0x192f7ab
+.word 0x2ff
+.word 0x3eba01d
+.word 0x2ff
+.word 0x3eba820
+.word 0x2ff
 .word 0x3ebb023
 .word 0x2ff
 .word 0x800e5872
 .word 0x2ff
-.word 0x3eba01d
-.word 0x2ff
-.word 0x3eba820
-.word 0x19de97c
 .word 0x1ff0297
 .word 0x2ff
 .word 0xb0f03fe
@@ -1475,7 +1475,7 @@
 .word 0x80040032
 .word 0x2ff
 .word 0x420f0007
-.word 0x19de93c
+.word 0x2ff
 .word 0x1006581c
 .word 0x2ff
 .word 0x420f0005
@@ -1541,20 +1541,20 @@
 .word 0x2c010002
 .word 0x2ff
 .word 0x2c0d0002
-.word 0x2ff
+.word 0x3eef87
 .word 0x5200080c
 .word 0x2ff
 .word 0x1f13002
 .word 0x2ff
 .word 0x52006803
 .word 0x2ff
-.word 0x80000030
+.word 0x81feebbc
 .word 0x2ff
 .word 0x400007e3
 .word 0x2ff
 .word 0x800841f2
 .word 0x2ff
-.word 0x420a0082
+.word 0x420a0077
 .word 0x2ff
 .word 0x80064072
 .word 0x2ff
@@ -1570,7 +1570,7 @@
 .word 0x2ff
 .word 0x5200681c
 .word 0x2ff
-.word 0x80000030
+.word 0x81feebbc
 .word 0x2ff
 .word 0x420a006e
 .word 0x2ff
@@ -1594,16 +1594,16 @@
 .word 0x2ff
 .word 0x80064772
 .word 0x2ff
+.word 0x1ec3000
+.word 0x2ff
+.word 0x1f43001
+.word 0x2ff
 .word 0x1f03002
 .word 0x2ff
-.word 0x1ec3000
-.word 0x2ff
-.word 0x1f43001
-.word 0x2ff
 .word 0x80042072
 .word 0x2ff
 .word 0x80000030
-.word 0x19d842c
+.word 0x2ff
 .word 0x81ec03bc
 .word 0x1ff632a
 .word 0x80000030
@@ -1671,14 +1671,14 @@
 .word 0x2c010002
 .word 0x2ff
 .word 0x2c0d0002
-.word 0x2ff
+.word 0x3eef87
 .word 0x500d0818
 .word 0x2ff
 .word 0x1f13802
 .word 0x2ff
 .word 0x5000080c
 .word 0x2ff
-.word 0x80000030
+.word 0x81feebbc
 .word 0x2ff
 .word 0x420a0038
 .word 0x2ff
@@ -1702,7 +1702,7 @@
 .word 0x2ff
 .word 0x80006235
 .word 0x2ff
-.word 0x420a0038
+.word 0x420a002d
 .word 0x2ff
 .word 0x80000030
 .word 0x2ff
@@ -1795,10 +1795,6 @@
 .word 0x80000030
 .word 0x2d6f86
 .word 0x80000030
-.word 0x3eef87
-.word 0x81feebbc
-.word 0x2ff
-.word 0x80000030
 .word 0x1ec6bac
 .word 0x80000030
 .word 0x1f4adac
@@ -1816,25 +1812,3 @@
 .word 0x1f6a5a8
 .word 0x80000030
 .word 0x1f284a8
-.word 0x80000030
-.word 0x3eef47
-.word 0x81fdf3bc
-.word 0x2ff
-.word 0x80000030
-.word 0x1ed63ac
-.word 0x80000030
-.word 0x1f5a5ac
-.word 0x80000030
-.word 0x1f184ac
-.word 0x800003bf
-.word 0x1e0739c
-.word 0x80000030
-.word 0x1e0b59c
-.word 0x80000030
-.word 0x1e0949c
-.word 0x80000030
-.word 0x1ee6bac
-.word 0x48005000
-.word 0x1f6adac
-.word 0x80000030
-.word 0x1f28cac
```
2026-09-04 23:01:17 -04:00
Tyler Wilding 9c86c86c74 d/jx: More files (#4360)
Breaks the 300 file milestone, also includes the majority of mips2c
functions carried forward. Some functions need some fixes in the c++
code to mips2c properly, and a small handful of the mips2c functions
require manual patching -- all spots were marked with `TODO - fix` that
had to be commented out to get things compiling.
2026-09-04 09:27:06 -04:00
Tyler Wilding 647282d896 deps: update fmt to 11.1.4 (#3880)
Fixes #3886
2025-04-12 15:59:13 -04:00
Tyler Wilding 60db0e5ef9 deps: update fmt to latest version (#3403)
This updates `fmt` to the latest version and moves to just being a copy
of their repo to make updating easier (no editing their cmake / figuring
out which files to minimally include).

The motivation for this is now that we switched to C++ 20, there were a
ton of deprecated function usages that is going away in future compiler
versions. This gets rid of all those warnings.
2024-03-05 22:11:52 -05:00
Hat Kid 17f5f74238 jak3: dump of all vu programs (#3340)
With the exception of `sprite` and the new `hfrag` renderer, everything
appears to be identical to Jak 2.
2024-01-27 11:38:03 +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
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
water111 70e231fa72 [jak 2] merc (#2039) 2022-11-30 22:36:09 -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 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
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
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
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
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 2d595c1ac0 lint: add include sorting config to clang-format (#1517) 2022-06-22 23:37:46 -04:00
water111 c80147119d [graphics] ocean near (#1234)
* dma for ocean near

* add first attempt at ocean near
2022-03-15 23:12:40 -04:00
water111 b2131d43e3 decompile goal code for ocean mid (#1231) 2022-03-12 12:58:04 -05:00
water111 9c00b0c135 [graphics] generic merc (#1192)
* begin generic merc

* more generic stuff

* generic dma generation not crashing, at least until high-speed-reject

* c

* unpacker for generic

* starting to work

* small fixes

* more fixes

* more progress

* cleanup

* fix tests

* no custom imgui assert on windows
2022-02-24 22:33:10 -05:00
water111 2342b6fb0f [graphics] MERC (#1124)
* merc dma generation

* wip very early version of merc

* small fixes

* fix

* fix more merc bugs

* derp fixed min

* oops we did need something weird on max

* merc for everything

* program optimization 1

* more optimization

* windows

* windows 2

* clean up

* fix test

* BLERC
2022-02-03 22:45:41 -05:00
water111 083202929c [graphics] tfrag3 renderer (#978)
* begin work

* work

* working objs

* exporting

* it works

* before some time of day fixes

* add time of day interp and also fix zbuffer

* some small blending fixes

* improve randomess

* clean up extraction and missing blend mode

* culling, time of day, more level fixes

* more cleanup

* cleanup memory usage

* windows fix
2021-12-04 12:33:18 -05:00
water111 3afd99a8e3 [graphics] partial tfrag implementation (#958)
* temp

* some decomp

* tfrag dma setup

* fix negative label bug

* tfrag dma setup

* tfrag, with pipeline tricks

* kinda works

* cleanup before trying some color stuff

* time of day works

* clean up

* temp before render changes

* a few more fixes

* fix up tests

* clean up

* fix

* fix alignment

* one more cleanup
2021-11-13 20:44:17 -05:00
water111 a96710f0c5 VU micro mode disassembler (#517)
* wip

* more

* the rest of the disassembler
2021-05-23 16:59:09 -04:00