fix fake vag clock and ocean with lag (#1558)

* fix the fake vag clock

* fix ocean in lag
This commit is contained in:
ManDude
2022-06-26 02:26:48 +01:00
committed by GitHub
parent 91fa0122d8
commit 892e5a6c49
4 changed files with 5 additions and 23 deletions
+2 -1
View File
@@ -14,6 +14,7 @@
#include "game/common/game_common_types.h"
#include "game/common/loader_rpc_types.h"
#include "game/common/player_rpc_types.h"
#include "game/graphics/gfx.h"
#include "game/sce/iop.h"
#include "game/sound/sndshim.h"
@@ -459,7 +460,7 @@ s32 VBlank_Handler() {
gFrameNum++;
if (gFakeVAGClockRunning && !gFakeVAGClockPaused) {
gFakeVAGClock += 17;
gFakeVAGClock += (s32)(1024 / Gfx::g_global_settings.target_fps);
}
// We don't need this, our DMA's are instant
+1 -1
View File
@@ -616,7 +616,7 @@
(set! *ocean-verts* (the-as (inline-array vector) #f))
(let ((gp-0 (-> *display* frames (-> *display* on-screen) frame global-buf)))
(set! *ocean-heights* (the-as ocean-wave-info (-> gp-0 base)))
(ocean-interp-wave *ocean-heights* (the uint (* (-> *display* time-adjust-ratio) (-> *display* integral-frame-counter)))) ;; changed for high fps
(ocean-interp-wave *ocean-heights* (the uint (* (/ (-> *display* time-factor) 5.0) (-> *display* integral-frame-counter)))) ;; changed for high fps
(&+! (-> gp-0 base) 4096)
(set! *ocean-verts* (the-as (inline-array vector) (-> gp-0 base)))
(ocean-generate-verts *ocean-verts* *ocean-heights*)
+1 -20
View File
@@ -966,26 +966,7 @@
(str-play-async (-> arg0 name) spool-sound)
(set! (-> *art-control* active-stream) (-> arg0 name))
)
;; When running at higher than 60fps, Jak's idle animations are spedup but no other animations appear to be
;; We couldn't figure out a simple way to detect these animations, so this is checking against the idle animation names
(let* ((f30-0 (* (if (and (or (= (-> *setting-control* current video-mode) '150fps) (= (-> *setting-control* current video-mode) '100fps))
(or (string= (-> arg0 name) "eichar-ambient-1")
(string= (-> arg0 name) "eichar-ambient-2")
(string= (-> arg0 name) "eichar-ambient-3")
(string= (-> arg0 name) "eichar-ambient-4")
(string= (-> arg0 name) "fishermans-boat-ride-to-village1-alt")
(string= (-> arg0 name) "fishermans-boat-ride-to-village1")
(string= (-> arg0 name) "fishermans-boat-ride-to-misty")
(string= (-> arg0 name) "gondola-ride-up")
(string= (-> arg0 name) "gondola-ride-down")
(string= (-> arg0 name) "logo-loop")
(string= (-> arg0 name) "logo-intro-2")
)
)
(-> *display* time-adjust-ratio)
1.0
)
0.05859375 (-> s2-4 speed)))
(let* ((f30-0 (* 0.05859375 (-> s2-4 speed)))
(f28-0 (+ sv-24 (/ (the float (+ (-> s2-4 data 0 length) -1)) f30-0)))
)
(set! sv-72 (current-str-pos spool-sound))
+1 -1
View File
@@ -569,7 +569,7 @@
(loop
(ground-tween-update gp-0 (-> self control unknown-float61) (-> self control unknown-float62))
(suspend)
(ja :num! (loop! (-> *display* time-adjust-ratio))) ;; changed for high fps, fixes ambient wind on jak
(ja :num! (loop!))
(ja :chan 1 :num! (chan 0))
(ja :chan 2 :num! (chan 0))
(if (can-play-stance-amibent?)