mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 11:26:18 -04:00
cd68cb671e
Major change to how `deftype` shows up in our code: - the decompiler will no longer emit the `offset-assert`, `method-count-assert`, `size-assert` and `flag-assert` parameters. There are extremely few cases where having this in the decompiled code is helpful, as the types there come from `all-types` which already has those parameters. This also doesn't break type consistency because: - the asserts aren't compared. - the first step of the test uses `all-types`, which has the asserts, which will throw an error if they're bad. - the decompiler won't emit the `heap-base` parameter unless necessary now. - the decompiler will try its hardest to turn a fixed-offset field into an `overlay-at` field. It falls back to the old offset if all else fails. - `overlay-at` now supports field "dereferencing" to specify the offset that's within a field that's a structure, e.g.: ```lisp (deftype foobar (structure) ((vec vector :inline) (flags int32 :overlay-at (-> vec w)) ) ) ``` in this structure, the offset of `flags` will be 12 because that is the final offset of `vec`'s `w` field within this structure. - **removed ID from all method declarations.** IDs are only ever automatically assigned now. Fixes #3068. - added an `:overlay` parameter to method declarations, in order to declare a new method that goes on top of a previously-defined method. Syntax is `:overlay <method-name>`. Please do not ever use this. - added `state-methods` list parameter. This lets you quickly specify a list of states to be put in the method table. Same syntax as the `states` list parameter. The decompiler will try to put as many states in this as it can without messing with the method ID order. Also changes `defmethod` to make the first type definition (before the arguments) optional. The type can now be inferred from the first argument. Fixes #3093. --------- Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
129 lines
4.1 KiB
Common Lisp
129 lines
4.1 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: debug-h.gc
|
|
;; name in dgo: debug-h
|
|
;; dgos: ENGINE, GAME
|
|
|
|
;; NOTE - for cam-states
|
|
(define-extern add-debug-flat-triangle (function symbol bucket-id vector vector vector rgba symbol))
|
|
;; NOTE - for cam-debug
|
|
(define-extern transform-float-point (function vector vector4w vector4w))
|
|
(define-extern add-debug-line (function symbol bucket-id vector vector rgba symbol rgba symbol))
|
|
;; NOTE - for editable
|
|
(define-extern add-debug-x (function symbol bucket-id vector rgba symbol))
|
|
(define-extern add-debug-vector (function symbol bucket-id vector vector meters rgba symbol))
|
|
|
|
(define-extern add-debug-line2d (function symbol bucket-id vector4w vector4w vector4w symbol))
|
|
(define-extern add-debug-text-3d (function symbol bucket-id string vector font-color vector2h symbol))
|
|
(define-extern add-debug-text-sphere (function symbol bucket-id vector meters string rgba symbol))
|
|
|
|
;; NOTE - for debug
|
|
(define-extern add-debug-sphere (function symbol bucket-id vector meters rgba symbol))
|
|
|
|
;; NOTE - for joint-mod-h
|
|
(define-extern add-debug-matrix (function symbol bucket-id matrix meters matrix))
|
|
|
|
;; NOTE - for menu
|
|
;; +++debug-menu-msg
|
|
(defenum debug-menu-msg
|
|
:type int32
|
|
(activate 1)
|
|
(deactivate 2)
|
|
(update 3)
|
|
(press 4)
|
|
)
|
|
;; ---debug-menu-msg
|
|
|
|
;; +++debug-menu-dest
|
|
(defenum debug-menu-dest
|
|
:type int32
|
|
(activation 0)
|
|
(root 1)
|
|
(open-menus 2)
|
|
(current-selection 3))
|
|
;; ---debug-menu-dest
|
|
|
|
(declare-type debug-menu basic)
|
|
(declare-type debug-menu-node basic)
|
|
(declare-type debug-menu-item debug-menu-node)
|
|
(declare-type debug-menu-context basic)
|
|
(define-extern debug-menu-context-send-msg (function debug-menu-context debug-menu-msg debug-menu-dest debug-menu-context))
|
|
(define-extern debug-menu-make-from-template (function debug-menu-context pair debug-menu-node))
|
|
(define-extern debug-menu-func-decode (function object function))
|
|
(define-extern debug-menu-item-send-msg (function debug-menu-item debug-menu-msg debug-menu-item))
|
|
(define-extern debug-menu-send-msg (function debug-menu debug-menu-msg symbol debug-menu))
|
|
(define-extern debug-menus-handler (function debug-menu-context debug-menu-context))
|
|
|
|
;; DECOMP BEGINS
|
|
|
|
(deftype pos-history (structure)
|
|
((points (inline-array vector))
|
|
(num-points int32)
|
|
(h-first int32)
|
|
(h-last int32)
|
|
)
|
|
)
|
|
|
|
|
|
(deftype debug-vertex (structure)
|
|
((trans vector4w :inline)
|
|
(normal vector3h :inline)
|
|
(st vector2h :inline)
|
|
(color uint32)
|
|
)
|
|
)
|
|
|
|
|
|
(deftype debug-vertex-stats (basic)
|
|
((length int32)
|
|
(pos-count int32)
|
|
(vertex debug-vertex 600 :inline)
|
|
)
|
|
)
|
|
|
|
|
|
(define *color-black* (new 'static 'rgba :a #x80))
|
|
|
|
(define *color-white* (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80))
|
|
|
|
(define *color-gray* (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80))
|
|
|
|
(define *color-red* (new 'static 'rgba :r #xff :a #x80))
|
|
|
|
(define *color-green* (new 'static 'rgba :g #xff :a #x80))
|
|
|
|
(define *color-blue* (new 'static 'rgba :b #xff :a #x80))
|
|
|
|
(define *color-cyan* (new 'static 'rgba :g #xff :b #xff :a #x80))
|
|
|
|
(define *color-magenta* (new 'static 'rgba :r #xff :b #xff :a #x80))
|
|
|
|
(define *color-yellow* (new 'static 'rgba :r #xff :g #xff :a #x80))
|
|
|
|
(define *color-light-red* (new 'static 'rgba :r #xff :g #x80 :b #x80 :a #x80))
|
|
|
|
(define *color-light-green* (new 'static 'rgba :r #x80 :g #xff :b #x80 :a #x80))
|
|
|
|
(define *color-light-blue* (new 'static 'rgba :r #x80 :g #x80 :b #xff :a #x80))
|
|
|
|
(define *color-light-cyan* (new 'static 'rgba :r #x80 :g #xff :b #xff :a #x80))
|
|
|
|
(define *color-light-magenta* (new 'static 'rgba :r #xff :g #x80 :b #xff :a #x80))
|
|
|
|
(define *color-light-yellow* (new 'static 'rgba :r #xff :g #xff :b #x80 :a #x80))
|
|
|
|
(define *color-dark-red* (new 'static 'rgba :r #x80 :a #x80))
|
|
|
|
(define *color-dark-green* (new 'static 'rgba :g #x80 :a #x80))
|
|
|
|
(define *color-dark-blue* (new 'static 'rgba :b #x80 :a #x80))
|
|
|
|
(define *color-dark-cyan* (new 'static 'rgba :g #x80 :b #x80 :a #x80))
|
|
|
|
(define *color-dark-magenta* (new 'static 'rgba :r #x80 :b #x80 :a #x80))
|
|
|
|
(define *color-dark-yellow* (new 'static 'rgba :r #x80 :g #x80 :a #x80))
|
|
|
|
(define *color-orange* (new 'static 'rgba :r #xff :g #x80 :a #x80))
|