Files
jak-project/test/decompiler/reference/engine/dma/dma-bucket_REF.gc
T
water111 656489e942 [decomp] Clean up - part 2 (#687)
* temp

* temp2

* basic case support

* working for or without else

* support more cases

* clean up to drawable headers

* ocean

* format json
2021-07-11 16:35:25 -04:00

58 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 bucket-id)
(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:
0