Skip to content

Commit

Permalink
[jak3] decompile (but not port) texture (#3346)
Browse files Browse the repository at this point in the history
For now - just a plain decompilation, with no PC port changes. I think
it'll be easier to do those once we have a little bit more decompiled.
  • Loading branch information
water111 authored Jan 27, 2024
1 parent 8d0d057 commit bfe0a72
Show file tree
Hide file tree
Showing 15 changed files with 5,709 additions and 361 deletions.
298 changes: 187 additions & 111 deletions decompiler/config/jak3/all-types.gc

Large diffs are not rendered by default.

26 changes: 25 additions & 1 deletion decompiler/config/jak3/ntsc_v1/type_casts.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,31 @@
],
"(method 3 connection-minimap)": [
[97, "f0", "float"]

],
"dma-buffer-add-ref-texture": [
[[47, 54], "a3", "dma-packet"],
[[56, 69], "a3", "gs-gif-tag"],
[[71, 87], "a2", "dma-packet"]
],
"texture-page-default-allocate":
[[51, "a3", "(pointer int32)"]],
"texture-page-font-allocate":[[33, "a3", "(pointer int32)"]],
"upload-vram-pages":[[[187, 193], "v1", "dma-packet"]],
"upload-vram-pages-pris": [[[181, 187], "v1", "dma-packet"]],
"(method 13 texture-page)": [[45, "a0", "(pointer uint64)"]],
"(method 11 texture-pool)": [[217, "a0", "(pointer uint64)"]],
"texture-page-login": [[34, "v0", "texture-page"]],
"(method 9 texture-page-dir)": [
[[36, 40], "t1", "adgif-shader"],
[[31, 41], "t2", "(pointer shader-ptr)"],
[37, "t0", "(pointer int32)"]
],
"texture-page-dir-inspect": [[[137, 138], "v1", "adgif-shader"]],
"(method 24 texture-pool)": [
[[77, 100], "a1", "adgif-shader"]
// [[70, 93], "a1", "adgif-shader"],
// [92, "a1", "adgif-shader"]
]


}
337 changes: 337 additions & 0 deletions decompiler/config/jak3/ntsc_v1/var_names.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -536,5 +536,342 @@
"args": [
"work"
]
},
"texture-bpp": {
"args": [
"tex-format"
]
},
"texture-qwc": {
"args": [
"w",
"h",
"tex-format"
]
},
"physical-address": {
"args": [
"addr"
]
},
"dma-buffer-add-ref-texture": {
"args": [
"dma-buf",
"tex-data-ptr",
"w",
"h",
"tex-format"
]
},
"gs-find-block": {
"args": [
"bx",
"by",
"tex-format"
]
},
"gs-page-width": {
"args": [
"tex-format"
]
},
"gs-page-height": {
"args": [
"tex-format"
]
},
"gs-block-width": {
"args": [
"tex-format"
]
},
"gs-block-height": {
"args": [
"tex-format"
]
},
"gs-largest-block": {
"args": [
"w",
"h",
"tex-format"
]
},
"gs-blocks-used": {
"args": [
"w",
"h",
"tex-format"
]
},
"texture-page-default-allocate": {
"args": [
"pool",
"page",
"heap",
"page-id"
]
},
"texture-page-common-allocate": {
"args": [
"pool",
"page",
"heap",
"page-id"
]
},
"texture-page-font-allocate": {
"args": [
"pool",
"page",
"heap",
"page-id"
]
},
"texture-page-common-boot-allocate": {
"args": [
"pool",
"page",
"heap",
"page-id"
]
},
"upload-vram-data": {
"args": [
"dma-buf",
"dest",
"data-ptr",
"h",
"w"
]
},
"upload-vram-pages": {
"args": [
"pool",
"pool-segment",
"page",
"mode",
"bucket"
]
},
"update-vram-pages": {
"args": [
"pool",
"pool-segment",
"page",
"mode"
]
},
"upload-vram-pages-pris": {
"args": [
"pool",
"pool-segment",
"page",
"bucket",
"mask"
]
},
"texture-page-level-allocate": {
"args": [
"pool",
"page",
"heap",
"page-id"
]
},
"texture-page-size-check": {
"args": [
"pool",
"lev",
"print?"
]
},
"upload-textures": {
"args": [
"pool"
]
},
"texture-relocate": {
"args": [
"dma-buf",
"tex",
"dest",
"tex-format",
"clut-dest"
]
},
"texture-page-login": {
"args": [
"id",
"alloc-func",
"heap"
]
},
"lookup-texture-by-id": {
"args": [
"id"
]
},
"lookup-texture-by-id-fast": {
"args": [
"id"
]
},
"lookup-texture-by-name": {
"args": [
"tex-name",
"page-name",
"page-out"
]
},
"lookup-texture-id-by-name": {
"args": [
"tex-name",
"page-name"
]
},
"lookup-level-texture-by-name": {
"args": [
"tex-name",
"lev",
"page-out"
]
},
"lookup-tex-id-from-texture": {
"args": [
"tex"
]
},
"lookup-level-texture-id-by-name": {
"args": [
"tex-name",
"lev",
"lev-page-idx"
]
},
"link-texture-by-id": {
"args": [
"id",
"shader"
]
},
"adgif-shader-update!": {
"args": [
"shader",
"tex"
]
},
"hack-texture": {
"args": [
"tex"
]
},
"adgif-shader-login": {
"args": [
"shader"
]
},
"adgif-shader-login-no-remap": {
"args": [
"shader"
]
},
"adgif-shader-login-fast": {
"args": [
"shader"
]
},
"adgif-shader-login-no-remap-fast": {
"args": [
"shader"
]
},
"adgif-shader<-texture-simple!": {
"args": [
"shader",
"tex"
]
},
"set-dirty-mask!": {
"args": [
"lev",
"mask-idx",
"m0",
"m1"
]
},
"(method 13 texture-pool)": {
"args": [
"this",
"lev",
"texture-page-count",
"texture-ids"
]
},
"(method 14 texture-pool)": {
"args": [
"pool",
"lev",
"category",
"bucket"
]
},
"(method 15 texture-pool)": {
"args": [
"this",
"size"
]
},
"(method 16 texture-pool)": {
"args": [
"this",
"segment",
"size"
]
},
"(method 17 texture-pool)": {
"args": [
"this",
"page"
]
},
"(method 18 texture-pool)": {
"args": [
"this",
"id"
]
},
"(method 7 texture-page)": {
"args": [
"this",
"heap",
"filename"
]
},
"(method 9 texture-page)": {
"args": [
"this",
"heap"
]
},
"(method 11 texture-page)": {
"args": [
"this",
"new-dest",
"seg-id"
]
},
"(method 12 texture-page)": {
"args": [
"page",
"buf",
"mode"
]
},
"(method 13 texture-page)": {
"args": [
"this",
"mode"
]
}
}
2 changes: 2 additions & 0 deletions goal_src/jak3/engine/gfx/blit-displays-h.gc
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,5 @@
(set! (-> this horizontal-flip-flag) arg0)
arg0
)

(define-extern *blit-displays-work* blit-displays-work)
3 changes: 3 additions & 0 deletions goal_src/jak3/engine/gfx/texture/texture-anim-h.gc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
;; name in dgo: texture-anim-h
;; dgos: GAME

(declare-type texture-anim-array array)
(define-extern update-texture-anim (function bucket-id texture-anim-array none))

;; DECOMP BEGINS

(deftype texture-anim-layer (structure)
Expand Down
Loading

0 comments on commit bfe0a72

Please sign in to comment.