mirror of
https://github.com/open-goal/jak-project
synced 2026-06-13 05:57:22 -04:00
26c3fb65e9
* [compiler] allow infinite args for `logior` * make some dma macros and use them on `display` * [goos] add `string->symbol` * make a sketchy macro * fix tests * `with-dma-bucket` and `dma-buffer-add-vector4w-2` * cleanup `debug` * cleanup `menu` * go thru `texture` pt 1 * finish `texture` * `sprite` pt 1 * `sprite` pt 2 * `generic` * `gs` and `main`
57 lines
2.2 KiB
Common Lisp
57 lines
2.2 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: generic.gc
|
|
;; name in dgo: generic
|
|
;; dgos: GAME, ENGINE
|
|
|
|
(define *generic-foreground-sinks*
|
|
(new 'static 'boxed-array :type generic-dma-foreground-sink :length 0 :allocated-length 9))
|
|
|
|
(set! (-> *generic-foreground-sinks* 0) (-> *level* level0 foreground-sink-group 0 generic-sink))
|
|
(set! (-> *generic-foreground-sinks* 1) (-> *level* level0 foreground-sink-group 1 generic-sink))
|
|
(set! (-> *generic-foreground-sinks* 2) (-> *level* level1 foreground-sink-group 0 generic-sink))
|
|
(set! (-> *generic-foreground-sinks* 3) (-> *level* level1 foreground-sink-group 1 generic-sink))
|
|
(set! (-> *generic-foreground-sinks* 4) (-> *level* level-default foreground-sink-group 0 generic-sink))
|
|
(set! (-> *generic-foreground-sinks* 5) (-> *level* level-default foreground-sink-group 1 generic-sink))
|
|
(set! (-> *generic-foreground-sinks* 6) (new 'static 'generic-dma-foreground-sink :bucket (bucket-id generic-foreground)))
|
|
(set! (-> *generic-foreground-sinks* 7) (-> *level* level0 foreground-sink-group 2 generic-sink))
|
|
(set! (-> *generic-foreground-sinks* 8) (-> *level* level1 foreground-sink-group 2 generic-sink))
|
|
|
|
(defun generic-dma-foreground-sink-init ((arg0 generic-dma-foreground-sink))
|
|
(set! (-> arg0 state gifbuf-adr) (the-as uint 837))
|
|
(set! (-> arg0 state inbuf-adr) (the-as uint 9))
|
|
(none)
|
|
)
|
|
|
|
(defun generic-init-buffers ()
|
|
(vu-lights-default! *default-lights*)
|
|
(let ((gp-0 (new 'static 'gs-zbuf :zbp #x1c0 :psm (gs-psm ct24)))
|
|
(s5-0 (new 'static 'gs-zbuf :zbp #x1c0 :psm (gs-psm ct24) :zmsk #x1))
|
|
)
|
|
(dotimes (s4-0 9)
|
|
(let ((s1-0 (-> *generic-foreground-sinks* s4-0)))
|
|
(when s1-0
|
|
(let ((s3-0 (-> s1-0 bucket)))
|
|
(with-dma-buffer-add-bucket ((s0-0 (current-display-frame global-buf))
|
|
(current-display-frame bucket-group)
|
|
s3-0)
|
|
(if (>= s4-0 7)
|
|
(generic-init-buf s0-0 1 s5-0)
|
|
(generic-init-buf s0-0 1 gp-0)
|
|
)
|
|
(generic-dma-foreground-sink-init s1-0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
#f
|
|
)
|
|
|
|
(defun generic-sink ((i int))
|
|
"Get the generic sink i"
|
|
(-> *generic-foreground-sinks* i)
|
|
)
|