mirror of
https://github.com/open-goal/jak-project
synced 2026-07-07 14:13:45 -04:00
decomp: Decompile ripple (#512)
* decomp: Decompile `ripple` * decomp: Finish decompiling `ripple` * update necessary src files
This commit is contained in:
@@ -21,3 +21,4 @@ logs/*
|
||||
*.log
|
||||
*.p2s
|
||||
savestate-out/
|
||||
failures/
|
||||
|
||||
+8
-1
@@ -47,5 +47,12 @@ tasks:
|
||||
- watchmedo shell-command --drop --patterns="*.p2s" --recursive --command='task analyze-ee-memory FILE="${watch_src_path}"' "{{.SAVESTATE_DIR}}"
|
||||
vars:
|
||||
SAVESTATE_DIR: '{{default "." .SAVESTATE_DIR}}'
|
||||
|
||||
offline-tests:
|
||||
cmds:
|
||||
- ./out/build/Debug/bin/offline-test.exe "./iso_data/jak1"
|
||||
update-reference-tests:
|
||||
cmds:
|
||||
- ./out/build/Debug/bin/offline-test.exe "./iso_data/jak1" --dump-mode
|
||||
- python .\scripts\update_decomp_reference.py .\failures\ .\test\decompiler\reference\
|
||||
- task: offline-tests
|
||||
|
||||
|
||||
@@ -6804,8 +6804,9 @@
|
||||
)
|
||||
|
||||
;; art-h
|
||||
(declare-type merc-ctrl basic)
|
||||
(deftype lod-group (structure)
|
||||
((geo basic :offset-assert 0)
|
||||
((geo merc-ctrl :offset-assert 0)
|
||||
(dist float :offset-assert 4) ;; meters
|
||||
)
|
||||
:pack-me
|
||||
@@ -6829,6 +6830,9 @@
|
||||
)
|
||||
|
||||
;; art-h
|
||||
(declare-type ripple-control basic)
|
||||
(declare-type shadow-geo basic)
|
||||
(declare-type shadow-control basic)
|
||||
(deftype draw-control (basic)
|
||||
((status uint8 :offset-assert 4)
|
||||
(matrix-type uint8 :offset-assert 5)
|
||||
@@ -6845,7 +6849,7 @@
|
||||
(force-lod int8 :offset-assert 61)
|
||||
(cur-lod int8 :offset-assert 62)
|
||||
(desired-lod int8 :offset-assert 63)
|
||||
(ripple basic :offset-assert 64)
|
||||
(ripple ripple-control :offset-assert 64)
|
||||
(longest-edge float :offset-assert 68) ;; meters
|
||||
(longest-edge? uint32 :offset 68)
|
||||
(light-index uint8 :offset-assert 72)
|
||||
@@ -6855,10 +6859,10 @@
|
||||
(death-timer-org uint8 :offset-assert 77)
|
||||
(death-vertex-skip uint16 :offset-assert 78)
|
||||
(death-effect uint32 :offset-assert 80)
|
||||
(sink-group basic :offset-assert 84) ;; dma-foreground-sink-group?
|
||||
(sink-group dma-foreground-sink-group :offset-assert 84) ;; dma-foreground-sink-group?
|
||||
(process process :offset-assert 88)
|
||||
(shadow basic :offset-assert 92)
|
||||
(shadow-ctrl basic :offset-assert 96)
|
||||
(shadow shadow-geo :offset-assert 92)
|
||||
(shadow-ctrl shadow-control :offset-assert 96)
|
||||
(origin vector :inline :offset-assert 112)
|
||||
(bounds vector :inline :offset-assert 128)
|
||||
(radius float :offset 140) ;; meters
|
||||
@@ -7216,7 +7220,7 @@
|
||||
(deftype merc-ctrl (art-element)
|
||||
((num-joints int32 :offset 20)
|
||||
(header merc-ctrl-header :inline :offset-assert 32)
|
||||
(effect uint8 :dynamic :offset-assert 112)
|
||||
(effect merc-effect :inline :dynamic :offset-assert 112)
|
||||
)
|
||||
:method-count-assert 13
|
||||
:size-assert #x70
|
||||
@@ -7280,7 +7284,7 @@
|
||||
(far-fade-dist float :offset-assert 16)
|
||||
(faded-scale float :offset-assert 20)
|
||||
(individual-normal-scale float :offset-assert 24)
|
||||
(waveform basic :offset-assert 28)
|
||||
(waveform ripple-wave-set :offset-assert 28)
|
||||
(send-query basic :offset-assert 32)
|
||||
(query basic :offset-assert 36)
|
||||
)
|
||||
@@ -8897,9 +8901,9 @@
|
||||
|
||||
;; game-h
|
||||
(deftype process-drawable (process)
|
||||
((root basic :offset-assert 112)
|
||||
((root trsqv :offset-assert 112)
|
||||
(node-list basic :offset-assert 116)
|
||||
(draw basic :offset-assert 120)
|
||||
(draw draw-control :offset-assert 120)
|
||||
(skel basic :offset-assert 124)
|
||||
(nav basic :offset-assert 128)
|
||||
(align basic :offset-assert 132)
|
||||
@@ -13630,25 +13634,38 @@
|
||||
; )
|
||||
; )
|
||||
|
||||
; ;; ripple
|
||||
; (deftype ripple-request (structure)
|
||||
; ((waveform basic :offset-assert 0)
|
||||
; (effect merc-effect :offset-assert 4)
|
||||
; )
|
||||
; :method-count-assert 9
|
||||
; :size-assert #x8
|
||||
; :flag-assert #x900000008
|
||||
; )
|
||||
;; ripple
|
||||
(deftype ripple-request (structure)
|
||||
((waveform ripple-wave :offset-assert 0)
|
||||
(effect merc-effect :offset-assert 4)
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 9
|
||||
:size-assert #x8
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
|
||||
; ;; ripple
|
||||
; (deftype ripple-globals (structure)
|
||||
; ((count int32 :offset-assert 0)
|
||||
; (requests UNKNOWN 16 :offset-assert 4)
|
||||
; )
|
||||
; :method-count-assert 9
|
||||
; :size-assert #x84
|
||||
; :flag-assert #x900000084
|
||||
; )
|
||||
;; ripple
|
||||
(deftype ripple-globals (structure)
|
||||
((count int32 :offset-assert 0)
|
||||
(requests ripple-request 16 :inline :offset-assert 4)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x84
|
||||
:flag-assert #x900000084
|
||||
)
|
||||
|
||||
(define-extern ripple-execute-init (function none))
|
||||
(define-extern *ripple-globals* ripple-globals)
|
||||
(define-extern ripple-slow-add-sine-waves (function ripple-wave-set float float float))
|
||||
(define-extern ripple-apply-wave-table (function merc-effect symbol))
|
||||
(define-extern ripple-find-height (function process-drawable basic vector float))
|
||||
(define-extern ripple-matrix-scale function)
|
||||
(define-extern ripple-add-debug-sphere (function process-drawable vector float float none)) ; TODO - this could be a child type of process-drawable instead
|
||||
(define-extern ripple-execute (function none))
|
||||
(define-extern ripple-update-waveform-offs (function ripple-wave-set none))
|
||||
(define-extern ripple-create-wave-table (function ripple-wave-set int))
|
||||
(define-extern ripple-make-request (function ripple-wave merc-effect none))
|
||||
|
||||
; ;; bones
|
||||
; (deftype bone-calculation (structure)
|
||||
@@ -33619,7 +33636,6 @@
|
||||
(define-extern art-joint-geo type)
|
||||
(define-extern new-dynamic-structure (function symbol type int structure)) ;; unknown type
|
||||
(define-extern merc-fragment-fp-data (function merc-fragment pointer))
|
||||
(define-extern ripple-wave-set type)
|
||||
(define-extern merc-ctrl type)
|
||||
(define-extern *generic-debug* generic-debug) ;; unknown type
|
||||
|
||||
@@ -34146,7 +34162,7 @@
|
||||
(define-extern history-init function)
|
||||
(define-extern debug-draw-buffers function)
|
||||
(define-extern display-file-info function)
|
||||
(define-extern add-debug-sphere function)
|
||||
(define-extern add-debug-sphere (function symbol int vector float int int))
|
||||
(define-extern add-debug-outline-triangle function)
|
||||
(define-extern add-debug-x function)
|
||||
(define-extern add-debug-points function)
|
||||
@@ -34209,19 +34225,6 @@
|
||||
(define-extern merc-stats function)
|
||||
(define-extern merc-stats-display function)
|
||||
(define-extern get-eye-block function)
|
||||
(define-extern ripple-execute-init function)
|
||||
;;(define-extern *ripple-globals* object) ;; unknown type
|
||||
(define-extern ripple-slow-add-sine-waves function)
|
||||
;;(define-extern ripple-request object) ;; unknown type
|
||||
(define-extern ripple-apply-wave-table function)
|
||||
(define-extern ripple-find-height function)
|
||||
(define-extern ripple-matrix-scale function)
|
||||
(define-extern ripple-add-debug-sphere function)
|
||||
(define-extern ripple-execute function)
|
||||
(define-extern ripple-update-waveform-offs function)
|
||||
(define-extern ripple-create-wave-table function)
|
||||
(define-extern ripple-make-request function)
|
||||
;;(define-extern ripple-globals object) ;; unknown type
|
||||
(define-extern dump-qword function)
|
||||
(define-extern bones-reset-sqwc function)
|
||||
;;(define-extern bone-calculation-list object) ;; unknown type
|
||||
|
||||
@@ -444,5 +444,10 @@
|
||||
|
||||
"res": [
|
||||
["L150", "uint64", true]
|
||||
],
|
||||
|
||||
"ripple": [
|
||||
["L73", "float", true],
|
||||
["L74", "uint64", true]
|
||||
]
|
||||
}
|
||||
|
||||
@@ -246,5 +246,9 @@
|
||||
"(method 15 trajectory)": [
|
||||
[16, "vector"],
|
||||
[32, "vector"]
|
||||
],
|
||||
|
||||
"ripple-add-debug-sphere": [
|
||||
[16, "vector"]
|
||||
]
|
||||
}
|
||||
|
||||
@@ -450,5 +450,9 @@
|
||||
|
||||
"(method 3 generic-tie-interp-point)": [
|
||||
[15, "gp", "(pointer uint128)"]
|
||||
],
|
||||
|
||||
"ripple-find-height": [
|
||||
[[22, 72], "s4", "mei-ripple"]
|
||||
]
|
||||
}
|
||||
|
||||
@@ -208,9 +208,10 @@
|
||||
:flag-assert #x900000048
|
||||
)
|
||||
|
||||
(declare-type merc-ctrl basic)
|
||||
(deftype lod-group (structure)
|
||||
((geo basic :offset-assert 0)
|
||||
(dist float :offset-assert 4)
|
||||
((geo merc-ctrl :offset-assert 0)
|
||||
(dist float :offset-assert 4) ;; meters
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 9
|
||||
@@ -231,47 +232,50 @@
|
||||
)
|
||||
)
|
||||
|
||||
(declare-type ripple-control basic)
|
||||
(declare-type shadow-geo basic)
|
||||
(declare-type shadow-control basic)
|
||||
(deftype draw-control (basic)
|
||||
((status uint8 :offset-assert 4)
|
||||
(matrix-type uint8 :offset-assert 5)
|
||||
(data-format uint8 :offset-assert 6)
|
||||
(global-effect uint8 :offset-assert 7)
|
||||
(art-group art-group :offset-assert 8)
|
||||
(jgeo art-joint-geo :offset-assert 12)
|
||||
(mgeo art-mesh-geo :offset-assert 16)
|
||||
(dma-add-func function :offset-assert 20)
|
||||
(skeleton skeleton-group :offset-assert 24)
|
||||
(lod-set lod-set :inline :offset-assert 28)
|
||||
(lod lod-group 4 :inline :offset 28)
|
||||
(max-lod int8 :offset 60)
|
||||
(force-lod int8 :offset-assert 61)
|
||||
(cur-lod int8 :offset-assert 62)
|
||||
(desired-lod int8 :offset-assert 63)
|
||||
(ripple basic :offset-assert 64)
|
||||
(longest-edge float :offset-assert 68) ;; meters
|
||||
(longest-edge? uint32 :offset 68)
|
||||
(light-index uint8 :offset-assert 72)
|
||||
(dummy uint8 2 :offset-assert 73)
|
||||
(death-draw-overlap uint8 :offset-assert 75)
|
||||
(death-timer uint8 :offset-assert 76)
|
||||
(death-timer-org uint8 :offset-assert 77)
|
||||
(death-vertex-skip uint16 :offset-assert 78)
|
||||
(death-effect uint32 :offset-assert 80)
|
||||
(sink-group basic :offset-assert 84) ;; dma-foreground-sink-group?
|
||||
(process process :offset-assert 88)
|
||||
(shadow basic :offset-assert 92)
|
||||
(shadow-ctrl basic :offset-assert 96)
|
||||
(origin vector :inline :offset-assert 112)
|
||||
(bounds vector :inline :offset-assert 128)
|
||||
(radius float :offset 140) ;; meters
|
||||
(color-mult rgbaf :inline :offset-assert 144)
|
||||
(color-emissive rgbaf :inline :offset-assert 160)
|
||||
(secondary-interp float :offset-assert 176)
|
||||
(current-secondary-interp float :offset-assert 180)
|
||||
(shadow-mask uint8 :offset-assert 184)
|
||||
(level-index uint8 :offset-assert 185)
|
||||
(origin-joint-index uint8 :offset-assert 186)
|
||||
(shadow-joint-index uint8 :offset-assert 187)
|
||||
((status uint8 :offset-assert 4)
|
||||
(matrix-type uint8 :offset-assert 5)
|
||||
(data-format uint8 :offset-assert 6)
|
||||
(global-effect uint8 :offset-assert 7)
|
||||
(art-group art-group :offset-assert 8)
|
||||
(jgeo art-joint-geo :offset-assert 12)
|
||||
(mgeo art-mesh-geo :offset-assert 16)
|
||||
(dma-add-func function :offset-assert 20)
|
||||
(skeleton skeleton-group :offset-assert 24)
|
||||
(lod-set lod-set :inline :offset-assert 28)
|
||||
(lod lod-group 4 :inline :offset 28)
|
||||
(max-lod int8 :offset 60)
|
||||
(force-lod int8 :offset-assert 61)
|
||||
(cur-lod int8 :offset-assert 62)
|
||||
(desired-lod int8 :offset-assert 63)
|
||||
(ripple ripple-control :offset-assert 64)
|
||||
(longest-edge float :offset-assert 68) ;; meters
|
||||
(longest-edge? uint32 :offset 68)
|
||||
(light-index uint8 :offset-assert 72)
|
||||
(dummy uint8 2 :offset-assert 73)
|
||||
(death-draw-overlap uint8 :offset-assert 75)
|
||||
(death-timer uint8 :offset-assert 76)
|
||||
(death-timer-org uint8 :offset-assert 77)
|
||||
(death-vertex-skip uint16 :offset-assert 78)
|
||||
(death-effect uint32 :offset-assert 80)
|
||||
(sink-group dma-foreground-sink-group :offset-assert 84)
|
||||
(process process :offset-assert 88)
|
||||
(shadow shadow-geo :offset-assert 92)
|
||||
(shadow-ctrl shadow-control :offset-assert 96)
|
||||
(origin vector :inline :offset-assert 112)
|
||||
(bounds vector :inline :offset-assert 128)
|
||||
(radius float :offset 140) ;; meters
|
||||
(color-mult rgbaf :inline :offset-assert 144)
|
||||
(color-emissive rgbaf :inline :offset-assert 160)
|
||||
(secondary-interp float :offset-assert 176)
|
||||
(current-secondary-interp float :offset-assert 180)
|
||||
(shadow-mask uint8 :offset-assert 184)
|
||||
(level-index uint8 :offset-assert 185)
|
||||
(origin-joint-index uint8 :offset-assert 186)
|
||||
(shadow-joint-index uint8 :offset-assert 187)
|
||||
)
|
||||
:method-count-assert 12
|
||||
:size-assert #xbc
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
;; name in dgo: game-h
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
; TODO - for hud-h.gc
|
||||
; TODO - for hud-h.gc and ripple
|
||||
(deftype process-drawable (process)
|
||||
((root basic :offset-assert 112)
|
||||
((root trsqv :offset-assert 112)
|
||||
(node-list basic :offset-assert 116)
|
||||
(draw basic :offset-assert 120)
|
||||
(draw draw-control :offset-assert 120)
|
||||
(skel basic :offset-assert 124)
|
||||
(nav basic :offset-assert 128)
|
||||
(align basic :offset-assert 132)
|
||||
@@ -63,4 +63,4 @@
|
||||
(:methods
|
||||
(dummy-9 () none 9)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -285,7 +285,7 @@
|
||||
(deftype merc-ctrl (art-element)
|
||||
((num-joints int32 :offset 20)
|
||||
(header merc-ctrl-header :inline :offset-assert 32)
|
||||
(effect uint8 :dynamic :offset-assert 112)
|
||||
(effect merc-effect :inline :dynamic :offset-assert 112)
|
||||
)
|
||||
:method-count-assert 13
|
||||
:size-assert #x70
|
||||
@@ -345,13 +345,13 @@
|
||||
(far-fade-dist float :offset-assert 16)
|
||||
(faded-scale float :offset-assert 20)
|
||||
(individual-normal-scale float :offset-assert 24)
|
||||
(waveform basic :offset-assert 28)
|
||||
(waveform ripple-wave-set :offset-assert 28)
|
||||
(send-query basic :offset-assert 32)
|
||||
(query basic :offset-assert 36)
|
||||
)
|
||||
(:methods
|
||||
(new (symbol type) _type_ 0)
|
||||
)
|
||||
(:methods
|
||||
(new (symbol type) _type_ 0)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x28
|
||||
:flag-assert #x900000028
|
||||
|
||||
@@ -436,10 +436,12 @@
|
||||
(define-extern vu-lights<-light-group! (function vu-lights light-group none))
|
||||
|
||||
;; game-h - TODO
|
||||
(declare-type trsqv basic)
|
||||
(declare-type draw-control basic)
|
||||
(deftype process-drawable (process)
|
||||
((root basic :offset-assert 112)
|
||||
((root trsqv :offset-assert 112)
|
||||
(node-list basic :offset-assert 116)
|
||||
(draw basic :offset-assert 120)
|
||||
(draw draw-control :offset-assert 120)
|
||||
(skel basic :offset-assert 124)
|
||||
(nav basic :offset-assert 128)
|
||||
(align basic :offset-assert 132)
|
||||
@@ -659,6 +661,17 @@
|
||||
)
|
||||
(define-extern add-debug-line (function symbol int vector vector rgba symbol int int))
|
||||
|
||||
;; early declarations for draw-control
|
||||
(declare-type ripple-control basic)
|
||||
(declare-type shadow-geo basic)
|
||||
(declare-type shadow-control basic)
|
||||
|
||||
;; early declarations for lod-group
|
||||
(declare-type merc-ctrl basic)
|
||||
|
||||
;; TODO - for ripple
|
||||
(define-extern add-debug-sphere (function symbol int vector float int int))
|
||||
|
||||
(defconstant SYM_TO_STRING_OFFSET #xff38)
|
||||
(defmacro symbol->string (sym)
|
||||
"Convert a symbol to a goal string."
|
||||
|
||||
@@ -350,8 +350,8 @@
|
||||
|
||||
;; definition of type lod-group
|
||||
(deftype lod-group (structure)
|
||||
((geo basic :offset-assert 0)
|
||||
(dist float :offset-assert 4)
|
||||
((geo merc-ctrl :offset-assert 0)
|
||||
(dist float :offset-assert 4)
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 9
|
||||
@@ -391,46 +391,46 @@
|
||||
|
||||
;; definition of type draw-control
|
||||
(deftype draw-control (basic)
|
||||
((status uint8 :offset-assert 4)
|
||||
(matrix-type uint8 :offset-assert 5)
|
||||
(data-format uint8 :offset-assert 6)
|
||||
(global-effect uint8 :offset-assert 7)
|
||||
(art-group art-group :offset-assert 8)
|
||||
(jgeo art-joint-geo :offset-assert 12)
|
||||
(mgeo art-mesh-geo :offset-assert 16)
|
||||
(dma-add-func function :offset-assert 20)
|
||||
(skeleton skeleton-group :offset-assert 24)
|
||||
(lod-set lod-set :inline :offset-assert 28)
|
||||
(lod lod-group 4 :inline :offset 28)
|
||||
(max-lod int8 :offset 60)
|
||||
(force-lod int8 :offset-assert 61)
|
||||
(cur-lod int8 :offset-assert 62)
|
||||
(desired-lod int8 :offset-assert 63)
|
||||
(ripple basic :offset-assert 64)
|
||||
(longest-edge float :offset-assert 68)
|
||||
(longest-edge? uint32 :offset 68)
|
||||
(light-index uint8 :offset-assert 72)
|
||||
(dummy uint8 2 :offset-assert 73)
|
||||
(death-draw-overlap uint8 :offset-assert 75)
|
||||
(death-timer uint8 :offset-assert 76)
|
||||
(death-timer-org uint8 :offset-assert 77)
|
||||
(death-vertex-skip uint16 :offset-assert 78)
|
||||
(death-effect uint32 :offset-assert 80)
|
||||
(sink-group basic :offset-assert 84)
|
||||
(process process :offset-assert 88)
|
||||
(shadow basic :offset-assert 92)
|
||||
(shadow-ctrl basic :offset-assert 96)
|
||||
(origin vector :inline :offset-assert 112)
|
||||
(bounds vector :inline :offset-assert 128)
|
||||
(radius float :offset 140)
|
||||
(color-mult rgbaf :inline :offset-assert 144)
|
||||
(color-emissive rgbaf :inline :offset-assert 160)
|
||||
(secondary-interp float :offset-assert 176)
|
||||
(current-secondary-interp float :offset-assert 180)
|
||||
(shadow-mask uint8 :offset-assert 184)
|
||||
(level-index uint8 :offset-assert 185)
|
||||
(origin-joint-index uint8 :offset-assert 186)
|
||||
(shadow-joint-index uint8 :offset-assert 187)
|
||||
((status uint8 :offset-assert 4)
|
||||
(matrix-type uint8 :offset-assert 5)
|
||||
(data-format uint8 :offset-assert 6)
|
||||
(global-effect uint8 :offset-assert 7)
|
||||
(art-group art-group :offset-assert 8)
|
||||
(jgeo art-joint-geo :offset-assert 12)
|
||||
(mgeo art-mesh-geo :offset-assert 16)
|
||||
(dma-add-func function :offset-assert 20)
|
||||
(skeleton skeleton-group :offset-assert 24)
|
||||
(lod-set lod-set :inline :offset-assert 28)
|
||||
(lod lod-group 4 :inline :offset 28)
|
||||
(max-lod int8 :offset 60)
|
||||
(force-lod int8 :offset-assert 61)
|
||||
(cur-lod int8 :offset-assert 62)
|
||||
(desired-lod int8 :offset-assert 63)
|
||||
(ripple ripple-control :offset-assert 64)
|
||||
(longest-edge float :offset-assert 68)
|
||||
(longest-edge? uint32 :offset 68)
|
||||
(light-index uint8 :offset-assert 72)
|
||||
(dummy uint8 2 :offset-assert 73)
|
||||
(death-draw-overlap uint8 :offset-assert 75)
|
||||
(death-timer uint8 :offset-assert 76)
|
||||
(death-timer-org uint8 :offset-assert 77)
|
||||
(death-vertex-skip uint16 :offset-assert 78)
|
||||
(death-effect uint32 :offset-assert 80)
|
||||
(sink-group dma-foreground-sink-group :offset-assert 84)
|
||||
(process process :offset-assert 88)
|
||||
(shadow shadow-geo :offset-assert 92)
|
||||
(shadow-ctrl shadow-control :offset-assert 96)
|
||||
(origin vector :inline :offset-assert 112)
|
||||
(bounds vector :inline :offset-assert 128)
|
||||
(radius float :offset 140)
|
||||
(color-mult rgbaf :inline :offset-assert 144)
|
||||
(color-emissive rgbaf :inline :offset-assert 160)
|
||||
(secondary-interp float :offset-assert 176)
|
||||
(current-secondary-interp float :offset-assert 180)
|
||||
(shadow-mask uint8 :offset-assert 184)
|
||||
(level-index uint8 :offset-assert 185)
|
||||
(origin-joint-index uint8 :offset-assert 186)
|
||||
(shadow-joint-index uint8 :offset-assert 187)
|
||||
)
|
||||
:method-count-assert 12
|
||||
:size-assert #xbc
|
||||
@@ -500,7 +500,3 @@
|
||||
;; failed to figure out what this is:
|
||||
(let ((v0-21 0))
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -563,8 +563,8 @@
|
||||
;; definition of type merc-ctrl
|
||||
(deftype merc-ctrl (art-element)
|
||||
((num-joints int32 :offset 20)
|
||||
(header merc-ctrl-header :inline :offset-assert 32)
|
||||
(effect uint8 :dynamic :offset-assert 112)
|
||||
(header merc-ctrl-header :inline :offset-assert 32)
|
||||
(effect merc-effect :inline :dynamic :offset-assert 112)
|
||||
)
|
||||
:method-count-assert 13
|
||||
:size-assert #x70
|
||||
@@ -664,15 +664,15 @@
|
||||
|
||||
;; definition of type ripple-control
|
||||
(deftype ripple-control (basic)
|
||||
((global-scale float :offset-assert 4)
|
||||
(last-frame-scale float :offset-assert 8)
|
||||
(close-fade-dist float :offset-assert 12)
|
||||
(far-fade-dist float :offset-assert 16)
|
||||
(faded-scale float :offset-assert 20)
|
||||
(individual-normal-scale float :offset-assert 24)
|
||||
(waveform basic :offset-assert 28)
|
||||
(send-query basic :offset-assert 32)
|
||||
(query basic :offset-assert 36)
|
||||
((global-scale float :offset-assert 4)
|
||||
(last-frame-scale float :offset-assert 8)
|
||||
(close-fade-dist float :offset-assert 12)
|
||||
(far-fade-dist float :offset-assert 16)
|
||||
(faded-scale float :offset-assert 20)
|
||||
(individual-normal-scale float :offset-assert 24)
|
||||
(waveform ripple-wave-set :offset-assert 28)
|
||||
(send-query basic :offset-assert 32)
|
||||
(query basic :offset-assert 36)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x28
|
||||
@@ -720,7 +720,3 @@
|
||||
;; failed to figure out what this is:
|
||||
(let ((v0-23 0))
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,269 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type ripple-request
|
||||
(deftype ripple-request (structure)
|
||||
((waveform ripple-wave :offset-assert 0)
|
||||
(effect merc-effect :offset-assert 4)
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 9
|
||||
:size-assert #x8
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
|
||||
;; definition for method 3 of type ripple-request
|
||||
(defmethod inspect ripple-request ((obj ripple-request))
|
||||
(format #t "[~8x] ~A~%" obj 'ripple-request)
|
||||
(format #t "~Twaveform: ~A~%" (-> obj waveform))
|
||||
(format #t "~Teffect: #<merc-effect @ #x~X>~%" (-> obj effect))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type ripple-globals
|
||||
(deftype ripple-globals (structure)
|
||||
((count int32 :offset-assert 0)
|
||||
(requests ripple-request 16 :inline :offset-assert 4)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x84
|
||||
:flag-assert #x900000084
|
||||
)
|
||||
|
||||
;; definition for method 3 of type ripple-globals
|
||||
(defmethod inspect ripple-globals ((obj ripple-globals))
|
||||
(format #t "[~8x] ~A~%" obj 'ripple-globals)
|
||||
(format #t "~Tcount: ~D~%" (-> obj count))
|
||||
(format #t "~Trequests[16] @ #x~X~%" (-> obj requests))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition for symbol *ripple-globals*, type ripple-globals
|
||||
(define *ripple-globals* (new 'global 'ripple-globals))
|
||||
|
||||
;; definition for function ripple-make-request
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun ripple-make-request ((arg0 ripple-wave) (arg1 merc-effect))
|
||||
(let ((v1-1 (-> *ripple-globals* count))
|
||||
(a2-1 (-> *ripple-globals* requests))
|
||||
(a3-0 0)
|
||||
)
|
||||
(when (< v1-1 16)
|
||||
(dotimes (t0-1 v1-1)
|
||||
(if (= arg1 (-> a2-1 t0-1 effect))
|
||||
(set! a3-0 1)
|
||||
)
|
||||
)
|
||||
(when (zero? a3-0)
|
||||
(set! (-> a2-1 v1-1 effect) arg1)
|
||||
(set! (-> a2-1 v1-1 waveform) arg0)
|
||||
(set! (-> *ripple-globals* count) (+ (-> *ripple-globals* count) 1))
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v0-0 0))
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function ripple-update-waveform-offs
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun ripple-update-waveform-offs ((arg0 ripple-wave-set))
|
||||
(let
|
||||
((f0-1
|
||||
(the float (- (-> *display* integral-frame-counter) (-> arg0 frame-save)))
|
||||
)
|
||||
)
|
||||
(when (!= f0-1 0.0)
|
||||
(dotimes (v1-4 (-> arg0 count))
|
||||
(let ((a1-4 (-> arg0 wave v1-4)))
|
||||
(set! (-> a1-4 offs) (+ (-> a1-4 offs) (* f0-1 (-> a1-4 delta))))
|
||||
(set! (-> a1-4 offs) (the float (logand (the int (-> a1-4 offs)) #xffff)))
|
||||
)
|
||||
)
|
||||
(set! (-> arg0 frame-save) (-> *display* integral-frame-counter))
|
||||
)
|
||||
)
|
||||
(let ((v0-0 0))
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function ripple-execute-init
|
||||
;; ERROR: function was not converted to expressions. Cannot decompile.
|
||||
|
||||
;; definition for function ripple-create-wave-table
|
||||
;; ERROR: function was not converted to expressions. Cannot decompile.
|
||||
|
||||
;; definition for function ripple-apply-wave-table
|
||||
;; ERROR: function was not converted to expressions. Cannot decompile.
|
||||
|
||||
;; definition for function ripple-execute
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun ripple-execute ()
|
||||
(when (-> *ripple-globals* count)
|
||||
(ripple-execute-init)
|
||||
(let ((gp-0 0)
|
||||
(s5-0 (-> *ripple-globals* count))
|
||||
(s4-0 (-> *ripple-globals* requests))
|
||||
)
|
||||
(while (!= gp-0 s5-0)
|
||||
(when (-> s4-0 gp-0 waveform)
|
||||
(let ((s3-0 gp-0)
|
||||
(s2-0 (-> s4-0 gp-0 waveform))
|
||||
)
|
||||
(ripple-create-wave-table (the-as ripple-wave-set s2-0))
|
||||
(while (!= s3-0 s5-0)
|
||||
(when (= s2-0 (-> s4-0 s3-0 waveform))
|
||||
(ripple-apply-wave-table (-> s4-0 s3-0 effect))
|
||||
(set! (-> s4-0 s3-0 waveform) #f)
|
||||
)
|
||||
(+! s3-0 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(+! gp-0 1)
|
||||
)
|
||||
)
|
||||
(set! (-> *ripple-globals* count) 0)
|
||||
(let ((v0-3 0))
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function ripple-matrix-scale
|
||||
;; ERROR: function was not converted to expressions. Cannot decompile.
|
||||
|
||||
;; definition (debug) for function ripple-add-debug-sphere
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
;; Used lq/sq
|
||||
(defun-debug
|
||||
ripple-add-debug-sphere
|
||||
((arg0 process-drawable) (arg1 vector) (arg2 float) (arg3 float))
|
||||
(rlet ((vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((f30-0 (- (quaternion-y-angle (the-as quaternion (-> arg0 root rot)))))
|
||||
(s5-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(set! (-> s5-0 quad) (the-as uint128 0))
|
||||
(let ((f28-0 (+ (-> arg1 x) (* arg2 (-> arg1 z))))
|
||||
(f26-0 (+ (-> arg1 y) (* arg3 (-> arg1 z))))
|
||||
)
|
||||
(set! (-> s5-0 x) (- (* f28-0 (cos f30-0)) (* f26-0 (sin f30-0))))
|
||||
(set! (-> s5-0 y) 0.0)
|
||||
(set! (-> s5-0 z) (+ (* f26-0 (cos f30-0)) (* f28-0 (sin f30-0))))
|
||||
)
|
||||
(set! (-> s5-0 w) 0.0)
|
||||
(let ((a0-6 s5-0))
|
||||
(let ((v1-1 s5-0)
|
||||
(a1-2 (-> arg0 root trans))
|
||||
)
|
||||
(.mov.vf vf6 vf0 :mask #b1000)
|
||||
(.lvf vf4 (&-> v1-1 quad))
|
||||
(.lvf vf5 (&-> a1-2 quad))
|
||||
)
|
||||
(.add.vf vf6 vf4 vf5 :mask #b111)
|
||||
(.svf (&-> a0-6 quad) vf6)
|
||||
)
|
||||
(add-debug-sphere #t 67 s5-0 2048.0 (the-as int #x8000ffff))
|
||||
)
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function ripple-slow-add-sine-waves
|
||||
(defun
|
||||
ripple-slow-add-sine-waves
|
||||
((arg0 ripple-wave-set) (arg1 float) (arg2 float))
|
||||
(let ((f30-0 0.0))
|
||||
(dotimes (s3-0 (-> arg0 count))
|
||||
(let* ((v1-3 (-> arg0 wave s3-0))
|
||||
(f0-2
|
||||
(+
|
||||
(+ (-> v1-3 offs) (* arg1 (-> v1-3 xmul)))
|
||||
(* arg2 (-> v1-3 zmul))
|
||||
)
|
||||
)
|
||||
)
|
||||
(+! f30-0 (* (-> v1-3 scale) (cos f0-2)))
|
||||
)
|
||||
)
|
||||
(fmax -127.0 (fmin 127.0 f30-0))
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function ripple-find-height
|
||||
(defun ripple-find-height ((arg0 process-drawable) (arg1 basic) (arg2 vector))
|
||||
(local-vars (sv-16 float) (sv-32 float))
|
||||
(let* ((f30-0 (-> arg0 root trans y))
|
||||
(v1-1 (-> arg0 draw))
|
||||
(a1-4 (-> v1-1 lod-set lod (-> v1-1 cur-lod) geo effect))
|
||||
)
|
||||
(if (or (zero? (logand (-> a1-4 0 effect-bits) 4)) (not (-> v1-1 ripple)))
|
||||
(return f30-0)
|
||||
)
|
||||
(let* ((a1-5 (-> a1-4 0 extra-info))
|
||||
(s4-0
|
||||
(the-as
|
||||
mei-ripple
|
||||
(+ (the-as uint a1-5) (the-as uint (* (-> a1-5 ripple-offset) 16)))
|
||||
)
|
||||
)
|
||||
(gp-0 (-> v1-1 ripple))
|
||||
(s5-0 (-> gp-0 waveform))
|
||||
)
|
||||
(if (not (-> gp-0 waveform))
|
||||
(return f30-0)
|
||||
)
|
||||
(if (not (-> s5-0 converted))
|
||||
(return f30-0)
|
||||
)
|
||||
(let* ((f28-0 (- (-> arg2 x) (-> arg0 root trans x)))
|
||||
(f26-0 (- (-> arg2 z) (-> arg0 root trans z)))
|
||||
(f22-0
|
||||
(+
|
||||
(quaternion-y-angle (the-as quaternion (-> arg0 root rot)))
|
||||
(-> s4-0 angle)
|
||||
)
|
||||
)
|
||||
(f24-0 (cos f22-0))
|
||||
(f1-3 (sin f22-0))
|
||||
(f0-4 (- (* f28-0 f24-0) (* f26-0 f1-3)))
|
||||
(f1-5 (+ (* f26-0 f24-0) (* f28-0 f1-3)))
|
||||
(f2-3 (/ 1.0 (-> s4-0 grid-size)))
|
||||
(f28-1 (* f2-3 (- f0-4 (-> s4-0 x-base))))
|
||||
(f26-1 (* f2-3 (- f1-5 (-> s4-0 z-base))))
|
||||
)
|
||||
(ripple-update-waveform-offs s5-0)
|
||||
(let* ((f22-1 (the float (the int f28-1)))
|
||||
(f24-1 (the float (the int f26-1)))
|
||||
(f20-0 (ripple-slow-add-sine-waves s5-0 f22-1 f24-1))
|
||||
)
|
||||
(set! sv-16 (ripple-slow-add-sine-waves s5-0 (+ 1.0 f22-1) f24-1))
|
||||
(set! sv-32 (ripple-slow-add-sine-waves s5-0 f22-1 (+ 1.0 f24-1)))
|
||||
(let*
|
||||
((f1-6 (ripple-slow-add-sine-waves s5-0 (+ 1.0 f22-1) (+ 1.0 f24-1)))
|
||||
(f0-22 (+ f20-0 (* (- f28-1 f22-1) (- sv-16 f20-0))))
|
||||
(f1-9 (+ sv-32 (* (- f28-1 f22-1) (- f1-6 sv-32))))
|
||||
(f1-12 (+ f0-22 (* (- f26-1 f24-1) (- f1-9 f0-22))))
|
||||
(f0-23 (-> gp-0 faded-scale))
|
||||
)
|
||||
(if (< f0-23 0.0)
|
||||
(set! f0-23 (-> gp-0 global-scale))
|
||||
)
|
||||
(+ f30-0 (* (* 0.0078125 f1-12) f0-23))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -62,6 +62,11 @@ const std::unordered_set<std::string> g_functions_expected_to_reject = {
|
||||
"vif1-handler", "vif1-handler-debug",
|
||||
// stats-h
|
||||
"(method 11 perf-stat)", "(method 12 perf-stat)",
|
||||
// ripple - asm
|
||||
"ripple-execute-init", "ripple-create-wave-table", "ripple-apply-wave-table",
|
||||
"ripple-matrix-scale",
|
||||
// ripple - calls an asm function
|
||||
"ripple-execute",
|
||||
|
||||
// sync-info
|
||||
"(method 15 sync-info)", // needs *res-static-buf*
|
||||
@@ -72,11 +77,17 @@ const std::unordered_set<std::string> g_functions_expected_to_reject = {
|
||||
const std::unordered_set<std::string> g_functions_to_skip_compiling = {
|
||||
/// GCOMMON
|
||||
// these functions are not implemented by the compiler in OpenGOAL, but are in GOAL.
|
||||
"abs", "ash", "min", "max", "lognor",
|
||||
"abs",
|
||||
"ash",
|
||||
"min",
|
||||
"max",
|
||||
"lognor",
|
||||
// weird PS2 specific debug registers:
|
||||
"breakpoint-range-set!",
|
||||
// does weird stuff with the type system.
|
||||
"print", "printl", "inspect",
|
||||
"print",
|
||||
"printl",
|
||||
"inspect",
|
||||
// inline assembly
|
||||
"valid?",
|
||||
|
||||
@@ -93,8 +104,10 @@ const std::unordered_set<std::string> g_functions_to_skip_compiling = {
|
||||
"send-event-function", // pp asm (eventually we should make this work)
|
||||
|
||||
/// MATH
|
||||
"rand-vu-init", "rand-vu", "rand-vu-nostep", // random hardware
|
||||
"log2", // weird tricky int-as-float stuff
|
||||
"rand-vu-init",
|
||||
"rand-vu",
|
||||
"rand-vu-nostep", // random hardware
|
||||
"log2", // weird tricky int-as-float stuff
|
||||
|
||||
// trig
|
||||
"sin-rad", // fpu acc
|
||||
@@ -118,14 +131,19 @@ const std::unordered_set<std::string> g_functions_to_skip_compiling = {
|
||||
"disasm-dma-list", // missing a single cast :(
|
||||
|
||||
// math camera
|
||||
"transform-point-vector!", "transform-point-qword!", "transform-point-vector-scale!",
|
||||
"transform-point-vector!",
|
||||
"transform-point-qword!",
|
||||
"transform-point-vector-scale!",
|
||||
|
||||
// display-h
|
||||
"put-draw-env",
|
||||
|
||||
// vector
|
||||
// bad decisions on float vs int128
|
||||
"vector-degf", "vector-degmod", "vector-deg-diff", "vector-degi",
|
||||
"vector-degf",
|
||||
"vector-degmod",
|
||||
"vector-deg-diff",
|
||||
"vector-degi",
|
||||
|
||||
// asm
|
||||
"invalidate-cache-line",
|
||||
@@ -137,6 +155,9 @@ const std::unordered_set<std::string> g_functions_to_skip_compiling = {
|
||||
"(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
|
||||
|
||||
// ripple - calls an asm function
|
||||
"ripple-execute",
|
||||
};
|
||||
|
||||
// default location for the data. It can be changed with a command line argument.
|
||||
|
||||
Reference in New Issue
Block a user