[decomp] get started on game info (#674)

* temp

* menu text

* wip

* recognize handle to process

* more
This commit is contained in:
water111
2021-07-03 16:18:41 -04:00
committed by GitHub
parent bc41241234
commit 784cd5debb
63 changed files with 9250 additions and 2542 deletions
+16 -6
View File
@@ -17,10 +17,17 @@
(defenum entity-perm-status
:bitfield #t
:type uint16
(bit-0 0)
(bit-1 1)
(dead 2)
(unknown 5) ;; TODO - task-control::task-cstage::14
(complete 6))
(bit-3 3)
(bit-4 4)
(user-set-from-cstage 5)
(complete 6)
(bit-7 7)
(real-complete 8)
(bit-9 9)
)
;; definition of type entity-perm
(deftype entity-perm (structure)
@@ -44,15 +51,15 @@
:size-assert #x10
:flag-assert #xa00000010
(:methods
(dummy-9 () none 9)
)
(update-perm! (_type_ symbol entity-perm-status) _type_ 9)
)
)
;; definition of type entity-links
(deftype entity-links (structure)
((prev-link entity-links :offset-assert 0)
(next-link entity-links :offset-assert 4)
(entity basic :offset-assert 8)
(entity entity :offset-assert 8)
(process process :offset-assert 12)
(level level :offset-assert 16)
(vis-id int32 :offset-assert 20)
@@ -82,7 +89,8 @@
;; definition of type entity-links-array
(deftype entity-links-array (inline-array-class)
()
((data entity-links :inline :dynamic :offset-assert 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
@@ -220,3 +228,5 @@
(defun-extern entity-by-name string entity)
(defun-extern entity-by-type type entity-actor)
(defun-extern entity-by-aid uint entity)
(define-extern reset-actors (function symbol none))
(define-extern *spawn-actors* symbol)
+18 -2
View File
@@ -5,6 +5,18 @@
;; name in dgo: entity-table
;; dgos: GAME, ENGINE
;; The *entity-info* table contains some simple information that can be used to
;; spawn a process for an entity.
;; :ptype the type of the process
;; :package the package that must be loaded (not used?)
;; :art-group the art that must be loaded
;; :pool the pool that the process should be allocated from
;; :heap-size the required size for the process heap
;; At one point, this was much bigger, but got smaller between
;; the demo and final build. The entity info is possibly stored somewhere else
;; and this may not even be used.
(define *entity-info*
(new 'static 'boxed-array :type entity-info :length 19 :allocated-length 19
(new 'static 'entity-info
@@ -155,20 +167,24 @@
(the-as entity-info
(cond
((nonzero? (-> arg0 method-table 13))
;; we already cached the type in the method table
(-> arg0 method-table 13)
)
(else
;; search the table
(let ((v1-1 *entity-info*))
(dotimes (a1-0 (-> v1-1 length))
(when (= arg0 (-> v1-1 a1-0 ptype))
(set!
(-> arg0 method-table 13)
;; found it, cache it in the method table
(set! (-> arg0 method-table 13)
(the-as function (-> v1-1 a1-0))
)
(return (-> v1-1 a1-0))
)
)
)
;; didn't find it, cache and return #f
(set! (-> arg0 method-table 13) #f)
#f
)