diff --git a/decompiler/config/all-types.gc b/decompiler/config/all-types.gc index faae573bef..3ca3b8ed62 100644 --- a/decompiler/config/all-types.gc +++ b/decompiler/config/all-types.gc @@ -3109,13 +3109,8 @@ :flag-assert #x900000080 ) -;;(define-extern display-env object) ;; unknown type -;;(define-extern display-frame object) ;; unknown type -;;(define-extern display object) ;; unknown type ;;(define-extern *post-draw-hook* object) ;; unknown type -;;(define-extern virtual-frame object) ;; unknown type (define-extern put-draw-env (function dma-packet none)) -;;(define-extern draw-env object) ;; unknown type ;;(define-extern *pre-draw-hook* object) ;; unknown type @@ -3151,7 +3146,6 @@ :flag-assert #x900000014 ) -;; display-h (deftype display (basic) ((display-env0 display-env :inline :offset-assert 8) (display-env1 display-env :inline :offset-assert 48) @@ -8398,15 +8392,15 @@ :size-assert #x8 :flag-assert #x1200000008 (:methods - (dummy-9 () none 9) - (dummy-10 () none 10) - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-16 () none 16) - (dummy-17 () none 17) + (dummy-9 (_type_ float) float 9) + (dummy-10 (_type_) float 10) + (dummy-11 (_type_) float 11) + (dummy-12 (_type_ float) float 12) + (dummy-13 (_type_) float 13) + (dummy-14 (_type_ uint float float float) int 14) ;; 3 arg for parent 5 for child + (dummy-15 (_type_) float 15) ;; wip + (dummy-16 (_type_ float) float 16) + (dummy-17 (_type_) float 17) ) ) @@ -8422,15 +8416,15 @@ :size-assert #x1c :flag-assert #x120000001c (:methods - (dummy-9 () none 9) - (dummy-10 () none 10) - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-16 () none 16) - (dummy-17 () none 17) + ;; (dummy-9 () none 9) + ;; (dummy-10 () none 10) + ;; (dummy-11 () none 11) + (dummy-12 (_type_ float) float 12) + (dummy-13 (_type_) float 13) + (dummy-14 (_type_ uint float float float) int 14) + (dummy-15 (_type_) float 15) ;; wip + ;; (dummy-16 () none 16) + ;; (dummy-17 () none 17) ) ) @@ -8443,15 +8437,15 @@ :size-assert #x10 :flag-assert #x1200000010 (:methods - (dummy-9 () none 9) - (dummy-10 () none 10) - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-16 () none 16) - (dummy-17 () none 17) + (dummy-9 (_type_ float) float 9) + ;; (dummy-10 () none 10) + (dummy-11 (_type_) float 11) + (dummy-12 (_type_ float) float 12) + (dummy-13 (_type_) float 13) + (dummy-14 (_type_ uint float float float) int 14) + (dummy-15 (_type_) float 15) ;; wip + ;; (dummy-16 () none 16) + ;; (dummy-17 () none 17) ) ) @@ -8468,8 +8462,8 @@ :size-assert #x1c :flag-assert #xb0000001c (:methods - (dummy-9 () none 9) - (dummy-10 () none 10) + (dummy-9 (_type_ int int float) float 9) + (dummy-10 (_type_ ) float 10) ) ) @@ -8486,8 +8480,8 @@ :size-assert #x18 :flag-assert #xb00000018 (:methods - (dummy-9 () none 9) - (dummy-10 () none 10) + (dummy-9 (_type_ float float float float) float 9) + (dummy-10 (_type_ float) float 10) ) ) @@ -8503,10 +8497,10 @@ :size-assert #x28 :flag-assert #xd00000028 (:methods - (dummy-9 () none 9) - (dummy-10 () none 10) - (dummy-11 () none 11) - (dummy-12 () none 12) + (dummy-9 (_type_ float float float float float float float) float 9) + (dummy-10 (_type_ float) float 10) + (dummy-11 (_type_) symbol 11) ;; bool + (dummy-12 (_type_) symbol 12) ;; bool ) ) @@ -8524,10 +8518,10 @@ :size-assert #x30 :flag-assert #xd00000030 (:methods - (dummy-9 () none 9) - (dummy-10 () none 10) - (dummy-11 () none 11) - (dummy-12 () none 12) + (dummy-9 (_type_ int int float float) vector 9) + (dummy-10 (_type_) vector 10) + (dummy-11 (_type_) vector 11) + (dummy-12 (_type_) vector 12) ) ) @@ -8544,8 +8538,8 @@ :size-assert #x3c :flag-assert #xb0000003c (:methods - (dummy-9 () none 9) - (dummy-10 () none 10) + (dummy-9 (_type_ vector float float float) vector 9) + (dummy-10 (_type_ vector) vector 10) ) ) @@ -32672,8 +32666,6 @@ ;;(define-extern cpad-open object) ;; unknown type -;;(define-extern *display* object) ;; unknown type - ;;(define-extern load-dir object) ;; unknown type ;;(define-extern external-art-buffer object) ;; unknown type ;;(define-extern load-dir-art-group object) ;; unknown type @@ -33245,7 +33237,6 @@ ;;(define-extern *debug-engine* object) ;; unknown type ;;(define-extern res-tag object) ;; unknown type ;;(define-extern *res-key-string* object) ;; unknown type -(define-extern res-lump type) ;;(define-extern *res-static-buf* object) ;; unknown type (define-extern part-group-pointer? function) (define-extern nav-mesh type) @@ -33324,14 +33315,6 @@ ;;(define-extern touch-tracker object) ;; unknown type ;;(define-extern part-tracker object) ;; unknown type ;;(define-extern pov-camera object) ;; unknown type -;;(define-extern delayed-rand-float object) ;; unknown type -;;(define-extern sync-info-paused object) ;; unknown type -;;(define-extern bouncing-float object) ;; unknown type -;;(define-extern delayed-rand-vector object) ;; unknown type -;;(define-extern sync-info object) ;; unknown type -;;(define-extern oscillating-vector object) ;; unknown type -;;(define-extern sync-info-eased object) ;; unknown type -;;(define-extern oscillating-float object) ;; unknown type ;;(define-extern smush-control object) ;; unknown type ;;(define-extern trajectory object) ;; unknown type ;;(define-extern joint-mod-wheel object) ;; unknown type diff --git a/decompiler/config/jak1_ntsc_black_label.jsonc b/decompiler/config/jak1_ntsc_black_label.jsonc index 31fe2a61b4..199fbd0319 100644 --- a/decompiler/config/jak1_ntsc_black_label.jsonc +++ b/decompiler/config/jak1_ntsc_black_label.jsonc @@ -502,7 +502,13 @@ "(anon-function 43 maincave-obs)", "(anon-function 2 target-tube)", "(anon-function 5 orbit-plat)", - "(anon-function 2 ogreboss)" + "(anon-function 2 ogreboss)", + + // not enough type info to decompile these + // (these are NOT actually asm functions) + "(method 15 sync-info)", // NEED *res-static-buf* + "(method 15 sync-info-eased)", // NEED *res-static-buf* + "(method 15 sync-info-paused)" // NEED *res-static-buf* ], "pair_functions_by_name":["ref", "last", "member", "nmember", "assoc", "assoce", "append!", "delete!", "delete-car!", diff --git a/decompiler/config/jak1_ntsc_black_label/label_types.jsonc b/decompiler/config/jak1_ntsc_black_label/label_types.jsonc index 8bfca90d05..3400ef93b6 100644 --- a/decompiler/config/jak1_ntsc_black_label/label_types.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/label_types.jsonc @@ -334,6 +334,18 @@ "fact-h": [["L35", "_auto_", true]], + "sync-info": [ + ["L78", "float", true], + ["L79", "float", true], + ["L80", "float", true], + ["L81", "float", true], + ["L82", "float", true], + ["L83", "float", true], + ["L84", "float", true], + ["L85", "float", true], + ["L86", "float", true] + ], + "smush-control-h": [ ["L20", "float", true], ["L18", "float", true], diff --git a/decompiler/config/jak1_ntsc_black_label/stack_vars.jsonc b/decompiler/config/jak1_ntsc_black_label/stack_vars.jsonc index 6d241f5288..af86591691 100644 --- a/decompiler/config/jak1_ntsc_black_label/stack_vars.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/stack_vars.jsonc @@ -132,5 +132,7 @@ "vector-deg-seek": [[16, "matrix"]], "vector-deg-slerp": [[16, "matrix"], [80, "vector"], [96, "vector"]], - "circle-test": [[16, "sphere"], [32, "sphere"], [48, "vector"], [64, "vector"]] -} + "circle-test": [[16, "sphere"], [32, "sphere"], [48, "vector"], [64, "vector"]], + + "(method 10 oscillating-vector)":[[16, "vector"]] +} diff --git a/goal_src/engine/physics/dynamics-h.gc b/goal_src/engine/physics/dynamics-h.gc index 1d33dc7cac..7b654a739a 100644 --- a/goal_src/engine/physics/dynamics-h.gc +++ b/goal_src/engine/physics/dynamics-h.gc @@ -52,7 +52,7 @@ :gravity-length GRAVITY_AMOUNT :gravity (new 'static 'vector :x 0.0 :y GRAVITY_AMOUNT :z 0.0 :w 1.0) :gravity-normal (new 'static 'vector :x 0.0 :y 1.0 :z 0.0 :w 1.0) - :walk-distance 8192.0 - :run-distance 20480.0 + :walk-distance (meters 2) + :run-distance (meters 5) ) ) diff --git a/goal_src/engine/physics/gravity-h.gc b/goal_src/engine/physics/gravity-h.gc index 2be8de1c92..65c7694558 100644 --- a/goal_src/engine/physics/gravity-h.gc +++ b/goal_src/engine/physics/gravity-h.gc @@ -6,5 +6,5 @@ ;; dgos: GAME, ENGINE ;; This file generates no code. -(defconstant GRAVITY_AMOUNT 245760.0) ;; (meters 60) -(defconstant GRAVITY_MAX 163840.0) ;; (meters 40) +(defconstant GRAVITY_AMOUNT (meters 60)) ;; gravity force +(defconstant GRAVITY_MAX (meters 40)) ;; regular terminal velocity diff --git a/goal_src/engine/util/sync-info-h.gc b/goal_src/engine/util/sync-info-h.gc index 608649837e..f408af34f9 100644 --- a/goal_src/engine/util/sync-info-h.gc +++ b/goal_src/engine/util/sync-info-h.gc @@ -13,15 +13,15 @@ :size-assert #x8 :flag-assert #x1200000008 (:methods - (dummy-9 () none 9) - (dummy-10 () none 10) - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-16 () none 16) - (dummy-17 () none 17) + (dummy-9 (_type_ float) float 9) + (dummy-10 (_type_) float 10) + (dummy-11 (_type_) float 11) + (dummy-12 (_type_ float) float 12) + (dummy-13 (_type_) float 13) + (dummy-14 (_type_ uint float float float) int 14) + (dummy-15 (_type_) float 15) ;; wip + (dummy-16 (_type_ float) float 16) + (dummy-17 (_type_) float 17) ) ) @@ -36,15 +36,15 @@ :size-assert #x1c :flag-assert #x120000001c (:methods - (dummy-9 () none 9) - (dummy-10 () none 10) - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-16 () none 16) - (dummy-17 () none 17) + ;; (dummy-9 () none 9) + ;; (dummy-10 () none 10) + ;; (dummy-11 () none 11) + (dummy-12 (_type_ float) float 12) + (dummy-13 (_type_) float 13) + (dummy-14 (_type_ uint float float float) int 14) + (dummy-15 (_type_) float 15) ;; wip + ;; (dummy-16 () none 16) + ;; (dummy-17 () none 17) ) ) @@ -56,15 +56,15 @@ :size-assert #x10 :flag-assert #x1200000010 (:methods - (dummy-9 () none 9) - (dummy-10 () none 10) - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-16 () none 16) - (dummy-17 () none 17) + (dummy-9 (_type_ float) float 9) + ;; (dummy-10 () none 10) + (dummy-11 (_type_) float 11) + (dummy-12 (_type_ float) float 12) + (dummy-13 (_type_) float 13) + (dummy-14 (_type_ uint float float float) int 14) + (dummy-15 (_type_) float 15) ;; wip + ;; (dummy-16 () none 16) + ;; (dummy-17 () none 17) ) ) @@ -80,8 +80,8 @@ :size-assert #x1c :flag-assert #xb0000001c (:methods - (dummy-9 () none 9) - (dummy-10 () none 10) + (dummy-9 (_type_ int int float) float 9) + (dummy-10 (_type_ ) float 10) ) ) @@ -97,8 +97,8 @@ :size-assert #x18 :flag-assert #xb00000018 (:methods - (dummy-9 () none 9) - (dummy-10 () none 10) + (dummy-9 (_type_ float float float float) float 9) + (dummy-10 (_type_ float) float 10) ) ) @@ -113,10 +113,10 @@ :size-assert #x28 :flag-assert #xd00000028 (:methods - (dummy-9 () none 9) - (dummy-10 () none 10) - (dummy-11 () none 11) - (dummy-12 () none 12) + (dummy-9 (_type_ float float float float float float float) float 9) + (dummy-10 (_type_ float) float 10) + (dummy-11 (_type_) symbol 11) ;; bool + (dummy-12 (_type_) symbol 12) ;; bool ) ) @@ -133,10 +133,10 @@ :size-assert #x30 :flag-assert #xd00000030 (:methods - (dummy-9 () none 9) - (dummy-10 () none 10) - (dummy-11 () none 11) - (dummy-12 () none 12) + (dummy-9 (_type_ int int float float) vector 9) + (dummy-10 (_type_) vector 10) + (dummy-11 (_type_) vector 11) + (dummy-12 (_type_) vector 12) ) ) @@ -152,7 +152,7 @@ :size-assert #x3c :flag-assert #xb0000003c (:methods - (dummy-9 () none 9) - (dummy-10 () none 10) + (dummy-9 (_type_ vector float float float) vector 9) + (dummy-10 (_type_ vector) vector 10) ) ) diff --git a/goal_src/engine/util/sync-info.gc b/goal_src/engine/util/sync-info.gc index 0a95ee4e77..d608e177ce 100644 --- a/goal_src/engine/util/sync-info.gc +++ b/goal_src/engine/util/sync-info.gc @@ -5,3 +5,723 @@ ;; name in dgo: sync-info ;; dgos: GAME, ENGINE + +;; definition for method 14 of type sync-info +(defmethod + dummy-14 + sync-info + ((obj sync-info) (arg0 uint) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> obj period) arg0) + (let* ((f0-1 (the float arg0)) + (f1-1 (* arg1 f0-1)) + (f0-3 (- f1-1 (* (the float (the int (/ f1-1 f0-1))) f0-1))) + ) + (set! (-> obj offset) f0-3) + ) + 0 + ) + +;; definition for method 14 of type sync-info-eased +(defmethod + dummy-14 + sync-info-eased + ((obj sync-info-eased) (arg0 uint) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> obj period) arg0) + (let* ((f0-1 (the float arg0)) + (f1-1 (* arg1 f0-1)) + (f0-3 (- f1-1 (* (the float (the int (/ f1-1 f0-1))) f0-1))) + ) + (set! (-> obj offset) f0-3) + ) + (if (< arg2 0.0) + (set! arg2 0.0) + ) + (if (< 1.0 arg2) + (set! arg2 1.0) + ) + (if (< arg3 0.001) + (set! arg3 0.001) + ) + (if (< 1.0 arg3) + (set! arg3 1.0) + ) + (let ((f0-9 (+ arg2 arg3))) + (when (< 1.0 f0-9) + (set! f0-9 1.0) + (set! arg2 (- 1.0 arg3)) + ) + (let* ((f1-11 (- 1.0 f0-9)) + (f0-10 arg2) + (f1-12 (+ arg2 f1-11)) + (f2-5 (* f0-10 f0-10)) + (f3-3 (+ (* (* 2.0 f0-10) (- f1-12 f0-10)) f2-5)) + (f4-3 (/ f0-10 (- 1.0 f1-12))) + (f3-4 (+ (* (* (- 1.0 f1-12) (- 1.0 f1-12)) f4-3) f3-3)) + ) + (set! (-> obj tlo) f0-10) + (set! (-> obj thi) f1-12) + (set! (-> obj ylo) f2-5) + (set! (-> obj m2) f4-3) + (set! (-> obj yend) f3-4) + ) + ) + 0 + ) + +;; definition for method 14 of type sync-info-paused +(defmethod + dummy-14 + sync-info-paused + ((obj sync-info-paused) (arg0 uint) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> obj period) arg0) + (let* ((f0-1 (the float arg0)) + (f1-1 (* arg1 f0-1)) + (f0-3 (- f1-1 (* (the float (the int (/ f1-1 f0-1))) f0-1))) + ) + (set! (-> obj offset) f0-3) + ) + (cond + ((< arg2 0.0) + (set! arg2 0.0) + ) + ((< 1.0 arg2) + (set! arg2 1.0) + ) + ) + (cond + ((< arg3 0.0) + (set! arg3 0.0) + ) + ((< (- 1.0 arg2) arg3) + (set! arg3 (- 1.0 arg2)) + ) + ) + (set! (-> obj pause-after-in) arg3) + (set! (-> obj pause-after-out) arg2) + 0 + ) + +;; definition for method 15 of type sync-info +;; WARN: Type Propagation failed: Could not get type of load: (set! a0 (l.wu (+ a1 48))). +;; WARN: Type Propagation failed: Type analysis failed +;; WARN: Unsupported inline assembly instruction kind - [sq r0, 16(sp)] +;; Used lq/sq + +;; definition for method 15 of type sync-info-eased +;; WARN: Type Propagation failed: Could not get type of load: (set! a0 (l.wu (+ a1 48))). +;; WARN: Type Propagation failed: Type analysis failed +;; WARN: Unsupported inline assembly instruction kind - [sq r0, 16(sp)] +;; Used lq/sq + +;; definition for method 15 of type sync-info-paused +;; WARN: Type Propagation failed: Could not get type of load: (set! a0 (l.wu (+ a1 48))). +;; WARN: Type Propagation failed: Type analysis failed +;; WARN: Unsupported inline assembly instruction kind - [sq r0, 16(sp)] +;; Used lq/sq + +;; definition for method 10 of type sync-info +(defmethod dummy-10 sync-info ((obj sync-info)) + (let* ((v1-0 (-> obj period)) + (f0-1 (the float v1-0)) + (f1-2 + (+ + (the float (mod (-> *display* base-frame-counter) v1-0)) + (-> obj offset) + ) + ) + ) + (/ (- f1-2 (* (the float (the int (/ f1-2 f0-1))) f0-1)) f0-1) + ) + ) + +;; definition for method 17 of type sync-info +(defmethod dummy-17 sync-info ((obj sync-info)) + (/ (-> obj offset) (the float (-> obj period))) + ) + +;; definition for method 16 of type sync-info +(defmethod dummy-16 sync-info ((obj sync-info) (arg0 float)) + (let* ((a2-0 (-> obj period)) + (f0-1 (the float a2-0)) + (v1-0 (- arg0 (* (the float (the int (/ arg0 f0-1))) f0-1))) + (f1-4 + (+ + (the float (mod (-> *display* base-frame-counter) a2-0)) + (-> obj offset) + ) + ) + (f1-6 (/ (- f1-4 (* (the float (the int (/ f1-4 f0-1))) f0-1)) f0-1)) + (f1-10 (+ (+ (* (- v1-0 f1-6) f0-1) f0-1) (-> obj offset))) + (f0-3 (- f1-10 (* (the float (the int (/ f1-10 f0-1))) f0-1))) + ) + (set! (-> obj offset) f0-3) + f0-3 + ) + ) + +;; definition for method 11 of type sync-info +(defmethod dummy-11 sync-info ((obj sync-info)) + (let* ((v1-0 (-> obj period)) + (f0-1 (the float v1-0)) + (f1-2 + (+ + (the float (mod (-> *display* base-frame-counter) v1-0)) + (-> obj offset) + ) + ) + ) + (/ (- f1-2 (* (the float (the int (/ f1-2 f0-1))) f0-1)) f0-1) + ) + ) + +;; definition for method 11 of type sync-info-paused +(defmethod dummy-11 sync-info-paused ((obj sync-info-paused)) + (let* ((v1-0 (-> obj period)) + (f1-0 (the float v1-0)) + (f0-1 1.0) + (f2-2 + (+ + (the float (mod (-> *display* base-frame-counter) v1-0)) + (-> obj offset) + ) + ) + ) + (fmin + f0-1 + (/ + (- f2-2 (* (the float (the int (/ f2-2 f1-0))) f1-0)) + (* f1-0 (- 1.0 (-> obj pause-after-out))) + ) + ) + ) + ) + +;; definition for method 9 of type sync-info +(defmethod dummy-9 sync-info ((obj sync-info) (arg0 float)) + (let* ((v1-0 (-> obj period)) + (f0-1 (the float v1-0)) + (f1-2 + (+ + (the float (mod (-> *display* base-frame-counter) v1-0)) + (-> obj offset) + ) + ) + ) + (* (/ (- f1-2 (* (the float (the int (/ f1-2 f0-1))) f0-1)) f0-1) arg0) + ) + ) + +;; definition for method 9 of type sync-info-paused +(defmethod dummy-9 sync-info-paused ((obj sync-info-paused) (arg0 float)) + (* ((method-of-type sync-info-paused dummy-11) obj) arg0) + ) + +;; definition for method 13 of type sync-info +(defmethod dummy-13 sync-info ((obj sync-info)) + (let* ((v1-0 (-> obj period)) + (f1-0 (the float v1-0)) + (f0-1 2.0) + (f2-2 + (+ + (the float (mod (-> *display* base-frame-counter) v1-0)) + (-> obj offset) + ) + ) + (f0-2 + (* + f0-1 + (/ (- f2-2 (* (the float (the int (/ f2-2 f1-0))) f1-0)) f1-0) + ) + ) + ) + (if (>= f0-2 1.0) + (set! f0-2 (- 2.0 f0-2)) + ) + f0-2 + ) + ) + +;; definition for method 13 of type sync-info-eased +(defmethod dummy-13 sync-info-eased ((obj sync-info-eased)) + (let* ((v1-0 (-> obj period)) + (f1-0 (the float v1-0)) + (f0-1 2.0) + (f2-2 + (+ + (the float (mod (-> *display* base-frame-counter) v1-0)) + (-> obj offset) + ) + ) + (f0-2 + (* + f0-1 + (/ (- f2-2 (* (the float (the int (/ f2-2 f1-0))) f1-0)) f1-0) + ) + ) + (v1-2 #f) + ) + (when (>= f0-2 1.0) + (set! v1-2 #t) + (set! f0-2 (+ -1.0 f0-2)) + ) + (let* ((f1-4 (-> obj tlo)) + (f0-7 (/ (cond + ((< f0-2 f1-4) + (* f0-2 f0-2) + ) + ((< f0-2 (-> obj thi)) + (+ (* (* 2.0 f1-4) (- f0-2 f1-4)) (-> obj ylo)) + ) + (else + (let ((f1-7 (- 1.0 f0-2))) + (- (-> obj yend) (* (* f1-7 f1-7) (-> obj m2))) + ) + ) + ) + (-> obj yend) + ) + ) + ) + (if v1-2 + (set! f0-7 (- 1.0 f0-7)) + ) + f0-7 + ) + ) + ) + +;; definition for method 13 of type sync-info-paused +(defmethod dummy-13 sync-info-paused ((obj sync-info-paused)) + (let* ((v1-0 (-> obj period)) + (f1-0 (the float v1-0)) + (f0-1 2.0) + (f2-2 + (+ + (the float (mod (-> *display* base-frame-counter) v1-0)) + (-> obj offset) + ) + ) + (f0-2 + (* + f0-1 + (/ (- f2-2 (* (the float (the int (/ f2-2 f1-0))) f1-0)) f1-0) + ) + ) + (f1-3 (- 1.0 (* 2.0 (-> obj pause-after-in)))) + (f2-7 (- 1.0 (* 2.0 (-> obj pause-after-out)))) + ) + (cond + ((>= f0-2 (+ 1.0 f1-3)) + 0.0 + ) + ((< 1.0 f0-2) + (- 1.0 (/ (+ -1.0 f0-2) f1-3)) + ) + ((>= f0-2 f2-7) + 1.0 + ) + (else + (/ f0-2 f2-7) + ) + ) + ) + ) + +;; definition for method 12 of type sync-info +(defmethod dummy-12 sync-info ((obj sync-info) (arg0 float)) + (let* ((v1-0 (-> obj period)) + (f1-0 (the float v1-0)) + (f0-1 2.0) + (f2-2 + (+ + (the float (mod (-> *display* base-frame-counter) v1-0)) + (-> obj offset) + ) + ) + (f0-2 + (* + f0-1 + (/ (- f2-2 (* (the float (the int (/ f2-2 f1-0))) f1-0)) f1-0) + ) + ) + ) + (if (>= f0-2 1.0) + (set! f0-2 (- 2.0 f0-2)) + ) + (* f0-2 arg0) + ) + ) + +;; definition for method 12 of type sync-info-eased +(defmethod dummy-12 sync-info-eased ((obj sync-info-eased) (arg0 float)) + (* ((method-of-type sync-info-eased dummy-13) obj) arg0) + ) + +;; definition for method 12 of type sync-info-paused +(defmethod dummy-12 sync-info-paused ((obj sync-info-paused) (arg0 float)) + (* ((method-of-type sync-info-paused dummy-13) obj) arg0) + ) + +;; definition for method 9 of type delayed-rand-float +(defmethod + dummy-9 + delayed-rand-float + ((obj delayed-rand-float) (arg0 int) (arg1 int) (arg2 float)) + (set! (-> obj min-time) arg0) + (set! (-> obj max-time) arg1) + (set! (-> obj max-val) (* 0.5 arg2)) + (set! (-> obj start-time) (the-as uint 0)) + (set! (-> obj timer) 0) + (set! (-> obj value) 0.0) + (-> obj value) + ) + +;; definition for method 10 of type delayed-rand-float +(defmethod dummy-10 delayed-rand-float ((obj delayed-rand-float)) + (when + (>= + (the-as int (- (-> *display* base-frame-counter) (-> obj start-time))) + (-> obj timer) + ) + (set! (-> obj start-time) (-> *display* base-frame-counter)) + (set! (-> obj timer) (rand-vu-int-range (-> obj min-time) (-> obj max-time))) + (let ((f0-3 (rand-vu-float-range (- (-> obj max-val)) (-> obj max-val)))) + (set! (-> obj value) f0-3) + ) + ) + (-> obj value) + ) + +;; definition for method 9 of type oscillating-float +(defmethod + dummy-9 + oscillating-float + ((obj oscillating-float) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> obj value) arg0) + (set! (-> obj target) arg0) + (set! (-> obj vel) 0.0) + (set! (-> obj max-vel) arg2) + (set! (-> obj damping) arg3) + (set! (-> obj accel) arg1) + (-> obj value) + ) + +;; definition for method 10 of type oscillating-float +(defmethod dummy-10 oscillating-float ((obj oscillating-float) (arg0 float)) + (let + ((f0-3 + (* + (- (+ (-> obj target) arg0) (-> obj value)) + (* (-> obj accel) (-> *display* time-adjust-ratio)) + ) + ) + ) + (set! (-> obj vel) (+ (-> obj vel) f0-3)) + ) + (set! + (-> obj vel) + (fmin (-> obj max-vel) (fmax (- (-> obj max-vel)) (-> obj vel))) + ) + (set! (-> obj vel) (* (-> obj vel) (-> obj damping))) + (let + ((f0-10 (+ (-> obj value) (* (-> obj vel) (-> *display* time-adjust-ratio)))) + ) + (set! (-> obj value) f0-10) + ) + (-> obj value) + ) + +;; definition for method 9 of type bouncing-float +(defmethod + dummy-9 + bouncing-float + ((obj bouncing-float) + (arg0 float) + (arg1 float) + (arg2 float) + (arg3 float) + (arg4 float) + (arg5 float) + (arg6 float) + ) + ((method-of-type oscillating-float dummy-9) (-> obj osc) arg0 arg4 arg5 arg6) + (set! (-> obj max-value) arg1) + (set! (-> obj min-value) arg2) + (set! (-> obj elasticity) arg3) + (set! (-> obj state) 0) + (-> obj osc value) + ) + +;; definition for method 10 of type bouncing-float +(defmethod dummy-10 bouncing-float ((obj bouncing-float) (arg0 float)) + ((method-of-type oscillating-float dummy-10) (-> obj osc) arg0) + (set! (-> obj state) 0) + (when (>= (-> obj osc value) (-> obj max-value)) + (set! (-> obj osc value) (-> obj max-value)) + (if (< 0.0 (-> obj osc vel)) + (let ((f0-4 (* (-> obj osc vel) (- (-> obj elasticity))))) + (set! (-> obj osc vel) f0-4) + ) + ) + (set! (-> obj state) 1) + ) + (when (>= (-> obj min-value) (-> obj osc value)) + (set! (-> obj osc value) (-> obj min-value)) + (if (< (-> obj osc vel) 0.0) + (let ((f0-9 (* (-> obj osc vel) (- (-> obj elasticity))))) + (set! (-> obj osc vel) f0-9) + ) + ) + (set! (-> obj state) -1) + ) + (-> obj osc value) + ) + +;; definition for method 11 of type bouncing-float +(defmethod dummy-11 bouncing-float ((obj bouncing-float)) + (= (-> obj state) -1) + ) + +;; definition for method 12 of type bouncing-float +(defmethod dummy-12 bouncing-float ((obj bouncing-float)) + (= (-> obj state) 1) + ) + +;; definition for method 9 of type delayed-rand-vector +(defmethod + dummy-9 + delayed-rand-vector + ((obj delayed-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) + (rlet ((vf0 :class vf)) + (.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0)) + (set! (-> obj min-time) arg0) + (set! (-> obj max-time) arg1) + (set! (-> obj xz-max) (* 0.5 arg2)) + (set! (-> obj y-max) (* 0.5 arg3)) + (set! (-> obj start-time) (the-as uint 0)) + (set! (-> obj timer) 0) + (let ((v1-0 (-> obj value))) + (.svf (&-> v1-0 quad) vf0) + ) + (-> obj value) + ) + ) + +;; definition for method 10 of type delayed-rand-vector +(defmethod dummy-10 delayed-rand-vector ((obj delayed-rand-vector)) + (set! (-> obj start-time) (-> *display* base-frame-counter)) + (set! (-> obj timer) (rand-vu-int-range (-> obj min-time) (-> obj max-time))) + (set! + (-> obj value data 0) + (rand-vu-float-range (- (-> obj xz-max)) (-> obj xz-max)) + ) + (set! + (-> obj value data 1) + (rand-vu-float-range (- (-> obj y-max)) (-> obj y-max)) + ) + (set! + (-> obj value data 2) + (rand-vu-float-range (- (-> obj xz-max)) (-> obj xz-max)) + ) + (-> obj value) + ) + +;; definition for method 11 of type delayed-rand-vector +(defmethod dummy-11 delayed-rand-vector ((obj delayed-rand-vector)) + (if + (>= + (the-as int (- (-> *display* base-frame-counter) (-> obj start-time))) + (-> obj timer) + ) + ((method-of-type delayed-rand-vector dummy-10) obj) + ) + (-> obj value) + ) + +;; definition for method 12 of type delayed-rand-vector +(defmethod dummy-12 delayed-rand-vector ((obj delayed-rand-vector)) + (rlet ((vf0 :class vf)) + (.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0)) + (if + (>= + (the-as int (- (-> *display* base-frame-counter) (-> obj start-time))) + (-> obj timer) + ) + ((method-of-type delayed-rand-vector dummy-10) obj) + (let ((v1-5 (-> obj value))) + (.svf (&-> v1-5 quad) vf0) + ) + ) + (-> obj value) + ) + ) + +;; definition for method 9 of type oscillating-vector +;; Used lq/sq +(defmethod + dummy-9 + oscillating-vector + ((obj oscillating-vector) + (arg0 vector) + (arg1 float) + (arg2 float) + (arg3 float) + ) + (rlet ((vf0 :class vf)) + (.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0)) + (cond + (arg0 + (let ((v1-0 (-> obj value))) + (set! (-> v1-0 quad) (-> arg0 quad)) + ) + (let ((v1-1 (-> obj target))) + (set! (-> v1-1 quad) (-> arg0 quad)) + ) + ) + (else + (let ((v1-2 (-> obj value))) + (.svf (&-> v1-2 quad) vf0) + ) + (let ((v1-3 (-> obj target))) + (.svf (&-> v1-3 quad) vf0) + ) + ) + ) + (let ((v1-4 (-> obj vel))) + (.svf (&-> v1-4 quad) vf0) + ) + (set! (-> obj max-vel) arg2) + (set! (-> obj damping) arg3) + (set! (-> obj accel) arg1) + (-> obj value) + ) + ) + +;; definition for method 10 of type oscillating-vector +(defmethod dummy-10 oscillating-vector ((obj oscillating-vector) (arg0 vector)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0)) + (let ((s5-0 (new 'stack 'vector))) + (cond + (arg0 + (let ((a0-1 s5-0)) + (let ((v1-0 (-> obj target))) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> v1-0 quad)) + ) + (.lvf vf5 (&-> arg0 quad)) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> a0-1 quad) vf6) + ) + (let ((a1-1 s5-0)) + (let ((v1-1 s5-0) + (a0-2 (-> obj value)) + ) + (.lvf vf4 (&-> v1-1 quad)) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> a1-1 quad) vf6) + ) + ) + (else + (let ((a1-2 s5-0)) + (let ((v1-2 (-> obj target)) + (a0-3 (-> obj value)) + ) + (.lvf vf4 (&-> v1-2 quad)) + (.lvf vf5 (&-> a0-3 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> a1-2 quad) vf6) + ) + ) + ) + (let ((v1-3 s5-0)) + (let ((a0-4 s5-0) + (f0-1 (* (-> obj accel) (-> *display* time-adjust-ratio))) + ) + (.lvf vf1 (&-> a0-4 quad)) + (let ((a0-5 f0-1)) + (.mov vf2 a0-5) + ) + ) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-3 quad) vf1) + ) + (let ((a1-4 (-> obj vel))) + (let ((v1-4 (-> obj vel)) + (a0-6 s5-0) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> v1-4 quad)) + (.lvf vf5 (&-> a0-6 quad)) + ) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> a1-4 quad) vf6) + ) + (let ((f0-2 (vector-length (-> obj vel)))) + (if (< (-> obj max-vel) f0-2) + (let ((v1-6 (-> obj vel))) + (let ((a0-8 (-> obj vel)) + (f0-3 (/ (-> obj max-vel) f0-2)) + ) + (.lvf vf1 (&-> a0-8 quad)) + (let ((a0-9 f0-3)) + (.mov vf2 a0-9) + ) + ) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-6 quad) vf1) + ) + ) + ) + (let ((v1-7 (-> obj vel))) + (let ((a0-10 (-> obj vel)) + (f0-4 (-> obj damping)) + ) + (.lvf vf1 (&-> a0-10 quad)) + (let ((a0-11 f0-4)) + (.mov vf2 a0-11) + ) + ) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-7 quad) vf1) + ) + (let ((v1-8 s5-0)) + (let ((a0-12 (-> obj vel)) + (f0-5 (-> *display* time-adjust-ratio)) + ) + (.lvf vf1 (&-> a0-12 quad)) + (let ((a0-13 f0-5)) + (.mov vf2 a0-13) + ) + ) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-8 quad) vf1) + ) + (let ((a0-14 (-> obj value))) + (let ((v1-9 (-> obj value))) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> v1-9 quad)) + ) + (.lvf vf5 (&-> s5-0 quad)) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> a0-14 quad) vf6) + ) + ) + (-> obj value) + ) + ) \ No newline at end of file diff --git a/scripts/batch/gk-display.bat b/scripts/batch/gk-display.bat new file mode 100644 index 0000000000..331d19cb32 --- /dev/null +++ b/scripts/batch/gk-display.bat @@ -0,0 +1,3 @@ +@echo off +cd ..\.. +out\build\Release\bin\gk -fakeiso -debug -v diff --git a/scripts/batch/gk.bat b/scripts/batch/gk.bat index 331d19cb32..a30edec307 100644 --- a/scripts/batch/gk.bat +++ b/scripts/batch/gk.bat @@ -1,3 +1,3 @@ @echo off cd ..\.. -out\build\Release\bin\gk -fakeiso -debug -v +out\build\Release\bin\gk -fakeiso -debug -v -nodisplay diff --git a/scripts/batch/test-offline.bat b/scripts/batch/test-offline.bat new file mode 100644 index 0000000000..5f11e8525a --- /dev/null +++ b/scripts/batch/test-offline.bat @@ -0,0 +1,4 @@ +@echo off +cd ..\.. +out\build\Release\bin\offline-test iso_data\jak1\ +pause \ No newline at end of file diff --git a/test/decompiler/reference/all_forward_declarations.gc b/test/decompiler/reference/all_forward_declarations.gc index ef93df312c..144ea5f66b 100644 --- a/test/decompiler/reference/all_forward_declarations.gc +++ b/test/decompiler/reference/all_forward_declarations.gc @@ -116,4 +116,104 @@ (define-extern vector-xz-normalize! (function vector float vector)) (declare-type quaternion structure) (define-extern quaternion-from-two-vectors-max-angle! (function quaternion vector vector float quaternion)) -(define-extern vector-xz-length (function vector float)) \ No newline at end of file +(define-extern vector-xz-length (function vector float)) + +;; display-h +(deftype display-env (structure) + ((pmode uint64 :offset-assert 0) + (smode2 uint64 :offset-assert 8) + (dspfb uint64 :offset-assert 16) + (display uint64 :offset-assert 24) + (bgcolor uint64 :offset-assert 32) + ) + :pack-me + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + ) + +(deftype draw-env (structure) + ((frame1 uint64 :offset-assert 0) + (frame1addr uint64 :offset-assert 8) + (zbuf1 uint64 :offset-assert 16) + (zbuf1addr uint64 :offset-assert 24) + (xyoffset1 uint64 :offset-assert 32) + (xyoffset1addr uint64 :offset-assert 40) + (scissor1 uint64 :offset-assert 48) + (scissor1addr uint64 :offset-assert 56) + (prmodecont uint64 :offset-assert 64) + (prmodecontaddr uint64 :offset-assert 72) + (colclamp uint64 :offset-assert 80) + (colclampaddr uint64 :offset-assert 88) + (dthe uint64 :offset-assert 96) + (dtheaddr uint64 :offset-assert 104) + (test1 uint64 :offset-assert 112) + (test1addr uint64 :offset-assert 120) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +(declare-type display-frame basic) + +(deftype virtual-frame (structure) + ((display display-env :offset-assert 0) + (display-last display-env :offset-assert 4) + (gif pointer :offset-assert 8) + (draw draw-env :offset-assert 12) + (frame display-frame :offset-assert 16) + ) + + :allow-misaligned + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +(deftype display (basic) + ((display-env0 display-env :inline :offset-assert 8) + (display-env1 display-env :inline :offset-assert 48) + (display-env2 display-env :inline :offset-assert 88) + (gif-tag0 uint128 :offset-assert 128) + (draw0 draw-env :inline :offset-assert 144) + (gif-tag1 uint128 :offset-assert 272) + (draw1 draw-env :inline :offset-assert 288) + (gif-tag2 uint128 :offset-assert 416) + (draw2 draw-env :inline :offset-assert 432) + (on-screen int32 :offset-assert 560) + (last-screen int32 :offset-assert 564) + (frames virtual-frame 6 :inline :offset-assert 568) + (bg-clear-color uint32 4 :offset-assert 760) + (real-frame-counter uint64 :offset-assert 776) + (base-frame-counter uint64 :offset-assert 784) + (game-frame-counter uint64 :offset-assert 792) + (integral-frame-counter uint64 :offset-assert 800) + (real-integral-frame-counter uint64 :offset-assert 808) + (actual-frame-counter uint64 :offset-assert 816) + (real-actual-frame-counter uint64 :offset-assert 824) + (part-frame-counter uint64 :offset-assert 832) + (old-real-frame-counter uint64 :offset-assert 840) + (old-base-frame-counter uint64 :offset-assert 848) + (old-game-frame-counter uint64 :offset-assert 856) + (old-integral-frame-counter uint64 :offset-assert 864) + (old-real-integral-frame-counter uint64 :offset-assert 872) + (old-actual-frame-counter uint64 :offset-assert 880) + (old-real-actual-frame-counter uint64 :offset-assert 888) + (old-part-frame-counter uint64 :offset-assert 896) + (time-ratio float :offset-assert 904) + (seconds-per-frame float :offset-assert 908) + (frames-per-second float :offset-assert 912) + (time-factor float :offset-assert 916) + (time-adjust-ratio float :offset-assert 920) + ) + :method-count-assert 10 + :size-assert #x39c + :flag-assert #xa0000039c + (:methods + (new (symbol type int int int int int) _type_ 0) + (dummy-9 () none 9) + ) + ) + +(define-extern *display* display) \ No newline at end of file diff --git a/test/decompiler/reference/sync-info-h_REF.gc b/test/decompiler/reference/sync-info-h_REF.gc new file mode 100644 index 0000000000..bff5db5bbf --- /dev/null +++ b/test/decompiler/reference/sync-info-h_REF.gc @@ -0,0 +1,242 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type sync-info +(deftype sync-info (structure) + ((offset float :offset-assert 0) + (period uint32 :offset-assert 4) + ) + :method-count-assert 18 + :size-assert #x8 + :flag-assert #x1200000008 + (:methods + (dummy-9 (_type_ float) float 9) + (dummy-10 (_type_) float 10) + (dummy-11 (_type_) float 11) + (dummy-12 (_type_ float) float 12) + (dummy-13 (_type_) float 13) + (dummy-14 (_type_ uint float float float) int 14) + (dummy-15 (_type_) float 15) + (dummy-16 (_type_ float) float 16) + (dummy-17 (_type_) float 17) + ) + ) + +;; definition for method 3 of type sync-info +(defmethod inspect sync-info ((obj sync-info)) + (format #t "[~8x] ~A~%" obj 'sync-info) + (format #t "~Toffset: ~f~%" (-> obj offset)) + (format #t "~Tperiod: ~D~%" (-> obj period)) + obj + ) + +;; definition of type sync-info-eased +(deftype sync-info-eased (sync-info) + ((tlo float :offset-assert 8) + (thi float :offset-assert 12) + (ylo float :offset-assert 16) + (m2 float :offset-assert 20) + (yend float :offset-assert 24) + ) + :method-count-assert 18 + :size-assert #x1c + :flag-assert #x120000001c + ) + +;; definition for method 3 of type sync-info-eased +(defmethod inspect sync-info-eased ((obj sync-info-eased)) + (format #t "[~8x] ~A~%" obj 'sync-info-eased) + (format #t "~Toffset: ~f~%" (-> obj offset)) + (format #t "~Tperiod: ~D~%" (-> obj period)) + (format #t "~Ttlo: ~f~%" (-> obj tlo)) + (format #t "~Tthi: ~f~%" (-> obj thi)) + (format #t "~Tylo: ~f~%" (-> obj ylo)) + (format #t "~Tm2: ~f~%" (-> obj m2)) + (format #t "~Tyend: ~f~%" (-> obj yend)) + obj + ) + +;; definition of type sync-info-paused +(deftype sync-info-paused (sync-info) + ((pause-after-out float :offset-assert 8) + (pause-after-in float :offset-assert 12) + ) + :method-count-assert 18 + :size-assert #x10 + :flag-assert #x1200000010 + ) + +;; definition for method 3 of type sync-info-paused +(defmethod inspect sync-info-paused ((obj sync-info-paused)) + (format #t "[~8x] ~A~%" obj 'sync-info-paused) + (format #t "~Toffset: ~f~%" (-> obj offset)) + (format #t "~Tperiod: ~D~%" (-> obj period)) + (format #t "~Tpause-after-out: ~f~%" (-> obj pause-after-out)) + (format #t "~Tpause-after-in: ~f~%" (-> obj pause-after-in)) + obj + ) + +;; definition of type delayed-rand-float +(deftype delayed-rand-float (structure) + ((min-time int32 :offset-assert 0) + (max-time int32 :offset-assert 4) + (max-val float :offset-assert 8) + (timer int32 :offset-assert 12) + (start-time uint64 :offset-assert 16) + (value float :offset-assert 24) + ) + :method-count-assert 11 + :size-assert #x1c + :flag-assert #xb0000001c + (:methods + (dummy-9 (_type_ int int float) float 9) + (dummy-10 (_type_) float 10) + ) + ) + +;; definition for method 3 of type delayed-rand-float +(defmethod inspect delayed-rand-float ((obj delayed-rand-float)) + (format #t "[~8x] ~A~%" obj 'delayed-rand-float) + (format #t "~Tmin-time: ~D~%" (-> obj min-time)) + (format #t "~Tmax-time: ~D~%" (-> obj max-time)) + (format #t "~Tmax-val: ~f~%" (-> obj max-val)) + (format #t "~Ttimer: ~D~%" (-> obj timer)) + (format #t "~Tstart-time: ~D~%" (-> obj start-time)) + (format #t "~Tvalue: ~f~%" (-> obj value)) + obj + ) + +;; definition of type oscillating-float +(deftype oscillating-float (structure) + ((value float :offset-assert 0) + (target float :offset-assert 4) + (vel float :offset-assert 8) + (max-vel float :offset-assert 12) + (damping float :offset-assert 16) + (accel float :offset-assert 20) + ) + :method-count-assert 11 + :size-assert #x18 + :flag-assert #xb00000018 + (:methods + (dummy-9 (_type_ float float float float) float 9) + (dummy-10 (_type_ float) float 10) + ) + ) + +;; definition for method 3 of type oscillating-float +(defmethod inspect oscillating-float ((obj oscillating-float)) + (format #t "[~8x] ~A~%" obj 'oscillating-float) + (format #t "~Tvalue: ~f~%" (-> obj value)) + (format #t "~Ttarget: ~f~%" (-> obj target)) + (format #t "~Tvel: ~f~%" (-> obj vel)) + (format #t "~Tmax-vel: ~f~%" (-> obj max-vel)) + (format #t "~Tdamping: ~f~%" (-> obj damping)) + (format #t "~Taccel: ~f~%" (-> obj accel)) + obj + ) + +;; definition of type bouncing-float +(deftype bouncing-float (structure) + ((osc oscillating-float :inline :offset-assert 0) + (max-value float :offset-assert 24) + (min-value float :offset-assert 28) + (elasticity float :offset-assert 32) + (state int32 :offset-assert 36) + ) + :method-count-assert 13 + :size-assert #x28 + :flag-assert #xd00000028 + (:methods + (dummy-9 (_type_ float float float float float float float) float 9) + (dummy-10 (_type_ float) float 10) + (dummy-11 (_type_) symbol 11) + (dummy-12 (_type_) symbol 12) + ) + ) + +;; definition for method 3 of type bouncing-float +(defmethod inspect bouncing-float ((obj bouncing-float)) + (format #t "[~8x] ~A~%" obj 'bouncing-float) + (format #t "~Tosc: #~%" (-> obj osc)) + (format #t "~Tmax-value: ~f~%" (-> obj max-value)) + (format #t "~Tmin-value: ~f~%" (-> obj min-value)) + (format #t "~Telasticity: ~f~%" (-> obj elasticity)) + (format #t "~Tstate: ~D~%" (-> obj state)) + obj + ) + +;; definition of type delayed-rand-vector +(deftype delayed-rand-vector (structure) + ((min-time int32 :offset-assert 0) + (max-time int32 :offset-assert 4) + (xz-max float :offset-assert 8) + (y-max float :offset-assert 12) + (timer int32 :offset-assert 16) + (start-time uint64 :offset-assert 24) + (value vector :inline :offset-assert 32) + ) + :method-count-assert 13 + :size-assert #x30 + :flag-assert #xd00000030 + (:methods + (dummy-9 (_type_ int int float float) vector 9) + (dummy-10 (_type_) vector 10) + (dummy-11 (_type_) vector 11) + (dummy-12 (_type_) vector 12) + ) + ) + +;; definition for method 3 of type delayed-rand-vector +(defmethod inspect delayed-rand-vector ((obj delayed-rand-vector)) + (format #t "[~8x] ~A~%" obj 'delayed-rand-vector) + (format #t "~Tmin-time: ~D~%" (-> obj min-time)) + (format #t "~Tmax-time: ~D~%" (-> obj max-time)) + (format #t "~Txz-max: ~f~%" (-> obj xz-max)) + (format #t "~Ty-max: ~f~%" (-> obj y-max)) + (format #t "~Ttimer: ~D~%" (-> obj timer)) + (format #t "~Tstart-time: ~D~%" (-> obj start-time)) + (format #t "~Tvalue: #~%" (-> obj value)) + obj + ) + +;; definition of type oscillating-vector +(deftype oscillating-vector (structure) + ((value vector :inline :offset-assert 0) + (target vector :inline :offset-assert 16) + (vel vector :inline :offset-assert 32) + (max-vel float :offset-assert 48) + (damping float :offset-assert 52) + (accel float :offset-assert 56) + ) + :method-count-assert 11 + :size-assert #x3c + :flag-assert #xb0000003c + (:methods + (dummy-9 (_type_ vector float float float) vector 9) + (dummy-10 (_type_ vector) vector 10) + ) + ) + +;; definition for method 3 of type oscillating-vector +(defmethod inspect oscillating-vector ((obj oscillating-vector)) + (format #t "[~8x] ~A~%" obj 'oscillating-vector) + (format #t "~Tvalue: #~%" (-> obj value)) + (format #t "~Ttarget: #~%" (-> obj target)) + (format #t "~Tvel: #~%" (-> obj vel)) + (format #t "~Tmax-vel: ~f~%" (-> obj max-vel)) + (format #t "~Tdamping: ~f~%" (-> obj damping)) + (format #t "~Taccel: ~f~%" (-> obj accel)) + obj + ) + +;; failed to figure out what this is: +(let ((v0-8 0)) + ) + +;; failed to figure out what this is: +(none) + + + + diff --git a/test/decompiler/reference/sync-info_REF.gc b/test/decompiler/reference/sync-info_REF.gc new file mode 100644 index 0000000000..e327aa2878 --- /dev/null +++ b/test/decompiler/reference/sync-info_REF.gc @@ -0,0 +1,720 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 14 of type sync-info +(defmethod + dummy-14 + sync-info + ((obj sync-info) (arg0 uint) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> obj period) arg0) + (let* ((f0-1 (the float arg0)) + (f1-1 (* arg1 f0-1)) + (f0-3 (- f1-1 (* (the float (the int (/ f1-1 f0-1))) f0-1))) + ) + (set! (-> obj offset) f0-3) + ) + 0 + ) + +;; definition for method 14 of type sync-info-eased +(defmethod + dummy-14 + sync-info-eased + ((obj sync-info-eased) (arg0 uint) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> obj period) arg0) + (let* ((f0-1 (the float arg0)) + (f1-1 (* arg1 f0-1)) + (f0-3 (- f1-1 (* (the float (the int (/ f1-1 f0-1))) f0-1))) + ) + (set! (-> obj offset) f0-3) + ) + (if (< arg2 0.0) + (set! arg2 0.0) + ) + (if (< 1.0 arg2) + (set! arg2 1.0) + ) + (if (< arg3 0.001) + (set! arg3 0.001) + ) + (if (< 1.0 arg3) + (set! arg3 1.0) + ) + (let ((f0-9 (+ arg2 arg3))) + (when (< 1.0 f0-9) + (set! f0-9 1.0) + (set! arg2 (- 1.0 arg3)) + ) + (let* ((f1-11 (- 1.0 f0-9)) + (f0-10 arg2) + (f1-12 (+ arg2 f1-11)) + (f2-5 (* f0-10 f0-10)) + (f3-3 (+ (* (* 2.0 f0-10) (- f1-12 f0-10)) f2-5)) + (f4-3 (/ f0-10 (- 1.0 f1-12))) + (f3-4 (+ (* (* (- 1.0 f1-12) (- 1.0 f1-12)) f4-3) f3-3)) + ) + (set! (-> obj tlo) f0-10) + (set! (-> obj thi) f1-12) + (set! (-> obj ylo) f2-5) + (set! (-> obj m2) f4-3) + (set! (-> obj yend) f3-4) + ) + ) + 0 + ) + +;; definition for method 14 of type sync-info-paused +(defmethod + dummy-14 + sync-info-paused + ((obj sync-info-paused) (arg0 uint) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> obj period) arg0) + (let* ((f0-1 (the float arg0)) + (f1-1 (* arg1 f0-1)) + (f0-3 (- f1-1 (* (the float (the int (/ f1-1 f0-1))) f0-1))) + ) + (set! (-> obj offset) f0-3) + ) + (cond + ((< arg2 0.0) + (set! arg2 0.0) + ) + ((< 1.0 arg2) + (set! arg2 1.0) + ) + ) + (cond + ((< arg3 0.0) + (set! arg3 0.0) + ) + ((< (- 1.0 arg2) arg3) + (set! arg3 (- 1.0 arg2)) + ) + ) + (set! (-> obj pause-after-in) arg3) + (set! (-> obj pause-after-out) arg2) + 0 + ) + +;; definition for method 15 of type sync-info +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for method 15 of type sync-info-eased +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for method 15 of type sync-info-paused +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for method 10 of type sync-info +(defmethod dummy-10 sync-info ((obj sync-info)) + (let* ((v1-0 (-> obj period)) + (f0-1 (the float v1-0)) + (f1-2 + (+ + (the float (mod (-> *display* base-frame-counter) v1-0)) + (-> obj offset) + ) + ) + ) + (/ (- f1-2 (* (the float (the int (/ f1-2 f0-1))) f0-1)) f0-1) + ) + ) + +;; definition for method 17 of type sync-info +(defmethod dummy-17 sync-info ((obj sync-info)) + (/ (-> obj offset) (the float (-> obj period))) + ) + +;; definition for method 16 of type sync-info +(defmethod dummy-16 sync-info ((obj sync-info) (arg0 float)) + (let* ((a2-0 (-> obj period)) + (f0-1 (the float a2-0)) + (v1-0 (- arg0 (* (the float (the int (/ arg0 f0-1))) f0-1))) + (f1-4 + (+ + (the float (mod (-> *display* base-frame-counter) a2-0)) + (-> obj offset) + ) + ) + (f1-6 (/ (- f1-4 (* (the float (the int (/ f1-4 f0-1))) f0-1)) f0-1)) + (f1-10 (+ (+ (* (- v1-0 f1-6) f0-1) f0-1) (-> obj offset))) + (f0-3 (- f1-10 (* (the float (the int (/ f1-10 f0-1))) f0-1))) + ) + (set! (-> obj offset) f0-3) + f0-3 + ) + ) + +;; definition for method 11 of type sync-info +(defmethod dummy-11 sync-info ((obj sync-info)) + (let* ((v1-0 (-> obj period)) + (f0-1 (the float v1-0)) + (f1-2 + (+ + (the float (mod (-> *display* base-frame-counter) v1-0)) + (-> obj offset) + ) + ) + ) + (/ (- f1-2 (* (the float (the int (/ f1-2 f0-1))) f0-1)) f0-1) + ) + ) + +;; definition for method 11 of type sync-info-paused +(defmethod dummy-11 sync-info-paused ((obj sync-info-paused)) + (let* ((v1-0 (-> obj period)) + (f1-0 (the float v1-0)) + (f0-1 1.0) + (f2-2 + (+ + (the float (mod (-> *display* base-frame-counter) v1-0)) + (-> obj offset) + ) + ) + ) + (fmin + f0-1 + (/ + (- f2-2 (* (the float (the int (/ f2-2 f1-0))) f1-0)) + (* f1-0 (- 1.0 (-> obj pause-after-out))) + ) + ) + ) + ) + +;; definition for method 9 of type sync-info +(defmethod dummy-9 sync-info ((obj sync-info) (arg0 float)) + (let* ((v1-0 (-> obj period)) + (f0-1 (the float v1-0)) + (f1-2 + (+ + (the float (mod (-> *display* base-frame-counter) v1-0)) + (-> obj offset) + ) + ) + ) + (* (/ (- f1-2 (* (the float (the int (/ f1-2 f0-1))) f0-1)) f0-1) arg0) + ) + ) + +;; definition for method 9 of type sync-info-paused +(defmethod dummy-9 sync-info-paused ((obj sync-info-paused) (arg0 float)) + (* ((method-of-type sync-info-paused dummy-11) obj) arg0) + ) + +;; definition for method 13 of type sync-info +(defmethod dummy-13 sync-info ((obj sync-info)) + (let* ((v1-0 (-> obj period)) + (f1-0 (the float v1-0)) + (f0-1 2.0) + (f2-2 + (+ + (the float (mod (-> *display* base-frame-counter) v1-0)) + (-> obj offset) + ) + ) + (f0-2 + (* + f0-1 + (/ (- f2-2 (* (the float (the int (/ f2-2 f1-0))) f1-0)) f1-0) + ) + ) + ) + (if (>= f0-2 1.0) + (set! f0-2 (- 2.0 f0-2)) + ) + f0-2 + ) + ) + +;; definition for method 13 of type sync-info-eased +(defmethod dummy-13 sync-info-eased ((obj sync-info-eased)) + (let* ((v1-0 (-> obj period)) + (f1-0 (the float v1-0)) + (f0-1 2.0) + (f2-2 + (+ + (the float (mod (-> *display* base-frame-counter) v1-0)) + (-> obj offset) + ) + ) + (f0-2 + (* + f0-1 + (/ (- f2-2 (* (the float (the int (/ f2-2 f1-0))) f1-0)) f1-0) + ) + ) + (v1-2 #f) + ) + (when (>= f0-2 1.0) + (set! v1-2 #t) + (set! f0-2 (+ -1.0 f0-2)) + ) + (let* ((f1-4 (-> obj tlo)) + (f0-7 (/ (cond + ((< f0-2 f1-4) + (* f0-2 f0-2) + ) + ((< f0-2 (-> obj thi)) + (+ (* (* 2.0 f1-4) (- f0-2 f1-4)) (-> obj ylo)) + ) + (else + (let ((f1-7 (- 1.0 f0-2))) + (- (-> obj yend) (* (* f1-7 f1-7) (-> obj m2))) + ) + ) + ) + (-> obj yend) + ) + ) + ) + (if v1-2 + (set! f0-7 (- 1.0 f0-7)) + ) + f0-7 + ) + ) + ) + +;; definition for method 13 of type sync-info-paused +(defmethod dummy-13 sync-info-paused ((obj sync-info-paused)) + (let* ((v1-0 (-> obj period)) + (f1-0 (the float v1-0)) + (f0-1 2.0) + (f2-2 + (+ + (the float (mod (-> *display* base-frame-counter) v1-0)) + (-> obj offset) + ) + ) + (f0-2 + (* + f0-1 + (/ (- f2-2 (* (the float (the int (/ f2-2 f1-0))) f1-0)) f1-0) + ) + ) + (f1-3 (- 1.0 (* 2.0 (-> obj pause-after-in)))) + (f2-7 (- 1.0 (* 2.0 (-> obj pause-after-out)))) + ) + (cond + ((>= f0-2 (+ 1.0 f1-3)) + 0.0 + ) + ((< 1.0 f0-2) + (- 1.0 (/ (+ -1.0 f0-2) f1-3)) + ) + ((>= f0-2 f2-7) + 1.0 + ) + (else + (/ f0-2 f2-7) + ) + ) + ) + ) + +;; definition for method 12 of type sync-info +(defmethod dummy-12 sync-info ((obj sync-info) (arg0 float)) + (let* ((v1-0 (-> obj period)) + (f1-0 (the float v1-0)) + (f0-1 2.0) + (f2-2 + (+ + (the float (mod (-> *display* base-frame-counter) v1-0)) + (-> obj offset) + ) + ) + (f0-2 + (* + f0-1 + (/ (- f2-2 (* (the float (the int (/ f2-2 f1-0))) f1-0)) f1-0) + ) + ) + ) + (if (>= f0-2 1.0) + (set! f0-2 (- 2.0 f0-2)) + ) + (* f0-2 arg0) + ) + ) + +;; definition for method 12 of type sync-info-eased +(defmethod dummy-12 sync-info-eased ((obj sync-info-eased) (arg0 float)) + (* ((method-of-type sync-info-eased dummy-13) obj) arg0) + ) + +;; definition for method 12 of type sync-info-paused +(defmethod dummy-12 sync-info-paused ((obj sync-info-paused) (arg0 float)) + (* ((method-of-type sync-info-paused dummy-13) obj) arg0) + ) + +;; definition for method 9 of type delayed-rand-float +(defmethod + dummy-9 + delayed-rand-float + ((obj delayed-rand-float) (arg0 int) (arg1 int) (arg2 float)) + (set! (-> obj min-time) arg0) + (set! (-> obj max-time) arg1) + (set! (-> obj max-val) (* 0.5 arg2)) + (set! (-> obj start-time) (the-as uint 0)) + (set! (-> obj timer) 0) + (set! (-> obj value) 0.0) + (-> obj value) + ) + +;; definition for method 10 of type delayed-rand-float +(defmethod dummy-10 delayed-rand-float ((obj delayed-rand-float)) + (when + (>= + (the-as int (- (-> *display* base-frame-counter) (-> obj start-time))) + (-> obj timer) + ) + (set! (-> obj start-time) (-> *display* base-frame-counter)) + (set! (-> obj timer) (rand-vu-int-range (-> obj min-time) (-> obj max-time))) + (let ((f0-3 (rand-vu-float-range (- (-> obj max-val)) (-> obj max-val)))) + (set! (-> obj value) f0-3) + ) + ) + (-> obj value) + ) + +;; definition for method 9 of type oscillating-float +(defmethod + dummy-9 + oscillating-float + ((obj oscillating-float) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> obj value) arg0) + (set! (-> obj target) arg0) + (set! (-> obj vel) 0.0) + (set! (-> obj max-vel) arg2) + (set! (-> obj damping) arg3) + (set! (-> obj accel) arg1) + (-> obj value) + ) + +;; definition for method 10 of type oscillating-float +(defmethod dummy-10 oscillating-float ((obj oscillating-float) (arg0 float)) + (let + ((f0-3 + (* + (- (+ (-> obj target) arg0) (-> obj value)) + (* (-> obj accel) (-> *display* time-adjust-ratio)) + ) + ) + ) + (set! (-> obj vel) (+ (-> obj vel) f0-3)) + ) + (set! + (-> obj vel) + (fmin (-> obj max-vel) (fmax (- (-> obj max-vel)) (-> obj vel))) + ) + (set! (-> obj vel) (* (-> obj vel) (-> obj damping))) + (let + ((f0-10 (+ (-> obj value) (* (-> obj vel) (-> *display* time-adjust-ratio)))) + ) + (set! (-> obj value) f0-10) + ) + (-> obj value) + ) + +;; definition for method 9 of type bouncing-float +(defmethod + dummy-9 + bouncing-float + ((obj bouncing-float) + (arg0 float) + (arg1 float) + (arg2 float) + (arg3 float) + (arg4 float) + (arg5 float) + (arg6 float) + ) + ((method-of-type oscillating-float dummy-9) (-> obj osc) arg0 arg4 arg5 arg6) + (set! (-> obj max-value) arg1) + (set! (-> obj min-value) arg2) + (set! (-> obj elasticity) arg3) + (set! (-> obj state) 0) + (-> obj osc value) + ) + +;; definition for method 10 of type bouncing-float +(defmethod dummy-10 bouncing-float ((obj bouncing-float) (arg0 float)) + ((method-of-type oscillating-float dummy-10) (-> obj osc) arg0) + (set! (-> obj state) 0) + (when (>= (-> obj osc value) (-> obj max-value)) + (set! (-> obj osc value) (-> obj max-value)) + (if (< 0.0 (-> obj osc vel)) + (let ((f0-4 (* (-> obj osc vel) (- (-> obj elasticity))))) + (set! (-> obj osc vel) f0-4) + ) + ) + (set! (-> obj state) 1) + ) + (when (>= (-> obj min-value) (-> obj osc value)) + (set! (-> obj osc value) (-> obj min-value)) + (if (< (-> obj osc vel) 0.0) + (let ((f0-9 (* (-> obj osc vel) (- (-> obj elasticity))))) + (set! (-> obj osc vel) f0-9) + ) + ) + (set! (-> obj state) -1) + ) + (-> obj osc value) + ) + +;; definition for method 11 of type bouncing-float +(defmethod dummy-11 bouncing-float ((obj bouncing-float)) + (= (-> obj state) -1) + ) + +;; definition for method 12 of type bouncing-float +(defmethod dummy-12 bouncing-float ((obj bouncing-float)) + (= (-> obj state) 1) + ) + +;; definition for method 9 of type delayed-rand-vector +(defmethod + dummy-9 + delayed-rand-vector + ((obj delayed-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) + (rlet ((vf0 :class vf)) + (.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0)) + (set! (-> obj min-time) arg0) + (set! (-> obj max-time) arg1) + (set! (-> obj xz-max) (* 0.5 arg2)) + (set! (-> obj y-max) (* 0.5 arg3)) + (set! (-> obj start-time) (the-as uint 0)) + (set! (-> obj timer) 0) + (let ((v1-0 (-> obj value))) + (.svf (&-> v1-0 quad) vf0) + ) + (-> obj value) + ) + ) + +;; definition for method 10 of type delayed-rand-vector +(defmethod dummy-10 delayed-rand-vector ((obj delayed-rand-vector)) + (set! (-> obj start-time) (-> *display* base-frame-counter)) + (set! (-> obj timer) (rand-vu-int-range (-> obj min-time) (-> obj max-time))) + (set! + (-> obj value data 0) + (rand-vu-float-range (- (-> obj xz-max)) (-> obj xz-max)) + ) + (set! + (-> obj value data 1) + (rand-vu-float-range (- (-> obj y-max)) (-> obj y-max)) + ) + (set! + (-> obj value data 2) + (rand-vu-float-range (- (-> obj xz-max)) (-> obj xz-max)) + ) + (-> obj value) + ) + +;; definition for method 11 of type delayed-rand-vector +(defmethod dummy-11 delayed-rand-vector ((obj delayed-rand-vector)) + (if + (>= + (the-as int (- (-> *display* base-frame-counter) (-> obj start-time))) + (-> obj timer) + ) + ((method-of-type delayed-rand-vector dummy-10) obj) + ) + (-> obj value) + ) + +;; definition for method 12 of type delayed-rand-vector +(defmethod dummy-12 delayed-rand-vector ((obj delayed-rand-vector)) + (rlet ((vf0 :class vf)) + (.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0)) + (if + (>= + (the-as int (- (-> *display* base-frame-counter) (-> obj start-time))) + (-> obj timer) + ) + ((method-of-type delayed-rand-vector dummy-10) obj) + (let ((v1-5 (-> obj value))) + (.svf (&-> v1-5 quad) vf0) + ) + ) + (-> obj value) + ) + ) + +;; definition for method 9 of type oscillating-vector +;; Used lq/sq +(defmethod + dummy-9 + oscillating-vector + ((obj oscillating-vector) + (arg0 vector) + (arg1 float) + (arg2 float) + (arg3 float) + ) + (rlet ((vf0 :class vf)) + (.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0)) + (cond + (arg0 + (let ((v1-0 (-> obj value))) + (set! (-> v1-0 quad) (-> arg0 quad)) + ) + (let ((v1-1 (-> obj target))) + (set! (-> v1-1 quad) (-> arg0 quad)) + ) + ) + (else + (let ((v1-2 (-> obj value))) + (.svf (&-> v1-2 quad) vf0) + ) + (let ((v1-3 (-> obj target))) + (.svf (&-> v1-3 quad) vf0) + ) + ) + ) + (let ((v1-4 (-> obj vel))) + (.svf (&-> v1-4 quad) vf0) + ) + (set! (-> obj max-vel) arg2) + (set! (-> obj damping) arg3) + (set! (-> obj accel) arg1) + (-> obj value) + ) + ) + +;; definition for method 10 of type oscillating-vector +(defmethod dummy-10 oscillating-vector ((obj oscillating-vector) (arg0 vector)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0)) + (let ((s5-0 (new 'stack 'vector))) + (cond + (arg0 + (let ((a0-1 s5-0)) + (let ((v1-0 (-> obj target))) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> v1-0 quad)) + ) + (.lvf vf5 (&-> arg0 quad)) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> a0-1 quad) vf6) + ) + (let ((a1-1 s5-0)) + (let ((v1-1 s5-0) + (a0-2 (-> obj value)) + ) + (.lvf vf4 (&-> v1-1 quad)) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> a1-1 quad) vf6) + ) + ) + (else + (let ((a1-2 s5-0)) + (let ((v1-2 (-> obj target)) + (a0-3 (-> obj value)) + ) + (.lvf vf4 (&-> v1-2 quad)) + (.lvf vf5 (&-> a0-3 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> a1-2 quad) vf6) + ) + ) + ) + (let ((v1-3 s5-0)) + (let ((a0-4 s5-0) + (f0-1 (* (-> obj accel) (-> *display* time-adjust-ratio))) + ) + (.lvf vf1 (&-> a0-4 quad)) + (let ((a0-5 f0-1)) + (.mov vf2 a0-5) + ) + ) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-3 quad) vf1) + ) + (let ((a1-4 (-> obj vel))) + (let ((v1-4 (-> obj vel)) + (a0-6 s5-0) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> v1-4 quad)) + (.lvf vf5 (&-> a0-6 quad)) + ) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> a1-4 quad) vf6) + ) + (let ((f0-2 (vector-length (-> obj vel)))) + (if (< (-> obj max-vel) f0-2) + (let ((v1-6 (-> obj vel))) + (let ((a0-8 (-> obj vel)) + (f0-3 (/ (-> obj max-vel) f0-2)) + ) + (.lvf vf1 (&-> a0-8 quad)) + (let ((a0-9 f0-3)) + (.mov vf2 a0-9) + ) + ) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-6 quad) vf1) + ) + ) + ) + (let ((v1-7 (-> obj vel))) + (let ((a0-10 (-> obj vel)) + (f0-4 (-> obj damping)) + ) + (.lvf vf1 (&-> a0-10 quad)) + (let ((a0-11 f0-4)) + (.mov vf2 a0-11) + ) + ) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-7 quad) vf1) + ) + (let ((v1-8 s5-0)) + (let ((a0-12 (-> obj vel)) + (f0-5 (-> *display* time-adjust-ratio)) + ) + (.lvf vf1 (&-> a0-12 quad)) + (let ((a0-13 f0-5)) + (.mov vf2 a0-13) + ) + ) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-8 quad) vf1) + ) + (let ((a0-14 (-> obj value))) + (let ((v1-9 (-> obj value))) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> v1-9 quad)) + ) + (.lvf vf5 (&-> s5-0 quad)) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> a0-14 quad) vf6) + ) + ) + (-> obj value) + ) + ) + +;; failed to figure out what this is: +(none) + + + + diff --git a/test/offline/offline_test_main.cpp b/test/offline/offline_test_main.cpp index 0504b06a6f..1ef718f762 100644 --- a/test/offline/offline_test_main.cpp +++ b/test/offline/offline_test_main.cpp @@ -16,7 +16,9 @@ const std::unordered_set g_object_files_to_decompile = { "bounding-box-h", "matrix-h", "quaternion-h", "euler-h", "transform-h", "geometry-h", "trigonometry-h", /* transformq-h */ "matrix", "transform", "quaternion", /* gap */ - "bounding-box"}; + "bounding-box", + /* gap */ + "sync-info-h", "sync-info"}; // the object files to check against a reference in test/decompiler/reference const std::vector g_object_files_to_check_against_reference = { @@ -26,7 +28,10 @@ const std::vector g_object_files_to_check_against_reference = { "geometry-h", "trigonometry-h", /* transformq-h, */ "matrix", "transform", "quaternion", - /* gap */ "bounding-box"}; + /* gap */ + "bounding-box", + /* gap */ + "sync-info-h", "sync-info"}; // the functions we expect the decompiler to skip const std::unordered_set expected_skip_in_decompiler = { @@ -56,8 +61,11 @@ const std::unordered_set expected_skip_in_decompiler = { "(method 14 bounding-box)", // handwritten asm loop // matrix "(method 9 matrix)", // handwritten asm loop - "matrix-axis-sin-cos!", - "matrix-axis-sin-cos-vu!", + "matrix-axis-sin-cos!", "matrix-axis-sin-cos-vu!", + // sync-info + "(method 15 sync-info)", // needs *res-static-buf* + "(method 15 sync-info-eased)", // needs *res-static-buf* + "(method 15 sync-info-paused)", // needs *res-static-buf* }; const std::unordered_set skip_in_compiling = { @@ -98,6 +106,11 @@ const std::unordered_set skip_in_compiling = { "matrix-with-scale->quaternion", // fpu acc "quaternion-delta-y", // fpu acc + // sync-info + "(method 15 sync-info)", // needs display stuff first + "(method 15 sync-info-eased)", // needs display stuff first + "(method 15 sync-info-paused)", // needs display stuff first + }; // default location for the data. It can be changed with a command line argument. @@ -412,4 +425,4 @@ TEST_F(OfflineDecompilation, Compile) { auto time = timer.getSeconds(); lg::info("Total Lines Compiled: {}. Lines/second: {:.1f}\n", total_lines, (float)total_lines / time); -} \ No newline at end of file +}