[decompiler] fix missing casts issue (#573)

* fix casts issue

* fix bug

* one last small fix
This commit is contained in:
water111
2021-06-09 21:35:13 -04:00
committed by GitHub
parent 12d72c7897
commit 92afd62e2c
102 changed files with 340 additions and 528 deletions
@@ -226,9 +226,5 @@
)
;; failed to figure out what this is:
(let ((v0-9 0))
(let ((v0-18 0))
)
@@ -192,5 +192,5 @@
)
;; failed to figure out what this is:
(let ((v0-5 0))
(let ((v0-10 0))
)
@@ -153,5 +153,5 @@
)
;; failed to figure out what this is:
(let ((v0-6 0))
(let ((v0-13 0))
)
@@ -842,5 +842,5 @@
)
;; failed to figure out what this is:
(let ((v0-11 0))
(let ((v0-28 0))
)
@@ -191,6 +191,5 @@
)
;; failed to figure out what this is:
(let ((v0-3 0))
(let ((v0-6 0))
)
@@ -145,8 +145,7 @@
)
)
(fog-corrector-setup *math-camera-fog-correction* math-cam)
(let ((v0-1 (matrix-identity! (-> math-cam camera-rot))))
)
(matrix-identity! (-> math-cam camera-rot))
(let ((fog-constant-1 100.0)
(fog-constant-2 16760631.0)
)
@@ -47,9 +47,5 @@
)
;; failed to figure out what this is:
(let ((v0-1 0))
(let ((v0-2 0))
)
@@ -104,9 +104,5 @@
)
;; failed to figure out what this is:
(let ((v0-5 0))
(let ((v0-9 0))
)
@@ -617,7 +617,7 @@
)
(set! (-> obj pat) (the-as uint 16))
(set! (-> obj prim-core prim-type) -1)
(the-as collide-shape-prim-sphere (the-as collide-shape-prim obj))
(the-as collide-shape-prim-sphere obj)
)
)
@@ -650,7 +650,7 @@
(set! (-> obj mesh-id) (the-as int mesh-id))
(set! (-> obj mesh-cache-id) (the-as uint 0))
(set! (-> obj prim-core prim-type) 1)
(the-as collide-shape-prim-mesh (the-as collide-shape-prim obj))
(the-as collide-shape-prim-mesh obj)
)
)
@@ -687,7 +687,7 @@
(set! (-> obj prim elt-count) (the-as uint #f))
(nop!)
)
(the-as collide-shape-prim-group (the-as collide-shape-prim obj))
(the-as collide-shape-prim-group obj)
)
)
@@ -853,7 +853,3 @@
:mesh #f
)
)
@@ -504,5 +504,5 @@
)
;; failed to figure out what this is:
(let ((v0-21 0))
(let ((v0-37 0))
)
@@ -63,7 +63,5 @@
(define *res-key-string* (new 'global 'string 64 (the-as string #f)))
;; failed to figure out what this is:
(let ((v0-3 0))
(let ((v0-4 0))
)
@@ -66,9 +66,5 @@
)
;; failed to figure out what this is:
(let ((v0-3 0))
(let ((v0-6 0))
)
@@ -734,16 +734,16 @@
(set! qwc (the-as int (-> current-tag qwc)))
(when mode-2
(let
((v0-9
((v0-10
(disasm-vif-tag (&-> data-2 vif0) 2 stream-2 (= mode-2 'details))
)
)
(disasm-vif-tag
(the-as
(pointer vif-tag)
(+ (the-as uint addr) (the-as uint v0-9))
(+ (the-as uint addr) (the-as uint v0-10))
)
(the-as int (- (* qwc 4) (the-as uint (/ v0-9 4))))
(the-as int (- (* qwc 4) (the-as uint (/ v0-10 4))))
stream-2
(= mode-2 'details)
)
@@ -878,7 +878,7 @@
(set! addr (&-> (the-as (pointer uint64) data-2) 2))
(set! qwc (the-as int (-> current-tag qwc)))
(set! end-condition #t)
(let ((v0-16 (if mode-2
(let ((v0-17 (if mode-2
(disasm-vif-tag
(the-as
(pointer vif-tag)
@@ -50,7 +50,7 @@
(.sync.l)
(set! (-> arg0 chcr) (new 'static 'dma-chcr :str #x1))
(.sync.l)
(let ((v0-1 0))
(let ((v0-2 0))
)
(none)
)
@@ -82,7 +82,7 @@
(new 'static 'dma-chcr :dir #x1 :mod #x1 :tte #x1 :str #x1)
)
(.sync.l)
(let ((v0-1 0))
(let ((v0-2 0))
)
(none)
)
@@ -111,7 +111,7 @@
(.sync.l)
(set! (-> arg0 chcr) (new 'static 'dma-chcr :dir #x1 :mod #x1 :str #x1))
(.sync.l)
(let ((v0-1 0))
(let ((v0-2 0))
)
(none)
)
@@ -167,7 +167,7 @@
(dma-sync (the-as pointer s5-0) 0 0)
)
)
(let ((v0-2 0))
(let ((v0-3 0))
)
(none)
)
@@ -218,7 +218,7 @@
(dma-sync (the-as pointer s5-0) 0 0)
)
)
(let ((v0-2 0))
(let ((v0-3 0))
)
(none)
)
@@ -351,7 +351,7 @@
(reset-path)
(reset-graph 1 1 *video-reset-parm* 1)
(format 0 "gkernel: vif1 path reset!~%")
(let ((v0-3 0))
(let ((v0-5 0))
)
(none)
)
@@ -397,7 +397,7 @@
)
)
)
(let ((v0-4 0))
(let ((v0-5 0))
)
(none)
)
@@ -46,9 +46,5 @@
)
;; failed to figure out what this is:
(let ((v0-3 0))
(let ((v0-5 0))
)
@@ -111,5 +111,5 @@
)
;; failed to figure out what this is:
(let ((v0-5 0))
(let ((v0-10 0))
)
@@ -49,5 +49,5 @@
)
;; failed to figure out what this is:
(let ((v0-2 0))
(let ((v0-4 0))
)
@@ -20,7 +20,5 @@
)
;; failed to figure out what this is:
(let ((v0-1 0))
(let ((v0-2 0))
)
@@ -114,11 +114,10 @@
;; definition for function num-func-blend-in!
(defun num-func-blend-in! ((arg0 joint-control-channel) (arg1 float))
(let*
((v0-0
(let
((f30-0
(seek (-> arg0 frame-interp) 1.0 (* arg1 (-> *display* time-adjust-ratio)))
)
(f30-0 (the-as float v0-0))
)
(set! (-> arg0 frame-interp) f30-0)
(set! (-> arg0 frame-interp) f30-0)
@@ -158,7 +157,3 @@
;; failed to figure out what this is:
(let ((v0-0 0))
)
@@ -164,10 +164,16 @@
((allocation symbol) (type-to-make type) (name basic) (length int))
(let
((obj
(object-new
allocation
type-to-make
(the-as int (+ (-> type-to-make size) (the-as uint (* (+ length -1) 32))))
(the-as
object
(object-new
allocation
type-to-make
(the-as
int
(+ (-> type-to-make size) (the-as uint (* (+ length -1) 32)))
)
)
)
)
)
@@ -310,5 +310,5 @@
)
;; failed to figure out what this is:
(let ((v0-12 0))
(let ((v0-20 0))
)
@@ -81,9 +81,5 @@
)
;; failed to figure out what this is:
(let ((v0-1 0))
(let ((v0-4 0))
)
@@ -189,5 +189,5 @@
)
;; failed to figure out what this is:
(let ((v0-4 0))
(let ((v0-8 0))
)
@@ -348,9 +348,5 @@
)
;; failed to figure out what this is:
(let ((v0-9 0))
(let ((v0-18 0))
)
@@ -326,5 +326,5 @@
)
;; failed to figure out what this is:
(let ((v0-2 0))
(let ((v0-4 0))
)
@@ -116,9 +116,5 @@
)
;; failed to figure out what this is:
(let ((v0-3 0))
(let ((v0-6 0))
)
@@ -218,9 +218,5 @@
)
;; failed to figure out what this is:
(let ((v0-3 0))
(let ((v0-7 0))
)
@@ -74,6 +74,5 @@
)
;; failed to figure out what this is:
(let ((v0-3 0))
(let ((v0-6 0))
)
@@ -190,9 +190,5 @@
)
;; failed to figure out what this is:
(let ((v0-4 0))
(let ((v0-8 0))
)
@@ -65,6 +65,5 @@
)
;; failed to figure out what this is:
(let ((v0-3 0))
(let ((v0-6 0))
)
@@ -54,7 +54,5 @@
)
;; failed to figure out what this is:
(let ((v0-2 0))
(let ((v0-4 0))
)
@@ -80,9 +80,5 @@
)
;; failed to figure out what this is:
(let ((v0-1 0))
(let ((v0-2 0))
)
@@ -24,9 +24,5 @@
)
;; failed to figure out what this is:
(let ((v0-1 0))
(let ((v0-2 0))
)
@@ -64,9 +64,5 @@
)
;; failed to figure out what this is:
(let ((v0-2 0))
(let ((v0-4 0))
)
@@ -107,5 +107,5 @@
)
;; failed to figure out what this is:
(let ((v0-4 0))
(let ((v0-8 0))
)
@@ -774,5 +774,5 @@
)
;; failed to figure out what this is:
(let ((v0-4 0))
(let ((v0-20 0))
)
@@ -80,9 +80,5 @@
)
;; failed to figure out what this is:
(let ((v0-3 0))
(let ((v0-6 0))
)
@@ -185,9 +185,5 @@
(define *generic-debug* (new 'global 'generic-debug))
;; failed to figure out what this is:
(let ((v0-9 0))
(let ((v0-17 0))
)
@@ -345,9 +345,5 @@
(define *post-draw-hook* nothing)
;; failed to figure out what this is:
(let ((v0-5 0))
(let ((v0-12 0))
)
@@ -571,11 +571,7 @@
)
(set! (-> a2-4 base) (&+ gif-buf 32))
)
(let
((total-qwc
(/ (&+ (- -16 (the-as int (the-as pointer end-dma))) (-> buf base)) 16)
)
)
(let ((total-qwc (/ (&+ (- -16 (the-as int end-dma)) (-> buf base)) 16)))
(cond
((nonzero? total-qwc)
(set!
@@ -73,5 +73,5 @@
)
;; failed to figure out what this is:
(let ((v0-1 0))
(let ((v0-2 0))
)
@@ -110,6 +110,5 @@
)
;; failed to figure out what this is:
(let ((v0-4 0))
(let ((v0-8 0))
)
@@ -206,5 +206,5 @@
)
;; failed to figure out what this is:
(let ((v0-9 0))
(let ((v0-19 0))
)
@@ -281,9 +281,5 @@
)
;; failed to figure out what this is:
(let ((v0-9 0))
(let ((v0-18 0))
)
@@ -718,5 +718,5 @@
)
;; failed to figure out what this is:
(let ((v0-23 0))
(let ((v0-47 0))
)
@@ -258,9 +258,5 @@
)
;; failed to figure out what this is:
(let ((v0-7 0))
(let ((v0-15 0))
)
@@ -818,6 +818,5 @@
)
;; failed to figure out what this is:
(let ((v0-32 0))
(let ((v0-64 0))
)
@@ -126,7 +126,7 @@
)
)
(set! (-> *ripple-globals* count) 0)
(let ((v0-3 0))
(let ((v0-4 0))
)
)
(none)
@@ -60,9 +60,5 @@
(define *fake-shadow-buffer* *fake-shadow-buffer-1*)
;; failed to figure out what this is:
(let ((v0-4 0))
(let ((v0-6 0))
)
@@ -465,9 +465,5 @@
)
;; failed to figure out what this is:
(let ((v0-14 0))
(let ((v0-23 0))
)
@@ -309,5 +309,5 @@
(define *cloud-drawn* #f)
;; failed to figure out what this is:
(let ((v0-15 0))
(let ((v0-27 0))
)
@@ -152,9 +152,5 @@
)
;; failed to figure out what this is:
(let ((v0-4 0))
(let ((v0-7 0))
)
@@ -215,9 +215,5 @@
(set! (-> sparticle-launch-control heap-base) (the-as uint 32))
;; failed to figure out what this is:
(let ((v0-6 0))
(let ((v0-12 0))
)
@@ -158,9 +158,5 @@
)
;; failed to figure out what this is:
(let ((v0-4 0))
(let ((v0-8 0))
)
@@ -403,5 +403,5 @@
(define *ocean-base-page* 0)
;; failed to figure out what this is:
(let ((v0-14 0))
(let ((v0-25 0))
)
@@ -397,9 +397,5 @@
(define *collide-stats* (new 'global 'collide-stats))
;; failed to figure out what this is:
(let ((v0-17 0))
(let ((v0-33 0))
)
@@ -476,9 +476,5 @@
)
;; failed to figure out what this is:
(let ((v0-19 0))
(let ((v0-30 0))
)
@@ -464,9 +464,5 @@
)
;; failed to figure out what this is:
(let ((v0-15 0))
(let ((v0-30 0))
)
@@ -264,9 +264,5 @@
)
;; failed to figure out what this is:
(let ((v0-8 0))
(let ((v0-16 0))
)
@@ -423,9 +423,5 @@
(define *instance-tie-work-copy* (the-as basic #f))
;; failed to figure out what this is:
(let ((v0-10 0))
(let ((v0-18 0))
)
@@ -218,9 +218,5 @@
(define *time-of-day-context* (new 'static 'time-of-day-context))
;; failed to figure out what this is:
(let ((v0-7 0))
(let ((v0-13 0))
)
@@ -139,13 +139,12 @@
)
(else
(format #t "_#x~X________________~%" arg1)
(let ((v0-1 (the-as object (inspect arg1)))
(s4-0 *print-column*)
)
(inspect arg1)
(let ((s4-0 *print-column*))
(set! *print-column* (+ *print-column* (the-as uint 64)))
(if (> (-> arg1 front) 0)
(inspect-bsp-tree arg0 (the-as bsp-node (-> arg1 front)))
(set! v0-1 (format #t "_#x~X________________~%" arg1))
(format #t "_#x~X________________~%" arg1)
)
(if (> (-> arg1 back) 0)
(inspect-bsp-tree arg0 (the-as bsp-node (-> arg1 back)))
@@ -239,9 +238,5 @@
)
;; failed to figure out what this is:
(let ((v0-6 0))
(let ((v0-12 0))
)
@@ -178,9 +178,5 @@
)
;; failed to figure out what this is:
(let ((v0-2 0))
(let ((v0-7 0))
)
@@ -288,7 +288,7 @@
)
)
)
(the-as pointer (the-as uint load-location))
(the-as pointer load-location)
)
)
@@ -417,7 +417,3 @@
)
(none)
)
@@ -272,9 +272,5 @@
)
;; failed to figure out what this is:
(let ((v0-5 0))
(let ((v0-12 0))
)
@@ -101,9 +101,5 @@
)
;; failed to figure out what this is:
(let ((v0-4 0))
(let ((v0-7 0))
)
@@ -39,5 +39,5 @@
)
;; failed to figure out what this is:
(let ((v0-1 0))
(let ((v0-2 0))
)
@@ -222,5 +222,5 @@
;; ERROR: function was not converted to expressions. Cannot decompile.
;; failed to figure out what this is:
(let ((v0-6 0))
(let ((v0-7 0))
)
@@ -35,6 +35,5 @@
(define *unity-quaternion* (new 'static 'quaternion :w 1.0))
;; failed to figure out what this is:
(let ((v0-1 0))
(let ((v0-2 0))
)
@@ -45,6 +45,5 @@
)
;; failed to figure out what this is:
(let ((v0-2 0))
(let ((v0-4 0))
)
@@ -147,9 +147,5 @@
)
;; failed to figure out what this is:
(let ((v0-3 0))
(let ((v0-8 0))
)
@@ -64,9 +64,5 @@
)
;; failed to figure out what this is:
(let ((v0-1 0))
(let ((v0-2 0))
)
@@ -33,9 +33,5 @@
)
;; failed to figure out what this is:
(let ((v0-1 0))
(let ((v0-2 0))
)
@@ -72,7 +72,7 @@
(let ((f0-1 (/ (vector-vector-xz-distance arg1 arg0) arg2)))
(TODO-RENAME-11 obj arg0 arg1 f0-1 arg3)
)
(let ((v0-1 0))
(let ((v0-2 0))
)
(none)
)
@@ -150,15 +150,11 @@
(draw-string-xy *temp-string* dma-buf 32 (+ (* 12 slot-idx) 8) 3 1)
)
)
(let ((v0-12 0))
(let ((v0-13 0))
)
(none)
)
;; failed to figure out what this is:
(let ((v0-3 0))
(let ((v0-5 0))
)
@@ -358,11 +358,11 @@
(defun buzz-stop! ((idx int))
(cpad-set-buzz! (-> *cpad-list* cpads idx) 0 0 0)
(cpad-set-buzz! (-> *cpad-list* cpads idx) 1 0 0)
(let ((v0-0 0))
(let ((v0-2 0))
)
(none)
)
;; failed to figure out what this is:
(let ((v0-4 0))
(let ((v0-9 0))
)
@@ -241,9 +241,5 @@
)
;; failed to figure out what this is:
(let ((v0-2 0))
(let ((v0-12 0))
)
@@ -165,5 +165,5 @@
)
;; failed to figure out what this is:
(let ((v0-7 0))
(let ((v0-14 0))
)
@@ -119,7 +119,5 @@
)
;; failed to figure out what this is:
(let ((v0-4 0))
(let ((v0-6 0))
)
@@ -785,11 +785,5 @@
(define *sound-bank-2* #f)
;; failed to figure out what this is:
(let ((v0-34 0))
(let ((v0-65 0))
)
@@ -67,7 +67,7 @@
;; INFO: Return type mismatch int vs none.
(defun-debug joint-mod-debug-draw ((mod joint-mod))
(add-debug-matrix #t (bucket-id debug-draw) (-> mod joint bone transform))
(let ((v0-0 0))
(let ((v0-1 0))
)
(none)
)
@@ -379,13 +379,7 @@
;; WARN: Unsupported inline assembly instruction kind - [madd.s f1, f3, f6]
;; Used lq/sq
(defun joint-mod-look-at-handler ((csp cspace) (xform transformq))
(local-vars
(v0-20 quaternion)
(f1-12 float)
(sv-48 vector)
(sv-52 vector)
(sv-56 vector)
)
(local-vars (f1-12 float) (sv-48 vector) (sv-52 vector) (sv-56 vector))
(rlet ((vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
@@ -520,33 +514,24 @@
(let ((v1-27 (-> gp-0 ear)))
(cond
((zero? v1-27)
(set!
v0-20
(quaternion-rotate-x!
(the-as quaternion (-> xform rot))
(the-as quaternion (-> xform rot))
(-> gp-0 twist x)
)
(quaternion-rotate-x!
(the-as quaternion (-> xform rot))
(the-as quaternion (-> xform rot))
(-> gp-0 twist x)
)
)
((= v1-27 1)
(set!
v0-20
(quaternion-rotate-local-y!
(the-as quaternion (-> xform rot))
(the-as quaternion (-> xform rot))
(-> gp-0 twist x)
)
(quaternion-rotate-local-y!
(the-as quaternion (-> xform rot))
(the-as quaternion (-> xform rot))
(-> gp-0 twist x)
)
)
(else
(set!
v0-20
(quaternion-rotate-z!
(the-as quaternion (-> xform rot))
(the-as quaternion (-> xform rot))
(-> gp-0 twist x)
)
(quaternion-rotate-z!
(the-as quaternion (-> xform rot))
(the-as quaternion (-> xform rot))
(-> gp-0 twist x)
)
)
)
@@ -563,7 +548,7 @@
)
)
)
(let ((v0-21 0))
(let ((v0-26 0))
)
(none)
)
@@ -683,39 +668,33 @@
(if (< f1-14 0.1)
(set! f0-20 0.0)
)
(let
((v0-17
(the-as
object
(deg-seek
(-> gp-0 twist x)
f0-20
(fmax 1.0 (* 0.1 (fabs (deg-diff f0-20 (-> gp-0 twist x)))))
)
)
)
(set!
(-> gp-0 twist x)
(deg-seek
(-> gp-0 twist x)
f0-20
(fmax 1.0 (* 0.1 (fabs (deg-diff f0-20 (-> gp-0 twist x)))))
)
(set! (-> gp-0 twist x) (the-as float v0-17))
(when (!= (-> gp-0 twist x) 0.0)
(let* ((v1-20 (-> gp-0 ear))
(a1-17 ((cond
((zero? v1-20)
matrix-rotate-x!
)
((= v1-20 1)
matrix-rotate-y!
)
(else
matrix-rotate-z!
)
)
(new 'stack-no-clear 'matrix) (-> gp-0 twist x)
)
)
(when (!= (-> gp-0 twist x) 0.0)
(let* ((v1-20 (-> gp-0 ear))
(a1-17 ((cond
((zero? v1-20)
matrix-rotate-x!
)
)
)
(set! v0-17 (matrix*! s5-0 a1-17 s5-0))
)
)
((= v1-20 1)
matrix-rotate-y!
)
(else
matrix-rotate-z!
)
)
(new 'stack-no-clear 'matrix) (-> gp-0 twist x)
)
)
)
(matrix*! s5-0 a1-17 s5-0)
)
)
)
@@ -730,7 +709,7 @@
)
)
)
(let ((v0-19 0))
(let ((v0-22 0))
)
(none)
)
@@ -807,7 +786,7 @@
)
)
(cspace<-parented-transformq-joint! arg0 arg1)
(let ((v0-9 0))
(let ((v0-10 0))
)
(none)
)
@@ -822,7 +801,7 @@
(set! (-> arg1 scale quad) (-> s4-0 scale quad))
)
(cspace<-parented-transformq-joint! arg0 arg1)
(let ((v0-1 0))
(let ((v0-2 0))
)
(none)
)
@@ -866,7 +845,7 @@
)
)
)
(let ((v0-3 0))
(let ((v0-4 0))
)
(none)
)
@@ -223,9 +223,5 @@
)
;; failed to figure out what this is:
(let ((v0-2 0))
(let ((v0-4 0))
)
@@ -1400,9 +1400,5 @@
(define *swim-surface* *stone-surface*)
;; failed to figure out what this is:
(let ((v0-4 0))
(let ((v0-6 0))
)
@@ -101,5 +101,5 @@
(define-perm *sidekick* sidekick #f)
;; failed to figure out what this is:
(let ((v0-2 0))
(let ((v0-4 0))
)
@@ -183,9 +183,5 @@
)
;; failed to figure out what this is:
(let ((v0-4 0))
(let ((v0-8 0))
)
@@ -65,5 +65,5 @@
(define *common-text* (the-as game-text-info #f))
;; failed to figure out what this is:
(let ((v0-3 0))
(let ((v0-5 0))
)
@@ -231,9 +231,5 @@
)
;; failed to figure out what this is:
(let ((v0-8 0))
(let ((v0-16 0))
)
@@ -42,6 +42,5 @@
)
;; failed to figure out what this is:
(let ((v0-2 0))
(let ((v0-4 0))
)
@@ -1229,5 +1229,5 @@
)
;; failed to figure out what this is:
(let ((v0-3 0))
(let ((v0-19 0))
)
@@ -373,5 +373,5 @@
)
;; failed to figure out what this is:
(let ((v0-11 0))
(let ((v0-23 0))
)
+90 -103
View File
@@ -188,7 +188,7 @@
(set! (-> obj suspend-hook) (method-of-object obj thread-suspend))
(set! (-> obj resume-hook) (method-of-object obj thread-resume))
(set! (-> obj stack-size) arg2)
(the-as cpu-thread (the-as pointer obj))
(the-as cpu-thread obj)
)
)
@@ -590,7 +590,7 @@
"WARNING: ~A ~A had to be allocated from the debug pool, because ~A was empty.~%"
)
(a2-1 arg0)
(v1-6 (the-as process s4-0))
(v1-6 (the-as object s4-0))
)
(t9-1 a0-2 a1-2 a2-1 (if (the-as process v1-6)
(-> (the-as (pointer process) v1-6) 0 self)
@@ -1139,20 +1139,28 @@
(define *global-search-count* 0)
;; definition for function process-by-name
;; INFO: Return type mismatch process-tree vs process.
(defun process-by-name ((arg0 object) (arg1 process-tree))
(set! *global-search-name* (the-as basic arg0))
(search-process-tree
arg1
(lambda ((a0-0 process)) (name= (-> a0-0 name) *global-search-name*))
(the-as
process
(search-process-tree
arg1
(lambda ((a0-0 process)) (name= (-> a0-0 name) *global-search-name*))
)
)
)
;; definition for function process-not-name
;; INFO: Return type mismatch process-tree vs process.
(defun process-not-name ((arg0 object) (arg1 process-tree))
(set! *global-search-name* (the-as basic arg0))
(search-process-tree
arg1
(lambda ((a0-0 process)) (not (name= (-> a0-0 name) *global-search-name*)))
(the-as
process
(search-process-tree
arg1
(lambda ((a0-0 process)) (not (name= (-> a0-0 name) *global-search-name*)))
)
)
)
@@ -1175,9 +1183,7 @@
(defun kill-by-name ((arg0 object) (arg1 process-tree))
(local-vars (a0-1 process))
(while (begin
(let ((v0-0 (process-by-name arg0 arg1)))
(set! a0-1 (the-as process v0-0))
)
(set! a0-1 (process-by-name arg0 arg1))
a0-1
)
(deactivate a0-1)
@@ -1187,18 +1193,15 @@
;; definition for function kill-by-type
(defun kill-by-type ((arg0 object) (arg1 process-tree))
(local-vars (a0-1 process))
(local-vars (a0-1 process-tree))
(set! *global-search-name* (the-as basic arg0))
(while (begin
(let
((v0-0
(search-process-tree
arg1
(lambda ((a0-0 process)) (= (-> a0-0 type) *global-search-name*))
)
)
(set!
a0-1
(search-process-tree
arg1
(lambda ((a0-0 process)) (= (-> a0-0 type) *global-search-name*))
)
(set! a0-1 (the-as process v0-0))
)
a0-1
)
@@ -1211,9 +1214,7 @@
(defun kill-not-name ((arg0 object) (arg1 process-tree))
(local-vars (a0-1 process))
(while (begin
(let ((v0-0 (process-not-name arg0 arg1)))
(set! a0-1 (the-as process v0-0))
)
(set! a0-1 (process-not-name arg0 arg1))
a0-1
)
(deactivate a0-1)
@@ -1223,18 +1224,15 @@
;; definition for function kill-not-type
(defun kill-not-type ((arg0 object) (arg1 process-tree))
(local-vars (a0-1 process))
(local-vars (a0-1 process-tree))
(set! *global-search-name* (the-as basic arg0))
(while (begin
(let
((v0-0
(search-process-tree
arg1
(lambda ((a0-0 process)) (!= (-> a0-0 type) *global-search-name*))
)
)
(set!
a0-1
(search-process-tree
arg1
(lambda ((a0-0 process)) (!= (-> a0-0 type) *global-search-name*))
)
(set! a0-1 (the-as process v0-0))
)
a0-1
)
@@ -1315,7 +1313,6 @@
)
;; definition for function search-process-tree
;; INFO: Return type mismatch process-tree vs process.
(defun
search-process-tree
((arg0 process-tree) (arg1 (function process-tree object)))
@@ -1336,7 +1333,7 @@
)
)
)
(the-as process (the-as process-tree #f))
(the-as process-tree #f)
)
;; definition for function kernel-dispatcher
@@ -1388,12 +1385,7 @@
)
)
)
(let
((v0-1
(reset-and-call s4-0 (-> a0-0 trans-hook))
)
)
)
(reset-and-call s4-0 (-> a0-0 trans-hook))
(delete s4-0)
)
(if (= (-> a0-0 status) 'dead)
@@ -1524,13 +1516,13 @@
protect-frame
((allocation symbol) (type-to-make type) (arg0 (function object)))
(local-vars (pp process))
(let ((v0-0 (the-as protect-frame (+ (the-as int allocation) 4))))
(let ((v0-0 (the-as object (+ (the-as int allocation) 4))))
(set! (-> (the-as protect-frame v0-0) type) type-to-make)
(set! (-> (the-as protect-frame v0-0) name) 'protect-frame)
(set! (-> (the-as protect-frame v0-0) exit) arg0)
(set! (-> (the-as protect-frame v0-0) next) (-> pp stack-frame-top))
(set! (-> pp stack-frame-top) (the-as protect-frame v0-0))
(the-as protect-frame (the-as int v0-0))
(the-as protect-frame v0-0)
)
)
@@ -1822,70 +1814,65 @@
;; WARN: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)]
;; WARN: Unsupported inline assembly instruction kind - [jr ra]
(defmethod deactivate process ((obj process))
(let ((v0-0 (when (!= (-> obj status) 'dead)
(set! (-> obj next-state) dead-state)
(if (-> obj entity)
(entity-deactivate-handler obj (-> obj entity))
)
(let ((s5-0 pp))
(let ((s4-0 (-> obj stack-frame-top)))
(while (the-as protect-frame s4-0)
(let ((v1-5 (-> s4-0 type)))
(if (or (= v1-5 protect-frame) (= v1-5 state))
((-> (the-as protect-frame s4-0) exit))
)
)
(set!
(the-as protect-frame s4-0)
(-> (the-as protect-frame s4-0) next)
)
)
)
(let ((s6-2 s5-0))
)
)
(let ((v0-2 (process-disconnect obj)))
)
(let ((v1-11 (-> obj child)))
(while v1-11
(let ((s5-1 (-> v1-11 0 brother)))
(deactivate (-> v1-11 0))
(set! v1-11 s5-1)
)
)
)
(return-process (-> obj pool) obj)
(set! (-> obj state) #f)
(set! (-> obj next-state) #f)
(set! (-> obj entity) #f)
(set! (-> obj pid) 0)
(cond
((= (-> *kernel-context* current-process) obj)
(set! (-> obj status) 'dead)
(.lw ra-0 return-from-thread s7-0)
(.jr ra-0)
(nop!)
(let ((v1-21 0))
)
)
((= (-> obj status) 'initialize)
(set! (-> obj status) 'dead)
(throw 'initialize #f)
)
)
(set! (-> obj status) 'dead)
0
)
)
(local-vars (pp process) (s7-0 none) (ra-0 int))
(when (!= (-> obj status) 'dead)
(set! (-> obj next-state) dead-state)
(if (-> obj entity)
(entity-deactivate-handler obj (-> obj entity))
)
(let ((s5-0 pp))
(let ((s4-0 (-> obj stack-frame-top)))
(while (the-as protect-frame s4-0)
(let ((v1-5 (-> s4-0 type)))
(if (or (= v1-5 protect-frame) (= v1-5 state))
((-> (the-as protect-frame s4-0) exit))
)
)
(set! (the-as protect-frame s4-0) (-> (the-as protect-frame s4-0) next))
)
)
(let ((s6-2 s5-0))
)
)
(process-disconnect obj)
(let ((v1-11 (-> obj child)))
(while v1-11
(let ((s5-1 (-> v1-11 0 brother)))
(deactivate (-> v1-11 0))
(set! v1-11 s5-1)
)
)
)
(return-process (-> obj pool) obj)
(set! (-> obj state) #f)
(set! (-> obj next-state) #f)
(set! (-> obj entity) #f)
(set! (-> obj pid) 0)
(cond
((= (-> *kernel-context* current-process) obj)
(set! (-> obj status) 'dead)
(.lw ra-0 return-from-thread s7-0)
(.jr ra-0)
(nop!)
(let ((v1-21 0))
)
)
((= (-> obj status) 'initialize)
(set! (-> obj status) 'dead)
(throw 'initialize #f)
)
)
(set! (-> obj status) 'dead)
(let ((v0-7 0))
)
)
(none)
)
;; failed to figure out what this is:
(let ((v0-1 (new 'global 'process 'listener 2048)))
(set! *listener-process* v0-1)
(let ((gp-0 v0-1))
(let ((v0-40 (new 'global 'process 'listener 2048)))
(set! *listener-process* v0-40)
(let ((gp-0 v0-40))
(set! (-> gp-0 status) 'ready)
(set! (-> gp-0 pid) 1)
(set!
@@ -1952,10 +1939,10 @@
;; failed to figure out what this is:
(let ((gp-1 change-parent)
(v0-13 (new 'global 'process-tree 'display-pool))
(v0-52 (new 'global 'process-tree 'display-pool))
)
(set! *display-pool* v0-13)
(gp-1 v0-13 *active-pool*)
(set! *display-pool* v0-52)
(gp-1 v0-52 *active-pool*)
)
;; failed to figure out what this is:
@@ -147,6 +147,7 @@
;; definition for function send-event-function
(defun send-event-function ((arg0 process) (arg1 event-message-block))
(local-vars (pp process))
(when (and arg0 (!= (-> arg0 type) process-tree) (-> arg0 event-hook))
(let ((gp-0 pp))
(let ((s6-1 arg0))
@@ -939,7 +939,7 @@ TEST_F(FormRegressionTest, DmaBufferAddVuFunction) {
" (while (> a3-0 0)\n"
" (let ((t0-1 (min 127 a3-0)))\n"
" (let* ((t1-1 arg0)\n"
" (t2-0 (the-as dma-packet (-> t1-1 base)))\n"
" (t2-0 (the-as object (-> t1-1 base)))\n"
" )\n"
" (set!\n"
" (-> (the-as dma-packet t2-0) dma)\n"
+2 -2
View File
@@ -363,7 +363,7 @@ TEST_F(FormRegressionTest, ExprMethod0Thread) {
" (set! (-> obj suspend-hook) (method-of-object obj thread-suspend))\n"
" (set! (-> obj resume-hook) (method-of-object obj thread-resume))\n"
" (set! (-> obj stack-size) arg4)\n"
" (the-as cpu-thread (the-as pointer obj))\n"
" (the-as cpu-thread obj)\n"
" )";
test_with_expr(func, type, expected, false, "cpu-thread", {},
"[[[13, 28], \"v0\", \"cpu-thread\"]]",
@@ -1080,7 +1080,7 @@ TEST_F(FormRegressionTest, ExprMethod14DeadPool) {
"empty.~%\"\n"
" )\n"
" (a2-1 arg1)\n"
" (v1-6 (the-as process s4-0))\n"
" (v1-6 (the-as object s4-0))\n"
" )\n"
" (t9-1 a0-2 a1-2 a2-1 (if (the-as process v1-6)\n"
" (-> (the-as (pointer process) v1-6) 0 self)\n"
+1 -2
View File
@@ -102,8 +102,7 @@ const std::unordered_set<std::string> g_functions_to_skip_compiling = {
"(method 10 process)",
/// GSTATE
"enter-state", // stack pointer asm
"send-event-function", // pp asm (eventually we should make this work)
"enter-state", // stack pointer asm
/// MATH
"rand-vu-init",