mirror of
https://github.com/open-goal/jak-project
synced 2026-06-22 17:13:01 -04:00
fc43870d85
This renames the method object in `defmethod`s to `this` and adds detection for the `set-time!` and `time-elapsed?` macros. Definitely my biggest PR yet...
174 lines
5.2 KiB
Common Lisp
Vendored
Generated
174 lines
5.2 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition of type tr-stat
|
|
(deftype tr-stat (structure)
|
|
((groups uint16 :offset-assert 0)
|
|
(fragments uint16 :offset-assert 2)
|
|
(tris uint32 :offset-assert 4)
|
|
(dverts uint32 :offset-assert 8)
|
|
(instances uint16 :offset-assert 12)
|
|
(pad uint16 :offset-assert 14)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x10
|
|
:flag-assert #x900000010
|
|
)
|
|
|
|
;; definition for method 3 of type tr-stat
|
|
(defmethod inspect tr-stat ((this tr-stat))
|
|
(format #t "[~8x] ~A~%" this 'tr-stat)
|
|
(format #t "~Tgroups: ~D~%" (-> this groups))
|
|
(format #t "~Tfragments: ~D~%" (-> this fragments))
|
|
(format #t "~Ttris: ~D~%" (-> this tris))
|
|
(format #t "~Tdverts: ~D~%" (-> this dverts))
|
|
(format #t "~Tinstances: ~D~%" (-> this instances))
|
|
(format #t "~Tpad: ~D~%" (-> this pad))
|
|
this
|
|
)
|
|
|
|
;; definition of type merc-global-stats
|
|
(deftype merc-global-stats (structure)
|
|
((merc tr-stat :inline :offset-assert 0)
|
|
(mercneric tr-stat :inline :offset-assert 16)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x20
|
|
:flag-assert #x900000020
|
|
)
|
|
|
|
;; definition for method 3 of type merc-global-stats
|
|
(defmethod inspect merc-global-stats ((this merc-global-stats))
|
|
(format #t "[~8x] ~A~%" this 'merc-global-stats)
|
|
(format #t "~Tmerc: #<tr-stat @ #x~X>~%" (-> this merc))
|
|
(format #t "~Tmercneric: #<tr-stat @ #x~X>~%" (-> this mercneric))
|
|
this
|
|
)
|
|
|
|
;; definition of type perf-stat
|
|
(deftype perf-stat (structure)
|
|
((frame-number uint32 :offset-assert 0)
|
|
(count uint32 :offset-assert 4)
|
|
(cycles uint32 :offset-assert 8)
|
|
(instructions uint32 :offset-assert 12)
|
|
(icache uint32 :offset-assert 16)
|
|
(dcache uint32 :offset-assert 20)
|
|
(select uint32 :offset-assert 24)
|
|
(ctrl uint32 :offset-assert 28)
|
|
(accum0 uint32 :offset-assert 32)
|
|
(accum1 uint32 :offset-assert 36)
|
|
(to-vu0-waits uint32 :offset-assert 40)
|
|
(to-spr-waits uint32 :offset-assert 44)
|
|
(from-spr-waits uint32 :offset-assert 48)
|
|
)
|
|
:pack-me
|
|
:method-count-assert 14
|
|
:size-assert #x34
|
|
:flag-assert #xe00000034
|
|
(:methods
|
|
(perf-stat-method-9 (_type_) none 9)
|
|
(print-to-stream (_type_ string basic) none 10)
|
|
(reset! (_type_) none 11)
|
|
(read! (_type_) none 12)
|
|
(update-wait-stats (_type_ uint uint uint) none 13)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type perf-stat
|
|
(defmethod inspect perf-stat ((this perf-stat))
|
|
(format #t "[~8x] ~A~%" this 'perf-stat)
|
|
(format #t "~Tframe-number: ~D~%" (-> this frame-number))
|
|
(format #t "~Tcount: ~D~%" (-> this count))
|
|
(format #t "~Tcycles: ~D~%" (-> this cycles))
|
|
(format #t "~Tinstructions: ~D~%" (-> this instructions))
|
|
(format #t "~Ticache: ~D~%" (-> this icache))
|
|
(format #t "~Tdcache: ~D~%" (-> this dcache))
|
|
(format #t "~Tselect: ~D~%" (-> this select))
|
|
(format #t "~Tctrl: ~D~%" (-> this ctrl))
|
|
(format #t "~Taccum0: ~D~%" (-> this accum0))
|
|
(format #t "~Taccum1: ~D~%" (-> this accum1))
|
|
(format #t "~Tto-vu0-waits: ~D~%" (-> this to-vu0-waits))
|
|
(format #t "~Tto-spr-waits: ~D~%" (-> this to-spr-waits))
|
|
(format #t "~Tfrom-spr-waits: ~D~%" (-> this from-spr-waits))
|
|
this
|
|
)
|
|
|
|
;; definition of type perf-stat-array
|
|
(deftype perf-stat-array (inline-array-class)
|
|
((data perf-stat :inline :dynamic :offset-assert 16)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x10
|
|
:flag-assert #x900000010
|
|
)
|
|
|
|
;; definition for method 3 of type perf-stat-array
|
|
(defmethod inspect perf-stat-array ((this perf-stat-array))
|
|
(format #t "[~8x] ~A~%" this (-> this type))
|
|
(format #t "~Tlength: ~D~%" (-> this length))
|
|
(format #t "~Tallocated-length: ~D~%" (-> this allocated-length))
|
|
(format #t "~Tdata[0] @ #x~X~%" (-> this data))
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(set! (-> perf-stat-array heap-base) (the-as uint 52))
|
|
|
|
;; definition for method 11 of type perf-stat
|
|
;; INFO: Return type mismatch int vs none.
|
|
(defmethod reset! perf-stat ((this perf-stat))
|
|
(let ((v1-0 (-> this ctrl)))
|
|
(+! (-> this count) 1)
|
|
(b! (zero? v1-0) cfg-2 :delay (nop!))
|
|
(.mtc0 Perf 0)
|
|
(.sync.l)
|
|
(.sync.p)
|
|
(.mtpc pcr0 0)
|
|
(.mtpc pcr1 0)
|
|
(.sync.l)
|
|
(.sync.p)
|
|
(.mtc0 Perf v1-0)
|
|
)
|
|
(.sync.l)
|
|
(.sync.p)
|
|
(label cfg-2)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 12 of type perf-stat
|
|
;; INFO: Return type mismatch int vs none.
|
|
(defmethod read! perf-stat ((this perf-stat))
|
|
(local-vars (v1-1 int) (v1-3 int))
|
|
(b! (zero? (-> this ctrl)) cfg-2 :delay (nop!))
|
|
(.mtc0 Perf 0)
|
|
(.sync.l)
|
|
(.sync.p)
|
|
(.mfpc v1-1 pcr0)
|
|
(+! (-> this accum0) v1-1)
|
|
(.mfpc v1-3 pcr1)
|
|
(+! (-> this accum1) v1-3)
|
|
(label cfg-2)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 13 of type perf-stat
|
|
;; INFO: Return type mismatch int vs none.
|
|
(defmethod update-wait-stats perf-stat ((this perf-stat) (arg0 uint) (arg1 uint) (arg2 uint))
|
|
(when (nonzero? (-> this ctrl))
|
|
(+! (-> this to-vu0-waits) arg0)
|
|
(+! (-> this to-spr-waits) arg1)
|
|
(+! (-> this from-spr-waits) arg2)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(when (not *debug-segment*)
|
|
(set! (-> perf-stat method-table 11) nothing)
|
|
(set! (-> perf-stat method-table 12) nothing)
|
|
(set! (-> perf-stat method-table 13) nothing)
|
|
)
|