Skip to content

Commit

Permalink
[jak3] decomp gsound (#3364)
Browse files Browse the repository at this point in the history
Decompile `gsound.gc`
  • Loading branch information
water111 committed Feb 3, 2024
1 parent 8b1c775 commit 2213602
Show file tree
Hide file tree
Showing 25 changed files with 4,589 additions and 164 deletions.
1 change: 1 addition & 0 deletions decompiler/analysis/insert_lets.cpp
Expand Up @@ -1630,6 +1630,7 @@ FormElement* rewrite_proc_new(LetElement* in, const Env& env, FormPool& pool) {
expected_name = fmt::format("'{}", proc_type);
break;
case GameVersion::Jak2:
case GameVersion::Jak3:
expected_name = fmt::format("(symbol->string (-> {} symbol))", proc_type);
break;
default:
Expand Down
303 changes: 186 additions & 117 deletions decompiler/config/jak3/all-types.gc

Large diffs are not rendered by default.

Expand Up @@ -13,5 +13,6 @@
[0, "(function none)"],
[1, "(function none)"],
[2, "(function none)"]
]
],
"gsound": [[1, "(function none)"]]
}
10 changes: 9 additions & 1 deletion decompiler/config/jak3/ntsc_v1/stack_structures.jsonc
Expand Up @@ -14,6 +14,14 @@
"show-mc-info": [[16, "mc-slot-info"]],
"joint-mod-blend-world-callback": [[16, "joint-mod-blend-world-work"]],
"(method 42 nav-mesh)": [[16, "vector"], [32, "vector"]],
"(method 44 nav-mesh)": [[16, "vector"], [32, "vector"]]
"(method 44 nav-mesh)": [[16, "vector"], [32, "vector"]],
"string->sound-name": [[16, ["array", "sound-name", 1]]],
"sound-name->string": [[16, ["array", "uint8", 16]]],
"doppler-pitch-shift": [[16, ["inline-array", "vector", 2]]],
"(anon-function 1 gsound)": [
[16, ["array", "symbol", 4]],
[32, ["array", "symbol", 4]]
]


}
55 changes: 54 additions & 1 deletion decompiler/config/jak3/ntsc_v1/type_casts.jsonc
Expand Up @@ -372,6 +372,59 @@
[27, "s4", "uint"],
[37, "s4", "uint"],
[60, "s4", "pointer"]
]
],
"ramdisk-load": [[[7, 12], "v1", "ramdisk-rpc-load"]],
"sound-buffer-dump": [[[13, 39], "s3", "sound-rpc-play"]],
"(method 10 engine-sound-pers)": [[[2, 17], "v1", "sound-rpc-set-param"]],
"check-irx-version": [[[3, 51], "gp", "sound-rpc-get-irx-version"]],
"sound-bank-iop-store": [[[7, 11], "v1", "sound-rpc-bank-cmd"]],
"sound-bank-iop-free": [[[7, 12], "v1", "sound-rpc-bank-cmd"]],
"sound-bank-load": [[[11, 16], "v1", "sound-rpc-load-bank"]],
"sound-bank-load-from-iop": [[[7, 12], "v1", "sound-rpc-load-bank"]],
"sound-bank-load-from-ee": [[[8, 14], "v1", "sound-rpc-load-bank"]],
"sound-bank-unload": [[[6, 11], "v1", "sound-rpc-unload-bank"]],
"sound-music-load": [[[6, 11], "v1", "sound-rpc-load-music"]],
"sound-music-unload": [[[3, 8], "v1", "sound-rpc-unload-music"]],
"set-language": [[[6, 9], "v1", "sound-rpc-set-language"]],
"sound-set-stereo-mode": [[[4, 9], "v1", "sound-rpc-set-stereo-mode"]],
"list-sounds": [[[3, 7], "v1", "sound-rpc-list-sounds"]],
"string->sound-name": [[[2, 18], "a1", "(pointer uint8)"]],
"sound-set-volume": [[[3, 16], "v1", "sound-rpc-set-master-volume"]],
"sound-set-reverb": [[[5, 25], "v1", "sound-rpc-set-reverb"]],
"sound-set-ear-trans": [[[7, 45], "gp", "sound-rpc-set-ear-trans"]],
"sound-name->string": [[2, "a1", "(pointer sound-name)"]],
"sound-play-by-name": [
[[12, 45], "s5", "sound-rpc-play"],
[[22, 39], "s3", "process-drawable"]
],
"sound-play-by-spec": [
[[4, 54], "s5", "sound-rpc-play"],
[[31, 47], "s3", "process-drawable"]
],
"sound-pause": [[[3, 8], "v1", "sound-rpc-pause-sound"]],
"sound-stop": [[[3, 8], "v1", "sound-rpc-stop-sound"]],
"sound-continue": [[[3, 8], "v1", "sound-rpc-continue-sound"]],
"sound-group-pause": [[[3, 7], "v1", "sound-rpc-pause-group"]],
"sound-group-stop": [[[3, 7], "v1", "sound-rpc-stop-group"]],
"sound-group-continue": [[[3, 7], "v1", "sound-rpc-continue-group"]],
"sound-set-flava": [[[3, 10], "v1", "sound-rpc-set-flava"]],
"sound-set-midi-reg": [[[3, 10], "v1", "sound-rpc-set-midi-reg"]],
"sound-set-fps": [[[3, 10], "v1", "sound-rpc-set-fps"]],
"(method 0 ambient-sound)": [
[143, "v1", "sound-spec"],
[147, "v1", "sound-spec"],
[150, "v1", "sound-spec"],
[154, "v1", "sound-spec"],
["_stack_", 16, "sound-spec"],
["_stack_", 64, "res-tag"],
["_stack_", 48, "(pointer float)"],
["_stack_", 32, "sound-name"],
[[117, 183], "s5", "ambient-sound"]
],
"ear-trans": [
[32, "s5", "process-focusable"]
],
"loader-test-command": [[[5, 10], "v1", "sound-rpc-test-cmd"]]


}
249 changes: 249 additions & 0 deletions decompiler/config/jak3/ntsc_v1/var_names.jsonc
Expand Up @@ -979,5 +979,254 @@
"start",
"end"
]
},
"sound-name=": {
"args": [
"a",
"b"
]
},
"str-id-is-playing?": {
"args": [
"id"
]
},
"current-str-pos": {
"args": [
"id"
]
},
"current-str-status": {
"args": [
"id"
]
},
"is-ramdisk-loaded?": {
"args": [
"name"
]
},
"sound-bank-iop-store": {
"args": [
"name"
]
},
"sound-bank-iop-free": {
"args": [
"name"
]
},
"sound-bank-load": {
"args": [
"name",
"mode",
"priority"
]
},
"sound-bank-load-from-iop": {
"args": [
"name"
]
},
"sound-bank-load-from-ee": {
"args": [
"name",
"addr"
]
},
"sound-bank-unload": {
"args": [
"name"
]
},
"sound-music-load": {
"args": [
"name"
]
},
"set-language": {
"args": [
"lang"
]
},
"sound-set-stereo-mode": {
"args": [
"mode"
]
},
"sound-command->string": {
"args": [
"cmd"
]
},
"sound-trans-convert": {
"args": [
"int-trans",
"meter-trans"
]
},
"sound-unit-vector-convert": {
"args": [
"int-unit-vector",
"float-unit-vector"
]
},
"sound-angle-convert": {
"args": [
"float-angle"
]
},
"string->sound-name": {
"args": [
"str"
]
},
"sound-name->string": {
"args": [
"name"
]
},
"sound-set-volume": {
"args": [
"group",
"vol"
]
},
"sound-set-reverb": {
"args": [
"reverb",
"left",
"right",
"core"
]
},
"sound-set-ear-trans": {
"args": [
"ear0",
"ear1",
"cam",
"fwd",
"left",
"scale"
]
},
"sound-play-by-name": {
"args": [
"name",
"id",
"vol",
"pitch",
"bend",
"group",
"trans"
]
},
"sound-play-by-spec": {
"args": [
"spec",
"name",
"trans"
]
},
"sound-pause": {
"args": [
"id"
]
},
"sound-stop": {
"args": [
"id"
]
},
"sound-continue": {
"args": [
"id"
]
},
"sound-group-pause": {
"args": [
"group"
]
},
"sound-group-stop": {
"args": [
"group"
]
},
"sound-group-continue": {
"args": [
"group"
]
},
"sound-set-flava": {
"args": [
"flava",
"excitement"
]
},
"sound-set-midi-reg": {
"args": [
"reg",
"val"
]
},
"sound-set-fps": {
"args": [
"fps"
]
},
"show-iop-info": {
"args": [
"dma"
]
},
"show-iop-memory": {
"args": [
"dma"
]
},
"ear-trans": {
"args": [
"mode"
]
},
"loader-test-command": {
"args": [
"cmd",
"param"
]
},
"doppler-pitch-shift": {
"args": [
"sound-pos",
"sound-vel"
]
},
"(method 0 ambient-sound)": {
"args": [
"allocation",
"type-to-make",
"spec",
"trans",
"lump-time"
]
},
"(method 10 ambient-sound)": {
"args": [
"this",
"new-sound"
]
},
"(method 11 ambient-sound)": {
"args": [
"this",
"new-trans"
]
},
"(method 12 ambient-sound)": {
"args": [
"this",
"new-vol"
]
}
}
1 change: 1 addition & 0 deletions goal_src/jak3/engine/camera/cam-interface-h.gc
Expand Up @@ -7,6 +7,7 @@

