mirror of
https://github.com/open-goal/jak-project
synced 2026-07-10 23:22:17 -04:00
format/j1: fix empty list handling
This commit is contained in:
@@ -138,9 +138,8 @@ void FormatterTree::construct_formatter_tree_recursive(const std::string& source
|
||||
}
|
||||
} else {
|
||||
construct_formatter_tree_recursive(source, child_node, tree_node, next_node_prefix);
|
||||
// TODO - im not sure if this is correct
|
||||
if (node_prefix && !tree_node.refs.empty()) {
|
||||
tree_node.refs.at(tree_node.refs.size() - 1).node_prefix = node_prefix;
|
||||
if (next_node_prefix && !tree_node.refs.empty()) {
|
||||
tree_node.refs.at(tree_node.refs.size() - 1).node_prefix = next_node_prefix;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#|@file Compiler Setup for Jak 1 |#
|
||||
;;
|
||||
;; Compiler Setup for Jak 1
|
||||
;;
|
||||
|
||||
;; load kernel type definitions.
|
||||
;; these types/functions are provided by Jak 1's runtime.
|
||||
|
||||
@@ -3,6 +3,11 @@
|
||||
(bundles "ENGINE.CGO" "GAME.CGO")
|
||||
(require "engine/draw/drawable-h.gc")
|
||||
(require "kernel/gstate.gc")
|
||||
|
||||
;; name: aligner-h.gc
|
||||
;; name in dgo: aligner-h
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
(defenum align-flags
|
||||
:bitfield #t
|
||||
:type uint32
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
(require "engine/anim/aligner-h.gc")
|
||||
(require "engine/common-obs/process-drawable.gc")
|
||||
|
||||
;; name: aligner.gc
|
||||
;; name in dgo: aligner
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)]
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
(require "engine/collide/collide-cache.gc")
|
||||
(require "engine/common-obs/process-drawable.gc")
|
||||
|
||||
;; name: joint-exploder.gc
|
||||
;; name in dgo: joint-exploder
|
||||
;; dgos: GAME, COMMON, L1
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(deftype joint-exploder-tuning (structure)
|
||||
@@ -400,7 +404,7 @@
|
||||
(set! (-> self root trans quad) (-> self parent-override 0 root trans quad))
|
||||
(quaternion-copy! (-> self root quat) (-> self parent-override 0 root quat))
|
||||
(set! (-> self root scale quad) (-> self parent-override 0 root scale quad))
|
||||
(initialize-skeleton self arg0 ())
|
||||
(initialize-skeleton self arg0 '())
|
||||
(logior! (-> self skel status) (janim-status inited))
|
||||
(set! (-> self anim) (the-as art-joint-anim (-> self draw art-group data arg1)))
|
||||
(ja-channel-set! 1)
|
||||
|
||||
@@ -1325,22 +1325,22 @@
|
||||
|
||||
(defun make-joint-jump-tables ()
|
||||
#|
|
||||
#x3ee6b6f9, // = 9 ^ 1055307504
|
||||
#x3ee6b6ff, // = 15 ^ 1055307504
|
||||
#x3ee6b6e2, // = 18 ^ 1055307504
|
||||
#x3ee6b6e4, // = 20 ^ 1055307504
|
||||
#x3ee6b6e5, // = 21 ^ 1055307504
|
||||
#x3ee6b6eb, // = 27 ^ 1055307504
|
||||
#x3ee6b6ee, // = 30 ^ 1055307504
|
||||
#x3ee6b6f6, // = 6 ^ 1055307504
|
||||
#x3ee6b6fc, // = 12 ^ 1055307504
|
||||
#x3ee6b6ff, // = 15 ^ 1055307504
|
||||
#x3ee6b6e3, // = 19 ^ 1055307504
|
||||
#x3ee6b6e4, // = 20 ^ 1055307504
|
||||
#x3ee6b6e8, // = 24 ^ 1055307504
|
||||
#x3ee6b6eb, // = 27 ^ 1055307504
|
||||
#x3ee6b6ef, // = 31 ^ 1055307504
|
||||
#x3ee6b6f6, // = 6 ^ 1055307504
|
||||
#x3ee6b6f9, // = 9 ^ 1055307504
|
||||
#x3ee6b6ff, // = 15 ^ 1055307504
|
||||
#x3ee6b6e2, // = 18 ^ 1055307504
|
||||
#x3ee6b6e4, // = 20 ^ 1055307504
|
||||
#x3ee6b6e5, // = 21 ^ 1055307504
|
||||
#x3ee6b6eb, // = 27 ^ 1055307504
|
||||
#x3ee6b6ee, // = 30 ^ 1055307504
|
||||
#x3ee6b6f6, // = 6 ^ 1055307504
|
||||
#x3ee6b6fc, // = 12 ^ 1055307504
|
||||
#x3ee6b6ff, // = 15 ^ 1055307504
|
||||
#x3ee6b6e3, // = 19 ^ 1055307504
|
||||
#x3ee6b6e4, // = 20 ^ 1055307504
|
||||
#x3ee6b6e8, // = 24 ^ 1055307504
|
||||
#x3ee6b6eb, // = 27 ^ 1055307504
|
||||
#x3ee6b6ef, // = 31 ^ 1055307504
|
||||
#x3ee6b6f6, // = 6 ^ 1055307504
|
||||
|#
|
||||
(set! (-> (scratchpad-object terrain-context) work foreground joint-work fix-jmp-table 0)
|
||||
(the-as (function none) (+ 0 #x3ee6b6f9)))
|
||||
|
||||
@@ -152,3 +152,5 @@
|
||||
(let ((a0-3 (mod (+ (the int arg0) -1 *timeplot-index*) 400))) (-> *timeplot-table* a0-3)))
|
||||
|
||||
(define-perm *cam-layout* symbol #f)
|
||||
|
||||
0
|
||||
|
||||
@@ -280,7 +280,7 @@
|
||||
(set! (-> self blend-to-type) (the-as uint 1))))
|
||||
:exit
|
||||
(behavior ()
|
||||
())
|
||||
'())
|
||||
:code
|
||||
(behavior ()
|
||||
(loop
|
||||
|
||||
@@ -376,7 +376,7 @@
|
||||
(matrix-rotate-y! (the-as matrix (-> self tracking)) (the-as float -32768.0)))
|
||||
:exit
|
||||
(behavior ()
|
||||
())
|
||||
'())
|
||||
:trans
|
||||
(behavior ()
|
||||
(if (not (logtest? (-> *camera* master-options) 2)) (go cam-free-floating)))
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
(when (logtest? (-> self flags) (pov-camera-flag inherit-orientation))
|
||||
(let ((v1-20 (if (and (nonzero? arg4) (type-type? (-> arg4 type) process-drawable)) arg4)))
|
||||
(quaternion-copy! (-> self root quat) (-> v1-20 root quat))))
|
||||
(initialize-skeleton self arg1 ())
|
||||
(initialize-skeleton self arg1 '())
|
||||
(logior! (-> self draw status) (draw-status skip-bones))
|
||||
(logior! (-> self skel status) (janim-status inited))
|
||||
(set! (-> self anim-name) arg2)
|
||||
|
||||
@@ -669,7 +669,7 @@
|
||||
"Allocate a new collide-sticky-rider-group with space for riders-amount sticky riders."
|
||||
(let ((this (object-new allocation
|
||||
type-to-make
|
||||
(the int (+ (-> type-to-make size) (the uint (* (1 - riders-amount) (size-of collide-sticky-rider))))))))
|
||||
(the int (+ (-> type-to-make size) (the uint (* (1- riders-amount) (size-of collide-sticky-rider))))))))
|
||||
(set! (-> this allocated-riders) riders-amount)
|
||||
(set! (-> this num-riders) 0)
|
||||
this))
|
||||
|
||||
@@ -234,7 +234,7 @@
|
||||
(none))
|
||||
|
||||
(defmethod nav-enemy-method-48 ((this babak))
|
||||
(initialize-skeleton this *babak-sg* ())
|
||||
(initialize-skeleton this *babak-sg* '())
|
||||
(init-defaults! this *babak-nav-enemy-info*)
|
||||
(set! (-> this neck up) (the-as uint 0))
|
||||
(set! (-> this neck nose) (the-as uint 1))
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
;;-*-Lisp-*-
|
||||
|
||||
(in-package goal)
|
||||
(bundles "GAME.CGO")
|
||||
(require "engine/common-obs/generic-obs.gc")
|
||||
(require "engine/target/logic-target.gc")
|
||||
|
||||
;; name: basebutton.gc
|
||||
|
||||
;; name in dgo: basebutton
|
||||
|
||||
;; dgos: GAME, COMMON, L1
|
||||
|
||||
;; DECOMP BEGINS
|
||||
@@ -210,7 +207,7 @@
|
||||
(let ((v0-0 'trigger)) (set! (-> this event-going-down) v0-0) v0-0))
|
||||
|
||||
(defmethod basebutton-method-26 ((this basebutton))
|
||||
(initialize-skeleton this *generic-button-sg* ())
|
||||
(initialize-skeleton this *generic-button-sg* '())
|
||||
(logior! (-> this skel status) (janim-status inited))
|
||||
(ja-channel-set! 1)
|
||||
(cond
|
||||
|
||||
@@ -755,7 +755,7 @@
|
||||
(if (when a0-10
|
||||
(let ((a0-11 (-> a0-10 extra perm task))) (if a0-11 (= a0-11 (game-task none)))))
|
||||
(set! (-> this entity extra perm task) (game-task complete))))
|
||||
(initialize-skeleton this *money-sg* ())
|
||||
(initialize-skeleton this *money-sg* '())
|
||||
(if (-> this entity) (nav-mesh-connect this (-> this root) (the-as nav-control #f)))
|
||||
(set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0)
|
||||
(set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0)
|
||||
@@ -832,17 +832,17 @@
|
||||
((logtest? (-> *target* control root-prim prim-core action) (collide-action racer)) (set! v1-7 16))
|
||||
((logtest? (-> *target* control root-prim prim-core action) (collide-action flut)) (set! v1-7 32))))
|
||||
(cond
|
||||
((zero? v1-7) (new 'static 'spool-anim :name "fuel-cell-victory" :index 3 :parts 2 :command-list ()))
|
||||
((= v1-7 1) (new 'static 'spool-anim :name "fuel-cell-victory-2" :index 4 :parts 2 :command-list ()))
|
||||
((= v1-7 2) (new 'static 'spool-anim :name "fuel-cell-victory-3" :index 5 :parts 2 :command-list ()))
|
||||
((= v1-7 3) (new 'static 'spool-anim :name "fuel-cell-victory-4" :index 6 :parts 2 :command-list ()))
|
||||
((= v1-7 4) (new 'static 'spool-anim :name "fuel-cell-victory-5" :index 7 :parts 2 :command-list ()))
|
||||
((= v1-7 5) (new 'static 'spool-anim :name "fuel-cell-victory-6" :index 8 :parts 2 :command-list ()))
|
||||
((= v1-7 6) (new 'static 'spool-anim :name "fuel-cell-victory-7" :index 9 :parts 2 :command-list ()))
|
||||
((= v1-7 7) (new 'static 'spool-anim :name "fuel-cell-victory-8" :index 10 :parts 2 :command-list ()))
|
||||
((= v1-7 16) (new 'static 'spool-anim :name "fuel-cell-racer-victory-1" :index 40 :parts 2 :command-list ()))
|
||||
((= v1-7 32) (new 'static 'spool-anim :name "fuel-cell-flut-victory-1" :index 44 :parts 2 :command-list ()))
|
||||
(else (new 'static 'spool-anim :name "fuel-cell-victory-3" :index 5 :parts 2 :command-list ())))))
|
||||
((zero? v1-7) (new 'static 'spool-anim :name "fuel-cell-victory" :index 3 :parts 2 :command-list '()))
|
||||
((= v1-7 1) (new 'static 'spool-anim :name "fuel-cell-victory-2" :index 4 :parts 2 :command-list '()))
|
||||
((= v1-7 2) (new 'static 'spool-anim :name "fuel-cell-victory-3" :index 5 :parts 2 :command-list '()))
|
||||
((= v1-7 3) (new 'static 'spool-anim :name "fuel-cell-victory-4" :index 6 :parts 2 :command-list '()))
|
||||
((= v1-7 4) (new 'static 'spool-anim :name "fuel-cell-victory-5" :index 7 :parts 2 :command-list '()))
|
||||
((= v1-7 5) (new 'static 'spool-anim :name "fuel-cell-victory-6" :index 8 :parts 2 :command-list '()))
|
||||
((= v1-7 6) (new 'static 'spool-anim :name "fuel-cell-victory-7" :index 9 :parts 2 :command-list '()))
|
||||
((= v1-7 7) (new 'static 'spool-anim :name "fuel-cell-victory-8" :index 10 :parts 2 :command-list '()))
|
||||
((= v1-7 16) (new 'static 'spool-anim :name "fuel-cell-racer-victory-1" :index 40 :parts 2 :command-list '()))
|
||||
((= v1-7 32) (new 'static 'spool-anim :name "fuel-cell-flut-victory-1" :index 44 :parts 2 :command-list '()))
|
||||
(else (new 'static 'spool-anim :name "fuel-cell-victory-3" :index 5 :parts 2 :command-list '())))))
|
||||
|
||||
(defbehavior fuel-cell-animate fuel-cell ()
|
||||
(let* ((gp-0 self)
|
||||
@@ -1115,7 +1115,7 @@
|
||||
(set! (-> this actor-pause) #t)
|
||||
(set! (-> this notify-parent) #f)
|
||||
(set! (-> this fact) (new 'process 'fact-info this (pickup-type fuel-cell) (the-as float 0.0)))
|
||||
(initialize-skeleton this *fuel-cell-sg* ())
|
||||
(initialize-skeleton this *fuel-cell-sg* '())
|
||||
(set! (-> this base quad) (-> this root trans quad))
|
||||
(set! (-> this old-base quad) (-> this root trans quad))
|
||||
(set! (-> this part) (create-launch-control (-> *part-group-id-table* 63) this))
|
||||
@@ -1326,7 +1326,7 @@
|
||||
(set! (-> this actor-pause) #t)
|
||||
(set! (-> this notify-parent) #f)
|
||||
(set! (-> this fact) (new 'process 'fact-info this (pickup-type buzzer) (the-as float 0.0)))
|
||||
(initialize-skeleton this *buzzer-sg* ())
|
||||
(initialize-skeleton this *buzzer-sg* '())
|
||||
(set! (-> this part) (create-launch-control (-> *part-group-id-table* 65) this))
|
||||
(set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "buzzer" :fo-max 40) (-> this root trans)))
|
||||
(set! (-> this victory-anim) (fuel-cell-pick-anim this))
|
||||
@@ -1619,7 +1619,7 @@
|
||||
(if (not ((-> self block-func) (the-as vent (ppointer->process (-> self parent)))))
|
||||
(set-vector! (-> self offset-target) 0.0 0.0 0.0 1.0))
|
||||
(set! (-> self offset quad) (-> self offset-target quad))
|
||||
(initialize-skeleton self *ecovalve-sg* ())
|
||||
(initialize-skeleton self *ecovalve-sg* '())
|
||||
(move-to-point! (-> self root)
|
||||
(vector+! (new 'stack-no-clear 'vector) (-> (the-as process-drawable (-> self parent 0)) root trans) (-> self offset)))
|
||||
(go ecovalve-idle)
|
||||
|
||||
@@ -818,25 +818,25 @@
|
||||
(case (-> this look)
|
||||
(('iron)
|
||||
(set! (-> this root root-prim prim-core offense) (collide-offense normal-attack))
|
||||
(initialize-skeleton this *crate-iron-sg* ()))
|
||||
(initialize-skeleton this *crate-iron-sg* '()))
|
||||
(('steel)
|
||||
(set! (-> this root root-prim prim-core offense) (collide-offense indestructible))
|
||||
(initialize-skeleton this *crate-steel-sg* ()))
|
||||
(initialize-skeleton this *crate-steel-sg* '()))
|
||||
(('darkeco)
|
||||
(when (= (-> this fact pickup-type) (pickup-type eco-pill-random))
|
||||
(set! (-> this fact pickup-type) (pickup-type none))
|
||||
(set! (-> this fact pickup-amount) 0.0))
|
||||
(initialize-skeleton this *crate-darkeco-sg* ())
|
||||
(initialize-skeleton this *crate-darkeco-sg* '())
|
||||
(set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0)
|
||||
(set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0))
|
||||
(('barrel) (initialize-skeleton this *crate-barrel-sg* ()))
|
||||
(('barrel) (initialize-skeleton this *crate-barrel-sg* '()))
|
||||
(('bucket)
|
||||
(when (= (-> this fact pickup-type) (pickup-type eco-pill-random))
|
||||
(set! (-> this fact pickup-type) (pickup-type none))
|
||||
(set! (-> this fact pickup-amount) 0.0))
|
||||
(initialize-skeleton this *crate-bucket-sg* ()))
|
||||
((none) (initialize-skeleton this *crate-wood-sg* ()) (logior! (-> this draw status) (draw-status hidden)))
|
||||
(else (initialize-skeleton this *crate-wood-sg* ())))
|
||||
(initialize-skeleton this *crate-bucket-sg* '()))
|
||||
(('none) (initialize-skeleton this *crate-wood-sg* '()) (logior! (-> this draw status) (draw-status hidden)))
|
||||
(else (initialize-skeleton this *crate-wood-sg* '())))
|
||||
(cond
|
||||
((logtest? (fact-options indestructible) (-> this fact options))
|
||||
(set! (-> this root root-prim prim-core offense) (collide-offense indestructible)))
|
||||
@@ -976,7 +976,7 @@
|
||||
|
||||
(defmethod params-init ((this pickup-spawner) (arg0 entity))
|
||||
(let ((t9-0 (method-of-type crate params-init))) (t9-0 this arg0))
|
||||
(set! (-> this look) none)
|
||||
(set! (-> this look) 'none)
|
||||
(set! (-> this blocker) #f)
|
||||
(if (logtest? (-> this fact options) (fact-options vent-blocked))
|
||||
(set! (-> this blocker) (entity-actor-lookup (-> this entity) 'alt-actor 0)))
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
(joint-control-remap! (-> self skel)
|
||||
(-> self draw art-group)
|
||||
(-> (the-as process-drawable s5-0) draw art-group)
|
||||
()
|
||||
'()
|
||||
0
|
||||
arg3))
|
||||
(when arg2
|
||||
@@ -275,7 +275,7 @@
|
||||
(joint-control-remap! (-> self skel)
|
||||
(-> self draw art-group)
|
||||
(-> (the-as process-drawable gp-0) draw art-group)
|
||||
()
|
||||
'()
|
||||
0
|
||||
""))
|
||||
(do-joint-math! self))
|
||||
@@ -318,7 +318,7 @@
|
||||
(set! (-> self root) s4-2)))
|
||||
(else (set! (-> self root) (new 'process 'trsqv))))
|
||||
(set! (-> self root trans quad) (-> arg0 quad))
|
||||
(initialize-skeleton self arg2 ())
|
||||
(initialize-skeleton self arg2 '())
|
||||
(if (type-type? (-> self root type) collide-shape) (update-transforms! (the-as collide-shape (-> self root))))
|
||||
(set! (-> self shadow-backup) (-> self draw shadow))
|
||||
(set! (-> self new-trans-hook) nothing)
|
||||
@@ -669,8 +669,8 @@
|
||||
(set! (-> self callback) #f)
|
||||
(set! (-> self userdata) #f)
|
||||
(set-time! (-> self start-time))
|
||||
(set! (-> self script) ())
|
||||
(set! (-> self script-line) ())
|
||||
(set! (-> self script) '())
|
||||
(set! (-> self script-line) '())
|
||||
(set! (-> self script-func) #f)
|
||||
(set! (-> self message) #f)
|
||||
(set! (-> self border-value) #f)
|
||||
@@ -759,7 +759,7 @@
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(logclear! (-> this mask) (process-mask actor-pause))
|
||||
(format (clear *lev-string*) "med-res-~S~S" s4-1 (if (zero? s3-1) "" (* s3-1 8)))
|
||||
(initialize-skeleton-by-name this *lev-string* ())
|
||||
(initialize-skeleton-by-name this *lev-string* '())
|
||||
(logior! (-> this draw status) (draw-status do-not-check-distance))
|
||||
(if (nonzero? (-> this draw)) (go med-res-level-idle))))
|
||||
(none))
|
||||
|
||||
@@ -205,7 +205,7 @@
|
||||
(set! (-> this root) s4-0))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(logclear! (-> this mask) (process-mask actor-pause))
|
||||
(initialize-skeleton this *orb-cache-top-sg* ())
|
||||
(initialize-skeleton this *orb-cache-top-sg* '())
|
||||
(logior! (-> this skel status) (janim-status inited))
|
||||
(update-transforms! (-> this root))
|
||||
(baseplat-method-21 this)
|
||||
|
||||
@@ -286,7 +286,7 @@
|
||||
(none))
|
||||
|
||||
(defmethod plat-button-method-31 ((this plat-button))
|
||||
(initialize-skeleton this *plat-button-sg* ())
|
||||
(initialize-skeleton this *plat-button-sg* '())
|
||||
0
|
||||
(none))
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(let ((s4-0 (get-unlit-skel this))
|
||||
(s5-1 (get-lit-skel this)))
|
||||
(initialize-skeleton this s4-0 ())
|
||||
(initialize-skeleton this s4-0 '())
|
||||
(setup-lods! (-> this unlit-look) s4-0 (-> this draw art-group) (-> this entity))
|
||||
(setup-lods! (-> this lit-look) s5-1 (-> this draw art-group) (-> this entity)))
|
||||
(logclear! (-> this mask) (process-mask actor-pause))
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
(logior! (-> this mask) (process-mask platform))
|
||||
(baseplat-method-24 this)
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton this (get-unlit-skel this) ())
|
||||
(initialize-skeleton this (get-unlit-skel this) '())
|
||||
(logior! (-> this skel status) (janim-status inited))
|
||||
(update-transforms! (-> this root))
|
||||
(baseplat-method-21 this)
|
||||
|
||||
@@ -148,11 +148,11 @@
|
||||
- min = the start of the animation.
|
||||
- max = the end of the animation.
|
||||
"
|
||||
(let* ((num-args (if (pair? num!) (cdr num!) ()))
|
||||
(let* ((num-args (if (pair? num!) (cdr num!) '()))
|
||||
(num! (if (pair? num!) (car num!) num!))
|
||||
(nf (cond
|
||||
((or (eq? num! 'identity) (eq? num! 'min) (eq? num! 'max)) 'num-func-identity)
|
||||
((eq? num! none) 'num-func-none)
|
||||
((eq? num! 'none) 'num-func-none)
|
||||
((eq? num! '+!) 'num-func-+!)
|
||||
((eq? num! '-!) 'num-func--!)
|
||||
((eq? num! 'seek!) 'num-func-seek!)
|
||||
@@ -170,20 +170,20 @@
|
||||
1.0
|
||||
(if (eq? 'max (car num-args))
|
||||
(if group!
|
||||
`(the float (1 - (-> (the art-joint-anim ,group!) data 0 length)))
|
||||
`(the float (1 - (-> ja-ch frame-group data 0 length))))
|
||||
`(the float (1- (-> (the art-joint-anim ,group!) data 0 length)))
|
||||
`(the float (1- (-> ja-ch frame-group data 0 length))))
|
||||
(car num-args))))
|
||||
((eq? num! 'seek!)
|
||||
(if (or (null? num-args) (eq? (car num-args) 'max))
|
||||
(if group!
|
||||
`(the float (1 - (-> (the art-joint-anim ,group!) data 0 length)))
|
||||
`(the float (1 - (-> ja-ch frame-group data 0 length))))
|
||||
`(the float (1- (-> (the art-joint-anim ,group!) data 0 length)))
|
||||
`(the float (1- (-> ja-ch frame-group data 0 length))))
|
||||
(car num-args))))))
|
||||
(p1 (if param1 param1 (cond ((eq? num! 'seek!) (if (or (null? num-args) (null? (cdr num-args))) 1.0 (cadr num-args))))))
|
||||
(frame-num (if (eq? 'max frame-num)
|
||||
(if group!
|
||||
`(the float (1 - (-> (the art-joint-anim ,group!) data 0 length)))
|
||||
`(the float (1 - (-> ja-ch frame-group data 0 length))))
|
||||
`(the float (1- (-> (the art-joint-anim ,group!) data 0 length)))
|
||||
`(the float (1- (-> ja-ch frame-group data 0 length))))
|
||||
frame-num))
|
||||
(frame-group (if (or p0 p1 frame-num (not nf)) group! #f)))
|
||||
`(let ((ja-ch (-> self skel root-channel ,chan)))
|
||||
@@ -201,8 +201,8 @@
|
||||
((eq? num! 'min) `(set! (-> ja-ch frame-num) 0.0))
|
||||
((eq? num! 'max)
|
||||
(if group!
|
||||
`(set! (-> ja-ch frame-num) (the float (1 - (-> (the art-joint-anim ,group!) data 0 length))))
|
||||
`(set! (-> ja-ch frame-num) (the float (1 - (-> ja-ch frame-group data 0 length))))))
|
||||
`(set! (-> ja-ch frame-num) (the float (1- (-> (the art-joint-anim ,group!) data 0 length))))
|
||||
`(set! (-> ja-ch frame-num) (the float (1- (-> ja-ch frame-group data 0 length))))))
|
||||
((eq? num! 'identity) `(set! (-> ja-ch frame-num) ,(car num-args)))
|
||||
(#t `(none))))))
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
(vector-matrix*! arg0 arg2 (-> arg1 bone transform)))
|
||||
|
||||
(defun-debug cspace-children ((arg0 process-drawable) (arg1 int))
|
||||
(let ((a3-0 ()))
|
||||
(let ((a3-0 '()))
|
||||
(countdown (s4-0 (-> arg0 node-list length))
|
||||
(if (= (-> arg0 node-list data s4-0 parent) arg1) (set! a3-0 (cons (-> arg0 node-list data s4-0) a3-0))))
|
||||
a3-0))
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
(none))
|
||||
|
||||
(defmethod get-response ((this gui-query))
|
||||
(kill-current-level-hint () '(sidekick voicebox stinger) 'exit)
|
||||
(kill-current-level-hint '() '(sidekick voicebox stinger) 'exit)
|
||||
(level-hint-surpress!)
|
||||
(hide-hud)
|
||||
(when (hud-hidden?)
|
||||
@@ -554,7 +554,7 @@
|
||||
((or (= (-> self next-state name) 'dead-state) (= (-> self next-state name) 'idle))
|
||||
(process-entity-status! self (entity-perm-status bit-3) #f))
|
||||
(else
|
||||
(kill-current-level-hint () () 'exit)
|
||||
(kill-current-level-hint '() '() 'exit)
|
||||
(logior! (-> self skel status) (janim-status inited))
|
||||
(logclear! (-> self mask) (process-mask actor-pause))
|
||||
(process-entity-status! self (entity-perm-status bit-3) #t)
|
||||
@@ -591,7 +591,7 @@
|
||||
(task-status need-reminder)
|
||||
(task-status need-reminder-a)
|
||||
(task-status need-reward-speech))
|
||||
(kill-current-level-hint () '(sidekick voicebox ambient) 'exit)
|
||||
(kill-current-level-hint '() '(sidekick voicebox ambient) 'exit)
|
||||
(level-hint-surpress!)
|
||||
(hide-hud)
|
||||
(when (and (hud-hidden?) (can-grab-display? self))
|
||||
@@ -644,7 +644,7 @@
|
||||
(stack-size-set! (-> this main-thread) 512)
|
||||
(initialize-collision this arg2 arg4)
|
||||
(process-drawable-from-entity! this (the-as entity-actor arg0))
|
||||
(initialize-skeleton this arg1 ())
|
||||
(initialize-skeleton this arg1 '())
|
||||
(set! (-> this shadow-backup) (-> this draw shadow))
|
||||
(logior! (-> this skel status) (janim-status eye))
|
||||
;; og:preserve-this
|
||||
|
||||
@@ -900,7 +900,7 @@
|
||||
(alloc-riders a0-13 3))
|
||||
(add-collision-meshes this)
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton-by-name this (-> this subtype-name) ())
|
||||
(initialize-skeleton-by-name this (-> this subtype-name) '())
|
||||
(logior! (-> this skel status) (janim-status inited))
|
||||
(let ((v1-29 (-> this tuning)))
|
||||
(set! (-> this draw bounds w) (-> v1-29 view-frustum-radius))
|
||||
|
||||
@@ -488,7 +488,7 @@ nav-enemy-default-event-handler
|
||||
(backup-collide-with-as s4-0)
|
||||
(set! (-> this collide-info) s4-0))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton this *sharkey-sg* ())
|
||||
(initialize-skeleton this *sharkey-sg* '())
|
||||
(init-defaults! this *sharkey-nav-enemy-info*)
|
||||
(logclear! (-> this mask) (process-mask actor-pause))
|
||||
(set! (-> this water) (new 'process 'water-control this 3 12288.0 8192.0 2048.0))
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
(orig quaternion :inline)
|
||||
(dist-ratio float)
|
||||
(damping float)
|
||||
(1 -damping float))
|
||||
(1-damping float))
|
||||
(:methods
|
||||
(reset! (_type_ process-drawable float float) none)
|
||||
(tippy-method-10 (_type_ process-drawable vector) symbol)))
|
||||
@@ -27,7 +27,7 @@
|
||||
(quaternion-copy! (-> this orig) (-> arg0 root quat))
|
||||
(set! (-> this dist-ratio) arg1)
|
||||
(set! (-> this damping) arg2)
|
||||
(set! (-> this 1 -damping) (- 1.0 arg2))
|
||||
(set! (-> this 1-damping) (- 1.0 arg2))
|
||||
0
|
||||
(none))
|
||||
|
||||
@@ -43,13 +43,13 @@
|
||||
(let ((f0-6 (vector-length s3-0)))
|
||||
(vector-float*! s3-0 s3-0 (/ 1.0 f0-6))
|
||||
(let ((f30-0 (* f0-6 (-> this dist-ratio))))
|
||||
(set! (-> this axis x) (+ (* (-> this 1 -damping) (-> this axis x)) (* (-> this damping) (-> s3-0 x))))
|
||||
(set! (-> this axis x) (+ (* (-> this 1-damping) (-> this axis x)) (* (-> this damping) (-> s3-0 x))))
|
||||
(set! (-> this axis y) 0.0)
|
||||
(set! (-> this axis z) (+ (* (-> this 1 -damping) (-> this axis z)) (* (-> this damping) (-> s3-0 z))))
|
||||
(set! (-> this axis z) (+ (* (-> this 1-damping) (-> this axis z)) (* (-> this damping) (-> s3-0 z))))
|
||||
(vector-normalize! (-> this axis) 1.0)
|
||||
(set! (-> this angle) (+ (* (-> this 1 -damping) (-> this angle)) (* (-> this damping) f30-0)))))))
|
||||
(set! (-> this angle) (+ (* (-> this 1-damping) (-> this angle)) (* (-> this damping) f30-0)))))))
|
||||
(else
|
||||
(set! (-> this angle) (* (-> this 1 -damping) (-> this angle)))
|
||||
(set! (-> this angle) (* (-> this 1-damping) (-> this angle)))
|
||||
(when (< (-> this angle) 182.04445)
|
||||
(set! (-> this angle) 0.0)
|
||||
(set! s4-0 #f))))
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
(set! (-> self hint) arg1)
|
||||
(set! (-> self root trans quad) (-> arg0 quad))
|
||||
(set! (-> self base-trans quad) (-> arg0 quad))
|
||||
(initialize-skeleton self *voicebox-sg* ())
|
||||
(initialize-skeleton self *voicebox-sg* '())
|
||||
(set! (-> self blend) 1.0)
|
||||
(go-virtual enter)
|
||||
(none))
|
||||
|
||||
@@ -578,7 +578,7 @@
|
||||
(let ((s3-0 s4-0))
|
||||
(if (not (if (and (nonzero? s3-0) (type-type? (-> (the-as basic s3-0) type) skeleton-group)) s3-0))
|
||||
(go process-drawable-art-error "skel group")))
|
||||
(initialize-skeleton this (the-as skeleton-group s4-0) ()))
|
||||
(initialize-skeleton this (the-as skeleton-group s4-0) '()))
|
||||
(ja-channel-set! 1)
|
||||
(let ((s4-1 (-> this skel root-channel 0)))
|
||||
(joint-control-channel-group-eval! s4-1
|
||||
|
||||
@@ -290,7 +290,7 @@
|
||||
`(-> self node-list data (joint-node-index ,jg ,name)))
|
||||
|
||||
(defmacro defskelgroup (name art-name joint-geom joint-anim lods &key (shadow 0) &key bounds &key (longest-edge 0.0) &key (texture-level 0) &key (sort 0))
|
||||
"define a new static skeleton group."
|
||||
"define a new static skeleton group"
|
||||
`(let ((skel (new 'static
|
||||
'skeleton-group
|
||||
:art-group-name ,(symbol->string art-name)
|
||||
|
||||
@@ -93,7 +93,8 @@
|
||||
(defun-debug internal-draw-debug-line ((bucket bucket-id) (p0 vector) (p1 vector) (first-color rgba) (mode symbol) (second-color rgba))
|
||||
"Draw a debug line from p0 to p1. Mode can be:
|
||||
'fade, 'fade-depth, or #f.
|
||||
second-color can be -1 to just use the same color."
|
||||
second-color can be -1 to just use the same color.
|
||||
"
|
||||
(let ((a0-4 (-> (current-frame) debug-buf)))
|
||||
(if (< (the-as uint (shr (+ (&- (-> a0-4 end) (the-as uint (-> a0-4 base))) 15) 4)) (the-as uint #x8000))
|
||||
(return (the-as pointer #f))))
|
||||
@@ -123,7 +124,7 @@
|
||||
(gs-reg-list rgbaq xyzf2 rgbaq xyzf2))
|
||||
(case mode
|
||||
(('fade-depth)
|
||||
(let ((f0-3 (fminmax (* (1 / #xffffff) (the float (-> s4-0 vector 0 z))) 0.2 1.0)))
|
||||
(let ((f0-3 (fminmax (* (1/ #xffffff) (the float (-> s4-0 vector 0 z))) 0.2 1.0)))
|
||||
(set! (-> s1-0 vector 0 x) (the int (* (the float (-> first-color r)) f0-3)))
|
||||
(set! (-> s1-0 vector 0 y) (the int (* (the float (-> first-color g)) f0-3)))
|
||||
(set! (-> s1-0 vector 0 z) (the int (* (the float (-> first-color b)) f0-3))))
|
||||
@@ -135,7 +136,7 @@
|
||||
(set! (-> s1-0 vector 0 w) (the-as int (-> first-color a)))))
|
||||
(cond
|
||||
((= mode 'fade-depth)
|
||||
(let ((f0-7 (fminmax (* (1 / #xffffff) (the float (-> s4-0 vector 1 z))) 0.2 1.0)))
|
||||
(let ((f0-7 (fminmax (* (1/ #xffffff) (the float (-> s4-0 vector 1 z))) 0.2 1.0)))
|
||||
(set! (-> s1-0 vector 1 x) (the int (* (the float (-> second-color r)) f0-7)))
|
||||
(set! (-> s1-0 vector 1 y) (the int (* (the float (-> second-color g)) f0-7)))
|
||||
(set! (-> s1-0 vector 1 z) (the int (* (the float (-> second-color b)) f0-7))))
|
||||
@@ -179,10 +180,10 @@
|
||||
(when enable
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector))
|
||||
(s3-0 (vector-3pt-cross! (new 'stack-no-clear 'vector) p0 p1 p2)))
|
||||
(vector-float / ! s3-0 s3-0 (* (1 / METER_LENGTH) (vector-length s3-0)))
|
||||
(vector-float/! s3-0 s3-0 (* (1/ METER_LENGTH) (vector-length s3-0)))
|
||||
(vector+! s4-0 p0 p1)
|
||||
(vector+! s4-0 s4-0 p2)
|
||||
(vector-float / ! s4-0 s4-0 3.0)
|
||||
(vector-float/! s4-0 s4-0 3.0)
|
||||
(vector+! s3-0 s3-0 s4-0)
|
||||
(add-debug-line #t bucket s4-0 s3-0 color #f (the-as rgba -1))))
|
||||
#f)
|
||||
@@ -692,12 +693,12 @@
|
||||
(when (>= (-> arg0 h-first) (-> arg0 num-points))
|
||||
(set! (-> arg0 h-first) 0)))
|
||||
(when arg1
|
||||
(dotimes (s5-1 (1 - (-> arg0 num-points)))
|
||||
(dotimes (s5-1 (1- (-> arg0 num-points)))
|
||||
(if (!= (+ s5-1 1) (-> arg0 h-first))
|
||||
(add-debug-line #t
|
||||
(bucket-id debug-no-zbuf)
|
||||
(-> arg0 points s5-1)
|
||||
(-> arg0 points (1 + s5-1))
|
||||
(-> arg0 points (1+ s5-1))
|
||||
(static-rgba #x80 #xc0 #x80 #x80)
|
||||
#f
|
||||
(the-as rgba -1)))))
|
||||
|
||||
@@ -138,9 +138,9 @@
|
||||
(debug-dma 84) ;; maybe
|
||||
(sky-dma 85) ;; maybe
|
||||
(pris-generic)
|
||||
(4 k-dead-pool 87)
|
||||
(8 k-dead-pool 88)
|
||||
(16 k-dead-pool 89)
|
||||
(4k-dead-pool 87)
|
||||
(8k-dead-pool 88)
|
||||
(16k-dead-pool 89)
|
||||
(nk-dead-pool 90)
|
||||
(target-dead-pool 91)
|
||||
(camera-dead-pool 92)
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
(set! (-> v0-0 name) name)
|
||||
(set! (-> v0-0 parent) #f)
|
||||
(set! (-> v0-0 selected-item) #f)
|
||||
(set! (-> v0-0 items) ())
|
||||
(set! (-> v0-0 items) '())
|
||||
v0-0))
|
||||
|
||||
;; Parent type for an item (an individual, selectable entry within a menu)
|
||||
@@ -376,7 +376,7 @@
|
||||
(was-active (-> context is-active)))
|
||||
(if was-active (debug-menu-context-send-msg context (debug-menu-msg deactivate) (debug-menu-dest activation)))
|
||||
(set! (-> item parent) menu)
|
||||
(set! (-> menu items) (the-as pair (append! (-> menu items) (dcons item ())))) ;; was normal cons
|
||||
(set! (-> menu items) (the-as pair (append! (-> menu items) (dcons item '())))) ;; was normal cons
|
||||
(debug-menu-rebuild menu)
|
||||
(if was-active (debug-menu-context-send-msg context (debug-menu-msg activate) (debug-menu-dest activation))))
|
||||
item)
|
||||
@@ -386,7 +386,7 @@
|
||||
(let* ((gp-0 (-> arg0 context))
|
||||
(s4-0 (-> gp-0 is-active)))
|
||||
(if s4-0 (debug-menu-context-send-msg gp-0 (debug-menu-msg deactivate) (debug-menu-dest activation)))
|
||||
(set! (-> arg0 items) ())
|
||||
(set! (-> arg0 items) '())
|
||||
(set! (-> arg0 selected-item) #f)
|
||||
(debug-menu-rebuild arg0)
|
||||
(if s4-0 (debug-menu-context-send-msg gp-0 (debug-menu-msg activate) (debug-menu-dest activation))))
|
||||
@@ -545,11 +545,11 @@
|
||||
(cond
|
||||
((> (-> item hilite-timer) 0)
|
||||
;; if the hilite is >0, we ran the function successfully, so we hilite in blue for a bit
|
||||
(1 -! (-> item hilite-timer))
|
||||
(1-! (-> item hilite-timer))
|
||||
(font-color menu-selected))
|
||||
((< (-> item hilite-timer) 0)
|
||||
;; if we're negative, it failed, so hilite in red
|
||||
(1 +! (-> item hilite-timer))
|
||||
(1+! (-> item hilite-timer))
|
||||
(font-color menu-func-bad))
|
||||
((nonzero? submenus)
|
||||
;; in a parent menu
|
||||
@@ -706,8 +706,8 @@
|
||||
;; search for the currently selected thing.
|
||||
(let ((s5-0 (-> arg0 sel-menu (+ (-> arg0 sel-length) -1))))
|
||||
(let ((a2-0 (-> s5-0 selected-item))
|
||||
(a0-1 ()) ;; thing before selection
|
||||
(v1-4 ()) ;; current selection
|
||||
(a0-1 '()) ;; thing before selection
|
||||
(v1-4 '()) ;; current selection
|
||||
)
|
||||
(let ((a3-0 (-> s5-0 items)))
|
||||
(while (not (null? a3-0))
|
||||
|
||||
@@ -56,21 +56,21 @@
|
||||
(when (nonzero? (-> this ctrl))
|
||||
(set! *pc-perf-stat-counter* (get-cpu-clock)))
|
||||
#|
|
||||
(let ((v1-0 (-> this ctrl)))
|
||||
(+! (-> this count) 1)
|
||||
(b! (zero? v1-0) cfg-2 :delay (nop!))
|
||||
(.mtc0 Perf 0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtpc pcr0 0)
|
||||
(.mtpc pcr1 0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtc0 Perf v1-0)
|
||||
)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(label cfg-2)
|
||||
(let ((v1-0 (-> this ctrl)))
|
||||
(+! (-> this count) 1)
|
||||
(b! (zero? v1-0) cfg-2 :delay (nop!))
|
||||
(.mtc0 Perf 0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtpc pcr0 0)
|
||||
(.mtpc pcr1 0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtc0 Perf v1-0)
|
||||
)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(label cfg-2)
|
||||
|#
|
||||
0
|
||||
(none))
|
||||
@@ -81,16 +81,16 @@
|
||||
(+! (-> this accum0) (- (get-cpu-clock) *pc-perf-stat-counter*))
|
||||
(set! (-> this accum1) 0))
|
||||
#|
|
||||
(local-vars (v1-1 int) (v1-3 int))
|
||||
(b! (zero? (-> this ctrl)) cfg-2 :delay (nop!))
|
||||
(.mtc0 Perf 0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mfpc v1-1 pcr0)
|
||||
(+! (-> this accum0) v1-1)
|
||||
(.mfpc v1-3 pcr1)
|
||||
(+! (-> this accum1) v1-3)
|
||||
(label cfg-2)
|
||||
(local-vars (v1-1 int) (v1-3 int))
|
||||
(b! (zero? (-> this ctrl)) cfg-2 :delay (nop!))
|
||||
(.mtc0 Perf 0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mfpc v1-1 pcr0)
|
||||
(+! (-> this accum0) v1-1)
|
||||
(.mfpc v1-3 pcr1)
|
||||
(+! (-> this accum1) v1-3)
|
||||
(label cfg-2)
|
||||
|#
|
||||
0
|
||||
(none))
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
(set! (-> a1-3 jgeo) s3-0)
|
||||
(set! (-> a1-3 janim) s5-0)
|
||||
(set! (-> a1-3 mgeo 0) s4-0)
|
||||
(initialize-skeleton self a1-3 ()))
|
||||
(initialize-skeleton self a1-3 '()))
|
||||
(set! (-> self align) (new 'process 'align-control self))
|
||||
(go viewer-process))
|
||||
(else (go process-drawable-art-error arg0)))))
|
||||
|
||||
@@ -264,7 +264,7 @@
|
||||
(-> s4-0 (+ (shl s2-0 2) 2))
|
||||
(-> s4-0 (+ (shl s2-0 2) 3)))
|
||||
(set! s3-0 (+ s3-0 1)))
|
||||
#f)
|
||||
'#f)
|
||||
|
||||
;; if we send junk DMA data due to an engine bug, the PS2 will eventually time out the transfer.
|
||||
;; in this case, the main loop will attempt to reset everything to hopefully recover.
|
||||
|
||||
@@ -116,13 +116,13 @@
|
||||
;; todo
|
||||
#t
|
||||
#|
|
||||
(let* ((addr (scratchpad-ptr int8 :offset (+ #x3b80 (/ id 8)))) ;; address of the vis data
|
||||
(vis-byte (-> addr 0)) ;; vis byte
|
||||
(shift-amount (+ 56 (logand id 7)))
|
||||
(shifted (shl vis-byte shift-amount))
|
||||
)
|
||||
(< shifted 0)
|
||||
)
|
||||
(let* ((addr (scratchpad-ptr int8 :offset (+ #x3b80 (/ id 8)))) ;; address of the vis data
|
||||
(vis-byte (-> addr 0)) ;; vis byte
|
||||
(shift-amount (+ 56 (logand id 7)))
|
||||
(shifted (shl vis-byte shift-amount))
|
||||
)
|
||||
(< shifted 0)
|
||||
)
|
||||
|#
|
||||
)
|
||||
|
||||
@@ -989,9 +989,9 @@
|
||||
(#when PC_PORT
|
||||
(if (< float-time-ratio 1.3) (set! time-ratio 1.0))
|
||||
#|
|
||||
(if (> time-ratio 1.)
|
||||
(format #t "LAG ~f frames~%" (- time-ratio 1.))
|
||||
)
|
||||
(if (> time-ratio 1.)
|
||||
(format #t "LAG ~f frames~%" (- time-ratio 1.))
|
||||
)
|
||||
|#
|
||||
))
|
||||
;; inform display system of our speed. This will adjust the scaling used in all physics calculations
|
||||
|
||||
@@ -133,14 +133,14 @@
|
||||
(if (< (the-as uint 1) (the-as uint arg4)) (close-specific-task! arg4 (task-status need-hint)))
|
||||
(let ((s3-1 (level-hint-task-process arg2 (the-as uint128 arg0) arg1)))
|
||||
(when (!= s3-1 -1)
|
||||
(kill-current-level-hint () () 'exit)
|
||||
(kill-current-level-hint '() '() 'exit)
|
||||
(process-spawn level-hint s3-1 arg1 arg2 :to arg3)))
|
||||
0
|
||||
(none))
|
||||
|
||||
(defun ambient-hint-spawn ((arg0 string) (arg1 vector) (arg2 process-tree) (arg3 symbol))
|
||||
(case arg3
|
||||
(('camera) (kill-current-level-hint () () 'exit)))
|
||||
(('camera) (kill-current-level-hint '() '() 'exit)))
|
||||
(and (not *hint-semaphore*) (process-spawn level-hint :init ambient-hint-init-by-other arg0 arg1 arg3 :to arg2)))
|
||||
|
||||
(defun kill-current-level-hint ((arg0 pair) (arg1 pair) (arg2 symbol))
|
||||
@@ -417,7 +417,7 @@
|
||||
(let ((v1-6 a1-3)) (set! (-> v1-6 height) (the float 96)))
|
||||
(set! (-> a1-3 flags) (font-flags shadow kerning middle large))
|
||||
(print-game-text "AS: UNKNOWN ID" a1-3 #f 128 22))))
|
||||
((!= s5-0 -1) (kill-current-level-hint () () 'exit) (process-spawn level-hint s5-0 #f (-> arg0 ambient) :to pp))))
|
||||
((!= s5-0 -1) (kill-current-level-hint '() '() 'exit) (process-spawn level-hint s5-0 #f (-> arg0 ambient) :to pp))))
|
||||
0
|
||||
(none)))
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
(type-ref sage-finalboss :method-count 53)
|
||||
:package "l1"
|
||||
:art-group
|
||||
()
|
||||
'()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x8000)
|
||||
(new 'static
|
||||
@@ -41,7 +41,7 @@
|
||||
(type-ref robotboss :method-count 21)
|
||||
:package "l1"
|
||||
:art-group
|
||||
()
|
||||
'()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x8000)
|
||||
(new 'static
|
||||
@@ -50,7 +50,7 @@
|
||||
(type-ref assistant-levitator :method-count 53)
|
||||
:package "l1"
|
||||
:art-group
|
||||
()
|
||||
'()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x8000)
|
||||
(new 'static
|
||||
@@ -86,7 +86,7 @@
|
||||
(type-ref launcher :method-count 20)
|
||||
:package "game"
|
||||
:art-group
|
||||
()
|
||||
'()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x400)
|
||||
(new 'static
|
||||
@@ -95,7 +95,7 @@
|
||||
(type-ref pickup-spawner :method-count 30)
|
||||
:package "game"
|
||||
:art-group
|
||||
()
|
||||
'()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #xc00)
|
||||
(new 'static
|
||||
@@ -104,7 +104,7 @@
|
||||
(type-ref bucket :method-count 30)
|
||||
:package "game"
|
||||
:art-group
|
||||
()
|
||||
'()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #xc00)
|
||||
(new 'static
|
||||
@@ -113,7 +113,7 @@
|
||||
(type-ref barrel :method-count 30)
|
||||
:package "game"
|
||||
:art-group
|
||||
()
|
||||
'()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #xc00)
|
||||
(new 'static
|
||||
@@ -122,7 +122,7 @@
|
||||
(type-ref crate :method-count 30)
|
||||
:package "game"
|
||||
:art-group
|
||||
()
|
||||
'()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #xc00)
|
||||
(new 'static
|
||||
@@ -140,7 +140,7 @@
|
||||
(type-ref eco :method-count 31)
|
||||
:package "game"
|
||||
:art-group
|
||||
()
|
||||
'()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x1000)
|
||||
(new 'static
|
||||
@@ -149,7 +149,7 @@
|
||||
(type-ref ecovent :method-count 21)
|
||||
:package "game"
|
||||
:art-group
|
||||
()
|
||||
'()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x1000)
|
||||
(new 'static
|
||||
@@ -158,7 +158,7 @@
|
||||
(type-ref fuel-cell :method-count 31)
|
||||
:package "game"
|
||||
:art-group
|
||||
()
|
||||
'()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x1400)
|
||||
(new 'static
|
||||
@@ -167,7 +167,7 @@
|
||||
(type-ref buzzer :method-count 31)
|
||||
:package "game"
|
||||
:art-group
|
||||
()
|
||||
'()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x1000)
|
||||
(new 'static
|
||||
@@ -176,7 +176,7 @@
|
||||
(type-ref money :method-count 31)
|
||||
:package "game"
|
||||
:art-group
|
||||
()
|
||||
'()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #xc00
|
||||
;; og:preserve-this CHANGED from 2k!!
|
||||
@@ -187,7 +187,7 @@
|
||||
(type-ref water-vol :method-count 30)
|
||||
:package "game"
|
||||
:art-group
|
||||
()
|
||||
'()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #xc00)
|
||||
(new 'static
|
||||
@@ -196,7 +196,7 @@
|
||||
(type-ref target-start :method-count 15)
|
||||
:package "game"
|
||||
:art-group
|
||||
()
|
||||
'()
|
||||
:pool '*16k-dead-pool*
|
||||
:heap-size #x400)))
|
||||
|
||||
|
||||
@@ -736,21 +736,21 @@
|
||||
(none))
|
||||
*null-kernel-context*))
|
||||
#|
|
||||
This is where the "actor graph" is drawn, but the plot functions don't do anything.
|
||||
(when (and *display-actor-graph* (not (or (= *master-mode* 'menu) (= *master-mode* 'progress))))
|
||||
(if (not (paused?))
|
||||
(float-save-timeplot (if (< (the int (the float (mod (-> *display* base-frame-counter) 600))) 300)
|
||||
1.0
|
||||
0.0
|
||||
)
|
||||
)
|
||||
)
|
||||
(camera-plot-float-func 0.0 399.0 -81920.0 81920.0 float-lookup-redline (new 'static 'vector4w :x #xff :w #x80))
|
||||
(camera-plot-float-func 0.0 399.0 -81920.0 81920.0 float-lookup-blueline (new 'static 'vector4w :z #xff :w #x80))
|
||||
(camera-plot-float-func 0.0 399.0 -81920.0 81920.0 float-lookup-greenline (new 'static 'vector4w :y #xff :w #x80))
|
||||
(camera-plot-float-func 0.0 399.0 0.0 409600.0 float-lookup-yellowline (new 'static 'vector4w :x #xff :y #xff :w #x80))
|
||||
(camera-plot-float-func 0.0 399.0 0.0 1.0 float-lookup-timeplot (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80))
|
||||
)
|
||||
This is where the "actor graph" is drawn, but the plot functions don't do anything.
|
||||
(when (and *display-actor-graph* (not (or (= *master-mode* 'menu) (= *master-mode* 'progress))))
|
||||
(if (not (paused?))
|
||||
(float-save-timeplot (if (< (the int (the float (mod (-> *display* base-frame-counter) 600))) 300)
|
||||
1.0
|
||||
0.0
|
||||
)
|
||||
)
|
||||
)
|
||||
(camera-plot-float-func 0.0 399.0 -81920.0 81920.0 float-lookup-redline (new 'static 'vector4w :x #xff :w #x80))
|
||||
(camera-plot-float-func 0.0 399.0 -81920.0 81920.0 float-lookup-blueline (new 'static 'vector4w :z #xff :w #x80))
|
||||
(camera-plot-float-func 0.0 399.0 -81920.0 81920.0 float-lookup-greenline (new 'static 'vector4w :y #xff :w #x80))
|
||||
(camera-plot-float-func 0.0 399.0 0.0 409600.0 float-lookup-yellowline (new 'static 'vector4w :x #xff :y #xff :w #x80))
|
||||
(camera-plot-float-func 0.0 399.0 0.0 1.0 float-lookup-timeplot (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80))
|
||||
)
|
||||
|#
|
||||
(when *display-split-boxes*
|
||||
(dotimes (s5-4 (-> this length))
|
||||
|
||||
@@ -10,28 +10,28 @@
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
#|
|
||||
res is a generic storage system for not very large data, used mostly for the game entities.
|
||||
These res files store collections of data, which can be as values (int8, int16, int32, int64, uint8, uint16, uint32, uint64, float, vector), or any structure (as references), which are tagged and identified with a res-tag.
|
||||
The data is stored similar to an unboxed inline-array, the type of the data is stored in the res-tag.
|
||||
|
||||
A res-lump stores and is used to access all of the data for a single "resource", a collection of varying data.
|
||||
This is similar to a C++ map or C# dictionary. The key is a res-tag and the value is the corresponding binary data.
|
||||
|
||||
A res-tag is a tag that contains information about a particular property of this resource, such as type, name, and amount of elements.
|
||||
For example, information about an array of vectors that make up a path - for a moving platform - or an integer to store its entity ID.
|
||||
|
||||
Keyframes are used to specify when/where the data is relevant.
|
||||
For example (this is made-up), say you have a camera spline, and you want the FOV to change at three specific points:
|
||||
when it starts, somewhere in the middle, and at the end.
|
||||
You would store an array of three FOV values. The key-frame field could then be used to say at which point in the spline
|
||||
the FOV should be at that value. If the camera is somewhere between those points, the result could then be interpolated.
|
||||
|
||||
Properties are looked up from a res-lump using their name (a symbol).
|
||||
You can look up the data of the property you want directly using the various get-property methods.
|
||||
Curves can be quickly filled in using the get-curve-data! method.
|
||||
|
||||
|
||||
This is updated from the entity system used in Crash 2, which had most of these features and worked very similarly!
|
||||
res is a generic storage system for not very large data, used mostly for the game entities.
|
||||
These res files store collections of data, which can be as values (int8, int16, int32, int64, uint8, uint16, uint32, uint64, float, vector), or any structure (as references), which are tagged and identified with a res-tag.
|
||||
The data is stored similar to an unboxed inline-array, the type of the data is stored in the res-tag.
|
||||
|
||||
A res-lump stores and is used to access all of the data for a single "resource", a collection of varying data.
|
||||
This is similar to a C++ map or C# dictionary. The key is a res-tag and the value is the corresponding binary data.
|
||||
|
||||
A res-tag is a tag that contains information about a particular property of this resource, such as type, name, and amount of elements.
|
||||
For example, information about an array of vectors that make up a path - for a moving platform - or an integer to store its entity ID.
|
||||
|
||||
Keyframes are used to specify when/where the data is relevant.
|
||||
For example (this is made-up), say you have a camera spline, and you want the FOV to change at three specific points:
|
||||
when it starts, somewhere in the middle, and at the end.
|
||||
You would store an array of three FOV values. The key-frame field could then be used to say at which point in the spline
|
||||
the FOV should be at that value. If the camera is somewhere between those points, the result could then be interpolated.
|
||||
|
||||
Properties are looked up from a res-lump using their name (a symbol).
|
||||
You can look up the data of the property you want directly using the various get-property methods.
|
||||
Curves can be quickly filled in using the get-curve-data! method.
|
||||
|
||||
|
||||
This is updated from the entity system used in Crash 2, which had most of these features and worked very similarly!
|
||||
|#
|
||||
|
||||
(defmacro res-ref? (tag)
|
||||
@@ -78,7 +78,7 @@
|
||||
"Allocate a new res-lump."
|
||||
(let ((this (object-new allocation
|
||||
type-to-make
|
||||
(the int (+ (-> type-to-make size) (* (1 - data-count) (size-of res-tag)) data-size)))))
|
||||
(the int (+ (-> type-to-make size) (* (1- data-count) (size-of res-tag)) data-size)))))
|
||||
(set! (-> this allocated-length) data-count)
|
||||
(set! (-> this data-size) data-size)
|
||||
(set! (-> this length) 0)
|
||||
@@ -380,14 +380,14 @@
|
||||
(tag-stop (+ (-> this length) -2)))
|
||||
(while (>= tag-stop i)
|
||||
(let* ((tag1 (-> this tag i))
|
||||
(tag2 (-> this tag (1 + i)))
|
||||
(tag2 (-> this tag (1+ i)))
|
||||
(tag-name1 (deref uint64 (-> (symbol->string (-> tag1 name)) data)))
|
||||
(tag-name2 (deref uint64 (-> (symbol->string (-> tag2 name)) data))))
|
||||
(when (or (< tag-name2 tag-name1) (and (= tag-name1 tag-name2) (< (-> tag2 key-frame) (-> tag1 key-frame))))
|
||||
(1 +! tags-sorted)
|
||||
(1+! tags-sorted)
|
||||
(set! (-> this tag i) tag2)
|
||||
(set! (-> this tag (1 + i)) tag1)))
|
||||
(1 +! i)))))
|
||||
(set! (-> this tag (1+ i)) tag1)))
|
||||
(1+! i)))))
|
||||
this)
|
||||
|
||||
(defmethod allocate-data-memory-for-tag! ((this res-lump) (arg0 res-tag))
|
||||
@@ -479,13 +479,13 @@
|
||||
(set! (-> arg0 inlined?) 1)
|
||||
(add-data! this arg0 (& arg1)) ;; note, only 32-bits are spilled to the stack here.
|
||||
#|
|
||||
(local-vars (sv-16 object))
|
||||
(set! sv-16 arg1)
|
||||
(let* ((v1-0 arg0)
|
||||
(a1-4 (copy-and-set-bf v1-0 :inlined? 1))
|
||||
)
|
||||
(add-data! this a1-4 (& sv-16))
|
||||
)
|
||||
(local-vars (sv-16 object))
|
||||
(set! sv-16 arg1)
|
||||
(let* ((v1-0 arg0)
|
||||
(a1-4 (copy-and-set-bf v1-0 :inlined? 1))
|
||||
)
|
||||
(add-data! this a1-4 (& sv-16))
|
||||
)
|
||||
|#
|
||||
)
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
:camera-trans
|
||||
(new 'static 'vector :w 1.0)
|
||||
:load-commands
|
||||
()
|
||||
'()
|
||||
:vis-nick #f
|
||||
:lev0 #f
|
||||
:disp0 #f
|
||||
@@ -171,7 +171,7 @@
|
||||
;; not in play mode, we're done.
|
||||
(set! this this)
|
||||
(goto cfg-50)))))
|
||||
(kill-current-level-hint () () 'die)
|
||||
(kill-current-level-hint '() '() 'die)
|
||||
(case cause
|
||||
(('game)
|
||||
;; we are doing a full restart.
|
||||
|
||||
@@ -255,20 +255,20 @@
|
||||
(cheats-sound-play *cheat-mode*)))
|
||||
;; language cheat, REMOVED IN PC PORT because it's literally useless
|
||||
#|
|
||||
(case (scf-get-territory)
|
||||
;; japan-only
|
||||
((GAME_TERRITORY_SCEI)
|
||||
(check-cheat-code (-> *cheat-temp* 2) 0
|
||||
(l1 r1 l1 r1 triangle circle x square)
|
||||
(cpad-clear! 0 r1)
|
||||
(set! *progress-cheat* (if *progress-cheat*
|
||||
#f
|
||||
'language
|
||||
))
|
||||
(cheats-sound-play *progress-cheat*)
|
||||
)
|
||||
)
|
||||
)
|
||||
(case (scf-get-territory)
|
||||
;; japan-only
|
||||
((GAME_TERRITORY_SCEI)
|
||||
(check-cheat-code (-> *cheat-temp* 2) 0
|
||||
(l1 r1 l1 r1 triangle circle x square)
|
||||
(cpad-clear! 0 r1)
|
||||
(set! *progress-cheat* (if *progress-cheat*
|
||||
#f
|
||||
'language
|
||||
))
|
||||
(cheats-sound-play *progress-cheat*)
|
||||
)
|
||||
)
|
||||
)
|
||||
|#
|
||||
;; debug only PAL cheat
|
||||
(when *debug-segment*
|
||||
|
||||
@@ -260,14 +260,14 @@
|
||||
(b! (zero? a0-76) cfg-28 :delay (nop!))
|
||||
(set! *pc-perf-stat-counter* (get-cpu-clock)) ;; patched
|
||||
#|
|
||||
(.mtc0 Perf 0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtpc pcr0 0)
|
||||
(.mtpc pcr1 0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtc0 Perf a0-76)
|
||||
(.mtc0 Perf 0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtpc pcr0 0)
|
||||
(.mtpc pcr1 0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtc0 Perf a0-76)
|
||||
|#
|
||||
)
|
||||
(.sync.l)
|
||||
|
||||
@@ -701,7 +701,7 @@
|
||||
(when (< v1-54 (the-as uint 10))
|
||||
(set! (-> s5-3 blink) (-> *eye-work* blink-table v1-54))
|
||||
(if (zero? v1-54)
|
||||
(set! (-> s5-3 random-time) (the-as uint (the int (* (1 / DISPLAY_FPS_RATIO) (rand-vu-float-range 60.0 240.0)))))))))))
|
||||
(set! (-> s5-3 random-time) (the-as uint (the int (* (1/ DISPLAY_FPS_RATIO) (rand-vu-float-range 60.0 240.0)))))))))))
|
||||
;; pick between level and common eyes
|
||||
(cond
|
||||
((>= (the-as uint 1) (-> s5-3 level))
|
||||
|
||||
@@ -597,25 +597,25 @@
|
||||
(let ((reg-count (length reg-ids)))
|
||||
(when (> (length reg-ids) 16)
|
||||
(ferror "too many regs passed to gs-reg-list"))
|
||||
(let ((list-to-splice ())
|
||||
(let ((list-to-splice '())
|
||||
(cur-lst reg-ids)
|
||||
(i -1))
|
||||
;; this is questionable.
|
||||
(while (and (not (null? cur-lst)) (< i 15))
|
||||
(push! list-to-splice (cons 'gif-reg-id (cons (car cur-lst) ())))
|
||||
(push! list-to-splice (cons 'gif-reg-id (cons (car cur-lst) '())))
|
||||
(push! list-to-splice (string->symbol-format ":regs{}" (inc! i)))
|
||||
(pop! cur-lst))
|
||||
`(new 'static 'gif-tag-regs ,@list-to-splice))
|
||||
#|
|
||||
;; the opengoal compiler does not have enough constant propagation for this for now
|
||||
(let ((i -1))
|
||||
|
||||
`(the-as gif-tag-regs (logior ,@(apply (lambda (x)
|
||||
`(shl (the-as uint (gif-reg-id ,x)) ,(* 4 (inc! i)))
|
||||
) reg-ids)
|
||||
))
|
||||
|
||||
)
|
||||
;; the opengoal compiler does not have enough constant propagation for this for now
|
||||
(let ((i -1))
|
||||
|
||||
`(the-as gif-tag-regs (logior ,@(apply (lambda (x)
|
||||
`(shl (the-as uint (gif-reg-id ,x)) ,(* 4 (inc! i)))
|
||||
) reg-ids)
|
||||
))
|
||||
|
||||
)
|
||||
|#
|
||||
))
|
||||
|
||||
|
||||
@@ -59,8 +59,8 @@
|
||||
;; the x/y ratio are frustum slopes
|
||||
(set! (-> math-cam x-ratio) (tan (* 0.5 (-> math-cam fov))))
|
||||
(if (= aspect 'aspect4x3)
|
||||
(set! (-> math-cam y-ratio) (* (1 / ASPECT_4X3) (-> math-cam x-ratio)))
|
||||
(set! (-> math-cam y-ratio) (* (1 / ASPECT_16X9) (-> math-cam x-ratio))))
|
||||
(set! (-> math-cam y-ratio) (* (1/ ASPECT_4X3) (-> math-cam x-ratio)))
|
||||
(set! (-> math-cam y-ratio) (* (1/ ASPECT_16X9) (-> math-cam x-ratio))))
|
||||
(with-pc
|
||||
(cond
|
||||
((-> *pc-settings* use-vis?)
|
||||
@@ -71,14 +71,14 @@
|
||||
((real-movie?)
|
||||
;; force the original 16x9 cropping during cutscenes.
|
||||
(if (<= (-> *pc-settings* aspect-ratio) ASPECT_16X9)
|
||||
(set! (-> math-cam y-ratio) (* (1 / (-> *pc-settings* aspect-ratio)) (-> math-cam x-ratio)))
|
||||
(set! (-> math-cam y-ratio) (* (1/ (-> *pc-settings* aspect-ratio)) (-> math-cam x-ratio)))
|
||||
(begin
|
||||
(set! (-> math-cam y-ratio) (* (1 / ASPECT_16X9) (-> math-cam x-ratio)))
|
||||
(set! (-> math-cam y-ratio) (* (1/ ASPECT_16X9) (-> math-cam x-ratio)))
|
||||
(*! (-> math-cam x-ratio) (/ (-> *pc-settings* aspect-ratio) ASPECT_16X9)))))
|
||||
(else
|
||||
;; not using game vis, allow *extended* aspect ratios
|
||||
;; there is no vertical cropping, and you can see more of the sides
|
||||
(set! (-> math-cam y-ratio) (* (1 / ASPECT_4X3) (-> math-cam x-ratio))) ;; same cropping as 4x3
|
||||
(set! (-> math-cam y-ratio) (* (1/ ASPECT_4X3) (-> math-cam x-ratio))) ;; same cropping as 4x3
|
||||
(*! (-> math-cam x-ratio) (/ (-> *pc-settings* aspect-ratio) ASPECT_4X3)) ;; extend fov! shows more on the sides.
|
||||
)))
|
||||
;; compute some culling constants. Not sure what these mean yet
|
||||
@@ -182,7 +182,7 @@
|
||||
;; cheating this by 1 bit seems to fix it.
|
||||
(#when PC_PORT
|
||||
;; #x4b002032 -> #x4b002031
|
||||
(set! (-> math-cam isometric vector 3 z) (the-as float (1 - (the-as int (-> math-cam isometric vector 3 z)))))
|
||||
(set! (-> math-cam isometric vector 3 z) (the-as float (1- (the-as int (-> math-cam isometric vector 3 z)))))
|
||||
;; also do mirror game check here.
|
||||
(when (pc-cheats? (-> *pc-settings* cheats) mirror)
|
||||
(*! (-> math-cam perspective vector 0 x) -1.))))
|
||||
|
||||
@@ -528,7 +528,7 @@
|
||||
(when (= (-> a0-3 status) 'active)
|
||||
(let ((a1-3 (-> a0-3 info ocean)))
|
||||
(cond
|
||||
((= a1-3 none)
|
||||
((= a1-3 'none)
|
||||
(when (and (-> a0-3 meta-inside?) (not (-> a0-3 other meta-inside?)))
|
||||
(set! *ocean-map* #f)
|
||||
(goto cfg-19)))
|
||||
|
||||
@@ -123,16 +123,17 @@
|
||||
;; it seems like the first definition is not used.
|
||||
;; The OpenGOAL compiler doesn't like this, so this is commented out.
|
||||
#|
|
||||
(deftype shadow-edge (structure)
|
||||
((ind-0 uint16 :offset-assert 0)
|
||||
(ind-1 uint16 :offset-assert 2)
|
||||
(tri-0 uint16 :offset-assert 4)
|
||||
(tri-1 uint16 :offset-assert 6)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x4
|
||||
:flag-assert #x900000004
|
||||
)
|
||||
;; shadow-cpu-h
|
||||
; (deftype shadow-edge (structure) ;
|
||||
; ((ind-0 uint16 :offset-assert 0) ;
|
||||
; (ind-1 uint16 :offset-assert 2) ;
|
||||
; (tri-0 uint16 :offset-assert 4) ;
|
||||
; (tri-1 uint16 :offset-assert 6) ;
|
||||
; ) ;
|
||||
; :method-count-assert 9 ;
|
||||
; :size-assert #x4 ;
|
||||
; :flag-assert #x900000004 ;
|
||||
; ) ;
|
||||
|#
|
||||
|
||||
(deftype shadow-tri (structure)
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
(spt-anim 2)
|
||||
(spt-anim-speed 3)
|
||||
(spt-birth-func 4)
|
||||
(spt-joint / refpoint 5)
|
||||
(spt-joint/refpoint 5)
|
||||
(spt-num 6)
|
||||
(spt-sound 7)
|
||||
(misc-fields-end 8)
|
||||
@@ -320,8 +320,8 @@
|
||||
(field-name (string->symbol (string-substr head 1 0)))
|
||||
(field-lookup (hash-table-try-ref *sparticle-fields* field-name))
|
||||
(field (cdr field-lookup))
|
||||
(store? (member :store params))
|
||||
(param-count (if store? (1 - (length params)) (length params))))
|
||||
(store? (member ':store params))
|
||||
(param-count (if store? (1- (length params)) (length params))))
|
||||
(when (not (car field-lookup))
|
||||
(fmt #t "unknown sparticle field {}\n" x))
|
||||
(when (neq? (string-ref head 0) #\:)
|
||||
@@ -350,8 +350,8 @@
|
||||
`(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :initial-value ,param0 :flags (sp-flag launcher)))
|
||||
((eq? field-name 'sound)
|
||||
`(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :sound ,param0 :flags (sp-flag object)))
|
||||
((and (= 2 param-count) (symbol? param0) (eq? param0 :copy))
|
||||
(let* ((other-field-lookup (hash-table-try-ref *sparticle-fields* (cadr (member :copy params))))
|
||||
((and (= 2 param-count) (symbol? param0) (eq? param0 ':copy))
|
||||
(let* ((other-field-lookup (hash-table-try-ref *sparticle-fields* (cadr (member ':copy params))))
|
||||
(other-field (cdr other-field-lookup))
|
||||
(other-field-id (car other-field)))
|
||||
(when (>= other-field-id field-id)
|
||||
@@ -365,13 +365,13 @@
|
||||
:flags (sp-flag copy-from-other)
|
||||
:initial-value ,(- other-field-id field-id)
|
||||
:random-mult 1)))
|
||||
((and (= 2 param-count) (symbol? param0) (eq? param0 :data))
|
||||
((and (= 2 param-count) (symbol? param0) (eq? param0 ':data))
|
||||
`(new 'static
|
||||
'sp-field-init-spec
|
||||
:field (sp-field-id ,field-enum-name)
|
||||
:flags (sp-flag object)
|
||||
:object
|
||||
,(cadr (member :data params))))
|
||||
,(cadr (member ':data params))))
|
||||
((and (= 1 param-count) (param-symbol? param0))
|
||||
`(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :flags (sp-flag symbol) :sym ,param0))
|
||||
((and (= 1 param-count) (param-float? param0))
|
||||
@@ -453,6 +453,6 @@
|
||||
(new 'static
|
||||
'inline-array
|
||||
sp-field-init-spec
|
||||
,(1 + (length init-specs))
|
||||
,(1+ (length init-specs))
|
||||
,@(apply process-init-spec init-specs)
|
||||
(new 'static 'sp-field-init-spec :field (sp-field-id spt-end)))))))
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
(arg2 sp-field-id)
|
||||
(arg3 sp-field-id)
|
||||
(write-missing-fields symbol))
|
||||
(1 +! arg2)
|
||||
(1+! arg2)
|
||||
(let ((cur-spec arg1))
|
||||
(while (< (-> cur-spec 0 field) arg2)
|
||||
(&+! cur-spec 16))
|
||||
@@ -139,7 +139,7 @@
|
||||
(set! (-> arg0) (-> cur-spec 0 initial-valuef))
|
||||
(set! (-> arg0)
|
||||
(+ (-> cur-spec 0 initial-valuef)
|
||||
(* (-> cur-spec 0 random-multf) (the int (* (rand-vu) (1 + (-> cur-spec 0 random-range)))))))))
|
||||
(* (-> cur-spec 0 random-multf) (the int (* (rand-vu) (1+ (-> cur-spec 0 random-range)))))))))
|
||||
(((sp-flag copy-from-other)) (set! (-> arg0) (-> arg0 (-> cur-spec 0 initial-value))))
|
||||
(((sp-flag symbol)) (set! (-> arg0) (the-as float (-> cur-spec 0 sym value))))
|
||||
(((sp-flag launcher)) (set! (-> arg0) (the-as float (-> *part-id-table* (-> cur-spec 0 initial-value)))))
|
||||
@@ -150,7 +150,7 @@
|
||||
(set! (-> arg0)
|
||||
(the-as float
|
||||
(+ (-> cur-spec 0 initial-value) (* (-> cur-spec 0 random-mult) (the int (* (rand-vu) (-> cur-spec 0 random-range))))))))))))
|
||||
(1 +! arg2)
|
||||
(1+! arg2)
|
||||
(&+! arg0 4)
|
||||
(&+! cur-spec 16))
|
||||
cur-spec))
|
||||
|
||||
@@ -549,19 +549,19 @@
|
||||
(new 'static 'vif-tag :cmd (vif-cmd nop))
|
||||
(new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32) :num qwc-pkt2 :imm (new 'static 'vif-unpack-imm :flg 1 :addr 1))))
|
||||
#|
|
||||
;(when (= mscal-addr 3)
|
||||
(dotimes (i num-sprites)
|
||||
(let ((spidx (+ i start-sprite-idx)))
|
||||
;(when (or (= spidx (-> sprites num-sprites 0)) (= spidx (+ 1 (-> sprites num-sprites 0))))
|
||||
(let ((data (the sprite-vec-data-2d (&+ (-> sprites vec-data) (* 48 (+ i start-sprite-idx))))))
|
||||
(let ((vec (-> data x-y-z-sx)))
|
||||
(format 0 "sp: ~d ~f ~f ~f~%" (+ i start-sprite-idx) (-> vec x) (-> vec y) (-> vec z))
|
||||
)
|
||||
)
|
||||
; )
|
||||
;(when (= mscal-addr 3)
|
||||
(dotimes (i num-sprites)
|
||||
(let ((spidx (+ i start-sprite-idx)))
|
||||
;(when (or (= spidx (-> sprites num-sprites 0)) (= spidx (+ 1 (-> sprites num-sprites 0))))
|
||||
(let ((data (the sprite-vec-data-2d (&+ (-> sprites vec-data) (* 48 (+ i start-sprite-idx))))))
|
||||
(let ((vec (-> data x-y-z-sx)))
|
||||
(format 0 "sp: ~d ~f ~f ~f~%" (+ i start-sprite-idx) (-> vec x) (-> vec y) (-> vec z))
|
||||
)
|
||||
)
|
||||
)
|
||||
; )
|
||||
; )
|
||||
)
|
||||
)
|
||||
; )
|
||||
|#
|
||||
;; third packet is adgif data (5 qw/sprite)
|
||||
(let ((qwc-pkt3 (* 5 num-sprites)))
|
||||
|
||||
@@ -1859,7 +1859,7 @@
|
||||
0)
|
||||
|
||||
;; debug menu shader stuff
|
||||
(define *shader-list* ())
|
||||
(define *shader-list* '())
|
||||
|
||||
(define *edit-shader* (new 'static 'texture-id))
|
||||
|
||||
@@ -2072,13 +2072,13 @@
|
||||
(set! (-> arg0 tex1) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1))
|
||||
(set! (-> arg0 tex0 tfx) 0)
|
||||
#|
|
||||
(set!
|
||||
(-> arg0 tex0)
|
||||
(the-as
|
||||
gs-tex0
|
||||
(logand (the-as uint (-> arg0 tex0)) (the-as uint #xffffffe7ffffffff))
|
||||
)
|
||||
)
|
||||
(set!
|
||||
(-> arg0 tex0)
|
||||
(the-as
|
||||
gs-tex0
|
||||
(logand (the-as uint (-> arg0 tex0)) (the-as uint #xffffffe7ffffffff))
|
||||
)
|
||||
)
|
||||
|#
|
||||
(if arg1 (adgif-shader<-texture! arg0 arg1))
|
||||
(set! (-> arg0 clamp) (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)))
|
||||
|
||||
@@ -50,26 +50,26 @@
|
||||
(let ((s5-0 (+ (-> arg0 length) -1))) ;; get the number of trees with draw-nodes (see doc, the last one is always tfragments)
|
||||
;; TODO
|
||||
#|
|
||||
(when (nonzero? s5-0) ;; only if we have draw-nodes (levels like INT have only like 2 tfrags)
|
||||
(dotimes (s4-0 s5-0) ;; loop over tree depths
|
||||
|
||||
;; not sure of the details yet, but we take two levels as inputs
|
||||
(let* ((v1-7 (-> arg0 arrays s4-0))
|
||||
(a0-4 (-> arg0 arrays (+ s4-0 1)))
|
||||
(a1-1 (/ (-> (the-as drawable-inline-array-node v1-7) data 0 id) 8))
|
||||
(a0-6 (/ (-> (the-as drawable-inline-array-node a0-4) data 0 id) 8))
|
||||
(a1-3 (&-> (scratchpad-object terrain-context) work background vis-list a1-1))
|
||||
(a0-8 (&-> (scratchpad-object terrain-context) work background vis-list a0-6))
|
||||
)
|
||||
(draw-node-cull
|
||||
a0-8
|
||||
a1-3
|
||||
(-> (the-as drawable-inline-array-node v1-7) data)
|
||||
(-> (the-as drawable-inline-array-node v1-7) length)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (nonzero? s5-0) ;; only if we have draw-nodes (levels like INT have only like 2 tfrags)
|
||||
(dotimes (s4-0 s5-0) ;; loop over tree depths
|
||||
|
||||
;; not sure of the details yet, but we take two levels as inputs
|
||||
(let* ((v1-7 (-> arg0 arrays s4-0))
|
||||
(a0-4 (-> arg0 arrays (+ s4-0 1)))
|
||||
(a1-1 (/ (-> (the-as drawable-inline-array-node v1-7) data 0 id) 8))
|
||||
(a0-6 (/ (-> (the-as drawable-inline-array-node a0-4) data 0 id) 8))
|
||||
(a1-3 (&-> (scratchpad-object terrain-context) work background vis-list a1-1))
|
||||
(a0-8 (&-> (scratchpad-object terrain-context) work background vis-list a0-6))
|
||||
)
|
||||
(draw-node-cull
|
||||
a0-8
|
||||
a1-3
|
||||
(-> (the-as drawable-inline-array-node v1-7) data)
|
||||
(-> (the-as drawable-inline-array-node v1-7) length)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|#
|
||||
;; draw, using the full list of all tfrags (not tree format)
|
||||
(let* ((v1-13 (the-as drawable-inline-array-tfrag (-> arg0 arrays s5-0)))
|
||||
@@ -166,25 +166,25 @@
|
||||
(when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag))
|
||||
(let ((s5-0 (+ (-> arg0 length) -1)))
|
||||
#|
|
||||
TODO
|
||||
(when (nonzero? s5-0)
|
||||
(dotimes (s4-0 s5-0)
|
||||
(let* ((v1-7 (-> arg0 arrays s4-0))
|
||||
(a0-4 (-> arg0 arrays (+ s4-0 1)))
|
||||
(a1-1 (/ (-> (the-as drawable-inline-array-node v1-7) data 0 id) 8))
|
||||
(a0-6 (/ (-> (the-as drawable-inline-array-node a0-4) data 0 id) 8))
|
||||
(a1-3 (&-> (the-as terrain-context #x70000000) work background vis-list a1-1))
|
||||
(a0-8 (&-> (the-as terrain-context #x70000000) work background vis-list a0-6))
|
||||
)
|
||||
(draw-node-cull
|
||||
a0-8
|
||||
a1-3
|
||||
(-> (the-as drawable-inline-array-node v1-7) data)
|
||||
(-> (the-as drawable-inline-array-node v1-7) length)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
TODO
|
||||
(when (nonzero? s5-0)
|
||||
(dotimes (s4-0 s5-0)
|
||||
(let* ((v1-7 (-> arg0 arrays s4-0))
|
||||
(a0-4 (-> arg0 arrays (+ s4-0 1)))
|
||||
(a1-1 (/ (-> (the-as drawable-inline-array-node v1-7) data 0 id) 8))
|
||||
(a0-6 (/ (-> (the-as drawable-inline-array-node a0-4) data 0 id) 8))
|
||||
(a1-3 (&-> (the-as terrain-context #x70000000) work background vis-list a1-1))
|
||||
(a0-8 (&-> (the-as terrain-context #x70000000) work background vis-list a0-6))
|
||||
)
|
||||
(draw-node-cull
|
||||
a0-8
|
||||
a1-3
|
||||
(-> (the-as drawable-inline-array-node v1-7) data)
|
||||
(-> (the-as drawable-inline-array-node v1-7) length)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|#
|
||||
(let* ((v1-13 (-> arg0 arrays s5-0))
|
||||
(s5-1 (&+ v1-13 32))
|
||||
@@ -225,87 +225,87 @@
|
||||
s3-0
|
||||
(the-as (pointer dma-tag) a3-3))))
|
||||
#|
|
||||
TODO
|
||||
(let*
|
||||
((s2-1 (-> *display* frames (-> *display* on-screen) frame global-buf))
|
||||
(s3-1 (-> s2-1 base))
|
||||
)
|
||||
(set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0))
|
||||
(set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0))
|
||||
(tfrag-near-init-buffer
|
||||
s2-1
|
||||
(new 'static 'gs-test
|
||||
:ate #x1
|
||||
:atst (gs-atest greater-equal)
|
||||
:aref #x7e
|
||||
:afail #x1
|
||||
:zte #x1
|
||||
:ztst (gs-ztest greater-equal)
|
||||
)
|
||||
1
|
||||
)
|
||||
(let* ((v1-48 (-> *perf-stats* data 6))
|
||||
(a0-32 (-> v1-48 ctrl))
|
||||
)
|
||||
(+! (-> v1-48 count) 1)
|
||||
(b! (zero? a0-32) cfg-15 :delay (nop!))
|
||||
(.mtc0 Perf r0-0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtpc pcr0 r0-0)
|
||||
(.mtpc pcr1 r0-0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtc0 Perf a0-32)
|
||||
)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(label cfg-15)
|
||||
0
|
||||
(draw-inline-array-tfrag-near sv-16 s5-1 s4-1 s2-1)
|
||||
(let ((v1-51 (-> *perf-stats* data 6)))
|
||||
(b! (zero? (-> v1-51 ctrl)) cfg-17 :delay (nop!))
|
||||
(.mtc0 Perf r0-0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mfpc a0-35 pcr0)
|
||||
(+! (-> v1-51 accum0) a0-35)
|
||||
(.mfpc a0-37 pcr1)
|
||||
(+! (-> v1-51 accum1) a0-37)
|
||||
)
|
||||
(label cfg-17)
|
||||
0
|
||||
(update-wait-stats
|
||||
(-> *perf-stats* data 6)
|
||||
(the-as uint 0)
|
||||
(-> *tfrag-work* near-wait-to-spr)
|
||||
(-> *tfrag-work* near-wait-from-spr)
|
||||
)
|
||||
(tfrag-near-end-buffer s2-1)
|
||||
(let ((a3-6 (-> s2-1 base)))
|
||||
(let ((v1-58 (the-as object (-> s2-1 base))))
|
||||
(set!
|
||||
(-> (the-as dma-packet v1-58) dma)
|
||||
(new 'static 'dma-tag :id (dma-tag-id next))
|
||||
)
|
||||
(set! (-> (the-as dma-packet v1-58) vif0) (new 'static 'vif-tag))
|
||||
(set! (-> (the-as dma-packet v1-58) vif1) (new 'static 'vif-tag))
|
||||
(set! (-> s2-1 base) (&+ (the-as pointer v1-58) 16))
|
||||
)
|
||||
(dma-bucket-insert-tag
|
||||
(-> *display* frames (-> *display* on-screen) frame bucket-group)
|
||||
(the-as
|
||||
bucket-id
|
||||
(if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index))
|
||||
33
|
||||
40
|
||||
)
|
||||
)
|
||||
s3-1
|
||||
(the-as (pointer dma-tag) a3-6)
|
||||
)
|
||||
)
|
||||
)
|
||||
TODO
|
||||
(let*
|
||||
((s2-1 (-> *display* frames (-> *display* on-screen) frame global-buf))
|
||||
(s3-1 (-> s2-1 base))
|
||||
)
|
||||
(set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0))
|
||||
(set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0))
|
||||
(tfrag-near-init-buffer
|
||||
s2-1
|
||||
(new 'static 'gs-test
|
||||
:ate #x1
|
||||
:atst (gs-atest greater-equal)
|
||||
:aref #x7e
|
||||
:afail #x1
|
||||
:zte #x1
|
||||
:ztst (gs-ztest greater-equal)
|
||||
)
|
||||
1
|
||||
)
|
||||
(let* ((v1-48 (-> *perf-stats* data 6))
|
||||
(a0-32 (-> v1-48 ctrl))
|
||||
)
|
||||
(+! (-> v1-48 count) 1)
|
||||
(b! (zero? a0-32) cfg-15 :delay (nop!))
|
||||
(.mtc0 Perf r0-0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtpc pcr0 r0-0)
|
||||
(.mtpc pcr1 r0-0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtc0 Perf a0-32)
|
||||
)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(label cfg-15)
|
||||
0
|
||||
(draw-inline-array-tfrag-near sv-16 s5-1 s4-1 s2-1)
|
||||
(let ((v1-51 (-> *perf-stats* data 6)))
|
||||
(b! (zero? (-> v1-51 ctrl)) cfg-17 :delay (nop!))
|
||||
(.mtc0 Perf r0-0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mfpc a0-35 pcr0)
|
||||
(+! (-> v1-51 accum0) a0-35)
|
||||
(.mfpc a0-37 pcr1)
|
||||
(+! (-> v1-51 accum1) a0-37)
|
||||
)
|
||||
(label cfg-17)
|
||||
0
|
||||
(update-wait-stats
|
||||
(-> *perf-stats* data 6)
|
||||
(the-as uint 0)
|
||||
(-> *tfrag-work* near-wait-to-spr)
|
||||
(-> *tfrag-work* near-wait-from-spr)
|
||||
)
|
||||
(tfrag-near-end-buffer s2-1)
|
||||
(let ((a3-6 (-> s2-1 base)))
|
||||
(let ((v1-58 (the-as object (-> s2-1 base))))
|
||||
(set!
|
||||
(-> (the-as dma-packet v1-58) dma)
|
||||
(new 'static 'dma-tag :id (dma-tag-id next))
|
||||
)
|
||||
(set! (-> (the-as dma-packet v1-58) vif0) (new 'static 'vif-tag))
|
||||
(set! (-> (the-as dma-packet v1-58) vif1) (new 'static 'vif-tag))
|
||||
(set! (-> s2-1 base) (&+ (the-as pointer v1-58) 16))
|
||||
)
|
||||
(dma-bucket-insert-tag
|
||||
(-> *display* frames (-> *display* on-screen) frame bucket-group)
|
||||
(the-as
|
||||
bucket-id
|
||||
(if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index))
|
||||
33
|
||||
40
|
||||
)
|
||||
)
|
||||
s3-1
|
||||
(the-as (pointer dma-tag) a3-6)
|
||||
)
|
||||
)
|
||||
)
|
||||
|#
|
||||
)))
|
||||
(none))
|
||||
@@ -315,41 +315,41 @@
|
||||
(when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag))
|
||||
(let ((s5-0 (+ (-> arg0 length) -1)))
|
||||
#|
|
||||
TODO
|
||||
(when (nonzero? s5-0)
|
||||
(dotimes (s4-0 s5-0)
|
||||
(let* ((v1-7 (-> arg0 arrays s4-0))
|
||||
(a0-4 (-> arg0 arrays (+ s4-0 1)))
|
||||
(a1-1 (/ (-> (the-as drawable-inline-array-node v1-7) data 0 id) 8))
|
||||
(a0-6 (/ (-> (the-as drawable-inline-array-node a0-4) data 0 id) 8))
|
||||
(a1-3
|
||||
(&->
|
||||
(the-as terrain-context #x70000000)
|
||||
work
|
||||
background
|
||||
vis-list
|
||||
a1-1
|
||||
)
|
||||
)
|
||||
(a0-8
|
||||
(&->
|
||||
(the-as terrain-context #x70000000)
|
||||
work
|
||||
background
|
||||
vis-list
|
||||
a0-6
|
||||
)
|
||||
)
|
||||
)
|
||||
(draw-node-cull
|
||||
a0-8
|
||||
a1-3
|
||||
(-> (the-as drawable-inline-array-node v1-7) data)
|
||||
(-> (the-as drawable-inline-array-node v1-7) length)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
TODO
|
||||
(when (nonzero? s5-0)
|
||||
(dotimes (s4-0 s5-0)
|
||||
(let* ((v1-7 (-> arg0 arrays s4-0))
|
||||
(a0-4 (-> arg0 arrays (+ s4-0 1)))
|
||||
(a1-1 (/ (-> (the-as drawable-inline-array-node v1-7) data 0 id) 8))
|
||||
(a0-6 (/ (-> (the-as drawable-inline-array-node a0-4) data 0 id) 8))
|
||||
(a1-3
|
||||
(&->
|
||||
(the-as terrain-context #x70000000)
|
||||
work
|
||||
background
|
||||
vis-list
|
||||
a1-1
|
||||
)
|
||||
)
|
||||
(a0-8
|
||||
(&->
|
||||
(the-as terrain-context #x70000000)
|
||||
work
|
||||
background
|
||||
vis-list
|
||||
a0-6
|
||||
)
|
||||
)
|
||||
)
|
||||
(draw-node-cull
|
||||
a0-8
|
||||
a1-3
|
||||
(-> (the-as drawable-inline-array-node v1-7) data)
|
||||
(-> (the-as drawable-inline-array-node v1-7) length)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|#
|
||||
(let* ((v1-13 (-> arg0 arrays s5-0))
|
||||
(s5-1 (&+ v1-13 32))
|
||||
@@ -379,84 +379,84 @@
|
||||
s3-0
|
||||
(the-as (pointer dma-tag) a3-3))))
|
||||
#|
|
||||
(let*
|
||||
((s2-1 (-> *display* frames (-> *display* on-screen) frame global-buf))
|
||||
(s3-1 (-> s2-1 base))
|
||||
)
|
||||
(set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0))
|
||||
(set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0))
|
||||
(tfrag-near-init-buffer
|
||||
s2-1
|
||||
(new 'static 'gs-test
|
||||
:ate #x1
|
||||
:afail #x1
|
||||
:zte #x1
|
||||
:ztst (gs-ztest greater-equal)
|
||||
)
|
||||
1
|
||||
)
|
||||
(let* ((v1-48 (-> *perf-stats* data 6))
|
||||
(a0-32 (-> v1-48 ctrl))
|
||||
)
|
||||
(+! (-> v1-48 count) 1)
|
||||
(b! (zero? a0-32) cfg-15 :delay (nop!))
|
||||
(.mtc0 Perf r0-0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtpc pcr0 r0-0)
|
||||
(.mtpc pcr1 r0-0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtc0 Perf a0-32)
|
||||
)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(label cfg-15)
|
||||
0
|
||||
(draw-inline-array-tfrag-near sv-16 s5-1 s4-1 s2-1)
|
||||
(let ((v1-51 (-> *perf-stats* data 6)))
|
||||
(b! (zero? (-> v1-51 ctrl)) cfg-17 :delay (nop!))
|
||||
(.mtc0 Perf r0-0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mfpc a0-35 pcr0)
|
||||
(+! (-> v1-51 accum0) a0-35)
|
||||
(.mfpc a0-37 pcr1)
|
||||
(+! (-> v1-51 accum1) a0-37)
|
||||
)
|
||||
(label cfg-17)
|
||||
0
|
||||
(update-wait-stats
|
||||
(-> *perf-stats* data 6)
|
||||
(the-as uint 0)
|
||||
(-> *tfrag-work* near-wait-to-spr)
|
||||
(-> *tfrag-work* near-wait-from-spr)
|
||||
)
|
||||
(tfrag-near-end-buffer s2-1)
|
||||
(let ((a3-6 (-> s2-1 base)))
|
||||
(let ((v1-58 (the-as object (-> s2-1 base))))
|
||||
(set!
|
||||
(-> (the-as dma-packet v1-58) dma)
|
||||
(new 'static 'dma-tag :id (dma-tag-id next))
|
||||
)
|
||||
(set! (-> (the-as dma-packet v1-58) vif0) (new 'static 'vif-tag))
|
||||
(set! (-> (the-as dma-packet v1-58) vif1) (new 'static 'vif-tag))
|
||||
(set! (-> s2-1 base) (&+ (the-as pointer v1-58) 16))
|
||||
)
|
||||
(dma-bucket-insert-tag
|
||||
(-> *display* frames (-> *display* on-screen) frame bucket-group)
|
||||
(the-as
|
||||
bucket-id
|
||||
(if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index))
|
||||
35
|
||||
42
|
||||
)
|
||||
)
|
||||
s3-1
|
||||
(the-as (pointer dma-tag) a3-6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let*
|
||||
((s2-1 (-> *display* frames (-> *display* on-screen) frame global-buf))
|
||||
(s3-1 (-> s2-1 base))
|
||||
)
|
||||
(set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0))
|
||||
(set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0))
|
||||
(tfrag-near-init-buffer
|
||||
s2-1
|
||||
(new 'static 'gs-test
|
||||
:ate #x1
|
||||
:afail #x1
|
||||
:zte #x1
|
||||
:ztst (gs-ztest greater-equal)
|
||||
)
|
||||
1
|
||||
)
|
||||
(let* ((v1-48 (-> *perf-stats* data 6))
|
||||
(a0-32 (-> v1-48 ctrl))
|
||||
)
|
||||
(+! (-> v1-48 count) 1)
|
||||
(b! (zero? a0-32) cfg-15 :delay (nop!))
|
||||
(.mtc0 Perf r0-0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtpc pcr0 r0-0)
|
||||
(.mtpc pcr1 r0-0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtc0 Perf a0-32)
|
||||
)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(label cfg-15)
|
||||
0
|
||||
(draw-inline-array-tfrag-near sv-16 s5-1 s4-1 s2-1)
|
||||
(let ((v1-51 (-> *perf-stats* data 6)))
|
||||
(b! (zero? (-> v1-51 ctrl)) cfg-17 :delay (nop!))
|
||||
(.mtc0 Perf r0-0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mfpc a0-35 pcr0)
|
||||
(+! (-> v1-51 accum0) a0-35)
|
||||
(.mfpc a0-37 pcr1)
|
||||
(+! (-> v1-51 accum1) a0-37)
|
||||
)
|
||||
(label cfg-17)
|
||||
0
|
||||
(update-wait-stats
|
||||
(-> *perf-stats* data 6)
|
||||
(the-as uint 0)
|
||||
(-> *tfrag-work* near-wait-to-spr)
|
||||
(-> *tfrag-work* near-wait-from-spr)
|
||||
)
|
||||
(tfrag-near-end-buffer s2-1)
|
||||
(let ((a3-6 (-> s2-1 base)))
|
||||
(let ((v1-58 (the-as object (-> s2-1 base))))
|
||||
(set!
|
||||
(-> (the-as dma-packet v1-58) dma)
|
||||
(new 'static 'dma-tag :id (dma-tag-id next))
|
||||
)
|
||||
(set! (-> (the-as dma-packet v1-58) vif0) (new 'static 'vif-tag))
|
||||
(set! (-> (the-as dma-packet v1-58) vif1) (new 'static 'vif-tag))
|
||||
(set! (-> s2-1 base) (&+ (the-as pointer v1-58) 16))
|
||||
)
|
||||
(dma-bucket-insert-tag
|
||||
(-> *display* frames (-> *display* on-screen) frame bucket-group)
|
||||
(the-as
|
||||
bucket-id
|
||||
(if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index))
|
||||
35
|
||||
42
|
||||
)
|
||||
)
|
||||
s3-1
|
||||
(the-as (pointer dma-tag) a3-6)
|
||||
)
|
||||
)
|
||||
)
|
||||
|#
|
||||
)))
|
||||
(none))
|
||||
@@ -466,25 +466,25 @@
|
||||
(when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag))
|
||||
(let ((s5-0 (+ (-> arg0 length) -1)))
|
||||
#|
|
||||
TODO
|
||||
(when (nonzero? s5-0)
|
||||
(dotimes (s4-0 s5-0)
|
||||
(let* ((v1-7 (-> arg0 arrays s4-0))
|
||||
(a0-4 (-> arg0 arrays (+ s4-0 1)))
|
||||
(a1-1 (/ (-> (the-as drawable-inline-array-node v1-7) data 0 id) 8))
|
||||
(a0-6 (/ (-> (the-as drawable-inline-array-node a0-4) data 0 id) 8))
|
||||
(a1-3 (&-> (the-as terrain-context #x70000000) work background vis-list a1-1))
|
||||
(a0-8 (&-> (the-as terrain-context #x70000000) work background vis-list a0-6))
|
||||
)
|
||||
(draw-node-cull
|
||||
a0-8
|
||||
a1-3
|
||||
(-> (the-as drawable-inline-array-node v1-7) data)
|
||||
(-> (the-as drawable-inline-array-node v1-7) length)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
TODO
|
||||
(when (nonzero? s5-0)
|
||||
(dotimes (s4-0 s5-0)
|
||||
(let* ((v1-7 (-> arg0 arrays s4-0))
|
||||
(a0-4 (-> arg0 arrays (+ s4-0 1)))
|
||||
(a1-1 (/ (-> (the-as drawable-inline-array-node v1-7) data 0 id) 8))
|
||||
(a0-6 (/ (-> (the-as drawable-inline-array-node a0-4) data 0 id) 8))
|
||||
(a1-3 (&-> (the-as terrain-context #x70000000) work background vis-list a1-1))
|
||||
(a0-8 (&-> (the-as terrain-context #x70000000) work background vis-list a0-6))
|
||||
)
|
||||
(draw-node-cull
|
||||
a0-8
|
||||
a1-3
|
||||
(-> (the-as drawable-inline-array-node v1-7) data)
|
||||
(-> (the-as drawable-inline-array-node v1-7) length)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|#
|
||||
(let* ((v1-13 (-> arg0 arrays s5-0))
|
||||
(s5-1 (&+ v1-13 32))
|
||||
@@ -517,85 +517,85 @@
|
||||
s3-0
|
||||
(the-as (pointer dma-tag) a3-3))))
|
||||
#|
|
||||
(let*
|
||||
((s2-1 (-> *display* frames (-> *display* on-screen) frame global-buf))
|
||||
(s3-1 (-> s2-1 base))
|
||||
)
|
||||
(set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0))
|
||||
(set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0))
|
||||
(tfrag-near-init-buffer
|
||||
s2-1
|
||||
(new 'static 'gs-test
|
||||
:ate #x1
|
||||
:atst (gs-atest always)
|
||||
:afail #x1
|
||||
:zte #x1
|
||||
:ztst (gs-ztest greater-equal)
|
||||
)
|
||||
1
|
||||
)
|
||||
(let* ((v1-48 (-> *perf-stats* data 6))
|
||||
(a0-32 (-> v1-48 ctrl))
|
||||
)
|
||||
(+! (-> v1-48 count) 1)
|
||||
(b! (zero? a0-32) cfg-15 :delay (nop!))
|
||||
(.mtc0 Perf r0-0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtpc pcr0 r0-0)
|
||||
(.mtpc pcr1 r0-0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtc0 Perf a0-32)
|
||||
)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(label cfg-15)
|
||||
0
|
||||
(draw-inline-array-tfrag-near sv-16 s5-1 s4-1 s2-1)
|
||||
(let ((v1-51 (-> *perf-stats* data 6)))
|
||||
(b! (zero? (-> v1-51 ctrl)) cfg-17 :delay (nop!))
|
||||
(.mtc0 Perf r0-0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mfpc a0-35 pcr0)
|
||||
(+! (-> v1-51 accum0) a0-35)
|
||||
(.mfpc a0-37 pcr1)
|
||||
(+! (-> v1-51 accum1) a0-37)
|
||||
)
|
||||
(label cfg-17)
|
||||
0
|
||||
(update-wait-stats
|
||||
(-> *perf-stats* data 6)
|
||||
(the-as uint 0)
|
||||
(-> *tfrag-work* near-wait-to-spr)
|
||||
(-> *tfrag-work* near-wait-from-spr)
|
||||
)
|
||||
(tfrag-near-end-buffer s2-1)
|
||||
(let ((a3-6 (-> s2-1 base)))
|
||||
(let ((v1-58 (the-as object (-> s2-1 base))))
|
||||
(set!
|
||||
(-> (the-as dma-packet v1-58) dma)
|
||||
(new 'static 'dma-tag :id (dma-tag-id next))
|
||||
)
|
||||
(set! (-> (the-as dma-packet v1-58) vif0) (new 'static 'vif-tag))
|
||||
(set! (-> (the-as dma-packet v1-58) vif1) (new 'static 'vif-tag))
|
||||
(set! (-> s2-1 base) (&+ (the-as pointer v1-58) 16))
|
||||
)
|
||||
(dma-bucket-insert-tag
|
||||
(-> *display* frames (-> *display* on-screen) frame bucket-group)
|
||||
(the-as
|
||||
bucket-id
|
||||
(if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index))
|
||||
37
|
||||
44
|
||||
)
|
||||
)
|
||||
s3-1
|
||||
(the-as (pointer dma-tag) a3-6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let*
|
||||
((s2-1 (-> *display* frames (-> *display* on-screen) frame global-buf))
|
||||
(s3-1 (-> s2-1 base))
|
||||
)
|
||||
(set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0))
|
||||
(set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0))
|
||||
(tfrag-near-init-buffer
|
||||
s2-1
|
||||
(new 'static 'gs-test
|
||||
:ate #x1
|
||||
:atst (gs-atest always)
|
||||
:afail #x1
|
||||
:zte #x1
|
||||
:ztst (gs-ztest greater-equal)
|
||||
)
|
||||
1
|
||||
)
|
||||
(let* ((v1-48 (-> *perf-stats* data 6))
|
||||
(a0-32 (-> v1-48 ctrl))
|
||||
)
|
||||
(+! (-> v1-48 count) 1)
|
||||
(b! (zero? a0-32) cfg-15 :delay (nop!))
|
||||
(.mtc0 Perf r0-0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtpc pcr0 r0-0)
|
||||
(.mtpc pcr1 r0-0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtc0 Perf a0-32)
|
||||
)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(label cfg-15)
|
||||
0
|
||||
(draw-inline-array-tfrag-near sv-16 s5-1 s4-1 s2-1)
|
||||
(let ((v1-51 (-> *perf-stats* data 6)))
|
||||
(b! (zero? (-> v1-51 ctrl)) cfg-17 :delay (nop!))
|
||||
(.mtc0 Perf r0-0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mfpc a0-35 pcr0)
|
||||
(+! (-> v1-51 accum0) a0-35)
|
||||
(.mfpc a0-37 pcr1)
|
||||
(+! (-> v1-51 accum1) a0-37)
|
||||
)
|
||||
(label cfg-17)
|
||||
0
|
||||
(update-wait-stats
|
||||
(-> *perf-stats* data 6)
|
||||
(the-as uint 0)
|
||||
(-> *tfrag-work* near-wait-to-spr)
|
||||
(-> *tfrag-work* near-wait-from-spr)
|
||||
)
|
||||
(tfrag-near-end-buffer s2-1)
|
||||
(let ((a3-6 (-> s2-1 base)))
|
||||
(let ((v1-58 (the-as object (-> s2-1 base))))
|
||||
(set!
|
||||
(-> (the-as dma-packet v1-58) dma)
|
||||
(new 'static 'dma-tag :id (dma-tag-id next))
|
||||
)
|
||||
(set! (-> (the-as dma-packet v1-58) vif0) (new 'static 'vif-tag))
|
||||
(set! (-> (the-as dma-packet v1-58) vif1) (new 'static 'vif-tag))
|
||||
(set! (-> s2-1 base) (&+ (the-as pointer v1-58) 16))
|
||||
)
|
||||
(dma-bucket-insert-tag
|
||||
(-> *display* frames (-> *display* on-screen) frame bucket-group)
|
||||
(the-as
|
||||
bucket-id
|
||||
(if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index))
|
||||
37
|
||||
44
|
||||
)
|
||||
)
|
||||
s3-1
|
||||
(the-as (pointer dma-tag) a3-6)
|
||||
)
|
||||
)
|
||||
)
|
||||
|#
|
||||
)))
|
||||
(none))
|
||||
|
||||
@@ -97,99 +97,99 @@
|
||||
(set! (-> (the-as (pointer uint32) (-> gp-3 last)) 1) (the-as uint s5-3))
|
||||
(set! (-> gp-3 last) (the-as (pointer dma-tag) v1-39))))))
|
||||
#|
|
||||
;; level 0's tie near
|
||||
(let ((gp-4 (-> *display* frames (-> *display* on-screen) frame bucket-group (bucket-id tie-near-0))))
|
||||
(when (!= gp-4 (-> gp-4 last))
|
||||
(let* ((s5-4 (-> *display* frames (-> *display* on-screen) frame global-buf))
|
||||
(s4-7 (-> s5-4 base))
|
||||
)
|
||||
(tie-near-init-engine
|
||||
s5-4
|
||||
(new 'static 'gs-test
|
||||
:ate #x1
|
||||
:atst (gs-atest greater-equal)
|
||||
:aref #x26
|
||||
:zte #x1
|
||||
:ztst (gs-ztest greater-equal)
|
||||
)
|
||||
0
|
||||
)
|
||||
(let ((v1-48 (the-as object (-> s5-4 base))))
|
||||
(set! (-> (the-as dma-packet v1-48) dma) (new 'static 'dma-tag :id (dma-tag-id next) :addr (-> gp-4 next)))
|
||||
(set! (-> (the-as dma-packet v1-48) vif0) (new 'static 'vif-tag))
|
||||
(set! (-> (the-as dma-packet v1-48) vif1) (new 'static 'vif-tag))
|
||||
(set! (-> s5-4 base) (&+ (the-as pointer v1-48) 16))
|
||||
)
|
||||
(set! (-> gp-4 next) (the-as uint s4-7))
|
||||
;; level 0's tie near
|
||||
(let ((gp-4 (-> *display* frames (-> *display* on-screen) frame bucket-group (bucket-id tie-near-0))))
|
||||
(when (!= gp-4 (-> gp-4 last))
|
||||
(let* ((s5-4 (-> *display* frames (-> *display* on-screen) frame global-buf))
|
||||
(s4-7 (-> s5-4 base))
|
||||
)
|
||||
(tie-near-init-engine
|
||||
s5-4
|
||||
(new 'static 'gs-test
|
||||
:ate #x1
|
||||
:atst (gs-atest greater-equal)
|
||||
:aref #x26
|
||||
:zte #x1
|
||||
:ztst (gs-ztest greater-equal)
|
||||
)
|
||||
0
|
||||
)
|
||||
(let ((v1-48 (the-as object (-> s5-4 base))))
|
||||
(set! (-> (the-as dma-packet v1-48) dma) (new 'static 'dma-tag :id (dma-tag-id next) :addr (-> gp-4 next)))
|
||||
(set! (-> (the-as dma-packet v1-48) vif0) (new 'static 'vif-tag))
|
||||
(set! (-> (the-as dma-packet v1-48) vif1) (new 'static 'vif-tag))
|
||||
(set! (-> s5-4 base) (&+ (the-as pointer v1-48) 16))
|
||||
)
|
||||
(set! (-> gp-4 next) (the-as uint s4-7))
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((gp-5 (-> *display* frames (-> *display* on-screen) frame bucket-group (bucket-id tie-near-0))))
|
||||
(when (!= gp-5 (-> gp-5 last))
|
||||
(let* ((s4-8 (-> *display* frames (-> *display* on-screen) frame global-buf))
|
||||
(s5-5 (-> s4-8 base))
|
||||
)
|
||||
(tie-near-end-buffer s4-8)
|
||||
(let ((v1-59 (-> s4-8 base)))
|
||||
(let ((a0-55 (the-as object (-> s4-8 base))))
|
||||
(set! (-> (the-as dma-packet a0-55) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
|
||||
(set! (-> (the-as dma-packet a0-55) vif0) (new 'static 'vif-tag))
|
||||
(set! (-> (the-as dma-packet a0-55) vif1) (new 'static 'vif-tag))
|
||||
(set! (-> s4-8 base) (&+ (the-as pointer a0-55) 16))
|
||||
)
|
||||
(set! (-> (the-as (pointer uint32) (-> gp-5 last)) 1) (the-as uint s5-5))
|
||||
(set! (-> gp-5 last) (the-as (pointer dma-tag) v1-59))
|
||||
)
|
||||
)
|
||||
(let ((gp-5 (-> *display* frames (-> *display* on-screen) frame bucket-group (bucket-id tie-near-0))))
|
||||
(when (!= gp-5 (-> gp-5 last))
|
||||
(let* ((s4-8 (-> *display* frames (-> *display* on-screen) frame global-buf))
|
||||
(s5-5 (-> s4-8 base))
|
||||
)
|
||||
(tie-near-end-buffer s4-8)
|
||||
(let ((v1-59 (-> s4-8 base)))
|
||||
(let ((a0-55 (the-as object (-> s4-8 base))))
|
||||
(set! (-> (the-as dma-packet a0-55) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
|
||||
(set! (-> (the-as dma-packet a0-55) vif0) (new 'static 'vif-tag))
|
||||
(set! (-> (the-as dma-packet a0-55) vif1) (new 'static 'vif-tag))
|
||||
(set! (-> s4-8 base) (&+ (the-as pointer a0-55) 16))
|
||||
)
|
||||
(set! (-> (the-as (pointer uint32) (-> gp-5 last)) 1) (the-as uint s5-5))
|
||||
(set! (-> gp-5 last) (the-as (pointer dma-tag) v1-59))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; level 1's tie near
|
||||
(let ((gp-6 (-> *display* frames (-> *display* on-screen) frame bucket-group (bucket-id tie-near-1))))
|
||||
(when (!= gp-6 (-> gp-6 last))
|
||||
(let* ((s5-6 (-> *display* frames (-> *display* on-screen) frame global-buf))
|
||||
(s4-10 (-> s5-6 base))
|
||||
)
|
||||
(tie-near-init-engine
|
||||
s5-6
|
||||
(new 'static 'gs-test
|
||||
:ate #x1
|
||||
:atst (gs-atest greater-equal)
|
||||
:aref #x26
|
||||
:zte #x1
|
||||
:ztst (gs-ztest greater-equal)
|
||||
)
|
||||
0
|
||||
)
|
||||
(let ((v1-68 (the-as object (-> s5-6 base))))
|
||||
(set! (-> (the-as dma-packet v1-68) dma) (new 'static 'dma-tag :id (dma-tag-id next) :addr (-> gp-6 next)))
|
||||
(set! (-> (the-as dma-packet v1-68) vif0) (new 'static 'vif-tag))
|
||||
(set! (-> (the-as dma-packet v1-68) vif1) (new 'static 'vif-tag))
|
||||
(set! (-> s5-6 base) (&+ (the-as pointer v1-68) 16))
|
||||
)
|
||||
(set! (-> gp-6 next) (the-as uint s4-10))
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((gp-7 (-> *display* frames (-> *display* on-screen) frame bucket-group (bucket-id tie-near-1))))
|
||||
(when (!= gp-7 (-> gp-7 last))
|
||||
(let* ((s4-11 (-> *display* frames (-> *display* on-screen) frame global-buf))
|
||||
(s5-7 (-> s4-11 base))
|
||||
)
|
||||
(tie-near-end-buffer s4-11)
|
||||
(let ((v1-79 (-> s4-11 base)))
|
||||
(let ((a0-74 (the-as object (-> s4-11 base))))
|
||||
(set! (-> (the-as dma-packet a0-74) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
|
||||
(set! (-> (the-as dma-packet a0-74) vif0) (new 'static 'vif-tag))
|
||||
(set! (-> (the-as dma-packet a0-74) vif1) (new 'static 'vif-tag))
|
||||
(set! (-> s4-11 base) (&+ (the-as pointer a0-74) 16))
|
||||
)
|
||||
(set! (-> (the-as (pointer uint32) (-> gp-7 last)) 1) (the-as uint s5-7))
|
||||
(set! (-> gp-7 last) (the-as (pointer dma-tag) v1-79))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; level 1's tie near
|
||||
(let ((gp-6 (-> *display* frames (-> *display* on-screen) frame bucket-group (bucket-id tie-near-1))))
|
||||
(when (!= gp-6 (-> gp-6 last))
|
||||
(let* ((s5-6 (-> *display* frames (-> *display* on-screen) frame global-buf))
|
||||
(s4-10 (-> s5-6 base))
|
||||
)
|
||||
(tie-near-init-engine
|
||||
s5-6
|
||||
(new 'static 'gs-test
|
||||
:ate #x1
|
||||
:atst (gs-atest greater-equal)
|
||||
:aref #x26
|
||||
:zte #x1
|
||||
:ztst (gs-ztest greater-equal)
|
||||
)
|
||||
0
|
||||
)
|
||||
(let ((v1-68 (the-as object (-> s5-6 base))))
|
||||
(set! (-> (the-as dma-packet v1-68) dma) (new 'static 'dma-tag :id (dma-tag-id next) :addr (-> gp-6 next)))
|
||||
(set! (-> (the-as dma-packet v1-68) vif0) (new 'static 'vif-tag))
|
||||
(set! (-> (the-as dma-packet v1-68) vif1) (new 'static 'vif-tag))
|
||||
(set! (-> s5-6 base) (&+ (the-as pointer v1-68) 16))
|
||||
)
|
||||
(set! (-> gp-6 next) (the-as uint s4-10))
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((gp-7 (-> *display* frames (-> *display* on-screen) frame bucket-group (bucket-id tie-near-1))))
|
||||
(when (!= gp-7 (-> gp-7 last))
|
||||
(let* ((s4-11 (-> *display* frames (-> *display* on-screen) frame global-buf))
|
||||
(s5-7 (-> s4-11 base))
|
||||
)
|
||||
(tie-near-end-buffer s4-11)
|
||||
(let ((v1-79 (-> s4-11 base)))
|
||||
(let ((a0-74 (the-as object (-> s4-11 base))))
|
||||
(set! (-> (the-as dma-packet a0-74) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
|
||||
(set! (-> (the-as dma-packet a0-74) vif0) (new 'static 'vif-tag))
|
||||
(set! (-> (the-as dma-packet a0-74) vif1) (new 'static 'vif-tag))
|
||||
(set! (-> s4-11 base) (&+ (the-as pointer a0-74) 16))
|
||||
)
|
||||
(set! (-> (the-as (pointer uint32) (-> gp-7 last)) 1) (the-as uint s5-7))
|
||||
(set! (-> gp-7 last) (the-as (pointer dma-tag) v1-79))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|#
|
||||
0
|
||||
(none))
|
||||
@@ -274,24 +274,24 @@
|
||||
;; The instance drawing will end up looking at too many instances, but this is fine - it
|
||||
;; should reject those, and it plenty fast.
|
||||
#|
|
||||
(when (nonzero? s4-0)
|
||||
(dotimes (s3-0 s4-0)
|
||||
(let* ((v1-10 (-> arg0 data s3-0))
|
||||
(a0-5 (-> arg0 data (+ s3-0 1)))
|
||||
(a1-2 (/ (-> (the-as drawable-inline-array-node v1-10) data 0 id) 8))
|
||||
(a0-7 (/ (-> (the-as drawable-inline-array-node a0-5) data 0 id) 8))
|
||||
(a1-4 (+ a1-2 #x38b0 #x70000000))
|
||||
(a0-9 (+ a0-7 #x38b0 #x70000000))
|
||||
)
|
||||
(draw-node-cull
|
||||
(the-as pointer a0-9)
|
||||
(the-as pointer a1-4)
|
||||
(-> (the-as drawable-inline-array-node v1-10) data)
|
||||
(-> (the-as drawable-inline-array-node v1-10) length)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (nonzero? s4-0)
|
||||
(dotimes (s3-0 s4-0)
|
||||
(let* ((v1-10 (-> arg0 data s3-0))
|
||||
(a0-5 (-> arg0 data (+ s3-0 1)))
|
||||
(a1-2 (/ (-> (the-as drawable-inline-array-node v1-10) data 0 id) 8))
|
||||
(a0-7 (/ (-> (the-as drawable-inline-array-node a0-5) data 0 id) 8))
|
||||
(a1-4 (+ a1-2 #x38b0 #x70000000))
|
||||
(a0-9 (+ a0-7 #x38b0 #x70000000))
|
||||
)
|
||||
(draw-node-cull
|
||||
(the-as pointer a0-9)
|
||||
(the-as pointer a1-4)
|
||||
(-> (the-as drawable-inline-array-node v1-10) data)
|
||||
(-> (the-as drawable-inline-array-node v1-10) length)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|#
|
||||
(let* ((v1-16 (-> arg0 data s4-0)) ;; leaves
|
||||
(s4-1 (-> arg0 prototypes prototype-array-tie)) ;; prototypes
|
||||
@@ -414,51 +414,51 @@
|
||||
(&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint s3-2)))
|
||||
(set! (-> v1-100 data 9 total) (-> v1-100 data 9 used))))))
|
||||
#|
|
||||
(when (logtest? *vu1-enable-user* (vu1-renderer-mask tie-near))
|
||||
(let ((s3-3 (-> *display* frames (-> *display* on-screen) frame global-buf base)))
|
||||
(let* ((s1-2 (-> *display* frames (-> *display* on-screen) frame global-buf))
|
||||
(s2-3 (-> s1-2 base))
|
||||
)
|
||||
(set! (-> *prototype-tie-work* near-wait-to-spr) (the-as uint 0))
|
||||
(set! (-> *prototype-tie-work* near-wait-from-spr) (the-as uint 0))
|
||||
(reset! (-> *perf-stats* data 12))
|
||||
;;(draw-inline-array-prototype-tie-near-asm s1-2 s5-1 s4-1)
|
||||
(read! (-> *perf-stats* data 12))
|
||||
(update-wait-stats (-> *perf-stats* data 12) (the-as uint 0)
|
||||
(-> *prototype-tie-work* near-wait-to-spr)
|
||||
(-> *prototype-tie-work* near-wait-from-spr)
|
||||
)
|
||||
(let ((a3-16 (-> s1-2 base)))
|
||||
(let ((v1-123 (the-as object (-> s1-2 base))))
|
||||
(set! (-> (the-as dma-packet v1-123) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
|
||||
(set! (-> (the-as dma-packet v1-123) vif0) (new 'static 'vif-tag))
|
||||
(set! (-> (the-as dma-packet v1-123) vif1) (new 'static 'vif-tag))
|
||||
(set! (-> s1-2 base) (&+ (the-as pointer v1-123) 16))
|
||||
)
|
||||
(dma-bucket-insert-tag
|
||||
(-> *display* frames (-> *display* on-screen) frame bucket-group)
|
||||
(if (zero? (-> arg1 index))
|
||||
(bucket-id tie-near-0)
|
||||
(bucket-id tie-near-1)
|
||||
)
|
||||
s2-3
|
||||
(the-as (pointer dma-tag) a3-16)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((a0-92 *dma-mem-usage*))
|
||||
(when (nonzero? a0-92)
|
||||
(set! (-> a0-92 length) (max 16 (-> a0-92 length)))
|
||||
(set! (-> a0-92 data 15 name) "tie-near")
|
||||
(+! (-> a0-92 data 15 count) 1)
|
||||
(+! (-> a0-92 data 15 used)
|
||||
(&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint s3-3))
|
||||
)
|
||||
(set! (-> a0-92 data 15 total) (-> a0-92 data 15 used))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (logtest? *vu1-enable-user* (vu1-renderer-mask tie-near))
|
||||
(let ((s3-3 (-> *display* frames (-> *display* on-screen) frame global-buf base)))
|
||||
(let* ((s1-2 (-> *display* frames (-> *display* on-screen) frame global-buf))
|
||||
(s2-3 (-> s1-2 base))
|
||||
)
|
||||
(set! (-> *prototype-tie-work* near-wait-to-spr) (the-as uint 0))
|
||||
(set! (-> *prototype-tie-work* near-wait-from-spr) (the-as uint 0))
|
||||
(reset! (-> *perf-stats* data 12))
|
||||
;;(draw-inline-array-prototype-tie-near-asm s1-2 s5-1 s4-1)
|
||||
(read! (-> *perf-stats* data 12))
|
||||
(update-wait-stats (-> *perf-stats* data 12) (the-as uint 0)
|
||||
(-> *prototype-tie-work* near-wait-to-spr)
|
||||
(-> *prototype-tie-work* near-wait-from-spr)
|
||||
)
|
||||
(let ((a3-16 (-> s1-2 base)))
|
||||
(let ((v1-123 (the-as object (-> s1-2 base))))
|
||||
(set! (-> (the-as dma-packet v1-123) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
|
||||
(set! (-> (the-as dma-packet v1-123) vif0) (new 'static 'vif-tag))
|
||||
(set! (-> (the-as dma-packet v1-123) vif1) (new 'static 'vif-tag))
|
||||
(set! (-> s1-2 base) (&+ (the-as pointer v1-123) 16))
|
||||
)
|
||||
(dma-bucket-insert-tag
|
||||
(-> *display* frames (-> *display* on-screen) frame bucket-group)
|
||||
(if (zero? (-> arg1 index))
|
||||
(bucket-id tie-near-0)
|
||||
(bucket-id tie-near-1)
|
||||
)
|
||||
s2-3
|
||||
(the-as (pointer dma-tag) a3-16)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((a0-92 *dma-mem-usage*))
|
||||
(when (nonzero? a0-92)
|
||||
(set! (-> a0-92 length) (max 16 (-> a0-92 length)))
|
||||
(set! (-> a0-92 data 15 name) "tie-near")
|
||||
(+! (-> a0-92 data 15 count) 1)
|
||||
(+! (-> a0-92 data 15 used)
|
||||
(&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint s3-3))
|
||||
)
|
||||
(set! (-> a0-92 data 15 total) (-> a0-92 data 15 used))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|#
|
||||
))))
|
||||
0)
|
||||
|
||||
@@ -53,10 +53,10 @@
|
||||
(the-as int (+ (-> drawable-inline-array-instance-tie size) (* (+ (-> this length) -1) 64))))
|
||||
|
||||
#|
|
||||
;; for some reason, this showed up twice.
|
||||
(defmethod login ((this drawable-tree-instance-tie))
|
||||
this
|
||||
)
|
||||
;; for some reason, this showed up twice.
|
||||
(defmethod login ((this drawable-tree-instance-tie))
|
||||
this
|
||||
)
|
||||
|#
|
||||
|
||||
(defmethod login ((this drawable-tree-instance-tie))
|
||||
|
||||
@@ -259,7 +259,7 @@
|
||||
:border? #f
|
||||
:want-level #f
|
||||
:load-commands
|
||||
()
|
||||
'()
|
||||
:play? #f
|
||||
:level0
|
||||
(new 'static
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -450,12 +450,12 @@
|
||||
;;(.mfc0 current-timer Count)
|
||||
;; this would quit the login function after some amount of time elapsed.
|
||||
#|
|
||||
(let ((elapsed-timer (- current-timer initial-timer)))
|
||||
(when (< #x186a0 elapsed-timer)
|
||||
(set! loaded-level loaded-level)
|
||||
(goto cfg-78)
|
||||
)
|
||||
)
|
||||
(let ((elapsed-timer (- current-timer initial-timer)))
|
||||
(when (< #x186a0 elapsed-timer)
|
||||
(set! loaded-level loaded-level)
|
||||
(goto cfg-78)
|
||||
)
|
||||
)
|
||||
|#
|
||||
(let ((current-login-pos (the-as int (-> level-login-state pos))))
|
||||
;; Login state -1.
|
||||
@@ -993,7 +993,7 @@
|
||||
(set! *display-profile* #f)
|
||||
(set! *cheat-mode* (if *debug-segment* 'debug #f))
|
||||
(set! *time-of-day-fast* #f)
|
||||
(load-commands-set! *level* ())
|
||||
(load-commands-set! *level* '())
|
||||
(when *time-of-day-proc*
|
||||
(set! (-> *time-of-day-proc* 0 time-ratio) (fsec 1.0))
|
||||
(set! (-> *time-of-day-proc* 0 hour) 7) ;; 7AM waking up in the morning
|
||||
|
||||
@@ -1036,7 +1036,7 @@
|
||||
(set! (-> this want 1 display?) #f)
|
||||
(set! (-> this want 1 force-vis?) #f)
|
||||
(set! (-> this want 1 force-inside?) #f)
|
||||
(set! (-> this command-list) ())
|
||||
(set! (-> this command-list) '())
|
||||
(dotimes (v1-1 256)
|
||||
(set! (-> this object-name v1-1) #f)
|
||||
(set! (-> this object-status v1-1) (the-as basic 0)))
|
||||
@@ -1117,7 +1117,7 @@
|
||||
(format 0 "WARNING: load state somehow aquired object command ~A~%" (-> this object-name s4-0))
|
||||
(set! (-> this object-name s4-0) #f)))
|
||||
(mem-copy! (&-> *backup-load-state* type) (&-> this type) 2092)
|
||||
(set! (-> *backup-load-state* command-list) ())
|
||||
(set! (-> *backup-load-state* command-list) '())
|
||||
(set! (-> this command-list) arg0)
|
||||
0)
|
||||
|
||||
@@ -1315,7 +1315,7 @@
|
||||
(set! (-> *time-of-day-proc* 0 time-ratio) 0.0))))))
|
||||
((= v1-4 'save)
|
||||
(mem-copy! (&-> *backup-load-state* type) (&-> this type) 2092)
|
||||
(set! (-> *backup-load-state* command-list) ())
|
||||
(set! (-> *backup-load-state* command-list) '())
|
||||
(dotimes (v1-112 256)
|
||||
(if (-> *backup-load-state* object-name v1-112) (set! (-> *backup-load-state* object-name v1-112) #f))))
|
||||
((= v1-4 'setting-reset)
|
||||
|
||||
@@ -23,7 +23,8 @@
|
||||
(local-vars (current-input int) (copy-length int))
|
||||
(nop!)
|
||||
(loop
|
||||
(loop ;; read the input and see what kind it is, based on number.
|
||||
(loop
|
||||
;; read the input and see what kind it is, based on number.
|
||||
(set! current-input (-> in 0))
|
||||
(set! in (&-> in 1))
|
||||
(b! (<= current-input 0) cfg-5 :delay (nop!))
|
||||
|
||||
@@ -99,9 +99,9 @@ struct DgoHeader {
|
||||
(define *load-str-rpc* (new 'global 'rpc-buffer-pair (the uint 64) (the uint 1) RPC-LOAD-STR))
|
||||
(define *play-str-rpc* (new 'global 'rpc-buffer-pair (the uint 64) (the uint 2) RPC-PLAY-STR))
|
||||
;; we have separate locks for queuing and loading.
|
||||
(define *load-str-lock* #f)
|
||||
(define *que-str-lock* #f)
|
||||
(define *dgo-name* (new 'global 'string 64 (the string #f))))
|
||||
(define *load-str-lock* '#f)
|
||||
(define *que-str-lock* '#f)
|
||||
(define *dgo-name* (new 'global 'string 64 (the string '#f))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; STR LOAD
|
||||
|
||||
@@ -94,10 +94,10 @@
|
||||
(cond
|
||||
((type-type? (-> arg0 type) string)
|
||||
#|
|
||||
(with-sp (protect sp
|
||||
(if (< sp *stack-top*)
|
||||
(set! sp (&+ *kernel-sp* -1024))
|
||||
)
|
||||
(with-sp (protect sp
|
||||
(if (< sp *stack-top*)
|
||||
(set! sp (&+ *kernel-sp* -1024))
|
||||
)
|
||||
|#
|
||||
(let ((s5-1 (the-as drawable (loado (the-as string arg0) arg1))))
|
||||
(if (and s5-1 (type-type? (-> s5-1 type) drawable)) (login s5-1)))
|
||||
@@ -108,10 +108,10 @@
|
||||
(defun art-load ((arg0 string) (arg1 kheap))
|
||||
"Load an art file. Unused."
|
||||
#|
|
||||
(with-sp (protect sp
|
||||
(if (< sp *stack-top*)
|
||||
(set! sp (&+ *kernel-sp* -1024))
|
||||
)
|
||||
(with-sp (protect sp
|
||||
(if (< sp *stack-top*)
|
||||
(set! sp (&+ *kernel-sp* -1024))
|
||||
)
|
||||
|#
|
||||
(let ((s5-0 (the-as art (loado arg0 arg1)))) (if (type-type? (-> s5-0 type) art) (login s5-0) (the-as art #f)))
|
||||
;;))
|
||||
@@ -121,10 +121,10 @@
|
||||
"Load and check an art-group file. this only runs if we're using debug memory."
|
||||
(when *debug-segment*
|
||||
#|
|
||||
(with-sp (protect sp
|
||||
(if (< sp *stack-top*)
|
||||
(set! sp (&+ *kernel-sp* -1024))
|
||||
)
|
||||
(with-sp (protect sp
|
||||
(if (< sp *stack-top*)
|
||||
(set! sp (&+ *kernel-sp* -1024))
|
||||
)
|
||||
|#
|
||||
(let ((s3-1 (the-as art-group (loado (make-file-name (file-kind art-group) arg0 arg2 #f) arg1))))
|
||||
(cond
|
||||
@@ -658,7 +658,7 @@
|
||||
(backup-load-state-and-set-cmds *load-state* (-> arg0 command-list))
|
||||
(set-setting! 'spooling (process->ppointer self) 0.0 0)
|
||||
(logior! (-> self skel status) (janim-status inited drawn done))
|
||||
(kill-current-level-hint () () 'die)
|
||||
(kill-current-level-hint '() '() 'die)
|
||||
(level-hint-surpress!)
|
||||
(apply-settings *setting-control*)
|
||||
(when (or (handle->process (-> *art-control* spool-lock)) (!= *master-mode* 'game))
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
((= (length regs) 2) (set! y (car regs)) (set! z (cadr regs)) (set! w (cadr regs)))
|
||||
((>= (length regs) 3) (set! y (car regs)) (set! z (cadr regs)) (set! w (caddr regs)))
|
||||
(#t (set! y reg1) (set! z reg1) (set! w reg1)))
|
||||
(cons x (cons y (cons z (cons w ()))))))
|
||||
(cons x (cons y (cons z (cons w '()))))))
|
||||
|
||||
(desfun .vf.x (vec)
|
||||
(car vec))
|
||||
|
||||
@@ -151,9 +151,7 @@
|
||||
(.svf (&-> arg0 vec quad) vf1)
|
||||
arg0))
|
||||
|
||||
(defun quaternion-float /
|
||||
!
|
||||
((arg0 quaternion) (arg1 quaternion) (arg2 float))
|
||||
(defun quaternion-float/! ((arg0 quaternion) (arg1 quaternion) (arg2 float))
|
||||
"Divide each element"
|
||||
(let ((f0-1 (/ 1.0 arg2))) (quaternion-float*! arg0 arg1 f0-1))
|
||||
arg0)
|
||||
@@ -585,7 +583,7 @@
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector))
|
||||
(gp-0 (new 'stack-no-clear 'vector))
|
||||
(s5-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-rad<-vector-deg / 2 ! s4-0 arg1)
|
||||
(vector-rad<-vector-deg/2! s4-0 arg1)
|
||||
(vector-sincos-rad! gp-0 s5-0 s4-0)
|
||||
(.lvf vf1 (&-> gp-0 quad))
|
||||
(.lvf vf2 (&-> s5-0 quad)))
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
(defun-extern vector-sin-rad! vector vector vector)
|
||||
|
||||
(defun-extern vector-rad<-vector-deg / 2 ! vector vector int)
|
||||
(defun-extern vector-rad<-vector-deg/2! vector vector int)
|
||||
|
||||
(defun-extern vector-sincos-rad! vector vector vector int)
|
||||
|
||||
|
||||
@@ -614,10 +614,7 @@
|
||||
(.mul.x.vf vf1 vf1 rot-to-rad)
|
||||
(.svf out vf1)))
|
||||
|
||||
(defun vector-rad<-vector-deg /
|
||||
2
|
||||
!
|
||||
((out vector) (in vector))
|
||||
(defun vector-rad<-vector-deg/2! ((out vector) (in vector))
|
||||
"Divide the input by two, and then convert from rotation units to radians, unwrapping.
|
||||
Not sure why this really needs to be separate the from previous function..."
|
||||
(rlet ((temp :class vf)
|
||||
|
||||
@@ -88,9 +88,7 @@
|
||||
(.svf (&-> arg0 quad) vf6)
|
||||
arg0))
|
||||
|
||||
(defun vector /
|
||||
!
|
||||
((arg0 vector) (arg1 vector) (arg2 vector))
|
||||
(defun vector/! ((arg0 vector) (arg1 vector) (arg2 vector))
|
||||
"Set arg0 = arg1 / arg2. The w component will be set to 1.
|
||||
The implementation is kind of crazy."
|
||||
(rlet ((Q :class vf)
|
||||
@@ -191,9 +189,7 @@
|
||||
(.svf (&-> arg0 quad) vf4)
|
||||
arg0))
|
||||
|
||||
(defun vector-float /
|
||||
!
|
||||
((arg0 vector) (arg1 vector) (arg2 float))
|
||||
(defun vector-float/! ((arg0 vector) (arg1 vector) (arg2 float))
|
||||
"Divide all components by arg2. The w component will be set to 1."
|
||||
(rlet ((Q :class vf)
|
||||
(vf0 :class vf)
|
||||
|
||||
@@ -334,7 +334,7 @@
|
||||
(lambda (x i)
|
||||
`((,i)
|
||||
(if (cpad-pressed? ,pad-idx ,x)
|
||||
,(if (< i (- (length buttons) 1)) `(1 +! ,cheat-var) `(begin ,@body (set! ,cheat-var 0)))
|
||||
,(if (< i (- (length buttons) 1)) `(1+! ,cheat-var) `(begin ,@body (set! ,cheat-var 0)))
|
||||
(set! ,cheat-var 0))))
|
||||
buttons))))
|
||||
|
||||
|
||||
@@ -29,9 +29,7 @@
|
||||
;; it's a real timer.
|
||||
`(the uint (logand #xffffffff (__read-ee-timer))))
|
||||
|
||||
(defmacro get-bus-clock /
|
||||
256
|
||||
()
|
||||
(defmacro get-bus-clock/256 ()
|
||||
"Read the 150 MHz / 256 clock."
|
||||
;; 300 MHz / (2^9)
|
||||
`(the uint (logand #xffffffff (shr (__read-ee-timer) 9))))
|
||||
@@ -46,8 +44,8 @@
|
||||
(defenum timer-clock-selection
|
||||
:type uint8
|
||||
(busclk 0)
|
||||
(busclk / 16 1)
|
||||
(busclk / 256 2)
|
||||
(busclk/16 1)
|
||||
(busclk/256 2)
|
||||
(hblank 3))
|
||||
|
||||
;; DECOMP BEGINS
|
||||
@@ -97,7 +95,7 @@
|
||||
|
||||
;; needs PS2 TIMER porting
|
||||
(#unless PC_PORT
|
||||
(timer-init (the-as timer-bank TIMER1_BANK) (new 'static 'timer-mode :clks (timer-clock-selection busclk / 16) :cue 1)))
|
||||
(timer-init (the-as timer-bank TIMER1_BANK) (new 'static 'timer-mode :clks (timer-clock-selection busclk/16) :cue 1)))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Profiler
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
"Reset a timer's counter to zero"
|
||||
(#when PC_PORT
|
||||
;; just store the current offset.
|
||||
(if (= timer TIMER1_BANK) (set! *timer-reset-value* (get-bus-clock / 256)) (format 0 "Unknown timer #x~X in timer-reset~%"))
|
||||
(if (= timer TIMER1_BANK) (set! *timer-reset-value* (get-bus-clock/256)) (format 0 "Unknown timer #x~X in timer-reset~%"))
|
||||
(return (the uint 0)))
|
||||
(.sync.l)
|
||||
(set! (-> timer count) 0)
|
||||
@@ -26,7 +26,7 @@
|
||||
"Return a timer's counter value"
|
||||
(#when PC_PORT
|
||||
(when (= timer TIMER1_BANK)
|
||||
(return (- (get-bus-clock / 256) *timer-reset-value*)))
|
||||
(return (- (get-bus-clock/256) *timer-reset-value*)))
|
||||
(format 0 "Unknown timer #x~X requested.~%" timer))
|
||||
(.sync.l)
|
||||
(let ((count (-> timer count))) (.sync.l) count))
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
'readwrite (or 'rw) means both
|
||||
#f means neither, turning this into a fancy macro around rlet."
|
||||
`(rlet (,@(apply (lambda (x) `(,x :class vf)) regs))
|
||||
,@(if (or (eq? rw 'read) (eq? rw 'readwrite) (eq? rw 'rw)) (apply (lambda (y) `(load-vf ,y)) regs) ())
|
||||
,@(if (or (eq? rw 'read) (eq? rw 'readwrite) (eq? rw 'rw)) (apply (lambda (y) `(load-vf ,y)) regs) '())
|
||||
,@body
|
||||
;; this will mess up the return value!
|
||||
,@(if (or (eq? rw 'write) (eq? rw 'readwrite) (eq? rw 'rw)) (apply (lambda (y) `(save-vf ,y)) regs) ())))
|
||||
,@(if (or (eq? rw 'write) (eq? rw 'readwrite) (eq? rw 'rw)) (apply (lambda (y) `(save-vf ,y)) regs) '())))
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
`(zero? (-> *sound-iop-info* dirtycd)))
|
||||
|
||||
(defun new-sound-id ()
|
||||
(set! *current-sound-id* (the sound-id (1 + (the uint *current-sound-id*))))
|
||||
(set! *current-sound-id* (the sound-id (1+ (the uint *current-sound-id*))))
|
||||
(if (< (the-as int *current-sound-id*) #x10000) (set! *current-sound-id* (the-as sound-id #x10000)))
|
||||
*current-sound-id*)
|
||||
|
||||
@@ -218,9 +218,9 @@
|
||||
|
||||
(defun sound-trans-convert ((dest vector3w) (src vector))
|
||||
(let ((vec (if src src (ear-trans))))
|
||||
(set! (-> dest x) (the int (* (1 / 16) (-> vec x))))
|
||||
(set! (-> dest y) (the int (* (1 / 16) (-> vec y))))
|
||||
(set! (-> dest z) (the int (* (1 / 16) (-> vec z)))))
|
||||
(set! (-> dest x) (the int (* (1/ 16) (-> vec x))))
|
||||
(set! (-> dest y) (the int (* (1/ 16) (-> vec y))))
|
||||
(set! (-> dest z) (the int (* (1/ 16) (-> vec z)))))
|
||||
0)
|
||||
|
||||
(defun sound-angle-convert ((deg float))
|
||||
@@ -474,7 +474,7 @@
|
||||
(format #t "(~5D) effect sound ~A ~G " (-> *display* base-frame-counter) (-> pp name) (-> spec sound-name-char))
|
||||
(format #t
|
||||
"volume: ~f pitch-mod: ~f~%"
|
||||
(* (1 / 10.24) (the float (-> spec volume)))
|
||||
(* (1/ 10.24) (the float (-> spec volume)))
|
||||
(* 0.000656168 (the float (-> spec pitch-mod))))))
|
||||
(let ((spec-volume (-> spec volume)))
|
||||
(set! (-> spec volume) (-> this volume))
|
||||
@@ -641,10 +641,10 @@
|
||||
(set! (-> *flava-table* row (-> *flava-table* count) flava n) 0))
|
||||
;; increase the music count
|
||||
;; (this should probably be done after...)
|
||||
(1 +! (-> *flava-table* count))
|
||||
(1+! (-> *flava-table* count))
|
||||
;; set the flavas or whatever they're called
|
||||
,@(apply (lambda (x)
|
||||
`(set! (-> *flava-table* row (1 - (-> *flava-table* count)) flava (music-flava ,(first x))) ,(second x)))
|
||||
`(set! (-> *flava-table* row (1- (-> *flava-table* count)) flava (music-flava ,(first x))) ,(second x)))
|
||||
flavas)))
|
||||
|
||||
(flava-table-add village1
|
||||
|
||||
@@ -359,7 +359,7 @@
|
||||
(+! gp-0 1)
|
||||
(+! v1-0 -1)
|
||||
(set! a1-6 (-> self control history-data (logand (+ (-> self control unknown-halfword00) v1-0) 127)))))
|
||||
(vector-float / ! s5-0 s5-0 (the float gp-0))
|
||||
(vector-float/! s5-0 s5-0 (the float gp-0))
|
||||
(let ((s4-0 (- 128 gp-0)))
|
||||
(while (< s4-0 128)
|
||||
(let ((v1-9 (-> self control history-data (logand (+ (-> self control unknown-halfword00) s4-0) 127))))
|
||||
@@ -1243,7 +1243,7 @@
|
||||
(set! (-> self control unknown-surface01 name) 'current)
|
||||
(set! (-> self control unknown-surface01 active-hook) nothing)
|
||||
(set! (-> self control unknown-surface01 touch-hook) nothing)
|
||||
(initialize-skeleton self *jchar-sg* ())
|
||||
(initialize-skeleton self *jchar-sg* '())
|
||||
(set! (-> self draw origin-joint-index) (the-as uint 33))
|
||||
(set! (-> self draw shadow-joint-index) (the-as uint 33))
|
||||
(let ((v1-79 (-> self node-list data)))
|
||||
@@ -1260,7 +1260,7 @@
|
||||
(set! (-> self neck) (new 'process 'joint-mod (joint-mod-handler-mode look-at) self 7))
|
||||
(set! (-> self fact)
|
||||
(new 'process 'fact-info-target self (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)))
|
||||
(set! (-> self sound) (new 'process 'ambient-sound none (-> self control trans)))
|
||||
(set! (-> self sound) (new 'process 'ambient-sound 'none (-> self control trans)))
|
||||
(set! (-> self control unknown-soundid00) (new-sound-id))
|
||||
(if *debug-segment* (add-connection *debug-engine* self target-print-stats self *stdcon0* #f))
|
||||
(activate-hud self)
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
(set! (-> self root) (new 'process 'trsqv))
|
||||
(vector-identity! (-> self root scale))
|
||||
(quaternion-identity! (-> self root quat))
|
||||
(initialize-skeleton self *sidekick-sg* ())
|
||||
(initialize-skeleton self *sidekick-sg* '())
|
||||
(set! (-> self draw origin-joint-index) (the-as uint 6))
|
||||
(set! (-> self draw shadow-joint-index) (the-as uint 6))
|
||||
(set! (-> self draw shadow-ctrl) *target-shadow-control*)
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
(not (logtest? (-> arg0 flags) (continue-flags sage-intro title))))
|
||||
(remove-setting! 'music-volume)))
|
||||
(suspend)))
|
||||
(backup-load-state-and-set-cmds *load-state* ())
|
||||
(backup-load-state-and-set-cmds *load-state* '())
|
||||
(execute-command *load-state* '(teleport))
|
||||
(let* ((s5-0 (-> arg0 load-commands))
|
||||
(a1-18 (car s5-0)))
|
||||
@@ -623,17 +623,17 @@
|
||||
'boxed-array
|
||||
:type
|
||||
spool-anim
|
||||
(new 'static 'spool-anim :name "death-0181" :index 3 :parts 1 :command-list ())
|
||||
(new 'static 'spool-anim :name "death-0182" :index 4 :parts 1 :command-list ())
|
||||
(new 'static 'spool-anim :name "death-0184" :index 5 :parts 1 :command-list ())
|
||||
(new 'static 'spool-anim :name "death-0186" :index 6 :parts 1 :command-list ())
|
||||
(new 'static 'spool-anim :name "death-0187" :index 7 :parts 1 :command-list ())
|
||||
(new 'static 'spool-anim :name "death-0191" :index 8 :parts 1 :command-list ())
|
||||
(new 'static 'spool-anim :name "death-0193" :index 9 :parts 2 :command-list ())
|
||||
(new 'static 'spool-anim :name "death-0195" :index 10 :parts 1 :command-list ())
|
||||
(new 'static 'spool-anim :name "death-0197" :index 11 :parts 2 :command-list ())
|
||||
(new 'static 'spool-anim :name "death-0199" :index 12 :parts 2 :command-list ())
|
||||
(new 'static 'spool-anim :name "death-0202" :index 13 :parts 1 :command-list ())))
|
||||
(new 'static 'spool-anim :name "death-0181" :index 3 :parts 1 :command-list '())
|
||||
(new 'static 'spool-anim :name "death-0182" :index 4 :parts 1 :command-list '())
|
||||
(new 'static 'spool-anim :name "death-0184" :index 5 :parts 1 :command-list '())
|
||||
(new 'static 'spool-anim :name "death-0186" :index 6 :parts 1 :command-list '())
|
||||
(new 'static 'spool-anim :name "death-0187" :index 7 :parts 1 :command-list '())
|
||||
(new 'static 'spool-anim :name "death-0191" :index 8 :parts 1 :command-list '())
|
||||
(new 'static 'spool-anim :name "death-0193" :index 9 :parts 2 :command-list '())
|
||||
(new 'static 'spool-anim :name "death-0195" :index 10 :parts 1 :command-list '())
|
||||
(new 'static 'spool-anim :name "death-0197" :index 11 :parts 2 :command-list '())
|
||||
(new 'static 'spool-anim :name "death-0199" :index 12 :parts 2 :command-list '())
|
||||
(new 'static 'spool-anim :name "death-0202" :index 13 :parts 1 :command-list '())))
|
||||
|
||||
(if (!= *kernel-boot-message* 'play) (set! (-> *death-spool-array* length) 3))
|
||||
|
||||
@@ -698,7 +698,7 @@
|
||||
(set! (-> self control transv quad) (the-as uint128 0))
|
||||
(logior! (-> self state-flags) (state-flags dying))
|
||||
(case arg0
|
||||
((none 'instant-death))
|
||||
(('none 'instant-death))
|
||||
(('ogreboss-super-boulder)
|
||||
;; og:preserve-this PAL patch here
|
||||
(process-spawn part-tracker
|
||||
@@ -902,7 +902,7 @@
|
||||
(send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim)
|
||||
(send-event (ppointer->process (-> self sidekick)) 'shadow #f)
|
||||
(send-event self 'blend-shape #t)
|
||||
(let ((s5-8 (ppointer->handle (process-spawn pov-camera (-> self control trans) *deathcam-sg* gp-18 4 self () :to *target-pool*))))
|
||||
(let ((s5-8 (ppointer->handle (process-spawn pov-camera (-> self control trans) *deathcam-sg* gp-18 4 self '() :to *target-pool*))))
|
||||
(send-event (handle->process s5-8) 'music-movie-volume 0.0)
|
||||
(send-event (handle->process s5-8) 'sfx-movie-volume 50.0)
|
||||
(set! (-> self post-hook) target-no-ja-move-post)
|
||||
|
||||
@@ -64,16 +64,16 @@
|
||||
(cond
|
||||
((zero? v1-2)
|
||||
(set! (-> self control unknown-uint20)
|
||||
(the-as uint (new 'static 'spool-anim :name "eichar-ambient-1" :index #xe7 :parts 1 :command-list ()))))
|
||||
(the-as uint (new 'static 'spool-anim :name "eichar-ambient-1" :index #xe7 :parts 1 :command-list '()))))
|
||||
((= v1-2 1)
|
||||
(set! (-> self control unknown-uint20)
|
||||
(the-as uint (new 'static 'spool-anim :name "eichar-ambient-2" :index #xe8 :parts 1 :command-list ()))))
|
||||
(the-as uint (new 'static 'spool-anim :name "eichar-ambient-2" :index #xe8 :parts 1 :command-list '()))))
|
||||
((= v1-2 2)
|
||||
(set! (-> self control unknown-uint20)
|
||||
(the-as uint (new 'static 'spool-anim :name "eichar-ambient-3" :index #xe9 :parts 1 :command-list ()))))
|
||||
(the-as uint (new 'static 'spool-anim :name "eichar-ambient-3" :index #xe9 :parts 1 :command-list '()))))
|
||||
(else
|
||||
(set! (-> self control unknown-uint20)
|
||||
(the-as uint (new 'static 'spool-anim :name "eichar-ambient-4" :index #xea :parts 1 :command-list ()))))))
|
||||
(the-as uint (new 'static 'spool-anim :name "eichar-ambient-4" :index #xea :parts 1 :command-list '()))))))
|
||||
(set-time! (-> self state-time)))
|
||||
:exit
|
||||
(behavior ()
|
||||
|
||||
@@ -319,7 +319,7 @@
|
||||
(defmethod set-transition-progress! ((this progress) (arg0 int))
|
||||
(set! (-> this transition-offset) arg0)
|
||||
(set! (-> this transition-offset-invert) (- 512 arg0))
|
||||
(set! (-> this transition-percentage) (* (1 / 512) (the float arg0)))
|
||||
(set! (-> this transition-percentage) (* (1/ 512) (the float arg0)))
|
||||
(set! (-> this transition-percentage-invert) (- 1.0 (-> this transition-percentage)))
|
||||
0
|
||||
(none))
|
||||
@@ -503,7 +503,7 @@
|
||||
(the-as progress ((method-of-type process relocate) this arg0)))
|
||||
|
||||
(defmethod adjust-sprites ((this progress))
|
||||
(let ((f0-1 (* (1 / METER_LENGTH) (the float (-> this in-out-position)))))
|
||||
(let ((f0-1 (* (1/ METER_LENGTH) (the float (-> this in-out-position)))))
|
||||
(set! (-> this particles 2 init-pos x) (the float (+ (-> this right-x-offset) 409 (the int (* 301.5 f0-1)))))
|
||||
(set! (-> this particles 1 init-pos x) (the float (+ (-> this left-x-offset) 59)))
|
||||
(set! (-> this left-side-x-scale)
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
;; DECOMP BEGINS
|
||||
|
||||
;; State of text drawing.
|
||||
(define *game-text-word* (new 'global 'string 128 (the string #f)))
|
||||
(define *game-text-word* (new 'global 'string 128 (the string '#f)))
|
||||
|
||||
(define *game-text-line* (new 'global 'string 256 (the string #f)))
|
||||
(define *game-text-line* (new 'global 'string 256 (the string '#f)))
|
||||
|
||||
(define *level-text-file-load-flag* #t)
|
||||
|
||||
@@ -45,12 +45,12 @@
|
||||
|
||||
(defmethod inspect ((this game-text-info))
|
||||
"Print a game text info, including all strings"
|
||||
(format #t "[~8x] ~A~%" this (-> this type))
|
||||
(format #t "~Tlength: ~D~%" (-> this length))
|
||||
(format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data))
|
||||
(format '#t "[~8x] ~A~%" this (-> this type))
|
||||
(format '#t "~Tlength: ~D~%" (-> this length))
|
||||
(format '#t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data))
|
||||
(let ((i 0))
|
||||
(while (< i (-> this length))
|
||||
(format #t "~T [~D] #x~X ~A~%" i (-> this data i id) (-> this data i text))
|
||||
(format '#t "~T [~D] #x~X ~A~%" i (-> this data i id) (-> this data i text))
|
||||
(+! i 1)))
|
||||
this)
|
||||
|
||||
|
||||
@@ -158,71 +158,71 @@
|
||||
(set! (-> origin z) (* (cos (* 3.0 (degrees dbg2))) (meters 100.)))
|
||||
(+! (-> origin x) (meters -50.)))
|
||||
#|
|
||||
;;; PROBE (at the frag finding level)
|
||||
|
||||
;; setup the collide work
|
||||
(setup-collide-for-line-sphere origin line radius)
|
||||
|
||||
|
||||
|
||||
;; clear collide list
|
||||
(set! (-> *collide-list* num-items) 0)
|
||||
|
||||
;; loop over active levels
|
||||
(dotimes (lev-idx (-> *level* length))
|
||||
(let ((lev (-> *level* level lev-idx)))
|
||||
(when (= (-> lev status) 'active)
|
||||
;; do the collision check!
|
||||
(collide-ray (-> lev bsp) 0 *collide-list*)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; print results
|
||||
(format *stdcon* "got ~d in list~%" (-> *collide-list* num-items))
|
||||
(format *stdcon* "cam at: ~`vector`P~%" (camera-pos))
|
||||
|
||||
(let ((old-count 0))
|
||||
;; visualize results
|
||||
(dotimes (i (-> *collide-list* num-items))
|
||||
(let ((mesh (the collide-frag-mesh (-> *collide-list* items i mesh)))
|
||||
(inst (the instance-tie (-> *collide-list* items i inst))))
|
||||
(when inst
|
||||
(+! old-count 1)
|
||||
(add-debug-sphere #t (bucket-id debug-draw0) (-> inst bsphere) (-> inst bsphere w) (new 'static 'rgba :b #x80 :a #x80))
|
||||
)
|
||||
|
||||
(when (not inst)
|
||||
(+! old-count 1)
|
||||
;;(format *stdcon* "NI: ~A~%" mesh)
|
||||
(add-debug-sphere #t (bucket-id debug-draw0) (vector-as-floats (-> mesh base-trans)) (meters 5.0) (new 'static 'rgba :g #x80 :a #x80))
|
||||
)
|
||||
;
|
||||
)
|
||||
)
|
||||
|
||||
;; now test the other one
|
||||
(set! (-> *collide-list* num-items) 0)
|
||||
(collide-probe-make-list (-> *level* level 0) *collide-list*)
|
||||
|
||||
;; these should come out the same, if we did it right.
|
||||
(format *stdcon* "COMPARE: ~d ~d~%" (-> *collide-list* num-items) old-count)
|
||||
|
||||
(dotimes (i (-> *collide-list* num-items))
|
||||
(let ((mesh (the collide-frag-mesh (-> *collide-list* items i mesh)))
|
||||
(inst (the instance-tie (-> *collide-list* items i inst))))
|
||||
(when inst
|
||||
(add-debug-sphere #t (bucket-id debug-draw0) (-> inst bsphere) (* 0.95 (-> inst bsphere w)) (new 'static 'rgba :b #x80 :r #x80 :a #x80))
|
||||
)
|
||||
|
||||
(when (not inst)
|
||||
;;(format *stdcon* "NI: ~A~%" mesh)
|
||||
(add-debug-sphere #t (bucket-id debug-draw0) (vector-as-floats (-> mesh base-trans)) (meters 6.0) (new 'static 'rgba :g #x30 :a #x80))
|
||||
)
|
||||
;
|
||||
)
|
||||
)
|
||||
)
|
||||
;;; PROBE (at the frag finding level)
|
||||
|
||||
;; setup the collide work
|
||||
(setup-collide-for-line-sphere origin line radius)
|
||||
|
||||
|
||||
|
||||
;; clear collide list
|
||||
(set! (-> *collide-list* num-items) 0)
|
||||
|
||||
;; loop over active levels
|
||||
(dotimes (lev-idx (-> *level* length))
|
||||
(let ((lev (-> *level* level lev-idx)))
|
||||
(when (= (-> lev status) 'active)
|
||||
;; do the collision check!
|
||||
(collide-ray (-> lev bsp) 0 *collide-list*)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; print results
|
||||
(format *stdcon* "got ~d in list~%" (-> *collide-list* num-items))
|
||||
(format *stdcon* "cam at: ~`vector`P~%" (camera-pos))
|
||||
|
||||
(let ((old-count 0))
|
||||
;; visualize results
|
||||
(dotimes (i (-> *collide-list* num-items))
|
||||
(let ((mesh (the collide-frag-mesh (-> *collide-list* items i mesh)))
|
||||
(inst (the instance-tie (-> *collide-list* items i inst))))
|
||||
(when inst
|
||||
(+! old-count 1)
|
||||
(add-debug-sphere #t (bucket-id debug-draw0) (-> inst bsphere) (-> inst bsphere w) (new 'static 'rgba :b #x80 :a #x80))
|
||||
)
|
||||
|
||||
(when (not inst)
|
||||
(+! old-count 1)
|
||||
;;(format *stdcon* "NI: ~A~%" mesh)
|
||||
(add-debug-sphere #t (bucket-id debug-draw0) (vector-as-floats (-> mesh base-trans)) (meters 5.0) (new 'static 'rgba :g #x80 :a #x80))
|
||||
)
|
||||
;
|
||||
)
|
||||
)
|
||||
|
||||
;; now test the other one
|
||||
(set! (-> *collide-list* num-items) 0)
|
||||
(collide-probe-make-list (-> *level* level 0) *collide-list*)
|
||||
|
||||
;; these should come out the same, if we did it right.
|
||||
(format *stdcon* "COMPARE: ~d ~d~%" (-> *collide-list* num-items) old-count)
|
||||
|
||||
(dotimes (i (-> *collide-list* num-items))
|
||||
(let ((mesh (the collide-frag-mesh (-> *collide-list* items i mesh)))
|
||||
(inst (the instance-tie (-> *collide-list* items i inst))))
|
||||
(when inst
|
||||
(add-debug-sphere #t (bucket-id debug-draw0) (-> inst bsphere) (* 0.95 (-> inst bsphere w)) (new 'static 'rgba :b #x80 :r #x80 :a #x80))
|
||||
)
|
||||
|
||||
(when (not inst)
|
||||
;;(format *stdcon* "NI: ~A~%" mesh)
|
||||
(add-debug-sphere #t (bucket-id debug-draw0) (vector-as-floats (-> mesh base-trans)) (meters 6.0) (new 'static 'rgba :g #x30 :a #x80))
|
||||
)
|
||||
;
|
||||
)
|
||||
)
|
||||
)
|
||||
|#
|
||||
;; CCACHE (fill from bounding box)
|
||||
(let ((bbox-fake (new 'stack 'bounding-box))
|
||||
|
||||
@@ -351,7 +351,7 @@
|
||||
(actor-pause 5) ;; 32
|
||||
(sleep 6) ;; 64
|
||||
(sleep-code 7) ;; 128
|
||||
(process-tree 8) ;; 256 not an actual process, just a "tree node" for organization
|
||||
(process-tree 8) ;; 256 not an actual process, just a "tree node" for organization
|
||||
(heap-shrunk 9) ;; 512
|
||||
(going 10) ;; 1024
|
||||
(movie 11) ;; 2048
|
||||
@@ -397,8 +397,8 @@
|
||||
|
||||
(deftype stack-frame (basic)
|
||||
((name symbol :offset 4)
|
||||
;; which way does this point?
|
||||
(next stack-frame :offset 8))
|
||||
(next stack-frame :offset 8) ;; which way does this point?
|
||||
)
|
||||
:size-assert #xc
|
||||
:method-count-assert 9
|
||||
:flag-assert #x90000000c
|
||||
@@ -408,7 +408,6 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;; PC Port functions
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defenum pc-renderer-tree-type
|
||||
(none 0)
|
||||
(tfrag3 1)
|
||||
|
||||
@@ -81,8 +81,7 @@
|
||||
This will not preserve the upper 64-bits of a 128-bit value."
|
||||
x)
|
||||
|
||||
(defun 1 /
|
||||
((x float))
|
||||
(defun 1/ ((x float))
|
||||
"Reciprocal floating point"
|
||||
(declare (inline))
|
||||
(/ 1. x))
|
||||
@@ -177,11 +176,11 @@
|
||||
|
||||
(defun false-func ()
|
||||
"Return false"
|
||||
#f)
|
||||
'#f)
|
||||
|
||||
(defun true-func ()
|
||||
"Return true"
|
||||
#t)
|
||||
'#t)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; format
|
||||
@@ -348,9 +347,9 @@
|
||||
|
||||
(defun nmember ((this basic) (lst object))
|
||||
"Is this in the list lst? Check with the name= function."
|
||||
(while (not (or (= lst ()) (name= (the-as basic (car lst)) this)))
|
||||
(while (not (or (= lst '()) (name= (the-as basic (car lst)) this)))
|
||||
(set! lst (cdr lst)))
|
||||
(if (!= lst ()) lst))
|
||||
(if (!= lst '()) lst))
|
||||
|
||||
(defun assoc ((item object) (alist object))
|
||||
"Is there an entry with key item in the association list alist?
|
||||
@@ -749,7 +748,7 @@
|
||||
#f)
|
||||
|
||||
;; not sure what this is.
|
||||
(define *trace-list* ())
|
||||
(define *trace-list* '())
|
||||
|
||||
(defun print-tree-bitmask ((bits int) (count int))
|
||||
"Print out a single entry for a process tree 'tree' diagram"
|
||||
@@ -802,13 +801,13 @@
|
||||
((nonzero? (logand (the-as int this) 3))
|
||||
;; alignment is bad!
|
||||
(if name (format print-dest "ERROR: object #x~X ~S is not a valid object (misaligned)~%" this name))
|
||||
#f)
|
||||
'#f)
|
||||
((not in-goal-mem)
|
||||
;; address isn't within the memory we expect.
|
||||
(if name (format print-dest "ERROR: object #x~X ~S is not a valid object (bad address)~%" this name))
|
||||
#f)
|
||||
'#f)
|
||||
;; otherwise, we're good!
|
||||
(else #t))) ;; end (not expected-type) check
|
||||
(else '#t))) ;; end (not expected-type) check
|
||||
((and allow-false (not this))
|
||||
;; we got a false, but its allowed!
|
||||
;; note that we don't reject falses otherwise, as false is a perfectly valid symbol.
|
||||
@@ -821,13 +820,13 @@
|
||||
((nonzero? (logand (the-as int this) 15))
|
||||
(if name
|
||||
(format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" this name expected-type))
|
||||
#f)
|
||||
'#f)
|
||||
((or (not in-goal-mem) (< (the-as uint this) (end-of-symbol-table)))
|
||||
;; structures should never be in the symbol table, they have a slightly stricter allowed memory range.
|
||||
(if name
|
||||
(format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%" this name expected-type))
|
||||
#f)
|
||||
(else #t)) ;; end structure check
|
||||
'#f)
|
||||
(else '#t)) ;; end structure check
|
||||
)
|
||||
((= expected-type pair)
|
||||
;; pair alignment is 8 bytes + 2.
|
||||
@@ -835,32 +834,32 @@
|
||||
((!= (logand (the-as int this) 7) PAIR_OFFSET)
|
||||
(if name
|
||||
(format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" this name expected-type))
|
||||
#f)
|
||||
'#f)
|
||||
((not in-goal-mem)
|
||||
;; the empty pair is in the symbol table, so we allow anything in GOAL memory.
|
||||
(if name
|
||||
(format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%" this name expected-type))
|
||||
#f)
|
||||
'#f)
|
||||
;; pass!
|
||||
(else #t)))
|
||||
(else '#t)))
|
||||
((= expected-type binteger)
|
||||
(cond
|
||||
;; binteger has 0 in the lower 3 bits.
|
||||
((zero? (logand (the-as int this) 7)) #t)
|
||||
((zero? (logand (the-as int this) 7)) '#t)
|
||||
(else
|
||||
(if name
|
||||
(format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" this name expected-type))
|
||||
#f)))
|
||||
'#f)))
|
||||
;; now we assume desired type is a basic.
|
||||
((!= (logand (the-as int this) 7) BASIC_OFFSET)
|
||||
(if name
|
||||
(format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" this name expected-type))
|
||||
#f)
|
||||
'#f)
|
||||
;; basics can be in the symbol table (basics are symbols...)
|
||||
((not in-goal-mem)
|
||||
(if name
|
||||
(format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%" this name expected-type))
|
||||
#f)
|
||||
'#f)
|
||||
((and (= expected-type type) (!= (rtype-of this) type))
|
||||
;; special case for type, check the runtime type of the object and be done.
|
||||
(if name
|
||||
@@ -870,13 +869,13 @@
|
||||
name
|
||||
expected-type
|
||||
(rtype-of this)))
|
||||
#f)
|
||||
'#f)
|
||||
(else
|
||||
;; otherwise... we want to check and see if the type is actually a type.
|
||||
;; we use valid? to do this check.
|
||||
;; avoid infinite recursion by skipping this check if the expected-type is type.
|
||||
(cond
|
||||
((and (!= expected-type type) (not (valid? (rtype-of this) type #f #t 0)))
|
||||
((and (!= expected-type type) (not (valid? (rtype-of this) type '#f '#t 0)))
|
||||
(if name
|
||||
;; note: print the invalid type as an address in case it's unprintable.
|
||||
(format print-dest
|
||||
@@ -885,7 +884,7 @@
|
||||
name
|
||||
expected-type
|
||||
(rtype-of this)))
|
||||
#f)
|
||||
'#f)
|
||||
((not (type-type? (rtype-of this) expected-type))
|
||||
;; type check failed.
|
||||
(if name
|
||||
@@ -895,7 +894,7 @@
|
||||
name
|
||||
expected-type
|
||||
(rtype-of this)))
|
||||
#f)
|
||||
'#f)
|
||||
((= expected-type symbol)
|
||||
;; got a symbol, expecting to be in the symbol table.
|
||||
(cond
|
||||
@@ -906,8 +905,8 @@
|
||||
this
|
||||
name
|
||||
expected-type))
|
||||
#f)
|
||||
(else #t)))
|
||||
'#f)
|
||||
(else '#t)))
|
||||
;; not a symbol, so expecting to be outside st.
|
||||
((< (the-as uint this) (end-of-symbol-table))
|
||||
(if name
|
||||
@@ -916,8 +915,8 @@
|
||||
this
|
||||
name
|
||||
expected-type))
|
||||
#f)
|
||||
(else #t)))))))
|
||||
'#f)
|
||||
(else '#t)))))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; PC Port asm macros
|
||||
@@ -937,7 +936,7 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;; inserted by the decompiler for assembly branches.
|
||||
(defmacro b! (pred destination &key (delay ()) &key (likely-delay ()))
|
||||
(defmacro b! (pred destination &key (delay '()) &key (likely-delay '()))
|
||||
"Branch!"
|
||||
;; evaluate the predicate
|
||||
`(let ((should-branch ,pred))
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
;; Both the C Kernel and GOAL Kernel update the kernel-packages list.
|
||||
;; The list is used to avoid loading the same package multiple times.
|
||||
|
||||
(define *kernel-packages* ())
|
||||
(define *kernel-packages* '())
|
||||
|
||||
(defun load-package ((package string) (allocation kheap))
|
||||
"Load a Package from a CGO/DGO"
|
||||
@@ -1626,13 +1626,13 @@
|
||||
(when parent
|
||||
;; make sure we aren't the only child.
|
||||
(set! child (-> parent 0 child))
|
||||
(if (= child proc) (return #f))
|
||||
(if (= child proc) (return '#f))
|
||||
;; iterate, until we find the one.
|
||||
(while child
|
||||
(if (= (-> child 0 brother) proc) (return child))
|
||||
(set! child (-> child 0 brother)))
|
||||
;; nope, didn't find it. bad tree.
|
||||
#f)))
|
||||
'#f)))
|
||||
|
||||
(defun change-parent ((this process-tree) (new-parent process-tree))
|
||||
"Make this a child of new-parent"
|
||||
@@ -1677,8 +1677,8 @@
|
||||
(set! a2-1 (-> arg0 parent))
|
||||
(when a2-1
|
||||
(set! t0-0 (-> a2-1 0 child))
|
||||
(set! a3-1 #f)
|
||||
(set! v1-4 #f)
|
||||
(set! a3-1 '#f)
|
||||
(set! v1-4 '#f)
|
||||
(set! t1-0 t0-0)
|
||||
(when (= (if t1-0 (-> t1-0 0 self)) arg0)
|
||||
(set! a3-1 a2-1)
|
||||
@@ -1735,7 +1735,7 @@
|
||||
(nop!)
|
||||
(set! v1-4 (-> v1-4 0 brother)))
|
||||
(set! (-> v1-4 0 brother) (-> arg0 ppointer))
|
||||
(set! (-> arg0 brother) #f))
|
||||
(set! (-> arg0 brother) '#f))
|
||||
arg0)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
@@ -8,47 +8,47 @@
|
||||
;; dgos: KERNEL
|
||||
|
||||
#|
|
||||
Summary of state system:
|
||||
|
||||
A process can be put into a state, using enter-state, or the go macro.
|
||||
This will set up the process to run the appropriate handler functions defined by the state.
|
||||
The state handlers are:
|
||||
- enter : gets run before trans on the first time the state is used. Can be #f. Must return.
|
||||
- trans : gets run before code each time the code is run. Can be #f. Must return.
|
||||
- code : main thread. Can suspend. If it returns, the process dies
|
||||
- exit : gets run when leaving a state. must return.
|
||||
- event : not sure of the details here yet.
|
||||
|
||||
You can use "go" to change the state of a process. This causes the process main thread execution to be abandoned.
|
||||
If the main thread has exits/protects on the stack frame, they will be run first to clean up.
|
||||
|
||||
There are several ways to "go"
|
||||
- go during init: when a process is being initialized with run-function-in-process, you can "go".
|
||||
this causes the run-function-in-process to return immediately, and the next time the process is dispatched
|
||||
it will go into the other state. This will automatically set the process to waiting-to-run,
|
||||
and shrink the process heap, if appropriate
|
||||
|
||||
- go from outside the process. You can temporarily set pp to another process, and have that
|
||||
process go to another state. The actual go will occur the next time the process is scheduled.
|
||||
Use the go-process macro to do this.
|
||||
|
||||
- go from a non-main thread in the right process. You can do a go from a temporary thread, like trans or post.
|
||||
If you do it from post, the go returns and the rest of the post runs. If you do it from any other thread, the temporary thread
|
||||
is immediately abandonded. Like the previous two, it will defer the actual go until the next time the
|
||||
process runs.
|
||||
|
||||
- go from the main thread of the main process. This causes the (-> pp state) to change, the stack frames
|
||||
to be cleaned up, and the old state's exit to be called. It will reset the stack, then run the code.
|
||||
Unlike the others, this means you "go" immediately.
|
||||
|
||||
The compiler has two special hooks related to states: go-hook and define-state-hook.
|
||||
These take care of doing a go and a state definition and properly checking types.
|
||||
|
||||
The define-state-hook takes a state object and handlers and defines a global symbol
|
||||
with the appropriate state type.
|
||||
|
||||
The go-hook calls enter state and sets (-> proc next-state) for the given process.
|
||||
It type checks the arguments for the entry function.
|
||||
Summary of state system:
|
||||
|
||||
A process can be put into a state, using enter-state, or the go macro.
|
||||
This will set up the process to run the appropriate handler functions defined by the state.
|
||||
The state handlers are:
|
||||
- enter : gets run before trans on the first time the state is used. Can be #f. Must return.
|
||||
- trans : gets run before code each time the code is run. Can be #f. Must return.
|
||||
- code : main thread. Can suspend. If it returns, the process dies
|
||||
- exit : gets run when leaving a state. must return.
|
||||
- event : not sure of the details here yet.
|
||||
|
||||
You can use "go" to change the state of a process. This causes the process main thread execution to be abandoned.
|
||||
If the main thread has exits/protects on the stack frame, they will be run first to clean up.
|
||||
|
||||
There are several ways to "go"
|
||||
- go during init: when a process is being initialized with run-function-in-process, you can "go".
|
||||
this causes the run-function-in-process to return immediately, and the next time the process is dispatched
|
||||
it will go into the other state. This will automatically set the process to waiting-to-run,
|
||||
and shrink the process heap, if appropriate
|
||||
|
||||
- go from outside the process. You can temporarily set pp to another process, and have that
|
||||
process go to another state. The actual go will occur the next time the process is scheduled.
|
||||
Use the go-process macro to do this.
|
||||
|
||||
- go from a non-main thread in the right process. You can do a go from a temporary thread, like trans or post.
|
||||
If you do it from post, the go returns and the rest of the post runs. If you do it from any other thread, the temporary thread
|
||||
is immediately abandonded. Like the previous two, it will defer the actual go until the next time the
|
||||
process runs.
|
||||
|
||||
- go from the main thread of the main process. This causes the (-> pp state) to change, the stack frames
|
||||
to be cleaned up, and the old state's exit to be called. It will reset the stack, then run the code.
|
||||
Unlike the others, this means you "go" immediately.
|
||||
|
||||
The compiler has two special hooks related to states: go-hook and define-state-hook.
|
||||
These take care of doing a go and a state definition and properly checking types.
|
||||
|
||||
The define-state-hook takes a state object and handlers and defines a global symbol
|
||||
with the appropriate state type.
|
||||
|
||||
The go-hook calls enter state and sets (-> proc next-state) for the given process.
|
||||
It type checks the arguments for the entry function.
|
||||
|#
|
||||
|
||||
(defmacro go (next-state &rest args)
|
||||
@@ -109,7 +109,7 @@
|
||||
|
||||
;; use a compile-time list to keep track of the type of an anonymous behavior.
|
||||
(seval
|
||||
(define *defstate-type-stack* ()))
|
||||
(define *defstate-type-stack* '()))
|
||||
|
||||
(desfun def-state-check-behavior (beh-form beh-type)
|
||||
"check if code block is an anonymous behavior. needed for anonymous behaviors on defstate."
|
||||
@@ -117,7 +117,7 @@
|
||||
(push! *defstate-type-stack* beh-type)))
|
||||
|
||||
(defmacro clear-def-state-stack ()
|
||||
(set! *defstate-type-stack* ())
|
||||
(set! *defstate-type-stack* '())
|
||||
`(none))
|
||||
|
||||
;; set when inside a defstate.
|
||||
@@ -139,7 +139,7 @@
|
||||
(fmt #t
|
||||
"*defstate-type-stack* leaked! An error probably happened in a previous defstate. stack is: {}"
|
||||
*defstate-type-stack*))
|
||||
(set! *defstate-type-stack* ())
|
||||
(set! *defstate-type-stack* '())
|
||||
(when virtual
|
||||
(set! *defstate-current-type* defstate-type)
|
||||
(set! *defstate-current-state-name* state-name))
|
||||
@@ -223,7 +223,7 @@
|
||||
|
||||
;; set the default handler functions for a process's state handlers
|
||||
(seval
|
||||
(define *default-state-handlers* ()))
|
||||
(define *default-state-handlers* '()))
|
||||
|
||||
(defmacro defstatehandler (proc &key (event #f) &key (enter #f) &key (trans #f) &key (exit #f) &key (code #f) &key (post #f))
|
||||
(let ((old (assoc proc *default-state-handlers*))
|
||||
@@ -276,7 +276,7 @@
|
||||
|
||||
(defmethod print ((this state))
|
||||
"Print a state."
|
||||
(format #t "#<~A ~A @ #x~X>" (-> this type) (-> this name) this)
|
||||
(format '#t "#<~A ~A @ #x~X>" (-> this type) (-> this name) this)
|
||||
this)
|
||||
|
||||
(define-extern enter-state (function object object object object object object object))
|
||||
|
||||
@@ -8,20 +8,20 @@
|
||||
;; dgos: KERNEL
|
||||
|
||||
#|
|
||||
pskernel.gc contains a bunch of utilities for poking around the PS2's kernel.
|
||||
These are unused in the retail game, and wouldn't be "safe" to use on a retail console,
|
||||
as later console revisions may have different memory layout of the BIOS. I suspect this
|
||||
was used for the purposes of debugging and handling crashes.
|
||||
They took over syscall 102 to access memory inside the kernel.
|
||||
|
||||
There's an error message:
|
||||
"I CANNOT CONTINUE TO LOAD GOAL, BECAUSE THE KERNEL VERSION HAS CHANGED~%"
|
||||
"~%Alternatively, try removing pskernel.gc and debug-handlers.gc from project.cl, do an (lg) and then (:r) again~%"
|
||||
|
||||
My theory is that debug-handlers.gc held crash handlers, and on load would install them using functions defined in pskernel.gc.
|
||||
In the retail game, they removed debug-handlers, but not pskernel.
|
||||
|
||||
In the PC port, all of these functions are just stubs.
|
||||
pskernel.gc contains a bunch of utilities for poking around the PS2's kernel.
|
||||
These are unused in the retail game, and wouldn't be "safe" to use on a retail console,
|
||||
as later console revisions may have different memory layout of the BIOS. I suspect this
|
||||
was used for the purposes of debugging and handling crashes.
|
||||
They took over syscall 102 to access memory inside the kernel.
|
||||
|
||||
There's an error message:
|
||||
"I CANNOT CONTINUE TO LOAD GOAL, BECAUSE THE KERNEL VERSION HAS CHANGED~%"
|
||||
"~%Alternatively, try removing pskernel.gc and debug-handlers.gc from project.cl, do an (lg) and then (:r) again~%"
|
||||
|
||||
My theory is that debug-handlers.gc held crash handlers, and on load would install them using functions defined in pskernel.gc.
|
||||
In the retail game, they removed debug-handlers, but not pskernel.
|
||||
|
||||
In the PC port, all of these functions are just stubs.
|
||||
|#
|
||||
|
||||
;; map of the kernel's memory.
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
(set! (-> this root) s4-0))
|
||||
(set! (-> this root pause-adjust-distance) 409600.0)
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton this *windmill-one-sg* ())
|
||||
(initialize-skeleton this *windmill-one-sg* '())
|
||||
(logior! (-> this skel status) (janim-status inited))
|
||||
(update-transforms! (-> this root))
|
||||
(set! (-> this sound-id) (new-sound-id))
|
||||
@@ -308,7 +308,7 @@
|
||||
(backup-collide-with-as s4-0)
|
||||
(set! (-> this root) s4-0))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton this *grottopole-sg* ())
|
||||
(initialize-skeleton this *grottopole-sg* '())
|
||||
(set! (-> this speed) (res-lump-float arg0 'speed :default 81920.0))
|
||||
(set! (-> this distance) (res-lump-float arg0 'distance :default 3072.0))
|
||||
(set! (-> this position) 0)
|
||||
@@ -535,7 +535,7 @@
|
||||
(arg0 (the-as int #f))
|
||||
(else
|
||||
(ambient-hint-spawn "gamcam10" (the-as vector #f) *entity-pool* 'camera)
|
||||
(ppointer->handle (process-spawn pov-camera (-> self root trans) *beachcam-sg* (-> self name) 0 #f () :to self))))))
|
||||
(ppointer->handle (process-spawn pov-camera (-> self root trans) *beachcam-sg* (-> self name) 0 #f '() :to self))))))
|
||||
(process-drawable-birth-fuel-cell (the-as entity #f) (the-as vector #f) #f)
|
||||
(while (handle->process (the-as handle gp-1))
|
||||
(suspend)))
|
||||
@@ -559,7 +559,7 @@
|
||||
(backup-collide-with-as s4-0)
|
||||
(set! (-> this root) s4-0))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton this *ecoventrock-sg* ())
|
||||
(initialize-skeleton this *ecoventrock-sg* '())
|
||||
(set! (-> this link) (new 'process 'actor-link-info this))
|
||||
(transform-post)
|
||||
(nav-mesh-connect this (-> this root) (the-as nav-control #f))
|
||||
@@ -664,7 +664,7 @@
|
||||
(vector-normalize! s5-1 1.0)
|
||||
(quaternion-vector-angle! (-> self tumble) s5-1 (rand-vu-float-range 0.0 1820.4445)))
|
||||
(quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 (rand-vu-float-range 0.0 65536.0))
|
||||
(initialize-skeleton self *kickrock-sg* ())
|
||||
(initialize-skeleton self *kickrock-sg* '())
|
||||
(set! (-> self root transv quad) (-> arg1 quad))
|
||||
(go flying-rock-rolling)
|
||||
(none))
|
||||
@@ -719,7 +719,7 @@
|
||||
(backup-collide-with-as s4-0)
|
||||
(set! (-> this root) s4-0))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton this *bladeassm-sg* ())
|
||||
(initialize-skeleton this *bladeassm-sg* '())
|
||||
(set! (-> this skel prebind-function) (the-as (function pointer int process-drawable none) bladeassm-prebind-function))
|
||||
(logclear! (-> this mask) (process-mask actor-pause))
|
||||
(go bladeassm-idle)
|
||||
@@ -978,7 +978,7 @@
|
||||
(backup-collide-with-as s4-0)
|
||||
(set! (-> this root) s4-0))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton this *flutflutegg-sg* ())
|
||||
(initialize-skeleton this *flutflutegg-sg* '())
|
||||
(vector-z-quaternion! (-> this dir) (-> this root quat))
|
||||
(set! (-> this start quad) (-> this root trans quad))
|
||||
(set! (-> this fall-dist) 20480.0)
|
||||
@@ -1092,7 +1092,7 @@
|
||||
(backup-collide-with-as s4-0)
|
||||
(set! (-> this root) s4-0))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton this *harvester-sg* ())
|
||||
(initialize-skeleton this *harvester-sg* '())
|
||||
(set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0))
|
||||
(go harvester-idle)
|
||||
(none))
|
||||
@@ -1106,10 +1106,10 @@
|
||||
(let* ((gp-1 (ppointer->handle (process-spawn pov-camera
|
||||
(-> gp-0 extra trans)
|
||||
*beachcam-sg*
|
||||
(new 'static 'spool-anim :name "beachcam-cannon" :index 3 :parts 1 :command-list ())
|
||||
(new 'static 'spool-anim :name "beachcam-cannon" :index 3 :parts 1 :command-list '())
|
||||
0
|
||||
#f
|
||||
()
|
||||
'()
|
||||
:to
|
||||
pp)))
|
||||
(s5-2 (ppointer->handle (process-spawn fuel-cell :init fuel-cell-init-as-clone gp-1 (-> pp entity extra perm task) :to pp))))
|
||||
|
||||
@@ -393,6 +393,6 @@
|
||||
(backup-collide-with-as s4-0)
|
||||
(set! (-> this root) s4-0))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton this *lrocklrg-sg* ())
|
||||
(initialize-skeleton this *lrocklrg-sg* '())
|
||||
((method-of-type beach-rock init-from-entity!) this arg0)
|
||||
(none))
|
||||
|
||||
@@ -75,10 +75,10 @@
|
||||
(cond
|
||||
((zero? (get-reminder (-> this tasks) 0))
|
||||
(if arg0 (save-reminder (-> this tasks) 1 0))
|
||||
(new 'static 'spool-anim :name "bird-lady-reminder-1" :index 5 :parts 4 :command-list ()))
|
||||
(new 'static 'spool-anim :name "bird-lady-reminder-1" :index 5 :parts 4 :command-list '()))
|
||||
(else
|
||||
(if arg0 (save-reminder (-> this tasks) 0 0))
|
||||
(new 'static 'spool-anim :name "bird-lady-reminder-2" :index 6 :parts 5 :command-list ()))))
|
||||
(new 'static 'spool-anim :name "bird-lady-reminder-2" :index 6 :parts 5 :command-list '()))))
|
||||
(else
|
||||
(if arg0
|
||||
(format 0
|
||||
|
||||
@@ -429,7 +429,7 @@ nav-enemy-default-event-handler
|
||||
(backup-collide-with-as s4-0)
|
||||
(set! (-> this collide-info) s4-0))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton this *lurkercrab-sg* ())
|
||||
(initialize-skeleton this *lurkercrab-sg* '())
|
||||
(init-defaults! this *lurkercrab-nav-enemy-info*)
|
||||
(set! (-> this part) (create-launch-control (-> *part-group-id-table* 159) this))
|
||||
(set! (-> this orient) #t)
|
||||
|
||||
@@ -214,7 +214,7 @@ nav-enemy-default-event-handler
|
||||
(none))
|
||||
|
||||
(defmethod nav-enemy-method-48 ((this lurkerpuppy))
|
||||
(initialize-skeleton this *lurkerpuppy-sg* ())
|
||||
(initialize-skeleton this *lurkerpuppy-sg* '())
|
||||
(init-defaults! this *lurkerpuppy-nav-enemy-info*)
|
||||
(when (nonzero? (-> this neck))
|
||||
(set! (-> this neck up) (the-as uint 0))
|
||||
|
||||
@@ -439,7 +439,7 @@ lurkerworm-default-post-behavior
|
||||
(backup-collide-with-as s4-0)
|
||||
(set! (-> this root) s4-0))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton this *lurkerworm-sg* ())
|
||||
(initialize-skeleton this *lurkerworm-sg* '())
|
||||
(set! (-> this fact) (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)))
|
||||
(set! (-> this angle) 0.0)
|
||||
(set! (-> this vulnerable) #f)
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
((closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))
|
||||
(mayor-lurkerm-reward-speech this arg0))
|
||||
(else
|
||||
(new 'static 'spool-anim :name "mayor-introduction" :index 4 :parts 16 :command-list ())
|
||||
(new 'static 'spool-anim :name "mayor-introduction" :index 4 :parts 16 :command-list '())
|
||||
(new 'static
|
||||
'spool-anim
|
||||
:name "mayor-introduction"
|
||||
|
||||
@@ -571,7 +571,7 @@
|
||||
(backup-collide-with-as s4-0)
|
||||
(set! (-> this root) s4-0))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton this *pelican-sg* ())
|
||||
(initialize-skeleton this *pelican-sg* '())
|
||||
(set! (-> this draw shadow-ctrl) (new 'process 'shadow-control -81920.0 4096.0 614400.0 (the-as float 25) 409600.0))
|
||||
(logclear! (-> this mask) (process-mask actor-pause))
|
||||
(set! (-> this align) (new 'process 'align-control this))
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
(1433 joint "cameraB"))))
|
||||
(((task-status need-reminder))
|
||||
(set! (-> this skippable) #t)
|
||||
(new 'static 'spool-anim :name "sculptor-reminder-1" :index 17 :parts 2 :command-list ()))
|
||||
(new 'static 'spool-anim :name "sculptor-reminder-1" :index 17 :parts 2 :command-list '()))
|
||||
(((task-status need-reward-speech))
|
||||
(when arg0
|
||||
(set! (-> this cell-for-task) (current-task (-> this tasks)))
|
||||
|
||||
@@ -781,7 +781,7 @@
|
||||
(backup-collide-with-as s3-0)
|
||||
(set! (-> self root) s3-0))
|
||||
(set! (-> self root trans quad) (-> arg0 quad))
|
||||
(initialize-skeleton self *seagull-sg* ())
|
||||
(initialize-skeleton self *seagull-sg* '())
|
||||
(logclear! (-> self mask) (process-mask actor-pause))
|
||||
(set! (-> self index) arg1)
|
||||
(set! (-> self flock) (the-as (pointer seagullflock) (process->ppointer arg2)))
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
(defmethod play-anim! ((this assistant-lavatube-end) (arg0 symbol))
|
||||
(case (current-status (-> this tasks))
|
||||
(((task-status unknown) (task-status need-hint))
|
||||
(new 'static 'spool-anim :name "assistant-lavatube-end-resolution" :index 4 :parts 11 :command-list ()))
|
||||
(new 'static 'spool-anim :name "assistant-lavatube-end-resolution" :index 4 :parts 11 :command-list '()))
|
||||
(((task-status need-reward-speech))
|
||||
(if arg0 (close-current! (-> this tasks)))
|
||||
(new 'static
|
||||
|
||||
@@ -186,41 +186,41 @@
|
||||
(deftype citb-arm-shoulder-b (citb-arm-shoulder) ())
|
||||
|
||||
(defmethod setup-new-process! ((this citb-arm-a))
|
||||
(initialize-skeleton this *citb-arm-a-sg* ())
|
||||
(initialize-skeleton this *citb-arm-a-sg* '())
|
||||
(call-parent-method this)
|
||||
(set! (-> this root root-prim local-sphere z) -184320.0)
|
||||
0
|
||||
(none))
|
||||
|
||||
(defmethod setup-new-process! ((this citb-arm-b))
|
||||
(initialize-skeleton this *citb-arm-b-sg* ())
|
||||
(initialize-skeleton this *citb-arm-b-sg* '())
|
||||
(call-parent-method this)
|
||||
(set! (-> this root root-prim local-sphere z) -225280.0)
|
||||
0
|
||||
(none))
|
||||
|
||||
(defmethod setup-new-process! ((this citb-arm-c))
|
||||
(initialize-skeleton this *citb-arm-c-sg* ())
|
||||
(initialize-skeleton this *citb-arm-c-sg* '())
|
||||
(call-parent-method this)
|
||||
(set! (-> this root root-prim local-sphere z) -266240.0)
|
||||
0
|
||||
(none))
|
||||
|
||||
(defmethod setup-new-process! ((this citb-arm-d))
|
||||
(initialize-skeleton this *citb-arm-d-sg* ())
|
||||
(initialize-skeleton this *citb-arm-d-sg* '())
|
||||
(call-parent-method this)
|
||||
(set! (-> this root root-prim local-sphere z) -307200.0)
|
||||
0
|
||||
(none))
|
||||
|
||||
(defmethod setup-new-process! ((this citb-arm-shoulder-a))
|
||||
(initialize-skeleton this *citb-arm-shoulder-a-sg* ())
|
||||
(initialize-skeleton this *citb-arm-shoulder-a-sg* '())
|
||||
(call-parent-method this)
|
||||
0
|
||||
(none))
|
||||
|
||||
(defmethod setup-new-process! ((this citb-arm-shoulder-b))
|
||||
(initialize-skeleton this *citb-arm-shoulder-b-sg* ())
|
||||
(initialize-skeleton this *citb-arm-shoulder-b-sg* '())
|
||||
(call-parent-method this)
|
||||
0
|
||||
(none))
|
||||
@@ -334,22 +334,22 @@
|
||||
(deftype citb-disc-d (citb-disc) ())
|
||||
|
||||
(defmethod citb-disc-method-21 ((this citb-disc-a))
|
||||
(initialize-skeleton this *citb-disc-a-sg* ())
|
||||
(initialize-skeleton this *citb-disc-a-sg* '())
|
||||
0
|
||||
(none))
|
||||
|
||||
(defmethod citb-disc-method-21 ((this citb-disc-b))
|
||||
(initialize-skeleton this *citb-disc-b-sg* ())
|
||||
(initialize-skeleton this *citb-disc-b-sg* '())
|
||||
0
|
||||
(none))
|
||||
|
||||
(defmethod citb-disc-method-21 ((this citb-disc-c))
|
||||
(initialize-skeleton this *citb-disc-c-sg* ())
|
||||
(initialize-skeleton this *citb-disc-c-sg* '())
|
||||
0
|
||||
(none))
|
||||
|
||||
(defmethod citb-disc-method-21 ((this citb-disc-d))
|
||||
(initialize-skeleton this *citb-disc-d-sg* ())
|
||||
(initialize-skeleton this *citb-disc-d-sg* '())
|
||||
0
|
||||
(none))
|
||||
|
||||
@@ -379,7 +379,7 @@
|
||||
(none))
|
||||
|
||||
(defmethod eco-door-method-25 ((this citb-iris-door))
|
||||
(initialize-skeleton this *citb-iris-door-sg* ())
|
||||
(initialize-skeleton this *citb-iris-door-sg* '())
|
||||
(set! (-> this open-distance) 32768.0)
|
||||
(set! (-> this close-distance) 49152.0)
|
||||
(set! (-> this auto-close) #t)
|
||||
@@ -416,7 +416,7 @@
|
||||
(the-as collide-shape-moving 0))
|
||||
|
||||
(defmethod basebutton-method-26 ((this citb-button))
|
||||
(initialize-skeleton this *citb-button-sg* ())
|
||||
(initialize-skeleton this *citb-button-sg* '())
|
||||
(logior! (-> this skel status) (janim-status inited))
|
||||
(ja-channel-set! 1)
|
||||
(cond
|
||||
@@ -630,7 +630,7 @@
|
||||
(backup-collide-with-as s4-0)
|
||||
(set! (-> this root) s4-0))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton this *citb-robotboss-sg* ())
|
||||
(initialize-skeleton this *citb-robotboss-sg* '())
|
||||
(set! (-> this part) (create-launch-control (-> *part-group-id-table* 601) this))
|
||||
(logclear! (-> this mask) (process-mask actor-pause))
|
||||
(set! (-> this shield-on) #t)
|
||||
@@ -707,7 +707,7 @@
|
||||
(defmethod init-from-entity! ((this citb-coil) (arg0 entity-actor))
|
||||
(set! (-> this root) (new 'process 'trsqv))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton this *citb-coil-sg* ())
|
||||
(initialize-skeleton this *citb-coil-sg* '())
|
||||
(set! (-> this part) (create-launch-control (-> *part-group-id-table* 596) this))
|
||||
(set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 602) this))
|
||||
(let ((v1-9 (entity-actor-lookup (-> this entity) 'state-actor 0)))
|
||||
@@ -772,7 +772,7 @@
|
||||
(defmethod init-from-entity! ((this citb-hose) (arg0 entity-actor))
|
||||
(set! (-> this root) (new 'process 'trsqv))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton this *citb-hose-sg* ())
|
||||
(initialize-skeleton this *citb-hose-sg* '())
|
||||
(let ((v1-3 (entity-actor-lookup (-> this entity) 'state-actor 0)))
|
||||
(if (not v1-3) (set! v1-3 (-> this entity)))
|
||||
(if (logtest? (-> v1-3 extra perm status) (entity-perm-status complete)) (go citb-hose-die) (go citb-hose-idle)))
|
||||
@@ -957,7 +957,7 @@
|
||||
(none))
|
||||
|
||||
(defmethod citb-generator-method-21 ((this citb-generator))
|
||||
(initialize-skeleton this *citb-generator-sg* ())
|
||||
(initialize-skeleton this *citb-generator-sg* '())
|
||||
(setup-lods! (-> this normal-look) *citb-generator-sg* (-> this draw art-group) (-> this entity))
|
||||
(setup-lods! (-> this broken-look) *citb-generator-broken-sg* (-> this draw art-group) (-> this entity))
|
||||
(set! (-> this link) (new 'process 'actor-link-info this))
|
||||
@@ -1033,7 +1033,7 @@
|
||||
(entity-birth-no-kill s4-0)
|
||||
(suspend)
|
||||
(send-event (if s4-0 (-> s4-0 extra process)) 'trigger))))))
|
||||
(let ((gp-2 (ppointer->handle (process-spawn pov-camera (-> self root trans) *citadelcam-sg* "citadelcam-stair-plats" 0 #f () :to self))))
|
||||
(let ((gp-2 (ppointer->handle (process-spawn pov-camera (-> self root trans) *citadelcam-sg* "citadelcam-stair-plats" 0 #f '() :to self))))
|
||||
(while (handle->process (the-as handle gp-2))
|
||||
(suspend)))
|
||||
(level-hint-spawn (text-id citadel-plat) "sksp0387" (the-as entity #f) *entity-pool* (game-task none))
|
||||
@@ -1060,7 +1060,7 @@
|
||||
"citadel-bunnies"
|
||||
0
|
||||
#f
|
||||
()
|
||||
'()
|
||||
:to
|
||||
self))))
|
||||
(send-event (handle->process (the-as handle gp-1)) 'mask 2048)
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
(let ((gp-0 (ppointer->process (-> self parent-override))))
|
||||
(when gp-0
|
||||
(joint-control-copy! (-> self skel) (-> (the-as citb-sage gp-0) skel))
|
||||
(joint-control-remap! (-> self skel) (-> self draw art-group) (-> (the-as citb-sage gp-0) draw art-group) () 0 ""))))
|
||||
(joint-control-remap! (-> self skel) (-> self draw art-group) (-> (the-as citb-sage gp-0) draw art-group) '() 0 ""))))
|
||||
(else (ja :num! (loop!))))
|
||||
(suspend)))
|
||||
:post
|
||||
@@ -117,7 +117,7 @@
|
||||
(none))
|
||||
|
||||
(defmethod citb-sagecage-method-21 ((this citb-sagecage))
|
||||
(initialize-skeleton this *citb-sagecage-sg* ())
|
||||
(initialize-skeleton this *citb-sagecage-sg* '())
|
||||
(logior! (-> this skel status) (janim-status inited))
|
||||
(set! (-> this root pause-adjust-distance) 409600.0)
|
||||
(let ((f0-1 20766.72)
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
:debug-draw-jump #f))
|
||||
|
||||
(defmethod nav-enemy-method-60 ((this citb-bunny))
|
||||
(initialize-skeleton this *citb-bunny-sg* ())
|
||||
(initialize-skeleton this *citb-bunny-sg* '())
|
||||
(set! (-> this draw origin-joint-index) (the-as uint 3))
|
||||
0
|
||||
(none))
|
||||
|
||||
@@ -197,11 +197,11 @@
|
||||
|
||||
(defmethod drop-plat-method-21 ((this drop-plat))
|
||||
(case (-> this color)
|
||||
((1) (initialize-skeleton this *citb-drop-plat-red-sg* ()))
|
||||
((2) (initialize-skeleton this *citb-drop-plat-green-sg* ()))
|
||||
((3) (initialize-skeleton this *citb-drop-plat-blue-sg* ()))
|
||||
((4) (initialize-skeleton this *citb-drop-plat-yellow-sg* ()))
|
||||
(else (initialize-skeleton this *citb-drop-plat-sg* ())))
|
||||
((1) (initialize-skeleton this *citb-drop-plat-red-sg* '()))
|
||||
((2) (initialize-skeleton this *citb-drop-plat-green-sg* '()))
|
||||
((3) (initialize-skeleton this *citb-drop-plat-blue-sg* '()))
|
||||
((4) (initialize-skeleton this *citb-drop-plat-yellow-sg* '()))
|
||||
(else (initialize-skeleton this *citb-drop-plat-sg* '())))
|
||||
(logclear! (-> this mask) (process-mask actor-pause))
|
||||
(let ((s3-0 (new 'stack-no-clear 'vector))
|
||||
(s5-0 (new 'stack-no-clear 'vector))
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
(none))
|
||||
|
||||
(defmethod citb-base-plat-method-22 ((this citb-base-plat))
|
||||
(initialize-skeleton this *plat-citb-sg* ())
|
||||
(initialize-skeleton this *plat-citb-sg* '())
|
||||
0
|
||||
(none))
|
||||
|
||||
@@ -256,7 +256,7 @@
|
||||
:post ja-post)
|
||||
|
||||
(defmethod citb-base-plat-method-22 ((this citb-stair-plat))
|
||||
(initialize-skeleton this *plat-citb-sg* ())
|
||||
(initialize-skeleton this *plat-citb-sg* '())
|
||||
(set! (-> this rise-height) (-> this root trans y))
|
||||
(set! (-> this idle-height) (+ -409600.0 (-> this rise-height)))
|
||||
(set! (-> this root trans y) (-> this idle-height))
|
||||
@@ -430,7 +430,7 @@
|
||||
(none))
|
||||
|
||||
(defmethod rigid-body-platform-method-31 ((this citb-chain-plat))
|
||||
(initialize-skeleton this *citb-chain-plat-sg* ())
|
||||
(initialize-skeleton this *citb-chain-plat-sg* '())
|
||||
(set! (-> this orig-trans quad) (-> this root-overlay trans quad))
|
||||
(quaternion-copy! (-> this orig-quat) (-> this root-overlay quat))
|
||||
(set! (-> this beam-end quad) (-> this orig-trans quad))
|
||||
@@ -496,7 +496,7 @@
|
||||
(none))
|
||||
|
||||
(defmethod citb-base-plat-method-22 ((this citb-rotatebox))
|
||||
(initialize-skeleton this *citb-rotatebox-sg* ())
|
||||
(initialize-skeleton this *citb-rotatebox-sg* '())
|
||||
0
|
||||
(none))
|
||||
|
||||
@@ -539,7 +539,7 @@
|
||||
(none))
|
||||
|
||||
(defmethod citb-base-plat-method-22 ((this citb-donut))
|
||||
(initialize-skeleton this *citb-donut-sg* ())
|
||||
(initialize-skeleton this *citb-donut-sg* '())
|
||||
(setup-params! (-> this sync) (the-as uint 9000) 0.0 0.15 0.15)
|
||||
(set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "rotate-plat" :fo-max 20) (-> this root trans)))
|
||||
(logclear! (-> this mask) (process-mask actor-pause))
|
||||
@@ -713,7 +713,7 @@
|
||||
(backup-collide-with-as s4-0)
|
||||
(set! (-> this root) s4-0))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton this *citb-firehose-sg* ())
|
||||
(initialize-skeleton this *citb-firehose-sg* '())
|
||||
(load-params! (-> this sync) this (the-as uint 900) 0.0 0.15 0.15)
|
||||
(set! (-> this idle-distance) 286720.0)
|
||||
(set! (-> this part) (create-launch-control (-> *part-group-id-table* 685) this))
|
||||
@@ -807,7 +807,7 @@
|
||||
(not (movie?)))
|
||||
|
||||
(defmethod plat-button-method-31 ((this citb-exit-plat))
|
||||
(initialize-skeleton this *citb-exit-plat-sg* ())
|
||||
(initialize-skeleton this *citb-exit-plat-sg* '())
|
||||
(none))
|
||||
|
||||
(defmethod plat-button-method-32 ((this citb-exit-plat))
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user