prepare for decompiling display (#359)

* prepare for decompiling display

Needs some work on the decompiler (mostly bitfield stuff) before a more proper decomp can be done

* make `(profile-bar draw)`, `set-display-gs-state-offset` and `set-display-env` decompile

decompiler should now support unsigned divide

* fill in some dma-h types

* Fill in a few VIF bitfields + other minor fixes

* Update all-types.gc

* Fix stupid mistake in `vif-mask`

* update dma-h reference

* this uint32 is actually a `vif-tag` (oops)
This commit is contained in:
ManDude
2021-04-16 23:36:19 +01:00
committed by GitHub
parent 8b62de35ea
commit 9fbbe1a79c
16 changed files with 435 additions and 290 deletions
@@ -121,6 +121,9 @@
(defmacro .sync.l ()
`(none))
;; timer-h
(declare-type dma-buffer basic)
;; display-h
(deftype display-env (structure)
((pmode uint64 :offset-assert 0)
+37 -7
View File
@@ -112,7 +112,13 @@
;; definition of type dma-ctrl
(deftype dma-ctrl (uint32)
()
((dmae uint8 :offset 0 :size 1)
(rele uint8 :offset 1 :size 1)
(mfd uint8 :offset 2 :size 2)
(sts uint8 :offset 4 :size 2)
(std uint8 :offset 6 :size 2)
(rcyc uint8 :offset 8 :size 3)
)
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
@@ -120,7 +126,8 @@
;; definition of type dma-enable
(deftype dma-enable (uint32)
()
((cpnd uint8 :offset 16 :size 1)
)
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
@@ -128,7 +135,9 @@
;; definition of type dma-sqwc
(deftype dma-sqwc (uint32)
()
((sqwc uint8 :offset 0 :size 8)
(tqwc uint8 :offset 16 :size 8)
)
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
@@ -246,7 +255,23 @@
;; definition of type vif-mask
(deftype vif-mask (uint32)
()
((m0 uint8 :offset 0 :size 2)
(m1 uint8 :offset 2 :size 2)
(m2 uint8 :offset 4 :size 2)
(m3 uint8 :offset 6 :size 2)
(m4 uint8 :offset 8 :size 2)
(m5 uint8 :offset 10 :size 2)
(m6 uint8 :offset 12 :size 2)
(m7 uint8 :offset 14 :size 2)
(m8 uint8 :offset 16 :size 2)
(m9 uint8 :offset 18 :size 2)
(m10 uint8 :offset 20 :size 2)
(m11 uint8 :offset 22 :size 2)
(m12 uint8 :offset 24 :size 2)
(m13 uint8 :offset 26 :size 2)
(m14 uint8 :offset 28 :size 2)
(m15 uint8 :offset 30 :size 2)
)
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
@@ -254,7 +279,9 @@
;; definition of type vif-stcycl-imm
(deftype vif-stcycl-imm (uint16)
()
((cl uint8 :offset 0 :size 8)
(wl uint8 :offset 8 :size 8)
)
:method-count-assert 9
:size-assert #x2
:flag-assert #x900000002
@@ -262,7 +289,10 @@
;; definition of type vif-unpack-imm
(deftype vif-unpack-imm (uint16)
()
((addr uint16 :offset 0 :size 10)
(usn uint8 :offset 14 :size 1)
(flg uint8 :offset 15 :size 1)
)
:method-count-assert 9
:size-assert #x2
:flag-assert #x900000002
@@ -273,8 +303,8 @@
((imm uint16 :offset 0 :size 16)
(num uint8 :offset 16 :size 8)
(cmd uint8 :offset 24 :size 7)
(msk uint8 :offset 28 :size 1)
(irq uint8 :offset 31 :size 1)
(msk uint8 :offset 28 :size 1)
)
:method-count-assert 9
:size-assert #x4
+12 -15
View File
@@ -21,7 +21,7 @@
;; definition of type timer-bank
(deftype timer-bank (structure)
((count uint32 :offset-assert 0)
((count uint32 :offset 0)
(mode timer-mode :offset 16)
(comp uint32 :offset 32)
)
@@ -93,12 +93,9 @@
;; definition of type profile-frame
(deftype profile-frame (structure)
((name basic :offset-assert 0)
(time-stamp uint32 :offset-assert 4)
(color uint32 :offset-assert 8)
(r uint8 :offset 8)
(g uint8 :offset 9)
(b uint8 :offset 10)
((name basic :offset-assert 0)
(time-stamp uint32 :offset-assert 4)
(color rgba :offset-assert 8)
)
:method-count-assert 9
:size-assert #xc
@@ -124,9 +121,9 @@
(format
#t
"~Tcolor: ~D ~D ~D~%"
(shr (shl (-> obj color) 56) 56)
(shr (shl (-> obj color) 48) 56)
(shr (shl (-> obj color) 40) 56)
(-> (-> obj color) r)
(-> (-> obj color) g)
(-> (-> obj color) b)
)
obj
)
@@ -141,11 +138,11 @@
:size-assert #x4010
:flag-assert #xe00004010
(:methods
(get-last-frame-time-stamp (profile-bar) uint 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(get-last-frame-time-stamp (_type_) uint 9)
(reset (_type_) _type_ 10)
(add-frame (_type_ symbol rgba) profile-frame 11)
(add-end-frame (_type_ symbol rgba) profile-frame 12)
(draw (_type_ dma-buffer int) float 13)
)
)