(define-extern math-camera-matrix (function matrix))
(define-extern camera-pos (function vector))
(define-extern math-camera-pos (function vector))

;; DECOMP BEGINS

Expand Down
2 changes: 2 additions & 0 deletions goal_src/jak3/engine/game/effect-control-h.gc
Expand Up @@ -12,6 +12,8 @@
)
;; ---effect-control-flag

(define-extern effect-param->sound-spec (function sound-spec (pointer float) int process-focusable sound-spec))
(define-extern *debug-effect-control* symbol)

;; DECOMP BEGINS

Expand Down
2 changes: 1 addition & 1 deletion goal_src/jak3/engine/game/game-info-h.gc
Expand Up @@ -239,7 +239,7 @@
(load-state-method-9 () none)
(load-state-method-10 () none)
(load-state-method-11 () none)
(load-state-method-12 () none)
(want-sound-banks (_type_ (pointer symbol)) none)
(load-state-method-13 () none)
(load-state-method-14 () none)
(load-state-method-15 () none)
Expand Down
1 change: 1 addition & 0 deletions goal_src/jak3/engine/game/main-h.gc
Expand Up @@ -6,6 +6,7 @@
;; dgos: GAME

(declare-type debug-menu-context basic)
(define-extern movie? (function symbol))

;; +++main-h:collide-spec
(defenum collide-spec
Expand Down

0 comments on commit 2213602

Please sign in to comment.