mirror of
https://github.com/open-goal/jak-project
synced 2026-05-31 17:32:51 -04:00
3d2ca71fe3
* update stuff * gs reference added * update config
1172 lines
31 KiB
Common Lisp
1172 lines
31 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition of type gs-pmode
|
|
(deftype gs-pmode (uint64)
|
|
((en1 uint8 :offset 0 :size 1)
|
|
(en2 uint8 :offset 1 :size 1)
|
|
(crtmd uint8 :offset 2 :size 3)
|
|
(mmod uint8 :offset 5 :size 1)
|
|
(amod uint8 :offset 6 :size 1)
|
|
(slbg uint8 :offset 7 :size 1)
|
|
(alp uint8 :offset 8 :size 8)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-smode2
|
|
(deftype gs-smode2 (uint64)
|
|
((int uint8 :offset 0 :size 1)
|
|
(ffmd uint8 :offset 1 :size 1)
|
|
(dpms uint8 :offset 2 :size 2)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition for function psm-size
|
|
(defun psm-size ((arg0 gs-psm))
|
|
(cond
|
|
((= arg0 (gs-psm mt8))
|
|
64
|
|
)
|
|
((= arg0 (gs-psm mt4))
|
|
32
|
|
)
|
|
(else
|
|
(if
|
|
(or
|
|
(= arg0 (gs-psm ct16))
|
|
(= arg0 (gs-psm ct16s))
|
|
(= arg0 (gs-psm mz16))
|
|
(= arg0 (gs-psm mz16s))
|
|
)
|
|
128
|
|
256
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for function psm-page-height
|
|
(defun psm-page-height ((arg0 gs-psm))
|
|
(cond
|
|
((= arg0 (gs-psm mt8))
|
|
64
|
|
)
|
|
((= arg0 (gs-psm mt4))
|
|
128
|
|
)
|
|
(else
|
|
(if
|
|
(or
|
|
(= arg0 (gs-psm ct16))
|
|
(= arg0 (gs-psm ct16s))
|
|
(= arg0 (gs-psm mz16))
|
|
(= arg0 (gs-psm mz16s))
|
|
)
|
|
64
|
|
32
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for function psm->string
|
|
(defun psm->string ((arg0 gs-psm))
|
|
(let ((v1-0 arg0))
|
|
(cond
|
|
((= v1-0 (gs-psm mz16s))
|
|
"mz16s"
|
|
)
|
|
((= v1-0 (gs-psm mz16))
|
|
"mz16"
|
|
)
|
|
((= v1-0 (gs-psm mz24))
|
|
"mz24"
|
|
)
|
|
((= v1-0 (gs-psm mz32))
|
|
"mz32"
|
|
)
|
|
((= v1-0 (gs-psm mt4hh))
|
|
"mt4hh"
|
|
)
|
|
((= v1-0 (gs-psm mt4hl))
|
|
"mt4hl"
|
|
)
|
|
((= v1-0 (gs-psm mt8h))
|
|
"mt8h"
|
|
)
|
|
((= v1-0 (gs-psm mt4))
|
|
"mt4"
|
|
)
|
|
((= v1-0 (gs-psm mt8))
|
|
"mt8"
|
|
)
|
|
((= v1-0 (gs-psm ct16s))
|
|
"ct16s"
|
|
)
|
|
((= v1-0 (gs-psm ct16))
|
|
"ct16"
|
|
)
|
|
((= v1-0 (gs-psm ct24))
|
|
"ct24"
|
|
)
|
|
((zero? v1-0)
|
|
"ct32"
|
|
)
|
|
(else
|
|
"*unknown*"
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition of type gs-display-fb
|
|
(deftype gs-display-fb (uint64)
|
|
((fbp uint16 :offset 0 :size 9)
|
|
(fbw uint8 :offset 9 :size 6)
|
|
(psm gs-psm :offset 15 :size 5)
|
|
(dbx uint16 :offset 32 :size 11)
|
|
(dby uint16 :offset 43 :size 11)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-display
|
|
(deftype gs-display (uint64)
|
|
((dx uint16 :offset 0 :size 12)
|
|
(dy uint16 :offset 12 :size 11)
|
|
(magh uint8 :offset 23 :size 4)
|
|
(magv uint8 :offset 27 :size 2)
|
|
(dw uint16 :offset 32 :size 12)
|
|
(dh uint16 :offset 44 :size 11)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-bgcolor
|
|
(deftype gs-bgcolor (uint64)
|
|
((r uint8 :offset 0 :size 8)
|
|
(g uint8 :offset 8 :size 8)
|
|
(b uint8 :offset 16 :size 8)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-csr
|
|
(deftype gs-csr (uint64)
|
|
((signal uint8 :offset 0 :size 1)
|
|
(finish uint8 :offset 1 :size 1)
|
|
(hsint uint8 :offset 2 :size 1)
|
|
(vsint uint8 :offset 3 :size 1)
|
|
(edwint uint8 :offset 4 :size 1)
|
|
(flush uint8 :offset 8 :size 1)
|
|
(reset uint8 :offset 9 :size 1)
|
|
(nfield uint8 :offset 12 :size 1)
|
|
(field uint8 :offset 13 :size 1)
|
|
(fifo uint8 :offset 14 :size 2)
|
|
(rev uint8 :offset 16 :size 8)
|
|
(id uint8 :offset 24 :size 8)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-bank
|
|
(deftype gs-bank (structure)
|
|
((pmode gs-pmode :offset-assert 0)
|
|
(smode2 gs-smode2 :offset 32)
|
|
(dspfb1 gs-display-fb :offset 112)
|
|
(display1 gs-display :offset 128)
|
|
(dspfb2 gs-display-fb :offset 144)
|
|
(display2 gs-display :offset 160)
|
|
(extbuf uint64 :offset 176)
|
|
(extdata uint64 :offset 192)
|
|
(extwrite uint64 :offset 208)
|
|
(bgcolor gs-bgcolor :offset 224)
|
|
(csr gs-csr :offset 4096)
|
|
(imr uint64 :offset 4112)
|
|
(busdir uint64 :offset 4160)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x1048
|
|
:flag-assert #x900001048
|
|
)
|
|
|
|
;; definition for method 3 of type gs-bank
|
|
(defmethod inspect gs-bank ((obj gs-bank))
|
|
(format #t "[~8x] ~A~%" obj 'gs-bank)
|
|
(format #t "~Tpmode: #x~X~%" (-> obj pmode))
|
|
(format #t "~Tsmode2: #x~X~%" (-> obj smode2))
|
|
(format #t "~Tdspfb1: #x~X~%" (-> obj dspfb1))
|
|
(format #t "~Tdisplay1: #x~X~%" (-> obj display1))
|
|
(format #t "~Tdspfb2: #x~X~%" (-> obj dspfb2))
|
|
(format #t "~Tdisplay2: #x~X~%" (-> obj display2))
|
|
(format #t "~Textbuf: #x~X~%" (-> obj extbuf))
|
|
(format #t "~Textdata: #x~X~%" (-> obj extdata))
|
|
(format #t "~Textwrite: #x~X~%" (-> obj extwrite))
|
|
(format #t "~Tbgcolor: #x~X~%" (-> obj bgcolor))
|
|
(format #t "~Tcsr: #x~X~%" (-> obj csr))
|
|
(format #t "~Timr: #x~X~%" (-> obj imr))
|
|
(format #t "~Tbusdir: #x~X~%" (-> obj busdir))
|
|
obj
|
|
)
|
|
|
|
;; definition of type gs-frame
|
|
(deftype gs-frame (uint64)
|
|
((fbp uint16 :offset 0 :size 9)
|
|
(fbw uint8 :offset 16 :size 6)
|
|
(psm uint8 :offset 24 :size 6)
|
|
(fbmsk uint32 :offset 32 :size 32)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-zbuf
|
|
(deftype gs-zbuf (uint64)
|
|
((zbp uint16 :offset 0 :size 9)
|
|
(psm uint8 :offset 24 :size 4)
|
|
(zmsk uint8 :offset 32 :size 1)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-xy-offset
|
|
(deftype gs-xy-offset (uint64)
|
|
((ofx uint16 :offset 0 :size 16)
|
|
(ofy uint16 :offset 32 :size 16)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-scissor
|
|
(deftype gs-scissor (uint64)
|
|
((scax0 uint16 :offset 0 :size 11)
|
|
(scax1 uint16 :offset 16 :size 11)
|
|
(scay0 uint16 :offset 32 :size 11)
|
|
(scay1 uint16 :offset 48 :size 11)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-prmode-cont
|
|
(deftype gs-prmode-cont (uint64)
|
|
((ac uint8 :offset 0 :size 1)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-color-clamp
|
|
(deftype gs-color-clamp (uint64)
|
|
((clamp uint8 :offset 0 :size 1)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-dthe
|
|
(deftype gs-dthe (uint64)
|
|
((dthe uint8 :offset 0 :size 1)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-test
|
|
(deftype gs-test (uint64)
|
|
((ate uint8 :offset 0 :size 1)
|
|
(atst uint8 :offset 1 :size 3)
|
|
(aref uint8 :offset 4 :size 8)
|
|
(afail uint8 :offset 12 :size 2)
|
|
(date uint8 :offset 14 :size 1)
|
|
(datm uint8 :offset 15 :size 1)
|
|
(zte uint8 :offset 16 :size 1)
|
|
(ztst uint8 :offset 17 :size 2)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-prim
|
|
(deftype gs-prim (uint64)
|
|
((prim gs-prim-type :offset 0 :size 3)
|
|
(iip uint8 :offset 3 :size 1)
|
|
(tme uint8 :offset 4 :size 1)
|
|
(fge uint8 :offset 5 :size 1)
|
|
(abe uint8 :offset 6 :size 1)
|
|
(aa1 uint8 :offset 7 :size 1)
|
|
(fst uint8 :offset 8 :size 1)
|
|
(ctxt uint8 :offset 9 :size 1)
|
|
(fix uint8 :offset 10 :size 1)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-rgbaq
|
|
(deftype gs-rgbaq (uint64)
|
|
((r uint8 :offset 0 :size 8)
|
|
(g uint8 :offset 8 :size 8)
|
|
(b uint8 :offset 16 :size 8)
|
|
(a uint8 :offset 24 :size 8)
|
|
(q float :offset 32 :size 32)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-xyz
|
|
(deftype gs-xyz (uint64)
|
|
((x uint16 :offset 0 :size 16)
|
|
(y uint16 :offset 16 :size 16)
|
|
(z uint32 :offset 32 :size 32)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-uv
|
|
(deftype gs-uv (uint64)
|
|
((u uint16 :offset 0 :size 14)
|
|
(v uint16 :offset 16 :size 14)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-st
|
|
(deftype gs-st (uint64)
|
|
((s float :offset 0 :size 32)
|
|
(t float :offset 32 :size 32)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-xyzf
|
|
(deftype gs-xyzf (uint64)
|
|
((x uint16 :offset 0 :size 16)
|
|
(y uint16 :offset 16 :size 16)
|
|
(z uint32 :offset 32 :size 24)
|
|
(f uint8 :offset 56 :size 8)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-trxpos
|
|
(deftype gs-trxpos (uint64)
|
|
((ssax uint16 :offset 0 :size 11)
|
|
(ssay uint16 :offset 16 :size 11)
|
|
(dsax uint16 :offset 32 :size 11)
|
|
(dsay uint16 :offset 48 :size 11)
|
|
(dir uint8 :offset 59 :size 2)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-trxreg
|
|
(deftype gs-trxreg (uint64)
|
|
((rrw uint16 :offset 0 :size 12)
|
|
(rrh uint16 :offset 32 :size 12)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-trxdir
|
|
(deftype gs-trxdir (uint64)
|
|
((xdir uint8 :offset 0 :size 2)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-bitbltbuf
|
|
(deftype gs-bitbltbuf (uint64)
|
|
((sbp uint16 :offset 0 :size 14)
|
|
(sbw uint8 :offset 16 :size 6)
|
|
(spsm uint8 :offset 24 :size 6)
|
|
(dbp uint16 :offset 32 :size 14)
|
|
(dbw uint8 :offset 48 :size 6)
|
|
(dpsm uint8 :offset 56 :size 6)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-tex0
|
|
(deftype gs-tex0 (uint64)
|
|
((tbp0 uint16 :offset 0 :size 14)
|
|
(tbw uint8 :offset 14 :size 6)
|
|
(psm uint8 :offset 20 :size 6)
|
|
(tw uint8 :offset 26 :size 4)
|
|
(th uint8 :offset 30 :size 4)
|
|
(tcc uint8 :offset 34 :size 1)
|
|
(tfx uint8 :offset 35 :size 2)
|
|
(cbp uint16 :offset 37 :size 14)
|
|
(cpsm uint8 :offset 51 :size 4)
|
|
(csm uint8 :offset 55 :size 1)
|
|
(csa uint8 :offset 56 :size 5)
|
|
(cld uint8 :offset 61 :size 3)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-tex1
|
|
(deftype gs-tex1 (uint64)
|
|
((lcm uint8 :offset 0 :size 1)
|
|
(mxl uint8 :offset 2 :size 3)
|
|
(mmag uint8 :offset 5 :size 1)
|
|
(mmin uint8 :offset 6 :size 3)
|
|
(mtba uint8 :offset 9 :size 1)
|
|
(l uint8 :offset 19 :size 2)
|
|
(k int16 :offset 32 :size 12)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-texa
|
|
(deftype gs-texa (uint64)
|
|
((ta0 uint8 :offset 0 :size 8)
|
|
(aem uint8 :offset 15 :size 1)
|
|
(ta1 uint8 :offset 32 :size 8)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-texclut
|
|
(deftype gs-texclut (uint64)
|
|
((cbw uint8 :offset 0 :size 6)
|
|
(cou uint8 :offset 6 :size 6)
|
|
(cov uint16 :offset 12 :size 10)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-miptbp
|
|
(deftype gs-miptbp (uint64)
|
|
((tbp1 uint16 :offset 0 :size 14)
|
|
(tbw1 uint8 :offset 14 :size 6)
|
|
(tbp2 uint16 :offset 20 :size 14)
|
|
(tbw2 uint8 :offset 34 :size 6)
|
|
(tbp3 uint16 :offset 40 :size 14)
|
|
(tbw3 uint8 :offset 54 :size 6)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-alpha
|
|
(deftype gs-alpha (uint64)
|
|
((a uint8 :offset 0 :size 2)
|
|
(b uint8 :offset 2 :size 2)
|
|
(c uint8 :offset 4 :size 2)
|
|
(d uint8 :offset 6 :size 2)
|
|
(fix uint8 :offset 32 :size 8)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition for method 3 of type gs-alpha
|
|
(defmethod inspect gs-alpha ((obj gs-alpha))
|
|
(format #t "[~8x] ~A~%" obj 'gs-alpha)
|
|
(format #t "~Ta: ~D~%" (-> obj a))
|
|
(format #t "~Tb: ~D~%" (-> obj b))
|
|
(format #t "~Tc: ~D~%" (-> obj c))
|
|
(format #t "~Td: ~D~%" (-> obj d))
|
|
(format #t "~Tfix: ~D~%" (-> obj fix))
|
|
obj
|
|
)
|
|
|
|
;; definition of type gs-clamp
|
|
(deftype gs-clamp (uint64)
|
|
((wms uint8 :offset 0 :size 2)
|
|
(wmt uint8 :offset 2 :size 2)
|
|
(minu uint16 :offset 4 :size 10)
|
|
(maxu uint16 :offset 14 :size 10)
|
|
(minv uint16 :offset 24 :size 10)
|
|
(maxv uint16 :offset 34 :size 10)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gs-fog
|
|
(deftype gs-fog (uint64)
|
|
((f uint8 :offset 56 :size 8)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition for method 3 of type gs-fog
|
|
(defmethod inspect gs-fog ((obj gs-fog))
|
|
(format #t "[~8x] ~A~%" obj 'gs-fog)
|
|
(format #t "~Tf: ~D~%" (-> obj f))
|
|
obj
|
|
)
|
|
|
|
;; definition of type gs-fogcol
|
|
(deftype gs-fogcol (uint64)
|
|
((fcr uint8 :offset 0 :size 8)
|
|
(fcg uint8 :offset 8 :size 8)
|
|
(fcb uint8 :offset 16 :size 8)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition for method 3 of type gs-fogcol
|
|
(defmethod inspect gs-fogcol ((obj gs-fogcol))
|
|
(format #t "[~8x] ~A~%" obj 'gs-fogcol)
|
|
(format #t "~Tr: ~D~%" (-> obj fcr))
|
|
(format #t "~Tg: ~D~%" (-> obj fcg))
|
|
(format #t "~Tb: ~D~%" (-> obj fcb))
|
|
obj
|
|
)
|
|
|
|
;; definition of type gif-ctrl
|
|
(deftype gif-ctrl (uint32)
|
|
((rst uint8 :offset 0 :size 1)
|
|
(pse uint8 :offset 3 :size 1)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x4
|
|
:flag-assert #x900000004
|
|
)
|
|
|
|
;; definition of type gif-mode
|
|
(deftype gif-mode (uint32)
|
|
((m3r uint8 :offset 0 :size 1)
|
|
(imt uint8 :offset 2 :size 1)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x4
|
|
:flag-assert #x900000004
|
|
)
|
|
|
|
;; definition of type gif-stat
|
|
(deftype gif-stat (uint32)
|
|
((m3r uint8 :offset 0 :size 1)
|
|
(m3p uint8 :offset 1 :size 1)
|
|
(imt uint8 :offset 2 :size 1)
|
|
(pse uint8 :offset 3 :size 1)
|
|
(ip3 uint8 :offset 5 :size 1)
|
|
(p3q uint8 :offset 6 :size 1)
|
|
(p2q uint8 :offset 7 :size 1)
|
|
(p1q uint8 :offset 8 :size 1)
|
|
(oph uint8 :offset 9 :size 1)
|
|
(apath uint8 :offset 10 :size 2)
|
|
(dir uint8 :offset 12 :size 1)
|
|
(fqc uint8 :offset 24 :size 5)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x4
|
|
:flag-assert #x900000004
|
|
)
|
|
|
|
;; definition of type gif-cnt
|
|
(deftype gif-cnt (uint32)
|
|
((loopcnt uint16 :offset 0 :size 15)
|
|
(regcnt uint8 :offset 16 :size 4)
|
|
(vuaddr uint16 :offset 20 :size 10)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x4
|
|
:flag-assert #x900000004
|
|
)
|
|
|
|
;; definition of type gif-p3cnt
|
|
(deftype gif-p3cnt (uint32)
|
|
((p3cnt uint16 :offset 0 :size 15)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x4
|
|
:flag-assert #x900000004
|
|
)
|
|
|
|
;; definition of type gif-p3tag
|
|
(deftype gif-p3tag (uint32)
|
|
((loopcnt uint16 :offset 0 :size 15)
|
|
(eop uint8 :offset 15 :size 1)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x4
|
|
:flag-assert #x900000004
|
|
)
|
|
|
|
;; definition of type gif-bank
|
|
(deftype gif-bank (structure)
|
|
((ctrl gif-ctrl :offset 0)
|
|
(mode gif-mode :offset 16)
|
|
(stat gif-stat :offset 32)
|
|
(tag0 uint32 :offset 64)
|
|
(tag1 uint32 :offset 80)
|
|
(tag2 uint32 :offset 96)
|
|
(tag3 uint32 :offset 112)
|
|
(cnt gif-cnt :offset 128)
|
|
(p3cnt gif-p3cnt :offset 144)
|
|
(p3tag gif-p3tag :offset 160)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #xa4
|
|
:flag-assert #x9000000a4
|
|
)
|
|
|
|
;; definition for method 3 of type gif-bank
|
|
(defmethod inspect gif-bank ((obj gif-bank))
|
|
(format #t "[~8x] ~A~%" obj 'gif-bank)
|
|
(format #t "~Tctrl: #x~X~%" (-> obj ctrl))
|
|
(format #t "~Tmode: #x~X~%" (-> obj mode))
|
|
(format #t "~Tstat: #x~X~%" (-> obj stat))
|
|
(format #t "~Ttag0: #x~X~%" (-> obj tag0))
|
|
(format #t "~Ttag1: #x~X~%" (-> obj tag1))
|
|
(format #t "~Ttag2: #x~X~%" (-> obj tag2))
|
|
(format #t "~Ttag3: #x~X~%" (-> obj tag3))
|
|
(format #t "~Tcnt: #x~X~%" (-> obj cnt))
|
|
(format #t "~Tp3cnt: #x~X~%" (-> obj p3cnt))
|
|
(format #t "~Tp3tag: #x~X~%" (-> obj p3tag))
|
|
obj
|
|
)
|
|
|
|
;; definition of type gif-tag-prim
|
|
(deftype gif-tag-prim (uint32)
|
|
()
|
|
:method-count-assert 9
|
|
:size-assert #x4
|
|
:flag-assert #x900000004
|
|
)
|
|
|
|
;; definition of type gif-tag-count
|
|
(deftype gif-tag-count (uint32)
|
|
()
|
|
:method-count-assert 9
|
|
:size-assert #x4
|
|
:flag-assert #x900000004
|
|
)
|
|
|
|
;; definition of type gif-tag64
|
|
(deftype gif-tag64 (uint64)
|
|
((nloop uint16 :offset 0 :size 15)
|
|
(eop uint8 :offset 15 :size 1)
|
|
(id uint16 :offset 32 :size 14)
|
|
(pre uint8 :offset 46 :size 1)
|
|
(prim uint16 :offset 47 :size 11)
|
|
(flg uint8 :offset 58 :size 2)
|
|
(nreg uint8 :offset 60 :size 4)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8
|
|
:flag-assert #x900000008
|
|
)
|
|
|
|
;; definition of type gif-tag
|
|
(deftype gif-tag (uint128)
|
|
((nloop uint16 :offset 0 :size 15)
|
|
(eop uint8 :offset 15 :size 1)
|
|
(id uint16 :offset 32 :size 14)
|
|
(pre uint8 :offset 46 :size 1)
|
|
(prim uint16 :offset 47 :size 11)
|
|
(flg uint8 :offset 58 :size 2)
|
|
(nreg uint8 :offset 60 :size 4)
|
|
(regs0 uint8 :offset 64 :size 4)
|
|
(regs1 uint8 :offset 68 :size 4)
|
|
(regs2 uint8 :offset 72 :size 4)
|
|
(regs3 uint8 :offset 76 :size 4)
|
|
(regs4 uint8 :offset 80 :size 4)
|
|
(regs5 uint8 :offset 84 :size 4)
|
|
(regs6 uint8 :offset 88 :size 4)
|
|
(regs7 uint8 :offset 92 :size 4)
|
|
(regs8 uint8 :offset 96 :size 4)
|
|
(regs9 uint8 :offset 100 :size 4)
|
|
(regs10 uint8 :offset 104 :size 4)
|
|
(regs11 uint8 :offset 108 :size 4)
|
|
(regs12 uint8 :offset 112 :size 4)
|
|
(regs13 uint8 :offset 116 :size 4)
|
|
(regs14 uint8 :offset 120 :size 4)
|
|
(regs15 uint8 :offset 124 :size 4)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x10
|
|
:flag-assert #x900000010
|
|
)
|
|
|
|
;; definition of type gs-gif-tag
|
|
(deftype gs-gif-tag (structure)
|
|
((qword uint128 :offset-assert 0)
|
|
(tag gif-tag64 :offset 0)
|
|
(regs gif-tag-regs :offset 8)
|
|
(dword uint64 2 :offset 0)
|
|
(word uint32 4 :offset 0)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x10
|
|
:flag-assert #x900000010
|
|
)
|
|
|
|
;; definition for method 3 of type gs-gif-tag
|
|
(defmethod inspect gs-gif-tag ((obj gs-gif-tag))
|
|
(format #t "[~8x] ~A~%" obj 'gs-gif-tag)
|
|
(format #t "~Tqword: #<qword @ #x~X>~%" (&-> obj qword))
|
|
(format #t "~Tdword[2] @ #x~X~%" (&-> obj qword))
|
|
(format #t "~Tword[4] @ #x~X~%" (&-> obj qword))
|
|
(format #t "~Ttag: ~D~%" (-> obj tag))
|
|
(format #t "~Tregs: ~D~%" (-> obj regs))
|
|
obj
|
|
)
|
|
|
|
;; definition for method 3 of type gif-tag
|
|
;; INFO: Return type mismatch object vs gif-tag.
|
|
;; WARN: Unsupported inline assembly instruction kind - [por gp, a0, r0]
|
|
;; WARN: Unsupported inline assembly instruction kind - [por a2, gp, r0]
|
|
;; WARN: Unsupported inline assembly instruction kind - [srl a2, v1, 28]
|
|
(defmethod inspect gif-tag ((obj gif-tag))
|
|
(local-vars
|
|
(r0-0 none)
|
|
(v1-6 uint128)
|
|
(v1-8 uint128)
|
|
(v1-10 uint128)
|
|
(v1-12 uint128)
|
|
(v1-14 uint128)
|
|
(v1-16 uint128)
|
|
(v1-18 uint128)
|
|
(v1-20 uint128)
|
|
(v1-21 uint128)
|
|
(v1-23 uint128)
|
|
(v1-25 uint128)
|
|
(v1-27 uint128)
|
|
(v1-29 uint128)
|
|
(v1-31 uint128)
|
|
(v1-33 uint128)
|
|
(v1-35 uint128)
|
|
(a2-0 uint128)
|
|
(a2-15 uint128)
|
|
(gp-0 uint128)
|
|
)
|
|
(.por gp-0 obj r0-0)
|
|
(let ((t9-0 format)
|
|
(a0-1 #t)
|
|
(a1-0 "[~8x] gif-tag~%")
|
|
)
|
|
(.por a2-0 gp-0 r0-0)
|
|
(t9-0 a0-1 a1-0 a2-0)
|
|
)
|
|
(format #t "~Tnloop: ~4d~%" (shr (shl (the-as int gp-0) 49) 49))
|
|
(format #t "~Teop : ~4d~%" (shr (shl (the-as int gp-0) 48) 63))
|
|
(format #t "~Tid : ~4d~%" (shr (shl (the-as int gp-0) 18) 50))
|
|
(format #t "~Tpre : ~4d~%" (shr (shl (the-as int gp-0) 17) 63))
|
|
(format #t "~Tprim : ~4d~%" (shr (shl (the-as int gp-0) 6) 53))
|
|
(format #t "~Tflg : ~4d~%" (shr (shl (the-as int gp-0) 4) 62))
|
|
(format #t "~Tnreg : ~4d~%" (shr (the-as int gp-0) 60))
|
|
(let ((t9-8 format)
|
|
(a0-9 #t)
|
|
(a1-8 "~Tregs0 : ~4d~%")
|
|
)
|
|
(.pcpyud v1-6 gp-0 r0-0)
|
|
(t9-8 a0-9 a1-8 (shr (shl (the-as int v1-6) 60) 60))
|
|
)
|
|
(let ((t9-9 format)
|
|
(a0-10 #t)
|
|
(a1-9 "~Tregs1 : ~4d~%")
|
|
)
|
|
(.pcpyud v1-8 gp-0 r0-0)
|
|
(t9-9 a0-10 a1-9 (shr (shl (the-as int v1-8) 56) 60))
|
|
)
|
|
(let ((t9-10 format)
|
|
(a0-11 #t)
|
|
(a1-10 "~Tregs2 : ~4d~%")
|
|
)
|
|
(.pcpyud v1-10 gp-0 r0-0)
|
|
(t9-10 a0-11 a1-10 (shr (shl (the-as int v1-10) 52) 60))
|
|
)
|
|
(let ((t9-11 format)
|
|
(a0-12 #t)
|
|
(a1-11 "~Tregs3 : ~4d~%")
|
|
)
|
|
(.pcpyud v1-12 gp-0 r0-0)
|
|
(t9-11 a0-12 a1-11 (shr (shl (the-as int v1-12) 48) 60))
|
|
)
|
|
(let ((t9-12 format)
|
|
(a0-13 #t)
|
|
(a1-12 "~Tregs4 : ~4d~%")
|
|
)
|
|
(.pcpyud v1-14 gp-0 r0-0)
|
|
(t9-12 a0-13 a1-12 (shr (shl (the-as int v1-14) 44) 60))
|
|
)
|
|
(let ((t9-13 format)
|
|
(a0-14 #t)
|
|
(a1-13 "~Tregs5 : ~4d~%")
|
|
)
|
|
(.pcpyud v1-16 gp-0 r0-0)
|
|
(t9-13 a0-14 a1-13 (shr (shl (the-as int v1-16) 40) 60))
|
|
)
|
|
(let ((t9-14 format)
|
|
(a0-15 #t)
|
|
(a1-14 "~Tregs6 : ~4d~%")
|
|
)
|
|
(.pcpyud v1-18 gp-0 r0-0)
|
|
(t9-14 a0-15 a1-14 (shr (shl (the-as int v1-18) 36) 60))
|
|
)
|
|
(let ((t9-15 format)
|
|
(a0-16 #t)
|
|
(a1-15 "~Tregs7 : ~4d~%")
|
|
)
|
|
(.pcpyud v1-20 gp-0 r0-0)
|
|
(.srl a2-15 v1-20 28)
|
|
(t9-15 a0-16 a1-15 a2-15)
|
|
)
|
|
(let ((t9-16 format)
|
|
(a0-17 #t)
|
|
(a1-16 "~Tregs8 : ~4d~%")
|
|
)
|
|
(.pcpyud v1-21 gp-0 r0-0)
|
|
(t9-16 a0-17 a1-16 (shr (shl (the-as int v1-21) 28) 60))
|
|
)
|
|
(let ((t9-17 format)
|
|
(a0-18 #t)
|
|
(a1-17 "~Tregs9 : ~4d~%")
|
|
)
|
|
(.pcpyud v1-23 gp-0 r0-0)
|
|
(t9-17 a0-18 a1-17 (shr (shl (the-as int v1-23) 24) 60))
|
|
)
|
|
(let ((t9-18 format)
|
|
(a0-19 #t)
|
|
(a1-18 "~Tregs10: ~4d~%")
|
|
)
|
|
(.pcpyud v1-25 gp-0 r0-0)
|
|
(t9-18 a0-19 a1-18 (shr (shl (the-as int v1-25) 20) 60))
|
|
)
|
|
(let ((t9-19 format)
|
|
(a0-20 #t)
|
|
(a1-19 "~Tregs11: ~4d~%")
|
|
)
|
|
(.pcpyud v1-27 gp-0 r0-0)
|
|
(t9-19 a0-20 a1-19 (shr (shl (the-as int v1-27) 16) 60))
|
|
)
|
|
(let ((t9-20 format)
|
|
(a0-21 #t)
|
|
(a1-20 "~Tregs12: ~4d~%")
|
|
)
|
|
(.pcpyud v1-29 gp-0 r0-0)
|
|
(t9-20 a0-21 a1-20 (shr (shl (the-as int v1-29) 12) 60))
|
|
)
|
|
(let ((t9-21 format)
|
|
(a0-22 #t)
|
|
(a1-21 "~Tregs13: ~4d~%")
|
|
)
|
|
(.pcpyud v1-31 gp-0 r0-0)
|
|
(t9-21 a0-22 a1-21 (shr (shl (the-as int v1-31) 8) 60))
|
|
)
|
|
(let ((t9-22 format)
|
|
(a0-23 #t)
|
|
(a1-22 "~Tregs14: ~4d~%")
|
|
)
|
|
(.pcpyud v1-33 gp-0 r0-0)
|
|
(t9-22 a0-23 a1-22 (shr (shl (the-as int v1-33) 4) 60))
|
|
)
|
|
(let ((t9-23 format)
|
|
(a0-24 #t)
|
|
(a1-23 "~Tregs15: ~4d~%")
|
|
)
|
|
(.pcpyud v1-35 gp-0 r0-0)
|
|
(the-as gif-tag (t9-23 a0-24 a1-23 (shr (the-as int v1-35) 60)))
|
|
)
|
|
)
|
|
|
|
;; definition for symbol *fog-color*, type int
|
|
(define *fog-color* #xc88029)
|
|
|
|
;; definition for symbol *default-regs-buffer*, type dma-buffer
|
|
(define *default-regs-buffer* (new 'global 'dma-buffer 1024))
|
|
|
|
;; definition for function default-buffer-init
|
|
;; INFO: Return type mismatch pointer vs none.
|
|
(defun default-buffer-init ((buff dma-buffer))
|
|
(let ((buff-ptr buff))
|
|
(set! (-> buff-ptr base) (-> buff-ptr data))
|
|
(set!
|
|
(-> buff-ptr end)
|
|
(&-> buff-ptr data-buffer (-> buff-ptr allocated-length))
|
|
)
|
|
)
|
|
(let* ((buff-ptr2 buff)
|
|
(packet (the-as dma-gif-packet (-> buff-ptr2 base)))
|
|
)
|
|
(set!
|
|
(-> packet dma-vif dma)
|
|
(new 'static 'dma-tag :qwc #xa :id (dma-tag-id cnt))
|
|
)
|
|
(set!
|
|
(-> packet dma-vif vif0)
|
|
(new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1)
|
|
)
|
|
(set!
|
|
(-> packet dma-vif vif1)
|
|
(new 'static 'vif-tag :imm #xa :cmd (vif-cmd direct) :msk #x1)
|
|
)
|
|
(set! (-> buff-ptr2 base) (&+ (the-as pointer packet) 16))
|
|
)
|
|
(let* ((buff-ptr5 buff)
|
|
(gif-tag (the-as gs-gif-tag (-> buff-ptr5 base)))
|
|
)
|
|
(set!
|
|
(-> gif-tag tag)
|
|
(the-as gif-tag64 (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x9))
|
|
)
|
|
(set!
|
|
(-> gif-tag regs)
|
|
(new 'static 'gif-tag-regs
|
|
:regs0 (gs-reg-id a+d)
|
|
:regs1 (gs-reg-id a+d)
|
|
:regs2 (gs-reg-id a+d)
|
|
:regs3 (gs-reg-id a+d)
|
|
:regs4 (gs-reg-id a+d)
|
|
:regs5 (gs-reg-id a+d)
|
|
:regs6 (gs-reg-id a+d)
|
|
:regs7 (gs-reg-id a+d)
|
|
:regs8 (gs-reg-id a+d)
|
|
:regs9 (gs-reg-id a+d)
|
|
:regs10 (gs-reg-id a+d)
|
|
:regs11 (gs-reg-id a+d)
|
|
:regs12 (gs-reg-id a+d)
|
|
:regs13 (gs-reg-id a+d)
|
|
:regs14 (gs-reg-id a+d)
|
|
:regs15 (gs-reg-id a+d)
|
|
)
|
|
)
|
|
(set! (-> buff-ptr5 base) (&+ (the-as pointer gif-tag) 16))
|
|
)
|
|
(let* ((buff-ptr3 buff)
|
|
(data (the-as (pointer uint64) (-> buff-ptr3 base)))
|
|
)
|
|
(set! (-> data 0) (the-as uint 68))
|
|
(set! (-> data 1) (the-as uint 66))
|
|
(set! (-> data 2) (the-as uint #x10001c0))
|
|
(set! (-> data 3) (the-as uint 78))
|
|
(set! (-> data 4) (the-as uint #x5000e))
|
|
(set! (-> data 5) (the-as uint 71))
|
|
(set! (-> data 6) (the-as uint 0))
|
|
(set! (-> data 7) (the-as uint 73))
|
|
(set! (-> data 8) (the-as uint 5))
|
|
(set! (-> data 9) (the-as uint 8))
|
|
(set! (-> data 10) (the-as uint 96))
|
|
(set! (-> data 11) (the-as uint 20))
|
|
(set! (-> data 12) (the-as uint (shl 128 32)))
|
|
(set! (-> data 13) (the-as uint 59))
|
|
(set! (-> data 14) (the-as uint 4))
|
|
(set! (-> data 15) (the-as uint 28))
|
|
(set! (-> data 16) (the-as uint *fog-color*))
|
|
(set! (-> data 17) (the-as uint 61))
|
|
(set! (-> buff-ptr3 base) (&+ (the-as pointer data) 144))
|
|
)
|
|
(let* ((buff-ptr4 buff)
|
|
(ret-packet (the-as dma-packet (-> buff-ptr4 base)))
|
|
)
|
|
(set! (-> ret-packet dma) (new 'static 'dma-tag :id (dma-tag-id ret)))
|
|
(set! (-> ret-packet vif0) (new 'static 'vif-tag))
|
|
(set! (-> ret-packet vif1) (new 'static 'vif-tag))
|
|
(set! (-> buff-ptr4 base) (&+ (the-as pointer ret-packet) 16))
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(default-buffer-init *default-regs-buffer*)
|
|
|
|
;; definition of type gif-packet
|
|
(deftype gif-packet (basic)
|
|
((reg-count int32 :offset-assert 4)
|
|
(gif-tag gs-gif-tag :inline :offset-assert 16)
|
|
(gif-tag0 uint128 :offset 16)
|
|
(args uint64 1 :offset-assert 32)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x28
|
|
:flag-assert #x900000028
|
|
(:methods
|
|
(new (symbol type int) _type_ 0)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type gif-packet
|
|
;; Used lq/sq
|
|
(defmethod inspect gif-packet ((obj gif-packet))
|
|
(format #t "[~8x] ~A~%" obj (-> obj type))
|
|
(format #t "~Treg-count: ~D~%" (-> obj reg-count))
|
|
(format #t "~Tgif-tag0: #x~X~%" (-> obj gif-tag qword))
|
|
(format #t "~Targs[1] @ #x~X~%" (-> obj args))
|
|
obj
|
|
)
|
|
|
|
;; definition for method 0 of type gif-packet
|
|
(defmethod new gif-packet ((allocation symbol) (type-to-make type) (arg0 int))
|
|
(object-new
|
|
allocation
|
|
type-to-make
|
|
(the-as int (+ (-> type-to-make size) (the-as uint (shl (+ arg0 -1) 3))))
|
|
)
|
|
)
|
|
|
|
;; definition for function open-gif-packet
|
|
(defun open-gif-packet ((arg0 gif-packet))
|
|
(set! (-> arg0 reg-count) 0)
|
|
(set! (-> arg0 gif-tag regs) (new 'static 'gif-tag-regs))
|
|
arg0
|
|
)
|
|
|
|
;; definition for function add-reg-gif-packet
|
|
;; INFO: Return type mismatch gif-packet vs none.
|
|
(defun add-reg-gif-packet ((packet gif-packet) (reg-idx int) (reg-val int))
|
|
(let ((tag (-> packet gif-tag)))
|
|
(set!
|
|
(-> tag regs)
|
|
(logior
|
|
(-> tag regs)
|
|
(the-as uint (ash reg-idx (shl (-> packet reg-count) 2)))
|
|
)
|
|
)
|
|
)
|
|
(set! (-> (&-> packet args (-> packet reg-count)) 0) (the-as uint reg-val))
|
|
(set! (-> packet reg-count) (+ (-> packet reg-count) 1))
|
|
(none)
|
|
)
|
|
|
|
;; definition for function close-gif-packet
|
|
(defun close-gif-packet ((arg0 gif-packet) (arg1 int))
|
|
(set!
|
|
(-> arg0 gif-tag tag)
|
|
(new 'static 'gif-tag64
|
|
:nloop #x1
|
|
:flg #x1
|
|
:eop arg1
|
|
:nreg (-> arg0 reg-count)
|
|
)
|
|
)
|
|
arg0
|
|
)
|
|
|
|
;; definition of type draw-context
|
|
(deftype draw-context (basic)
|
|
((orgx int32 :offset-assert 4)
|
|
(orgy int32 :offset-assert 8)
|
|
(orgz int32 :offset-assert 12)
|
|
(width int32 :offset-assert 16)
|
|
(height int32 :offset-assert 20)
|
|
(color rgba 4 :offset-assert 24)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x28
|
|
:flag-assert #x900000028
|
|
(:methods
|
|
(new (symbol type int int int int rgba) _type_ 0)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type draw-context
|
|
(defmethod inspect draw-context ((obj draw-context))
|
|
(format #t "[~8x] ~A~%" obj (-> obj type))
|
|
(format #t "~Torgx: ~D~%" (-> obj orgx))
|
|
(format #t "~Torgy: ~D~%" (-> obj orgy))
|
|
(format #t "~Torgz: ~D~%" (-> obj orgz))
|
|
(format #t "~Twidth: ~D~%" (-> obj width))
|
|
(format #t "~Theight: ~D~%" (-> obj height))
|
|
(format #t "~Tcolor[4] @ #x~X~%" (-> obj color))
|
|
obj
|
|
)
|
|
|
|
;; definition for method 0 of type draw-context
|
|
(defmethod
|
|
new
|
|
draw-context
|
|
((allocation symbol)
|
|
(type-to-make type)
|
|
(org-x int)
|
|
(org-y int)
|
|
(width int)
|
|
(height int)
|
|
(color-0 rgba)
|
|
)
|
|
(let
|
|
((obj
|
|
(object-new allocation type-to-make (the-as int (-> type-to-make size)))
|
|
)
|
|
)
|
|
(let
|
|
((v1-3 (the int (* (the float org-y) (-> *video-parms* relative-y-scale))))
|
|
(a0-2 (the int (* (the float height) (-> *video-parms* relative-y-scale))))
|
|
)
|
|
(set! (-> obj orgx) org-x)
|
|
(set! (-> obj orgy) v1-3)
|
|
(set! (-> obj orgz) #xffffff)
|
|
(set! (-> obj width) width)
|
|
(set! (-> obj height) a0-2)
|
|
)
|
|
(set! (-> obj color 0) color-0)
|
|
obj
|
|
)
|
|
)
|
|
|
|
;; definition for function draw-context-set-xy
|
|
;; INFO: Return type mismatch int vs none.
|
|
(defun draw-context-set-xy ((ctxt draw-context) (x int) (y int))
|
|
(let* ((y (gpr->fpr y))
|
|
(v0-0 (the int (* (the float y) (-> *video-parms* relative-y-scale))))
|
|
)
|
|
(set! (-> ctxt orgx) x)
|
|
(set! (-> ctxt orgy) v0-0)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
|