Files
jak-project/test/decompiler/reference/jak2/engine/entity/entity-table_REF.gc
T
Hat Kid 67d4eda169 decomp: hover-* files, wasp, crimson-guard-hover, flamer, target-turret, drill-turret, jellyfish (#2198)
Manual patches:

- `drill-turret`: The static data for `*turret-13-path*`,
`*turret-14-path*` and `*turret-15-path*` was decompiled by hand and the
integers in the `set-speed-mult` events have been replaced with boxed
integer arrays that contain only that integer in order to make the
compiler happy. To that effect, the event handler in `target-turret` was
changed to access that array instead of just accessing the int.
- `hover-nav-control`: In `hover-nav-control::10`, `arg2` is usually a
`vector`, but there are some places where it is called with `#t` as
`arg2` and, subsequently, crashes the game because it tries to access
the `quad` of `arg2` if `arg2` is truthy. To mitigate this, the
condition `arg2` has been replaced with `(and (!= arg2 #t) arg2)` (in
this case, it would jump to the `else` that just resets the `dest-vel`
and `transv` `quad`s)
- `drill-baron`: The static data for `*drill-ship-turret-speed-event*`
has been decompiled by hand.

TODOs:
- Jellyfish crash the game
- Destroying the metalhead eggs that are on the breakable wall crashes
the game (already happened with the Peacemaker before)
- Figure out why static data of type `turret-path-event` doesn't
decompile

The docs for all the hover-nav and nav-network code could use some love
in the future, I'm not smart enough to figure out what any of that code
actually means, but it seems to work...

Also threw in the fix for the ▲ that was accidentally left commented
out.
2023-02-09 18:22:56 -05:00

218 lines
9.7 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition for symbol *entity-info*, type (array entity-info)
(define *entity-info* (new 'static 'boxed-array :type entity-info
(new 'static 'entity-info
:ptype (type-ref stadium-part :method-count 16)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref citywide-part :method-count 16)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref ctywide-part :method-count 16)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref tomb-part :method-count 16)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref ctyslumb-part :method-count 16)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref ctygena-part :method-count 16)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref ctyindb-part :method-count 16)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref jellyfish :method-count 165)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x10000
)
(new 'static 'entity-info
:ptype (type-ref widow :method-count 47)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x10000
)
(new 'static 'entity-info
:ptype (type-ref nav-graph :method-count 45)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref pal-electric-fan :method-count 23)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x6000
)
(new 'static 'entity-info
:ptype (type-ref lurker-pipe-lid :method-count 31)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref ctyn-lamp :method-count 31)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref burning-bush :method-count 33)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref sail-boat-a :method-count 179)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref barge :method-count 149)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref propa :method-count 32)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref city-window-a :method-count 179)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref cty-window-a :method-count 179)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref parking-spot :method-count 25)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref security-wall :method-count 25)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref cty-guard-turret :method-count 36)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref cty-fruit-stand :method-count 30)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref fruit-stand :method-count 30)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref torn :method-count 179)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref neon-baron :method-count 17)
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x10000
)
)
)
;; definition for function entity-info-lookup
;; WARN: Return type mismatch basic vs entity-info.
(defun entity-info-lookup ((arg0 type))
"Given a type, return the [[entity-info]] from [[*entity-info*]] whos type
matches the `ptype` field. Set's `method 13` on said type that returns the `length`
off the [[entity-info]]
If nothing matches, set `method 13` to `#f` and return `#f`"
(the-as entity-info (cond
((nonzero? (-> arg0 method-table 13))
(-> arg0 method-table 13)
)
(else
(let ((v1-1 *entity-info*))
(dotimes (a1-0 (-> v1-1 length))
(when (= arg0 (-> v1-1 a1-0 ptype))
(set! (-> arg0 method-table 13) (the-as function (-> v1-1 a1-0)))
(return (the-as entity-info (-> v1-1 a1-0)))
)
)
)
(set! (-> arg0 method-table 13) #f)
(the-as basic #f)
)
)
)
)