diff --git a/game/graphics/pipelines/opengl.cpp b/game/graphics/pipelines/opengl.cpp index 2249232b4b..f85190e1ae 100644 --- a/game/graphics/pipelines/opengl.cpp +++ b/game/graphics/pipelines/opengl.cpp @@ -191,6 +191,13 @@ static std::shared_ptr gl_make_display(int width, g_gfx_data->debug_gui.m_vsync = false; g_gfx_data->vsync_enabled = false; glfwSwapInterval(false); + if (primary_monitor_video_mode->refreshRate > 100) { + BootVideoMode = VideoMode::FPS150; + g_gfx_data->debug_gui.target_fps = 150; + } else if (primary_monitor_video_mode->refreshRate > 60) { + BootVideoMode = VideoMode::FPS100; + g_gfx_data->debug_gui.target_fps = 100; + } } else { // enable vsync g_gfx_data->debug_gui.framelimiter = false; diff --git a/game/kernel/kboot.cpp b/game/kernel/kboot.cpp index 6e8aade4a4..7cb2c83bc7 100644 --- a/game/kernel/kboot.cpp +++ b/game/kernel/kboot.cpp @@ -32,6 +32,8 @@ using namespace ee; +VideoMode BootVideoMode; + // Level to load on boot char DebugBootLevel[64]; diff --git a/game/kernel/kboot.h b/game/kernel/kboot.h index 7989048c1c..db29523a71 100644 --- a/game/kernel/kboot.h +++ b/game/kernel/kboot.h @@ -30,6 +30,16 @@ enum class RuntimeExitStatus { RESTART_IN_DEBUG = 3, }; +enum class VideoMode { + NTSC = 0, + PAL = 1, + FPS100 = 2, + FPS150 = 3, +}; + +// Video Mode that's set based on display refresh rate on boot +extern VideoMode BootVideoMode; + // Level to load on boot extern char DebugBootLevel[64]; diff --git a/game/kernel/kscheme.cpp b/game/kernel/kscheme.cpp index ab7a65630a..557c545754 100644 --- a/game/kernel/kscheme.cpp +++ b/game/kernel/kscheme.cpp @@ -2003,7 +2003,7 @@ s32 InitHeapAndSymbol() { method_set_symbol->value = 0; // set *boot-video-mode* - intern_from_c("*boot-video-mode*")->value = 0; + intern_from_c("*boot-video-mode*")->value = (u32)BootVideoMode; lg::info("Initialized GOAL heap in {:.2} ms", heap_init_timer.getMs()); // load the kernel! diff --git a/goal_src/engine/ambient/weather-part.gc b/goal_src/engine/ambient/weather-part.gc index 54bcc23c1c..c934004a65 100644 --- a/goal_src/engine/ambient/weather-part.gc +++ b/goal_src/engine/ambient/weather-part.gc @@ -353,7 +353,7 @@ ) (defun update-snow ((arg0 target)) - (let ((gp-0 (-> arg0 control trans))) + (let ((target-position (-> arg0 control trans))) (let ((f0-0 (lerp-scale 0.0 1.0 (vector-length (-> arg0 control transv)) 2048.0 40960.0))) (set! (-> *part-id-table* 34 init-specs 1 initial-valuef) (- 1.0 f0-0)) (set! (-> *part-id-table* 33 init-specs 1 initial-valuef) (* 4.0 f0-0)) @@ -361,22 +361,8 @@ (set! (-> *part-id-table* 33 init-specs 19 initial-valuef) (+ 32768.0 (vector-y-angle (-> arg0 control transv))) ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 34) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 33) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 34) target-position) + (launch-particles (-> *part-id-table* 33) target-position) ) 0 (none) @@ -464,22 +450,8 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 39) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 40) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 39) gp-0) + (launch-particles :system *sp-particle-system-3d* :rate 1.0 (-> *part-id-table* 40) gp-0) ) ) (none) @@ -512,22 +484,8 @@ (set! (-> *part-id-table* 38 init-specs 5 initial-valuef) f30-0) (set! (-> *part-id-table* 38 init-specs 5 random-rangef) f30-0) ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 37) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 38) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 37) gp-0) + (launch-particles (-> *part-id-table* 38) gp-0) ) ) 0 diff --git a/goal_src/engine/draw/drawable.gc b/goal_src/engine/draw/drawable.gc index 9249778496..3068e0b9e1 100644 --- a/goal_src/engine/draw/drawable.gc +++ b/goal_src/engine/draw/drawable.gc @@ -1335,7 +1335,12 @@ (+! (-> disp base-frame-counter) scaled-seconds) (+! (-> disp part-frame-counter) scaled-seconds) ;; this counts actual frames, not seconds. Will count 2 frames if we lag - (+! (-> disp integral-frame-counter) (the int time-ratio)) + ;; When counting frames while running at > 60fps we need to scale it, but always count at least 1 frame + (+! (-> disp integral-frame-counter) (if (= (-> *setting-control* current video-mode) '150fps) + (min 1 (the int (+ 1 (* 0.4 time-ratio)))) + (if (= (-> *setting-control* current video-mode) '100fps) + (min 1 (the int (+ 1 (* 0.6 time-ratio)))) + (the int time-ratio)))) ;; this counts actual frames, not doubling for lag. Will count 1 per frame drawn (+! (-> disp actual-frame-counter) 1) ;; game counter will count seconds that we're not in a movie @@ -1640,7 +1645,7 @@ ;; need to call reset-graph with some magic number ;; also stash this parameter so that if things go really wrong and our DMA transfer ;; times out, we can reset-graph to the appropriate video mode - (if (= (-> *setting-control* current video-mode) 'ntsc) + (if (or (= (-> *setting-control* current video-mode) 'ntsc) (= (-> *setting-control* current video-mode) '150fps) (= (-> *setting-control* current video-mode) '100fps)) (set! *video-reset-parm* 2) (set! *video-reset-parm* 3) ) diff --git a/goal_src/engine/draw/process-drawable-h.gc b/goal_src/engine/draw/process-drawable-h.gc index 68b1cda420..1eabf45db9 100644 --- a/goal_src/engine/draw/process-drawable-h.gc +++ b/goal_src/engine/draw/process-drawable-h.gc @@ -148,4 +148,137 @@ (bit-10 10) ) -(define-extern process-entity-status! (function process entity-perm-status symbol int)) \ No newline at end of file +(define-extern process-entity-status! (function process entity-perm-status symbol int)) + +(defmacro ja-group (&key (chan 0)) + "get the frame group for self. default channel is 0, the base channel. returns #f if no frame group." + `(if (> (-> self skel active-channels) ,chan) + (-> self skel root-channel ,chan frame-group)) + ) + +(defmacro ja-group? (group &key (chan 0)) + "is self in this frame group on this channel? default is channel 0, which is the base channel." + `(= (ja-group) ,group) + ) + +(defmacro ja (&key (chan 0) + &key (group! #f) + &key (num! #f) + &key (param0 #f) + &key (param1 #f) + &key (num-func #f) + &key (frame-num #f) + &key (frame-interp #f) + &key (dist #f) + &key (eval? #t) + ) + "set various joint anim parameters for self and eval them. + you can use this for playing animations! + + chan = the channel to modify. defaults to 0 (base channel). this is usually what you want. + group! = when not #f, set this as the new frame-group. defaults to #f + num! = set the frame playback function. this is what determines what frame an animation is at. funcs below. + #f = no func will be set, and there wont be a frame eval. + num-func = sets the num-func field for the channel. this lets you change the function with eval'ing. + param0 = 1st parameter for the playback function. ONLY USE THESE WITH num-func !! + param1 = 2nd parameter for the playback function. ONLY USE THESE WITH num-func !! + frame-num = set the frame-num field. + frame-interp = set the frame-interp field. + dist = set the dist field. + + available num! functions: + - (+!) = advance anim. + - (-!) = reverse anim. + - (identity num) = play 'num' frame. + - (seek! target speed) = animate towards frame target at a speed. + speed is optional and defaults to 1.0 when not provided. + target is optional and defaults to the last frame of the animation. + if you want to set the speed, you therefore must also set the target. + target can be max (no quote), which is just the same as the default value. + - (loop! speed) = loop animation at a speed. default speed is 1.0 when not provided. + - (chan channel) = copy frame from another channel. + - min = the start of the animation. + - max = the end of the animation. + " + + (let* ((num-args (if (pair? num!) (cdr num!) '())) + (num! (if (pair? num!) (car num!) num!)) + (nf (cond + ((or (eq? num! 'identity) + (eq? num! 'min) + (eq? num! 'max) + ) + 'num-func-identity) + ((eq? num! 'none) 'num-func-none) + ((eq? num! '+!) 'num-func-+!) + ((eq? num! '-!) 'num-func--!) + ((eq? num! 'seek!) 'num-func-seek!) + ((eq? num! 'loop!) 'num-func-loop!) + ((eq? num! 'blend-in!) 'num-func-blend-in!) + ((eq? num! 'chan) 'num-func-chan) + )) + (p0 (if param0 param0 + (cond + ((eq? num! 'chan) `(the float ,(car num-args))) + ((eq? num! '+!) (if (null? num-args) 1.0 (car num-args))) + ((eq? num! '-!) (if (null? num-args) 1.0 (car num-args))) + ((eq? num! 'loop!) (if (null? num-args) 1.0 (if (eq? 'max (car num-args)) + (if group! + `(the float (1- (-> (the art-joint-anim ,group!) data 0 length))) + `(the float (1- (-> ja-ch frame-group data 0 length))) + ) + (car num-args)))) + ((eq? num! 'seek!) (if (or (null? num-args) (eq? (car num-args) 'max)) + (if group! + `(the float (1- (-> (the art-joint-anim ,group!) data 0 length))) + `(the float (1- (-> ja-ch frame-group data 0 length))) + ) + (car num-args))) + ))) + (p1 (if param1 param1 + (cond + ((eq? num! 'seek!) (if (or (null? num-args) (null? (cdr num-args))) 1.0 (cadr num-args))) + ))) + (frame-num (if (eq? 'max frame-num) (if group! + `(the float (1- (-> (the art-joint-anim ,group!) data 0 length))) + `(the float (1- (-> ja-ch frame-group data 0 length))) + ) + frame-num)) + (frame-group (if (or p0 p1 frame-num (not nf)) group! #f)) + ) + `(let ((ja-ch (-> self skel root-channel ,chan))) + ,(if frame-interp `(set! (-> ja-ch frame-interp) ,frame-interp) `(none)) + ,(if dist `(set! (-> ja-ch dist) ,dist) `(none)) + ,(if frame-group `(set! (-> ja-ch frame-group) (the art-joint-anim ,frame-group)) `(none)) + ,(if p0 `(set! (-> ja-ch param 0) ,p0) `(none)) + ,(if p1 `(set! (-> ja-ch param 1) ,p1) `(none)) + ,(if num-func `(set! (-> ja-ch num-func) ,num-func) `(none)) + ,(if frame-num `(set! (-> ja-ch frame-num) ,frame-num) `(none)) + ,(if nf + `(,(if eval? 'joint-control-channel-group-eval! 'joint-control-channel-group!) + ja-ch (the art-joint-anim ,group!) ,nf) + `(none)) + ,(cond + ((eq? num! 'min) `(set! (-> ja-ch frame-num) 0.0)) + ((eq? num! 'max) (if group! + `(set! (-> ja-ch frame-num) (the float (1- (-> (the art-joint-anim ,group!) data 0 length)))) + `(set! (-> ja-ch frame-num) (the float (1- (-> ja-ch frame-group data 0 length)))) + )) + ((eq? num! 'identity) `(set! (-> ja-ch frame-num) ,(car num-args))) + (#t `(none)) + ) + )) + ) + +(defmacro ja-no-eval (&key (chan 0) + &key (group! #f) + &key (num! #f) + &key (param0 #f) + &key (param1 #f) + &key (num-func #f) + &key (frame-num #f) + &key (frame-interp #f) + &key (dist #f) + ) + `(ja :eval? #f :chan ,chan :group! ,group! :num! ,num! :param0 ,param0 :param1 ,param1 :num-func ,num-func :frame-num ,frame-num :frame-interp ,frame-interp :dist ,dist) + ) diff --git a/goal_src/engine/draw/process-drawable.gc b/goal_src/engine/draw/process-drawable.gc index da55f294c9..e7edd79d9c 100644 --- a/goal_src/engine/draw/process-drawable.gc +++ b/goal_src/engine/draw/process-drawable.gc @@ -694,18 +694,6 @@ ) ) - -(defmacro ja-group (&key (chan 0)) - "get the frame group for self. default channel is 0, the base channel. returns #f if no frame group." - `(if (> (-> self skel active-channels) ,chan) - (-> self skel root-channel ,chan frame-group)) - ) - -(defmacro ja-group? (group &key (chan 0)) - "is self in this frame group on this channel? default is channel 0, which is the base channel." - `(= (ja-group) ,group) - ) - (defbehavior ja-num-frames process-drawable ((arg0 int)) (+ (-> self skel root-channel arg0 frame-group data 0 length) -1) ) @@ -881,128 +869,6 @@ ) ) -(defmacro ja (&key (chan 0) - &key (group! #f) - &key (num! #f) - &key (param0 #f) - &key (param1 #f) - &key (num-func #f) - &key (frame-num #f) - &key (frame-interp #f) - &key (dist #f) - &key (eval? #t) - ) - "set various joint anim parameters for self and eval them. - you can use this for playing animations! - - chan = the channel to modify. defaults to 0 (base channel). this is usually what you want. - group! = when not #f, set this as the new frame-group. defaults to #f - num! = set the frame playback function. this is what determines what frame an animation is at. funcs below. - #f = no func will be set, and there wont be a frame eval. - num-func = sets the num-func field for the channel. this lets you change the function with eval'ing. - param0 = 1st parameter for the playback function. ONLY USE THESE WITH num-func !! - param1 = 2nd parameter for the playback function. ONLY USE THESE WITH num-func !! - frame-num = set the frame-num field. - frame-interp = set the frame-interp field. - dist = set the dist field. - - available num! functions: - - (+!) = advance anim. - - (-!) = reverse anim. - - (identity num) = play 'num' frame. - - (seek! target speed) = animate towards frame target at a speed. - speed is optional and defaults to 1.0 when not provided. - target is optional and defaults to the last frame of the animation. - if you want to set the speed, you therefore must also set the target. - target can be max (no quote), which is just the same as the default value. - - (loop! speed) = loop animation at a speed. default speed is 1.0 when not provided. - - (chan channel) = copy frame from another channel. - - min = the start of the animation. - - max = the end of the animation. - " - - (let* ((num-args (if (pair? num!) (cdr num!) '())) - (num! (if (pair? num!) (car num!) num!)) - (nf (cond - ((or (eq? num! 'identity) - (eq? num! 'min) - (eq? num! 'max) - ) - 'num-func-identity) - ((eq? num! 'none) 'num-func-none) - ((eq? num! '+!) 'num-func-+!) - ((eq? num! '-!) 'num-func--!) - ((eq? num! 'seek!) 'num-func-seek!) - ((eq? num! 'loop!) 'num-func-loop!) - ((eq? num! 'blend-in!) 'num-func-blend-in!) - ((eq? num! 'chan) 'num-func-chan) - )) - (p0 (if param0 param0 - (cond - ((eq? num! 'chan) `(the float ,(car num-args))) - ((eq? num! '+!) (if (null? num-args) 1.0 (car num-args))) - ((eq? num! '-!) (if (null? num-args) 1.0 (car num-args))) - ((eq? num! 'loop!) (if (null? num-args) 1.0 (if (eq? 'max (car num-args)) - (if group! - `(the float (1- (-> (the art-joint-anim ,group!) data 0 length))) - `(the float (1- (-> ja-ch frame-group data 0 length))) - ) - (car num-args)))) - ((eq? num! 'seek!) (if (or (null? num-args) (eq? (car num-args) 'max)) - (if group! - `(the float (1- (-> (the art-joint-anim ,group!) data 0 length))) - `(the float (1- (-> ja-ch frame-group data 0 length))) - ) - (car num-args))) - ))) - (p1 (if param1 param1 - (cond - ((eq? num! 'seek!) (if (or (null? num-args) (null? (cdr num-args))) 1.0 (cadr num-args))) - ))) - (frame-num (if (eq? 'max frame-num) (if group! - `(the float (1- (-> (the art-joint-anim ,group!) data 0 length))) - `(the float (1- (-> ja-ch frame-group data 0 length))) - ) - frame-num)) - (frame-group (if (or p0 p1 frame-num (not nf)) group! #f)) - ) - `(let ((ja-ch (-> self skel root-channel ,chan))) - ,(if frame-interp `(set! (-> ja-ch frame-interp) ,frame-interp) `(none)) - ,(if dist `(set! (-> ja-ch dist) ,dist) `(none)) - ,(if frame-group `(set! (-> ja-ch frame-group) (the art-joint-anim ,frame-group)) `(none)) - ,(if p0 `(set! (-> ja-ch param 0) ,p0) `(none)) - ,(if p1 `(set! (-> ja-ch param 1) ,p1) `(none)) - ,(if num-func `(set! (-> ja-ch num-func) ,num-func) `(none)) - ,(if frame-num `(set! (-> ja-ch frame-num) ,frame-num) `(none)) - ,(if nf - `(,(if eval? 'joint-control-channel-group-eval! 'joint-control-channel-group!) - ja-ch (the art-joint-anim ,group!) ,nf) - `(none)) - ,(cond - ((eq? num! 'min) `(set! (-> ja-ch frame-num) 0.0)) - ((eq? num! 'max) (if group! - `(set! (-> ja-ch frame-num) (the float (1- (-> (the art-joint-anim ,group!) data 0 length)))) - `(set! (-> ja-ch frame-num) (the float (1- (-> ja-ch frame-group data 0 length)))) - )) - ((eq? num! 'identity) `(set! (-> ja-ch frame-num) ,(car num-args))) - (#t `(none)) - ) - )) - ) - -(defmacro ja-no-eval (&key (chan 0) - &key (group! #f) - &key (num! #f) - &key (param0 #f) - &key (param1 #f) - &key (num-func #f) - &key (frame-num #f) - &key (frame-interp #f) - &key (dist #f) - ) - `(ja :eval? #f :chan ,chan :group! ,group! :num! ,num! :param0 ,param0 :param1 ,param1 :num-func ,num-func :frame-num ,frame-num :frame-interp ,frame-interp :dist ,dist) - ) - (defbehavior ja-eval process-drawable () (let ((gp-0 (-> self skel root-channel 0)) (s5-0 (-> self skel channel (-> self skel active-channels))) diff --git a/goal_src/engine/game/effect-control.gc b/goal_src/engine/game/effect-control.gc index 54bfc59a06..687d7c6add 100644 --- a/goal_src/engine/game/effect-control.gc +++ b/goal_src/engine/game/effect-control.gc @@ -430,14 +430,10 @@ arg1 s5-0 ) - (sp-launch-particles-var - *sp-particle-system-2d* - (the-as sparticle-launcher s3-0) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 + (the-as sparticle-launcher s3-0) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)) + ) ) ((= (-> (the-as basic s3-0) type) sparticle-launch-group) (if *debug-effect-control* diff --git a/goal_src/engine/game/generic-obs.gc b/goal_src/engine/game/generic-obs.gc index ea570ab84b..357b21d8c0 100644 --- a/goal_src/engine/game/generic-obs.gc +++ b/goal_src/engine/game/generic-obs.gc @@ -2364,14 +2364,7 @@ (dotimes (s4-1 3) (quaternion-rotate-local-z! s5-0 s5-0 10922.667) (quaternion-copy! *particle-quat* s5-0) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2528) - gp-1 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2528) gp-1) ) ) ) diff --git a/goal_src/engine/game/powerups.gc b/goal_src/engine/game/powerups.gc index 661a4d10fe..1aa721767f 100644 --- a/goal_src/engine/game/powerups.gc +++ b/goal_src/engine/game/powerups.gc @@ -503,24 +503,10 @@ :init-specs ((sp-flt spt-fade-g 0.0)) ) -(defun eco-blue-glow ((arg0 vector)) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 255) - arg0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) +(defun eco-blue-glow ((origin vector)) + (launch-particles (-> *part-id-table* 255) origin) (if (rand-vu-percent? 0.5) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 257) - arg0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 257) origin) ) 0 (none) @@ -555,14 +541,7 @@ ) (rand-vu-percent? 0.5) ) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2391) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2391) gp-0) ) ) (let ((gp-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 70)))) @@ -576,14 +555,7 @@ ) (rand-vu-percent? 0.5) ) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2391) - gp-1 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2391) gp-1) ) ) (let ((f0-8 (lerp-scale 60.0 90.0 (-> self control unknown-float01) 0.0 81920.0))) @@ -656,29 +628,15 @@ (((pickup-type eco-yellow)) (change-sound! (-> self sound) (static-sound-name "yel-eco-jak")) (let ((s4-0 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* (if (rand-vu-percent? 0.5) - 269 - 270 - ) - ) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-0)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* (if (rand-vu-percent? 0.5) 269 270)) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-0)) + ) ) (dotimes (gp-4 2) (let ((v1-111 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 271) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-111)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 271) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-111)) + ) ) ) ) @@ -694,29 +652,15 @@ (update-transforms! (-> self control)) (change-sound! (-> self sound) (static-sound-name "red-eco-jak")) (let ((s4-2 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* (if (rand-vu-percent? 0.5) - 273 - 274 - ) - ) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-2)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* (if (rand-vu-percent? 0.5) 273 274)) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-2)) + ) ) (dotimes (gp-6 2) (let ((v1-139 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 275) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-139)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 275) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-139)) + ) ) ) ) @@ -735,77 +679,35 @@ (set! (-> *part-id-table* 259 init-specs 4 random-rangef) 16384.0) ) ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 259) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-150)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 259) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-150)) +) ) (let ((gp-8 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* (if (rand-vu-percent? 0.5) - 255 - 256 - ) - ) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data gp-8)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* (if (rand-vu-percent? 0.5) 255 256)) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data gp-8)) + ) (if (rand-vu-percent? 0.5) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 257) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data gp-8)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 257) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data gp-8)) + ) ) ) (let ((v1-168 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 260) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-168)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 260) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-168)) + ) ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 1 (seconds 0.1)) ) (((pickup-type eco-green)) (change-sound! (-> self sound) (static-sound-name "green-eco-jak")) (let ((s4-8 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* (if (rand-vu-percent? 0.5) - 277 - 278 - ) - ) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-8)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* (if (rand-vu-percent? 0.5) 277 278)) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-8))) ) (dotimes (gp-11 2) (let ((v1-188 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 279) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-188)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 279) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-188))) ) ) ) diff --git a/goal_src/engine/game/settings.gc b/goal_src/engine/game/settings.gc index 8cbc040e31..b1b4964cc0 100644 --- a/goal_src/engine/game/settings.gc +++ b/goal_src/engine/game/settings.gc @@ -445,10 +445,20 @@ (set! (-> gp-0 aspect-ratio) 'aspect4x3) ) ) - (if (zero? *boot-video-mode*) - (set! (-> gp-0 video-mode) 'ntsc) - (set! (-> gp-0 video-mode) 'pal) - ) + (case *boot-video-mode* + ((0) + (set! (-> gp-0 video-mode) 'ntsc) + ) + ((1) + (set! (-> gp-0 video-mode) 'pal) + ) + ((2) + (set! (-> gp-0 video-mode) '100fps) + ) + ((3) + (set! (-> gp-0 video-mode) '150fps) + ) + ) (set! (-> s5-0 sfx-volume) (+ -1.0 (-> gp-0 sfx-volume))) (set! (-> s5-0 music-volume) (+ -1.0 (-> gp-0 music-volume))) (set! (-> s5-0 dialog-volume) (+ -1.0 (-> gp-0 dialog-volume))) diff --git a/goal_src/engine/game/video.gc b/goal_src/engine/game/video.gc index 88ea7b7434..971c3419ee 100644 --- a/goal_src/engine/game/video.gc +++ b/goal_src/engine/game/video.gc @@ -33,6 +33,30 @@ (set! (-> *math-camera* y-clip) 512.0) (set! (-> *shadow-data* texoffset y) 128.5) ) + (('100fps) + (set! (-> *video-parms* screen-sy) 224) + (set! (-> *setting-control* default screenx) 0) + (set! (-> *setting-control* default screeny) 8) + (set! (-> *video-parms* screen-pages-high) 7) + (set! (-> *video-parms* relative-y-scale) 1.0) + (set! *ticks-per-frame* 5859) + (set! (-> *math-camera* isometric vector 1 y) 0.5) + (set! (-> *math-camera* y-pix) 112.0) + (set! (-> *math-camera* y-clip) 448.0) + (set! (-> *shadow-data* texoffset y) 112.5) + ) + (('150fps) + (set! (-> *video-parms* screen-sy) 224) + (set! (-> *setting-control* default screenx) 0) + (set! (-> *setting-control* default screeny) 8) + (set! (-> *video-parms* screen-pages-high) 7) + (set! (-> *video-parms* relative-y-scale) 1.0) + (set! *ticks-per-frame* 3906) + (set! (-> *math-camera* isometric vector 1 y) 0.5) + (set! (-> *math-camera* y-pix) 112.0) + (set! (-> *math-camera* y-clip) 448.0) + (set! (-> *shadow-data* texoffset y) 112.5) + ) ) (set-time-ratios *display* (-> *display* time-ratio)) (set! (-> *video-parms* reset-video-mode) #t) diff --git a/goal_src/engine/gfx/hw/display.gc b/goal_src/engine/gfx/hw/display.gc index 42a44e8bb2..1e44cec4e2 100644 --- a/goal_src/engine/gfx/hw/display.gc +++ b/goal_src/engine/gfx/hw/display.gc @@ -45,13 +45,30 @@ ;; 6 "ticks" per frame * 50 fps = 300 ticks per second. (set! (-> obj time-factor) 6.0) ) - (else + (('ntsc) (set! (-> obj time-adjust-ratio) ratio) (set! (-> obj seconds-per-frame) (* 0.016666668 ratio)) (set! (-> obj frames-per-second) (* 60.0 (/ 1.0 ratio))) ;; 5 "ticks" per frame * 60 fps = 300 ticks per second. (set! (-> obj time-factor) 5.0) ) + (('100fps) + (set! (-> obj time-adjust-ratio) (* 0.6 ratio)) + (set! (-> obj seconds-per-frame) (* 0.01 ratio)) + (set! (-> obj frames-per-second) (* 100.0 (/ 1.0 ratio))) + ;; 3 "ticks" per frame * 100 fps = 300 ticks per second. + (set! (-> obj time-factor) 3.0) + ) + (('150fps) + (set! (-> obj time-adjust-ratio) (* 0.4 ratio)) + (set! (-> obj seconds-per-frame) (* 0.006666667 ratio)) + (set! (-> obj frames-per-second) (* 150.0 (/ 1.0 ratio))) + ;; 2 "ticks" per frame * 150 fps = 300 ticks per second. + (set! (-> obj time-factor) 2.0) + ) + (else + (format #t "Warning: Tried to set unsupported video-mode") + ) ) ) (-> obj time-ratio) diff --git a/goal_src/engine/gfx/ocean/ocean.gc b/goal_src/engine/gfx/ocean/ocean.gc index 8c06b24b51..1f4342e766 100644 --- a/goal_src/engine/gfx/ocean/ocean.gc +++ b/goal_src/engine/gfx/ocean/ocean.gc @@ -747,4 +747,4 @@ ) 0 (none) - ) \ No newline at end of file + ) diff --git a/goal_src/engine/gfx/sky/sky-tng.gc b/goal_src/engine/gfx/sky/sky-tng.gc index b0bac528af..69910fb11c 100644 --- a/goal_src/engine/gfx/sky/sky-tng.gc +++ b/goal_src/engine/gfx/sky/sky-tng.gc @@ -168,15 +168,31 @@ (sky-make-sun-data *sky-parms* 1 arg0) (sky-make-moon-data *sky-parms* arg0) (let ((v1-0 *sky-tng-data*)) - (+! (-> v1-0 off-s-0) 16) - (+! (-> v1-0 off-t-0) 32) - (+! (-> v1-0 off-s-1) -21) - (+! (-> v1-0 off-t-1) 42) - (set! (-> v1-0 time) arg0) + (case (-> *setting-control* current video-mode) + (('150fps) + (+! (-> v1-0 off-s-0) 6.4) + (+! (-> v1-0 off-t-0) 12.8) + (+! (-> v1-0 off-s-1) -8.4) + (+! (-> v1-0 off-t-1) 16.8) + ) + (('100fps) + (+! (-> v1-0 off-s-0) 9.6) + (+! (-> v1-0 off-t-0) 19.2) + (+! (-> v1-0 off-s-1) -12.6) + (+! (-> v1-0 off-t-1) 25.2) + ) + (else + (+! (-> v1-0 off-s-0) 16) + (+! (-> v1-0 off-t-0) 32) + (+! (-> v1-0 off-s-1) -21) + (+! (-> v1-0 off-t-1) 42) + ) + ) + (set! (-> v1-0 time) arg0) ) 0 (none) - ) +) #| (defun init-sky-regs () diff --git a/goal_src/engine/gfx/water/water.gc b/goal_src/engine/gfx/water/water.gc index 614aa8b8b5..d77d7998d0 100644 --- a/goal_src/engine/gfx/water/water.gc +++ b/goal_src/engine/gfx/water/water.gc @@ -48,14 +48,7 @@ (sp-kill-particle arg0 arg1) (set-vector! s5-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) (sound-play "water-drop" :position (the-as symbol s5-0)) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 108) - s5-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* :rate 1.0 (-> *part-id-table* 108) s5-0) ) ) 0 @@ -728,42 +721,14 @@ (set! (-> *part-id-table* 118 init-specs 1 initial-valuef) (* 0.0000036621095 f28-0)) (set! (-> *part-id-table* 118 init-specs 2 initial-valuef) (* 0.1 f28-0)) (set! (-> *part-id-table* 118 init-specs 13 initial-valuef) 0.7111111) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 118) - s4-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 118) s4-0) (set! (-> *part-id-table* 121 init-specs 1 initial-valuef) (* 0.000004150391 f28-0)) (set! (-> *part-id-table* 121 init-specs 18 initial-valuef) f30-1) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 121) - s4-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 121) s4-0) (when (< f28-0 4096.0) (set! (-> *part-id-table* 112 init-specs 4 random-rangef) (-> obj ripple-size)) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 112) - s4-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 115) - s4-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 112) s4-0) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 115) s4-0) ) ) ) @@ -786,23 +751,9 @@ (* 0.00012207031 (vector-xz-length (-> obj process root transv))) ) ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 110) - s4-1 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 110) s4-1) (set! (-> *part-id-table* 111 init-specs 16 initial-valuef) (-> obj surface-height)) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 111) - s4-1 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 111) s4-1) ) ) (let ((f30-3 (- (+ (-> obj base-height) (-> obj ocean-offset) (-> obj bob-offset) (-> obj align-offset)) @@ -990,14 +941,7 @@ (set! (-> *part-id-table* 145 init-specs 8 initial-valuef) (* 0.05 (- (-> a2-15 x) (-> obj drip-old-pos x)))) (set! (-> *part-id-table* 145 init-specs 9 initial-valuef) (* 0.05 (- (-> a2-15 y) (-> obj drip-old-pos y)))) (set! (-> *part-id-table* 145 init-specs 10 initial-valuef) (* 0.05 (- (-> a2-15 z) (-> obj drip-old-pos z)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 145) - a2-15 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 145) a2-15) ) (set! (-> obj drip-time) (-> *display* base-frame-counter)) (logclear! (-> obj flags) (water-flags wt15)) diff --git a/goal_src/engine/gfx/wind.gc b/goal_src/engine/gfx/wind.gc index 0ee8bfc63c..acef24b799 100644 --- a/goal_src/engine/gfx/wind.gc +++ b/goal_src/engine/gfx/wind.gc @@ -21,9 +21,9 @@ (set! (-> arg0 wind-time) (+ (-> arg0 wind-time) 1)) (let* ((s4-0 (logand (-> arg0 wind-time) 63)) (f0-4 (rand-vu-float-range 0.0 100.0)) - (v1-5 (/ (-> arg0 wind-time) (the-as uint 120))) + (v1-5 (/ (if (or (eq? (-> *setting-control* current video-mode) '150fps) (eq? (-> *setting-control* current video-mode) '100fps)) (the uint (min 1.0 (* (if (eq? (-> *setting-control* current video-mode) '150fps) 0.4 0.6) (-> arg0 wind-time)))) (-> arg0 wind-time)) (the-as uint 120))) (f1-6 (* 0.008333334 - (the float (mod (-> arg0 wind-time) (the-as uint 120))) + (the float (mod (if (or (eq? (-> *setting-control* current video-mode) '150fps) (eq? (-> *setting-control* current video-mode) '100fps)) (the uint (min 1.0 (* (if (eq? (-> *setting-control* current video-mode) '150fps) 0.4 0.6) (-> arg0 wind-time)))) (-> arg0 wind-time)) (the-as uint 120))) ) ) (f2-4 (* 0.0625 diff --git a/goal_src/engine/load/loader.gc b/goal_src/engine/load/loader.gc index 84e99c6e15..f503b02e0f 100644 --- a/goal_src/engine/load/loader.gc +++ b/goal_src/engine/load/loader.gc @@ -892,7 +892,7 @@ (set! sv-56 0) (set! spool-sound (new-sound-id)) (backup-load-state-and-set-cmds *load-state* (-> arg0 command-list)) - (set-setting! 'spooling (the-as symbol (process->ppointer self)) 0.0 0) + (set-setting! 'spooling (process->ppointer self) 0.0 0) (logior! (-> self skel status) (janim-status inited drawn done)) (kill-current-level-hint '() '() 'die) (level-hint-surpress!) @@ -900,16 +900,9 @@ (when (or (handle->process (-> *art-control* spool-lock)) (!= *master-mode* 'game)) (cond (arg1 - (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - arg1 - ) + (when (!= (ja-group) arg1) (ja-channel-push! 1 (seconds 0.05)) - (let ((s2-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! s2-0 arg1 num-func-identity) - (set! (-> s2-0 frame-num) 0.0) - ) + (ja :group! arg1 :num! min) ) ) (else @@ -923,12 +916,9 @@ ) (spool-push *art-control* (-> arg0 name) spool-part self -9.0) (suspend) - (when arg1 - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-loop!) + (if arg1 + (ja :num! (loop!)) ) - ) ) ) (let ((v1-46 (process->ppointer self))) @@ -936,7 +926,7 @@ (new 'static 'handle :process v1-46 :pid (-> (the-as process (-> v1-46 0)) pid)) ) ) - (set! sv-48 (-> *display* base-frame-counter)) + (set! sv-48 (the-as int (-> *display* base-frame-counter))) (while (< spool-part (-> arg0 parts)) (spool-push *art-control* (-> arg0 name) spool-part self -20.0) (update *art-control* #f) @@ -944,16 +934,9 @@ (when (!= (file-status *art-control* (-> arg0 name) spool-part) 'active) (cond (arg1 - (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - arg1 - ) + (when (!= (ja-group) arg1) (ja-channel-set! 1) - (let ((s2-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! s2-2 arg1 num-func-identity) - (set! (-> s2-2 frame-num) 0.0) - ) + (ja :group! arg1 :num! min) ) ) (else @@ -967,12 +950,9 @@ (spool-push *art-control* (-> arg0 name) spool-part self -20.0) (format #t "WARNING: ---------------------> loader stall on art ~S ~D~%" (-> arg0 name) spool-part) (suspend) - (when arg1 - (let ((a0-37 (-> self skel root-channel 0))) - (set! (-> a0-37 param 0) 1.0) - (joint-control-channel-group-eval! a0-37 (the-as art-joint-anim #f) num-func-loop!) + (if arg1 + (ja :num! (loop!)) ) - ) ) ) (spool-push *art-control* (-> arg0 name) spool-part self -20.0) @@ -980,28 +960,34 @@ (cond (s2-4 (ja-channel-set! 1) - (let ((a0-42 (-> self skel root-channel 0))) - (set! (-> a0-42 frame-group) s2-4) - (set! (-> a0-42 param 0) (the float (+ (-> s2-4 data 0 length) -1))) - (set! (-> a0-42 param 1) 1.0) - (set! (-> a0-42 frame-num) 0.0) - (joint-control-channel-group! a0-42 s2-4 num-func-seek!) - ) + (ja-no-eval :group! s2-4 :num! (seek!) :frame-num 0.0) (when (zero? spool-part) (str-play-async (-> arg0 name) spool-sound) (set! (-> *art-control* active-stream) (-> arg0 name)) ) - (let* ((f30-0 (* 0.05859375 (-> s2-4 speed))) + ;; 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") + ) + ) + (if (= (-> *setting-control* current video-mode) '150fps) 0.4 0.6) + 1.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)) - (set! sv-40 (-> *display* base-frame-counter)) + (set! sv-40 (the-as int (-> *display* base-frame-counter))) (until (>= (the float v0-39) f28-0) (if (= (-> self skel root-channel 0) (-> self skel channel)) (logior! (-> self skel status) (janim-status spool)) ) (if (or (arg3 self) - (and (<= sv-72 0) (>= (- (-> *display* base-frame-counter) sv-40) 1200)) + (and (<= sv-72 0) (>= (- (-> *display* base-frame-counter) sv-40) (seconds 4))) (and (< 300 sv-56) (<= sv-72 0)) ) (goto cfg-88) @@ -1015,22 +1001,17 @@ (cond ((and (< sv-32 sv-72) (= (current-str-id) spool-sound)) (set! sv-56 (+ sv-56 (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)))) - (set! sv-40 (-> *display* base-frame-counter)) + (set! sv-40 (the-as int (-> *display* base-frame-counter))) ) (else 0 ) ) (set! sv-32 sv-72) - (set! sv-48 (-> *display* base-frame-counter)) + (set! sv-48 (the-as int (-> *display* base-frame-counter))) (suspend) - (let ((f0-14 (* (- (the float (current-str-pos spool-sound)) sv-24) f30-0)) - (a0-69 (-> self skel root-channel 0)) - ) - (set! (-> a0-69 param 0) (the float (+ (-> a0-69 frame-group data 0 length) -1))) - (set! (-> a0-69 param 1) 1.0) - (set! (-> a0-69 frame-num) f0-14) - (joint-control-channel-group! a0-69 (the-as art-joint-anim #f) num-func-seek!) + (let ((f0-14 (* (- (the float (current-str-pos spool-sound)) sv-24) f30-0))) + (ja-no-eval :num! (seek!) :frame-num f0-14) ) (set! v0-39 (current-str-pos spool-sound)) (set! sv-72 v0-39) @@ -1055,34 +1036,28 @@ (defbehavior ja-abort-spooled-anim process-drawable ((arg0 spool-anim) (arg1 art-joint-anim) (arg2 int)) "Abort a spooled animation." - (restore-load-state-and-cleanup *load-state*) (str-play-stop (-> arg0 name)) (set! (-> *art-control* active-stream) #f) (logclear! (-> self skel status) (janim-status drawn done)) (if (zero? (logand (-> self skel status) (janim-status inited))) - (logclear! (-> self skel status) (janim-status inited)) - ) + (logclear! (-> self skel status) (janim-status inited)) + ) (remove-setting! 'spooling) (cond - ((and arg1 (>= arg2 0)) - (ja-channel-push! 1 (seconds 0.1)) - (set! (-> self skel root-channel 0 frame-group) arg1) - (while (!= (-> self skel root-channel 0) (-> self skel channel)) - (spool-push *art-control* (-> arg0 name) arg2 self -20.0) - (suspend) - ;; TODO macro - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) + ((and arg1 (>= arg2 0)) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) arg1) + (while (!= (-> self skel root-channel 0) (-> self skel channel)) + (spool-push *art-control* (-> arg0 name) arg2 self -20.0) + (suspend) + (ja :num! (seek!)) ) + ) + (else + (ja-channel-set! 0) ) ) - (else - (ja-channel-set! 0) - ) - ) (set! (-> *art-control* spool-lock) (the-as handle #f)) 0 ) diff --git a/goal_src/engine/sparticle/sparticle.gc b/goal_src/engine/sparticle/sparticle.gc index c380ff8a36..3f936a2dc9 100644 --- a/goal_src/engine/sparticle/sparticle.gc +++ b/goal_src/engine/sparticle/sparticle.gc @@ -127,6 +127,12 @@ (new 'global 'sparticle-system 256 0 #t (-> *sprite-array-3d* vec-data) (-> *sprite-array-3d* adgif-data)) ) +(defmacro launch-particles (&key (system *sp-particle-system-2d*) particle origin &key (launch-state (the-as sparticle-launch-state #f)) &key (launch-control (the-as sparticle-launch-control #f)) + &key (rate (if (= (-> *setting-control* current video-mode) '150fps) + (if (= (-> *setting-control* current video-mode) '100fps) 0.6 0.4) + 1.0))) + `(sp-launch-particles-var ,system ,particle ,origin ,launch-state ,launch-control ,rate) + ) ;;;;;;;;;;;;;;;;;;;; @@ -676,46 +682,9 @@ (none) ) -(defun set-particle-frame-time ((arg0 int)) - (cond - ((= arg0 5) - (set-vector! - *sp-frame-time* - 0.00000000000000000000000000000000000001175495 - 5.0 - 1.0 - 1.0 - ) - ) - ((= arg0 6) - (set-vector! - *sp-frame-time* - 0.000000000000000000000000000000000000011754952 - 6.0 - 1.2 - 1.2 - ) - ) - ((= arg0 10) - (set-vector! - *sp-frame-time* - 0.000000000000000000000000000000000000011754958 - 10.0 - 2.0 - 2.0 - ) - ) - ((= arg0 12) - (set-vector! - *sp-frame-time* - 0.00000000000000000000000000000000000001175496 - 12.0 - 2.4 - 2.4 - ) - ) - ) - 0 +(defun set-particle-frame-time ((scaled-seconds int)) + "Adjusts particle frame time based on the frame-rate (scaled-seconds). Note: This used to be a case statement and has been rewritten as a more generic formula" + (set-vector! *sp-frame-time* (the-as float (logior #x800000 scaled-seconds)) (the float scaled-seconds) (* 0.2 scaled-seconds) (* 0.2 scaled-seconds)) (none) ) diff --git a/goal_src/engine/target/target-part.gc b/goal_src/engine/target/target-part.gc index b016d29e38..e658c3d855 100644 --- a/goal_src/engine/target/target-part.gc +++ b/goal_src/engine/target/target-part.gc @@ -2172,14 +2172,7 @@ ) ) ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2002) - a2-3 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - (the-as float 1.0) - ) + (launch-particles (-> *part-id-table* 2002) a2-3) ) (suspend) 0 diff --git a/goal_src/engine/target/target.gc b/goal_src/engine/target/target.gc index c29628d8a6..406a1f0e03 100644 --- a/goal_src/engine/target/target.gc +++ b/goal_src/engine/target/target.gc @@ -2697,10 +2697,14 @@ (or (= v1-6 eichar-flop-down-loop-ja) (= v1-6 eichar-moving-flop-down-ja)) ) ) - (when (and (or (< (target-move-dist (seconds 0.1)) 1638.4) - (and (logtest? (-> self control status) (cshape-moving-flags twall)) (< 0.7 (-> self control poly-angle))) - ) - (zero? (logand (-> self control status) (cshape-moving-flags t-act))) + (when (and (or (< (target-move-dist (if (or (= (-> *setting-control* current video-mode) '150fps) (= (-> *setting-control* current video-mode) '150fps)) + (if (= (-> *setting-control* current video-mode) '150ps) (seconds 0.04) (seconds 0.06)) + (seconds 0.1))) + (if (or (= (-> *setting-control* current video-mode) '150fps) (= (-> *setting-control* current video-mode) '100fps)) (if (= (-> *setting-control* current video-mode) '150fps) 655.36 983.04) 1638.4) + ) + (and (logtest? (-> self control status) (cshape-moving-flags twall)) (< 0.7 (-> self control poly-angle))) + ) + (zero? (logand (-> self control status) (cshape-moving-flags t-act))) (>= (-> self control unknown-uint20) (the-as uint 2)) ) (set! (-> self control unknown-dword36) (-> *display* base-frame-counter)) diff --git a/goal_src/examples/debug-draw-example.gc b/goal_src/examples/debug-draw-example.gc index e20e9311f4..5ef1ef25e0 100644 --- a/goal_src/examples/debug-draw-example.gc +++ b/goal_src/examples/debug-draw-example.gc @@ -102,23 +102,9 @@ ) (dotimes (i 10) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 37) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 + (launch-particles (-> *part-id-table* 37) gp-0) + (launch-particles (-> *part-id-table* 38) gp-0) ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 38) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - ) ) ) 0 @@ -368,4 +354,4 @@ (load-state-want-display-level *debug-load-level* #t) ) ) - ) \ No newline at end of file + ) diff --git a/goal_src/levels/beach/beach-part.gc b/goal_src/levels/beach/beach-part.gc index 365d775043..d199592f41 100644 --- a/goal_src/levels/beach/beach-part.gc +++ b/goal_src/levels/beach/beach-part.gc @@ -93,24 +93,10 @@ (f0-0 (vector-vector-distance (-> self root trans) gp-0)) ) (if (or (< (-> gp-0 y) (-> self root trans y)) (< 122880.0 f0-0)) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 666) - (-> self root trans) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 666) (-> self root trans)) ) ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 668) - (-> self root trans) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 668) (-> self root trans)) ) (suspend) ) diff --git a/goal_src/levels/beach/lurkerworm.gc b/goal_src/levels/beach/lurkerworm.gc index 58300d0bc1..b7d16a2ff9 100644 --- a/goal_src/levels/beach/lurkerworm.gc +++ b/goal_src/levels/beach/lurkerworm.gc @@ -241,44 +241,16 @@ (defmethod particle-effect lurkerworm ((obj lurkerworm)) (let ((a2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 5)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 661) - a2-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 661) a2-0) ) (let ((a2-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 6)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 661) - a2-1 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 661) a2-1) ) (let ((a2-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 7)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 661) - a2-2 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 661) a2-2) ) (let ((a2-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 8)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 661) - a2-3 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 661) a2-3) ) 0 (none) diff --git a/goal_src/levels/citadel/citadel-part.gc b/goal_src/levels/citadel/citadel-part.gc index 913d405e81..671cadf8f5 100644 --- a/goal_src/levels/citadel/citadel-part.gc +++ b/goal_src/levels/citadel/citadel-part.gc @@ -63,22 +63,8 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! gp-0 (-> arg2 x) (-> arg2 y) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2882) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - (the-as float 1.0) - ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2883) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - (the-as float 1.0) - ) + (launch-particles :rate 1.0 (-> *part-id-table* 2882) gp-0) + (launch-particles :rate 1.0 (-> *part-id-table* 2883) gp-0) ) ) (none) diff --git a/goal_src/levels/citadel/citadel-sages.gc b/goal_src/levels/citadel/citadel-sages.gc index 0c04a53f6e..e8e9215a92 100644 --- a/goal_src/levels/citadel/citadel-sages.gc +++ b/goal_src/levels/citadel/citadel-sages.gc @@ -71,14 +71,7 @@ ) (dotimes (s2-2 12) (vector-matrix*! s5-0 (-> self bar-array s2-2) gp-0) - (sp-launch-particles-var - s3-1 - s4-1 - s5-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system s3-1 s4-1 s5-0) ) ) ) diff --git a/goal_src/levels/citadel/citb-plat.gc b/goal_src/levels/citadel/citb-plat.gc index 897526e5e6..840e4a9cd1 100644 --- a/goal_src/levels/citadel/citb-plat.gc +++ b/goal_src/levels/citadel/citb-plat.gc @@ -887,14 +887,7 @@ (dotimes (s5-0 16) (quaternion-rotate-local-z! gp-0 gp-0 2048.0) (quaternion-copy! *particle-quat* gp-0) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2541) - (-> self blast-pos) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2541) (-> self blast-pos)) ) ) (spawn (-> self part) (-> self blast-pos)) diff --git a/goal_src/levels/finalboss/light-eco.gc b/goal_src/levels/finalboss/light-eco.gc index ee5e3013a1..2786515d1c 100644 --- a/goal_src/levels/finalboss/light-eco.gc +++ b/goal_src/levels/finalboss/light-eco.gc @@ -188,22 +188,8 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! gp-0 (-> arg2 x) (-> arg2 y) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2904) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2905) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 2904) gp-0) + (launch-particles :rate 1.0 (-> *part-id-table* 2905) gp-0) ) ) (none) @@ -321,22 +307,8 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! gp-0 (-> arg2 x) (-> arg2 y) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2910) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2911) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 2910) gp-0) + (launch-particles :rate 1.0 (-> *part-id-table* 2911) gp-0) ) ) (none) diff --git a/goal_src/levels/finalboss/sage-finalboss-part.gc b/goal_src/levels/finalboss/sage-finalboss-part.gc index 14f996ec1c..27308eb822 100644 --- a/goal_src/levels/finalboss/sage-finalboss-part.gc +++ b/goal_src/levels/finalboss/sage-finalboss-part.gc @@ -352,22 +352,8 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! gp-0 (-> arg2 x) (-> arg2 y) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2933) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2934) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 2933) gp-0) + (launch-particles :rate 1.0 (-> *part-id-table* 2934) gp-0) ) ) (none) @@ -1041,22 +1027,8 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! gp-0 (-> arg2 x) (-> arg2 y) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2962) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2963) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 2962) gp-0) + (launch-particles :rate 1.0 (-> *part-id-table* 2963) gp-0) ) ) (none) diff --git a/goal_src/levels/jungle/darkvine.gc b/goal_src/levels/jungle/darkvine.gc index 291f34c129..c00e933300 100644 --- a/goal_src/levels/jungle/darkvine.gc +++ b/goal_src/levels/jungle/darkvine.gc @@ -218,14 +218,7 @@ (ja-channel-push! 1 (seconds 0.15)) (ja-no-eval :group! darkvine-retreat-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 800) - (-> self root-override trans) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 800) (-> self root-override trans)) (suspend) (ja :num! (seek!)) ) diff --git a/goal_src/levels/jungle/fisher.gc b/goal_src/levels/jungle/fisher.gc index 543f8b1de3..826e31ba9d 100644 --- a/goal_src/levels/jungle/fisher.gc +++ b/goal_src/levels/jungle/fisher.gc @@ -853,14 +853,7 @@ (set! (-> *part-id-table* 118 init-specs 1 initial-valuef) 0.05) (set! (-> *part-id-table* 118 init-specs 2 initial-valuef) 0.0) (set! (-> *part-id-table* 118 init-specs 13 initial-valuef) 0.35555556) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 118) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 118) gp-0) ) 0 (none) @@ -1742,42 +1735,14 @@ (when (-> self training) (let ((gp-0 (new-stack-vector0))) (vector<-cspace! gp-0 (-> self node-list data 74)) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2001) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 2001) gp-0) (fisher-fish-water gp-0 (+ 32768.0 (vector-y-angle (-> self node-list data 75 bone transform vector 1)))) (vector<-cspace! gp-0 (-> self node-list data 77)) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2001) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 2001) gp-0) (fisher-fish-water gp-0 (+ 32768.0 (vector-y-angle (-> self node-list data 78 bone transform vector 1)))) (vector<-cspace! gp-0 (-> self node-list data 80)) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 828) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2013) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 828) gp-0) + (launch-particles (-> *part-id-table* 2013) gp-0) (fisher-fish-water gp-0 (+ 32768.0 (vector-y-angle (-> self node-list data 80 bone transform vector 1)))) ) ) diff --git a/goal_src/levels/jungle/jungle-mirrors.gc b/goal_src/levels/jungle/jungle-mirrors.gc index 61c740d3d5..714d768efd 100644 --- a/goal_src/levels/jungle/jungle-mirrors.gc +++ b/goal_src/levels/jungle/jungle-mirrors.gc @@ -998,14 +998,7 @@ (when (periscope-has-power-input?) (update! (-> self sound)) (if (logtest? (-> self draw status) (draw-status was-drawn)) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 825) - (-> self reflector-trans) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 825) (-> self reflector-trans)) ) ) 0 @@ -1828,14 +1821,7 @@ (draw-power-beam gp-0 (-> self beam-end)) (update! (-> self sound)) (when (logtest? (-> self draw status) (draw-status was-drawn)) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 825) - (-> self beam-end) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 825) (-> self beam-end)) (when (and *target* (>= 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (start-hint-timer (game-text-id jungle-mirrors-break-the-mirror-jak)) (level-hint-spawn diff --git a/goal_src/levels/maincave/maincave-obs.gc b/goal_src/levels/maincave/maincave-obs.gc index 56aa06a64c..9a96531ac2 100644 --- a/goal_src/levels/maincave/maincave-obs.gc +++ b/goal_src/levels/maincave/maincave-obs.gc @@ -483,22 +483,8 @@ (cond ((< gp-0 a0-1) (when (sphere-in-view-frustum? (the-as sphere (-> self root-override root-prim prim-core))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 704) - (the-as vector (-> self launch-pos)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 705) - (the-as vector (&-> self stack 112)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 704) (the-as vector (-> self launch-pos))) + (launch-particles (-> *part-id-table* 705) (the-as vector (&-> self stack 112))) ) (when (-> self should-play-sound?) (set! (-> self should-play-sound?) #f) diff --git a/goal_src/levels/maincave/maincave-part.gc b/goal_src/levels/maincave/maincave-part.gc index 696762375c..9a85d60567 100644 --- a/goal_src/levels/maincave/maincave-part.gc +++ b/goal_src/levels/maincave/maincave-part.gc @@ -293,22 +293,8 @@ (sound-play "water-drop") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2231) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2232) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 2231) gp-0) + (launch-particles :system *sp-particle-system-3d* :rate 1.0 (-> *part-id-table* 2232) gp-0) ) ) (none) diff --git a/goal_src/levels/misty/misty-obs.gc b/goal_src/levels/misty/misty-obs.gc index 056470a7c0..2657d82112 100644 --- a/goal_src/levels/misty/misty-obs.gc +++ b/goal_src/levels/misty/misty-obs.gc @@ -1394,14 +1394,7 @@ (defstate breakaway-about-to-fall (breakaway) :code (behavior () (sound-play "falling-bones") - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 281) - (-> self root-override trans) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 281) (-> self root-override trans)) (let ((gp-1 #f) (s5-1 (-> *display* base-frame-counter)) ) diff --git a/goal_src/levels/misty/muse.gc b/goal_src/levels/misty/muse.gc index 1a994dae59..be7ddcf094 100644 --- a/goal_src/levels/misty/muse.gc +++ b/goal_src/levels/misty/muse.gc @@ -150,14 +150,7 @@ (defmethod dummy-51 muse ((obj muse)) (dotimes (s5-0 2) (let ((v1-2 (rand-vu-int-range 3 (+ (-> obj node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 271) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data v1-2)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 271) (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data v1-2))) ) ) 0 diff --git a/goal_src/levels/racer_common/racer-states.gc b/goal_src/levels/racer_common/racer-states.gc index 89e8fdd180..6582b1b6be 100644 --- a/goal_src/levels/racer_common/racer-states.gc +++ b/goal_src/levels/racer_common/racer-states.gc @@ -407,14 +407,7 @@ ) (when (>= (-> self control unknown-float01) 40960.0) (set! (-> *part-id-table* 2225 init-specs 1 initial-valuef) 100.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2225) - (-> self control trans) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 2225) (-> self control trans)) ) (target-land-effect) (when (and (>= (-> self control ground-impact-vel) 61440.0) (zero? (-> self racer bounce))) diff --git a/goal_src/levels/racer_common/target-racer.gc b/goal_src/levels/racer_common/target-racer.gc index 63ecaf5c54..b882c77432 100644 --- a/goal_src/levels/racer_common/target-racer.gc +++ b/goal_src/levels/racer_common/target-racer.gc @@ -650,14 +650,10 @@ (when (< 0.0 (-> *part-id-table* 2212 init-specs 11 initial-valuef)) (set! (-> *part-id-table* 2212 init-specs 14 initial-valuef) (the-as float gp-0)) (set! (-> *part-id-table* 2212 init-specs 3 initial-valuef) 15155.2) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2212) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 4)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* + (-> *part-id-table* 2212) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 4)) + ) ) ) (let ((gp-2 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00)))) @@ -670,14 +666,10 @@ (when (< 0.0 (-> *part-id-table* 2212 init-specs 11 initial-valuef)) (set! (-> *part-id-table* 2212 init-specs 14 initial-valuef) (the-as float gp-2)) (set! (-> *part-id-table* 2212 init-specs 3 initial-valuef) 10240.0) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2212) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 10)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* + (-> *part-id-table* 2212) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 10)) + ) ) ) (when (and (racer-on-ground?) (< (-> self control unknown-float01) 90112.0)) @@ -696,22 +688,8 @@ (set! (-> *part-id-table* 2275 init-specs 19 initial-valuef) (+ 49152.0 f1-3)) (set! (-> *part-id-table* 2275 init-specs 1 initial-valuef) (* 0.0000036621095 f0-17)) (set! (-> *part-id-table* 2275 init-specs 2 initial-valuef) (* 0.1 f0-17)) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2275) - s4-2 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2276) - s4-2 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2275) s4-2) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2276) s4-2) ) ) (-> *part-id-table* 2208) @@ -753,17 +731,10 @@ ) (set! (-> s5-2 y) (-> self control shadow-pos y)) (if (nonzero? a1-13) - (sp-launch-particles-var - (if gp-4 - *sp-particle-system-3d* - *sp-particle-system-2d* - ) - a1-13 - s5-2 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system (if gp-4 *sp-particle-system-3d* *sp-particle-system-2d*) + a1-13 + s5-2 + ) ) ) (let* ((gp-5 #f) @@ -790,17 +761,10 @@ ) (set! (-> a2-7 y) (-> self control shadow-pos y)) (if (nonzero? s5-3) - (sp-launch-particles-var - (if gp-5 - *sp-particle-system-3d* - *sp-particle-system-2d* - ) - (the-as sparticle-launcher s5-3) - a2-7 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system (if gp-5 *sp-particle-system-3d* *sp-particle-system-2d*) + (the-as sparticle-launcher s5-3) + a2-7 + ) ) ) ) @@ -916,14 +880,9 @@ (when (!= (-> self racer boost-output) 0.0) (dotimes (gp-7 8) (let ((v1-258 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2229) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-258)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 2229) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-258)) + ) ) ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 1 (seconds 0.1)) @@ -948,14 +907,7 @@ ) ) ) - (sp-launch-particles-var - *sp-particle-system-2d* - a1-54 - gp-8 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles a1-54 gp-8) ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 51 (seconds 0.05)) (sound-play-by-name @@ -986,14 +938,7 @@ ) ) ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2227) - a2-28 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 2227) a2-28) ) ) 0 diff --git a/goal_src/levels/rolling/rolling-lightning-mole.gc b/goal_src/levels/rolling/rolling-lightning-mole.gc index c692629c1e..37ecb572cb 100644 --- a/goal_src/levels/rolling/rolling-lightning-mole.gc +++ b/goal_src/levels/rolling/rolling-lightning-mole.gc @@ -1157,14 +1157,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 1771) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 1771) gp-0) ) ) (none) @@ -1178,14 +1171,7 @@ (sound-play "land-grass") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 1772) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 1772) gp-0) ) ) (none) diff --git a/goal_src/levels/sunken/orbit-plat.gc b/goal_src/levels/sunken/orbit-plat.gc index bdb3c610de..e3cd038d55 100644 --- a/goal_src/levels/sunken/orbit-plat.gc +++ b/goal_src/levels/sunken/orbit-plat.gc @@ -152,14 +152,7 @@ ) (set! (-> *part-id-table* 1717 init-specs 1 random-rangef) (* 0.000009494358 f30-0)) ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 1717) - arg0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 1717) arg0) 0 (none) ) diff --git a/goal_src/levels/sunken/sun-exit-chamber.gc b/goal_src/levels/sunken/sun-exit-chamber.gc index e3ec051794..b6041d69d3 100644 --- a/goal_src/levels/sunken/sun-exit-chamber.gc +++ b/goal_src/levels/sunken/sun-exit-chamber.gc @@ -571,14 +571,7 @@ (vector-matrix*! gp-0 gp-0 s4-0) (vector-float*! gp-0 gp-0 (/ 1.0 (-> gp-0 w))) (set! (-> *part-id-table* 2515 init-specs 13 initial-valuef) (+ 24576.0 (-> gp-0 y))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2515) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 2515) gp-0) ) (none) ) diff --git a/goal_src/levels/sunken/sunken-water.gc b/goal_src/levels/sunken/sunken-water.gc index 01cdde025c..8bb8022a5c 100644 --- a/goal_src/levels/sunken/sunken-water.gc +++ b/goal_src/levels/sunken/sunken-water.gc @@ -80,14 +80,7 @@ ) (set! (-> gp-0 vertex-skip) 128) (dotimes (s5-0 (-> gp-0 vertex-count)) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 1736) - (-> gp-0 data s5-0) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 1736) (-> gp-0 data s5-0)) ) ) #f diff --git a/goal_src/levels/training/training-part.gc b/goal_src/levels/training/training-part.gc index 264cc74f21..b999b2d384 100644 --- a/goal_src/levels/training/training-part.gc +++ b/goal_src/levels/training/training-part.gc @@ -293,22 +293,8 @@ (sound-play "water-drop") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 763) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 764) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 763) gp-0) + (launch-particles :system *sp-particle-system-3d* :rate 1.0 (-> *part-id-table* 764) gp-0) ) ) (none) diff --git a/goal_src/levels/village1/assistant.gc b/goal_src/levels/village1/assistant.gc index b05217c073..0ffdeff23b 100644 --- a/goal_src/levels/village1/assistant.gc +++ b/goal_src/levels/village1/assistant.gc @@ -359,14 +359,7 @@ (sound-play "water-drop") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 367) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 367) gp-0) ) ) (none) diff --git a/goal_src/levels/village1/fishermans-boat.gc b/goal_src/levels/village1/fishermans-boat.gc index a221ff40d3..ed5a3c28a5 100644 --- a/goal_src/levels/village1/fishermans-boat.gc +++ b/goal_src/levels/village1/fishermans-boat.gc @@ -688,14 +688,7 @@ (set! (-> *part-id-table* 2896 init-specs 19 initial-valuef) (+ 49152.0 arg1)) (set! (-> *part-id-table* 2896 init-specs 1 initial-valuef) (* 0.0000036621095 arg2)) (set! (-> *part-id-table* 2896 init-specs 2 initial-valuef) (* 0.1 arg2)) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2896) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2896) gp-0) ) 0 (none) diff --git a/goal_src/levels/village1/village1-part.gc b/goal_src/levels/village1/village1-part.gc index c72df280b5..bda4286fd3 100644 --- a/goal_src/levels/village1/village1-part.gc +++ b/goal_src/levels/village1/village1-part.gc @@ -1209,22 +1209,8 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 434) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - (the-as float 1.0) - ) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 435) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - (the-as float 1.0) - ) + (launch-particles :rate 1.0 (-> *part-id-table* 434) gp-0) + (launch-particles :system *sp-particle-system-3d* :rate 1.0 (-> *part-id-table* 435) gp-0) ) ) (none) diff --git a/goal_src/levels/village1/village1-part2.gc b/goal_src/levels/village1/village1-part2.gc index 9604e20dee..c83094d2f0 100644 --- a/goal_src/levels/village1/village1-part2.gc +++ b/goal_src/levels/village1/village1-part2.gc @@ -1613,22 +1613,8 @@ (sound-play "water-drop") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 502) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - (the-as float 1.0) - ) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 503) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - (the-as float 1.0) - ) + (launch-particles :rate 1.0 (-> *part-id-table* 502) gp-0) + (launch-particles :system *sp-particle-system-3d* :rate 1.0 (-> *part-id-table* 503) gp-0) ) ) (none) diff --git a/goal_src/levels/village2/assistant-village2.gc b/goal_src/levels/village2/assistant-village2.gc index f11bb6a5e0..7161b86d80 100644 --- a/goal_src/levels/village2/assistant-village2.gc +++ b/goal_src/levels/village2/assistant-village2.gc @@ -687,14 +687,7 @@ (sound-play "water-drop") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 1324) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 1324) gp-0) ) ) (none) diff --git a/goal_src/levels/village2/swamp-blimp.gc b/goal_src/levels/village2/swamp-blimp.gc index bfc94caec3..96aceefecb 100644 --- a/goal_src/levels/village2/swamp-blimp.gc +++ b/goal_src/levels/village2/swamp-blimp.gc @@ -1030,14 +1030,7 @@ (let ((a2-1 (new 'static 'vector))) (set! (-> a2-1 quad) (-> self root-override trans quad)) (set! (-> a2-1 y) 0.0) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2017) - a2-1 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 2017) a2-1) ) ) (none) diff --git a/goal_src/levels/village2/village2-part.gc b/goal_src/levels/village2/village2-part.gc index 2eb4111ae2..d05f9afcd2 100644 --- a/goal_src/levels/village2/village2-part.gc +++ b/goal_src/levels/village2/village2-part.gc @@ -1856,14 +1856,7 @@ (sound-play "water-drop") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 1207) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - (the-as float 1.0) - ) + (launch-particles :rate 1.0 (-> *part-id-table* 1207) gp-0) ) ) (none)