This commit is contained in:
Hat Kid
2024-04-06 00:42:28 +02:00
parent fd079dc9c3
commit 1f56415307
6 changed files with 2138 additions and 22 deletions
+167 -1
View File
@@ -1513,7 +1513,173 @@
)
;; definition for function foreground-draw-hud
;; ERROR: function was not converted to expressions. Cannot decompile.
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
;; ERROR: Unsupported inline assembly instruction kind - [lui at, 28672]
(defun foreground-draw-hud ((arg0 draw-control) (arg1 dma-buffer) (arg2 float))
(local-vars (at-0 int) (a0-2 (pointer uint128)) (t2-8 object) (t3-3 uint) (t3-4 uint) (t3-5 uint) (t3-6 uint))
(.lui at-0 28672)
(let* ((a2-1 (-> arg1 base))
(v1-0 (the-as object (&+ a2-1 64)))
)
(let ((a3-0 (logand (the-as int v1-0) 48)))
(b! (zero? a3-0) cfg-2 :delay (nop!))
(set! v1-0 (&- (&+ (the-as pointer v1-0) 64) (the-as uint a3-0)))
)
(label cfg-2)
(let* ((t1-0 (+ (-> arg0 mgeo length) 3))
(a3-3 (* t1-0 128))
)
(let ((t0-1 (-> (the-as foreground-work #x70000000) regs)))
(set! (-> t0-1 joint-ptr) (the-as (inline-array joint) (-> arg0 jgeo data 0)))
(set! (-> t0-1 bone-ptr) (-> arg0 skeleton bones))
(set! (-> t0-1 num-bones) (the-as uint t1-0))
(set! (-> t0-1 dist) 0.0)
(set! (-> t0-1 dma-buf) arg1)
(set! (-> t0-1 level-buckets)
(-> (the-as foreground-work #x70000000)
grid
level-buckets
(-> (the-as foreground-work #x70000000) draw-index-map (-> arg0 level-index))
)
)
)
(let ((t1-5 v1-0)
(t2-5 2)
(t5-0 (-> (the-as foreground-work #x70000000) regs))
(a1-6 *bone-calculation-list*)
(t0-2 a2-1)
)
(let ((t3-0 (-> t5-0 joint-ptr))
(t4-0 (-> t5-0 bone-ptr))
(t5-1 (-> t5-0 num-bones))
(t6-0 t0-2)
)
(set! (-> (the-as (pointer int16) t6-0)) t2-5)
(s.h! (+ t6-0 2) t5-1)
(s.w! (+ t6-0 4) t1-5)
(s.w! (+ t6-0 8) t3-0)
(s.w! (+ t6-0 12) t4-0)
(s.w! (+ t6-0 32) 0)
)
(if (nonzero? (-> a1-6 next))
(set! (-> a1-6 next next) (the-as bone-calculation t0-2))
)
(if (zero? (-> a1-6 first))
(set! (-> a1-6 first) (the-as bone-calculation t0-2))
)
(set! (-> a1-6 next) (the-as bone-calculation t0-2))
)
(&+ a2-1 48)
(let ((a1-8 (the-as object (+ (the-as uint v1-0) a3-3))))
(s.w! (+ at-0 36) v1-0)
(let ((v1-3 (-> *foreground* merc-bucket-info)))
(when (= (-> arg0 data-format) (draw-control-data-format merc))
(let ((a2-4 (-> arg0 lod-set lod 0 geo))
(a3-5 0)
)
(b! #t cfg-22 :delay (nop!))
(label cfg-8)
(b! (not (logtest? (-> a2-4 effect a3-5 effect-usage) 1)) cfg-17 :delay (nop!))
(let* ((t1-13 (-> v1-3 light))
(t2-7 (-> (the-as foreground-work #x70000000) lights))
(t0-9 7)
(t1-14 (the-as object t1-13))
)
(b! (< (+ t0-9 -4) 0) cfg-11 :delay (set! t2-8 t2-7))
(nop!)
(let ((t6-1 (-> (the-as (pointer uint128) t2-8) 0)))
(nop!)
(let ((t3-2 (-> (the-as (pointer uint128) t2-8) 1)))
(+! t0-9 -4)
(let ((t4-1 (-> (the-as (pointer uint128) t2-8) 2)))
(set! t1-14 (-> (the-as vu-lights t1-14) color 1))
(let ((t5-2 (-> (the-as (pointer uint128) t2-8) 3)))
(set! t2-8 (&-> (the-as (pointer uint128) t2-8) 4))
(set! (-> (the-as (pointer uint128) t1-14) -4) t6-1)
(let ((t6-2 (+ t0-9 -4)))
(set! (-> (the-as (pointer uint128) t1-14) -3) t3-2)
(nop!)
(set! (-> (the-as (pointer uint128) t1-14) -2) t4-1)
(b! (>= t6-2 0) cfg-10 :delay (set! (-> (the-as (pointer uint128) t1-14) -1) t5-2))
)
)
)
)
)
(label cfg-11)
(b! (zero? t0-9) cfg-16 :delay (set! t3-3 (the-as uint (-> (the-as (pointer uint128) t2-8) 0))))
(let ((t2-9 (&-> (the-as (pointer uint128) t2-8) 1))
(t1-15 (the-as object (&-> (the-as (pointer uint128) t1-14) 1)))
(t0-10 (+ t0-9 -1))
)
(s.q! (+ (the-as vu-lights t1-15) -16) t3-3)
(b! (zero? t0-10) cfg-16 :delay (set! t3-4 (the-as uint (-> t2-9 0))))
(let ((t2-10 (&-> t2-9 1))
(t1-16 (&-> (the-as (pointer uint128) t1-15) 1))
(t0-11 (+ t0-10 -1))
)
(set! (-> t1-16 -1) (the-as uint128 t3-4))
(b! (zero? t0-11) cfg-16 :delay (set! t3-5 (the-as uint (-> t2-10 0))))
(let ((t2-11 (&-> t2-10 1))
(t1-17 (&-> t1-16 1))
(t0-12 (+ t0-11 -1))
)
(set! (-> t1-17 -1) (the-as uint128 t3-5))
(b! (zero? t0-12) cfg-16 :delay (set! t3-6 (the-as uint (-> t2-11 0))))
(&-> t2-11 1)
(let ((t1-18 (&-> t1-17 1)))
(+ t0-12 -1)
(set! (-> t1-18 -1) (the-as uint128 t3-6))
)
)
)
)
)
(label cfg-16)
0
(set! (-> v1-3 effect a3-5 color-fade) (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80))
(set! (-> v1-3 effect a3-5 merc-path) (the-as uint 2))
(b! #t cfg-18 :delay (nop!))
(label cfg-17)
(set! (-> v1-3 effect a3-5 merc-path) (the-as uint 2))
(label cfg-18)
(set! (-> v1-3 effect a3-5 disable-draw) (the-as uint 0))
(set! (-> v1-3 effect a3-5 ignore-alpha)
(the-as uint (if (logtest? (-> a2-4 effect a3-5 effect-bits) (effect-bits ignore-alpha))
1
0
)
)
)
(+! a3-5 1)
(label cfg-22)
(b! (< a3-5 (the-as int (-> a2-4 header effect-count))) cfg-8)
)
(if (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask generic))
(set! a1-8 (foreground-generic-merc arg0 (the-as pointer a1-8) 1))
)
)
)
(let ((v1-11 (logand (the-as int a1-8) 48)))
0
(b! (zero? v1-11) cfg-27 :delay (set! a0-2 (the-as (pointer uint128) #x20000000)))
(s.q! a1-8 a0-2)
(let ((a0-3 a1-8))
(set! a1-8 (+ (- (the-as int a1-8) (the-as uint v1-11)) 64))
(s.w! (+ a0-3 4) (the-as int a1-8))
)
)
(label cfg-27)
(set! (-> (the-as foreground-work #x70000000) regs dma-buf base)
(the-as pointer (logand a1-8 (the-as uint #xfffffff)))
)
)
)
)
0
(none)
)
;; failed to figure out what this is:
(kmemopen global "foreground-engine")
+23 -17
View File
@@ -4,7 +4,7 @@
;; definition of type mood-channel
(deftype mood-channel (structure)
((data float 24)
(vecs vector4 6 :overlay-at (-> data 0))
(vecs vector4 6 :inline :overlay-at (-> data 0))
)
)
@@ -71,7 +71,8 @@
;; definition of type mood-fog-table
(deftype mood-fog-table (structure)
((data mood-fog 8 :inline)
((data mood-fog 8 :inline)
(_data uint128 24 :overlay-at data)
)
)
@@ -127,7 +128,8 @@
;; definition of type mood-color-table
(deftype mood-color-table (structure)
((data mood-color 8 :inline)
((data mood-color 8 :inline)
(_data uint128 16 :overlay-at data)
)
)
@@ -308,6 +310,7 @@
((time float)
(fade float)
)
:pack-me
)
;; definition for method 3 of type light-state
@@ -328,6 +331,7 @@
((flicker-off uint8)
(flicker-on uint8)
)
:allow-misaligned
)
;; definition for method 3 of type flicker-state
@@ -434,6 +438,7 @@
(length uint8)
(height uint8)
)
:pack-me
)
;; definition for method 3 of type flames-state
@@ -528,6 +533,7 @@
(deftype mood-context (mood-context-core3)
((itimes vector4w 4 :inline)
(state uint32 32)
(data uint128 123 :overlay-at (-> current-fog fog-color data 0))
)
)
@@ -624,22 +630,22 @@
(clouds mood-clouds 9)
)
(:methods
(mood-control-method-9 () none)
(mood-control-method-10 () none)
(mood-control-method-11 () none)
(mood-control-method-12 () none)
(init-weather! (_type_) none)
(set-cloud-and-fog-interp! (_type_ float float float float) none)
(update-mood-range! (_type_ float float float float) none)
(set-time-for-random-weather! (_type_ float float) none)
(set-special-interps! (_type_ float float symbol) none)
(weather-event-concluded? (_type_) symbol)
(mood-control-method-15 () none)
(mood-control-method-16 () none)
(mood-control-method-17 () none)
(mood-control-method-18 () none)
(mood-control-method-19 () none)
(mood-control-method-20 () none)
(mood-control-method-21 () none)
(mood-control-method-22 () none)
(mood-control-method-23 () none)
(mood-control-method-24 () none)
(set-lightning-time! (_type_ int int float) none)
(apply-mood-clouds-and-fog (_type_ mood-control-work) none)
(apply-mood-fog (_type_ mood-control-work mood-color-table mood-color-table mood-color-table float) none)
(apply-fog-height (_type_ mood-control-work float float float float) none)
(apply-mood-colors (_type_ mood-control-work) none)
(mood-control-method-20 (_type_ mood-control-work mood-color-table mood-color-table mood-color-table float) none)
(apply-mood-channels (_type_ mood-control-work) none)
(adjust-num-clouds (_type_ mood-control-work) none)
(gen-lightning-and-thunder! (_type_ int) none)
(play-or-stop-lightning-sfx! (_type_ sound-spec vector) none)
)
)
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -406,9 +406,9 @@
(disable-day-star basic)
)
(:methods
(sky-work-method-9 () none)
(sky-work-method-10 () none)
(sky-work-method-11 () none)
(init-sun-data! (_type_ int float float float) none)
(init-orbit-settings! (_type_ int float float float float float float) none)
(update-colors-for-time (_type_ float) none)
(update-time-and-speed (_type_ float float) none)
(sky-work-method-13 () none)
(draw (_type_) none)
+1
View File
@@ -60,6 +60,7 @@ This probably started as a very simple structure, but now it is extremely compli
(cam-outside-bsp uint8 :offset 152)
(cam-using-back uint8)
(cam-box-idx uint16)
(ambients symbol)
(subdivide-close float :offset 160)
(subdivide-far float)
(race-meshes (array entity-race-mesh))
+3 -1
View File
@@ -172,7 +172,9 @@
"sparticle-motion-blur", // clipping
"birth-func-texture-group",
// script
"command-get-process"
"command-get-process",
// mood
"update-mood-direction"
],
"skip_compile_states": {}