Skip to content

Commit

Permalink
[jak3] Decompile sprite and debug files (#3420)
Browse files Browse the repository at this point in the history
  • Loading branch information
water111 authored Mar 11, 2024
1 parent 937af79 commit fae20a1
Show file tree
Hide file tree
Showing 29 changed files with 7,546 additions and 147 deletions.
240 changes: 126 additions & 114 deletions decompiler/config/jak3/all-types.gc

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions decompiler/config/jak3/ntsc_v1/hacks.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,8 @@
"(method 16 ocean)",

// unknown instructions
"debug-line-clip?",
// logand with #f arg
"bugfix?",
// "bugfix?",
// CFG failed
"draw-inline-array-instance-shrub",

Expand Down Expand Up @@ -273,7 +272,11 @@
"(method 9 curve-color-fast)": [0, 1],
"evaluate-color-curve-fast": [0, 1],
"(anon-function 0 target-death)": [71, 131, 132, 137],
"target-board-handler": [15, 16, 20]
"target-board-handler": [15, 16, 20],
"sprite-draw-distorters": [4, 5],
"(method 10 simple-sprite-system)": [0],
"add-debug-box-with-transform": [0, 3],
"add-debug-line-sphere": [0]
},

// Sometimes the game might use format strings that are fetched dynamically,
Expand Down Expand Up @@ -409,7 +412,8 @@
"generic-warp-dest",
"generic-warp-envmap-dest",
"generic-no-light-proc",
"(method 21 cloth-system)"
"(method 21 cloth-system)",
"debug-line-clip?"
],

"mips2c_jump_table_functions": {},
Expand Down
10 changes: 10 additions & 0 deletions decompiler/config/jak3/ntsc_v1/label_types.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -275,5 +275,15 @@
["L683", "uint64", true],
["L685", "uint64", true],
["L678", "uint64", true]
],
"sprite-glow": [
["L29", "vu-function"],
["L27", "dma-packet"]
],
"debug": [
["L286", "(inline-array vector)", 3],
["L287", "(inline-array vector)", 3],
["L283", "(inline-array vector)", 32],
["L265", "(inline-array vector)", 4]
]
}
48 changes: 47 additions & 1 deletion decompiler/config/jak3/ntsc_v1/stack_structures.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -250,5 +250,51 @@
],
"add-a-bunch": [[16, "vector"]],
"birth-pickup-at-point": [[16, "vector"]],
"(code pickup eco)": [[16, "event-message-block"]]
"(code pickup eco)": [[16, "event-message-block"]],
"(method 10 simple-sprite-system)": [[16, ["array", "texture-id", 128]]],
"make-debug-sphere-table": [
[16, "vector"],
[32, "vector"],
[48, "vector"],
[64, "vector"],
[80, "vector"],
[96, "vector"],
[112, "vector"]
],
"add-debug-sphere-from-table": [
[16, "vector"],
[48, "vector"],
[64, "vector"]
],
"internal-draw-debug-line": [
[16, "vector4w-2"],
[48, "vector4w-2"],
[80, "vector"],
[96, "vector"]
],
"add-debug-box-with-transform": [
[16, ["inline-array", "vector", 8]],
[144, ["inline-array", "vector", 2]],
[176, "vector"]
],
"add-debug-line-sphere": [
[48, "matrix"],
[112, "matrix"],
[128, "vector"],
[144, "vector"],
[160, "vector"],
[176, "vector"],
[208, "vector"],
[192, "vector"]
],
"add-debug-arc": [
[16, "vector"],
[32, "vector"]
],
"add-debug-curve": [
[16, "vector"],
[32, "vector"]
],
"add-debug-points": [[16, "vector"]],
"add-debug-cursor": [[16, "vector"]]
}
74 changes: 74 additions & 0 deletions decompiler/config/jak3/ntsc_v1/type_casts.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -2082,5 +2082,79 @@
[[109, 116], "a0", "dma-packet"],
[[127, 134], "a0", "dma-packet"],
[[148, 155], "a0", "dma-packet"]
],
"sprite-init-distorter": [
[50, "a3", "uint"],
[[46, 59], "a1", "dma-packet"]
],
"sprite-draw-distorters": [
[[73, 98], "a0", "vector"],
["_stack_", 32, "vector"],
["_stack_", 48, "vector"],
[[174, 199], "a1", "dma-packet"],
[[206, 213], "a0", "dma-packet"],
[[215, 221], "a0", "vector4w"],
[[223, 231], "a0", "dma-packet"],
[[251, 276], "a1", "dma-packet"],
[[281, 288], "a1", "dma-packet"],
[[290, 296], "a1", "vector4w"],
[[297, 305], "v1", "dma-packet"]
],
"sprite-glow-init-engine": [
[[8, 22], "a0", "dma-packet"],
[[32, 50], "a1", "dma-packet"],
[[52, 74], "a1", "dma-packet"],
[[76, 84], "a0", "dma-packet"],
[[85, 92], "v1", "dma-packet"]
],
"sprite-glow-add-sprite": [[[0, 33], "v1", "sprite-glow-cnt-template"]],
"sprite-glow-add-simple-sprite": [
[[0, 33], "v1", "sprite-glow-ref-template"]
],
"add-shader-to-dma": [[[6, 8], "v1", "(pointer uint32)"]],
"add-debug-sphere-from-table": [
[[38, 41], "v1", "vector"],
[[55, 59], "s0", "(inline-array vector)"]
],
"add-debug-point": [
[[36, 43], "a3", "dma-packet"],
[[45, 52], "a3", "gs-gif-tag"],
[[65, 73], "a3", "vector4w-2"],
[[85, 93], "a3", "vector4w-2"],
[[102, 110], "a3", "vector4w-2"],
[[122, 130], "a1", "vector4w-2"],
[[129, 148], "a0", "(pointer uint64)"]
],
"internal-draw-debug-line": [
[[5, 224], "s5", "rgba"],
[[27, 29], "v1", "rgba"],
[[109, 115], "a3", "dma-packet"],
[[118, 124], "a3", "gs-gif-tag"],
[[232, 245], "a1", "(inline-array vector4w-2)"],
[[107, 267], "a0", "(pointer uint64)"]
],
"add-debug-flat-triangle": [
[[73, 80], "a3", "dma-packet"],
[[82, 89], "a3", "gs-gif-tag"],
[[111, 131], "a3", "(inline-array vector)"],
[[68, 149], "a0", "(pointer uint64)"]
],
"add-debug-line2d": [
[[61, 68], "a2", "dma-packet"],
[[70, 77], "a2", "gs-gif-tag"],
[[79, 85], "a2", "vector4w-2"],
[[87, 93], "a2", "vector4w-2"],
[[97, 111], "a0", "(pointer uint64)"]
],
"drawable-frag-count": [[[14, 20], "s5", "drawable-group"]],
"add-boundary-shader": [
[[6, 12], "a0", "gs-gif-tag"],
[[14, 31], "s5", "adgif-shader"]
],
"add-debug-bound": [
//[105, "v1", "dma-packet"],
//[85, "a0", "dma-packet"],
["_stack_", 16, "dma-packet"],
[91, "v1", "dma-packet"]
]
}
Loading

0 comments on commit fae20a1

Please sign in to comment.