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:
Tyler Wilding 2021-06-23 23:29:24 -04:00 committed by GitHub
parent 83c5852465
commit d54eb0b98d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 369 additions and 4 deletions

View file

@ -15817,9 +15817,10 @@
;; - Functions ;; - 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)) (define-extern *entity-info* (array entity-info))

View file

@ -5,3 +5,182 @@
;; name in dgo: entity-table ;; name in dgo: entity-table
;; dgos: GAME, ENGINE ;; 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
)
)
)
)

View 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
)
)
)
)

View file

@ -204,7 +204,7 @@
(dummy-25 () none 25) (dummy-25 () none 25)
(dummy-26 () none 26) (dummy-26 () none 26)
(dummy-27 () none 27) (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-18 (_type_ symbol) none 18)
(dummy-19 (_type_ pair) none 19) (dummy-19 (_type_ pair) none 19)
(dummy-20 () none 20) (dummy-20 () none 20)
(dummy-21 () none 21) (dummy-21 (_type_ level-group int) pair 21)
(dummy-22 () none 22) (dummy-22 () none 22)
(dummy-23 () none 23) (dummy-23 () none 23)
(dummy-24 () none 24) (dummy-24 () none 24)