Skip to content

Commit

Permalink
jak2: some high fps fixes (#3177)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hat-Kid authored Nov 8, 2023
1 parent 4e3d35e commit a80b4f1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion goal_src/jak2/engine/gfx/foreground/foreground.gc
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@
)
)
(when (< v1-1 32)
(let* ((a3-1 (the-as int (-> pp clock integral-frame-counter)))
;; og:preserve-this high fps fix
(let* ((a3-1 (the int (* DISPLAY_FPS_RATIO (-> pp clock integral-frame-counter))))
(a2-3 (-> a1-1 time-factor))
(t0-2 (+ (ash 1 a2-3) -1))
)
Expand Down
2 changes: 2 additions & 0 deletions goal_src/jak2/engine/gfx/hw/display.gc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
;(defconstant DMA_BUFFER_DEBUG_SIZE (* 8 1024 1024)) ;; 8M
(defconstant DMA_BUFFER_DEBUG_SIZE (* 12 1024 1024)) ;; expand to 12M because we can

(defconstant DISPLAY_FPS_RATIO (/ (-> *display* time-factor) 5.0))

;; DECOMP BEGINS

(defun get-current-time ()
Expand Down
3 changes: 2 additions & 1 deletion goal_src/jak2/engine/ui/hud-classes.gc
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@
)
)
(when (not (paused?))
(let ((v1-10 8))
;; og:preserve-this high fps fix
(let ((v1-10 (* DISPLAY_FPS_RATIO 8)))
(if (and (< (-> this values 1 target) 270) (< 270 (+ (-> this values 1 target) v1-10)))
(set! (-> this values 1 target) 270)
)
Expand Down
3 changes: 2 additions & 1 deletion goal_src/jak2/engine/ui/minimap.gc
Original file line number Diff line number Diff line change
Expand Up @@ -2429,7 +2429,8 @@
(if (or (logtest? (-> arg1 class flags) (minimap-flag frustum))
(logtest? (-> arg1 class flags) (minimap-flag racer))
(and (logtest? (-> arg1 class flags) (minimap-flag flash))
(< (the-as int (logand (-> *display* base-clock integral-frame-counter) 15)) 8)
;; og:preserve-this high fps fix
(< (the-as int (logand (the int (* DISPLAY_FPS_RATIO (-> *display* base-clock integral-frame-counter))) 15)) 8)
)
)
(set! s2-0 #t)
Expand Down
3 changes: 2 additions & 1 deletion goal_src/jak2/levels/drill/ginsu.gc
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,8 @@
(ja :group! ginsu-idle-ja :num! min)
)
(vector-seek! (-> self root scale) (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) 0.02)
(+! (-> self path-pos) (/ 2048.0 (total-distance (-> self ambush-path))))
;; og:preserve-this high fps fix
(+! (-> self path-pos) (/ (* DISPLAY_FPS_RATIO 2048.0) (total-distance (-> self ambush-path))))
(let ((f30-1 (-> self path-pos)))
(when (>= f30-1 1.0)
(set! (-> self path-pos) 1.0)
Expand Down

0 comments on commit a80b4f1

Please sign in to comment.