Files
jak-project/test/decompiler/reference/jak3/engine/util/script-h_REF.gc
T
Hat Kid 2969833b2d decomp3: more engine stuff, detect non-virtual state inheritance (#3377)
- `speech`
- `ambient`
- `water-h`
- `vol-h`
- `generic-obs`
- `carry-h`
- `pilot-h`
- `board-h`
- `gun-h`
- `flut-h`
- `indax-h`
- `lightjak-h`
- `darkjak-h`
- `target-util`
- `history`
- `collide-reaction-target`
- `logic-target`
- `sidekick`
- `projectile`
- `voicebox`
- `ragdoll-edit`
- most of `ragdoll` (not added to gsrc yet)
- `curves`
- `find-nearest`
- `lightjak-wings`
- `target-handler`
- `target-anim`
- `target`
- `target2`
- `target-swim`
- `target-lightjak`
- `target-invisible`
- `target-death`
- `target-gun`
- `gun-util`
- `board-util`
- `target-board`
- `board-states`
- `mech-h`
- `vol`
- `vent`
- `viewer`
- `gem-pool`
- `collectables`
- `crates`
- `secrets-menu`

Additionally:

- Detection of non-virtual state inheritance
- Added a config file that allows overriding the process stack size set
by `stack-size-set!` calls
- Fix for integer multiplication with `r0`
- Fixed detection for the following macros:
	- `static-attack-info`
- `defpart` and `defpartgroup` (probably still needs adjustments, uses
Jak 2 implementation at the moment)
- `sound-play` (Jak 3 seems to always call `sound-play-by-name` with a
`sound-group` of 0, so the macro has been temporarily defaulted to use
that)

One somewhat significant change made here that should be noted is that
the return type of `process::init-from-entity!` was changed to `object`.
I've been thinking about this for a while, since it looks a bit nicer
without the `(none)` at the end and I have recently encountered init
methods that early return `0`.
2024-03-03 15:15:27 -05:00

98 lines
2.9 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition of type script-form
(deftype script-form (structure)
((name symbol)
(spec pair)
(func (function script-context object))
)
(:methods
(script-form-method-9 () none)
)
)
;; definition for method 3 of type script-form
(defmethod inspect ((this script-form))
(when (not this)
(set! this this)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" this 'script-form)
(format #t "~1Tname: ~A~%" (-> this name))
(format #t "~1Tspec: ~A~%" (-> this spec))
(format #t "~1Tfunc: ~A~%" (-> this func))
(label cfg-4)
this
)
;; definition of type script-context
(deftype script-context (structure)
((load-state load-state)
(key object)
(process process)
(trans vector)
(side-effect? symbol)
(got-error? symbol)
(expr pair)
(param-count int32)
(param object 16)
(param-type object 16)
)
(:methods
(new (symbol type object process vector) _type_)
(eval! (_type_ pair) object)
(script-context-method-10 () none)
(script-context-method-11 () none)
)
)
;; definition for method 3 of type script-context
(defmethod inspect ((this script-context))
(when (not this)
(set! this this)
(goto cfg-10)
)
(format #t "[~8x] ~A~%" this 'script-context)
(format #t "~1Tload-state: ~A~%" (-> this load-state))
(format #t "~1Tkey: ~A~%" (-> this key))
(format #t "~1Tprocess: ~A~%" (-> this process))
(format #t "~1Ttrans: #<vector @ #x~X>~%" (-> this trans))
(format #t "~1Tside-effect?: ~A~%" (-> this side-effect?))
(format #t "~1Tgot-error?: ~A~%" (-> this got-error?))
(format #t "~1Texpr: ~A~%" (-> this expr))
(format #t "~1Tparam-count: ~D~%" (-> this param-count))
(format #t "~1Tparam[16] @ #x~X~%" (-> this param))
(dotimes (s5-0 (-> this param-count))
(format #t "~T [~D]~1Tparam: ~`object`P~%" s5-0 (-> this param s5-0))
)
(format #t "~1Tparam-type[16] @ #x~X~%" (-> this param-type))
(dotimes (s5-1 (-> this param-count))
(format #t "~T [~D]~1Tparam-type: ~`object`P~%" s5-1 (-> this param-type s5-1))
)
(label cfg-10)
this
)
;; definition for method 0 of type script-context
;; WARN: Return type mismatch structure vs script-context.
(defmethod new script-context ((allocation symbol) (type-to-make type) (arg0 object) (arg1 process) (arg2 vector))
(let ((t9-0 (method-of-type structure new))
(v1-1 type-to-make)
)
(-> type-to-make size)
(let ((v0-0 (t9-0 allocation v1-1)))
(set! (-> (the-as script-context v0-0) key) arg0)
(set! (-> (the-as script-context v0-0) process) arg1)
(set! (-> (the-as script-context v0-0) load-state) *load-state*)
(set! (-> (the-as script-context v0-0) side-effect?) #t)
(set! (-> (the-as script-context v0-0) got-error?) #f)
(set! (-> (the-as script-context v0-0) trans) arg2)
(the-as script-context v0-0)
)
)
)
;; failed to figure out what this is:
0