jak-project/goal_src/jak2/engine/gfx/warp.gc
ManDude 6884b0f73e
start blit-displays decomp & renderer + improve decompilation of some DMA macros (#2616)
Adds sprite distort, fixes buggy sprite rendering in progress, adds
scissoring support (used in various scrolling menus) and a very basic
implementation of `blit-displays`. This is enough to make the fade
effect in the progress menu work, along with all the menus working
properly without needing to use the REPL. This does not make screen
flipping and the filter when failing a mission work.

Added support in the decompiler for detecting `dma-buffer-add-gs-set`
and `dma-buffer-add-gs-set-flusha` and updated all of the Jak 2 code to
use it. Readability improved!

Fixes decompiler issue with `with-dma-buffer-add-bucket` not inlining
forms which broke syntax. Fixes store error warnings showing up for
non-existent stores, there is now a dedicated pass for this at the end.

I started work on making `BITBLTBUF` stuff work in the DirectRenderer,
but stopped for now because it wasn't strictly necessary. It will still
assert like before.
2023-05-04 18:34:09 -04:00

37 lines
1.3 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: warp.gc
;; name in dgo: warp
;; dgos: ENGINE, GAME
;; DECOMP BEGINS
(defun fx-copy-buf ((arg0 dma-buffer))
"draw the current framebuffer to tbp #x3300 (13056)"
(#when PC_PORT
(dma-buffer-add-cnt-vif2 arg0 1 (new 'static 'vif-tag :cmd (vif-cmd pc-port) :imm #x10) ;; kind - buffer->texture
(new 'static 'vif-tag :cmd (vif-cmd pc-port) :imm #x3300))
(dma-buffer-add-uint128 arg0 0)
)
(set-dirty-mask! (-> *level* default-level) 5 #xd0000 #x4c000)
0
(none)
)
(define *warp-shader* (new 'static 'adgif-shader
:reg-0 #x6
:reg-1 #x14
:reg-3 #x8
:reg-4-u32 (gs-reg32 alpha-1)
:tex0 (new 'static 'gs-tex0 :tbp0 #x4c0 :tbw #x8 :tw #x9 :th #x9 :tcc #x1)
:tex1 (new 'static 'gs-tex1 :mmag #x1)
:clamp (new 'static 'gs-clamp
:wms (gs-tex-wrap-mode region-clamp)
:wmt (gs-tex-wrap-mode region-clamp)
:maxu #x1ff
:maxv #x19f
)
:next (new 'static 'shader-ptr :first-8 #x34)
)
)