diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index cadcbecfa0..40425d7d14 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -51999,10 +51999,10 @@ Consists of a header and a list of [[merc-effect]]s." (vehicle-method-75 (_type_) float) ;; 75 (vehicle-method-76 (_type_ int uint) none) ;; 76 (vehicle-method-77 (_type_) none) ;; 77 - (vehicle-method-78 (_type_ int) none) ;; 78 + (prepare-zone-transition (_type_ int) none) ;; 78 (vehicle-method-79 (_type_) none) ;; 79 - (vehicle-method-80 (_type_) none) ;; 80 - (vehicle-method-81 (_type_) none) ;; 81 + (switch-zone-high! (_type_) none) ;; 80 + (switch-zone-low! (_type_) none) ;; 81 (vehicle-method-82 (_type_) none) ;; 82 (vehicle-method-83 (_type_) none) ;; 83 (draw-thruster (_type_ vector vector float float) none) ;; 84 @@ -52010,10 +52010,10 @@ Consists of a header and a list of [[merc-effect]]s." (update-joint-mods (_type_) none) ;; 86 (vehicle-method-87 (_type_) none) ;; 87 (vehicle-method-88 (_type_) none) ;; 88 - (vehicle-method-89 (_type_) none) ;; 89 - (vehicle-method-90 (_type_) none) ;; 90 - (vehicle-method-91 (_type_) none) ;; 91 - (vehicle-method-92 (_type_) none) ;; 92 + (enable-bike-mode (_type_) none) ;; 89 + (disable-bike-mode (_type_) none) ;; 90 + (enable-rapid-camera-tracking (_type_) none) ;; 91 + (disable-rapid-camera-tracking (_type_) none) ;; 92 (vehicle-method-93 (_type_) none) ;; 93 (vehicle-method-94 (_type_) none) ;; 94 (vehicle-method-95 (_type_ vector) none) ;; 95 diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc index caa08f0b8e..9a72fc8842 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc @@ -1060,7 +1060,7 @@ ) (when (zero? (-> this flight-level-index)) (if (logtest? (-> this flags) (rigid-body-object-flag riding)) - (vehicle-method-80 this) + (switch-zone-high! this) ) ) 0 diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-h.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-h.gc index 2e0aa0ce7a..69c1e2a502 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-h.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-h.gc @@ -374,10 +374,10 @@ (vehicle-method-75 (_type_) float) (vehicle-method-76 (_type_ int uint) none) (vehicle-method-77 (_type_) none) - (vehicle-method-78 (_type_ int) none) + (prepare-zone-transition (_type_ int) none) (vehicle-method-79 (_type_) none) - (vehicle-method-80 (_type_) none) - (vehicle-method-81 (_type_) none) + (switch-zone-high! (_type_) none) + (switch-zone-low! (_type_) none) (vehicle-method-82 (_type_) none) (vehicle-method-83 (_type_) none) (draw-thruster (_type_ vector vector float float) none) @@ -385,10 +385,10 @@ (update-joint-mods (_type_) none) (vehicle-method-87 (_type_) none) (vehicle-method-88 (_type_) none) - (vehicle-method-89 (_type_) none) - (vehicle-method-90 (_type_) none) - (vehicle-method-91 (_type_) none) - (vehicle-method-92 (_type_) none) + (enable-bike-mode (_type_) none) + (disable-bike-mode (_type_) none) + (enable-rapid-camera-tracking (_type_) none) + (disable-rapid-camera-tracking (_type_) none) (vehicle-method-93 (_type_) none) (vehicle-method-94 (_type_) none) (vehicle-method-95 (_type_ vector) none) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc index 4c528ac019..8a74f33d2b 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc @@ -142,6 +142,7 @@ (define *pilot-edge-grab-info* (new 'static 'pilot-edge-grab-info)) (defmethod deactivate ((this vehicle)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (vehicle-method-110 this) (call-parent-method this) (none) @@ -749,13 +750,13 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-78 ((this vehicle) (arg0 int)) +(defmethod prepare-zone-transition ((this vehicle) (arg0 int)) (set! (-> this flight-level-index-prev) (-> this flight-level-index)) (set! (-> this flight-level-index) arg0) (logior! (-> this flags) (rigid-body-object-flag flight-level-transition camera-rapid-track-mode)) (logclear! (-> this flags) (rigid-body-object-flag flight-level-transition-ending)) (set-time! (-> this transition-time)) - (vehicle-method-91 this) + (enable-rapid-camera-tracking this) 0 (none) ) @@ -904,8 +905,8 @@ This commonly includes things such as: (set-setting! 'head-offset 'abs (-> this info camera-head-offset) 0) (set-setting! 'foot-offset 'abs (-> this info camera-foot-offset) 0) (set-setting! 'target-height 'abs (meters 0) 0) - (vehicle-method-92 this) - (vehicle-method-89 this) + (disable-rapid-camera-tracking this) + (enable-bike-mode this) (persist-with-delay *setting-control* 'mode-name (seconds 0.2) 'mode-name 'cam-fixed 0.0 0) (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 0.0 0) (let ((v1-27 (process->ppointer this))) @@ -926,8 +927,8 @@ This commonly includes things such as: (defmethod vehicle-method-88 ((this vehicle)) (when (logtest? (rigid-body-object-flag camera) (-> this flags)) - (vehicle-method-92 this) - (vehicle-method-90 this) + (disable-rapid-camera-tracking this) + (disable-bike-mode this) (remove-setting! 'rapid-tracking) (remove-setting! 'fov) (remove-setting! 'string-camera-ceiling) @@ -959,7 +960,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-89 ((this vehicle)) +(defmethod enable-bike-mode ((this vehicle)) (when (not (logtest? (rigid-body-object-flag camera-bike-mode) (-> this flags))) (logior! (-> this flags) (rigid-body-object-flag camera-bike-mode)) (set-setting! 'bike-mode #f 0.0 0) @@ -968,7 +969,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-90 ((this vehicle)) +(defmethod disable-bike-mode ((this vehicle)) (when (logtest? (rigid-body-object-flag camera-bike-mode) (-> this flags)) (logclear! (-> this flags) (rigid-body-object-flag camera-bike-mode)) (remove-setting! 'bike-mode) @@ -977,7 +978,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-91 ((this vehicle)) +(defmethod enable-rapid-camera-tracking ((this vehicle)) (when (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (logior! (-> this flags) (rigid-body-object-flag camera-rapid-track-mode)) (set-setting! 'rapid-tracking #f 0.0 0) @@ -986,7 +987,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-92 ((this vehicle)) +(defmethod disable-rapid-camera-tracking ((this vehicle)) (when (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (logclear! (-> this flags) (rigid-body-object-flag camera-rapid-track-mode)) (remove-setting! 'rapid-tracking) @@ -1071,13 +1072,13 @@ This commonly includes things such as: 0 ) -(defmethod vehicle-method-80 ((this vehicle)) +(defmethod switch-zone-high! ((this vehicle)) (when (and (logtest? (-> this info flags) 64) (< (-> this flight-level-index) 1)) 1 (cond ((< (+ 8192.0 (-> this rbody state position y)) (-> this flight-level)) (sound-play "bike-up") - (vehicle-method-78 this 1) + (prepare-zone-transition this 1) ) (else (set! (-> this flight-level-index) 1) @@ -1088,10 +1089,10 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-81 ((this vehicle)) +(defmethod switch-zone-low! ((this vehicle)) (when (and (logtest? (-> this info flags) 64) (> (-> this flight-level-index) 0)) (sound-play "bike-down") - (vehicle-method-78 this 0) + (prepare-zone-transition this 0) ) 0 (none) @@ -1099,7 +1100,7 @@ This commonly includes things such as: (defmethod vehicle-method-83 ((this vehicle)) (logclear! (-> this flags) (rigid-body-object-flag flight-level-transition)) - (vehicle-method-92 this) + (disable-rapid-camera-tracking this) (set! (-> this flight-level-index) 0) 0 (none) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc index a96a6416b3..8fecf8a792 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc @@ -236,7 +236,7 @@ ) (when (zero? (-> this flight-level-index)) (if (logtest? (-> this flags) (rigid-body-object-flag riding)) - (vehicle-method-80 this) + (switch-zone-high! this) ) ) (vector-! (-> s5-0 vector 1) (-> this target-acceleration) (-> this lin-acceleration)) @@ -371,8 +371,8 @@ ) (when (and (cpad-pressed? 0 r2) (not *pause-lock*)) (if (zero? (-> this flight-level-index)) - (vehicle-method-80 this) - (vehicle-method-81 this) + (switch-zone-high! this) + (switch-zone-low! this) ) ) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -548,7 +548,7 @@ (time-elapsed? (-> this transition-end-time) (seconds 1)) ) (logclear! (-> this flags) (rigid-body-object-flag flight-level-transition-ending)) - (vehicle-method-92 this) + (disable-rapid-camera-tracking this) ) 0 (none) @@ -597,13 +597,13 @@ (let ((f0-5 (vector-dot (-> this rbody state lin-velocity) (-> this rbody state matrix vector 2)))) (cond ((= (-> this crash-level) 2) - (vehicle-method-90 this) + (disable-bike-mode this) ) ((< f0-5 (-> this info camera-max-lookaround-speed)) - (vehicle-method-90 this) + (disable-bike-mode this) ) ((< (+ 4096.0 (-> this info camera-max-lookaround-speed)) f0-5) - (vehicle-method-89 this) + (enable-bike-mode this) ) ) ) @@ -651,7 +651,7 @@ (f1-13 122880.0) ) (if (< f0-20 (* f1-13 f1-13)) - (vehicle-method-92 this) + (disable-rapid-camera-tracking this) ) ) ) @@ -667,7 +667,7 @@ (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-98 vf1) (if (< f0-23 v1-98) - (vehicle-method-91 this) + (enable-rapid-camera-tracking this) ) ) ) @@ -706,6 +706,7 @@ (let ((s5-0 (-> this draw shadow-ctrl))) (when (!= *vehicle-shadow-control-disabled* s5-0) (let ((f30-0 (vector-vector-xz-distance (camera-pos) (-> this root trans)))) + ;; og:preserve-this Shadow fix of some sort (#when PC_PORT (if (not (-> *pc-settings* ps2-shadow?)) (set! f30-0 0.0))) diff --git a/goal_src/jak2/pc/progress/progress-static-pc.gc b/goal_src/jak2/pc/progress/progress-static-pc.gc index 388f7ef6f0..a9e0182e1b 100644 --- a/goal_src/jak2/pc/progress/progress-static-pc.gc +++ b/goal_src/jak2/pc/progress/progress-static-pc.gc @@ -501,6 +501,7 @@ This gives us more freedom to write code how we want. (pc-settings-save))) (new 'static 'menu-generic-carousel-option :name (text-id progress-frame-rate) + :should-disable? (lambda () (-> *pc-settings* speedrunner-mode?)) :get-item-index-fn (lambda () ;; TODO - use an array (case (-> *pc-settings* target-fps) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-guard_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-guard_REF.gc index c203c6dc6b..40972bd02c 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-guard_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-guard_REF.gc @@ -1229,7 +1229,7 @@ ) (when (zero? (-> this flight-level-index)) (if (logtest? (-> this flags) (rigid-body-object-flag riding)) - (vehicle-method-80 this) + (switch-zone-high! this) ) ) 0 diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-h_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-h_REF.gc index c0391ea309..20d2a6d3b6 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-h_REF.gc @@ -633,10 +633,10 @@ (vehicle-method-75 (_type_) float) (vehicle-method-76 (_type_ int uint) none) (vehicle-method-77 (_type_) none) - (vehicle-method-78 (_type_ int) none) + (prepare-zone-transition (_type_ int) none) (vehicle-method-79 (_type_) none) - (vehicle-method-80 (_type_) none) - (vehicle-method-81 (_type_) none) + (switch-zone-high! (_type_) none) + (switch-zone-low! (_type_) none) (vehicle-method-82 (_type_) none) (vehicle-method-83 (_type_) none) (draw-thruster (_type_ vector vector float float) none) @@ -644,10 +644,10 @@ (update-joint-mods (_type_) none) (vehicle-method-87 (_type_) none) (vehicle-method-88 (_type_) none) - (vehicle-method-89 (_type_) none) - (vehicle-method-90 (_type_) none) - (vehicle-method-91 (_type_) none) - (vehicle-method-92 (_type_) none) + (enable-bike-mode (_type_) none) + (disable-bike-mode (_type_) none) + (enable-rapid-camera-tracking (_type_) none) + (disable-rapid-camera-tracking (_type_) none) (vehicle-method-93 (_type_) none) (vehicle-method-94 (_type_) none) (vehicle-method-95 (_type_ vector) none) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-util_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-util_REF.gc index 3a395cdfc3..333c3b7761 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-util_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-util_REF.gc @@ -839,13 +839,13 @@ This commonly includes things such as: ;; definition for method 78 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-78 ((this vehicle) (arg0 int)) +(defmethod prepare-zone-transition ((this vehicle) (arg0 int)) (set! (-> this flight-level-index-prev) (-> this flight-level-index)) (set! (-> this flight-level-index) arg0) (logior! (-> this flags) (rigid-body-object-flag flight-level-transition camera-rapid-track-mode)) (logclear! (-> this flags) (rigid-body-object-flag flight-level-transition-ending)) (set-time! (-> this transition-time)) - (vehicle-method-91 this) + (enable-rapid-camera-tracking this) 0 (none) ) @@ -1013,8 +1013,8 @@ This commonly includes things such as: (set-setting! 'head-offset 'abs (-> this info camera-head-offset) 0) (set-setting! 'foot-offset 'abs (-> this info camera-foot-offset) 0) (set-setting! 'target-height 'abs (meters 0) 0) - (vehicle-method-92 this) - (vehicle-method-89 this) + (disable-rapid-camera-tracking this) + (enable-bike-mode this) (persist-with-delay *setting-control* 'mode-name (seconds 0.2) 'mode-name 'cam-fixed 0.0 0) (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 0.0 0) (let ((v1-27 (process->ppointer this))) @@ -1037,8 +1037,8 @@ This commonly includes things such as: ;; WARN: Return type mismatch int vs none. (defmethod vehicle-method-88 ((this vehicle)) (when (logtest? (rigid-body-object-flag camera) (-> this flags)) - (vehicle-method-92 this) - (vehicle-method-90 this) + (disable-rapid-camera-tracking this) + (disable-bike-mode this) (remove-setting! 'rapid-tracking) (remove-setting! 'fov) (remove-setting! 'string-camera-ceiling) @@ -1072,7 +1072,7 @@ This commonly includes things such as: ;; definition for method 89 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-89 ((this vehicle)) +(defmethod enable-bike-mode ((this vehicle)) (when (not (logtest? (rigid-body-object-flag camera-bike-mode) (-> this flags))) (logior! (-> this flags) (rigid-body-object-flag camera-bike-mode)) (set-setting! 'bike-mode #f 0.0 0) @@ -1083,7 +1083,7 @@ This commonly includes things such as: ;; definition for method 90 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-90 ((this vehicle)) +(defmethod disable-bike-mode ((this vehicle)) (when (logtest? (rigid-body-object-flag camera-bike-mode) (-> this flags)) (logclear! (-> this flags) (rigid-body-object-flag camera-bike-mode)) (remove-setting! 'bike-mode) @@ -1094,7 +1094,7 @@ This commonly includes things such as: ;; definition for method 91 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-91 ((this vehicle)) +(defmethod enable-rapid-camera-tracking ((this vehicle)) (when (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (logior! (-> this flags) (rigid-body-object-flag camera-rapid-track-mode)) (set-setting! 'rapid-tracking #f 0.0 0) @@ -1105,7 +1105,7 @@ This commonly includes things such as: ;; definition for method 92 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-92 ((this vehicle)) +(defmethod disable-rapid-camera-tracking ((this vehicle)) (when (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (logclear! (-> this flags) (rigid-body-object-flag camera-rapid-track-mode)) (remove-setting! 'rapid-tracking) @@ -1207,13 +1207,13 @@ This commonly includes things such as: ;; definition for method 80 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-80 ((this vehicle)) +(defmethod switch-zone-high! ((this vehicle)) (when (and (logtest? (-> this info flags) 64) (< (-> this flight-level-index) 1)) 1 (cond ((< (+ 8192.0 (-> this rbody state position y)) (-> this flight-level)) (sound-play "bike-up") - (vehicle-method-78 this 1) + (prepare-zone-transition this 1) ) (else (set! (-> this flight-level-index) 1) @@ -1226,10 +1226,10 @@ This commonly includes things such as: ;; definition for method 81 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-81 ((this vehicle)) +(defmethod switch-zone-low! ((this vehicle)) (when (and (logtest? (-> this info flags) 64) (> (-> this flight-level-index) 0)) (sound-play "bike-down") - (vehicle-method-78 this 0) + (prepare-zone-transition this 0) ) 0 (none) @@ -1239,7 +1239,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch int vs none. (defmethod vehicle-method-83 ((this vehicle)) (logclear! (-> this flags) (rigid-body-object-flag flight-level-transition)) - (vehicle-method-92 this) + (disable-rapid-camera-tracking this) (set! (-> this flight-level-index) 0) 0 (none) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle_REF.gc index 68ce3affc1..092b0e0739 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle_REF.gc @@ -255,7 +255,7 @@ ) (when (zero? (-> this flight-level-index)) (if (logtest? (-> this flags) (rigid-body-object-flag riding)) - (vehicle-method-80 this) + (switch-zone-high! this) ) ) (vector-! (-> s5-0 vector 1) (-> this target-acceleration) (-> this lin-acceleration)) @@ -394,8 +394,8 @@ ) (when (and (cpad-pressed? 0 r2) (not *pause-lock*)) (if (zero? (-> this flight-level-index)) - (vehicle-method-80 this) - (vehicle-method-81 this) + (switch-zone-high! this) + (switch-zone-low! this) ) ) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -573,7 +573,7 @@ (time-elapsed? (-> this transition-end-time) (seconds 1)) ) (logclear! (-> this flags) (rigid-body-object-flag flight-level-transition-ending)) - (vehicle-method-92 this) + (disable-rapid-camera-tracking this) ) 0 (none) @@ -625,13 +625,13 @@ (let ((f0-5 (vector-dot (-> this rbody state lin-velocity) (-> this rbody state matrix vector 2)))) (cond ((= (-> this crash-level) 2) - (vehicle-method-90 this) + (disable-bike-mode this) ) ((< f0-5 (-> this info camera-max-lookaround-speed)) - (vehicle-method-90 this) + (disable-bike-mode this) ) ((< (+ 4096.0 (-> this info camera-max-lookaround-speed)) f0-5) - (vehicle-method-89 this) + (enable-bike-mode this) ) ) ) @@ -679,7 +679,7 @@ (f1-13 122880.0) ) (if (< f0-20 (* f1-13 f1-13)) - (vehicle-method-92 this) + (disable-rapid-camera-tracking this) ) ) ) @@ -695,7 +695,7 @@ (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-98 vf1) (if (< f0-23 v1-98) - (vehicle-method-91 this) + (enable-rapid-camera-tracking this) ) ) )