diff --git a/Taskfile.yml b/Taskfile.yml index e901aee857..348698604c 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -9,10 +9,10 @@ tasks: - ./out/build/Debug/bin/gk.exe -fakeiso -debug -nodisplay repl: cmds: - - ./out/build/Debug/bin/goalc.exe -auto-lt + - ./out/build/Release/bin/goalc.exe -auto-lt decomp: cmds: - - ./out/build/Debug/bin/decompiler.exe "./decompiler/config/jak1_ntsc_black_label.jsonc" "./iso_data/jak1" "./decompiler_out/jak1" + - ./out/build/Release/bin/decompiler.exe "./decompiler/config/jak1_ntsc_black_label.jsonc" "./iso_data/jak1" "./decompiler_out/jak1" decomp-clean: cmds: - rm ./decompiler_out/**/*.asm @@ -49,7 +49,7 @@ tasks: SAVESTATE_DIR: '{{default "." .SAVESTATE_DIR}}' offline-tests: cmds: - - ./out/build/Debug/bin/offline-test.exe "./iso_data/jak1" + - ./out/build/Release/bin/offline-test.exe "./iso_data/jak1" update-reference-tests: cmds: - ./out/build/Debug/bin/offline-test.exe "./iso_data/jak1" --dump-mode diff --git a/decompiler/config/all-types.gc b/decompiler/config/all-types.gc index 303a58b551..cfe648281e 100644 --- a/decompiler/config/all-types.gc +++ b/decompiler/config/all-types.gc @@ -9035,49 +9035,45 @@ ; :flag-assert #x900000024 ; ) -; ;; generic-obs-h -; (deftype manipy (process-drawable) -; ((~Tnew-trans-hook basic :offset-assert 176) -; (~Tcur-trans-hook basic :offset-assert 180) -; (~Tcur-event-hook basic :offset-assert 184) -; (~Tnew-joint-anim basic :offset-assert 188) -; (~Tnew-joint-anim-blend uint64 :offset-assert 192) -; (~Tanim-mode basic :offset-assert 200) -; (~Tcur-grab-handle uint64 :offset-assert 208) -; (~Tcur-target-handle uint64 :offset-assert 216) -; (~Told-grab-pos vector :inline :offset-assert 224) -; (~Tjoint UNKNOWN 4 :offset-assert 240) -; (~Tnew-post-hook basic :offset-assert 256) -; (~Tcur-post-hook basic :offset-assert 260) -; (~Tclone-copy-trans basic :offset-assert 264) -; (~Tshadow-backup basic :offset-assert 268) -; (~Tdraw? basic :offset-assert 272) -; ) -; :method-count-assert 20 -; :size-assert #x114 -; :flag-assert #x1400b00114 -; ;; inherited inspect of process-drawable -; (: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-18 () none 18) -; (dummy-19 () none 19) -; ) -; ) +;; generic-obs-h +(deftype manipy (process-drawable) + ((new-trans-hook basic :offset-assert 176) + (cur-trans-hook basic :offset-assert 180) + (cur-event-hook basic :offset-assert 184) + (new-joint-anim basic :offset-assert 188) + (new-joint-anim-blend uint64 :offset-assert 192) + (anim-mode basic :offset-assert 200) + (cur-grab-handle uint64 :offset-assert 208) + (cur-target-handle uint64 :offset-assert 216) + (old-grab-pos vector :inline :offset-assert 224) + (joint joint 4 :offset-assert 240) + (new-post-hook basic :offset-assert 256) + (cur-post-hook basic :offset-assert 260) + (clone-copy-trans basic :offset-assert 264) + (shadow-backup basic :offset-assert 268) + (draw? basic :offset-assert 272) + ) + :heap-base #xb0 + :method-count-assert 20 + :size-assert #x114 + :flag-assert #x1400b00114 + ;; inherited inspect of process-drawable + (:methods + (dummy-14 () none 14) + (dummy-15 () none 15) + (dummy-16 () none 16) + (dummy-17 () none 17) + (dummy-18 () none 18) + (dummy-19 () none 19) + ) + ) ;; generic-obs-h (deftype part-spawner (process-drawable) - ((~Tmode uint32 :offset-assert 176) - (~Tenable basic :offset-assert 180) - (~Tradius float :offset-assert 184) ; meters - (~Tworld-sphere sphere :inline :offset-assert 192) + ((mode uint32 :offset-assert 176) + (enable basic :offset-assert 180) + (radius float :offset-assert 184) ; meters + (world-sphere sphere :inline :offset-assert 192) ) :heap-base #x60 :method-count-assert 21 @@ -9089,21 +9085,16 @@ ) ) -; ;; generic-obs-h -; (deftype part-tracker (process) -; () -; :method-count-assert 14 -; :size-assert #xf8 -; :flag-assert #xe009000f8 -; ;; inherited inspect of process -; (:methods -; (dummy-9 () none 9) -; (dummy-10 () none 10) -; (dummy-11 () none 11) -; (dummy-12 () none 12) -; (dummy-13 () none 13) -; ) -; ) +;; generic-obs-h +;; (deftype part-tracker (process) +;; () +;; :method-count-assert 14 +;; :size-assert #xf8 +;; :flag-assert #xe009000f8 +;; ;; inherited inspect of process +;; (:methods +;; ) +;; ) ;; generic-obs-h (deftype camera-tracker (process) @@ -9191,17 +9182,17 @@ ;; generic-obs-h (deftype othercam (process) - ((~Thand uint64 :offset-assert 112) - (~Told-global-mask uint32 :offset-assert 120) - (~Tmask-to-clear uint32 :offset-assert 124) - (~Tcam-joint-index int32 :offset-assert 128) - (~Told-pos vector :inline :offset-assert 144) - (~Told-mat-z vector :inline :offset-assert 160) - (~Thad-valid-frame basic :offset-assert 176) - (~Tborder-value basic :offset-assert 180) - (~Tdie? basic :offset-assert 184) - (~Tsurvive-anim-end? basic :offset-assert 188) - (~Tspooling? basic :offset-assert 192) + ((hand uint64 :offset-assert 112) + (old-global-mask uint32 :offset-assert 120) + (mask-to-clear uint32 :offset-assert 124) + (cam-joint-index int32 :offset-assert 128) + (old-pos vector :inline :offset-assert 144) + (old-mat-z vector :inline :offset-assert 160) + (had-valid-frame basic :offset-assert 176) + (border-value basic :offset-assert 180) + (die? basic :offset-assert 184) + (survive-anim-end? basic :offset-assert 188) + (spooling? basic :offset-assert 192) ) :heap-base #x60 :method-count-assert 14 @@ -10387,28 +10378,28 @@ ;; projectiles-h (deftype projectile (process-drawable) - ((~Tbase-trans vector :inline :offset-assert 176) - (~Ttarget vector :inline :offset-assert 192) - (~Ttarget-base vector :inline :offset-assert 208) - (~Tparent-base vector :inline :offset-assert 224) - (~Tparent-quat vector :inline :offset-assert 240) - (~Tbase-vector vector :inline :offset-assert 256) - (~Ttimeout uint64 :offset-assert 272) - (~Toptions uint64 :offset-assert 280) - (~Tlast-target uint64 :offset-assert 288) - (~Tnotify-handle uint64 :offset-assert 296) - (~Tmax-speed float :offset-assert 304) - (~Tmax-turn float :offset-assert 308) - (~Told-dist float 16 :offset-assert 312) - (~Told-dist-count int32 :offset-assert 376) - (~Thits int32 :offset-assert 380) - (~Tmax-hits int32 :offset-assert 384) - (~Ttween float :offset-assert 388) - (~Tattack-mode basic :offset-assert 392) - (~Tupdate-velocity basic :offset-assert 396) - (~Tcounter int32 :offset-assert 400) - (~Ttarget-count int32 :offset-assert 404) - (~Tsound-id uint32 :offset-assert 408) + ((base-trans vector :inline :offset-assert 176) + (target vector :inline :offset-assert 192) + (target-base vector :inline :offset-assert 208) + (parent-base vector :inline :offset-assert 224) + (parent-quat vector :inline :offset-assert 240) + (base-vector vector :inline :offset-assert 256) + (timeout uint64 :offset-assert 272) + (options uint64 :offset-assert 280) + (last-target uint64 :offset-assert 288) + (notify-handle uint64 :offset-assert 296) + (max-speed float :offset-assert 304) + (max-turn float :offset-assert 308) + (old-dist float 16 :offset-assert 312) + (old-dist-count int32 :offset-assert 376) + (hits int32 :offset-assert 380) + (max-hits int32 :offset-assert 384) + (tween float :offset-assert 388) + (attack-mode basic :offset-assert 392) + (update-velocity basic :offset-assert 396) + (counter int32 :offset-assert 400) + (target-count int32 :offset-assert 404) + (sound-id uint32 :offset-assert 408) ) :heap-base #x130 :method-count-assert 29 @@ -10430,48 +10421,36 @@ ;; projectiles-h (deftype projectile-yellow (projectile) - ((~Tmode int32 :offset-assert 412) - (~Tangle float :offset-assert 416) + ((mode int32 :offset-assert 412) + (angle float :offset-assert 416) ) :heap-base #x140 :method-count-assert 29 :size-assert #x1a4 :flag-assert #x1d014001a4 - ;; inherited inspect of projectile ) -; ;; projectiles-h -; (deftype projectile-blue (projectile) -; ((~Tmode int32 :offset-assert 412) -; (~Tjoint-num int32 :offset-assert 416) -; ) -; :method-count-assert 29 -; :size-assert #x1a4 -; :flag-assert #x1d014001a4 -; ;; inherited inspect of projectile -; (: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-18 () none 18) -; (dummy-19 () none 19) -; (dummy-20 () none 20) -; (dummy-21 () none 21) -; (dummy-22 () none 22) -; (dummy-23 () none 23) -; (dummy-24 () none 24) -; (dummy-25 () none 25) -; (dummy-26 () none 26) -; (dummy-27 () none 27) -; (dummy-28 () none 28) -; ) -; ) +;; projectiles-h +(deftype projectile-blue (projectile) + ((mode int32 :offset-assert 412) + (joint-num int32 :offset-assert 416) + ) + :heap-base #x140 + :method-count-assert 29 + :size-assert #x1a4 + :flag-assert #x1d014001a4 + (:methods + (dummy-20 () none 20) + (dummy-21 () none 21) + (dummy-22 () none 22) + (dummy-23 () none 23) + (dummy-24 () none 24) + (dummy-25 () none 25) + (dummy-26 () none 26) + (dummy-27 () none 27) + (dummy-28 () none 28) + ) + ) ;; target-h (deftype target (process-drawable) @@ -12013,17 +11992,17 @@ :flag-assert #x900000430 ) -; ;; eye-h -; (deftype eye-work (structure) -; ((sprite-tmpl dma-gif-packet :inline :offset-assert 0) -; (sprite-tmpl2 dma-gif-packet :inline :offset-assert 32) -; (adgif-tmpl dma-gif-packet :inline :offset-assert 64) -; (blink-table UNKNOWN 10 :offset-assert 96) -; ) -; :method-count-assert 9 -; :size-assert #x88 -; :flag-assert #x900000088 -; ) +;; eye-h +(deftype eye-work (structure) + ((sprite-tmpl dma-gif-packet :inline :offset-assert 0) + (sprite-tmpl2 dma-gif-packet :inline :offset-assert 32) + (adgif-tmpl dma-gif-packet :inline :offset-assert 64) + (blink-table float 10 :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x88 + :flag-assert #x900000088 + ) ;; sparticle-launcher-h (deftype sp-field-init-spec (structure) @@ -14122,31 +14101,31 @@ ;; task-control-h (deftype process-taskable (process-drawable) - ((~Ttasks basic :offset-assert 176) - (~Tquery gui-query :inline :offset-assert 180) - (~Told-target-pos transformq :inline :offset-assert 208) - (~Tcell-for-task uint8 :offset-assert 256) - (~Tcell-x uint64 :offset-assert 264) - (~Tcam-joint-index int32 :offset-assert 272) - (~Tskippable basic :offset-assert 276) - (~Tblend-on-exit basic :offset-assert 280) - (~Tcamera uint64 :offset-assert 288) - (~Twill-talk basic :offset-assert 296) - (~Ttalk-message uint32 :offset-assert 300) - (~Tlast-talk uint64 :offset-assert 304) - (~Tbounce-away basic :offset-assert 312) - (~Tambient ambient-control :inline :offset-assert 320) - (~Tcenter-joint-index int32 :offset-assert 336) - (~Tdraw-bounds-y-offset float :offset-assert 340) - (~Tneck-joint-index int32 :offset-assert 344) - (~Tfuel-cell-anim basic :offset-assert 348) - (~Tsound-flava uint8 :offset-assert 352) - (~Thave-flava basic :offset-assert 356) - (~Tmusic basic :offset-assert 360) - (~Thave-music basic :offset-assert 364) - (~Tbeen-kicked basic :offset-assert 368) - (~Tcur-trans-hook basic :offset-assert 372) - (~Tshadow-backup basic :offset-assert 376) + ((tasks basic :offset-assert 176) + (query gui-query :inline :offset-assert 180) + (old-target-pos transformq :inline :offset-assert 208) + (cell-for-task uint8 :offset-assert 256) + (cell-x uint64 :offset-assert 264) + (cam-joint-index int32 :offset-assert 272) + (skippable basic :offset-assert 276) + (blend-on-exit basic :offset-assert 280) + (camera uint64 :offset-assert 288) + (will-talk basic :offset-assert 296) + (talk-message uint32 :offset-assert 300) + (last-talk uint64 :offset-assert 304) + (bounce-away basic :offset-assert 312) + (ambient ambient-control :inline :offset-assert 320) + (center-joint-index int32 :offset-assert 336) + (draw-bounds-y-offset float :offset-assert 340) + (neck-joint-index int32 :offset-assert 344) + (fuel-cell-anim basic :offset-assert 348) + (sound-flava uint8 :offset-assert 352) + (have-flava basic :offset-assert 356) + (music basic :offset-assert 360) + (have-music basic :offset-assert 364) + (been-kicked basic :offset-assert 368) + (cur-trans-hook basic :offset-assert 372) + (shadow-backup basic :offset-assert 376) ) :heap-base #x110 :method-count-assert 53 @@ -14722,67 +14701,68 @@ :flag-assert #x900000010 ) -; ;; water-h -; (deftype water-control (basic) -; ((flags uint32 :offset-assert 4) -; (process basic :offset-assert 8) -; (joint-index int32 :offset-assert 12) -; (top-y-offset float :offset-assert 16) -; (ripple-size meters :offset-assert 20) -; (enter-water-time uint64 :offset-assert 24) -; (wade-time uint64 :offset-assert 32) -; (on-water-time uint64 :offset-assert 40) -; (enter-swim-time uint64 :offset-assert 48) -; (swim-time uint64 :offset-assert 56) -; (base-height meters :offset-assert 64) -; (wade-height meters :offset-assert 68) -; (swim-height meters :offset-assert 72) -; (surface-height meters :offset-assert 76) -; (bottom-height meters :offset-assert 80) -; (height meters :offset-assert 84) -; (height-offset UNKNOWN 4 :offset-assert 88) -; (real-ocean-offset meters :offset-assert 88) -; (ocean-offset meters :offset-assert 92) -; (bob-offset meters :offset-assert 96) -; (align-offset meters :offset-assert 100) -; (swim-depth meters :offset-assert 104) -; (bob smush-control :inline :offset-assert 112) -; (volume uint64 :offset-assert 144) -; (bottom UNKNOWN 2 :offset-assert 160) -; (top UNKNOWN 2 :offset-assert 192) -; (enter-water-pos vector :inline :offset-assert 224) -; (drip-old-pos vector :inline :offset-assert 240) -; (drip-joint-index int32 :offset-assert 256) -; (drip-wetness float :offset-assert 260) -; (drip-time uint64 :offset-assert 264) -; (drip-speed float :offset-assert 272) -; (drip-height meters :offset-assert 276) -; (drip-mult float :offset-assert 280) -; ) -; :method-count-assert 17 -; :size-assert #x11c -; :flag-assert #x110000011c -; (: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) -; ) -; ) +;; water-h +(deftype water-control (basic) + ((flags uint32 :offset-assert 4) + (process basic :offset-assert 8) + (joint-index int32 :offset-assert 12) + (top-y-offset float :offset-assert 16) + (ripple-size float :offset-assert 20) ; meters + (enter-water-time uint64 :offset-assert 24) + (wade-time uint64 :offset-assert 32) + (on-water-time uint64 :offset-assert 40) + (enter-swim-time uint64 :offset-assert 48) + (swim-time uint64 :offset-assert 56) + (base-height float :offset-assert 64) ; meters + (wade-height float :offset-assert 68) ; meters + (swim-height float :offset-assert 72) ; meters + (surface-height float :offset-assert 76) ; meters + (bottom-height float :offset-assert 80) ; meters + (height float :offset-assert 84) ; meters + (height-offset float 4 :offset-assert 88) + (real-ocean-offset float :offset 88) ; meters + (ocean-offset float :offset 92) ; meters + (bob-offset float :offset 96) ; meters + (align-offset float :offset 100) ; meters + (swim-depth float :offset-assert 104) ; meters + (bob smush-control :inline :offset-assert 112) + (volume uint64 :offset-assert 144) + (bottom vector 2 :inline :offset-assert 160) + (top vector 2 :inline :offset-assert 192) + (enter-water-pos vector :inline :offset-assert 224) + (drip-old-pos vector :inline :offset-assert 240) + (drip-joint-index int32 :offset-assert 256) + (drip-wetness float :offset-assert 260) + (drip-time uint64 :offset-assert 264) + (drip-speed float :offset-assert 272) + (drip-height float :offset-assert 276) ; meters + (drip-mult float :offset-assert 280) + ) + :method-count-assert 17 + :size-assert #x11c + :flag-assert #x110000011c + (:methods + (new (symbol type process int float float float) _type_ 0) + (dummy-9 () none 9) + (dummy-10 () none 10) + (dummy-11 () none 11) + (distance-from-surface (_type_) float 12) + (dummy-13 () none 13) + (display-water-marks? (_type_) symbol 14) + (dummy-15 () none 15) + (dummy-16 () none 16) + ) + ) ;; water-h (deftype water-vol (process-drawable) - ((~Twater-height float :offset-assert 176) ;; meters - (~Twade-height float :offset-assert 180) ;; meters - (~Tswim-height float :offset-assert 184) ;; meters - (~Tbottom-height float :offset-assert 188) ;; meters - (~Tattack-event basic :offset-assert 192) - (~Ttarget uint64 :offset-assert 200) - (~Tflags uint32 :offset-assert 208) + ((water-height float :offset-assert 176) ;; meters + (wade-height float :offset-assert 180) ;; meters + (swim-height float :offset-assert 184) ;; meters + (bottom-height float :offset-assert 188) ;; meters + (attack-event basic :offset-assert 192) + (target uint64 :offset-assert 200) + (flags uint32 :offset-assert 208) ) :heap-base #x70 :method-count-assert 30 @@ -33730,8 +33710,8 @@ ;;(define-extern part-tracker object) ;; unknown type ;;(define-extern trajectory object) ;; unknown type (define-extern joint-mod-set-local-callback function) -(define-extern joint-mod-blend-local-callback function) -(define-extern joint-mod-look-at-handler function) +(define-extern joint-mod-blend-local-callback (function joint-mod-blend-local vector none)) ;; first arg is something WITh a joint-mod, no idea yet! +(define-extern joint-mod-look-at-handler (function cspace none)) ;; TODO (define-extern joint-mod-set-world-callback function) ;;(define-extern last-try-to-look-at-data object) ;; unknown type ;;(define-extern *joint-axis-vectors* object) ;; unknown type @@ -33874,7 +33854,7 @@ ;;(define-extern sprite-vec-data-3d object) ;; unknown type ;;(define-extern sprite-vec-data-2d object) ;; unknown type (define-extern eye-control-array type) -;;(define-extern *eye-control-array* object) ;; unknown type +(define-extern *eye-control-array* eye-control-array) ;; unknown type ;;(define-extern eye-work object) ;; unknown type (define-extern sparticle-launcher type) (define-extern sparticle-launch-group type) @@ -34832,12 +34812,12 @@ (define-extern update-sky-tng-data function) ;;(define-extern sky-base-polygons object) ;; unknown type (define-extern make-sky-textures function) -(define-extern sky-set-orbit function) -(define-extern sky-set-sun-colors-sun function) -(define-extern sky-set-sun-colors-halo function) -(define-extern sky-set-sun-radii function) -(define-extern sky-set-sun-colors function) -(define-extern sky-set-sun-colors-aurora function) +(define-extern sky-set-orbit (function sky-parms int float float float float float float symbol)) +(define-extern sky-set-sun-colors-sun (function sky-parms int uint uint symbol)) +(define-extern sky-set-sun-colors-halo (function sky-parms int uint uint symbol)) +(define-extern sky-set-sun-radii (function sky-parms int float float float symbol)) +(define-extern sky-set-sun-colors (function sky-parms int uint uint uint uint symbol)) +(define-extern sky-set-sun-colors-aurora (function sky-parms int uint uint symbol)) (define-extern sky-make-sun-data function) ;;(define-extern sky-frame-data object) ;; unknown type ;;(define-extern sky-vu1-block object) ;; unknown type diff --git a/decompiler/config/jak1_ntsc_black_label/label_types.jsonc b/decompiler/config/jak1_ntsc_black_label/label_types.jsonc index 740a35e1f7..76d59250ff 100644 --- a/decompiler/config/jak1_ntsc_black_label/label_types.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/label_types.jsonc @@ -449,5 +449,17 @@ "ripple": [ ["L73", "float", true], ["L74", "uint64", true] + ], + + "eye-h": [ + ["L2", "eye-control-array", true] + ], + + "eye": [ + ["L36", "eye-work", true] + ], + + "smush-control-h": [ + ["L20", "float", true] ] } diff --git a/goal_src/engine/game/generic-obs-h.gc b/goal_src/engine/game/generic-obs-h.gc index f66ac56c59..a20752d519 100644 --- a/goal_src/engine/game/generic-obs-h.gc +++ b/goal_src/engine/game/generic-obs-h.gc @@ -5,3 +5,22 @@ ;; name in dgo: generic-obs-h ;; dgos: GAME, ENGINE +;; TODO - for task-control-h +(deftype gui-query (structure) + ((x-position int32 :offset-assert 0) + (y-position int32 :offset-assert 4) + (message basic :offset-assert 8) + (decision basic :offset-assert 12) + (only-allow-cancel basic :offset-assert 16) + (no-msg basic :offset-assert 20) + (message-space int32 :offset-assert 24) + ) + :pack-me + :method-count-assert 11 + :size-assert #x1c + :flag-assert #xb0000001c + (:methods + (dummy-9 () none 9) + (dummy-10 () none 10) + ) + ) diff --git a/goal_src/engine/game/projectiles-h.gc b/goal_src/engine/game/projectiles-h.gc index fbc119857e..52de9b8955 100644 --- a/goal_src/engine/game/projectiles-h.gc +++ b/goal_src/engine/game/projectiles-h.gc @@ -5,3 +5,66 @@ ;; name in dgo: projectiles-h ;; dgos: GAME, ENGINE +;; definition of type projectile +(deftype projectile (process-drawable) + ((base-trans vector :inline :offset-assert 176) + (target vector :inline :offset-assert 192) + (target-base vector :inline :offset-assert 208) + (parent-base vector :inline :offset-assert 224) + (parent-quat vector :inline :offset-assert 240) + (base-vector vector :inline :offset-assert 256) + (timeout uint64 :offset-assert 272) + (options uint64 :offset-assert 280) + (last-target uint64 :offset-assert 288) + (notify-handle uint64 :offset-assert 296) + (max-speed float :offset-assert 304) + (max-turn float :offset-assert 308) + (old-dist float 16 :offset-assert 312) + (old-dist-count int32 :offset-assert 376) + (hits int32 :offset-assert 380) + (max-hits int32 :offset-assert 384) + (tween float :offset-assert 388) + (attack-mode basic :offset-assert 392) + (update-velocity basic :offset-assert 396) + (counter int32 :offset-assert 400) + (target-count int32 :offset-assert 404) + (sound-id uint32 :offset-assert 408) + ) + :heap-base #x130 + :method-count-assert 29 + :size-assert #x19c + :flag-assert #x1d0130019c + (:methods + (dummy-20 () none 20) + (dummy-21 () none 21) + (dummy-22 () none 22) + (dummy-23 () none 23) + (dummy-24 () none 24) + (dummy-25 () none 25) + (dummy-26 () none 26) + (dummy-27 () none 27) + (dummy-28 () none 28) + ) + ) + +;; definition of type projectile-yellow +(deftype projectile-yellow (projectile) + ((mode int32 :offset-assert 412) + (angle float :offset-assert 416) + ) + :heap-base #x140 + :method-count-assert 29 + :size-assert #x1a4 + :flag-assert #x1d014001a4 + ) + +;; definition of type projectile-blue +(deftype projectile-blue (projectile) + ((mode int32 :offset-assert 412) + (joint-num int32 :offset-assert 416) + ) + :heap-base #x140 + :method-count-assert 29 + :size-assert #x1a4 + :flag-assert #x1d014001a4 + ) diff --git a/goal_src/engine/game/task/task-control-h.gc b/goal_src/engine/game/task/task-control-h.gc index 6b40f67fb0..a2289d91a5 100644 --- a/goal_src/engine/game/task/task-control-h.gc +++ b/goal_src/engine/game/task/task-control-h.gc @@ -5,3 +5,130 @@ ;; name in dgo: task-control-h ;; dgos: GAME, ENGINE +;; definition of type task-cstage +(deftype task-cstage (structure) + ((game-task uint8 :offset-assert 0) + (status uint64 :offset-assert 8) + (flags uint8 :offset-assert 16) + (condition basic :offset-assert 20) + ) + :method-count-assert 16 + :size-assert #x18 + :flag-assert #x1000000018 + (: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) + ) + ) + +;; definition of type task-control +(deftype task-control (basic) + ((current-stage int16 :offset-assert 4) + (stage basic :offset-assert 8) + ) + :method-count-assert 19 + :size-assert #xc + :flag-assert #x130000000c + (: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-18 () none 18) + ) + ) + +;; definition of type ambient-control +(deftype ambient-control (structure) + ((last-ambient-time uint64 :offset-assert 0) + (last-ambient basic :offset-assert 8) + (last-ambient-id uint32 :offset-assert 12) + ) + :method-count-assert 12 + :size-assert #x10 + :flag-assert #xc00000010 + (:methods + (dummy-9 () none 9) + (dummy-10 () none 10) + (dummy-11 () none 11) + ) + ) + +;; definition of type process-taskable +(deftype process-taskable (process-drawable) + ((tasks basic :offset-assert 176) + (query gui-query :inline :offset-assert 180) + (old-target-pos transformq :inline :offset-assert 208) + (cell-for-task uint8 :offset-assert 256) + (cell-x uint64 :offset-assert 264) + (cam-joint-index int32 :offset-assert 272) + (skippable basic :offset-assert 276) + (blend-on-exit basic :offset-assert 280) + (camera uint64 :offset-assert 288) + (will-talk basic :offset-assert 296) + (talk-message uint32 :offset-assert 300) + (last-talk uint64 :offset-assert 304) + (bounce-away basic :offset-assert 312) + (ambient ambient-control :inline :offset-assert 320) + (center-joint-index int32 :offset-assert 336) + (draw-bounds-y-offset float :offset-assert 340) + (neck-joint-index int32 :offset-assert 344) + (fuel-cell-anim basic :offset-assert 348) + (sound-flava uint8 :offset-assert 352) + (have-flava basic :offset-assert 356) + (music basic :offset-assert 360) + (have-music basic :offset-assert 364) + (been-kicked basic :offset-assert 368) + (cur-trans-hook basic :offset-assert 372) + (shadow-backup basic :offset-assert 376) + ) + :heap-base #x110 + :method-count-assert 53 + :size-assert #x17c + :flag-assert #x350110017c + (:methods + (dummy-20 () none 20) + (dummy-21 () none 21) + (dummy-22 () none 22) + (dummy-23 () none 23) + (dummy-24 () none 24) + (dummy-25 () none 25) + (dummy-26 () none 26) + (dummy-27 () none 27) + (dummy-28 () none 28) + (dummy-29 () none 29) + (dummy-30 () none 30) + (dummy-31 () none 31) + (dummy-32 () none 32) + (dummy-33 () none 33) + (dummy-34 () none 34) + (dummy-35 () none 35) + (dummy-36 () none 36) + (dummy-37 () none 37) + (dummy-38 () none 38) + (dummy-39 () none 39) + (dummy-40 () none 40) + (dummy-41 () none 41) + (dummy-42 () none 42) + (dummy-43 () none 43) + (dummy-44 () none 44) + (dummy-45 () none 45) + (dummy-46 () none 46) + (dummy-47 () none 47) + (dummy-48 () none 48) + (dummy-49 () none 49) + (dummy-50 () none 50) + (dummy-51 () none 51) + (dummy-52 () none 52) + ) + ) diff --git a/goal_src/engine/gfx/eye-h.gc b/goal_src/engine/gfx/eye-h.gc index 1c6611c7e3..db04ac9ac6 100644 --- a/goal_src/engine/gfx/eye-h.gc +++ b/goal_src/engine/gfx/eye-h.gc @@ -5,3 +5,64 @@ ;; name in dgo: eye-h ;; dgos: GAME, ENGINE +;; definition of type eye +(deftype eye (structure) + ((data uint128 2 :offset-assert 0) + (x float :offset 0) + (y float :offset 4) + (lid float :offset 8) + (iris-scale float :offset 16) + (pupil-scale float :offset 20) + (lid-scale float :offset 24) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition of type eye-control +(deftype eye-control (structure) + ((process uint64 :offset-assert 0) + (random-time uint16 :offset-assert 8) + (level uint16 :offset-assert 10) + (blink float :offset-assert 12) + (shaders uint32 :offset-assert 16) + (left eye :inline :offset-assert 32) + (right eye :inline :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x60 + :flag-assert #x900000060 + ) + +;; definition of type eye-control-array +(deftype eye-control-array (basic) + ((data eye-control 11 :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x430 + :flag-assert #x900000430 + ) + +;; definition of type eye-work +(deftype eye-work (structure) + ((sprite-tmpl dma-gif-packet :inline :offset-assert 0) + (sprite-tmpl2 dma-gif-packet :inline :offset-assert 32) + (adgif-tmpl dma-gif-packet :inline :offset-assert 64) + (blink-table float 10 :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x88 + :flag-assert #x900000088 + ) + +;; definition for symbol *eye-control-array*, type eye-control-array +(define *eye-control-array* (new 'static 'eye-control-array)) + +;; failed to figure out what this is: +(dotimes (v1-5 11) + (set! (-> *eye-control-array* data v1-5 process) (the-as uint #f)) + (set! (-> *eye-control-array* data v1-5 shaders) (the-as uint #f)) + (set! (-> *eye-control-array* data v1-5 random-time) (the-as uint 60)) + (set! (-> *eye-control-array* data v1-5 blink) 0.0) + ) diff --git a/goal_src/engine/gfx/sky/sky-utils.gc b/goal_src/engine/gfx/sky/sky-utils.gc index 9ee3ed4298..f00774db7f 100644 --- a/goal_src/engine/gfx/sky/sky-utils.gc +++ b/goal_src/engine/gfx/sky/sky-utils.gc @@ -5,3 +5,83 @@ ;; name in dgo: sky-utils ;; dgos: GAME, ENGINE +;; definition for function sky-set-sun-radii +(defun + sky-set-sun-radii + ((arg0 sky-parms) (arg1 int) (arg2 float) (arg3 float) (arg4 float)) + (let ((v1-0 (logand arg1 1))) + (set! (-> arg0 upload-data sun v1-0 r-sun) arg2) + (set! (-> arg0 upload-data sun v1-0 r-halo) arg3) + (set! (-> arg0 upload-data sun v1-0 r-aurora) arg4) + ) + #f + ) + +;; definition for function sky-set-sun-colors +(defun + sky-set-sun-colors + ((arg0 sky-parms) (arg1 int) (arg2 uint) (arg3 uint) (arg4 uint) (arg5 uint)) + (let ((v1-0 (logand arg1 1))) + (set! (-> arg0 upload-data sun v1-0 c-sun-start) arg2) + (set! (-> arg0 upload-data sun v1-0 c-sun-end) arg3) + (set! (-> arg0 upload-data sun v1-0 c-halo-start) arg3) + (set! (-> arg0 upload-data sun v1-0 c-halo-end) arg4) + (set! (-> arg0 upload-data sun v1-0 c-aurora-start) arg4) + (set! (-> arg0 upload-data sun v1-0 c-aurora-end) arg5) + ) + #f + ) + +;; definition for function sky-set-sun-colors-sun +(defun + sky-set-sun-colors-sun + ((arg0 sky-parms) (arg1 int) (arg2 uint) (arg3 uint)) + (let ((v1-0 (logand arg1 1))) + (set! (-> arg0 upload-data sun v1-0 c-sun-start) arg2) + (set! (-> arg0 upload-data sun v1-0 c-sun-end) arg3) + ) + #f + ) + +;; definition for function sky-set-sun-colors-halo +(defun + sky-set-sun-colors-halo + ((arg0 sky-parms) (arg1 int) (arg2 uint) (arg3 uint)) + (let ((v1-0 (logand arg1 1))) + (set! (-> arg0 upload-data sun v1-0 c-halo-start) arg2) + (set! (-> arg0 upload-data sun v1-0 c-halo-end) arg3) + ) + #f + ) + +;; definition for function sky-set-sun-colors-aurora +(defun + sky-set-sun-colors-aurora + ((arg0 sky-parms) (arg1 int) (arg2 uint) (arg3 uint)) + (let ((v1-0 (logand arg1 1))) + (set! (-> arg0 upload-data sun v1-0 c-aurora-start) arg2) + (set! (-> arg0 upload-data sun v1-0 c-aurora-end) arg3) + ) + #f + ) + +;; definition for function sky-set-orbit +(defun + sky-set-orbit + ((arg0 sky-parms) + (arg1 int) + (arg2 float) + (arg3 float) + (arg4 float) + (arg5 float) + (arg6 float) + (arg7 float) + ) + (set! (-> arg0 orbit arg1 high-noon) arg2) + (set! (-> arg0 orbit arg1 tilt) (* 0.017453292 arg3)) + (set! (-> arg0 orbit arg1 rise) (* 0.017453292 arg4)) + (set! (-> arg0 orbit arg1 dist) arg5) + (set! (-> arg0 orbit arg1 min-halo) arg6) + (set! (-> arg0 orbit arg1 max-halo) arg7) + #f + ) diff --git a/goal_src/engine/gfx/water/water-h.gc b/goal_src/engine/gfx/water/water-h.gc index fae3ca8aa5..ea447cbb31 100644 --- a/goal_src/engine/gfx/water/water-h.gc +++ b/goal_src/engine/gfx/water/water-h.gc @@ -5,3 +5,123 @@ ;; name in dgo: water-h ;; dgos: GAME, ENGINE +;; definition of type water-control +(deftype water-control (basic) + ((flags uint32 :offset-assert 4) + (process basic :offset-assert 8) + (joint-index int32 :offset-assert 12) + (top-y-offset float :offset-assert 16) + (ripple-size float :offset-assert 20) + (enter-water-time uint64 :offset-assert 24) + (wade-time uint64 :offset-assert 32) + (on-water-time uint64 :offset-assert 40) + (enter-swim-time uint64 :offset-assert 48) + (swim-time uint64 :offset-assert 56) + (base-height float :offset-assert 64) + (wade-height float :offset-assert 68) + (swim-height float :offset-assert 72) + (surface-height float :offset-assert 76) + (bottom-height float :offset-assert 80) + (height float :offset-assert 84) + (height-offset float 4 :offset-assert 88) + (real-ocean-offset float :offset 88) + (ocean-offset float :offset 92) + (bob-offset float :offset 96) + (align-offset float :offset 100) + (swim-depth float :offset-assert 104) + (bob smush-control :inline :offset-assert 112) + (volume uint64 :offset-assert 144) + (bottom vector 2 :inline :offset-assert 160) + (top vector 2 :inline :offset-assert 192) + (enter-water-pos vector :inline :offset-assert 224) + (drip-old-pos vector :inline :offset-assert 240) + (drip-joint-index int32 :offset-assert 256) + (drip-wetness float :offset-assert 260) + (drip-time uint64 :offset-assert 264) + (drip-speed float :offset-assert 272) + (drip-height float :offset-assert 276) + (drip-mult float :offset-assert 280) + ) + :method-count-assert 17 + :size-assert #x11c + :flag-assert #x110000011c + (:methods + (new (symbol type process int float float float) _type_ 0) + (dummy-9 () none 9) + (dummy-10 () none 10) + (dummy-11 () none 11) + (distance-from-surface (_type_) float 12) + (dummy-13 () none 13) + (display-water-marks? (_type_) symbol 14) + (dummy-15 () none 15) + (dummy-16 () none 16) + ) + ) + +;; definition for method 14 of type water-control +(defmethod display-water-marks? water-control ((obj water-control)) + (and *display-water-marks* (nonzero? (logand (-> obj flags) 1))) + ) + +;; definition for method 0 of type water-control +(defmethod + new + water-control + ((allocation symbol) + (type-to-make type) + (arg0 process) + (arg1 int) + (arg2 float) + (arg3 float) + (arg4 float) + ) + (let + ((v0-0 + (object-new allocation type-to-make (the-as int (-> type-to-make size))) + ) + ) + (set! (-> v0-0 process) arg0) + (set! (-> v0-0 joint-index) arg1) + (set! (-> v0-0 wade-height) arg4) + (set! (-> v0-0 swim-height) arg3) + (set! (-> v0-0 bottom-height) 32768.0) + (set! (-> v0-0 ripple-size) 1638.4) + (set! (-> v0-0 volume) (the-as uint #f)) + (set! (-> v0-0 drip-mult) 1.0) + (set! (-> v0-0 top-y-offset) arg2) + v0-0 + ) + ) + +;; definition for method 12 of type water-control +(defmethod distance-from-surface water-control ((obj water-control)) + (- (-> obj top 0 y) (-> obj height)) + ) + +;; definition of type water-vol +(deftype water-vol (process-drawable) + ((water-height float :offset-assert 176) + (wade-height float :offset-assert 180) + (swim-height float :offset-assert 184) + (bottom-height float :offset-assert 188) + (attack-event basic :offset-assert 192) + (target uint64 :offset-assert 200) + (flags uint32 :offset-assert 208) + ) + :heap-base #x70 + :method-count-assert 30 + :size-assert #xd4 + :flag-assert #x1e007000d4 + (:methods + (dummy-20 () none 20) + (dummy-21 () none 21) + (dummy-22 () none 22) + (dummy-23 () none 23) + (dummy-24 () none 24) + (dummy-25 () none 25) + (dummy-26 () none 26) + (dummy-27 () none 27) + (dummy-28 () none 28) + (dummy-29 () none 29) + ) + ) diff --git a/test/decompiler/reference/all_forward_declarations.gc b/test/decompiler/reference/all_forward_declarations.gc index 2768e92683..d3dc676a98 100644 --- a/test/decompiler/reference/all_forward_declarations.gc +++ b/test/decompiler/reference/all_forward_declarations.gc @@ -677,3 +677,23 @@ "Convert a symbol to a goal string." `(-> (the-as (pointer string) (+ SYM_TO_STRING_OFFSET (the-as int ,sym)))) ) + +;; TODO - from generic-obs-h +(deftype gui-query (structure) + ((x-position int32 :offset-assert 0) + (y-position int32 :offset-assert 4) + (message basic :offset-assert 8) + (decision basic :offset-assert 12) + (only-allow-cancel basic :offset-assert 16) + (no-msg basic :offset-assert 20) + (message-space int32 :offset-assert 24) + ) + :pack-me + :method-count-assert 11 + :size-assert #x1c + :flag-assert #xb0000001c + (:methods + (dummy-9 () none 9) + (dummy-10 () none 10) + ) + ) diff --git a/test/decompiler/reference/engine/game/projectiles-h_REF.gc b/test/decompiler/reference/engine/game/projectiles-h_REF.gc new file mode 100644 index 0000000000..6b4f6f1c9e --- /dev/null +++ b/test/decompiler/reference/engine/game/projectiles-h_REF.gc @@ -0,0 +1,124 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type projectile +(deftype projectile (process-drawable) + ((base-trans vector :inline :offset-assert 176) + (target vector :inline :offset-assert 192) + (target-base vector :inline :offset-assert 208) + (parent-base vector :inline :offset-assert 224) + (parent-quat vector :inline :offset-assert 240) + (base-vector vector :inline :offset-assert 256) + (timeout uint64 :offset-assert 272) + (options uint64 :offset-assert 280) + (last-target uint64 :offset-assert 288) + (notify-handle uint64 :offset-assert 296) + (max-speed float :offset-assert 304) + (max-turn float :offset-assert 308) + (old-dist float 16 :offset-assert 312) + (old-dist-count int32 :offset-assert 376) + (hits int32 :offset-assert 380) + (max-hits int32 :offset-assert 384) + (tween float :offset-assert 388) + (attack-mode basic :offset-assert 392) + (update-velocity basic :offset-assert 396) + (counter int32 :offset-assert 400) + (target-count int32 :offset-assert 404) + (sound-id uint32 :offset-assert 408) + ) + :heap-base #x130 + :method-count-assert 29 + :size-assert #x19c + :flag-assert #x1d0130019c + (:methods + (dummy-20 () none 20) + (dummy-21 () none 21) + (dummy-22 () none 22) + (dummy-23 () none 23) + (dummy-24 () none 24) + (dummy-25 () none 25) + (dummy-26 () none 26) + (dummy-27 () none 27) + (dummy-28 () none 28) + ) + ) + +;; definition for method 3 of type projectile +(defmethod inspect projectile ((obj projectile)) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~T~Tbase-trans: ~`vector`P~%" (&-> obj stack 64)) + (format #t "~T~Ttarget: ~`vector`P~%" (&-> obj stack 80)) + (format #t "~T~Ttarget-base: ~`vector`P~%" (&-> obj stack 96)) + (format #t "~T~Tparent-base: ~`vector`P~%" (&-> obj stack 112)) + (format #t "~T~Tparent-quat: ~`vector`P~%" (&-> obj stack 128)) + (format #t "~T~Tbase-vector: ~`vector`P~%" (&-> obj stack 144)) + (format #t "~T~Ttimeout: ~D~%" (-> obj timeout)) + (format #t "~T~Toptions: ~D~%" (-> obj options)) + (format #t "~T~Tlast-target: ~D~%" (-> obj last-target)) + (format #t "~T~Tnotify-handle: ~D~%" (-> obj notify-handle)) + (format #t "~T~Tmax-speed: ~f~%" (-> obj max-speed)) + (format #t "~T~Tmax-turn: ~f~%" (-> obj max-turn)) + (format #t "~T~Told-dist[16] @ #x~X~%" (&-> obj stack 200)) + (format #t "~T~Told-dist-count: ~D~%" (-> obj old-dist-count)) + (format #t "~T~Thits: ~D~%" (-> obj hits)) + (format #t "~T~Tmax-hits: ~D~%" (-> obj max-hits)) + (format #t "~T~Ttween: ~f~%" (-> obj tween)) + (format #t "~T~Tattack-mode: ~A~%" (-> obj attack-mode)) + (format #t "~T~Tupdate-velocity: ~A~%" (-> obj update-velocity)) + (format #t "~T~Tcounter: ~D~%" (-> obj counter)) + (format #t "~T~Ttarget-count: ~D~%" (-> obj target-count)) + (format #t "~T~Tsound-id: ~D~%" (-> obj sound-id)) + obj + ) + +;; definition of type projectile-yellow +(deftype projectile-yellow (projectile) + ((mode int32 :offset-assert 412) + (angle float :offset-assert 416) + ) + :heap-base #x140 + :method-count-assert 29 + :size-assert #x1a4 + :flag-assert #x1d014001a4 + ) + +;; definition for method 3 of type projectile-yellow +(defmethod inspect projectile-yellow ((obj projectile-yellow)) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 obj) + ) + (format #t "~T~Tmode: ~D~%" (-> obj mode)) + (format #t "~T~Tangle: ~f~%" (-> obj angle)) + obj + ) + +;; definition of type projectile-blue +(deftype projectile-blue (projectile) + ((mode int32 :offset-assert 412) + (joint-num int32 :offset-assert 416) + ) + :heap-base #x140 + :method-count-assert 29 + :size-assert #x1a4 + :flag-assert #x1d014001a4 + ) + +;; definition for method 3 of type projectile-blue +(defmethod inspect projectile-blue ((obj projectile-blue)) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 obj) + ) + (format #t "~T~Tmode: ~D~%" (-> obj mode)) + (format #t "~T~Tjoint-num: ~D~%" (-> obj joint-num)) + obj + ) + +;; failed to figure out what this is: +(let ((v0-3 0)) + ) + + + + diff --git a/test/decompiler/reference/engine/game/task/task-control-h_REF.gc b/test/decompiler/reference/engine/game/task/task-control-h_REF.gc new file mode 100644 index 0000000000..6af72c1dd6 --- /dev/null +++ b/test/decompiler/reference/engine/game/task/task-control-h_REF.gc @@ -0,0 +1,198 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type task-cstage +(deftype task-cstage (structure) + ((game-task uint8 :offset-assert 0) + (status uint64 :offset-assert 8) + (flags uint8 :offset-assert 16) + (condition basic :offset-assert 20) + ) + :method-count-assert 16 + :size-assert #x18 + :flag-assert #x1000000018 + (: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) + ) + ) + +;; definition for method 3 of type task-cstage +(defmethod inspect task-cstage ((obj task-cstage)) + (format #t "[~8x] ~A~%" obj 'task-cstage) + (format #t "~Tgame-task: ~D~%" (-> obj game-task)) + (format #t "~Tstatus: ~D~%" (-> obj status)) + (format #t "~Tflags: ~D~%" (-> obj flags)) + (format #t "~Tcondition: ~A~%" (-> obj condition)) + obj + ) + +;; definition of type task-control +(deftype task-control (basic) + ((current-stage int16 :offset-assert 4) + (stage basic :offset-assert 8) + ) + :method-count-assert 19 + :size-assert #xc + :flag-assert #x130000000c + (: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-18 () none 18) + ) + ) + +;; definition for method 3 of type task-control +(defmethod inspect task-control ((obj task-control)) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~Tcurrent-stage: ~D~%" (-> obj current-stage)) + (format #t "~Tstage: ~A~%" (-> obj stage)) + obj + ) + +;; definition of type ambient-control +(deftype ambient-control (structure) + ((last-ambient-time uint64 :offset-assert 0) + (last-ambient basic :offset-assert 8) + (last-ambient-id uint32 :offset-assert 12) + ) + :method-count-assert 12 + :size-assert #x10 + :flag-assert #xc00000010 + (:methods + (dummy-9 () none 9) + (dummy-10 () none 10) + (dummy-11 () none 11) + ) + ) + +;; definition for method 3 of type ambient-control +(defmethod inspect ambient-control ((obj ambient-control)) + (format #t "[~8x] ~A~%" obj 'ambient-control) + (format #t "~Tlast-ambient-time: ~D~%" (-> obj last-ambient-time)) + (format #t "~Tlast-ambient: ~A~%" (-> obj last-ambient)) + (format #t "~Tlast-ambient-id: ~D~%" (-> obj last-ambient-id)) + obj + ) + +;; definition of type process-taskable +(deftype process-taskable (process-drawable) + ((tasks basic :offset-assert 176) + (query gui-query :inline :offset-assert 180) + (old-target-pos transformq :inline :offset-assert 208) + (cell-for-task uint8 :offset-assert 256) + (cell-x uint64 :offset-assert 264) + (cam-joint-index int32 :offset-assert 272) + (skippable basic :offset-assert 276) + (blend-on-exit basic :offset-assert 280) + (camera uint64 :offset-assert 288) + (will-talk basic :offset-assert 296) + (talk-message uint32 :offset-assert 300) + (last-talk uint64 :offset-assert 304) + (bounce-away basic :offset-assert 312) + (ambient ambient-control :inline :offset-assert 320) + (center-joint-index int32 :offset-assert 336) + (draw-bounds-y-offset float :offset-assert 340) + (neck-joint-index int32 :offset-assert 344) + (fuel-cell-anim basic :offset-assert 348) + (sound-flava uint8 :offset-assert 352) + (have-flava basic :offset-assert 356) + (music basic :offset-assert 360) + (have-music basic :offset-assert 364) + (been-kicked basic :offset-assert 368) + (cur-trans-hook basic :offset-assert 372) + (shadow-backup basic :offset-assert 376) + ) + :heap-base #x110 + :method-count-assert 53 + :size-assert #x17c + :flag-assert #x350110017c + (:methods + (dummy-20 () none 20) + (dummy-21 () none 21) + (dummy-22 () none 22) + (dummy-23 () none 23) + (dummy-24 () none 24) + (dummy-25 () none 25) + (dummy-26 () none 26) + (dummy-27 () none 27) + (dummy-28 () none 28) + (dummy-29 () none 29) + (dummy-30 () none 30) + (dummy-31 () none 31) + (dummy-32 () none 32) + (dummy-33 () none 33) + (dummy-34 () none 34) + (dummy-35 () none 35) + (dummy-36 () none 36) + (dummy-37 () none 37) + (dummy-38 () none 38) + (dummy-39 () none 39) + (dummy-40 () none 40) + (dummy-41 () none 41) + (dummy-42 () none 42) + (dummy-43 () none 43) + (dummy-44 () none 44) + (dummy-45 () none 45) + (dummy-46 () none 46) + (dummy-47 () none 47) + (dummy-48 () none 48) + (dummy-49 () none 49) + (dummy-50 () none 50) + (dummy-51 () none 51) + (dummy-52 () none 52) + ) + ) + +;; definition for method 3 of type process-taskable +(defmethod inspect process-taskable ((obj process-taskable)) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~T~Ttasks: ~A~%" (-> obj tasks)) + (format #t "~T~Tquery: #~%" (&-> obj stack 68)) + (format #t "~T~Told-target-pos: #~%" (&-> obj stack 96)) + (format #t "~T~Tcell-for-task: ~D~%" (-> obj stack 144)) + (format #t "~T~Tcell-x: ~D~%" (-> obj cell-x)) + (format #t "~T~Tcam-joint-index: ~D~%" (-> obj cam-joint-index)) + (format #t "~T~Tskippable: ~A~%" (-> obj skippable)) + (format #t "~T~Tblend-on-exit: ~A~%" (-> obj blend-on-exit)) + (format #t "~T~Tcamera: ~D~%" (-> obj camera)) + (format #t "~T~Twill-talk: ~A~%" (-> obj will-talk)) + (format #t "~T~Ttalk-message: ~D~%" (-> obj talk-message)) + (format #t "~T~Tlast-talk: ~D~%" (-> obj last-talk)) + (format #t "~T~Tbounce-away: ~A~%" (-> obj bounce-away)) + (format #t "~T~Tambient: #~%" (&-> obj stack 208)) + (format #t "~T~Tcenter-joint-index: ~D~%" (-> obj center-joint-index)) + (format #t "~T~Tdraw-bounds-y-offset: ~f~%" (-> obj draw-bounds-y-offset)) + (format #t "~T~Tneck-joint-index: ~D~%" (-> obj neck-joint-index)) + (format #t "~T~Tfuel-cell-anim: ~A~%" (-> obj fuel-cell-anim)) + (format #t "~T~Tsound-flava: ~D~%" (-> obj stack 240)) + (format #t "~T~Thave-flava: ~A~%" (-> obj have-flava)) + (format #t "~T~Tmusic: ~A~%" (-> obj music)) + (format #t "~T~Thave-music: ~A~%" (-> obj have-music)) + (format #t "~T~Tbeen-kicked: ~A~%" (-> obj been-kicked)) + (format #t "~T~Tcur-trans-hook: ~A~%" (-> obj cur-trans-hook)) + (format #t "~T~Tshadow-backup: ~A~%" (-> obj shadow-backup)) + obj + ) + +;; failed to figure out what this is: +(let ((v0-4 0)) + ) + + + + diff --git a/test/decompiler/reference/engine/gfx/eye-h_REF.gc b/test/decompiler/reference/engine/gfx/eye-h_REF.gc new file mode 100644 index 0000000000..e20d43cf6c --- /dev/null +++ b/test/decompiler/reference/engine/gfx/eye-h_REF.gc @@ -0,0 +1,121 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type eye +(deftype eye (structure) + ((data uint128 2 :offset-assert 0) + (x float :offset 0) + (y float :offset 4) + (lid float :offset 8) + (iris-scale float :offset 16) + (pupil-scale float :offset 20) + (lid-scale float :offset 24) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type eye +(defmethod inspect eye ((obj eye)) + (format #t "[~8x] ~A~%" obj 'eye) + (format #t "~Tdata[2] @ #x~X~%" (-> obj data)) + (format #t "~Tx: ~f~%" (-> obj x)) + (format #t "~Ty: ~f~%" (-> obj y)) + (format #t "~Tlid: ~f~%" (-> obj lid)) + (format #t "~Tiris-scale: ~f~%" (-> obj iris-scale)) + (format #t "~Tpupil-scale: ~f~%" (-> obj pupil-scale)) + (format #t "~Tlid-scale: ~f~%" (-> obj lid-scale)) + obj + ) + +;; definition of type eye-control +(deftype eye-control (structure) + ((process uint64 :offset-assert 0) + (random-time uint16 :offset-assert 8) + (level uint16 :offset-assert 10) + (blink float :offset-assert 12) + (shaders uint32 :offset-assert 16) + (left eye :inline :offset-assert 32) + (right eye :inline :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x60 + :flag-assert #x900000060 + ) + +;; definition for method 3 of type eye-control +(defmethod inspect eye-control ((obj eye-control)) + (format #t "[~8x] ~A~%" obj 'eye-control) + (format #t "~Tprocess: ~D~%" (-> obj process)) + (format #t "~Trandom-time: ~D~%" (-> obj random-time)) + (format #t "~Tlevel: ~D~%" (-> obj level)) + (format #t "~Tblink: ~f~%" (-> obj blink)) + (format #t "~Tshaders: #x~X~%" (-> obj shaders)) + (format #t "~Tleft: #~%" (-> obj left)) + (format #t "~Tright: #~%" (-> obj right)) + obj + ) + +;; definition of type eye-control-array +(deftype eye-control-array (basic) + ((data eye-control 11 :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x430 + :flag-assert #x900000430 + ) + +;; definition for method 3 of type eye-control-array +(defmethod inspect eye-control-array ((obj eye-control-array)) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~Tdata[11] @ #x~X~%" (-> obj data)) + obj + ) + +;; definition of type eye-work +(deftype eye-work (structure) + ((sprite-tmpl dma-gif-packet :inline :offset-assert 0) + (sprite-tmpl2 dma-gif-packet :inline :offset-assert 32) + (adgif-tmpl dma-gif-packet :inline :offset-assert 64) + (blink-table float 10 :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x88 + :flag-assert #x900000088 + ) + +;; definition for method 3 of type eye-work +(defmethod inspect eye-work ((obj eye-work)) + (format #t "[~8x] ~A~%" obj 'eye-work) + (format #t "~Tsprite-tmpl: #~%" (-> obj sprite-tmpl)) + (format #t "~Tsprite-tmpl2: #~%" (-> obj sprite-tmpl2)) + (format #t "~Tadgif-tmpl: #~%" (-> obj adgif-tmpl)) + (format #t "~Tblink-table[10] @ #x~X~%" (-> obj blink-table)) + obj + ) + +;; definition for symbol *eye-control-array*, type eye-control-array +(define *eye-control-array* (new 'static 'eye-control-array)) + +;; failed to figure out what this is: +(dotimes (v1-5 11) + (set! (-> *eye-control-array* data v1-5 process) (the-as uint #f)) + (set! (-> *eye-control-array* data v1-5 shaders) (the-as uint #f)) + (set! (-> *eye-control-array* data v1-5 random-time) (the-as uint 60)) + (set! (-> *eye-control-array* data v1-5 blink) 0.0) + ) + +;; failed to figure out what this is: +(empty-form) + +;; failed to figure out what this is: +(empty-form) + +;; failed to figure out what this is: +(let ((v0-4 0)) + ) + + + + diff --git a/test/decompiler/reference/engine/gfx/sky/sky-utils_REF.gc b/test/decompiler/reference/engine/gfx/sky/sky-utils_REF.gc new file mode 100644 index 0000000000..88f9c9162a --- /dev/null +++ b/test/decompiler/reference/engine/gfx/sky/sky-utils_REF.gc @@ -0,0 +1,87 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function sky-set-sun-radii +(defun + sky-set-sun-radii + ((arg0 sky-parms) (arg1 int) (arg2 float) (arg3 float) (arg4 float)) + (let ((v1-0 (logand arg1 1))) + (set! (-> arg0 upload-data sun v1-0 r-sun) arg2) + (set! (-> arg0 upload-data sun v1-0 r-halo) arg3) + (set! (-> arg0 upload-data sun v1-0 r-aurora) arg4) + ) + #f + ) + +;; definition for function sky-set-sun-colors +(defun + sky-set-sun-colors + ((arg0 sky-parms) (arg1 int) (arg2 uint) (arg3 uint) (arg4 uint) (arg5 uint)) + (let ((v1-0 (logand arg1 1))) + (set! (-> arg0 upload-data sun v1-0 c-sun-start) arg2) + (set! (-> arg0 upload-data sun v1-0 c-sun-end) arg3) + (set! (-> arg0 upload-data sun v1-0 c-halo-start) arg3) + (set! (-> arg0 upload-data sun v1-0 c-halo-end) arg4) + (set! (-> arg0 upload-data sun v1-0 c-aurora-start) arg4) + (set! (-> arg0 upload-data sun v1-0 c-aurora-end) arg5) + ) + #f + ) + +;; definition for function sky-set-sun-colors-sun +(defun + sky-set-sun-colors-sun + ((arg0 sky-parms) (arg1 int) (arg2 uint) (arg3 uint)) + (let ((v1-0 (logand arg1 1))) + (set! (-> arg0 upload-data sun v1-0 c-sun-start) arg2) + (set! (-> arg0 upload-data sun v1-0 c-sun-end) arg3) + ) + #f + ) + +;; definition for function sky-set-sun-colors-halo +(defun + sky-set-sun-colors-halo + ((arg0 sky-parms) (arg1 int) (arg2 uint) (arg3 uint)) + (let ((v1-0 (logand arg1 1))) + (set! (-> arg0 upload-data sun v1-0 c-halo-start) arg2) + (set! (-> arg0 upload-data sun v1-0 c-halo-end) arg3) + ) + #f + ) + +;; definition for function sky-set-sun-colors-aurora +(defun + sky-set-sun-colors-aurora + ((arg0 sky-parms) (arg1 int) (arg2 uint) (arg3 uint)) + (let ((v1-0 (logand arg1 1))) + (set! (-> arg0 upload-data sun v1-0 c-aurora-start) arg2) + (set! (-> arg0 upload-data sun v1-0 c-aurora-end) arg3) + ) + #f + ) + +;; definition for function sky-set-orbit +(defun + sky-set-orbit + ((arg0 sky-parms) + (arg1 int) + (arg2 float) + (arg3 float) + (arg4 float) + (arg5 float) + (arg6 float) + (arg7 float) + ) + (set! (-> arg0 orbit arg1 high-noon) arg2) + (set! (-> arg0 orbit arg1 tilt) (* 0.017453292 arg3)) + (set! (-> arg0 orbit arg1 rise) (* 0.017453292 arg4)) + (set! (-> arg0 orbit arg1 dist) arg5) + (set! (-> arg0 orbit arg1 min-halo) arg6) + (set! (-> arg0 orbit arg1 max-halo) arg7) + #f + ) + + + + diff --git a/test/decompiler/reference/engine/gfx/water/water-h_REF.gc b/test/decompiler/reference/engine/gfx/water/water-h_REF.gc new file mode 100644 index 0000000000..6e393bc6d6 --- /dev/null +++ b/test/decompiler/reference/engine/gfx/water/water-h_REF.gc @@ -0,0 +1,186 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type water-control +(deftype water-control (basic) + ((flags uint32 :offset-assert 4) + (process basic :offset-assert 8) + (joint-index int32 :offset-assert 12) + (top-y-offset float :offset-assert 16) + (ripple-size float :offset-assert 20) + (enter-water-time uint64 :offset-assert 24) + (wade-time uint64 :offset-assert 32) + (on-water-time uint64 :offset-assert 40) + (enter-swim-time uint64 :offset-assert 48) + (swim-time uint64 :offset-assert 56) + (base-height float :offset-assert 64) + (wade-height float :offset-assert 68) + (swim-height float :offset-assert 72) + (surface-height float :offset-assert 76) + (bottom-height float :offset-assert 80) + (height float :offset-assert 84) + (height-offset float 4 :offset-assert 88) + (real-ocean-offset float :offset 88) + (ocean-offset float :offset 92) + (bob-offset float :offset 96) + (align-offset float :offset 100) + (swim-depth float :offset-assert 104) + (bob smush-control :inline :offset-assert 112) + (volume uint64 :offset-assert 144) + (bottom vector 2 :inline :offset-assert 160) + (top vector 2 :inline :offset-assert 192) + (enter-water-pos vector :inline :offset-assert 224) + (drip-old-pos vector :inline :offset-assert 240) + (drip-joint-index int32 :offset-assert 256) + (drip-wetness float :offset-assert 260) + (drip-time uint64 :offset-assert 264) + (drip-speed float :offset-assert 272) + (drip-height float :offset-assert 276) + (drip-mult float :offset-assert 280) + ) + :method-count-assert 17 + :size-assert #x11c + :flag-assert #x110000011c + (:methods + (new (symbol type process int float float float) _type_ 0) + (dummy-9 () none 9) + (dummy-10 () none 10) + (dummy-11 () none 11) + (distance-from-surface (_type_) float 12) + (dummy-13 () none 13) + (display-water-marks? (_type_) symbol 14) + (dummy-15 () none 15) + (dummy-16 () none 16) + ) + ) + +;; definition for method 3 of type water-control +(defmethod inspect water-control ((obj water-control)) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~Tflags: #x~X~%" (-> obj flags)) + (format #t "~Tprocess: ~A~%" (-> obj process)) + (format #t "~Tjoint-index: ~D~%" (-> obj joint-index)) + (format #t "~Ttop-y-offset: ~f~%" (-> obj top-y-offset)) + (format #t "~Tripple-size: (meters ~m)~%" (-> obj ripple-size)) + (format #t "~Tenter-water-time: ~D~%" (-> obj enter-water-time)) + (format #t "~Twade-time: ~D~%" (-> obj wade-time)) + (format #t "~Ton-water-time: ~D~%" (-> obj on-water-time)) + (format #t "~Tenter-swim-time: ~D~%" (-> obj enter-swim-time)) + (format #t "~Tswim-time: ~D~%" (-> obj swim-time)) + (format #t "~Tbase-height: (meters ~m)~%" (-> obj base-height)) + (format #t "~Twade-height: (meters ~m)~%" (-> obj wade-height)) + (format #t "~Tswim-height: (meters ~m)~%" (-> obj swim-height)) + (format #t "~Tsurface-height: (meters ~m)~%" (-> obj surface-height)) + (format #t "~Tbottom-height: (meters ~m)~%" (-> obj bottom-height)) + (format #t "~Theight: (meters ~m)~%" (-> obj height)) + (format #t "~Theight-offset[4] @ #x~X~%" (-> obj height-offset)) + (format #t "~Treal-ocean-offset: (meters ~m)~%" (-> obj height-offset 0)) + (format #t "~Tocean-offset: (meters ~m)~%" (-> obj height-offset 1)) + (format #t "~Tbob-offset: (meters ~m)~%" (-> obj height-offset 2)) + (format #t "~Talign-offset: (meters ~m)~%" (-> obj height-offset 3)) + (format #t "~Tswim-depth: (meters ~m)~%" (-> obj swim-depth)) + (format #t "~Tbob: #~%" (-> obj bob)) + (format #t "~Tvolume: ~D~%" (-> obj volume)) + (format #t "~Tbottom[2] @ #x~X~%" (-> obj bottom)) + (format #t "~Ttop[2] @ #x~X~%" (-> obj top)) + (format #t "~Tenter-water-pos: ~`vector`P~%" (-> obj enter-water-pos)) + (format #t "~Tdrip-old-pos: ~`vector`P~%" (-> obj drip-old-pos)) + (format #t "~Tdrip-joint-index: ~D~%" (-> obj drip-joint-index)) + (format #t "~Tdrip-wetness: ~f~%" (-> obj drip-wetness)) + (format #t "~Tdrip-time: ~D~%" (-> obj drip-time)) + (format #t "~Tdrip-speed: ~f~%" (-> obj drip-speed)) + (format #t "~Tdrip-height: (meters ~m)~%" (-> obj drip-height)) + (format #t "~Tdrip-mult: ~f~%" (-> obj drip-mult)) + obj + ) + +;; definition for method 14 of type water-control +(defmethod display-water-marks? water-control ((obj water-control)) + (and *display-water-marks* (nonzero? (logand (-> obj flags) 1))) + ) + +;; definition for method 0 of type water-control +(defmethod + new + water-control + ((allocation symbol) + (type-to-make type) + (arg0 process) + (arg1 int) + (arg2 float) + (arg3 float) + (arg4 float) + ) + (let + ((v0-0 + (object-new allocation type-to-make (the-as int (-> type-to-make size))) + ) + ) + (set! (-> v0-0 process) arg0) + (set! (-> v0-0 joint-index) arg1) + (set! (-> v0-0 wade-height) arg4) + (set! (-> v0-0 swim-height) arg3) + (set! (-> v0-0 bottom-height) 32768.0) + (set! (-> v0-0 ripple-size) 1638.4) + (set! (-> v0-0 volume) (the-as uint #f)) + (set! (-> v0-0 drip-mult) 1.0) + (set! (-> v0-0 top-y-offset) arg2) + v0-0 + ) + ) + +;; definition for method 12 of type water-control +(defmethod distance-from-surface water-control ((obj water-control)) + (- (-> obj top 0 y) (-> obj height)) + ) + +;; definition of type water-vol +(deftype water-vol (process-drawable) + ((water-height float :offset-assert 176) + (wade-height float :offset-assert 180) + (swim-height float :offset-assert 184) + (bottom-height float :offset-assert 188) + (attack-event basic :offset-assert 192) + (target uint64 :offset-assert 200) + (flags uint32 :offset-assert 208) + ) + :heap-base #x70 + :method-count-assert 30 + :size-assert #xd4 + :flag-assert #x1e007000d4 + (:methods + (dummy-20 () none 20) + (dummy-21 () none 21) + (dummy-22 () none 22) + (dummy-23 () none 23) + (dummy-24 () none 24) + (dummy-25 () none 25) + (dummy-26 () none 26) + (dummy-27 () none 27) + (dummy-28 () none 28) + (dummy-29 () none 29) + ) + ) + +;; definition for method 3 of type water-vol +(defmethod inspect water-vol ((obj water-vol)) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~T~Twater-height: (meters ~m)~%" (-> obj water-height)) + (format #t "~T~Twade-height: (meters ~m)~%" (-> obj wade-height)) + (format #t "~T~Tswim-height: (meters ~m)~%" (-> obj swim-height)) + (format #t "~T~Tbottom-height: (meters ~m)~%" (-> obj bottom-height)) + (format #t "~T~Tattack-event: ~A~%" (-> obj attack-event)) + (format #t "~T~Ttarget: ~D~%" (-> obj target)) + (format #t "~T~Tflags: #x~X~%" (-> obj flags)) + obj + ) + +;; failed to figure out what this is: +(let ((v0-2 0)) + ) + + + + diff --git a/test/decompiler/reference/engine/util/smush-control-h_REF.gc b/test/decompiler/reference/engine/util/smush-control-h_REF.gc new file mode 100644 index 0000000000..20673c4b66 --- /dev/null +++ b/test/decompiler/reference/engine/util/smush-control-h_REF.gc @@ -0,0 +1,151 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type smush-control +(deftype smush-control (structure) + ((start-time uint64 :offset-assert 0) + (period float :offset-assert 8) + (duration float :offset-assert 12) + (amp float :offset-assert 16) + (damp-amp float :offset-assert 20) + (damp-period float :offset-assert 24) + (ticks float :offset-assert 28) + ) + :method-count-assert 15 + :size-assert #x20 + :flag-assert #xf00000020 + (:methods + (set-zero! (_type_) _type_ 9) + (update! (_type_) float 10) + (get-no-update (_type_) float 11) + (activate! (_type_ float int int float float float) _type_ 12) + (nonzero-amplitude? (_type_) symbol 13) + (die-on-next-update! (_type_) _type_ 14) + ) + ) + +;; definition for method 3 of type smush-control +(defmethod inspect smush-control ((obj smush-control)) + (format #t "[~8x] ~A~%" obj 'smush-control) + (format #t "~Tstart-time: ~D~%" (-> obj start-time)) + (format #t "~Tperiod: ~f~%" (-> obj period)) + (format #t "~Tduration: ~f~%" (-> obj duration)) + (format #t "~Tamp: ~f~%" (-> obj amp)) + (format #t "~Tdamp-amp: ~f~%" (-> obj damp-amp)) + (format #t "~Tdamp-period: ~f~%" (-> obj damp-period)) + (format #t "~Tticks: ~f~%" (-> obj ticks)) + obj + ) + +;; definition for method 13 of type smush-control +(defmethod nonzero-amplitude? smush-control ((obj smush-control)) + (!= (-> obj amp) 0.0) + ) + +;; definition for method 9 of type smush-control +(defmethod set-zero! smush-control ((obj smush-control)) + (set! (-> obj period) 0.0) + (set! (-> obj duration) 0.0) + (set! (-> obj amp) 0.0) + (set! (-> obj damp-amp) 0.0) + (set! (-> obj damp-period) 0.0) + (set! (-> obj ticks) 0.0) + obj + ) + +;; definition for method 10 of type smush-control +(defmethod update! smush-control ((obj smush-control)) + (cond + ((!= (-> obj amp) 0.0) + (let* + ((f30-0 + (the float (- (-> *display* base-frame-counter) (-> obj start-time))) + ) + (f0-2 (-> obj period)) + (f28-0 (- f30-0 (* (the float (the int (/ f30-0 f0-2))) f0-2))) + ) + (when (>= (- f30-0 (-> obj ticks)) (-> obj period)) + (set! (-> obj amp) (* (-> obj amp) (-> obj damp-amp))) + (set! (-> obj period) (* (-> obj period) (-> obj damp-period))) + (set! (-> obj ticks) f30-0) + (if (< (-> obj damp-period) 0.0) + ((method-of-type smush-control set-zero!) obj) + ) + ) + (if (>= f30-0 (-> obj duration)) + ((method-of-type smush-control set-zero!) obj) + ) + (* + (sin (/ (* 65536.0 f28-0) (-> obj period))) + (* (-> obj amp) (/ (- (-> obj duration) f30-0) (-> obj duration))) + ) + ) + ) + (else + 0.0 + ) + ) + ) + +;; definition for method 11 of type smush-control +(defmethod get-no-update smush-control ((obj smush-control)) + (cond + ((!= (-> obj amp) 0.0) + (let* + ((f30-0 + (the float (- (-> *display* base-frame-counter) (-> obj start-time))) + ) + (f0-2 (-> obj period)) + (f0-4 (- f30-0 (* (the float (the int (/ f30-0 f0-2))) f0-2))) + ) + (* + (sin (/ (* 65536.0 f0-4) (-> obj period))) + (* (-> obj amp) (/ (- (-> obj duration) f30-0) (-> obj duration))) + ) + ) + ) + (else + 0.0 + ) + ) + ) + +;; definition for method 14 of type smush-control +(defmethod die-on-next-update! smush-control ((obj smush-control)) + (if (!= (-> obj amp) 0.0) + (set! (-> obj damp-period) -1.0) + ) + obj + ) + +;; definition for method 12 of type smush-control +(defmethod + activate! + smush-control + ((obj smush-control) + (arg0 float) + (arg1 int) + (arg2 int) + (arg3 float) + (arg4 float) + (arg5 float) + ) + (when + (>= + (fabs (* 0.2 (-> obj amp))) + (fabs ((method-of-type smush-control get-no-update) obj)) + ) + (set! (-> obj amp) arg0) + (set! (-> obj period) (the float arg1)) + (set! (-> obj duration) (the float arg2)) + (set! (-> obj damp-amp) arg3) + (set! (-> obj damp-period) arg4) + (set! (-> obj ticks) 0.0) + (set! (-> obj start-time) (-> *display* base-frame-counter)) + ) + obj + ) + + + +