Files
jak-project/test/decompiler/reference/engine/ps2/timer-h_REF.gc
T
ManDude 24578b64b9 proper support for hardcoded "time" types (#1141)
* hardcode `time-frame`things

* Update cam-states_REF.gc

* Update level-info_REF.gc

* update refs 1

* update refs 2

* update refs 3

* update refs 4

* update refs 5

* update detection and casting

* Update FormExpressionAnalysis.cpp

* update refs 6

* update mood decomp

* update refs 7

* update refs 8

* remove temp entity birth code

* update time-frame casts

* fix compiler

* hardcode stuff and fix some types

* fix some bitfield detection being wrong

* bug fixes

* detect seconds on adds with immediate

* update refs 9

* fix casts and rand-vu-int-range bugs (update refs 10)

* update refs 11

* update 12

* update 13

* update 14

* Update game-info_REF.gc

* improve cpad macros detection

* remove unused code

* update refs

* clang

* update source code

* Update cam-states.gc

* `lavatube-energy` finish

* update refs

* fix actor bank stuff

* Update navigate.gc

* reduce entity default stack size

* Update transformq-h.gc

* oops forgot these

* fix code and tests

* fix mood sound stuff

* Update load-dgo.gc

* Update README.md
2022-02-12 12:26:19 -05:00

163 lines
5.1 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 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 ((obj timer-bank))
(format #t "[~8x] ~A~%" obj 'timer-bank)
(format #t "~Tcount: #x~X~%" (-> obj count))
(format #t "~Tmode: #x~X~%" (-> obj mode))
(format #t "~Tcomp: #x~X~%" (-> obj comp))
obj
)
;; 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 ((obj timer-hold-bank))
(format #t "[~8x] ~A~%" obj 'timer-hold-bank)
(format #t "~Tcount: #x~X~%" (-> obj count))
(format #t "~Tmode: #x~X~%" (-> obj mode))
(format #t "~Tcomp: #x~X~%" (-> obj comp))
(format #t "~Thold: #x~X~%" (-> obj hold))
obj
)
;; 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 ((obj stopwatch))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tprev-time-elapsed: ~D~%" (-> obj prev-time-elapsed))
(format #t "~Tstart-time: ~D~%" (-> obj start-time))
(format #t "~Tbegin-level: ~D~%" (-> obj begin-level))
obj
)
;; 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)
)
;; definition of type profile-frame
(deftype profile-frame (structure)
((name symbol :offset-assert 0)
(time-stamp uint32 :offset-assert 4)
(color rgba :offset-assert 8)
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
;; definition for method 3 of type profile-frame
;; INFO: this function exists in multiple non-identical object files
(defmethod inspect profile-frame ((obj profile-frame))
(format #t "[~8x] ~A~%" obj 'profile-frame)
(format #t "~Tname: ~A~%" (-> obj name))
(format #t "~Ttime-stamp: ~D~%" (-> obj time-stamp))
(format #t "~Tcolor: ~D~%" (-> obj color))
obj
)
;; definition for method 3 of type profile-frame
;; INFO: this function exists in multiple non-identical object files
(defmethod inspect profile-frame ((obj profile-frame))
(format #t "[~8x] profile-frame~%" obj)
(format #t "~Tname: ~A~%" (-> obj name))
(format #t "~Ttime-stamp: ~D~%" (-> obj time-stamp))
(format #t "~Tcolor: ~D ~D ~D~%" (-> obj color r) (-> obj color g) (-> obj color b))
obj
)
;; definition of type profile-bar
(deftype profile-bar (basic)
((profile-frame-count int32 :offset-assert 4)
(cache-time time-frame :offset-assert 8)
(data profile-frame 1024 :inline :offset-assert 16)
)
:method-count-assert 14
:size-assert #x4010
:flag-assert #xe00004010
(:methods
(new (symbol type) _type_ 0)
(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)
)
)
;; definition for method 3 of type profile-bar
(defmethod inspect profile-bar ((obj profile-bar))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tprofile-frame-count: ~D~%" (-> obj profile-frame-count))
(format #t "~Tcache-time: ~D~%" (-> obj cache-time))
(format #t "~Tdata[1024] @ #x~X~%" (-> obj data))
obj
)
;; definition for method 9 of type profile-bar
(defmethod get-last-frame-time-stamp profile-bar ((obj profile-bar))
(-> obj data (+ (-> obj profile-frame-count) -2) time-stamp)
)
;; failed to figure out what this is:
0