mirror of
https://github.com/open-goal/jak-project
synced 2026-05-26 07:39:12 -04:00
223 lines
6.6 KiB
Common Lisp
Vendored
Generated
223 lines
6.6 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition for function timer-count
|
|
(defun timer-count ((arg0 timer-bank))
|
|
(.sync.l)
|
|
(let ((v0-0 (-> arg0 count)))
|
|
(.sync.l)
|
|
v0-0
|
|
)
|
|
)
|
|
|
|
;; definition for function disable-irq
|
|
;; WARN: Return type mismatch int vs none.
|
|
;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v0, Status]
|
|
(defun disable-irq ()
|
|
(local-vars (v0-0 int))
|
|
(let ((v1-0 (the-as uint #xfffffffe)))
|
|
(.mfc0 v0-0 Status)
|
|
(let ((v0-1 (logand v0-0 v1-0)))
|
|
(.mtc0 Status v0-1)
|
|
)
|
|
)
|
|
(.sync.p)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for function enable-irq
|
|
;; WARN: Return type mismatch int vs none.
|
|
;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v0, Status]
|
|
(defun enable-irq ()
|
|
(local-vars (v0-0 int))
|
|
(.mfc0 v0-0 Status)
|
|
(let ((v0-1 (logior v0-0 1)))
|
|
(.mtc0 Status v0-1)
|
|
)
|
|
(.sync.p)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for function stopwatch-init
|
|
(defun stopwatch-init ((arg0 stopwatch))
|
|
(set! (-> arg0 begin-level) 0)
|
|
(set! (-> arg0 prev-time-elapsed) 0)
|
|
0
|
|
)
|
|
|
|
;; definition for function stopwatch-reset
|
|
;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count]
|
|
(defun stopwatch-reset ((arg0 stopwatch))
|
|
(local-vars (v1-3 int))
|
|
(set! (-> arg0 prev-time-elapsed) 0)
|
|
(when (> (-> arg0 begin-level) 0)
|
|
0
|
|
(.mfc0 v1-3 Count)
|
|
(set! (-> arg0 start-time) (the-as time-frame v1-3))
|
|
)
|
|
0
|
|
)
|
|
|
|
;; definition for function stopwatch-start
|
|
;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count]
|
|
(defun stopwatch-start ((arg0 stopwatch))
|
|
(local-vars (v1-4 int))
|
|
(when (zero? (-> arg0 begin-level))
|
|
(set! (-> arg0 begin-level) 1)
|
|
0
|
|
(.mfc0 v1-4 Count)
|
|
(set! (-> arg0 start-time) (the-as time-frame v1-4))
|
|
)
|
|
0
|
|
)
|
|
|
|
;; definition for function stopwatch-stop
|
|
;; WARN: Return type mismatch int vs none.
|
|
;; ERROR: Unsupported inline assembly instruction kind - [mfc0 a1, Count]
|
|
(defun stopwatch-stop ((arg0 stopwatch))
|
|
(local-vars (a1-0 int))
|
|
(when (> (-> arg0 begin-level) 0)
|
|
(set! (-> arg0 begin-level) 0)
|
|
0
|
|
(.mfc0 a1-0 Count)
|
|
(+! (-> arg0 prev-time-elapsed) (- (the-as time-frame a1-0) (-> arg0 start-time)))
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for function stopwatch-begin
|
|
;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count]
|
|
(defun stopwatch-begin ((arg0 stopwatch))
|
|
(local-vars (v1-3 int))
|
|
(when (zero? (-> arg0 begin-level))
|
|
0
|
|
(.mfc0 v1-3 Count)
|
|
(set! (-> arg0 start-time) (the-as time-frame v1-3))
|
|
)
|
|
(+! (-> arg0 begin-level) 1)
|
|
0
|
|
)
|
|
|
|
;; definition for function stopwatch-end
|
|
;; WARN: Return type mismatch int vs none.
|
|
;; ERROR: Unsupported inline assembly instruction kind - [mfc0 a1, Count]
|
|
(defun stopwatch-end ((arg0 stopwatch))
|
|
(local-vars (a1-0 int))
|
|
(+! (-> arg0 begin-level) -1)
|
|
(when (zero? (-> arg0 begin-level))
|
|
0
|
|
(.mfc0 a1-0 Count)
|
|
(+! (-> arg0 prev-time-elapsed) (- (the-as time-frame a1-0) (-> arg0 start-time)))
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for function stopwatch-elapsed-ticks
|
|
;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count]
|
|
(defun stopwatch-elapsed-ticks ((arg0 stopwatch))
|
|
(local-vars (v1-3 int))
|
|
(let ((v0-0 (-> arg0 prev-time-elapsed)))
|
|
(when (> (-> arg0 begin-level) 0)
|
|
0
|
|
(.mfc0 v1-3 Count)
|
|
(+! v0-0 (- (the-as time-frame v1-3) (-> arg0 start-time)))
|
|
)
|
|
v0-0
|
|
)
|
|
)
|
|
|
|
;; definition for function stopwatch-elapsed-seconds
|
|
(defun stopwatch-elapsed-seconds ((arg0 stopwatch))
|
|
(let ((v1-0 (stopwatch-elapsed-ticks arg0)))
|
|
(* 0.0000000033333334 (the float v1-0))
|
|
)
|
|
)
|
|
|
|
;; definition for method 9 of type clock
|
|
(defmethod update-rates! clock ((obj clock) (arg0 float))
|
|
(set! (-> obj clock-ratio) arg0)
|
|
(let ((f0-6 (if (nonzero? *display*)
|
|
(* (-> *display* time-factor) (-> *display* dog-ratio) arg0)
|
|
(* 5.0 arg0)
|
|
)
|
|
)
|
|
)
|
|
(set! (-> obj time-adjust-ratio) (* 0.2 f0-6))
|
|
)
|
|
(set! (-> obj seconds-per-frame) (* 0.016666668 (-> obj time-adjust-ratio)))
|
|
(set! (-> obj frames-per-second) (if (= (-> obj time-adjust-ratio) 0.0)
|
|
0.0
|
|
(* 60.0 (/ 1.0 (-> obj time-adjust-ratio)))
|
|
)
|
|
)
|
|
(let* ((v1-12 (- (-> obj frame-counter) (-> obj old-frame-counter)))
|
|
(f0-14 (gpr->fpr v1-12))
|
|
(f1-9 (* 0.2 (the float v1-12)))
|
|
)
|
|
(set-vector! (-> obj sparticle-data) (the-as float f0-14) (* 5.0 f1-9) f1-9 f1-9)
|
|
)
|
|
arg0
|
|
)
|
|
|
|
;; definition for method 10 of type clock
|
|
(defmethod advance-by! clock ((obj clock) (arg0 float))
|
|
(the int (+ arg0 (-> obj accum)))
|
|
(+! (-> obj integral-accum) arg0)
|
|
(set! (-> obj old-integral-frame-counter) (-> obj integral-frame-counter))
|
|
(while (>= (-> obj integral-accum) (-> *display* time-factor))
|
|
(+! (-> obj integral-frame-counter) 1)
|
|
(set! (-> obj integral-accum) (- (-> obj integral-accum) (-> *display* time-factor)))
|
|
)
|
|
(let ((v1-7 (the int (+ arg0 (-> obj accum)))))
|
|
(set! (-> obj accum) (- (+ arg0 (-> obj accum)) (the float v1-7)))
|
|
(set! (-> obj old-frame-counter) (-> obj frame-counter))
|
|
(+! (-> obj frame-counter) v1-7)
|
|
)
|
|
(update-rates! obj (-> obj clock-ratio))
|
|
obj
|
|
)
|
|
|
|
;; definition for method 11 of type clock
|
|
(defmethod tick! clock ((obj clock))
|
|
(if (not (logtest? (-> obj mask) (-> *kernel-context* prevent-from-run)))
|
|
(advance-by! obj (* (-> *display* time-factor) (-> *display* dog-ratio) (-> obj clock-ratio)))
|
|
(set! (-> obj sparticle-data x) 0.0)
|
|
)
|
|
obj
|
|
)
|
|
|
|
;; definition for method 14 of type clock
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod reset! clock ((obj clock))
|
|
(set! (-> obj frame-counter) (seconds 1000))
|
|
(set! (-> obj integral-frame-counter) (the-as uint #x493e0))
|
|
(set! (-> obj accum) 0.0)
|
|
(set! (-> obj old-frame-counter) (+ (-> obj frame-counter) -1))
|
|
(set! (-> obj old-integral-frame-counter) (+ (-> obj integral-frame-counter) -1))
|
|
(update-rates! obj 1.0)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 12 of type clock
|
|
(defmethod save! clock ((obj clock) (arg0 (pointer uint64)))
|
|
(set! (-> arg0 0) (the-as uint (-> obj frame-counter)))
|
|
(set! (-> arg0 1) (-> obj integral-frame-counter))
|
|
16
|
|
)
|
|
|
|
;; definition for method 13 of type clock
|
|
(defmethod load! clock ((obj clock) (arg0 (pointer uint64)))
|
|
(set! (-> obj frame-counter) (the-as time-frame (-> arg0 0)))
|
|
(set! (-> obj integral-frame-counter) (-> arg0 1))
|
|
(set! (-> obj accum) 0.0)
|
|
(set! (-> obj integral-accum) 0.0)
|
|
(set! (-> obj old-frame-counter) (-> obj frame-counter))
|
|
(set! (-> obj old-integral-frame-counter) (-> obj integral-frame-counter))
|
|
16
|
|
)
|