;;-*-Lisp-*- (in-package goal) ;; definition for function transform-float-point ;; ERROR: Bad vector register dependency: vf1 ;; ERROR: Bad vector register dependency: vf2 ;; ERROR: Bad vector register dependency: vf3 ;; ERROR: Bad vector register dependency: vf4 ;; ERROR: Bad vector register dependency: vf6 ;; ERROR: Bad vector register dependency: vf8 ;; ERROR: Bad vector register dependency: vf9 (defun transform-float-point ((src-world-pt vector) (dst-gs-screen-pt vector4w)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) (vf1 :class vf) (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) (vf5 :class vf) (vf6 :class vf) (vf8 :class vf) (vf9 :class vf) ) (init-vf0-vector) (.lvf vf5 (&-> src-world-pt quad)) (.mul.w.vf acc vf4 vf5) (.add.mul.x.vf acc vf1 vf5 acc) (.add.mul.y.vf acc vf2 vf5 acc) (.add.mul.z.vf vf5 vf3 vf5 acc) (.div.vf Q vf9 vf5 :fsf #b0 :ftf #b11) (.wait.vf) (.mul.vf.xyz vf5 vf5 Q) (.add.vf vf5 vf5 vf8) (.max.x.vf.w vf5 vf5 vf0) (.min.x.vf.w vf5 vf5 vf6) (vftoi4.xyzw vf5 vf5) (.svf (&-> dst-gs-screen-pt quad) vf5) dst-gs-screen-pt ) ) ;; definition (debug) for function add-debug-point ;; INFO: Used lq/sq (defun-debug add-debug-point ((arg0 symbol) (arg1 bucket-id) (arg2 vector)) (if (not (or arg0 *display-capture-mode*)) (return #f) ) (let ((s5-0 (new 'stack 'vector4w-2)) (a1-2 (new 'stack-no-clear 'vector)) ) (set! (-> a1-2 quad) (-> arg2 quad)) (set! (-> a1-2 w) 1.0) (when (transform-point-qword! (-> s5-0 vector 0) a1-2) (with-dma-buffer-add-bucket ((v1-11 (-> *display* frames (-> *display* on-screen) debug-buf)) arg1 ) (let ((a0-6 (-> v1-11 base))) (let* ((a1-3 v1-11) (a3-0 (the-as dma-packet (-> a1-3 base))) ) (set! (-> a3-0 dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) (set! (-> a3-0 vif0) (new 'static 'vif-tag)) (set! (-> a3-0 vif1) (new 'static 'vif-tag :cmd (vif-cmd direct) :msk #x1)) (set! (-> a1-3 base) (the-as pointer (&+ a3-0 16))) ) (let* ((a1-4 v1-11) (a3-2 (the-as gs-gif-tag (-> a1-4 base))) ) (set! (-> a3-2 tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :pre #x1 :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :abe #x1) :nreg #x8 ) ) (set! (-> a3-2 regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id rgbaq) :regs1 (gif-reg-id xyzf2) :regs2 (gif-reg-id rgbaq) :regs3 (gif-reg-id xyzf2) :regs4 (gif-reg-id rgbaq) :regs5 (gif-reg-id xyzf2) :regs6 (gif-reg-id rgbaq) :regs7 (gif-reg-id xyzf2) ) ) (set! (-> a1-4 base) (the-as pointer (&+ a3-2 16))) ) (set! (-> s5-0 vector 1 x) 255) (set! (-> s5-0 vector 1 y) 128) (set! (-> s5-0 vector 1 z) 128) (set! (-> s5-0 vector 1 w) 128) (+! (-> s5-0 vector 0 y) 288) (let* ((a1-11 v1-11) (a3-4 (the-as vector4w-2 (-> a1-11 base))) ) (set! (-> a3-4 vector 0 quad) (-> s5-0 vector 1 quad)) (set! (-> a3-4 vector 1 quad) (-> s5-0 vector 0 quad)) (set! (-> a1-11 base) (the-as pointer (&+ a3-4 32))) ) (+! (-> s5-0 vector 0 x) -256) (+! (-> s5-0 vector 0 y) -288) (set! (-> s5-0 vector 1 x) 128) (set! (-> s5-0 vector 1 y) 255) (let* ((a1-18 v1-11) (a3-6 (the-as vector4w-2 (-> a1-18 base))) ) (set! (-> a3-6 vector 0 quad) (-> s5-0 vector 1 quad)) (set! (-> a3-6 vector 1 quad) (-> s5-0 vector 0 quad)) (set! (-> a1-18 base) (the-as pointer (&+ a3-6 32))) ) (+! (-> s5-0 vector 0 x) 512) (set! (-> s5-0 vector 1 y) 128) (set! (-> s5-0 vector 1 z) 255) (let* ((a1-23 v1-11) (a3-8 (the-as vector4w-2 (-> a1-23 base))) ) (set! (-> a3-8 vector 0 quad) (-> s5-0 vector 1 quad)) (set! (-> a3-8 vector 1 quad) (-> s5-0 vector 0 quad)) (set! (-> a1-23 base) (the-as pointer (&+ a3-8 32))) ) (+! (-> s5-0 vector 0 x) -256) (+! (-> s5-0 vector 0 y) -288) (set! (-> s5-0 vector 1 x) 255) (set! (-> s5-0 vector 1 y) 128) (let* ((a3-10 v1-11) (a1-30 (the-as vector4w-2 (-> a3-10 base))) ) (set! (-> a1-30 vector 0 quad) (-> s5-0 vector 1 quad)) (set! (-> a1-30 vector 1 quad) (-> s5-0 vector 0 quad)) (set! (-> a3-10 base) (the-as pointer (&+ a1-30 32))) ) (let ((a3-14 (/ (the-as int (+ (- -16 (the-as int a0-6)) (the-as int (-> v1-11 base)))) 16))) (cond ((nonzero? a3-14) (logior! (-> (the-as (pointer uint64) a0-6) 0) (shr (shl a3-14 48) 48)) (logior! (-> (the-as (pointer uint64) a0-6) 1) (shl (shr (shl a3-14 48) 48) 32)) ) (else (set! (-> v1-11 base) a0-6) ) ) ) ) ) ) ) #f ) ;; definition (debug) for function debug-line-clip? ;; INFO: function output is handled by mips2c (def-mips2c debug-line-clip? (function vector vector vector vector symbol)) ;; definition (debug) for function internal-draw-debug-line ;; INFO: Used lq/sq ;; WARN: Return type mismatch pointer vs symbol. (defun-debug internal-draw-debug-line ((arg0 bucket-id) (arg1 vector) (arg2 vector) (arg3 rgba) (arg4 symbol) (arg5 rgba)) (let ((a0-2 (-> *display* frames (-> *display* on-screen) debug-buf))) (if (< (the-as uint (shr (+ (&- (-> a0-2 end) (the-as uint (-> a0-2 base))) 15) 4)) (the-as uint #x8000)) (return (the-as symbol #f)) ) ) (if (the-as rgba (or (= arg5 -1) (= arg5 (the-as uint #xffffffff)))) (set! arg5 arg3) ) (case arg4 (('fade) (set! arg5 (new 'static 'rgba :r (shr (-> arg5 r) 1) :g (shr (-> arg5 g) 1) :b (shr (-> arg5 b) 1) :a (-> arg5 a)) ) ) ) (let ((s4-0 (new 'stack-no-clear 'inline-array 'vector4w 5))) (the-as symbol (when (debug-line-clip? (the-as vector (-> s4-0 4)) (the-as vector (-> s4-0 5)) arg1 arg2) (set! (-> s4-0 4 w) (the-as int 1.0)) (set! (-> s4-0 5 w) (the-as int 1.0)) (when (and (transform-point-qword! (-> s4-0 0) (the-as vector (-> s4-0 4))) (transform-point-qword! (-> s4-0 1) (the-as vector (-> s4-0 5))) ) (with-dma-buffer-add-bucket ((v1-33 (-> *display* frames (-> *display* on-screen) debug-buf)) arg0 ) (let ((a0-26 (-> v1-33 base))) (let* ((a1-4 v1-33) (a3-2 (the-as object (-> a1-4 base))) ) (set! (-> (the-as dma-packet a3-2) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) (set! (-> (the-as dma-packet a3-2) vif0) (new 'static 'vif-tag)) (set! (-> (the-as dma-packet a3-2) vif1) (new 'static 'vif-tag :cmd (vif-cmd direct) :msk #x1)) (set! (-> a1-4 base) (&+ (the-as pointer a3-2) 16)) ) (let* ((a1-5 v1-33) (a3-4 (the-as object (-> a1-5 base))) ) (set! (-> (the-as gs-gif-tag a3-4) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :pre #x1 :prim (new 'static 'gs-prim :prim (gs-prim-type line) :iip #x1 :abe #x1) :nreg #x4 ) ) (set! (-> (the-as gs-gif-tag a3-4) regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id rgbaq) :regs1 (gif-reg-id xyzf2) :regs2 (gif-reg-id rgbaq) :regs3 (gif-reg-id xyzf2) ) ) (set! (-> a1-5 base) (&+ (the-as pointer a3-4) 16)) ) (case arg4 (('fade-depth) (let ((f0-3 (fmax 0.2 (fmin 1.0 (* 0.00000005960465 (the float (-> s4-0 0 z))))))) (set! (-> s4-0 2 x) (the int (* (the float (-> arg3 r)) f0-3))) (set! (-> s4-0 2 y) (the int (* (the float (-> arg3 g)) f0-3))) (set! (-> s4-0 2 z) (the int (* (the float (-> arg3 b)) f0-3))) ) (set! (-> s4-0 2 w) (the-as int (-> arg3 a))) ) (else (set! (-> s4-0 2 x) (the-as int (-> arg3 r))) (set! (-> s4-0 2 y) (the-as int (-> arg3 g))) (set! (-> s4-0 2 z) (the-as int (-> arg3 b))) (set! (-> s4-0 2 w) (the-as int (-> arg3 a))) ) ) (cond ((= arg4 'fade-depth) (let ((f0-7 (fmax 0.2 (fmin 1.0 (* 0.00000005960465 (the float (-> s4-0 1 z))))))) (set! (-> s4-0 3 x) (the int (* (the float (-> arg5 r)) f0-7))) (set! (-> s4-0 3 y) (the int (* (the float (-> arg5 g)) f0-7))) (set! (-> s4-0 3 z) (the int (* (the float (-> arg5 b)) f0-7))) ) (set! (-> s4-0 3 w) (the-as int (-> arg5 a))) ) (else (set! (-> s4-0 3 x) (the-as int (-> arg5 r))) (set! (-> s4-0 3 y) (the-as int (-> arg5 g))) (set! (-> s4-0 3 z) (the-as int (-> arg5 b))) (set! (-> s4-0 3 w) (the-as int (-> arg5 a))) ) ) (+! (-> s4-0 0 z) -8192) (+! (-> s4-0 1 z) -8192) (let* ((a3-7 v1-33) (a1-48 (the-as object (-> a3-7 base))) ) (set! (-> (the-as (inline-array vector4w-2) a1-48) 0 vector 0 quad) (-> s4-0 2 quad)) (set! (-> (the-as (inline-array vector4w-2) a1-48) 0 vector 1 quad) (-> s4-0 0 quad)) (set! (-> (the-as (inline-array vector4w-2) a1-48) 1 vector 0 quad) (-> s4-0 3 quad)) (set! (-> (the-as (inline-array vector4w-2) a1-48) 1 vector 1 quad) (-> s4-0 1 quad)) (set! (-> a3-7 base) (&+ (the-as pointer a1-48) 64)) ) (let ((a3-11 (/ (the-as int (+ (- -16 (the-as int a0-26)) (the-as int (-> v1-33 base)))) 16))) (cond ((nonzero? a3-11) (logior! (-> (the-as (pointer uint64) a0-26) 0) (shr (shl a3-11 48) 48)) (logior! (-> (the-as (pointer uint64) a0-26) 1) (shl (shr (shl a3-11 48) 48) 32)) ) (else (set! (-> v1-33 base) (the-as (pointer uint64) a0-26)) ) ) ) ) ) ) ) ) ) ) ;; definition (debug) for function internal-draw-debug-text-3d ;; INFO: Used lq/sq (defun-debug internal-draw-debug-text-3d ((arg0 bucket-id) (arg1 string) (arg2 vector) (arg3 font-color) (arg4 vector2h)) (let ((s2-0 (new 'stack-no-clear 'vector4w))) (set! (-> s2-0 quad) (the-as uint128 0)) (when (transform-point-qword! s2-0 arg2) (with-dma-buffer-add-bucket ((s1-0 (-> *display* frames (-> *display* on-screen) debug-buf)) arg0 ) (let ((a2-2 (new 'stack 'font-context *font-default-matrix* (+ (-> arg4 x) -1792 (/ (-> s2-0 x) 16)) (+ (-> arg4 y) -1855 (/ (-> s2-0 y) 16)) (the-as float (/ (-> s2-0 z) 16)) arg3 (font-flags shadow kerning) ) ) ) (draw-string arg1 s1-0 a2-2) ) ) ) ) ) ;; definition (debug) for function add-debug-outline-triangle (defun-debug add-debug-outline-triangle ((arg0 symbol) (arg1 bucket-id) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 rgba)) (when (and arg0 (or (not *display-capture-mode*) (-> *setting-control* user-current unknown-uint32-1))) (add-debug-line #t arg1 arg2 arg3 arg5 #f (the-as rgba -1)) (add-debug-line #t arg1 arg3 arg4 arg5 #f (the-as rgba -1)) (add-debug-line #t arg1 arg4 arg2 arg5 #f (the-as rgba -1)) ) #f ) ;; definition (debug) for function add-debug-triangle-normal (defun-debug add-debug-triangle-normal ((arg0 symbol) (arg1 bucket-id) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 rgba)) (rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) (vf6 :class vf) ) (init-vf0-vector) (when (and arg0 (or (not *display-capture-mode*) (-> *setting-control* user-current unknown-uint32-1))) (let ((s3-0 (new 'stack-no-clear 'inline-array 'vector 2))) (vector-3pt-cross! (-> s3-0 1) arg2 arg3 arg4) (vector-float/! (-> s3-0 1) (-> s3-0 1) (* 0.00024414062 (vector-length (-> s3-0 1)))) (let ((v1-7 (-> s3-0 0))) (.lvf vf4 (&-> arg2 quad)) (.lvf vf5 (&-> arg3 quad)) (.mov.vf.w vf6 vf0) (.add.vf.xyz vf6 vf4 vf5) (.svf (&-> v1-7 quad) vf6) ) (let ((a0-3 (-> s3-0 0))) (.lvf vf4 (&-> (-> s3-0 0) quad)) (.lvf vf5 (&-> arg4 quad)) (.mov.vf.w vf6 vf0) (.add.vf.xyz vf6 vf4 vf5) (.svf (&-> a0-3 quad) vf6) ) (vector-float/! (-> s3-0 0) (-> s3-0 0) 3.0) (let ((a1-4 (-> s3-0 1))) (let ((v1-9 (-> s3-0 1)) (a0-5 (-> s3-0 0)) ) (.lvf vf4 (&-> v1-9 quad)) (.lvf vf5 (&-> a0-5 quad)) ) (.mov.vf.w vf6 vf0) (.add.vf.xyz vf6 vf4 vf5) (.svf (&-> a1-4 quad) vf6) ) (add-debug-line #t arg1 (-> s3-0 0) (-> s3-0 1) arg5 #f (the-as rgba -1)) ) ) #f ) ) ;; definition (debug) for function add-debug-flat-triangle-noclip ;; INFO: Used lq/sq ;; ERROR: failed type prop at 38: add failed: ;; WARN: Return type mismatch symbol vs none. ;; ERROR: Failed to guess stack use for 16 in add-debug-flat-triangle-noclip:9 ;; ERROR: Function may read a register that is not set: t1 ;; ERROR: Unsupported inline assembly instruction kind - [srl a1, s4, 24] (defun-debug add-debug-flat-triangle-noclip ((a0-0 vector) (a1-0 vector) (a2-0 vector) (a3-0 vector) (t0-0 vector)) (local-vars (v0-1 symbol) (v0-2 symbol) (v0-3 symbol) (v0-4 pointer) (v1-0 object) (v1-3 none) (v1-4 none) (v1-5 none) (v1-6 float) (v1-7 float) (v1-8 float) (v1-9 symbol) (v1-10 display) (v1-11 int) (v1-12 int) (v1-13 int) (v1-14 display-frame) (v1-15 dma-buffer) (v1-16 display) (v1-17 int) (v1-18 int) (v1-19 int) (v1-20 display-frame) (a0-1 vector) (a0-2 uint128) (a0-3 vector) (a0-4 uint128) (a0-5 vector) (a0-6 uint128) (a0-7 none) (a0-8 none) (a0-9 none) (a0-11 display) (a0-12 pointer) (a0-14 pointer) (a0-15 pointer) (a0-16 display) (a0-17 (inline-array dma-bucket)) (a1-1 none) (a1-2 none) (a1-3 none) (a1-4 dma-buffer) (a1-5 dma-buffer) (a1-6 int) (a1-7 int) (a1-8 int) (a1-9 int) (a1-10 int) (a1-11 int) (a1-12 int) (a1-13 none) (a1-14 none) (a1-15 none) (a1-16 none) (a1-17 none) (a1-18 none) (a1-19 dma-buffer) (a1-20 int) (a1-21 int) (a1-22 pointer) (a1-23 uint) (a1-24 uint) (a1-25 uint) (a1-26 uint) (a1-27 uint) (a1-29 int) (a1-30 vector) (a2-1 pointer) (a3-1 pointer) (a3-2 pointer) (a3-3 pointer) (a3-4 pointer) (a3-5 pointer) (a3-6 pointer) (a3-7 pointer) (t0-1 int) (t0-2 int) (t0-3 uint) (t0-4 uint) (t0-5 int) (t0-6 none) (t0-7 none) (t0-8 none) (t0-9 none) (t0-10 none) (t0-11 none) (t0-12 none) (t0-13 none) (t0-14 none) (t0-15 none) (t0-16 none) (t0-17 none) (t0-18 pointer) (t0-19 uint) (t0-20 uint) (t0-21 uint) (t1-0 none) (t1-1 uint) (t1-2 uint) (s5-0 none) (t9-0 (function vector4w vector symbol)) (t9-1 (function vector4w vector symbol)) (t9-2 (function vector4w vector symbol)) (t9-3 (function (inline-array dma-bucket) bucket-id pointer (pointer dma-tag) pointer)) (sp-0 none) (f0-0 float) (f0-1 float) (f0-2 float) ) (if (begin (or (begin a0-0) (set! v1-0 *display-capture-mode*)) (not v1-0)) (return (empty-form)) ) (when (begin (and (begin (set! s5-0 (the-as none (+ sp-0 16))) (set! v1-3 (the-as none (+ s5-0 96))) (set! a0-1 a2-0) (set! a0-2 (-> a0-1 quad)) (s.q! v1-3 a0-2) (set! v1-4 (the-as none (+ s5-0 112))) (set! a0-3 a3-0) (set! a0-4 (-> a0-3 quad)) (s.q! v1-4 a0-4) (set! v1-5 (the-as none (+ s5-0 128))) (set! a0-5 t0-0) (set! a0-6 (-> a0-5 quad)) (s.q! v1-5 a0-6) (set! v1-6 1.0) (set! f0-0 (gpr->fpr v1-6)) (s.f! (+ s5-0 108) f0-0) (set! v1-7 1.0) (set! f0-1 (gpr->fpr v1-7)) (s.f! (+ s5-0 124) f0-1) (set! v1-8 1.0) (set! f0-2 (gpr->fpr v1-8)) (s.f! (+ s5-0 140) f0-2) (set! t9-0 transform-point-qword!) (set! a0-7 (the-as none (+ s5-0 0))) (set! a1-1 (the-as none (+ s5-0 96))) (set! v0-1 (call! a0-7 a1-1)) v0-1 ) (begin (set! t9-1 transform-point-qword!) (set! a0-8 (the-as none (+ s5-0 16))) (set! a1-2 (the-as none (+ s5-0 112))) (set! v0-2 (call! a0-8 a1-2)) v0-2 ) (begin (set! t9-2 transform-point-qword!) (set! a0-9 (the-as none (+ s5-0 32))) (set! a1-3 (the-as none (+ s5-0 128))) (set! v0-3 (call! a0-9 a1-3)) (set! v1-9 v0-3) ) ) v1-9 ) (when (begin (cond ((begin (set! v1-10 *display*) (set! v1-11 (-> v1-10 on-screen)) (set! v1-12 (sll v1-11 2)) (set! a0-11 *display*) (set! v1-13 (+ v1-12 a0-11)) (set! v1-14 (dynamic-array-field-access v1-13 frames PLACEHOLDER)) (set! v1-15 (-> v1-14 debug-buf)) (set! a2-1 (-> v1-15 base)) (set! a0-12 (-> v1-15 base)) (set! a1-4 v1-15) (set! a3-1 (-> a1-4 base)) (set! t0-1 #x10000000) (set! (the-as (pointer int64) (-> (the-as (pointer int64) a3-1))) t0-1) (s.w! (+ a3-1 8) 0) (set! t0-2 #x50000000) (s.w! (+ a3-1 12) t0-2) (set! a3-2 (+ a3-1 16)) (set! (-> a1-4 base) a3-2) (set! a1-5 v1-15) (set! a3-3 (-> a1-5 base)) (set! t0-3 (the-as uint #x6025c00000008001)) (set! t0-4 (pcypld 0 t0-3)) (set! (the-as (pointer uint64) (-> (the-as (pointer uint64) a3-3))) t0-4) (set! t0-5 #x414141) (s.d! (+ a3-3 8) t0-5) (set! a3-4 (+ a3-3 16)) (set! (-> a1-5 base) a3-4) (set! a1-6 (sll t1-0 56)) (set! a1-7 (srl a1-6 56)) (s.w! (+ s5-0 48) a1-7) (set! a1-8 (sll t1-0 48)) (set! a1-9 (srl a1-8 56)) (s.w! (+ s5-0 52) a1-9) (set! a1-10 (sll t1-0 40)) (set! a1-11 (srl a1-10 56)) (s.w! (+ s5-0 56) a1-11) (.srl a1-12 t1-0 24) (s.w! (+ s5-0 60) a1-12) (set! a1-13 (the-as none (l.w (+ s5-0 8)))) (set! a1-14 (the-as none (+ a1-13 -8192))) (s.w! (+ s5-0 8) a1-14) (set! a1-15 (the-as none (l.w (+ s5-0 24)))) (set! a1-16 (the-as none (+ a1-15 -8192))) (s.w! (+ s5-0 24) a1-16) (set! a1-17 (the-as none (l.w (+ s5-0 40)))) (set! a1-18 (the-as none (+ a1-17 -8192))) (s.w! (+ s5-0 40) a1-18) (set! a1-19 v1-15) (set! a3-5 (-> a1-19 base)) (set! t0-6 (the-as none (+ s5-0 48))) (set! t0-7 (the-as none (l.q t0-6))) (set! (the-as (pointer int128) (-> (the-as (pointer int128) a3-5))) t0-7) (set! t0-8 (the-as none (+ s5-0 0))) (set! t0-9 (the-as none (l.q t0-8))) (s.q! (+ a3-5 16) t0-9) (set! t0-10 (the-as none (+ s5-0 48))) (set! t0-11 (the-as none (l.q t0-10))) (s.q! (+ a3-5 32) t0-11) (set! t0-12 (the-as none (+ s5-0 16))) (set! t0-13 (the-as none (l.q t0-12))) (s.q! (+ a3-5 48) t0-13) (set! t0-14 (the-as none (+ s5-0 48))) (set! t0-15 (the-as none (l.q t0-14))) (s.q! (+ a3-5 64) t0-15) (set! t0-16 (the-as none (+ s5-0 32))) (set! t0-17 (the-as none (l.q t0-16))) (s.q! (+ a3-5 80) t0-17) (set! a3-6 (+ a3-5 96)) (set! (-> a1-19 base) a3-6) (set! a1-20 -16) (set! a1-21 (- a1-20 a0-12)) (set! t0-18 (-> v1-15 base)) (set! a1-22 (+ a1-21 t0-18)) (set! a1-23 (sra a1-22 4)) (nonzero? a1-23) ) (set! t0-19 (l.d a0-12)) (set! t1-1 (sll a1-23 48)) (set! t1-2 (srl t1-1 48)) (set! t0-20 (logior t0-19 t1-2)) (s.d! a0-12 t0-20) (set! t0-21 (l.d (+ a0-12 8))) (set! a1-24 (sll a1-23 48)) (set! a1-25 (srl a1-24 48)) (set! a1-26 (sll a1-25 32)) (set! a1-27 (logior t0-21 a1-26)) (s.d! (+ a0-12 8) a1-27) ) (else (s.w! (+ v1-15 4) a0-12) (set! a1-28 a0-12) ) ) (set! a3-7 (l.wu (+ v1-15 4))) (!= a2-1 a3-7) ) (set! a0-14 (l.wu (+ v1-15 4))) (set! a1-29 #x20000000) (set! (the-as (pointer int64) (-> (the-as (pointer int64) a0-14))) a1-29) (s.w! (+ a0-14 8) 0) (s.w! (+ a0-14 12) 0) (set! a0-15 (+ a0-14 16)) (s.w! (+ v1-15 4) a0-15) (set! t9-3 dma-bucket-insert-tag) (set! v1-16 *display*) (set! v1-17 (-> v1-16 on-screen)) (set! v1-18 (sll v1-17 2)) (set! a0-16 *display*) (set! v1-19 (+ v1-18 a0-16)) (set! v1-20 (dynamic-array-field-access v1-19 frames PLACEHOLDER)) (set! a0-17 (-> v1-20 bucket-group)) (set! a1-30 a1-0) (call! a0-17 a1-30 a2-1 a3-7) (set! a0-18 v0-4) ) ) (ret-none) ) ;; this part is debug only (when *debug-segment* ;; definition of type debug-line (deftype debug-line (structure) ((flags int32) (bucket int32) (v1 vector :inline) (v2 vector :inline) (color rgba) (mode symbol) (color2 rgba) ) ) ;; definition for method 3 of type debug-line (defmethod inspect ((this debug-line)) (when (not this) (set! this this) (goto cfg-4) ) (format #t "[~8x] ~A~%" this 'debug-line) (format #t "~1Tflags: ~D~%" (-> this flags)) (format #t "~1Tbucket: ~D~%" (-> this bucket)) (format #t "~1Tv1: #~%" (-> this v1)) (format #t "~1Tv2: #~%" (-> this v2)) (format #t "~1Tcolor: ~D~%" (-> this color)) (format #t "~1Tmode: ~A~%" (-> this mode)) (format #t "~1Tcolor2: ~D~%" (-> this color2)) (label cfg-4) this ) ;; definition of type debug-text-3d (deftype debug-text-3d (structure) ((flags int32) (bucket int32) (pos vector :inline) (color uint8) (offset vector2h :inline) (str string) ) ) ;; definition for method 3 of type debug-text-3d (defmethod inspect ((this debug-text-3d)) (when (not this) (set! this this) (goto cfg-4) ) (format #t "[~8x] ~A~%" this 'debug-text-3d) (format #t "~1Tflags: ~D~%" (-> this flags)) (format #t "~1Tbucket: ~D~%" (-> this bucket)) (format #t "~1Tpos: #~%" (-> this pos)) (format #t "~1Tcolor: ~D~%" (-> this color)) (format #t "~1Toffset: #~%" (-> this offset)) (format #t "~1Tstr: ~A~%" (-> this str)) (label cfg-4) this ) ;; definition of type debug-tracking-thang (deftype debug-tracking-thang (basic) ((length int32) (allocated-length int32) ) ) ;; definition for method 3 of type debug-tracking-thang (defmethod inspect ((this debug-tracking-thang)) (when (not this) (set! this this) (goto cfg-4) ) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~1Tlength: ~D~%" (-> this length)) (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) (label cfg-4) this ) ;; definition for symbol *debug-lines*, type (inline-array debug-line) (define *debug-lines* (the-as (inline-array debug-line) (malloc 'debug #x100000))) ;; definition for symbol *debug-lines-trk*, type debug-tracking-thang (define *debug-lines-trk* (new 'debug 'debug-tracking-thang)) ;; failed to figure out what this is: (set! (-> *debug-lines-trk* allocated-length) #x4000) ;; definition for symbol *debug-text-3ds*, type (inline-array debug-text-3d) (define *debug-text-3ds* (the-as (inline-array debug-text-3d) (malloc 'debug #x6000))) ;; definition for symbol *debug-text-3d-trk*, type debug-tracking-thang (define *debug-text-3d-trk* (new 'debug 'debug-tracking-thang)) ;; failed to figure out what this is: (set! (-> *debug-text-3d-trk* allocated-length) 512) ;; definition for symbol *debug-prims*, type prim-strip (define *debug-prims* (the-as prim-strip 0)) ;; failed to figure out what this is: (dotimes (gp-0 (-> *debug-text-3d-trk* allocated-length)) (set! (-> *debug-text-3ds* gp-0 str) (new 'debug 'string 80 (the-as string #f))) ) ) ;; definition (debug) for function debug-reset-prim-buffer ;; WARN: Return type mismatch int vs none. (defun-debug debug-reset-prim-buffer () (when (zero? *debug-prims*) (set! *debug-prims* (new 'debug 'prim-strip 1500 (new 'static 'texture-id :index #x3 :page #x1) (the-as string #f)) ) (set! (-> *debug-prims* data0) (new 'static 'gs-test :zte #x1 :ztst (gs-ztest always))) (set! (-> *debug-prims* adnops 0 cmds) (gs-reg64 test-1)) ) (when (nonzero? *debug-prims*) (set! (-> *debug-prims* num-verts) (the-as uint 0)) 0 ) (none) ) ;; definition (debug) for function add-debug-flat-triangle ;; INFO: Used lq/sq ;; WARN: Return type mismatch uint vs none. ;; WARN: Function add-debug-flat-triangle has a return type of none, but the expression builder found a return statement. (defun-debug add-debug-flat-triangle ((arg0 symbol) (arg1 bucket-id) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 rgba)) (let ((v1-0 *debug-prims*)) (when (nonzero? v1-0) (let ((a0-1 (-> v1-0 num-verts))) (if (>= (+ a0-1 3) (-> v1-0 allocated-num-verts)) (return #f) ) (let ((a1-5 (-> v1-0 data a0-1))) (set! (-> a1-5 pos quad) (-> arg2 quad)) (set! (-> a1-5 col) arg5) (set! (-> a1-5 stq z) (the-as float #x1)) ) (let ((a0-2 (+ a0-1 1))) (let ((a1-8 (-> v1-0 data a0-2))) (set! (-> a1-8 pos quad) (-> arg3 quad)) (set! (-> a1-8 col) arg5) (set! (-> a1-8 stq z) (the-as float #x1)) ) (let ((a0-6 (-> v1-0 data (+ a0-2 1)))) (set! (-> a0-6 pos quad) (-> arg4 quad)) (set! (-> a0-6 col) arg5) (set! (-> a0-6 stq z) 0.0) ) ) ) 0 (+! (-> v1-0 num-verts) 3) ) ) (none) ) ;; definition (debug) for function get-debug-line (defun-debug get-debug-line () (cond ((< (-> *debug-lines-trk* length) (-> *debug-lines-trk* allocated-length)) (+! (-> *debug-lines-trk* length) 1) (-> *debug-lines* (+ (-> *debug-lines-trk* length) -1)) ) (else (the-as debug-line #f) ) ) ) ;; definition (debug) for function get-debug-text-3d (defun-debug get-debug-text-3d () (cond ((< (-> *debug-text-3d-trk* length) (-> *debug-text-3d-trk* allocated-length)) (+! (-> *debug-text-3d-trk* length) 1) (-> *debug-text-3ds* (+ (-> *debug-text-3d-trk* length) -1)) ) (else (the-as debug-text-3d #f) ) ) ) ;; definition (debug) for function debug-reset-buffers (defun-debug debug-reset-buffers () (set! (-> *debug-lines-trk* length) 0) (set! (-> *debug-text-3d-trk* length) 0) (set! *debug-draw-pauseable* #f) #f ) ;; definition (debug) for function debug-draw-buffers (defun-debug debug-draw-buffers () (dotimes (gp-0 (-> *debug-lines-trk* length)) (let ((v1-1 (-> *debug-lines* gp-0))) (internal-draw-debug-line (the-as bucket-id (-> v1-1 bucket)) (-> v1-1 v1) (-> v1-1 v2) (-> v1-1 color) (-> v1-1 mode) (-> v1-1 color2) ) ) ) (dotimes (gp-1 (-> *debug-text-3d-trk* length)) (let ((v1-8 (-> *debug-text-3ds* gp-1))) (internal-draw-debug-text-3d (the-as bucket-id (-> v1-8 bucket)) (-> v1-8 str) (-> v1-8 pos) (the-as font-color (-> v1-8 color)) (-> v1-8 offset) ) ) ) #f ) ;; definition (debug) for function add-debug-line ;; INFO: Used lq/sq (defun-debug add-debug-line ((arg0 symbol) (arg1 bucket-id) (arg2 vector) (arg3 vector) (arg4 rgba) (arg5 symbol) (arg6 rgba)) (when (and arg0 (or (not *display-capture-mode*) (-> *setting-control* user-current unknown-uint32-1))) (cond (*debug-draw-pauseable* (let ((v1-5 (get-debug-line))) (when v1-5 (set! (-> v1-5 bucket) (the-as int arg1)) (set! (-> v1-5 v1 quad) (-> arg2 quad)) (set! (-> v1-5 v2 quad) (-> arg3 quad)) (set! (-> v1-5 color) arg4) (set! (-> v1-5 color2) arg6) (set! (-> v1-5 mode) arg5) ) ) ) (else (internal-draw-debug-line arg1 arg2 arg3 arg4 arg5 arg6) ) ) ) #f ) ;; definition (debug) for function add-debug-line2d ;; INFO: Used lq/sq (defun-debug add-debug-line2d ((arg0 symbol) (arg1 bucket-id) (arg2 vector4w) (arg3 vector4w) (arg4 vector4w)) (if (not (or arg0 *display-capture-mode*)) (return #f) ) (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) debug-buf)) arg1 ) (let ((s2-0 (new 'stack 'vector4w)) (v1-10 (new 'stack 'vector4w)) ) (set! (-> s2-0 quad) (-> arg2 quad)) (set! (-> v1-10 quad) (-> arg3 quad)) (set! (-> s2-0 x) (* (+ (-> s2-0 x) 2048) 16)) (set! (-> s2-0 y) (* -16 (- 2048 (-> s2-0 y)))) (set! (-> s2-0 z) #x7fffff) (set! (-> v1-10 x) (* (+ (-> v1-10 x) 2048) 16)) (set! (-> v1-10 y) (* -16 (- 2048 (-> v1-10 y)))) (set! (-> v1-10 z) #x7fffff) (let ((a0-18 (-> s4-0 base))) (let* ((a1-7 s4-0) (a2-3 (the-as dma-packet (-> a1-7 base))) ) (set! (-> a2-3 dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) (set! (-> a2-3 vif0) (new 'static 'vif-tag)) (set! (-> a2-3 vif1) (new 'static 'vif-tag :cmd (vif-cmd direct) :msk #x1)) (set! (-> a1-7 base) (the-as pointer (&+ a2-3 16))) ) (let* ((a1-8 s4-0) (a2-5 (the-as gs-gif-tag (-> a1-8 base))) ) (set! (-> a2-5 tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :pre #x1 :prim (new 'static 'gs-prim :prim (gs-prim-type line) :iip #x1 :abe #x1) :nreg #x4 ) ) (set! (-> a2-5 regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id rgbaq) :regs1 (gif-reg-id xyzf2) :regs2 (gif-reg-id rgbaq) :regs3 (gif-reg-id xyzf2) ) ) (set! (-> a1-8 base) (the-as pointer (&+ a2-5 16))) ) (let* ((a1-9 s4-0) (a2-7 (the-as vector4w-2 (-> a1-9 base))) ) (set! (-> a2-7 vector 0 quad) (-> arg4 quad)) (set! (-> a2-7 vector 1 quad) (-> s2-0 quad)) (set! (-> a1-9 base) (the-as pointer (&+ a2-7 32))) ) (let* ((a1-10 s4-0) (a2-9 (the-as vector4w-2 (-> a1-10 base))) ) (set! (-> a2-9 vector 0 quad) (-> arg4 quad)) (set! (-> a2-9 vector 1 quad) (-> v1-10 quad)) (set! (-> a1-10 base) (the-as pointer (&+ a2-9 32))) ) (let ((a1-14 (/ (the-as int (+ (- -16 (the-as int a0-18)) (the-as int (-> s4-0 base)))) 16))) (cond ((nonzero? a1-14) (logior! (-> (the-as (pointer uint64) a0-18) 0) (shr (shl a1-14 48) 48)) (logior! (-> (the-as (pointer uint64) a0-18) 1) (shl (shr (shl a1-14 48) 48) 32)) ) (else (set! (-> s4-0 base) a0-18) ) ) ) ) ) ) #f ) ;; definition (debug) for function add-debug-box ;; INFO: Used lq/sq (defun-debug add-debug-box ((arg0 symbol) (arg1 bucket-id) (arg2 vector) (arg3 vector) (arg4 rgba)) (let ((s5-0 (new-stack-vector0))) (set! (-> s5-0 quad) (-> arg2 quad)) (let ((s1-0 (new-stack-vector0))) (set! (-> s1-0 quad) (-> arg2 quad)) (when (and arg0 (or (not *display-capture-mode*) (-> *setting-control* user-current unknown-uint32-1))) (set! (-> s1-0 x) (-> arg3 x)) (add-debug-line #t arg1 s5-0 s1-0 arg4 #f (the-as rgba -1)) (set! (-> s1-0 x) (-> arg2 x)) (set! (-> s1-0 y) (-> arg3 y)) (add-debug-line #t arg1 s5-0 s1-0 arg4 #f (the-as rgba -1)) (set! (-> s1-0 y) (-> arg2 y)) (set! (-> s1-0 z) (-> arg3 z)) (add-debug-line #t arg1 s5-0 s1-0 arg4 #f (the-as rgba -1)) (set! (-> s5-0 y) (-> arg3 y)) (set! (-> s1-0 y) (-> arg3 y)) (add-debug-line #t arg1 s5-0 s1-0 arg4 #f (the-as rgba -1)) (set! (-> s1-0 z) (-> arg2 z)) (set! (-> s1-0 x) (-> arg3 x)) (add-debug-line #t arg1 s5-0 s1-0 arg4 #f (the-as rgba -1)) (set! (-> s1-0 y) (-> arg2 y)) (set! (-> s5-0 x) (-> arg3 x)) (add-debug-line #t arg1 s5-0 s1-0 arg4 #f (the-as rgba -1)) (set! (-> s5-0 quad) (-> arg3 quad)) (set! (-> s1-0 quad) (-> arg3 quad)) (set! (-> s1-0 x) (-> arg2 x)) (add-debug-line #t arg1 s5-0 s1-0 arg4 #f (the-as rgba -1)) (set! (-> s1-0 x) (-> arg3 x)) (set! (-> s1-0 y) (-> arg2 y)) (add-debug-line #t arg1 s5-0 s1-0 arg4 #f (the-as rgba -1)) (set! (-> s1-0 y) (-> arg3 y)) (set! (-> s1-0 z) (-> arg2 z)) (add-debug-line #t arg1 s5-0 s1-0 arg4 #f (the-as rgba -1)) (set! (-> s5-0 y) (-> arg2 y)) (set! (-> s1-0 y) (-> arg2 y)) (add-debug-line #t arg1 s5-0 s1-0 arg4 #f (the-as rgba -1)) (set! (-> s1-0 z) (-> arg3 z)) (set! (-> s1-0 x) (-> arg2 x)) (add-debug-line #t arg1 s5-0 s1-0 arg4 #f (the-as rgba -1)) (set! (-> s1-0 y) (-> arg3 y)) (set! (-> s5-0 x) (-> arg2 x)) (add-debug-line #t arg1 s5-0 s1-0 arg4 #f (the-as rgba -1)) ) ) ) #f ) ;; definition (debug) for function add-debug-box-with-transform ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs symbol. (defun-debug add-debug-box-with-transform ((enable symbol) (bucket bucket-id) (box bounding-box) (mat matrix) (color rgba)) (b! (not enable) cfg-5 :delay (nop!)) (let ((s4-0 (new 'stack-no-clear 'inline-array 'vector 8))) (let ((s2-0 (new 'stack-no-clear 'inline-array 'vector 2)) (s1-0 (new 'stack-no-clear 'vector)) ) (set! (-> s2-0 0 quad) (-> box min quad)) (set! (-> s2-0 1 quad) (-> box max quad)) (set! (-> s1-0 w) 1.0) (dotimes (s0-0 8) (set! (-> s1-0 x) (-> s2-0 (logand s0-0 1) x)) (set! (-> s1-0 y) (-> s2-0 (logand (/ s0-0 2) 1) y)) (set! (-> s1-0 z) (-> s2-0 (logand (/ s0-0 4) 1) z)) (let ((a0-5 (-> s4-0 s0-0))) (vector-matrix*! a0-5 s1-0 mat) ) ) ) (add-debug-line #t bucket (-> s4-0 0) (-> s4-0 1) color #f (the-as rgba -1)) (add-debug-line #t bucket (-> s4-0 1) (-> s4-0 3) color #f (the-as rgba -1)) (add-debug-line #t bucket (-> s4-0 3) (-> s4-0 2) color #f (the-as rgba -1)) (add-debug-line #t bucket (-> s4-0 2) (-> s4-0 0) color #f (the-as rgba -1)) (add-debug-line #t bucket (-> s4-0 4) (-> s4-0 5) color #f (the-as rgba -1)) (add-debug-line #t bucket (-> s4-0 5) (-> s4-0 7) color #f (the-as rgba -1)) (add-debug-line #t bucket (-> s4-0 7) (-> s4-0 6) color #f (the-as rgba -1)) (add-debug-line #t bucket (-> s4-0 6) (-> s4-0 4) color #f (the-as rgba -1)) (add-debug-line #t bucket (-> s4-0 0) (-> s4-0 4) color #f (the-as rgba -1)) (add-debug-line #t bucket (-> s4-0 1) (-> s4-0 5) color #f (the-as rgba -1)) (add-debug-line #t bucket (-> s4-0 3) (-> s4-0 7) color #f (the-as rgba -1)) (add-debug-line #t bucket (-> s4-0 2) (-> s4-0 6) color #f (the-as rgba -1)) ) (label cfg-5) (the-as symbol 0) ) ;; definition (debug) for function add-debug-x ;; INFO: Used lq/sq (defun-debug add-debug-x ((arg0 symbol) (arg1 bucket-id) (arg2 vector) (arg3 rgba)) (rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) (vf6 :class vf) ) (init-vf0-vector) (if (not (or arg0 *display-capture-mode*)) (return #f) ) (let ((s3-0 (new-stack-vector0)) (s2-0 (new-stack-vector0)) ) (let ((a1-1 s3-0)) (let ((v1-3 arg2) (a0-1 (new 'static 'vector :data (new 'static 'array float 4 -1228.8 0.0 0.0 0.0))) ) (.lvf vf4 (&-> v1-3 quad)) (.lvf vf5 (&-> a0-1 quad)) ) (.mov.vf.w vf6 vf0) (.add.vf.xyz vf6 vf4 vf5) (.svf (&-> a1-1 quad) vf6) ) (let ((a1-2 s2-0)) (let ((v1-4 arg2) (a0-2 (new 'static 'vector :data (new 'static 'array float 4 1228.8 0.0 0.0 0.0))) ) (.lvf vf4 (&-> v1-4 quad)) (.lvf vf5 (&-> a0-2 quad)) ) (.mov.vf.w vf6 vf0) (.add.vf.xyz vf6 vf4 vf5) (.svf (&-> a1-2 quad) vf6) ) (add-debug-line #t arg1 s3-0 s2-0 arg3 #f (the-as rgba -1)) (let ((a1-4 s3-0)) (let ((v1-5 arg2) (a0-4 (new 'static 'vector :data (new 'static 'array float 4 0.0 0.0 -1228.8 0.0))) ) (.lvf vf4 (&-> v1-5 quad)) (.lvf vf5 (&-> a0-4 quad)) ) (.mov.vf.w vf6 vf0) (.add.vf.xyz vf6 vf4 vf5) (.svf (&-> a1-4 quad) vf6) ) (let ((a0-5 s2-0)) (let ((v1-6 (new 'static 'vector :data (new 'static 'array float 4 0.0 0.0 1228.8 0.0)))) (.lvf vf4 (&-> arg2 quad)) (.lvf vf5 (&-> v1-6 quad)) ) (.mov.vf.w vf6 vf0) (.add.vf.xyz vf6 vf4 vf5) (.svf (&-> a0-5 quad) vf6) ) (add-debug-line #t arg1 s3-0 s2-0 arg3 #f (the-as rgba -1)) ) #f ) ) ;; definition (debug) for function add-debug-cross ;; INFO: Used lq/sq (defun-debug add-debug-cross ((arg0 symbol) (arg1 bucket-id) (arg2 vector) (arg3 float)) (rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) (vf6 :class vf) ) (init-vf0-vector) (if (not (or arg0 *display-capture-mode*)) (return #f) ) (let ((s4-0 (new-stack-vector0)) (s3-0 (new-stack-vector0)) ) (let ((a1-1 s4-0)) (let ((v1-3 arg2) (a0-1 (new 'stack-no-clear 'vector)) ) (set! (-> a0-1 x) (- arg3)) (set! (-> a0-1 y) 0.0) (set! (-> a0-1 z) 0.0) (set! (-> a0-1 w) 1.0) (.lvf vf4 (&-> v1-3 quad)) (.lvf vf5 (&-> a0-1 quad)) ) (.mov.vf.w vf6 vf0) (.add.vf.xyz vf6 vf4 vf5) (.svf (&-> a1-1 quad) vf6) ) (let ((a1-2 s3-0)) (let ((v1-4 arg2) (a0-2 (new 'stack-no-clear 'vector)) ) (set! (-> a0-2 x) arg3) (set! (-> a0-2 y) 0.0) (set! (-> a0-2 z) 0.0) (set! (-> a0-2 w) 1.0) (.lvf vf4 (&-> v1-4 quad)) (.lvf vf5 (&-> a0-2 quad)) ) (.mov.vf.w vf6 vf0) (.add.vf.xyz vf6 vf4 vf5) (.svf (&-> a1-2 quad) vf6) ) (add-debug-line #t arg1 s4-0 s3-0 *color-red* #f (the-as rgba -1)) (let ((a1-4 s4-0)) (let ((v1-5 arg2) (a0-4 (new 'stack-no-clear 'vector)) ) (set! (-> a0-4 x) 0.0) (set! (-> a0-4 y) (- arg3)) (set! (-> a0-4 z) 0.0) (set! (-> a0-4 w) 1.0) (.lvf vf4 (&-> v1-5 quad)) (.lvf vf5 (&-> a0-4 quad)) ) (.mov.vf.w vf6 vf0) (.add.vf.xyz vf6 vf4 vf5) (.svf (&-> a1-4 quad) vf6) ) (let ((a1-5 s3-0)) (let ((v1-6 arg2) (a0-5 (new 'stack-no-clear 'vector)) ) (set! (-> a0-5 x) 0.0) (set! (-> a0-5 y) arg3) (set! (-> a0-5 z) 0.0) (set! (-> a0-5 w) 1.0) (.lvf vf4 (&-> v1-6 quad)) (.lvf vf5 (&-> a0-5 quad)) ) (.mov.vf.w vf6 vf0) (.add.vf.xyz vf6 vf4 vf5) (.svf (&-> a1-5 quad) vf6) ) (add-debug-line #t arg1 s4-0 s3-0 *color-green* #f (the-as rgba -1)) (let ((a1-7 s4-0)) (let ((v1-7 arg2) (a0-7 (new 'stack-no-clear 'vector)) ) (set! (-> a0-7 x) 0.0) (set! (-> a0-7 y) 0.0) (set! (-> a0-7 z) (- arg3)) (set! (-> a0-7 w) 1.0) (.lvf vf4 (&-> v1-7 quad)) (.lvf vf5 (&-> a0-7 quad)) ) (.mov.vf.w vf6 vf0) (.add.vf.xyz vf6 vf4 vf5) (.svf (&-> a1-7 quad) vf6) ) (let ((a0-8 s3-0)) (let ((v1-8 (new 'stack-no-clear 'vector))) (set! (-> v1-8 x) 0.0) (set! (-> v1-8 y) 0.0) (set! (-> v1-8 z) arg3) (set! (-> v1-8 w) 1.0) (.lvf vf4 (&-> arg2 quad)) (.lvf vf5 (&-> v1-8 quad)) ) (.mov.vf.w vf6 vf0) (.add.vf.xyz vf6 vf4 vf5) (.svf (&-> a0-8 quad) vf6) ) (add-debug-line #t arg1 s4-0 s3-0 *color-blue* #f (the-as rgba -1)) ) #f ) ) ;; definition (debug) for function add-debug-text-3d ;; INFO: Used lq/sq (defun-debug add-debug-text-3d ((arg0 symbol) (arg1 bucket-id) (arg2 string) (arg3 vector) (arg4 font-color) (arg5 vector2h)) (when (and arg0 (or (not *display-capture-mode*) (-> *setting-control* user-current unknown-uint32-1))) (cond (*debug-draw-pauseable* (let ((v1-5 (get-debug-text-3d))) (when v1-5 (set! (-> v1-5 flags) 0) (set! (-> v1-5 bucket) (the-as int arg1)) (set! (-> v1-5 pos quad) (-> arg3 quad)) (cond (arg5 (set! (-> v1-5 offset x) (-> arg5 x)) (set! (-> v1-5 offset y) (-> arg5 y)) ) (else (set! (-> v1-5 offset x) 0) (set! (-> v1-5 offset y) 0) 0 ) ) (set! (-> v1-5 color) (the-as uint arg4)) (let ((a0-6 0) (a1-2 (-> arg2 data)) (v1-7 (-> v1-5 str data)) ) (while (and (nonzero? (-> a1-2 0)) (< a0-6 79)) (set! (-> v1-7 0) (-> a1-2 0)) (set! a1-2 (&-> a1-2 1)) (set! v1-7 (&-> v1-7 1)) (+! a0-6 1) ) (set! (-> v1-7 0) (the-as uint 0)) ) 0 ) ) ) (else (internal-draw-debug-text-3d arg1 arg2 arg3 arg4 (cond (arg5 (empty) arg5 ) (else (new 'static 'vector2h) ) ) ) ) ) ) #f ) ;; definition (debug) for function add-debug-sphere-with-transform (defun-debug add-debug-sphere-with-transform ((arg0 symbol) (arg1 bucket-id) (arg2 vector) (arg3 meters) (arg4 matrix) (arg5 rgba)) (rlet ((acc :class vf) (vf0 :class vf) (vf1 :class vf) (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) (vf5 :class vf) ) (init-vf0-vector) (when (and arg0 (or (not *display-capture-mode*) (-> *setting-control* user-current unknown-uint32-1))) (.lvf vf5 (&-> arg2 quad)) (.lvf vf1 (&-> arg4 rvec quad)) (.lvf vf2 (&-> arg4 uvec quad)) (.lvf vf3 (&-> arg4 fvec quad)) (.lvf vf4 (&-> arg4 trans quad)) (.mul.w.vf acc vf4 vf0) (.add.mul.x.vf acc vf1 vf5 acc) (.add.mul.y.vf acc vf2 vf5 acc) (.add.mul.z.vf vf5 vf3 vf5 acc) (let ((a2-1 (new 'stack-no-clear 'vector))) (.svf (&-> a2-1 quad) vf5) (add-debug-sphere arg0 arg1 a2-1 arg3 arg5) ) ) #f ) ) ;; definition (debug) for function add-debug-sphere (defun-debug add-debug-sphere ((arg0 symbol) (arg1 bucket-id) (arg2 vector) (arg3 meters) (arg4 rgba)) (if (and arg0 (or (not *display-capture-mode*) (-> *setting-control* user-current unknown-uint32-1))) (add-debug-sphere-from-table arg1 arg2 arg3 arg4 6) ) #f ) ;; definition (debug) for function add-debug-text-sphere (defun-debug add-debug-text-sphere ((enable symbol) (bucket bucket-id) (pos vector) (radius meters) (text string) (color rgba)) (add-debug-sphere enable bucket pos radius color) (add-debug-text-3d enable bucket text pos (font-color default) (the-as vector2h #f)) #f ) ;; definition (debug) for function add-debug-spheres (defun-debug add-debug-spheres ((arg0 symbol) (arg1 bucket-id) (arg2 (inline-array vector)) (arg3 int) (arg4 rgba)) (when (and arg0 (or (not *display-capture-mode*) (-> *setting-control* user-current unknown-uint32-1))) (let ((s4-0 (-> arg2 0))) (countdown (s3-0 arg3) (add-debug-sphere #t arg1 s4-0 (-> s4-0 w) arg4) (&+! s4-0 16) ) ) ) #f ) ;; definition (debug) for function add-debug-line-sphere ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defun-debug add-debug-line-sphere ((arg0 symbol) (arg1 bucket-id) (arg2 vector) (arg3 vector) (arg4 float) (arg5 rgba)) (b! (not arg0) cfg-8 :delay (nop!)) (let* ((sv-16 arg1) (sv-24 arg2) (sv-28 arg3) (sv-32 arg4) (sv-36 arg5) (sv-112 (new 'stack-no-clear 'matrix)) (sv-116 (vector-length sv-28)) ) (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) (vector-normalize-copy! gp-0 sv-28 1.0) (vector-reset! s5-0) (if (< (square (-> gp-0 y)) (square (-> gp-0 z))) (set! (-> s5-0 y) -1.0) (set! (-> s5-0 z) -1.0) ) (forward-down->inv-matrix sv-112 gp-0 s5-0) ) (set! (-> sv-112 trans quad) (-> sv-24 quad)) (set! (-> sv-112 trans w) 1.0) (let ((gp-1 (new 'static 'inline-array vector 3 (new 'static 'vector :data (new 'static 'array float 4 0.0 0.5877 0.951 0.951)) (new 'static 'vector :data (new 'static 'array float 4 0.5877 0.0 -0.5877 -0.951)) (new 'static 'vector :data (new 'static 'array float 4 -0.951 -0.5878 0.0 0.0)) ) ) (s5-1 (new 'static 'inline-array vector 3 (new 'static 'vector :data (new 'static 'array float 4 1.0 0.809 0.3089 -0.3088)) (new 'static 'vector :data (new 'static 'array float 4 -0.809 -1.0 -0.809 -0.309)) (new 'static 'vector :data (new 'static 'array float 4 0.3089 0.8089 0.0 0.0)) ) ) (s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'vector)) (s1-0 (new 'stack-no-clear 'vector)) ) (set! (-> s1-0 z) 0.0) (set! (-> s1-0 w) 1.0) (set! (-> s1-0 x) (* sv-32 (-> s5-1 2 y))) (set! (-> s1-0 y) (* sv-32 (-> gp-1 2 y))) (vector-matrix*! s3-0 s1-0 sv-112) (dotimes (s0-0 10) (set! (-> s4-0 quad) (-> s3-0 quad)) (set! (-> s1-0 x) (* sv-32 (-> (&-> s5-1 0 data s0-0) 0))) (set! (-> s1-0 y) (* sv-32 (-> (&-> gp-1 0 data s0-0) 0))) (vector-matrix*! s3-0 s1-0 sv-112) (add-debug-line #t sv-16 s4-0 s3-0 sv-36 #f (the-as rgba -1)) (vector+float*! s2-0 s3-0 (-> sv-112 fvec) sv-116) (add-debug-line #t sv-16 s3-0 s2-0 sv-36 #f (the-as rgba -1)) (vector+float*! s4-0 s4-0 (-> sv-112 fvec) sv-116) (add-debug-line #t sv-16 s4-0 s2-0 sv-36 #f (the-as rgba -1)) ) ) ) (label cfg-8) 0 (none) ) ;; definition (debug) for function add-debug-circle ;; INFO: Used lq/sq (defun-debug add-debug-circle ((arg0 symbol) (arg1 bucket-id) (arg2 vector) (arg3 float) (arg4 rgba) (arg5 matrix)) (rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) (vf6 :class vf) ) (init-vf0-vector) "note: you may pass #f for orientation" (if (not (or arg0 *display-capture-mode*)) (return #f) ) (let ((f30-0 0.0) (s1-0 (new-stack-vector0)) (s0-0 (new-stack-vector0)) (sv-48 0) ) (while (< sv-48 12) (let ((sv-64 s1-0)) (set! (-> sv-64 x) (* arg3 (cos f30-0))) (set! (-> sv-64 y) 0.0) (set! (-> sv-64 z) (* arg3 (sin f30-0))) (set! (-> sv-64 w) 1.0) ) (set! f30-0 (+ 5461.3335 f30-0)) (let ((sv-80 s0-0)) (set! (-> sv-80 x) (* arg3 (cos f30-0))) (set! (-> sv-80 y) 0.0) (set! (-> sv-80 z) (* arg3 (sin f30-0))) (set! (-> sv-80 w) 1.0) ) (when arg5 (vector-matrix*! s1-0 s1-0 arg5) (vector-matrix*! s0-0 s0-0 arg5) ) (let ((a1-3 s1-0)) (let ((v1-17 s1-0) (a0-7 arg2) ) (.lvf vf4 (&-> v1-17 quad)) (.lvf vf5 (&-> a0-7 quad)) ) (.mov.vf.w vf6 vf0) (.add.vf.xyz vf6 vf4 vf5) (.svf (&-> a1-3 quad) vf6) ) (let ((a1-4 s0-0)) (let ((v1-18 s0-0) (a0-8 arg2) ) (.lvf vf4 (&-> v1-18 quad)) (.lvf vf5 (&-> a0-8 quad)) ) (.mov.vf.w vf6 vf0) (.add.vf.xyz vf6 vf4 vf5) (.svf (&-> a1-4 quad) vf6) ) (add-debug-line #t arg1 s1-0 s0-0 arg4 #f (the-as rgba -1)) (+! sv-48 1) ) ) #f ) ) ;; definition (debug) for function add-debug-vector ;; INFO: Used lq/sq (defun-debug add-debug-vector ((enable symbol) (bucket bucket-id) (base vector) (dir vector) (len-scale meters) (color rgba)) (if (not (or enable *display-capture-mode*)) (return #f) ) (let ((v1-3 (new-stack-vector0))) (set! (-> v1-3 x) (+ (-> base x) (* (-> dir x) len-scale))) (set! (-> v1-3 y) (+ (-> base y) (* (-> dir y) len-scale))) (set! (-> v1-3 z) (+ (-> base z) (* (-> dir z) len-scale))) (add-debug-line #t bucket base v1-3 color #f (the-as rgba -1)) ) #f ) ;; definition (debug) for function add-debug-matrix (defun-debug add-debug-matrix ((arg0 symbol) (arg1 bucket-id) (arg2 matrix) (arg3 meters)) (add-debug-vector arg0 arg1 (-> arg2 trans) (-> arg2 rvec) arg3 (new 'static 'rgba :r #xff :a #x80)) (add-debug-vector arg0 arg1 (-> arg2 trans) (-> arg2 uvec) arg3 (new 'static 'rgba :g #xff :a #x80)) (add-debug-vector arg0 arg1 (-> arg2 trans) (-> arg2 fvec) arg3 (new 'static 'rgba :b #xff :a #x80)) arg2 ) ;; definition (debug) for function add-debug-rot-matrix (defun-debug add-debug-rot-matrix ((arg0 symbol) (arg1 bucket-id) (arg2 matrix) (arg3 vector)) (add-debug-vector arg0 arg1 arg3 (-> arg2 rvec) (meters 2) (new 'static 'rgba :r #xff :a #x80)) (add-debug-vector arg0 arg1 arg3 (-> arg2 uvec) (meters 2) (new 'static 'rgba :g #xff :a #x80)) (add-debug-vector arg0 arg1 arg3 (-> arg2 fvec) (meters 2) (new 'static 'rgba :b #xff :a #x80)) arg2 ) ;; definition (debug) for function add-debug-quaternion ;; WARN: Return type mismatch int vs none. (defun-debug add-debug-quaternion ((arg0 symbol) (arg1 bucket-id) (arg2 vector) (arg3 quaternion)) (when (and arg0 (or (not *display-capture-mode*) (-> *setting-control* user-current unknown-uint32-1))) (let ((a2-1 (quaternion->matrix (new 'stack-no-clear 'matrix) arg3))) (add-debug-rot-matrix arg0 arg1 a2-1 arg2) ) ) 0 (none) ) ;; definition (debug) for function add-debug-cspace (defun-debug add-debug-cspace ((enable symbol) (bucket bucket-id) (cs cspace)) (add-debug-matrix enable bucket (-> cs bone transform) (meters 2)) cs ) ;; definition (debug) for function add-debug-yrot-vector ;; INFO: Used lq/sq ;; WARN: Stack slot offset 32 signed mismatch ;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 ;; WARN: Stack slot offset 32 signed mismatch ;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 ;; WARN: Stack slot offset 32 signed mismatch ;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 (defun-debug add-debug-yrot-vector ((arg0 symbol) (arg1 bucket-id) (arg2 vector) (arg3 float) (arg4 float) (arg5 rgba)) (let ((sv-32 arg3) (s0-0 arg4) (s3-0 arg5) ) (if (not (or arg0 *display-capture-mode*)) (return #f) ) (let ((s1-0 (new-stack-vector0))) (set-vector! s1-0 (+ (-> arg2 x) (* (sin sv-32) s0-0)) (-> arg2 y) (+ (-> arg2 z) (* (cos sv-32) s0-0)) 1.0) (add-debug-line arg0 arg1 s1-0 arg2 s3-0 #f (the-as rgba -1)) ) ) #f ) ;; definition (debug) for function add-debug-arc ;; INFO: Used lq/sq (defun-debug add-debug-arc ((arg0 symbol) (arg1 bucket-id) (arg2 vector) (arg3 float) (arg4 float) (arg5 float) (arg6 rgba) (arg7 matrix) ) (rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) (vf6 :class vf) ) (init-vf0-vector) "note: you may pass #f for orientation" (if (not (or arg0 *display-capture-mode*)) (return #f) ) (let ((f30-0 arg3) (sv-48 (new 'stack-no-clear 'vector)) ) (set! (-> sv-48 quad) (the-as uint128 0)) (let ((sv-64 (new 'stack-no-clear 'vector))) (set! (-> sv-64 quad) (the-as uint128 0)) (let ((sv-80 0)) (while (< sv-80 12) (let ((sv-96 sv-48)) (set! (-> sv-96 x) (* arg5 (sin f30-0))) (set! (-> sv-96 y) 0.0) (set! (-> sv-96 z) (* arg5 (cos f30-0))) (set! (-> sv-96 w) 1.0) ) (+! f30-0 (the float (/ (the int (- arg4 arg3)) 12))) (let ((sv-112 sv-64)) (set! (-> sv-112 x) (* arg5 (sin f30-0))) (set! (-> sv-112 y) 0.0) (set! (-> sv-112 z) (* arg5 (cos f30-0))) (set! (-> sv-112 w) 1.0) ) (when arg7 (vector-matrix*! sv-48 sv-48 arg7) (vector-matrix*! sv-64 sv-64 arg7) ) (let ((a1-3 sv-48)) (let ((v1-24 sv-48) (a0-8 arg2) ) (.lvf vf4 (&-> v1-24 quad)) (.lvf vf5 (&-> a0-8 quad)) ) (.mov.vf.w vf6 vf0) (.add.vf.xyz vf6 vf4 vf5) (.svf (&-> a1-3 quad) vf6) ) (let ((a1-4 sv-64)) (let ((v1-25 sv-64) (a0-9 arg2) ) (.lvf vf4 (&-> v1-25 quad)) (.lvf vf5 (&-> a0-9 quad)) ) (.mov.vf.w vf6 vf0) (.add.vf.xyz vf6 vf4 vf5) (.svf (&-> a1-4 quad) vf6) ) (add-debug-line #t arg1 sv-48 sv-64 arg6 #f (the-as rgba -1)) (cond ((zero? sv-80) (add-debug-line #t arg1 sv-48 arg2 arg6 #f (the-as rgba -1)) ) ((= sv-80 11) (add-debug-line #t arg1 sv-64 arg2 arg6 #f (the-as rgba -1)) ) ) (+! sv-80 1) ) ) ) ) #f ) ) ;; definition (debug) for function add-debug-curve ;; INFO: Used lq/sq (defun-debug add-debug-curve ((arg0 symbol) (arg1 bucket-id) (arg2 (inline-array vector)) (arg3 int) (arg4 (pointer float)) (arg5 int) (arg6 rgba) ) (if (not (or arg0 *display-capture-mode*)) (return #f) ) (let ((s0-0 (new-stack-vector0)) (sv-48 (new 'stack-no-clear 'vector)) ) (set! (-> sv-48 quad) (the-as uint128 0)) (let ((sv-64 (* arg3 4))) (curve-evaluate! sv-48 (-> arg4 0) arg2 arg3 arg4 arg5) (let ((sv-80 0)) (while (< sv-80 sv-64) (set! (-> s0-0 quad) (-> sv-48 quad)) (curve-evaluate! sv-48 (/ (the float (+ sv-80 1)) (the float sv-64)) arg2 arg3 arg4 arg5) (add-debug-line #t arg1 s0-0 sv-48 arg6 #f (the-as rgba -1)) (+! sv-80 1) ) ) ) ) #f ) ;; definition (debug) for function add-debug-curve2 (defun-debug add-debug-curve2 ((arg0 symbol) (arg1 bucket-id) (arg2 curve) (arg3 rgba) (arg4 symbol)) (if (and arg0 (or (not *display-capture-mode*) (-> *setting-control* user-current unknown-uint32-1))) (add-debug-curve #t arg1 (-> arg2 cverts) (-> arg2 num-cverts) (-> arg2 knots) (-> arg2 num-knots) arg3) ) #f ) ;; definition (debug) for function add-debug-points ;; INFO: Used lq/sq (defun-debug add-debug-points ((arg0 symbol) (arg1 bucket-id) (arg2 (inline-array vector)) (arg3 int) (arg4 rgba) (arg5 float) (arg6 int)) (when (and arg0 (or (not *display-capture-mode*) (-> *setting-control* user-current unknown-uint32-1))) (dotimes (s0-0 arg3) (let ((sv-96 (new 'stack-no-clear 'vector))) (set! (-> sv-96 quad) (the-as uint128 0)) (set! (-> sv-96 quad) (-> arg2 s0-0 quad)) (if (!= arg5 0.0) (set! (-> sv-96 y) arg5) ) (let ((sv-32 add-debug-text-3d) (sv-48 #t) (sv-64 arg1) ) (format (clear *temp-string*) "~d" s0-0) (sv-32 sv-48 sv-64 *temp-string* sv-96 (font-color white) (the-as vector2h #f)) ) (add-debug-x #t arg1 sv-96 (if (= s0-0 arg6) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) (the-as rgba arg4) ) ) ) ) ) #f ) ;; definition (debug) for function debug-percent-bar ;; INFO: Used lq/sq ;; WARN: Stack slot offset 32 signed mismatch ;; WARN: Stack slot offset 32 signed mismatch (defun-debug debug-percent-bar ((arg0 symbol) (arg1 bucket-id) (arg2 int) (arg3 int) (arg4 float) (arg5 rgba) (arg6 int) (arg7 int)) (let ((sv-16 arg3) (sv-32 arg4) (s3-0 arg5) (s1-0 arg6) (s2-0 arg7) ) (if (not (or arg0 *display-capture-mode*)) (return #f) ) (with-dma-buffer-add-bucket ((s0-0 (-> *display* frames (-> *display* on-screen) debug-buf)) arg1 ) (draw-sprite2d-xy s0-0 arg2 sv-16 s1-0 s2-0 (new 'static 'rgba :a #x40) #x3fffff) (draw-sprite2d-xy s0-0 arg2 (+ sv-16 2) (the int (* sv-32 (the float s1-0))) (+ s2-0 -4) s3-0 #x3fffff) ) ) #f ) ;; definition (debug) for function debug-pad-display ;; INFO: Used lq/sq (defun-debug debug-pad-display ((arg0 cpad-info)) (let ((gp-0 (new 'static 'inline-array vector 32 (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) (new 'static 'vector) ) ) ) (countdown (v1-0 31) (let ((a0-3 (-> gp-0 v1-0 quad))) (set! (-> gp-0 (+ v1-0 1) quad) a0-3) ) ) (set! (-> gp-0 0 x) (* (sin (-> arg0 stick0-dir)) (-> arg0 stick0-speed))) (set! (-> gp-0 0 y) (* (cos (-> arg0 stick0-dir)) (-> arg0 stick0-speed))) (dotimes (s5-1 32) (with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) debug-buf)) (bucket-id bucket793) ) (draw-sprite2d-xy s3-0 (the int (* 120.0 (-> gp-0 s5-1 x))) (the int (* 144.0 (-> gp-0 s5-1 y))) 10 10 (new 'static 'rgba :a #x80 :r (- 255 (* 7 s5-1))) #x3fffff ) ) ) ) #f ) ;; definition (debug) for function add-debug-light ;; INFO: Used lq/sq (defun-debug add-debug-light ((arg0 symbol) (arg1 bucket-id) (arg2 light) (arg3 vector) (arg4 string)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) (vf5 :class vf) (vf6 :class vf) (vf7 :class vf) ) (init-vf0-vector) (if (not (or arg0 *display-capture-mode*)) (return #f) ) (when (!= (-> arg2 extra x) 0.0) (add-debug-vector arg0 arg1 arg3 (-> arg2 direction) (meters 3) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) (let ((s2-0 (new-stack-vector0))) (let ((v1-4 (-> arg2 direction))) (let ((a0-3 (* 12288.0 (-> arg2 extra x)))) (.mov vf7 a0-3) ) (.lvf vf5 (&-> v1-4 quad)) ) (.lvf vf4 (&-> arg3 quad)) (.add.x.vf.w vf6 vf0 vf0) (.mul.x.vf.xyz acc vf5 vf7) (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) (.svf (&-> s2-0 quad) vf6) (let ((s1-1 (logior (logior (logior (shr (shl (the int (* 128.0 (-> arg2 color w))) 56) 32) (shr (shl (the int (* 128.0 (-> arg2 color z))) 56) 40) ) (shr (shl (the int (* 128.0 (-> arg2 color y))) 56) 48) ) (shr (shl (the int (* 128.0 (-> arg2 color x))) 56) 56) ) ) ) (format (clear *temp-string*) "~S ~,,2f" arg4 (-> arg2 extra x)) (let ((t0-2 *temp-string*)) (add-debug-text-sphere arg0 arg1 s2-0 (* 2048.0 (-> arg2 extra x)) t0-2 (the-as rgba s1-1)) ) ) ) ) #f ) ) ;; definition (debug) for function add-debug-lights (defun-debug add-debug-lights ((arg0 symbol) (arg1 bucket-id) (arg2 (inline-array light)) (arg3 vector)) (if (not (or arg0 *display-capture-mode*)) (return #f) ) (add-debug-light arg0 arg1 (-> arg2 0) arg3 "dir0") (add-debug-light arg0 arg1 (-> arg2 1) arg3 "dir1") (add-debug-light arg0 arg1 (-> arg2 2) arg3 "dir2") (add-debug-light arg0 arg1 (-> arg2 3) arg3 "ambi") #f ) ;; definition (debug) for function drawable-frag-count (defun-debug drawable-frag-count ((arg0 drawable)) (let ((gp-0 0)) (cond ((not arg0) ) ((type? arg0 drawable-group) (dotimes (s4-0 (-> (the-as drawable-group arg0) length)) (+! gp-0 (drawable-frag-count (-> (the-as drawable-group arg0) data s4-0))) ) ) (else (+! gp-0 1) ) ) gp-0 ) ) ;; definition for method 3 of type debug-vertex-stats (defmethod inspect ((this debug-vertex-stats)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tpos-count: ~D~%" (-> this pos-count)) (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this vertex)) (dotimes (s5-0 (-> this length)) (let ((s4-0 (-> this vertex s5-0))) (format #t " ~D : trans: ~D ~D ~D ~D" s5-0 (-> s4-0 trans x) (-> s4-0 trans y) (-> s4-0 trans z) (-> s4-0 trans w) ) (format #t " st: ~D ~D~%" (-> s4-0 st x) (-> s4-0 st y)) (format #t " col: ~X norm: ~D ~D ~D~%" (-> s4-0 color) (-> s4-0 normal x) (-> s4-0 normal y) (-> s4-0 normal z) ) ) ) this ) ;; definition (debug) for function history-init (defun-debug history-init ((arg0 pos-history) (arg1 int)) (set! (-> arg0 num-points) arg1) (set! (-> arg0 points) (the-as (inline-array vector) #f)) arg0 ) ;; definition (debug) for function history-draw-and-update ;; INFO: Used lq/sq (defun-debug history-draw-and-update ((arg0 pos-history) (arg1 symbol) (arg2 vector)) (if (and arg1 (not (-> arg0 points))) (set! (-> arg0 points) (the-as (inline-array vector) (malloc 'debug (* (-> arg0 num-points) 16)))) ) (when (-> arg0 points) (set! (-> arg0 points (-> arg0 h-first) quad) (-> arg2 quad)) (+! (-> arg0 h-first) 1) (when (>= (-> arg0 h-first) (-> arg0 num-points)) (set! (-> arg0 h-first) 0) 0 ) ) (when (and arg1 (or (not *display-capture-mode*) (-> *setting-control* user-current unknown-uint32-1))) (dotimes (s5-1 (+ (-> arg0 num-points) -1)) (if (!= (+ s5-1 1) (-> arg0 h-first)) (add-debug-line #t (bucket-id bucket785) (-> arg0 points s5-1) (-> arg0 points (+ s5-1 1)) (new 'static 'rgba :r #x80 :g #xc0 :b #x80 :a #x80) #f (the-as rgba -1) ) ) ) ) #f ) ;; definition (debug) for function dma-timeout-cam ;; INFO: Used lq/sq (defun-debug dma-timeout-cam () (let ((a0-0 (new-stack-vector0)) (a1-0 (new-stack-matrix0)) ) (set! (-> a0-0 x) -666764.4) (set! (-> a0-0 y) 21102.984) (set! (-> a0-0 z) 51613.348) (set! (-> a0-0 w) 1.0) (set! (-> a1-0 rvec x) -0.911) (set! (-> a1-0 rvec y) 0.0) (set! (-> a1-0 rvec z) 0.4122) (set! (-> a1-0 rvec w) 0.0) (set! (-> a1-0 uvec x) -0.0984) (set! (-> a1-0 uvec y) 0.971) (set! (-> a1-0 uvec z) -0.2174) (set! (-> a1-0 uvec w) 0.0) (set! (-> a1-0 fvec x) -0.4003) (set! (-> a1-0 fvec y) -0.2387) (set! (-> a1-0 fvec z) -0.8847) (set! (-> a1-0 fvec w) 0.0) (set! (-> a1-0 trans x) 0.0) (set! (-> a1-0 trans y) 0.0) (set! (-> a1-0 trans z) 0.0) (set! (-> a1-0 trans w) 1.0) (debug-set-camera-pos-rot! a0-0 a1-0) ) ) ;; definition (debug) for function display-file-info (defun-debug display-file-info () (when (and *display-file-info* (!= *master-mode* 'menu)) (dotimes (gp-0 (-> *level* length)) (let ((v1-7 (-> *level* level gp-0))) (when (= (-> v1-7 status) 'active) (let ((s5-0 (-> v1-7 bsp))) (format *stdcon* "file name: ~S~%" (-> s5-0 info file-name)) (format *stdcon* "version: ~D.~D~%" (-> s5-0 info major-version) (-> s5-0 info minor-version)) (format *stdcon* "maya file: ~S~%" (-> s5-0 info maya-file-name)) (format *stdcon* "mdb file: ~S~%" (-> s5-0 info mdb-file-name)) (format *stdcon* "~S" (-> s5-0 info tool-debug)) ) ) ) ) ) 0 ) ;; definition (debug) for function add-debug-cursor ;; INFO: Used lq/sq (defun-debug add-debug-cursor ((arg0 symbol) (arg1 bucket-id) (arg2 int) (arg3 int) (arg4 mouse-buttons)) (when (and arg0 (or (not *display-capture-mode*) (-> *setting-control* user-current unknown-uint32-1))) (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) arg1 ) (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) (let ((v1-10 arg4)) (draw-string-xy "X" s4-0 (+ arg2 -5) (+ arg3 -4) (cond ((= v1-10 (mouse-buttons left)) (font-color red) ) ((= v1-10 (mouse-buttons right)) (font-color yellow) ) ((= v1-10 (mouse-buttons middle)) (font-color green) ) (else (font-color default) ) ) (font-flags shadow kerning) ) ) ) ) 0 ) ;; this part is debug only (when *debug-segment* ;; definition for symbol *boundary-polygon*, type (inline-array sky-vertex) (define *boundary-polygon* (the-as (inline-array sky-vertex) (malloc 'debug 768))) ) ;; definition (debug) for function init-boundary-regs ;; INFO: function output is handled by mips2c (def-mips2c init-boundary-regs (function none)) ;; definition (debug) for function add-boundary-shader ;; WARN: Return type mismatch pointer vs none. (defun-debug add-boundary-shader ((arg0 texture-id) (arg1 dma-buffer)) (let ((a1-1 (lookup-texture-by-id arg0))) (when a1-1 (let* ((v1-0 arg1) (a0-1 (the-as object (-> v1-0 base))) ) (set! (-> (the-as gs-gif-tag a0-1) tag) (new 'static 'gif-tag64 :nloop #x1 :nreg #x5)) (set! (-> (the-as gs-gif-tag a0-1) regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d) :regs1 (gif-reg-id a+d) :regs2 (gif-reg-id a+d) :regs3 (gif-reg-id a+d) :regs4 (gif-reg-id a+d) ) ) (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) ) (let ((s5-0 (the-as adgif-shader (-> arg1 base)))) (adgif-shader<-texture-simple! s5-0 a1-1) (set! (-> s5-0 alpha) (new 'static 'gs-miptbp :tbp1 #x44)) (set! (-> s5-0 tex0 tfx) 0) (set! (-> s5-0 tex1 mmag) 0) (set! (-> s5-0 clamp) (new 'static 'gs-clamp)) ) 0 (&+! (-> arg1 base) 80) ) ) (none) ) ;; definition (debug) for function draw-boundary-polygon ;; INFO: function output is handled by mips2c (def-mips2c draw-boundary-polygon function) ;; definition (debug) for function render-boundary-quad ;; INFO: function output is handled by mips2c (def-mips2c render-boundary-quad function) ;; definition (debug) for function render-boundary-tri ;; INFO: function output is handled by mips2c (def-mips2c render-boundary-tri (function sky-vertex dma-buffer none)) ;; definition (debug) for function add-debug-bound-internal ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. (defun-debug add-debug-bound-internal ((arg0 dma-buffer) (arg1 (inline-array vector)) (arg2 int) (arg3 rgba) (arg4 rgba) (arg5 int)) (rlet ((vf27 :class vf)) (cond ((nonzero? arg5) (set-vector! (-> *boundary-polygon* 0 col) (the float (-> arg3 r)) (the float (-> arg3 g)) (the float (-> arg3 b)) (the float (-> arg3 a)) ) (set-vector! (-> *boundary-polygon* 1 col) (the float (-> arg4 r)) (the float (-> arg4 g)) (the float (-> arg4 b)) (the float (-> arg4 a)) ) ) (else (set-vector! (-> *boundary-polygon* 0 col) (the float (-> arg3 r)) (the float (-> arg3 g)) (the float (-> arg3 b)) (the float (shr (-> arg3 a) 1)) ) (set-vector! (-> *boundary-polygon* 1 col) (the float (-> arg4 r)) (the float (-> arg4 g)) (the float (-> arg4 b)) (the float (shr (-> arg4 a) 1)) ) ) ) (init-boundary-regs) (.lvf vf27 (&-> *sky-work* giftag-clouds quad)) (let ((s3-0 0) (s2-0 (new 'static 'inline-array vector 4 (new 'static 'vector :data (new 'static 'array float 4 1.0 8.0 1.0 1.0)) (new 'static 'vector :data (new 'static 'array float 4 0.0 0.0 1.0 1.0)) (new 'static 'vector :data (new 'static 'array float 4 0.0 8.0 1.0 1.0)) (new 'static 'vector :data (new 'static 'array float 4 1.0 0.0 1.0 1.0)) ) ) ) (while (< s3-0 (+ arg2 -2)) (cond ((not (logtest? s3-0 1)) (dotimes (v1-10 3) (set! (-> *boundary-polygon* v1-10 pos quad) (-> arg1 (+ s3-0 v1-10) quad)) (set! (-> *boundary-polygon* v1-10 stq quad) (-> s2-0 (+ s3-0 v1-10) quad)) ) ) (else (set! (-> *boundary-polygon* 0 pos quad) (-> arg1 (+ s3-0 1) quad)) (set! (-> *boundary-polygon* 1 pos quad) (-> arg1 s3-0 quad)) (set! (-> *boundary-polygon* 2 pos quad) (-> arg1 (+ s3-0 2) quad)) (set! (-> *boundary-polygon* 0 stq quad) (-> s2-0 (+ s3-0 1) quad)) (set! (-> *boundary-polygon* 1 stq quad) (-> s2-0 s3-0 quad)) (set! (-> *boundary-polygon* 2 stq quad) (-> s2-0 (+ s3-0 2) quad)) ) ) (render-boundary-tri (-> *boundary-polygon* 0) arg0) (+! s3-0 1) ) ) (none) ) ) ;; definition (debug) for function add-debug-bound ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; WARN: Function add-debug-bound has a return type of none, but the expression builder found a return statement. (defun-debug add-debug-bound ((arg0 bucket-id) (arg1 (inline-array vector)) (arg2 int) (arg3 rgba) (arg4 rgba) (arg5 int)) (let ((sv-32 arg4) (s1-0 arg5) ) (if (< arg2 3) (return 0) ) (with-dma-buffer-add-bucket ((s2-0 (-> *display* frames (-> *display* on-screen) global-buf)) arg0 ) (let* ((v1-7 *viewport-array*) (v1-8 (-> v1-7 data (-> v1-7 current-viewport-index))) ) (dma-buffer-add-gs-set s2-0 (zbuf-1 (-> v1-8 zbuf-on)) (test-1 (new 'static 'gs-test :zte #x1 :ztst (gs-ztest greater-equal))) (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) ) ) (let ((sv-16 (the-as dma-packet (-> s2-0 base)))) (&+! (-> s2-0 base) 16) (add-boundary-shader (new 'static 'texture-id :index #x3 :page #x1) s2-0) (add-debug-bound-internal s2-0 arg1 arg2 arg3 sv-32 s1-0) (close-sky-buffer s2-0) (let ((v1-22 (/ (+ (- -16 (the-as int sv-16)) (the-as int (-> s2-0 base))) 16))) (set! (-> sv-16 dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc v1-22)) (set! (-> sv-16 vif0) (new 'static 'vif-tag)) (set! (-> sv-16 vif1) (new 'static 'vif-tag :cmd (vif-cmd direct) :msk #x1 :imm v1-22)) ) ) (let* ((v1-26 *viewport-array*) (v1-27 (-> v1-26 data (-> v1-26 current-viewport-index))) ) (dma-buffer-add-gs-set s2-0 (zbuf-1 (-> v1-27 zbuf-on)) (test-1 (new 'static 'gs-test :zte #x1 :ztst (gs-ztest greater-equal))) (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) ) ) (let ((s1-1 (if (= s1-0 1) (the-as int (the-as uint #x80ffffff)) #x60606060 ) ) (s0-1 (/ arg2 4)) ) (add-debug-line #t arg0 (-> arg1 0) (-> arg1 1) (the-as rgba s1-1) #f (the-as rgba -1)) (add-debug-line #t arg0 (-> arg1 0) (-> arg1 2) (the-as rgba s1-1) #f (the-as rgba -1)) (add-debug-line #t arg0 (-> arg1 (+ arg2 -1)) (-> arg1 (+ arg2 -2)) (the-as rgba s1-1) #f (the-as rgba -1)) (let ((sv-48 0)) (while (< sv-48 s0-1) (let* ((a2-15 (+ (* sv-48 2) 1)) (v1-43 (+ a2-15 2)) (sv-64 (+ a2-15 1)) (sv-80 (+ sv-64 2)) ) (if (< sv-64 arg2) (add-debug-line #t arg0 (-> arg1 a2-15) (-> arg1 v1-43) (the-as rgba s1-1) #f (the-as rgba -1)) ) (if (< sv-80 arg2) (add-debug-line #t arg0 (-> arg1 sv-64) (-> arg1 sv-80) (the-as rgba s1-1) #f (the-as rgba -1)) ) ) (+! sv-48 1) ) ) ) ) ) 0 (none) ) ;; definition (debug) for function cpu-delay ;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 a1, Count] (defun-debug cpu-delay ((arg0 uint)) (local-vars (v1-2 int) (a1-0 int) (a1-1 int)) 0 0 (.mfc0 v1-2 Count) (until (>= (the-as uint a1-1) arg0) (.mfc0 a1-0 Count) (nop!) (set! a1-1 (- a1-0 v1-2)) (nop!) ) 0 (none) ) ;; definition (debug) for function qword-read-time ;; INFO: Used lq/sq ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 a0, Count] ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] (defun-debug qword-read-time ((arg0 (pointer uint128)) (arg1 int)) (local-vars (v1-1 int) (a0-1 int)) (let ((v1-0 (shr arg1 2)) (a1-1 arg0) ) (.mfc0 a0-1 Count) (until (zero? v1-0) (-> a1-1 0) (+! v1-0 -1) (-> a1-1 1) (nop!) (-> a1-1 2) (nop!) (-> a1-1 3) (set! a1-1 (&-> a1-1 4)) ) ) (.mfc0 v1-1 Count) (- v1-1 a0-1) ) ;; definition (debug) for function bugfix? (defun-debug bugfix? () (let ((s5-0 (the-as int #xffffffff)) (gp-0 (the-as int #xffffffff)) (s4-0 (logior #x20000000 (logand (the-as uint #xffffffc0) #f))) ) 0 (let ((s3-0 (+ #x2000000 s4-0))) (dotimes (s2-0 100) (set! s5-0 (min s5-0 (qword-read-time (the-as (pointer uint128) s4-0) 128))) (set! gp-0 (min gp-0 (qword-read-time (the-as (pointer uint128) s3-0) 128))) ) (let ((f30-0 (/ (the float gp-0) (the float s5-0)))) (format #t "qword read times: hi #x~x ~d, lo #x~x ~d~%" s3-0 gp-0 s4-0 s5-0) (format #t "hi/lo memory bank uncached read speed ratio is ~f~%" f30-0) (format #t "If the workaround for the EE memory controller bug is turned on, this ratio should be about 1.3, otherwise about 1.0.~%" ) (< 1.15 f30-0) ) ) ) )