[jak2] widescreen fix for splash/jp subtitles (#2916)

This commit is contained in:
ManDude
2023-08-18 03:25:21 +01:00
committed by GitHub
parent eeb3292ff0
commit d6e08df094
3 changed files with 29 additions and 1 deletions
+12
View File
@@ -136,6 +136,10 @@
(with-dma-buffer-add-bucket ((s0-0 (-> *display* frames (-> *display* on-screen) global-buf))
arg0
)
(#when PC_PORT
;; draw a black rectangle covering the screen first
(draw-sprite2d-xy s0-0 0 0 512 416 (static-rgba 0 0 0 128))
)
;; (upload-vram-data s0-0 0 (the-as pointer arg1) arg3 arg2)
(pc-upload-raw-texture s0-0 (the pointer arg1) arg2 arg3 0)
(set! sv-32 (+ (log2 (+ arg2 -1)) 1))
@@ -157,6 +161,14 @@
(set-vector! (the-as vector4w (&+ v1-19 64)) #x7000 #x7300 0 0)
(set-vector! (the-as vector4w (&+ v1-19 80)) (* arg2 16) (* arg3 16) 0 0)
(set-vector! (the-as vector4w (&+ v1-19 96)) #x9000 #x8d00 0 0)
(#when PC_PORT
(when (not (-> *pc-settings* use-vis?))
(let ((corrected-width (the int (* (-> *pc-settings* aspect-ratio-reciprocal) #x1000))))
(set-vector! (the-as vector4w (&+ v1-19 64)) (- #x8000 corrected-width) #x7300 0 0)
(set-vector! (the-as vector4w (&+ v1-19 96)) (+ #x8000 corrected-width) #x8d00 0 0)
)
)
)
)
(&+! (-> s0-0 base) 112)
(set-dirty-mask! arg4 arg5 (* (* arg3 arg2) 4) 0)
+16
View File
@@ -671,6 +671,14 @@
(a0-23 (+ a2-23 (-> arg0 width)))
(a1-33 (+ a3-8 (-> arg0 height)))
)
(#when PC_PORT
(when (not (-> *pc-settings* use-vis?))
(let ((corrected-width (the int (* (-> *pc-settings* aspect-ratio-reciprocal) (-> arg0 width)))))
(set! a2-23 (+ (- 1793 (the-as int (shr corrected-width 1))) (the int (+ (-> arg1 origin x) (* 0.5 (-> arg1 width))))))
(set! a0-23 (+ a2-23 corrected-width))
)
)
)
(set! (-> (the-as (pointer uint128) v1-28) 0) (-> *subtitle-work* draw-tmpl dma-vif quad))
(set! (-> (the-as (pointer uint128) v1-28) 1) (-> *subtitle-work* draw-tmpl quad 1))
(set! (-> (the-as (pointer uint128) v1-28) 2) (-> *subtitle-work* color0 quad))
@@ -688,6 +696,14 @@
(a0-30 (+ a1-38 (-> arg0 width)))
(a2-28 (+ a3-11 (-> arg0 height)))
)
(#when PC_PORT
(when (not (-> *pc-settings* use-vis?))
(let ((corrected-width (the int (* (-> *pc-settings* aspect-ratio-reciprocal) (-> arg0 width)))))
(set! a1-38 (+ (- 1793 (the-as int (shr corrected-width 1))) (the int (+ (-> arg1 origin x) (* 0.5 (-> arg1 width))))))
(set! a0-30 (+ a1-38 corrected-width))
)
)
)
(set! (-> (the-as (pointer uint128) v1-32) 0) (-> *subtitle-work* draw-tmpl dma-vif quad))
(set! (-> (the-as (pointer uint128) v1-32) 1) (-> *subtitle-work* draw-tmpl quad 1))
(set! (-> (the-as (pointer uint128) v1-32) 2) (-> *subtitle-work* color1 quad))
+1 -1
View File
@@ -194,7 +194,7 @@
(set! (-> color b) (the int (lerp-scale (the float (-> *color-yellow* b)) (the float (-> *color-red* b)) percentage 0.55 0.1)))
)
)
(with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) debug-buf))
(with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf))
bucket
)
(cond