jak-project/goal_src/levels/demo/static-screen.gc
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

177 lines
5.2 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: static-screen.gc
;; name in dgo: static-screen
;; dgos: DEM, L1, TIT
;; DECOMP BEGINS
(deftype static-screen (process)
((part sparticle-launch-control 1 :offset-assert 112)
(state-time time-frame :offset-assert 120)
)
:heap-base #x10
:method-count-assert 15
:size-assert #x80
:flag-assert #xf00100080
(:methods
(idle (int time-frame symbol) _type_ :state 14)
)
)
(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))
)
(defmethod deactivate static-screen ((obj static-screen))
(dotimes (s5-0 1)
(if (nonzero? (-> obj part s5-0))
(kill-and-free-particles (-> obj part s5-0))
)
)
((method-of-type process deactivate) obj)
(none)
)
(defpart 2966
:init-specs
((sp-tex spt-texture (new 'static 'texture-id :page #x5c6))
(sp-flt spt-num 1.0)
(sp-flt spt-y (meters 1.18))
(sp-flt spt-scale-x (meters 15))
(sp-flt spt-scale-y (meters 6.5))
(sp-flt spt-r 128.0)
(sp-flt spt-g 128.0)
(sp-flt spt-b 128.0)
(sp-flt spt-a 128.0)
(sp-int spt-timer -1)
(sp-cpuinfo-flags bit2 bit9 bit13)
)
)
(defpart 2967
:init-specs
((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x5c6))
(sp-flt spt-num 1.0)
(sp-flt spt-y (meters -1.264))
(sp-flt spt-scale-x (meters 15))
(sp-flt spt-scale-y (meters 3.25))
(sp-flt spt-r 128.0)
(sp-flt spt-g 128.0)
(sp-flt spt-b 128.0)
(sp-flt spt-a 128.0)
(sp-int spt-timer -1)
(sp-cpuinfo-flags bit2 bit9 bit13)
)
)
(defpart 2968
:init-specs
((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x5c6))
(sp-flt spt-num 1.0)
(sp-flt spt-y (meters -2.482))
(sp-flt spt-scale-x (meters 15))
(sp-flt spt-scale-y (meters 1.625))
(sp-flt spt-r 128.0)
(sp-flt spt-g 128.0)
(sp-flt spt-b 128.0)
(sp-flt spt-a 128.0)
(sp-int spt-timer -1)
(sp-cpuinfo-flags bit2 bit9 bit13)
)
)
(defpartgroup group-part-screen1
:id 707
:flags (screen-space)
:bounds (static-bspherem 0 0 0 1)
:parts
((sp-item 2966 :flags (launch-asap)) (sp-item 2967 :flags (launch-asap)) (sp-item 2968 :flags (launch-asap)))
)
(defstate idle (static-screen)
:virtual #t
:enter
(behavior ((arg0 int) (arg1 time-frame) (arg2 symbol))
(set! (-> *setting-control* current bg-a) 1.0)
(set! (-> *setting-control* default bg-a) 0.0)
(push-setting! *setting-control* self 'common-page 'set 0.0 (ash 1 (+ arg0 1)))
(none)
)
:trans
(behavior ()
(hide-hud-quick)
(spawn (-> self part 0) *zero-vector*)
0
(none)
)
:code
(behavior ((arg0 int) (arg1 time-frame) (arg2 symbol))
(local-vars (v1-6 symbol))
(set! (-> self state-time) (-> *display* base-frame-counter))
(until v1-6
(suspend)
(set! v1-6 (or (and (> arg1 0) (>= (- (-> *display* base-frame-counter) (-> self state-time)) arg1))
(and arg2
(>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1))
(cpad-pressed? 0 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)
)
)
(defbehavior static-screen-init-by-other static-screen ((arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 time-frame) (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)
)
(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)
)
)