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.
This commit is contained in:
Hat Kid
2022-09-11 01:02:58 +02:00
committed by GitHub
parent 81b6d5fe08
commit 7339b2b965
19 changed files with 7709 additions and 28 deletions
+13 -15
View File
@@ -3016,8 +3016,8 @@
(rn10)
(rn11)
(rn12)
(rn13)
(rn14)
(merc)
(emerc)
(rn15)
(rn16)
(rn17)
@@ -7461,7 +7461,7 @@
(define-extern adgif-shader-update! (function adgif-shader texture none))
;; (define-extern adgif-shader<-texture-with-update! function) ;; (function adgif-shader texture adgif-shader)
;; (define-extern hack-texture function)
;; (define-extern adgif-shader-login function) ;; (function adgif-shader texture)
(define-extern adgif-shader-login (function adgif-shader texture))
(define-extern adgif-shader-login-no-remap (function adgif-shader texture))
;; (define-extern adgif-shader-login-fast function) ;; (function adgif-shader texture)
;; (define-extern adgif-shader-login-no-remap-fast function) ;; (function adgif-shader texture)
@@ -10344,7 +10344,7 @@
:size-assert #x18
:flag-assert #xa00000018
(:methods
(login-adgifs (_type_) none 9)
(login-adgifs (_type_) merc-fragment 9)
)
)
@@ -22016,7 +22016,7 @@
;; merc-vu1 ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; (define-extern merc-vu1-block object) ;; vu-function
(define-extern merc-vu1-block vu-function)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; emerc-vu1 ;;
@@ -22107,7 +22107,6 @@
;; merc ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#|
(deftype texture-login-data (structure)
((default-texture-index int32 :offset-assert 0)
(current-texture-index int32 :offset-assert 4)
@@ -22119,7 +22118,6 @@
:size-assert #x14
:flag-assert #x900000014
)
|#
#|
(deftype merc-fragment-control (structure)
@@ -22143,15 +22141,15 @@
)
|#
;; (define-extern *texture-login-data* object)
;; (define-extern texture-usage-init function)
;; (define-extern texture-usage-update function)
;; (define-extern merc-stats-display function) ;; (function merc-ctrl none)
(define-extern *texture-login-data* texture-login-data)
(define-extern texture-usage-init (function merc-ctrl symbol))
(define-extern texture-usage-update (function texture symbol))
(define-extern merc-stats-display (function merc-ctrl none))
(define-extern merc-stats (function none))
;; (define-extern merc-edge-stats function) ;; (function none)
(define-extern merc-edge-stats (function none))
(define-extern merc-vu1-add-vu-function (function dma-packet vu-function int dma-gif-packet))
;; (define-extern merc-vu1-initialize-chain function) ;; (function dma-gif-packet dma-packet)
;; (define-extern merc-vu1-init-buffer function) ;; (function bucket-id gs-test int none)
(define-extern merc-vu1-initialize-chain (function dma-gif-packet int dma-packet))
(define-extern merc-vu1-init-buffer (function bucket-id int symbol int))
(define-extern merc-vu1-init-buffers (function none))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -28927,7 +28925,7 @@
;; (define-extern render-eyes-64-different function)
;; (define-extern debug-eyes function)
(define-extern update-eyes (function none))
;; (define-extern get-eye-block function) ;; (function int int int)
(define-extern get-eye-block (function int int int))
;; (define-extern convert-eye-data function) ;; (function eye uint float)
;; (define-extern merc-eye-anim function) ;; (function process-drawable none)
;; (define-extern set-eye-draw-flag function)
+2 -1
View File
@@ -165,5 +165,6 @@
["L480", "vector"],
["L479", "vector"],
["L474", "vector"]
]
],
"merc-vu1": [["L1", "vu-function"]]
}
+33
View File
@@ -1909,6 +1909,39 @@
[9, "t9", "(function editable-light editable-array none)"]
],
"(method 25 editable)": [[[12, 17], "a0", "editable"]],
"merc-edge-stats": [[31, "v1", "merc-ctrl"]],
"(method 8 merc-ctrl)": [
[46, "s2", "pointer"], // was merc-fragment-control
[[22, 45], "s2", "merc-fragment-control"],
[[89, 93], "a1", "merc-blend-ctrl"],
[103, "a1", "pointer"]
],
"merc-vu1-initialize-chain": [
[[13, 19], "gp", "(pointer vif-tag)"],
[[19, 116], "s5", "merc-vu1-low-mem"],
[127, "gp", "(inline-array dma-packet)"]
],
"(method 9 merc-fragment)": [[[13, 265], "s3", "adgif-shader"]],
"(method 9 merc-effect)": [
[46, "s4", "pointer"],
[47, "s5", "pointer"],
[[0, 46], "s4", "merc-fragment"],
[[0, 47], "s5", "merc-fragment-control"]
],
"merc-vu1-init-buffer": [
[[21, 37], "a0", "dma-packet"],
[[37, 40], "a0", "gs-gif-tag"],
[45, "a0", "(pointer gs-test)"],
[47, "a0", "(pointer gs-reg64)"],
[49, "a1", "(pointer gs-reg64)"],
[52, "a0", "(pointer gs-test)"],
[54, "a0", "(pointer gs-test)"],
[[63, 68], "v1", "dma-packet"]
],
"texture-usage-init": [
[23, "a1", "texture-masks"],
[24, "a1", "texture-mask"]
],
// placeholder
"placeholder-do-not-add-below": []
}
+28
View File
@@ -665,5 +665,33 @@
"v1-48": "time-after-vsync",
"s5-1": "next-dma-buf"
}
},
"merc-vu1-add-vu-function": {
"args": ["dma", "func", "flush-mode"],
"vars": {
"v1-0": "func-data",
"a3-0": "qwc",
"a1-1": "dst",
"t0-1": "qwc-this-time"
}
},
"merc-vu1-init-buffer": {
"args": ["dma-bucket"],
"vars": {
"gp-0": "bucket",
"s4-0": "dma-buf"
}
},
"(method 9 merc-effect)": {
"vars": {
"v1-0": "data",
"v1-1": "tex",
"a0-8": "seg",
"s3-0": "frag-idx",
"s2-0": "ctrl-size",
"s1-0": "geo-size",
"s4-0": ["geo", "merc-fragment"],
"s5-0": ["ctrl", "merc-fragment-control"]
}
}
}
+1 -1
View File
@@ -8,7 +8,7 @@
// if you want to filter to only some object names.
// it will make the decompiler much faster.
"allowed_objects": [],
"banned_objects": ["effect-control"],
"banned_objects": ["effect-control", "time-of-day"],
////////////////////////////
// CODE ANALYSIS OPTIONS