mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 11:26:18 -04:00
decomp: entity-table
(#614)
* decomp: `entity-table` done but problem with the label cast * decomp: `entity-table` * decomp: finalize `entity-table`
This commit is contained in:
parent
83c5852465
commit
d54eb0b98d
|
@ -15817,9 +15817,10 @@
|
|||
|
||||
;; - Functions
|
||||
|
||||
(define-extern entity-info-lookup function)
|
||||
;; This is a terrible terrible function, here be dragons - https://github.com/water111/jak-project/pull/623!
|
||||
(define-extern entity-info-lookup (function type entity-info))
|
||||
|
||||
;; - Unknowns
|
||||
;; - Symbols
|
||||
|
||||
(define-extern *entity-info* (array entity-info))
|
||||
|
||||
|
|
|
@ -5,3 +5,182 @@
|
|||
;; name in dgo: entity-table
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
;; definition for symbol *entity-info*, type (array entity-info)
|
||||
(define
|
||||
*entity-info*
|
||||
(the-as (array entity-info)
|
||||
(new
|
||||
'static
|
||||
'boxed-array
|
||||
:type entity-info :length 19 :allocated-length 19
|
||||
(new 'static 'entity-info
|
||||
:ptype
|
||||
(type-ref sage-finalboss :method-count 53)
|
||||
:package "l1"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x8000
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref robotboss :method-count 21)
|
||||
:package "l1"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x8000
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype
|
||||
(type-ref assistant-levitator :method-count 53)
|
||||
:package "l1"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x8000
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref babak :method-count 76)
|
||||
:package "l1"
|
||||
:art-group '("babak")
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x2800
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref racer :method-count 24)
|
||||
:package "game"
|
||||
:art-group '("racer")
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x4000
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref springbox :method-count 20)
|
||||
:package "game"
|
||||
:art-group '("bounceytarp")
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x1400
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref launcher :method-count 20)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x400
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype
|
||||
(type-ref pickup-spawner :method-count 30)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #xc00
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref bucket :method-count 30)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #xc00
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref barrel :method-count 30)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #xc00
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref crate :method-count 30)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #xc00
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype
|
||||
(type-ref orb-cache-top :method-count 29)
|
||||
:package "game"
|
||||
:art-group '("orb-cache-top")
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x1000
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref eco :method-count 31)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x1000
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref ecovent :method-count 21)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x1000
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref fuel-cell :method-count 31)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x1400
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref buzzer :method-count 31)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x1000
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref money :method-count 31)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x800
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref water-vol :method-count 30)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #xc00
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype
|
||||
(type-ref target-start :method-count 15)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x400
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function entity-info-lookup
|
||||
;; INFO: Return type mismatch basic vs entity-info.
|
||||
(defun entity-info-lookup ((arg0 type))
|
||||
(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))
|
||||
(if (= arg0 (-> v1-1 a1-0 ptype))
|
||||
(return (begin
|
||||
(set!
|
||||
(-> arg0 method-table 13)
|
||||
(the-as function (-> v1-1 a1-0))
|
||||
)
|
||||
(-> v1-1 a1-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> arg0 method-table 13) #f)
|
||||
#f
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
|
185
test/decompiler/reference/engine/entity/entity-table_REF.gc
Normal file
185
test/decompiler/reference/engine/entity/entity-table_REF.gc
Normal file
|
@ -0,0 +1,185 @@
|
|||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition for symbol *entity-info*, type (array entity-info)
|
||||
(define
|
||||
*entity-info*
|
||||
(the-as (array entity-info)
|
||||
(new
|
||||
'static
|
||||
'boxed-array
|
||||
:type entity-info :length 19 :allocated-length 19
|
||||
(new 'static 'entity-info
|
||||
:ptype
|
||||
(type-ref sage-finalboss :method-count 53)
|
||||
:package "l1"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x8000
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref robotboss :method-count 21)
|
||||
:package "l1"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x8000
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype
|
||||
(type-ref assistant-levitator :method-count 53)
|
||||
:package "l1"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x8000
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref babak :method-count 76)
|
||||
:package "l1"
|
||||
:art-group '("babak")
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x2800
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref racer :method-count 24)
|
||||
:package "game"
|
||||
:art-group '("racer")
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x4000
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref springbox :method-count 20)
|
||||
:package "game"
|
||||
:art-group '("bounceytarp")
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x1400
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref launcher :method-count 20)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x400
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype
|
||||
(type-ref pickup-spawner :method-count 30)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #xc00
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref bucket :method-count 30)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #xc00
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref barrel :method-count 30)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #xc00
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref crate :method-count 30)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #xc00
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype
|
||||
(type-ref orb-cache-top :method-count 29)
|
||||
:package "game"
|
||||
:art-group '("orb-cache-top")
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x1000
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref eco :method-count 31)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x1000
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref ecovent :method-count 21)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x1000
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref fuel-cell :method-count 31)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x1400
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref buzzer :method-count 31)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x1000
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref money :method-count 31)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x800
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype (type-ref water-vol :method-count 30)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #xc00
|
||||
)
|
||||
(new 'static 'entity-info
|
||||
:ptype
|
||||
(type-ref target-start :method-count 15)
|
||||
:package "game"
|
||||
:art-group '()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x400
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function entity-info-lookup
|
||||
;; INFO: Return type mismatch basic vs entity-info.
|
||||
(defun entity-info-lookup ((arg0 type))
|
||||
(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))
|
||||
(if (= arg0 (-> v1-1 a1-0 ptype))
|
||||
(return (begin
|
||||
(set!
|
||||
(-> arg0 method-table 13)
|
||||
(the-as function (-> v1-1 a1-0))
|
||||
)
|
||||
(-> v1-1 a1-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> arg0 method-table 13) #f)
|
||||
#f
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
|
@ -204,7 +204,7 @@
|
|||
(dummy-25 () none 25)
|
||||
(dummy-26 () none 26)
|
||||
(dummy-27 () none 27)
|
||||
(dummy-28 () none 28)
|
||||
(dummy-28 (_type_ string) symbol 28)
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -301,7 +301,7 @@
|
|||
(dummy-18 (_type_ symbol) none 18)
|
||||
(dummy-19 (_type_ pair) none 19)
|
||||
(dummy-20 () none 20)
|
||||
(dummy-21 () none 21)
|
||||
(dummy-21 (_type_ level-group int) pair 21)
|
||||
(dummy-22 () none 22)
|
||||
(dummy-23 () none 23)
|
||||
(dummy-24 () none 24)
|
||||
|
|
Loading…
Reference in a new issue