mirror of
https://github.com/open-goal/jak-project
synced 2026-07-30 16:04:33 -04:00
[decompiler] as-type and font method support (#3855)
Add support for `as-type` macro, and detecting inline font methods. This works in all three games but I've only updated jak 3's goal_src for now. Eventually I will go back and work through the others, but I want to get more decompiler features in first.  --------- Co-authored-by: water111 <awaterford1111445@gmail.com>
This commit is contained in:
@@ -323,6 +323,19 @@
|
||||
,@args)
|
||||
)
|
||||
|
||||
(defmacro as-type (this type)
|
||||
"If this is the specified type, return this cast to that type. Otherwise, return #f."
|
||||
(with-gensyms (obj)
|
||||
`(the ,type (let ((,obj ,this))
|
||||
(if (type? ,obj ,type)
|
||||
,obj
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(defun ref ((arg0 object) (arg1 int))
|
||||
"Get the n-th item in a linked list. No range checking."
|
||||
(dotimes (v1-0 arg1)
|
||||
|
||||
Reference in New Issue
Block a user