mirror of
https://github.com/open-goal/jak-project
synced 2026-06-27 10:52:59 -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...
114 lines
3.2 KiB
Common Lisp
Vendored
Generated
114 lines
3.2 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition of type timer-mode
|
|
(deftype timer-mode (uint32)
|
|
((clks timer-clock-selection :offset 0 :size 2)
|
|
(gate uint8 :offset 2 :size 1)
|
|
(gats uint8 :offset 3 :size 1)
|
|
(gatm uint8 :offset 4 :size 2)
|
|
(zret uint8 :offset 6 :size 1)
|
|
(cue uint8 :offset 7 :size 1)
|
|
(cmpe uint8 :offset 8 :size 1)
|
|
(ovfe uint8 :offset 9 :size 1)
|
|
(equf uint8 :offset 10 :size 1)
|
|
(ovff uint8 :offset 11 :size 1)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x4
|
|
:flag-assert #x900000004
|
|
)
|
|
|
|
;; definition of type timer-bank
|
|
(deftype timer-bank (structure)
|
|
((count uint32 :offset-assert 0)
|
|
(mode timer-mode :offset 16)
|
|
(comp uint32 :offset 32)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x24
|
|
:flag-assert #x900000024
|
|
)
|
|
|
|
;; definition for method 3 of type timer-bank
|
|
(defmethod inspect timer-bank ((this timer-bank))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'timer-bank)
|
|
(format #t "~1Tcount: #x~X~%" (-> this count))
|
|
(format #t "~1Tmode: #x~X~%" (-> this mode))
|
|
(format #t "~1Tcomp: #x~X~%" (-> this comp))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition of type timer-hold-bank
|
|
(deftype timer-hold-bank (timer-bank)
|
|
((hold uint32 :offset 48)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x34
|
|
:flag-assert #x900000034
|
|
)
|
|
|
|
;; definition for method 3 of type timer-hold-bank
|
|
(defmethod inspect timer-hold-bank ((this timer-hold-bank))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'timer-hold-bank)
|
|
(format #t "~1Tcount: #x~X~%" (-> this count))
|
|
(format #t "~1Tmode: #x~X~%" (-> this mode))
|
|
(format #t "~1Tcomp: #x~X~%" (-> this comp))
|
|
(format #t "~1Thold: #x~X~%" (-> this hold))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition of type stopwatch
|
|
(deftype stopwatch (basic)
|
|
((prev-time-elapsed time-frame :offset-assert 8)
|
|
(start-time time-frame :offset-assert 16)
|
|
(begin-level int32 :offset-assert 24)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x1c
|
|
:flag-assert #x90000001c
|
|
)
|
|
|
|
;; definition for method 3 of type stopwatch
|
|
(defmethod inspect stopwatch ((this stopwatch))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this (-> this type))
|
|
(format #t "~1Tprev-time-elapsed: ~D~%" (-> this prev-time-elapsed))
|
|
(format #t "~1Tstart-time: ~D~%" (-> this start-time))
|
|
(format #t "~1Tbegin-level: ~D~%" (-> this begin-level))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition for symbol *ticks-per-frame*, type int
|
|
(define *ticks-per-frame* 9765)
|
|
|
|
;; definition for function timer-init
|
|
(defun timer-init ((arg0 timer-bank) (arg1 timer-mode))
|
|
(set! (-> arg0 mode) arg1)
|
|
(set! (-> arg0 count) (the-as uint 0))
|
|
0
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(timer-init
|
|
(the-as timer-bank #x10000800)
|
|
(new 'static 'timer-mode :clks (timer-clock-selection busclk/256) :cue #x1)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
0
|