From 27627012dc6d74a0f6e7516336813f211f5ec107 Mon Sep 17 00:00:00 2001 From: Grateful Forest <168700820+gratefulforest@users.noreply.github.com> Date: Sat, 28 Mar 2026 10:22:40 +1030 Subject: [PATCH] jak1: fix memcard screen on custom aspects (#4116) The particles for the grey memcard slots already had functions associated with them, so scaling the grey boxes was simply a matter of making use of those functions. The memcard boxes expand and shrink with the aspect to resemble the PS2 behavior, where at 4:3 you get a short grey box and at 16:9 you get a long grey box. Although I added scaling to the grey boxes, I wasn't satisfied with the way elements would "slip" as they would scale differently to each other. Mainly, the collectable counts and their totals slide more and more off from each other. This is due to the game's use of integer offsets to decided UI placements; they were the right numbers for 4:3, but once you start to scale, they can slide more and more off. You can see this on a real PS2, where at 4:3, the collectibles are centered above the totals, and at 16:9, the collectibles are more right-aligned above the totals. To fix this, I used the same text flags on the totals as the counts, so everything is snapped to each other. Guards against `(-> *pc-settings* use-vis?)` ensure PS2 aspects remain untouched, and at PS2 16:9, you still get the original game bug of more right aligned counts. https://github.com/user-attachments/assets/0fa00a5d-0090-4cd0-b68b-8b8f28816185 --- goal_src/jak1/engine/ui/progress/progress-draw.gc | 14 ++++++++++---- goal_src/jak1/engine/ui/progress/progress-part.gc | 12 ++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/goal_src/jak1/engine/ui/progress/progress-draw.gc b/goal_src/jak1/engine/ui/progress/progress-draw.gc index 2ad6c16a4f..c0f620a9a7 100644 --- a/goal_src/jak1/engine/ui/progress/progress-draw.gc +++ b/goal_src/jak1/engine/ui/progress/progress-draw.gc @@ -474,8 +474,12 @@ (s0-5 *temp-string* arg0 #f s4-1 22)) (let ((v1-116 arg0)) (set! (-> v1-116 scale) 0.5)) (+! (-> arg0 origin y) 9.0) - (set! (-> arg0 flags) (font-flags shadow kerning large)) - (set! (-> arg0 origin x) (the float (- 85 (-> this left-x-offset)))) + ;; og:preserve-this add 'middle' flag when custom-aspect to snap totals with counts + (if (-> *pc-settings* use-vis?) + (set! (-> arg0 flags) (font-flags shadow kerning large)) + (set! (-> arg0 flags) (font-flags shadow kerning middle large))) + ;; og:preserve-this when custom-aspect use same offsets from counts for totals + (set! (-> arg0 origin x) (the float (- (if (-> *pc-settings* use-vis?) 85 -73) (-> this left-x-offset)))) (let ((s0-6 print-game-text)) (set! sv-80 format) (let ((a0-56 (clear *temp-string*)) @@ -483,7 +487,8 @@ (a2-17 (if (< 100 (the int (-> s3-3 file s1-0 fuel-cell-count))) (-> this total-nb-of-power-cells) 100))) (sv-80 a0-56 a1-21 a2-17)) (s0-6 *temp-string* arg0 #f s4-1 22)) - (set! (-> arg0 origin x) (the float (- 150 (-> this left-x-offset)))) + ;; og:preserve-this when custom-aspect use same offsets from counts for totals + (set! (-> arg0 origin x) (the float (- (if (-> *pc-settings* use-vis?) 150 1) (-> this left-x-offset)))) (let ((s0-7 print-game-text)) (set! sv-96 format) (let ((a0-60 (clear *temp-string*)) @@ -491,7 +496,8 @@ (a2-19 (-> this total-nb-of-orbs))) (sv-96 a0-60 a1-23 a2-19)) (s0-7 *temp-string* arg0 #f s4-1 22)) - (set! (-> arg0 origin x) (the float (- 238 (-> this left-x-offset)))) + ;; og:preserve-this when custom-aspect use same offsets from counts for totals + (set! (-> arg0 origin x) (the float (- (if (-> *pc-settings* use-vis?) 238 79) (-> this left-x-offset)))) (let ((s0-8 print-game-text)) (set! sv-112 format) (let ((a0-64 (clear *temp-string*)) diff --git a/goal_src/jak1/engine/ui/progress/progress-part.gc b/goal_src/jak1/engine/ui/progress/progress-part.gc index a3b7df20f9..b14a3eab40 100644 --- a/goal_src/jak1/engine/ui/progress/progress-part.gc +++ b/goal_src/jak1/engine/ui/progress/progress-part.gc @@ -67,24 +67,36 @@ (defun part-progress-card-slot-01-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) (set! (-> arg2 vector 2 w) (if (zero? (-> *progress-process* 0 option-index)) 64.0 32.0)) (set! (-> arg2 vector 1 w) (-> *progress-process* 0 slot-scale)) + ;; og:preserve-this added memcard width scaling for custom-aspects + (when (not (-> *pc-settings* use-vis?)) + (set! (-> arg2 vector 0 w) (* (meters 9.2) (-> *video-parms* relative-x-scale-reciprical)))) 0 (none)) (defun part-progress-card-slot-02-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) (set! (-> arg2 vector 2 w) (if (= (-> *progress-process* 0 option-index) 1) 64.0 32.0)) (set! (-> arg2 vector 1 w) (-> *progress-process* 0 slot-scale)) + ;; og:preserve-this added memcard width scaling for custom-aspects + (when (not (-> *pc-settings* use-vis?)) + (set! (-> arg2 vector 0 w) (* (meters 9.2) (-> *video-parms* relative-x-scale-reciprical)))) 0 (none)) (defun part-progress-card-slot-03-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) (set! (-> arg2 vector 2 w) (if (= (-> *progress-process* 0 option-index) 2) 64.0 32.0)) (set! (-> arg2 vector 1 w) (-> *progress-process* 0 slot-scale)) + ;; og:preserve-this added memcard width scaling for custom-aspects + (when (not (-> *pc-settings* use-vis?)) + (set! (-> arg2 vector 0 w) (* (meters 9.2) (-> *video-parms* relative-x-scale-reciprical)))) 0 (none)) (defun part-progress-card-slot-04-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) (set! (-> arg2 vector 2 w) (if (= (-> *progress-process* 0 option-index) 3) 64.0 32.0)) (set! (-> arg2 vector 1 w) (-> *progress-process* 0 slot-scale)) + ;; og:preserve-this added memcard width scaling for custom-aspects + (when (not (-> *pc-settings* use-vis?)) + (set! (-> arg2 vector 0 w) (* (meters 9.2) (-> *video-parms* relative-x-scale-reciprical)))) 0 (none))