Files
jak-project/test/decompiler/reference/engine/dma/dma-bucket_REF.gc
T
water111 d9f9d36f37 [OpenGOAL] make multiplication/divsion like GOAL and support in decompiler (#483)
* support in compiler

* multiplication in the decompiler

* update divisions
2021-05-14 18:43:12 -04:00

55 lines
1.5 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; definition for function dma-buffer-add-buckets
;; INFO: Return type mismatch pointer vs none.
(defun dma-buffer-add-buckets ((dma-buf dma-buffer) (count int))
(let ((current-bucket (the-as dma-bucket (-> dma-buf base))))
(dotimes (i count)
(set!
(-> current-bucket tag)
(new 'static 'dma-tag
:id (dma-tag-id next)
:addr (the-as int (&+ (the-as pointer current-bucket) 16))
)
)
(set! (-> current-bucket last) (the-as (pointer dma-tag) current-bucket))
(set!
current-bucket
(the-as dma-bucket (&+ (the-as pointer current-bucket) 16))
)
)
(set! (-> dma-buf base) (the-as pointer current-bucket))
)
(none)
)
;; definition for function dma-buffer-patch-buckets
(defun dma-buffer-patch-buckets ((bucket dma-bucket) (count int))
(when (nonzero? bucket)
(dotimes (i count)
(set! (-> bucket last 0 addr) (the-as int (&+ (the-as pointer bucket) 16)))
(set! (-> bucket last) (the-as (pointer dma-tag) 0))
(set! bucket (the-as dma-bucket (&+ (the-as pointer bucket) 16)))
)
)
bucket
)
;; definition for function dma-bucket-insert-tag
(defun
dma-bucket-insert-tag
((base dma-bucket) (idx int) (tag-start pointer) (tag-end (pointer dma-tag)))
(let
((bucket (the-as dma-bucket (+ (the-as uint base) (the-as uint (* idx 16)))))
)
(set! (-> (the-as dma-bucket (-> bucket last)) next) (the-as uint tag-start))
(set! (-> bucket last) tag-end)
)
tag-start
)
;; failed to figure out what this is:
(let ((v0-0 0))
)