Files
jak-project/test/decompiler/reference/levels/common/static-screen_REF.gc
T
ManDude 89ccb8cbc7 [decomp] progress (#780)
* cleanup `main`

* whitespace

* start `progress` decomp pt1

* fill in more stuff

* Update label_types.jsonc

* run cheats

* clang

* make most of `progress` decompile

* `progress` pt 2

* [decompiler] support dynamic format strings

* Make `progress-draw` decompile and almost all `progress`

* make clang shut up

* fix unhandled format string

* fix `progress-draw`

* Update DecompilerTypeSystem.cpp

* fix?

* fixes

* fix a few functions

* make `language-enum`

* warn on weird floats

* fix minor pad bug

* dump stuff in `progress`

* make `progress-screen` enum

* progress progress

* update refs and fix stupid bug

* trying to get it to work

* it works!?

* disable sound functions

* fixes

* final touches

* tests

* tests

* add process allocations

* use the right register for windows

* another try for windows, counting is hard

* one more try

* use process allocations

Co-authored-by: water <awaterford111445@gmail.com>
2021-09-06 20:35:03 -04:00

437 lines
9.9 KiB
Common Lisp
Vendored

;;-*-Lisp-*-
(in-package goal)
;; definition of type static-screen
(deftype static-screen (process)
((part sparticle-launch-control 1 :offset-assert 112)
(state-time uint64 :offset-assert 120)
)
:heap-base #x10
:method-count-assert 15
:size-assert #x80
:flag-assert #xf00100080
(:methods
(idle (int int symbol) _type_ :state 14)
)
)
;; definition for method 3 of type static-screen
(defmethod inspect static-screen ((obj static-screen))
(let ((t9-0 (method-of-type process inspect)))
(t9-0 obj)
)
(format #t "~T~Tpart[1] @ #x~X~%" (-> obj stack))
(format #t "~T~Tstate-time: ~D~%" (-> obj state-time))
obj
)
;; definition for method 7 of type static-screen
;; INFO: Return type mismatch process vs static-screen.
(defmethod relocate static-screen ((obj static-screen) (arg0 int))
(let ((v1-0 *kernel-context*))
(set! (-> v1-0 relocating-process) obj)
(set! (-> v1-0 relocating-min) (the-as int (&-> obj type)))
(set!
(-> v1-0 relocating-max)
(the-as
int
(+ (+ (-> obj allocated-length) -4 (-> process size)) (the-as int obj))
)
)
(set! (-> v1-0 relocating-offset) arg0)
)
(dotimes (v1-2 1)
(if (nonzero? (-> obj part v1-2))
(&+! (-> obj part v1-2) arg0)
)
)
(the-as static-screen ((method-of-type process relocate) obj arg0))
)
;; definition for method 10 of type static-screen
(defmethod deactivate static-screen ((obj static-screen))
(dotimes (s5-0 1)
(if (nonzero? (-> obj part s5-0))
(deactivate (-> obj part s5-0))
)
)
((method-of-type process deactivate) obj)
(none)
)
;; failed to figure out what this is:
(set!
(-> *part-id-table* 2966)
(new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 12
(new 'static 'sp-field-init-spec
:field #x1
:initial-valuef 252201580000000000.0
)
(new 'static 'sp-field-init-spec
:field #x6
:flags #x1
:initial-valuef 1.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #xb
:flags #x1
:initial-valuef 4833.28
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #xd
:flags #x1
:initial-valuef 61440.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x11
:flags #x1
:initial-valuef 26624.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x12
:flags #x1
:initial-valuef 128.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x13
:flags #x1
:initial-valuef 128.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x14
:flags #x1
:initial-valuef 128.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x15
:flags #x1
:initial-valuef 128.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x2e
:initial-valuef (the-as float #xffffffff)
:random-multf (the-as float #x1)
)
(new 'static 'sp-field-init-spec
:field #x2f
:initial-valuef (the-as float #x2204)
:random-multf (the-as float #x1)
)
(new 'static 'sp-field-init-spec :field #x43)
)
)
)
;; failed to figure out what this is:
(set!
(-> *part-id-table* 2967)
(new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 12
(new 'static 'sp-field-init-spec
:field #x1
:initial-valuef 252205980000000000.0
)
(new 'static 'sp-field-init-spec
:field #x6
:flags #x1
:initial-valuef 1.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #xb
:flags #x1
:initial-valuef -5177.344
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #xd
:flags #x1
:initial-valuef 61440.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x11
:flags #x1
:initial-valuef 13312.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x12
:flags #x1
:initial-valuef 128.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x13
:flags #x1
:initial-valuef 128.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x14
:flags #x1
:initial-valuef 128.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x15
:flags #x1
:initial-valuef 128.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x2e
:initial-valuef (the-as float #xffffffff)
:random-multf (the-as float #x1)
)
(new 'static 'sp-field-init-spec
:field #x2f
:initial-valuef (the-as float #x2204)
:random-multf (the-as float #x1)
)
(new 'static 'sp-field-init-spec :field #x43)
)
)
)
;; failed to figure out what this is:
(set!
(-> *part-id-table* 2968)
(new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 12
(new 'static 'sp-field-init-spec
:field #x1
:initial-valuef 252210380000000000.0
)
(new 'static 'sp-field-init-spec
:field #x6
:flags #x1
:initial-valuef 1.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #xb
:flags #x1
:initial-valuef -10166.272
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #xd
:flags #x1
:initial-valuef 61440.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x11
:flags #x1
:initial-valuef 6656.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x12
:flags #x1
:initial-valuef 128.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x13
:flags #x1
:initial-valuef 128.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x14
:flags #x1
:initial-valuef 128.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x15
:flags #x1
:initial-valuef 128.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x2e
:initial-valuef (the-as float #xffffffff)
:random-multf (the-as float #x1)
)
(new 'static 'sp-field-init-spec
:field #x2f
:initial-valuef (the-as float #x2204)
:random-multf (the-as float #x1)
)
(new 'static 'sp-field-init-spec :field #x43)
)
)
)
;; failed to figure out what this is:
(set!
(-> *part-group-id-table* 707)
(new 'static 'sparticle-launch-group
:length 3
:duration #xbb8
:linger-duration #x5dc
:flags #x4
:name "group-part-screen1"
:launcher
(new 'static 'inline-array sparticle-group-item 3
(new 'static 'sparticle-group-item :launcher #xb96 :flags #x8)
(new 'static 'sparticle-group-item :launcher #xb97 :flags #x8)
(new 'static 'sparticle-group-item :launcher #xb98 :flags #x8)
)
:bounds (new 'static 'sphere :w 4096.0)
)
)
;; failed to figure out what this is:
(defstate idle (static-screen)
:virtual #t
:enter
(behavior ((arg0 int) (arg1 int) (arg2 symbol))
(set! (-> *setting-control* current bg-a) 1.0)
(set! (-> *setting-control* default bg-a) 0.0)
(push-setting!
*setting-control*
self
(the-as (function object object object object object) 'common-page)
'set
0.0
(ash 1 (+ arg0 1))
)
(none)
)
:trans
(behavior ()
(hide-hud-quick)
(dummy-11 (-> self part 0) *zero-vector*)
0
(none)
)
:code
(behavior ((arg0 int) (arg1 int) (arg2 symbol))
(local-vars (v1-6 symbol))
(set! (-> self state-time) (the-as uint (-> *display* base-frame-counter)))
(until v1-6
(suspend)
(set!
v1-6
(or
(and
(> arg1 0)
(>=
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
arg1
)
)
(and
arg2
(>=
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
300
)
(logtest?
(-> *cpad-list* cpads 0 button0-rel 0)
(pad-buttons select start triangle circle x square)
)
)
)
)
)
(set! (-> *setting-control* default bg-a) 1.0)
(while
(!= (-> *setting-control* current bg-a) (-> *setting-control* default bg-a))
(suspend)
)
(clear-pending-settings-from-process *setting-control* self 'common-page)
(suspend)
0
(none)
)
)
;; definition for function static-screen-init-by-other
;; INFO: Return type mismatch int vs none.
(defbehavior
static-screen-init-by-other static-screen
((arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 symbol))
(let ((s3-0 (lookup-part-group-by-name "group-part-screen1")))
(when
(and
s3-0
(nonzero? s3-0)
(type-type? (-> s3-0 type) sparticle-launch-group)
)
(set!
(-> *part-id-table* 2966 init-specs 0 initial-valuef)
(the-as float arg1)
)
(set!
(-> *part-id-table* 2967 init-specs 0 initial-valuef)
(the-as float arg2)
)
(set!
(-> *part-id-table* 2968 init-specs 0 initial-valuef)
(the-as float arg3)
)
(set!
(-> self part 0)
(create-launch-control (the-as sparticle-launch-group s3-0) self)
)
(go-virtual idle arg0 arg4 arg5)
)
)
0
(none)
)
;; definition for function static-screen-spawn
;; Used lq/sq
(defun
static-screen-spawn
((arg0 int)
(arg1 int)
(arg2 int)
(arg3 int)
(arg4 int)
(arg5 symbol)
(arg6 target)
)
(local-vars (sv-16 process))
(set! sv-16 (get-process *default-dead-pool* static-screen #x4000))
(when sv-16
(let ((t9-1 (method-of-type static-screen activate)))
(t9-1
(the-as static-screen sv-16)
arg6
'static-screen
(the-as pointer #x70004000)
)
)
(run-now-in-process
sv-16
static-screen-init-by-other
arg0
arg1
arg2
arg3
arg4
arg5
)
(-> sv-16 ppointer)
)
)