[jak2] GOAL side texture animation stuff (#2766)

It turns out we didn't decompile any of this stuff yet.
This commit is contained in:
water111
2023-06-24 10:11:47 -04:00
committed by GitHub
parent 97fd6a6e8d
commit 2fc943977f
45 changed files with 4197 additions and 391 deletions
+5 -17
View File
@@ -162,7 +162,6 @@
;; definition for method 78 of type ocean
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ a0-3 8) 0) at op 21
(defmethod draw-ocean-texture ocean ((obj ocean) (arg0 dma-buffer) (arg1 int))
(set-display-gs-state arg0 21 128 128 0 0)
(ocean-texture-add-envmap obj arg0)
@@ -204,7 +203,6 @@
;; definition for method 79 of type ocean
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ a0-2 8) 0) at op 14
(defmethod ocean-method-79 ocean ((obj ocean) (arg0 dma-buffer))
(set-display-gs-state arg0 53 64 64 0 0)
(dma-buffer-add-gs-set arg0
@@ -303,7 +301,7 @@
;; WARN: Return type mismatch int vs none.
(defmethod ocean-method-80 ocean ((obj ocean) (arg0 (pointer rgba)))
(dotimes (v1-0 256)
(let ((a0-3 (-> (the-as (pointer uint8) (&+ *clut-translate* v1-0)))))
(let ((a0-3 (-> *clut-translate* v1-0)))
(set! (-> arg0 a0-3 r) v1-0)
(set! (-> arg0 a0-3 g) v1-0)
(set! (-> arg0 a0-3 b) v1-0)
@@ -339,7 +337,6 @@
;; definition for method 81 of type ocean
;; INFO: Used lq/sq
;; ERROR: Failed store: (s.w! (+ a0-2 8) 0) at op 14
(defmethod ocean-method-81 ocean ((obj ocean) (arg0 dma-buffer))
(set-display-gs-state arg0 53 128 128 0 0)
(dma-buffer-add-gs-set arg0
@@ -460,9 +457,9 @@
(dotimes (a3-9 (/ s5-1 16))
(dma-buffer-add-gs-set arg0
(uv (new 'static 'gs-uv :v #x8 :u (+ (* a3-9 256) 8)))
(xyz2 (shr (shl (+ (* a3-9 256) 128) 48) 48))
(xyz2 (new 'static 'gs-xyz :x (+ (* a3-9 256) 128)))
(uv (new 'static 'gs-uv :u (+ (* a3-9 256) 136) :v (+ (* a2-6 16) 8)))
(xyz2 (logior (shr (shl (+ (* a3-9 256) 256) 48) 48) (shr (shl (* a2-6 16) 48) 32)))
(xyz2 (new 'static 'gs-xyz :y (* a2-6 16) :x (+ (* a3-9 256) 256)))
)
)
)
@@ -479,9 +476,9 @@
(dotimes (v1-73 (/ s5-1 16))
(dma-buffer-add-gs-set arg0
(uv (new 'static 'gs-uv :v #x8 :u (+ (* v1-73 256) 8)))
(xyz2 (shr (shl (+ (* v1-73 256) 128) 48) 48))
(xyz2 (new 'static 'gs-xyz :x (+ (* v1-73 256) 128)))
(uv (new 'static 'gs-uv :u (+ (* v1-73 256) 136) :v (+ (* s4-3 16) 8)))
(xyz2 (logior (shr (shl (+ (* v1-73 256) 256) 48) 48) (shr (shl (* s4-3 16) 48) 32)))
(xyz2 (new 'static 'gs-xyz :y (* s4-3 16) :x (+ (* v1-73 256) 256)))
)
)
)
@@ -491,7 +488,6 @@
;; definition for method 82 of type ocean
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ a0-2 8) 0) at op 11
(defmethod draw-envmap-debug ocean ((obj ocean) (arg0 dma-buffer))
(format *stdcon* "draw-envmap-debug~%")
(-> arg0 base)
@@ -547,7 +543,6 @@
;; definition for method 83 of type ocean
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ a0-1 8) 0) at op 14
(defmethod ocean-method-83 ocean ((obj ocean) (arg0 dma-buffer) (arg1 float))
(let* ((s4-0 64)
(s3-0 0)
@@ -640,7 +635,6 @@
;; definition for method 85 of type ocean
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ a0-1 8) 0) at op 6
(defmethod ocean-method-85 ocean ((obj ocean) (arg0 dma-buffer))
(local-vars (sv-48 vector4w) (sv-64 vector4w))
(dma-buffer-add-gs-set arg0 (alpha-1 (new 'static 'gs-alpha :b #x2 :d #x1)))
@@ -794,7 +788,6 @@
;; definition for method 88 of type ocean
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ a0-1 8) 0) at op 6
(defmethod ocean-method-88 ocean ((obj ocean) (arg0 dma-buffer))
(local-vars (sv-48 vector) (sv-64 uint) (sv-80 vector) (sv-96 vector) (sv-112 vector))
(dma-buffer-add-gs-set arg0
@@ -930,7 +923,6 @@
;; definition for method 89 of type ocean
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ a0-4 8) 0) at op 40
(defmethod ocean-method-89 ocean ((obj ocean) (arg0 dma-buffer))
(set-display-gs-state arg0 (the-as int (+ (-> *ocean-texture-base* vram-page) 8)) 64 64 0 0)
(vector-float*! (-> obj sky-color) (-> *time-of-day-context* current-sky-color) 0.25)
@@ -1381,7 +1373,3 @@
v0-0
)
)
@@ -0,0 +1,250 @@
;;-*-Lisp-*-
(in-package goal)
;; definition for function noise-texture-anim-layer-func
(defun noise-texture-anim-layer-func ((dma-buf dma-buffer) (fbp-to-draw uint) (width int) (height int) (layer texture-anim-layer) (time float))
(when (and (>= time (-> layer start-time)) (< time (-> layer end-time)))
(texture-anim-layer-interp layer time)
(when (!= (-> layer interpolated-color w) 0.0)
(upload-vram-data dma-buf (the-as int (-> layer tex dest 0)) (the-as pointer (-> layer tex pad 0)) 32 32)
(dma-buffer-add-gs-set dma-buf (texflush 0))
(texture-anim-layer-add-shader dma-buf layer 1)
(let ((s1-0 (/ (+ width 63) 64)))
(dma-buffer-add-gs-set dma-buf (frame-1 (new 'static 'gs-frame :fbmsk #xffffff :fbw s1-0 :fbp fbp-to-draw)))
(texture-anim-layer-draw dma-buf width height layer)
(let* ((v1-13 dma-buf)
(a0-17 (the-as object (-> v1-13 base)))
)
(set! (-> (the-as dma-packet a0-17) dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
(set! (-> (the-as dma-packet a0-17) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet a0-17) vif1) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1))
(set! (-> v1-13 base) (&+ (the-as pointer a0-17) 16))
)
(let* ((v1-14 dma-buf)
(a0-19 (the-as object (-> v1-14 base)))
)
(set! (-> (the-as gs-gif-tag a0-19) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1))
(set! (-> (the-as gs-gif-tag a0-19) regs) GIF_REGS_ALL_AD)
(set! (-> v1-14 base) (&+ (the-as pointer a0-19) 16))
)
(let ((v1-15 (-> dma-buf base)))
(set! (-> (the-as (pointer gs-frame) v1-15) 0) (new 'static 'gs-frame :fbw s1-0 :fbp fbp-to-draw))
(set! (-> (the-as (pointer gs-reg64) v1-15) 1) (gs-reg64 frame-1))
(set! (-> dma-buf base) (&+ v1-15 16))
)
)
)
)
0
)
;; definition for function cloud-texture-anim-layer-func
(defun cloud-texture-anim-layer-func ((dma-buf dma-buffer) (fbp-to-draw uint) (width int) (height int) (layer texture-anim-layer) (time float))
(when (and (>= time (-> layer start-time)) (< time (-> layer end-time)))
(texture-anim-layer-interp layer time)
(when (!= (-> layer interpolated-color w) 0.0)
(let* ((v1-4 (-> layer tex))
(t0-1 (/ (-> v1-4 w) 2))
(a3-1 (/ (-> v1-4 h) 2))
)
(upload-vram-data dma-buf (the-as int (-> v1-4 dest 0)) (the-as pointer (-> v1-4 pad 0)) a3-1 t0-1)
)
(dma-buffer-add-gs-set dma-buf (texflush 0))
(texture-anim-layer-add-shader dma-buf layer 1)
(texture-anim-layer-draw dma-buf width height layer)
)
)
0
)
;; definition for function cloud-texture-anim-func
(defun cloud-texture-anim-func ((arg0 dma-buffer) (arg1 texture-anim))
(with-pp
(when (>= (+ (-> arg1 frame-time) (* (-> arg1 frame-delta) (-> pp clock seconds-per-frame))) (-> arg1 frame-mod))
(let ((s5-0 (-> arg1 data 0 tex))
(s4-0 (-> arg1 data 1 tex))
(s3-0 (-> arg1 data 0 tex w))
)
(when (not (paused?))
(set! (-> arg1 data 0 tex) s4-0)
(set! (-> arg1 data 1 tex) s5-0)
(make-noise-texture (the-as pointer (-> s5-0 pad 0)) s3-0 s3-0 s3-0)
)
)
)
0
)
)
;; definition for function fog-texture-anim-init
;; INFO: Used lq/sq
(defun fog-texture-anim-init ((arg0 texture-anim))
(let ((gp-0 (new 'loading-level 'fog8x256))
(s4-0 (new 'loading-level 'clut16x16))
)
(when (and gp-0 s4-0)
(let ((v1-5 (new 'loading-level 'texture)))
(let ((a0-4 (the int (-> arg0 extra x)))
(a1-3 (the int (-> arg0 extra y)))
)
(set! (-> arg0 tex) v1-5)
(set! (-> v1-5 pad 0) (the-as uint gp-0))
(set! (-> v1-5 pad 1) (the-as uint s4-0))
(set! (-> v1-5 w) 256)
(set! (-> v1-5 h) 1)
(set! (-> v1-5 num-mips) (the-as uint 1))
(set! (-> v1-5 psm) (gs-psm mt8))
(set! (-> v1-5 clutpsm) (the-as uint 0))
(set! (-> v1-5 dest 0) (the-as uint (* a0-4 32)))
(set! (-> v1-5 clutdest) (the-as uint (* a1-3 32)))
)
(set! (-> v1-5 width 0) (the-as uint 4))
(set! (-> v1-5 masks data 0 mask quad) (the-as uint128 0))
(set! (-> v1-5 masks data 1 mask quad) (the-as uint128 0))
(set! (-> v1-5 masks data 2 mask quad) (the-as uint128 0))
)
0
(dotimes (v1-7 256)
(nop!)
(nop!)
(nop!)
(nop!)
(set! (-> gp-0 image v1-7) (the-as uint v1-7))
)
)
)
0
)
;; definition for symbol *fog-texture-work*, type fog-texture-work
(define *fog-texture-work* (new 'static 'fog-texture-work :const (new 'static 'vector :x 0.00390625)))
;; definition for function real-fog-texture-anim-func
;; INFO: Used lq/sq
;; WARN: Return type mismatch symbol vs int.
(defun real-fog-texture-anim-func ((arg0 dma-buffer) (arg1 texture-anim))
(local-vars (sv-48 int))
(let ((s4-0 (new 'stack-no-clear 'vector))
(s3-0 (new 'stack-no-clear 'vector))
(s1-0 *fog-texture-work*)
(s2-0 (the-as (pointer uint32) (-> arg1 tex pad 1)))
)
(let ((v1-1 (-> s1-0 color)))
(dotimes (a0-1 256)
(set! (-> s2-0 a0-1) v1-1)
)
)
(set! sv-48 0)
(let ((s0-0 0))
(let ((f0-0 40955904.0)
(f1-0 -40955904.0)
)
(dotimes (v1-7 4)
(let ((f2-0 (-> *fog-texture-work* corner v1-7 y)))
(when (< f2-0 f0-0)
(set! f0-0 f2-0)
(set! sv-48 v1-7)
sv-48
)
(when (< f1-0 f2-0)
(set! f1-0 f2-0)
(set! s0-0 v1-7)
)
)
)
)
(set! (-> s4-0 quad) (-> *fog-texture-work* corner sv-48 quad))
(vector-! s3-0 (-> *fog-texture-work* corner s0-0) (-> *fog-texture-work* corner sv-48))
(vector-float/! s3-0 s3-0 256.0)
(set! (-> *fog-texture-work* min-corner quad) (-> *fog-texture-work* corner sv-48 quad))
(set! (-> *fog-texture-work* max-corner quad) (-> *fog-texture-work* corner s0-0 quad))
)
0.0
0.0
(let ((f0-4 (fmax 4096.0 (-> *math-camera* trans y)))
(f1-2 (-> arg1 extra z))
(f2-1 (-> s1-0 alpha-near))
(f3-0 (-> s1-0 alpha-far))
(f4-0 (-> s1-0 alpha-delta))
(f5-0 (-> s1-0 fog-near))
(f6-0 (-> s1-0 fog-far))
(f7-0 (-> s1-0 fog-delta))
)
(dotimes (v1-19 256)
(let* ((f8-0 (-> s4-0 y))
(f8-1 (cond
((= f8-0 0.0)
f3-0
)
((< f8-0 0.0)
(let ((f9-4 (fmin f6-0 (/ (* f0-4 (vector-length s4-0)) (- f8-0)))))
(+ f2-1 (* f4-0 (/ (fmax 0.0 (- f9-4 f5-0)) f7-0)))
)
)
(else
(let ((f9-8 (fmin f6-0 (/ (* f1-2 (vector-length s4-0)) f8-0))))
(+ f2-1 (* f4-0 (/ (fmax 0.0 (- f9-8 f5-0)) f7-0)))
)
)
)
)
)
(set! (-> s2-0 (-> *clut-translate* v1-19))
(logior (logand (-> s2-0 (-> *clut-translate* v1-19)) (the-as uint #xffffffff00ffffff))
(shr (shl (the int (* 128.0 f8-1)) 56) 32)
)
)
)
(vector+! s4-0 s4-0 s3-0)
)
)
)
(let ((s5-1 (-> arg1 tex)))
(dma-buffer-add-gs-set arg0
(bitbltbuf
(new 'static 'gs-bitbltbuf :dpsm (the-as int (-> s5-1 psm)) :dbp (-> s5-1 dest 0) :dbw (-> s5-1 width 0))
)
(trxpos (new 'static 'gs-trxpos))
(trxreg (new 'static 'gs-trxreg :rrw (-> s5-1 w) :rrh (-> s5-1 h)))
(trxdir (new 'static 'gs-trxdir))
)
(dma-buffer-add-ref-texture arg0 (the-as pointer (-> s5-1 pad 0)) (-> s5-1 w) (-> s5-1 h) (-> s5-1 psm))
(upload-vram-data arg0 (the-as int (-> s5-1 clutdest)) (the-as pointer (-> s5-1 pad 1)) 16 16)
(set! (-> *texture-pool* ids (shr (-> s5-1 clutdest) 6)) (the-as uint 0))
(let* ((v1-29 arg0)
(a0-51 (the-as object (-> v1-29 base)))
)
(set! (-> (the-as dma-packet a0-51) dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
(set! (-> (the-as dma-packet a0-51) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet a0-51) vif1) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1))
(set! (-> v1-29 base) (&+ (the-as pointer a0-51) 16))
)
(let* ((v1-30 arg0)
(a0-53 (the-as object (-> v1-30 base)))
)
(set! (-> (the-as gs-gif-tag a0-53) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1))
(set! (-> (the-as gs-gif-tag a0-53) regs) GIF_REGS_ALL_AD)
(set! (-> v1-30 base) (&+ (the-as pointer a0-53) 16))
)
(let ((v1-31 (-> arg0 base)))
(set! (-> (the-as (pointer int64) v1-31)) 0)
(set! (-> (the-as (pointer gs-reg64) v1-31) 1) (gs-reg64 texflush))
(set! (-> arg0 base) (&+ v1-31 16))
)
(let ((v1-34 (shr (-> s5-1 dest 0) 6)))
(dotimes (a0-56 3)
(set! (-> *texture-pool* ids (+ v1-34 a0-56)) (the-as uint 0))
)
)
)
(the-as int #f)
)
;; definition for function fog-texture-anim-func
(defun fog-texture-anim-func ((arg0 dma-buffer) (arg1 texture-anim))
(real-fog-texture-anim-func arg0 arg1)
)
+316 -120
View File
@@ -3,41 +3,49 @@
;; definition of type texture-anim-layer
(deftype texture-anim-layer (structure)
((extra vector :inline :offset 240)
(func (function texture-anim-layer int) :offset 256)
(func-id symbol :offset 256)
(init-func (function texture-anim-layer int) :offset 260)
(init-func-id symbol :offset 260)
(tex texture :offset 264)
(start-time float :offset 268)
(end-time float :offset 272)
(tex-name string :offset 276)
(test gs-test :offset 280)
(alpha gs-alpha :offset 288)
(clamp gs-clamp :offset 296)
(start-color vector :inline :offset 80)
(start-scale vector2 :inline :offset 96)
(start-offset vector2 :inline :offset 104)
(start-st-scale vector2 :inline :offset 112)
(start-st-offset vector2 :inline :offset 120)
(start-qs vector :inline :offset 128)
(start-rot degrees :offset 144)
(start-st-rot degrees :offset 148)
(end-color vector :inline :offset 160)
(end-scale vector2 :inline :offset 176)
(end-offset vector2 :inline :offset 184)
(end-st-scale vector2 :inline :offset 192)
(end-st-offset vector2 :inline :offset 200)
(end-qs vector :inline :offset 208)
(end-rot degrees :offset 224)
(end-st-rot degrees :offset 228)
((interpolated-color vector :inline :offset-assert 0)
(interpolated-scale-offset vector :inline :offset-assert 16)
(interpolated-st-scale-offset vector :inline :offset-assert 32)
(interpolated-qs vector :inline :offset-assert 48)
(interpolated-rot vector :inline :offset-assert 64)
(extra vector :inline :offset 240)
(func (function dma-buffer uint int int texture-anim-layer float int) :offset 256)
(func-id symbol :offset 256)
(init-func (function texture-anim-layer int) :offset 260)
(init-func-id symbol :offset 260)
(tex texture :offset 264)
(start-time float :offset 268)
(end-time float :offset 272)
(tex-name string :offset 276)
(test gs-test :offset 280)
(alpha gs-alpha :offset 288)
(clamp gs-clamp :offset 296)
(start-vectors vector 5 :inline :offset 80)
(start-color vector :inline :offset 80)
(start-scale vector2 :inline :offset 96)
(start-offset vector2 :inline :offset 104)
(start-st-scale vector2 :inline :offset 112)
(start-st-offset vector2 :inline :offset 120)
(start-qs vector :inline :offset 128)
(start-rot degrees :offset 144)
(start-st-rot degrees :offset 148)
(end-vectors vector 5 :inline :offset 160)
(end-color vector :inline :offset 160)
(end-scale vector2 :inline :offset 176)
(end-offset vector2 :inline :offset 184)
(end-scale-offset vector :inline :offset 176)
(end-st-scale vector2 :inline :offset 192)
(end-st-offset vector2 :inline :offset 200)
(end-qs vector :inline :offset 208)
(end-rot degrees :offset 224)
(end-st-rot degrees :offset 228)
)
:method-count-assert 11
:size-assert #x130
:flag-assert #xb00000130
(:methods
(texture-anim-layer-method-9 (_type_) _type_ 9)
(texture-anim-layer-method-10 (_type_) _type_ 10)
(initialize-texture! (_type_) _type_ 9)
(clear-texture! (_type_) _type_ 10)
)
)
@@ -82,29 +90,29 @@
;; definition of type texture-anim
(deftype texture-anim (structure)
((num-layers uint32 :offset-assert 0)
(func (function texture-anim int) :offset-assert 4)
(func-id symbol :offset 4)
(init-func (function texture-anim int) :offset-assert 8)
(init-func-id symbol :offset 8)
(tex texture :offset-assert 12)
(tex-name string :offset-assert 16)
(extra vector :inline :offset-assert 32)
(color rgba :offset-assert 48)
(frame-time float :offset-assert 52)
(frame-delta float :offset-assert 56)
(frame-mod float :offset-assert 60)
(test gs-test :offset-assert 64)
(alpha gs-alpha :offset-assert 72)
(clamp gs-clamp :offset-assert 80)
(data texture-anim-layer :dynamic :offset-assert 88)
((num-layers uint32 :offset-assert 0)
(func (function dma-buffer texture-anim int) :offset-assert 4)
(func-id symbol :offset 4)
(init-func (function texture-anim int) :offset-assert 8)
(init-func-id symbol :offset 8)
(tex texture :offset-assert 12)
(tex-name string :offset-assert 16)
(extra vector :inline :offset-assert 32)
(color rgba :offset-assert 48)
(frame-time float :offset-assert 52)
(frame-delta float :offset-assert 56)
(frame-mod float :offset-assert 60)
(test gs-test :offset-assert 64)
(alpha gs-alpha :offset-assert 72)
(clamp gs-clamp :offset-assert 80)
(data texture-anim-layer :dynamic :offset-assert 88)
)
:method-count-assert 11
:size-assert #x58
:flag-assert #xb00000058
(:methods
(texture-anim-method-9 (_type_) _type_ 9)
(texture-anim-method-10 (_type_) _type_ 10)
(init-textures! (_type_) _type_ 9)
(clear-textures! (_type_) _type_ 10)
)
)
@@ -143,8 +151,8 @@
:size-assert #x10
:flag-assert #xb00000010
(:methods
(texture-anim-array-method-9 (_type_) _type_ 9)
(texture-anim-array-method-10 (_type_) _type_ 10)
(init! (_type_) _type_ 9)
(clear! (_type_) _type_ 10)
)
)
@@ -394,78 +402,266 @@
obj
)
;; definition for symbol *clut-translate*, type (pointer uint32)
(define *clut-translate* (new 'static 'array uint32 64
#x3020100
#x7060504
#x13121110
#x17161514
#xb0a0908
#xf0e0d0c
#x1b1a1918
#x1f1e1d1c
#x23222120
#x27262524
#x33323130
#x37363534
#x2b2a2928
#x2f2e2d2c
#x3b3a3938
#x3f3e3d3c
#x43424140
#x47464544
#x53525150
#x57565554
#x4b4a4948
#x4f4e4d4c
#x5b5a5958
#x5f5e5d5c
#x63626160
#x67666564
#x73727170
#x77767574
#x6b6a6968
#x6f6e6d6c
#x7b7a7978
#x7f7e7d7c
#x83828180
#x87868584
#x93929190
#x97969594
#x8b8a8988
#x8f8e8d8c
#x9b9a9998
#x9f9e9d9c
#xa3a2a1a0
#xa7a6a5a4
#xb3b2b1b0
#xb7b6b5b4
#xabaaa9a8
#xafaeadac
#xbbbab9b8
#xbfbebdbc
#xc3c2c1c0
#xc7c6c5c4
#xd3d2d1d0
#xd7d6d5d4
#xcbcac9c8
#xcfcecdcc
#xdbdad9d8
#xdfdedddc
#xe3e2e1e0
#xe7e6e5e4
#xf3f2f1f0
#xf7f6f5f4
#xebeae9e8
#xefeeedec
#xfbfaf9f8
#xfffefdfc
;; definition for symbol *clut-translate*, type (pointer uint8)
(define *clut-translate* (new 'static 'array uint8 256
#x0
#x1
#x2
#x3
#x4
#x5
#x6
#x7
#x10
#x11
#x12
#x13
#x14
#x15
#x16
#x17
#x8
#x9
#xa
#xb
#xc
#xd
#xe
#xf
#x18
#x19
#x1a
#x1b
#x1c
#x1d
#x1e
#x1f
#x20
#x21
#x22
#x23
#x24
#x25
#x26
#x27
#x30
#x31
#x32
#x33
#x34
#x35
#x36
#x37
#x28
#x29
#x2a
#x2b
#x2c
#x2d
#x2e
#x2f
#x38
#x39
#x3a
#x3b
#x3c
#x3d
#x3e
#x3f
#x40
#x41
#x42
#x43
#x44
#x45
#x46
#x47
#x50
#x51
#x52
#x53
#x54
#x55
#x56
#x57
#x48
#x49
#x4a
#x4b
#x4c
#x4d
#x4e
#x4f
#x58
#x59
#x5a
#x5b
#x5c
#x5d
#x5e
#x5f
#x60
#x61
#x62
#x63
#x64
#x65
#x66
#x67
#x70
#x71
#x72
#x73
#x74
#x75
#x76
#x77
#x68
#x69
#x6a
#x6b
#x6c
#x6d
#x6e
#x6f
#x78
#x79
#x7a
#x7b
#x7c
#x7d
#x7e
#x7f
#x80
#x81
#x82
#x83
#x84
#x85
#x86
#x87
#x90
#x91
#x92
#x93
#x94
#x95
#x96
#x97
#x88
#x89
#x8a
#x8b
#x8c
#x8d
#x8e
#x8f
#x98
#x99
#x9a
#x9b
#x9c
#x9d
#x9e
#x9f
#xa0
#xa1
#xa2
#xa3
#xa4
#xa5
#xa6
#xa7
#xb0
#xb1
#xb2
#xb3
#xb4
#xb5
#xb6
#xb7
#xa8
#xa9
#xaa
#xab
#xac
#xad
#xae
#xaf
#xb8
#xb9
#xba
#xbb
#xbc
#xbd
#xbe
#xbf
#xc0
#xc1
#xc2
#xc3
#xc4
#xc5
#xc6
#xc7
#xd0
#xd1
#xd2
#xd3
#xd4
#xd5
#xd6
#xd7
#xc8
#xc9
#xca
#xcb
#xcc
#xcd
#xce
#xcf
#xd8
#xd9
#xda
#xdb
#xdc
#xdd
#xde
#xdf
#xe0
#xe1
#xe2
#xe3
#xe4
#xe5
#xe6
#xe7
#xf0
#xf1
#xf2
#xf3
#xf4
#xf5
#xf6
#xf7
#xe8
#xe9
#xea
#xeb
#xec
#xed
#xee
#xef
#xf8
#xf9
#xfa
#xfb
#xfc
#xfd
#xfe
#xff
)
)
;; failed to figure out what this is:
0
File diff suppressed because it is too large Load Diff
+12 -4
View File
@@ -1,7 +1,10 @@
;;-*-Lisp-*-
(in-package goal)
;; failed to figure out what this is:
(setup-font-texture *texture-pool*)
;; failed to figure out what this is:
(let ((v1-2 (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #x70c))))
(when v1-2
(set! (-> v1-2 w) 32)
@@ -10,12 +13,17 @@
)
)
(texture-anim-array-method-9 *sky-texture-anim-array*)
;; failed to figure out what this is:
(init! *sky-texture-anim-array*)
(texture-anim-array-method-9 *darkjak-texture-anim-array*)
;; failed to figure out what this is:
(init! *darkjak-texture-anim-array*)
(texture-anim-array-method-9 *skull-gem-texture-anim-array*)
;; failed to figure out what this is:
(init! *skull-gem-texture-anim-array*)
(texture-anim-array-method-9 *bomb-texture-anim-array*)
;; failed to figure out what this is:
(init! *bomb-texture-anim-array*)
;; failed to figure out what this is:
(kmemclose)
+8 -16
View File
@@ -682,7 +682,6 @@
;; definition for function upload-vram-data
;; WARN: Return type mismatch symbol vs none.
;; ERROR: Failed store: (s.w! (+ a0-1 8) 0) at op 13
(defun upload-vram-data ((buf dma-buffer) (dest int) (data pointer) (height int) (width int))
(while (> height 0)
(let ((height-this-time (min 2048 height)))
@@ -702,7 +701,6 @@
)
;; definition for function upload-vram-pages
;; ERROR: Failed store: (s.w! (+ a0-24 8) 0) at op 143
(defun upload-vram-pages ((pool texture-pool)
(dest-seg texture-pool-segment)
(tpage texture-page)
@@ -848,7 +846,6 @@
)
;; definition for function upload-vram-pages-pris
;; ERROR: Failed store: (s.w! (+ a0-27 8) 0) at op 137
(defun upload-vram-pages-pris ((pool texture-pool)
(dest-seg texture-pool-segment)
(tpage texture-page)
@@ -1251,9 +1248,11 @@
(dotimes (s2-1 7)
(let ((v1-54 (-> *level* level s2-1)))
(when (or (= (-> v1-54 status) 'active) (= (-> v1-54 status) 'reserved))
(if (-> v1-54 texture-anim-array 5)
(update-texture-anim bucket)
)
(let ((a1-26 (-> v1-54 texture-anim-array 5)))
(if a1-26
(update-texture-anim bucket a1-26)
)
)
)
)
)
@@ -1265,21 +1264,21 @@
(let ((f30-0 (-> pp clock seconds-per-frame)))
(set! (-> pp clock seconds-per-frame) (* 10.0 (-> pp clock seconds-per-frame)))
(if s2-0
(update-texture-anim bucket)
(update-texture-anim bucket s2-0)
)
(set! (-> pp clock seconds-per-frame) f30-0)
)
)
(else
(if s2-0
(update-texture-anim bucket)
(update-texture-anim bucket s2-0)
)
)
)
)
(else
(if s2-0
(update-texture-anim bucket)
(update-texture-anim bucket s2-0)
)
)
)
@@ -1409,7 +1408,6 @@
;; definition for method 13 of type texture-page
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ a0-1 8) 0) at op 19
(defmethod upload-now! texture-page ((obj texture-page) (arg0 tex-upload-mode))
(let ((gp-0 *txt-dma-list*))
(let ((v1-0 gp-0))
@@ -1462,7 +1460,6 @@
)
;; definition for function texture-relocate
;; ERROR: Failed store: (s.w! (+ t4-0 8) 0) at op 18
(defun texture-relocate ((dma-buff dma-buffer) (tex texture) (dest-loc int) (dest-fmt gs-psm) (clut-dst int))
(dotimes (v1-0 (the-as int (-> tex num-mips)))
(let ((t1-1 (ash (-> tex w) (- v1-0)))
@@ -1551,7 +1548,6 @@
;; WARN: Stack slot offset 16 signed mismatch
;; WARN: Stack slot offset 16 signed mismatch
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ a0-26 8) 0) at op 192
(defmethod setup-font-texture texture-pool ((obj texture-pool))
(local-vars (sv-16 int) (sv-20 int))
(let ((s3-0 (-> obj font-palette)))
@@ -2270,7 +2266,3 @@
;; definition for symbol *texture-pool*, type texture-pool
(define *texture-pool* (new 'global 'texture-pool))
+2 -6
View File
@@ -792,9 +792,7 @@
(dotimes (s4-0 10)
(let ((a0-8 (-> obj info texture-anim s4-0)))
(if a0-8
(set! (-> obj texture-anim-array s4-0)
(texture-anim-array-method-9 (the-as texture-anim-array (-> a0-8 value)))
)
(set! (-> obj texture-anim-array s4-0) (init! (the-as texture-anim-array (-> a0-8 value))))
)
)
)
@@ -1278,9 +1276,7 @@
(dotimes (s5-3 10)
(let ((a0-37 (-> obj info texture-anim s5-3)))
(if a0-37
(set! (-> obj texture-anim-array s5-3)
(texture-anim-array-method-10 (the-as texture-anim-array (-> a0-37 value)))
)
(set! (-> obj texture-anim-array s5-3) (clear! (the-as texture-anim-array (-> a0-37 value))))
)
)
)
@@ -74,3 +74,21 @@
)
)
)
(let ((s1 (new 'static 'array uint8 16
1 2 3 4 0 0 0 0 8 8 8 8 240 240 241 243 9 8 7 6))
(s2 (new 'static 'array uint8 16
7 8 3 4 1 2 3 4 9 8 7 6 240 240 241 243 9 8 1 2))
(s3 (new 'static 'array uint8 16)))
(let ((v1 (-> (the (pointer uint128) s1)))
(v2 (-> (the (pointer uint128) s2)))
(v3 (the uint128 0)))
(.paddb v3 v2 v1)
(set! (-> (the (pointer uint128) s3)) v3)
(dotimes (i 16)
(format #t "~X + ~X = ~X (~X)~%" (-> s1 i) (-> s2 i) (-> s3 i) (logand #xff (+ (-> s1 i) (-> s2 i))))
)
0
)
)
+14 -10
View File
@@ -648,16 +648,20 @@ TEST_F(WithGameTests, I128Simple) {
// TODO - add tests
TEST_F(WithGameTests, Pextlw) {
shared_compiler->runner.run_static_test(testCategory, "test-pextlw.gc",
{"#x07060504171615140302010013121110\n"
"#x0f0e0d0c1f1e1d1c0b0a09081b1a1918\n"
"#x07060504030201001716151413121110\n"
"#x1f1e1d1c1b1a19180f0e0d0c0b0a0908\n"
"#x0d0c0908050401001d1c191815141110\n"
"#x0e0c0a08060402001e1c1a1816141210\n"
"#xffffffff00000000ffffffff00000000\n"
"#x00090000000000fefffffffe000002ff\n"
"0\n"});
shared_compiler->runner.run_static_test(
testCategory, "test-pextlw.gc",
{"#x07060504171615140302010013121110\n"
"#x0f0e0d0c1f1e1d1c0b0a09081b1a1918\n"
"#x07060504030201001716151413121110\n"
"#x1f1e1d1c1b1a19180f0e0d0c0b0a0908\n"
"#x0d0c0908050401001d1c191815141110\n"
"#x0e0c0a08060402001e1c1a1816141210\n"
"#xffffffff00000000ffffffff00000000\n"
"#x00090000000000fefffffffe000002ff\n"
"1 + 7 = 8 (8)\n2 + 8 = a (a)\n3 + 3 = 6 (6)\n4 + 4 = 8 (8)\n0 + 1 = 1 (1)\n0 + 2 = 2 "
"(2)\n0 + 3 = 3 (3)\n0 + 4 = 4 (4)\n8 + 9 = 11 (11)\n8 + 8 = 10 (10)\n8 + 7 = f (f)\n8 + 6 "
"= e (e)\nf0 + f0 = e0 (e0)\nf0 + f0 = e0 (e0)\nf1 + f1 = e2 (e2)\nf3 + f3 = e6 (e6)\n"
"0\n"});
}
TEST_F(WithGameTests, Matrix) {
+15
View File
@@ -673,6 +673,21 @@ TEST(EmitterAVX, VPOR) {
"C5E1EBDBC4C161EBDDC591EBDBC4C111EBDDC561EBEBC44161EBEDC511EBEBC44111EBED");
}
TEST(EmitterAVX, VPADDB) {
CodeTester tester;
tester.init_code_buffer(1024);
tester.emit(IGen::parallel_add_byte(XMM0 + 3, XMM0 + 3, XMM0 + 3));
tester.emit(IGen::parallel_add_byte(XMM0 + 3, XMM0 + 3, XMM0 + 13));
tester.emit(IGen::parallel_add_byte(XMM0 + 3, XMM0 + 13, XMM0 + 3));
tester.emit(IGen::parallel_add_byte(XMM0 + 3, XMM0 + 13, XMM0 + 13));
tester.emit(IGen::parallel_add_byte(XMM0 + 13, XMM0 + 3, XMM0 + 3));
tester.emit(IGen::parallel_add_byte(XMM0 + 13, XMM0 + 3, XMM0 + 13));
tester.emit(IGen::parallel_add_byte(XMM0 + 13, XMM0 + 13, XMM0 + 3));
tester.emit(IGen::parallel_add_byte(XMM0 + 13, XMM0 + 13, XMM0 + 13));
EXPECT_EQ(tester.dump_to_hex_string(true),
"C5E1FCDBC4C161FCDDC591FCDBC4C111FCDDC561FCEBC44161FCEDC511FCEBC44111FCED");
}
TEST(EmitterAVX, VPXOR) {
CodeTester tester;
tester.init_code_buffer(1024);