[goalc] fix 0 in xmm128, be more strict with none in comparison (#1079)

* fix a few small bugs

* merge fixup

* 0 constant fix
This commit is contained in:
water111 2022-01-15 22:33:53 -05:00 committed by GitHub
parent e018951d38
commit c043367094
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 337 additions and 191 deletions

View file

@ -399,8 +399,8 @@
)
(deftype res-tag-pair (uint64)
((lo uint32 :offset 0)
(hi uint32 :offset 32)
((lo int32 :offset 0)
(hi int32 :offset 32)
)
;; made-up type
)
@ -10405,7 +10405,7 @@
:size-assert #xd0
:flag-assert #x15006000d0
(:methods
(dummy-20 (_type_) none 20)
(dummy-20 (_type_) symbol 20)
)
(:states
part-spawner-active)
@ -10473,7 +10473,7 @@
(duration uint64 :offset-assert 176)
(target handle :offset-assert 184)
(event symbol :offset-assert 192)
(run-function (function none) :offset-assert 196)
(run-function (function object) :offset-assert 196)
(callback (function touch-tracker none) :offset-assert 200)
(event-mode basic :offset-assert 204) ;; not a basic!
)
@ -14862,7 +14862,7 @@
:flag-assert #x1b00b00118
;; inherited inspect of process
(:methods
(dummy-14 (_type_) none 14)
(dummy-14 (_type_) symbol 14)
(dummy-15 (_type_) none 15)
(TODO-RENAME-16 (_type_ int int) none 16) ;; first int seen as a fixed point from racer-info 'heat'
(dummy-17 (_type_) none 17)
@ -15471,7 +15471,7 @@
(TODO-RENAME-18 (_type_ vector) nav-poly 18)
(dummy-19 (_type_ vector collide-shape-moving vector float) none 19)
(dummy-20 () none 20)
(dummy-21 (_type_ vector) none 21)
(dummy-21 (_type_ vector) symbol 21)
(dummy-22 () none 22)
(dummy-23 (_type_ vector check-vector-collision-with-nav-spheres-info) float 23) ;; TODO - unconfirmed
(dummy-24 (_type_ float clip-travel-vector-to-mesh-return-info) none 24)
@ -17421,7 +17421,7 @@
(dummy-42 (_type_) none 42)
(TODO-RENAME-43 (_type_) symbol 43)
(play-reminder (_type_) symbol 44)
(dummy-45 (_type_) none 45)
(dummy-45 (_type_) symbol 45)
(dummy-46 (_type_) none 46)
(target-above-threshold? (_type_) symbol 47)
(draw-npc-shadow (_type_) none 48)
@ -26512,7 +26512,7 @@
:heap-base #x50
:flag-assert #x14005000c0
(:states
(reflector-mirror-broken)
(reflector-mirror-broken symbol)
(reflector-mirror-idle))
)

View file

@ -207,4 +207,8 @@
- It is now possible to use a macro to provide a static inline array element definition
- It is now possible to have symbol names that have a `#` in the middle of them
- `go-hook` now returns the return value of the `enter-state` function it calls
- Added a `(declare-file (debug))` to put things in the debug segment by default. This only changes _static_ objects. Dynamic allocation with forms like `cons` will continue to use the main segment like before.
- Added a `(declare-file (debug))` to put things in the debug segment by default. This only changes _static_ objects. Dynamic allocation with forms like `cons` will continue to use the main segment like before.
- It is now an error to use a `none`-typed variable in a condition
- Debugger will now correctly track when object files are loaded over previous files
- Asm ops requiring 128-bit inputs will now try harder to convert their inputs when it is appropriate.
- 0's that are constant propagated to the input of a 128-bit instruction will use `vpxor` instruction to generate the value, instead of `xor` and a `mov`.

View file

@ -19,8 +19,8 @@
)
(deftype res-tag-pair (uint64)
((lo uint32 :offset 0)
(hi uint32 :offset 32)
((lo int32 :offset 0)
(hi int32 :offset 32)
)
;; made-up type
)

View file

@ -259,7 +259,8 @@
;; tod update
(update-time-of-day *time-of-day-context*)
;; closest
;; ocean
(update-ocean)
;; draw ocean
;; merc
;; init bg
(init-background)

View file

@ -1253,6 +1253,8 @@
(define-extern collectable type)
(define-extern ecovalve type)
(define-extern crate type)
(define-extern water-vol type)
(define-extern slide-control type)
(defmacro heap-size-hack (info entity-type)
`(cond
@ -1276,7 +1278,10 @@
(type-type? (-> obj etype) collectable)
(type-type? (-> obj etype) vent)
(type-type? (-> obj etype) ecovalve)
(type-type? (-> obj etype) water-vol)
(type-type? (-> obj etype) slide-control)
;(type-type? (-> obj etype) crate)
)
;;(birth-log "rejecting ~A birth because yes (was ~A)~%" obj (-> obj etype))
(logior! (-> obj extra perm status) (entity-perm-status bit-0))

View file

@ -71,7 +71,7 @@
:size-assert #xd0
:flag-assert #x15006000d0
(:methods
(dummy-20 (_type_) none 20)
(dummy-20 (_type_) symbol 20)
)
(:states
part-spawner-active
@ -144,7 +144,7 @@
(duration uint64 :offset-assert 176)
(target handle :offset-assert 184)
(event symbol :offset-assert 192)
(run-function (function none) :offset-assert 196)
(run-function (function object) :offset-assert 196)
(callback (function touch-tracker none) :offset-assert 200)
(event-mode basic :offset-assert 204)
)

View file

@ -1408,7 +1408,6 @@
(defmethod dummy-20 part-spawner ((obj part-spawner))
(sphere<-vector+r! (-> obj world-sphere) (-> obj root trans) (-> obj radius))
(sphere-in-view-frustum? (-> obj world-sphere))
(none)
)
(defstate part-spawner-active (part-spawner)
@ -2326,7 +2325,7 @@
)
((= v1-0 'exit)
(set! v0-0 (the-as none (-> arg3 param 0)))
(set! (-> self run-function) (the-as (function none) v0-0))
(set! (-> self run-function) (the-as (function object) v0-0))
v0-0
)
((= v1-0 'eval)
@ -2409,12 +2408,8 @@
(set! (-> self event) #f)
(set! (-> self callback) #f)
(set! (-> self run-function)
(the-as
(function none)
(lambda :behavior touch-tracker
()
(< (- (-> *display* base-frame-counter) (-> self state-time)) (the-as int (-> self duration)))
)
(lambda :behavior touch-tracker ()
(< (- (-> *display* base-frame-counter) (-> self state-time)) (the-as int (-> self duration)))
)
)
(set! (-> self event-hook) (-> touch-tracker-idle event))

View file

@ -166,7 +166,7 @@
(dummy-42 (_type_) none 42)
(TODO-RENAME-43 (_type_) symbol 43)
(play-reminder (_type_) symbol 44)
(dummy-45 (_type_) none 45)
(dummy-45 (_type_) symbol 45)
(dummy-46 (_type_) none 46)
(target-above-threshold? (_type_) symbol 47)
(draw-npc-shadow (_type_) none 48)

View file

@ -7,6 +7,7 @@
;; NOTE - for water
(define-extern ocean-get-height (function vector float))
(define-extern update-ocean (function none))
;; The "ocean" renderer is used to render the infinite water.
;; It doesn't draw the rivers in FJ or the water near the farmer.

View file

@ -9,3 +9,78 @@
(define-extern *ocean-map* ocean-map)
;; TODO - for rigid-body
(define-extern ocean-get-height (function vector float))
(defun ocean-get-height ((arg0 vector))
(cond
((and *ocean-heights* *ocean-map*)
(let* ((f2-1 (* 0.00008138021 (- (-> arg0 x) (-> *ocean-map* start-corner x))))
(f3-1 (* 0.00008138021 (- (-> arg0 z) (-> *ocean-map* start-corner z))))
(f0-2 f2-1)
(f0-4 (- f0-2 (the float (the int f0-2))))
(f1-8 f3-1)
(f1-10 (- f1-8 (the float (the int f1-8))))
(a0-1 (logand (the int f2-1) 31))
(a2-0 (logand (the int f3-1) 31))
(v1-11 (logand (+ a0-1 1) 31))
(a1-1 (logand (+ a2-0 1) 31))
(f2-4 (-> (the-as (pointer float) (+ (the-as uint *ocean-heights*) (* (+ (* a2-0 32) a0-1) 4)))))
(f4-4 (-> (the-as (pointer float) (+ (the-as uint *ocean-heights*) (* (+ (* a2-0 32) v1-11) 4)))))
(f3-2 (-> (the-as (pointer float) (+ (the-as uint *ocean-heights*) (* (+ (* a1-1 32) a0-1) 4)))))
(f5-0 (-> (the-as (pointer float) (+ (the-as uint *ocean-heights*) (* (+ (* a1-1 32) v1-11) 4)))))
(f2-6 (+ (* f4-4 f0-4) (* f2-4 (- 1.0 f0-4))))
)
(+ (* (+ (* f5-0 f0-4) (* f3-2 (- 1.0 f0-4))) f1-10) (* f2-6 (- 1.0 f1-10)) (-> *ocean-map* start-corner y))
)
)
(else
0.0
)
)
)
(defun update-ocean ()
(set! *ocean-map* #f)
(dotimes (v1-0 (-> *level* length))
(let ((a0-3 (-> *level* level v1-0)))
(when (= (-> a0-3 status) 'active)
(let ((a1-3 (-> a0-3 info ocean)))
(cond
((= a1-3 'none)
(when (and (-> a0-3 meta-inside?) (not (-> a0-3 other meta-inside?)))
(set! *ocean-map* #f)
(goto cfg-19)
)
)
((and a1-3 (nonzero? (-> a1-3 value)))
(set! *ocean-map* (the-as ocean-map (-> a1-3 value)))
)
)
)
)
)
)
(label cfg-19)
(if (and *ocean-map* (< (-> *math-camera* trans y) -409600.0))
(set! *ocean-map* *ocean-map-sunken*)
)
(let ((gp-0 (new 'stack-no-clear 'vector)))
(set! (-> gp-0 quad) (-> (matrix-local->world #f #f) vector 2 quad))
(cond
((< (fabs (-> gp-0 z)) (fabs (-> gp-0 x)))
(if (< (-> gp-0 x) 0.0)
(set! *ocean-facing* 3)
(set! *ocean-facing* 2)
)
)
((< (-> gp-0 z) 0.0)
(set! *ocean-facing* 0)
0
)
(else
(set! *ocean-facing* 1)
)
)
)
0
(none)
)

View file

@ -250,7 +250,7 @@
(TODO-RENAME-18 (_type_ vector) nav-poly 18)
(dummy-19 (_type_ vector collide-shape-moving vector float) none 19)
(dummy-20 () none 20)
(dummy-21 (_type_ vector) none 21)
(dummy-21 (_type_ vector) symbol 21)
(dummy-22 () none 22)
(dummy-23 (_type_ vector check-vector-collision-with-nav-spheres-info) float 23) ;; TODO - unconfirmed
(dummy-24 (_type_ float clip-travel-vector-to-mesh-return-info) none 24)

View file

@ -23,19 +23,17 @@
(the int (/ arg0 (- (vel-tick arg1))))
)
(defun time-to-ground ((velocity float) (gravity float) (height float))
"How long to fall from height?"
(let ((height-checked 0.0)
(ticks 0))
;; loop in ticks until we reach the ground
(while (< (- height) height-checked)
(let ((velocity (- velocity (vel-tick gravity))))
(+! height-checked (vel-tick velocity))
)
(+! ticks 1)
(defun time-to-ground ((arg0 float) (arg1 float) (arg2 float))
(let ((f0-0 0.0)
(v0-0 0)
)
(while (< (- arg2) f0-0)
(set! arg0 (- arg0 (* 0.0033333334 arg1)))
(+! f0-0 (* 0.0033333334 arg0))
(+! v0-0 1)
)
v0-0
)
ticks
)
)
(define *standard-dynamics*

View file

@ -93,7 +93,7 @@
:size-assert #x118
:flag-assert #x1b00b00118
(:methods
(dummy-14 (_type_) none 14)
(dummy-14 (_type_) symbol 14)
(dummy-15 (_type_) none 15)
(TODO-RENAME-16 (_type_ int int) none 16)
(dummy-17 (_type_) none 17)

View file

@ -38,7 +38,7 @@
(when (and (not (dummy-14 obj)) (not (paused?)))
(dotimes (s5-0 (-> obj nb-of-particles))
(when (!= s5-0 (-> obj skip-particle))
(if (or (!= (-> obj particles 0 pos x) 0.0) (!= (-> obj particles 0 pos y) 0.0))
(when (or (!= (-> obj particles 0 pos x) 0.0) (!= (-> obj particles 0 pos y) 0.0))
(spawn (-> obj particles s5-0 part) *null-vector*)
)
)
@ -202,7 +202,6 @@
(defmethod dummy-14 hud ((obj hud))
(= (-> obj next-state name) 'hud-hidden)
(none)
)
(defstate hud-hidden (hud)

View file

@ -249,6 +249,7 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;
(copy-strs
;; power cell animations
"FUCVICTO"
"FUCV2"
"FUCV3"
@ -257,10 +258,16 @@
"FUCV6"
"FUCV7"
"FUCV8"
;; jak's ambient
"EIA1"
"EIA2"
"EIA3"
"EIA4"
;; intro camera
"NDINTRO"
"LOINTRO"
"LOLOOP"
"LOI2"
)

View file

@ -550,9 +550,27 @@
`(set! ,mask (logand ,mask (lognot (process-mask ,@enum-value))))
)
;; set to true to get error prints on suspends out of stack.
(defglobalconstant DEBUG_PRINT_SUSPEND_FAIL #f)
(defmacro suspend ()
;; suspend the current process.
`(rlet ((pp :reg r13 :reset-here #t))
(#when DEBUG_PRINT_SUSPEND_FAIL
(rlet ((sp :reg rsp :reset-here #t :type int)
(off :reg r15 :type uint))
(let* ((sp-goal (- sp off))
(stack-top-goal (-> (the process pp) top-thread stack-top))
(stack-used (&- stack-top-goal sp-goal))
(stack-size (-> (the process pp) top-thread stack-size))
)
(when (> stack-used stack-size)
(format 0 "ERROR: suspend called without enough stack in proc:~%~A~%Stack: ~D/~D~%" pp stack-used stack-size)
)
)
)
)
;; set to the current thread
(set! pp (-> (the process pp) top-thread))
;; call the suspend hook (put nothing as the argument)

View file

@ -687,6 +687,8 @@
(let ((proc (-> obj process)))
(when (> (process-stack-used proc) (-> obj stack-size))
(break) ;; too much stack has been used and we can't suspend!
;; if you hit this, try with DEBUG_PRINT_SUSPEND_FAIL set to #t (see gkernel-h.gc)
;; it will print more info before reaching here.
)
;; mark the process as suspended and copy the stack

View file

@ -398,8 +398,7 @@
(defmethod dummy-45 citb-sage ((obj citb-sage))
(set! (-> obj spawn-pos quad) (-> obj root-override trans quad))
0
(none)
(the-as symbol 0)
)
(defmethod dummy-42 citb-sage ((obj citb-sage))
@ -561,8 +560,7 @@
(set! (-> *part-id-table* 2457 init-specs 13 initial-valuef) (-> obj rot-x))
(set! (-> *part-id-table* 2454 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2454 init-specs 13 initial-valuef) (-> obj rot-x))
0
(none)
(the-as symbol 0)
)
(defmethod play-reminder red-sagecage ((obj red-sagecage))
@ -676,8 +674,7 @@
(set! (-> *part-id-table* 2450 init-specs 13 initial-valuef) (-> obj rot-x))
(set! (-> *part-id-table* 2447 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2447 init-specs 13 initial-valuef) (-> obj rot-x))
0
(none)
(the-as symbol 0)
)
(defmethod play-reminder blue-sagecage ((obj blue-sagecage))
@ -796,8 +793,7 @@
(set! (-> *part-id-table* 2464 init-specs 13 initial-valuef) (-> obj rot-x))
(set! (-> *part-id-table* 2461 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2461 init-specs 13 initial-valuef) (-> obj rot-x))
0
(none)
(the-as symbol 0)
)
(defmethod play-reminder yellow-sagecage ((obj yellow-sagecage))
@ -879,8 +875,7 @@
(set! (-> *part-id-table* 2471 init-specs 13 initial-valuef) (-> obj rot-x))
(set! (-> *part-id-table* 2468 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2468 init-specs 13 initial-valuef) (-> obj rot-x))
0
(none)
(the-as symbol 0)
)
(defmethod play-reminder green-sagecage ((obj green-sagecage))

View file

@ -327,32 +327,34 @@
(defmethod dummy-45 sage-finalboss ((obj sage-finalboss))
(let ((s5-0 (entity-by-name "assistant-lavatube-end-3")))
(when s5-0
(let ((s4-0 (get-process *default-dead-pool* manipy #x4000)))
(set! (-> obj assistant)
(ppointer->handle
(when s4-0
(let ((t9-2 (method-of-type manipy activate)))
(t9-2 (the-as manipy s4-0) obj 'manipy (the-as pointer #x70004000))
(the-as
symbol
(when s5-0
(let ((s4-0 (get-process *default-dead-pool* manipy #x4000)))
(set! (-> obj assistant)
(ppointer->handle
(when s4-0
(let ((t9-2 (method-of-type manipy activate)))
(t9-2 (the-as manipy s4-0) obj 'manipy (the-as pointer #x70004000))
)
(run-now-in-process s4-0 manipy-init (-> obj root-override trans) s5-0 *assistant-lavatube-end-sg* #f)
(-> s4-0 ppointer)
)
(run-now-in-process s4-0 manipy-init (-> obj root-override trans) s5-0 *assistant-lavatube-end-sg* #f)
(-> s4-0 ppointer)
)
)
)
(let ((s5-1 (handle->process (-> obj assistant))))
(if (the-as manipy s5-1)
(set! (-> (the-as manipy s5-1) draw level-index) (the-as uint (-> (level-get *level* 'finalboss) index)))
)
)
(send-event (handle->process (-> obj assistant)) 'anim-mode 'clone-anim)
(send-event (handle->process (-> obj assistant)) 'blend-shape #t)
(send-event (handle->process (-> obj assistant)) 'center-joint 3)
(send-event (handle->process (-> obj assistant)) 'origin-joint-index 3)
)
(let ((s5-1 (handle->process (-> obj assistant))))
(if (the-as manipy s5-1)
(set! (-> (the-as manipy s5-1) draw level-index) (the-as uint (-> (level-get *level* 'finalboss) index)))
)
)
(send-event (handle->process (-> obj assistant)) 'anim-mode 'clone-anim)
(send-event (handle->process (-> obj assistant)) 'blend-shape #t)
(send-event (handle->process (-> obj assistant)) 'center-joint 3)
(send-event (handle->process (-> obj assistant)) 'origin-joint-index 3)
)
)
(none)
)
(defmethod play-anim! sage-finalboss ((obj sage-finalboss) (arg0 symbol))

View file

@ -616,7 +616,7 @@
:size-assert #xc0
:flag-assert #x14005000c0
(:states
reflector-mirror-broken
(reflector-mirror-broken symbol)
reflector-mirror-idle
)
)
@ -2027,8 +2027,7 @@
(case arg2
(('attack)
(sound-play-by-name (static-sound-name "mirror-smash") (new-sound-id) 1024 0 0 1 #t)
enter-state
(go reflector-mirror-broken)
(go reflector-mirror-broken #f)
)
)
)
@ -2076,8 +2075,7 @@
(defstate reflector-mirror-broken (reflector-mirror)
:code
(behavior ()
(local-vars (a0-0 none))
(behavior ((arg0 symbol))
(ja-channel-set! 0)
(clear-collide-with-as (-> self root-override))
(ja-post)
@ -2103,7 +2101,7 @@
)
)
)
(when (not a0-0)
(when (not arg0)
(ambient-hint-spawn "gamcam21" (the-as vector #f) *entity-pool* 'camera)
(let* ((gp-1 (get-process *default-dead-pool* manipy #x4000))
(v1-11 (when gp-1
@ -2206,16 +2204,10 @@
(-> obj beam-end)
)
)
(cond
((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))
enter-state
#t
(go reflector-mirror-broken)
)
(else
(if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))
(go reflector-mirror-broken #t)
(go reflector-mirror-idle)
)
)
(none)
)

View file

@ -377,9 +377,9 @@
#t
)
(else
#f
)
)
(none)
)
(defmethod get-art-elem sage ((obj sage))

View file

@ -144,8 +144,10 @@
(defmethod dummy-45 sage-bluehut ((obj sage-bluehut))
(cond
((= (current-status (-> obj tasks)) (task-status unknown))
#f
)
((= (current-status (-> obj tasks)) (task-status invalid))
#f
)
((and (closed? (-> obj tasks) (game-task rolling-plants) (task-status need-reminder))
(= (get-reminder (-> obj tasks) 0) 0)
@ -161,9 +163,9 @@
#t
)
(else
#f
)
)
(none)
)
(defmethod get-art-elem sage-bluehut ((obj sage-bluehut))

View file

@ -81,6 +81,17 @@ class ConstantValue {
return false;
}
/*!
* Is the value 0?
*/
bool is_zero() const {
if (m_size) {
return value_64() == 0;
} else {
return (value_128_lo() == 0) && (value_128_hi() == 0);
}
}
protected:
u8 m_value[16] = {0};
int m_size;

View file

@ -108,6 +108,27 @@ RegVal* IntegerConstantVal::to_reg(const goos::Object& form, Env* fe) {
}
}
RegVal* IntegerConstantVal::to_xmm128(const goos::Object& form, Env* fe) {
if (m_value.is_zero()) {
// if we are a constant 0, can use XOR
auto rv = fe->make_ireg(m_ts, RegClass::INT_128);
fe->emit_ir<IR_Int128Math3Asm>(form, true, rv, rv, rv, IR_Int128Math3Asm::Kind::PXOR);
return rv;
} else {
// not zero. fall back to the normal implementation.
auto rv = to_reg(form, fe);
if (rv->ireg().reg_class == RegClass::INT_128 ||
rv->ireg().reg_class == RegClass::VECTOR_FLOAT) {
return rv;
} else {
// but we got only an integer, need to promote. we're a constant, so this is safe.
auto re = fe->make_ireg(coerce_to_reg_type(m_ts), RegClass::INT_128);
fe->emit(form, std::make_unique<IR_RegSet>(re, rv));
return re;
}
}
}
RegVal* SymbolVal::to_reg(const goos::Object& form, Env* fe) {
auto re = fe->make_gpr(coerce_to_reg_type(m_ts));
fe->emit(form, std::make_unique<IR_LoadSymbolPointer>(re, m_name));
@ -220,6 +241,13 @@ RegVal* AliasVal::to_reg(const goos::Object& form, Env* fe) {
return result;
}
RegVal* AliasVal::to_xmm128(const goos::Object& form, Env* fe) {
auto as_old_type = base->to_xmm128(form, fe);
auto result = fe->make_ireg(m_ts, as_old_type->ireg().reg_class);
fe->emit(form, std::make_unique<IR_RegSet>(result, as_old_type));
return result;
}
std::string PairEntryVal::print() const {
if (is_car) {
return fmt::format("[car of {}]", base->print());

View file

@ -237,6 +237,7 @@ class AliasVal : public Val {
AliasVal(TypeSpec ts, Val* _base) : Val(std::move(ts)), base(_base) {}
std::string print() const override { return "alias-of-" + base->print(); }
RegVal* to_reg(const goos::Object& form, Env* fe) override;
RegVal* to_xmm128(const goos::Object& form, Env* fe) override;
Val* base = nullptr;
};
@ -249,6 +250,7 @@ class IntegerConstantVal : public Val {
std::string print() const override { return std::string("integer-constant-") + m_value.print(); }
RegVal* to_reg(const goos::Object& form, Env* fe) override;
RegVal* to_xmm128(const goos::Object& form, Env* fe) override;
const ConstantValue& value() const { return m_value; }
protected:

View file

@ -404,7 +404,7 @@ Val* Compiler::compile_asm_mov_vf(const goos::Object& form, const goos::Object&
}
auto dest = compile_error_guard(args.unnamed.at(0), env)->to_reg(form, env);
auto src = compile_error_guard(args.unnamed.at(1), env)->to_reg(form, env);
auto src = compile_error_guard(args.unnamed.at(1), env)->to_xmm128(form, env);
check_vector_float_regs(form, env, {{"destination", dest}, {"source", src}});
u8 mask = 0b1111;
@ -431,8 +431,8 @@ Val* Compiler::compile_asm_blend_vf(const goos::Object& form, const goos::Object
}
auto dest = compile_error_guard(args.unnamed.at(0), env)->to_reg(form, env);
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_reg(form, env);
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_reg(form, env);
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_xmm128(form, env);
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_xmm128(form, env);
check_vector_float_regs(form, env,
{{"destination", dest}, {"first source", src1}, {"second source", src2}});
@ -464,8 +464,8 @@ Val* Compiler::compile_asm_vf_math3(const goos::Object& form,
}
auto dest = compile_error_guard(args.unnamed.at(0), env)->to_reg(form, env);
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_reg(form, env);
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_reg(form, env);
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_xmm128(form, env);
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_xmm128(form, env);
check_vector_float_regs(form, env,
{{"destination", dest}, {"first source", src1}, {"second source", src2}});
@ -525,8 +525,8 @@ Val* Compiler::compile_asm_int128_math3(const goos::Object& form,
}
auto dest = compile_error_guard(args.unnamed.at(0), env)->to_reg(form, env);
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_reg(form, env);
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_reg(form, env);
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_xmm128(form, env);
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_xmm128(form, env);
if (!dest->settable()) {
throw_compiler_error(form, "Cannot set destination");
@ -549,7 +549,7 @@ Val* Compiler::compile_asm_vf_math2(const goos::Object& form,
}
auto dest = compile_error_guard(args.unnamed.at(0), env)->to_reg(form, env);
auto src = compile_error_guard(args.unnamed.at(1), env)->to_reg(form, env);
auto src = compile_error_guard(args.unnamed.at(1), env)->to_xmm128(form, env);
check_vector_float_regs(form, env, {{"destination", dest}, {"source", src}});
u8 mask = 0b1111;
@ -589,7 +589,7 @@ Val* Compiler::compile_asm_int128_math2_imm_u8(const goos::Object& form,
}
auto dest = compile_error_guard(args.unnamed.at(0), env)->to_reg(form, env);
auto src = compile_error_guard(args.unnamed.at(1), env)->to_reg(form, env);
auto src = compile_error_guard(args.unnamed.at(1), env)->to_xmm128(form, env);
s64 imm;
if (!try_getting_constant_integer(args.unnamed.at(2), &imm, env)) {
throw_compiler_error(form, "Could not evaluate {} as a compile-time integer.",
@ -649,8 +649,8 @@ Val* Compiler::compile_asm_pnor(const goos::Object& form, const goos::Object& re
va_check(form, args, {{}, {}, {}}, {});
auto dest = compile_error_guard(args.unnamed.at(0), env)->to_reg(form, env);
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_reg(form, env); // rs
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_reg(form, env); // rt
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_xmm128(form, env); // rs
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_xmm128(form, env); // rt
auto temp = env->make_ireg(TypeSpec("uint128"), RegClass::INT_128);
if (!ireg_is_128_ok(dest->ireg())) {
@ -753,8 +753,8 @@ Val* Compiler::compile_asm_ppach(const goos::Object& form, const goos::Object& r
va_check(form, args, {{}, {}, {}}, {});
auto dest = compile_error_guard(args.unnamed.at(0), env)->to_reg(form, env);
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_reg(form, env); // rs
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_reg(form, env); // rt
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_xmm128(form, env); // rs
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_xmm128(form, env); // rt
auto temp = env->make_ireg(TypeSpec("uint128"), RegClass::INT_128);
if (!dest->settable()) {
@ -778,8 +778,8 @@ Val* Compiler::compile_asm_xorp(const goos::Object& form, const goos::Object& re
va_check(form, args, {{}, {}, {}}, {});
auto dest = compile_error_guard(args.unnamed.at(0), env)->to_reg(form, env);
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_reg(form, env); // rs
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_reg(form, env); // rt
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_xmm128(form, env); // rs
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_xmm128(form, env); // rt
if (!dest->settable()) {
throw_compiler_error(form, "Cannot set destination");
@ -943,15 +943,15 @@ Val* Compiler::compile_asm_vf_math4_two_operation(const goos::Object& form,
}
auto dest = compile_error_guard(args.unnamed.at(0), env)->to_reg(form, env);
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_reg(form, env);
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_reg(form, env);
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_xmm128(form, env);
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_xmm128(form, env);
// This third register is intended for the ACC/Q/ETC, and is used to temporarily store the value
// that eventually goes into the destination
//
// For example VMADDA:
// > ACC += src1 * src2
// > DEST = ACC
auto src3 = compile_error_guard(args.unnamed.at(3), env)->to_reg(form, env);
auto src3 = compile_error_guard(args.unnamed.at(3), env)->to_xmm128(form, env);
check_vector_float_regs(form, env,
{{"destination", dest},
{"first source", src1},
@ -1100,7 +1100,7 @@ Val* Compiler::compile_asm_abs_vf(const goos::Object& form, const goos::Object&
}
auto dest = compile_error_guard(args.unnamed.at(0), env)->to_reg(form, env);
auto src = compile_error_guard(args.unnamed.at(1), env)->to_reg(form, env);
auto src = compile_error_guard(args.unnamed.at(1), env)->to_xmm128(form, env);
check_vector_float_regs(form, env, {{"destination", dest}, {"source", src}});
u8 mask = 0b1111;
@ -1177,8 +1177,8 @@ Val* Compiler::compile_asm_div_vf(const goos::Object& form, const goos::Object&
}
auto dest = compile_error_guard(args.unnamed.at(0), env)->to_reg(form, env);
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_reg(form, env);
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_reg(form, env);
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_xmm128(form, env);
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_xmm128(form, env);
check_vector_float_regs(form, env,
{{"destination", dest}, {"first source", src1}, {"second source", src2}});
@ -1226,7 +1226,7 @@ Val* Compiler::compile_asm_sqrt_vf(const goos::Object& form, const goos::Object&
}
auto dest = compile_error_guard(args.unnamed.at(0), env)->to_reg(form, env);
auto src = compile_error_guard(args.unnamed.at(1), env)->to_reg(form, env);
auto src = compile_error_guard(args.unnamed.at(1), env)->to_xmm128(form, env);
check_vector_float_regs(form, env, {{"destination", dest}, {"source", src}});
u8 ftf = args.named.at("ftf").as_int();
@ -1267,8 +1267,8 @@ Val* Compiler::compile_asm_inv_sqrt_vf(const goos::Object& form,
}
auto dest = compile_error_guard(args.unnamed.at(0), env)->to_reg(form, env);
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_reg(form, env);
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_reg(form, env);
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_xmm128(form, env);
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_xmm128(form, env);
check_vector_float_regs(form, env,
{{"destination", dest}, {"first source", src1}, {"second source", src2}});
@ -1308,8 +1308,8 @@ Val* Compiler::compile_asm_outer_product_vf(const goos::Object& form,
}
auto dest = compile_error_guard(args.unnamed.at(0), env)->to_reg(form, env);
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_reg(form, env);
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_reg(form, env);
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_xmm128(form, env);
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_xmm128(form, env);
check_vector_float_regs(form, env,
{{"destination", dest}, {"first source", src1}, {"second source", src2}});
@ -1371,8 +1371,8 @@ Val* Compiler::compile_asm_outer_product_a_vf(const goos::Object& form,
}
auto dest = compile_error_guard(args.unnamed.at(0), env)->to_reg(form, env);
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_reg(form, env);
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_reg(form, env);
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_xmm128(form, env);
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_xmm128(form, env);
check_vector_float_regs(form, env,
{{"destination", dest}, {"first source", src1}, {"second source", src2}});
@ -1413,9 +1413,9 @@ Val* Compiler::compile_asm_outer_product_b_vf(const goos::Object& form,
}
auto dest = compile_error_guard(args.unnamed.at(0), env)->to_reg(form, env);
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_reg(form, env);
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_reg(form, env);
auto acc = compile_error_guard(args.unnamed.at(3), env)->to_reg(form, env);
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_xmm128(form, env);
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_xmm128(form, env);
auto acc = compile_error_guard(args.unnamed.at(3), env)->to_xmm128(form, env);
check_vector_float_regs(form, env,
{{"destination", dest},
{"first source", src1},

View file

@ -99,6 +99,10 @@ Condition Compiler::compile_condition(const goos::Object& condition, Env* env, b
gc.b = second_arg->to_gpr(condition, env);
}
if (gc.a->type() == TypeSpec("none") || gc.b->type() == TypeSpec("none")) {
throw_compiler_error(condition, "Cannot use none-typed variable in a condition.");
}
return gc;
}
}
@ -108,6 +112,9 @@ Condition Compiler::compile_condition(const goos::Object& condition, Env* env, b
// todo - it's possible to optimize a false comparison because the false offset is zero
gc.kind = invert ? ConditionKind::EQUAL : ConditionKind::NOT_EQUAL;
gc.a = compile_error_guard(condition, env)->to_gpr(condition, env);
if (gc.a->type() == TypeSpec("none")) {
throw_compiler_error(condition, "Cannot use none-typed variable in a condition.");
}
gc.b = compile_get_sym_obj("#f", env)->to_gpr(condition, env);
return gc;

View file

@ -577,7 +577,6 @@ StaticResult Compiler::compile_static_no_eval_for_pairs(const goos::Object& form
if (!unq_arg.is_pair() || unq_arg.is_empty_list()) {
throw_compiler_error(form, "Cannot unquote non-list");
}
auto& unq_arg_call = unq_arg.as_pair()->car;
goos::Object macro_obj;
if (!try_getting_macro_from_goos(unq_arg.as_pair()->car, &macro_obj)) {
throw_compiler_error(form, "Macro {} not found", unq_arg.as_pair()->car.print());

View file

@ -564,6 +564,14 @@ void Listener::add_load(const std::string& name, const LoadEntry& le) {
m_load_entries[*m_pending_listener_load_object_name] = le;
m_pending_listener_load_object_name = {};
} else {
// if we load over an existing thing, kick it out.
for (auto it = m_load_entries.begin(); it != m_load_entries.end();) {
if (it->second.overlaps_with(le)) {
it = m_load_entries.erase(it);
} else {
it++;
}
}
m_load_entries[name] = le;
}
}

View file

@ -120,4 +120,15 @@ bool MemoryMap::lookup(const std::string& obj_name, u8 seg_id, MemoryMapEntry* o
}
return false;
}
bool LoadEntry::overlaps_with(const LoadEntry& other) const {
for (int seg = 0; seg < 2; seg++) {
if (std::max(segments[seg], other.segments[seg]) <
std::min(segments[seg] + segment_sizes[seg],
other.segments[seg] + other.segment_sizes[seg])) {
return true;
}
}
return false;
}
} // namespace listener

View file

@ -12,6 +12,8 @@ struct LoadEntry {
uint32_t segment_sizes[3] = {0, 0, 0};
std::string load_string;
std::string print() const;
bool overlaps_with(const LoadEntry& other) const;
};
struct MemoryMapEntry {

View file

@ -861,7 +861,7 @@
)
(let ((s3-0 (-> ((method-of-type res-lump lookup-tag-idx) s4-0 'vol 'exact 0.0) lo)))
(when (>= (the-as int s3-0) 0)
(let ((s2-0 (the-as uint s3-0))
(let ((s2-0 (the-as int s3-0))
(s1-0 (-> s4-0 tag s3-0))
)
0
@ -907,7 +907,7 @@
)
(let ((s3-0 (-> ((method-of-type res-lump lookup-tag-idx) s4-0 'vol 'exact 0.0) lo)))
(when (>= (the-as int s3-0) 0)
(let ((s2-0 (the-as uint s3-0))
(let ((s2-0 (the-as int s3-0))
(s1-0 (-> s4-0 tag s3-0))
)
0
@ -954,7 +954,7 @@
)
(let ((s3-0 (-> ((method-of-type res-lump lookup-tag-idx) s4-0 'vol 'exact 0.0) lo)))
(when (>= (the-as int s3-0) 0)
(let ((s2-0 (the-as uint s3-0))
(let ((s2-0 (the-as int s3-0))
(s1-0 (-> s4-0 tag s3-0))
)
0
@ -1075,7 +1075,7 @@
(set! (-> obj ambient-data user-float 2) (the-as float 0))
(let ((s5-1 (-> ((method-of-type res-lump lookup-tag-idx) obj 'effect-name 'exact 0.0) lo)))
(when (>= (the-as int s5-1) 0)
(let ((s4-0 (the-as uint s5-1))
(let ((s4-0 (the-as int s5-1))
(v1-14 (-> obj tag s5-1))
)
0

View file

@ -63,7 +63,7 @@
:size-assert #xd0
:flag-assert #x15006000d0
(:methods
(dummy-20 (_type_) none 20)
(dummy-20 (_type_) symbol 20)
)
(:states
part-spawner-active
@ -197,7 +197,7 @@
(duration uint64 :offset-assert 176)
(target handle :offset-assert 184)
(event symbol :offset-assert 192)
(run-function (function none) :offset-assert 196)
(run-function (function object) :offset-assert 196)
(callback (function touch-tracker none) :offset-assert 200)
(event-mode basic :offset-assert 204)
)

View file

@ -1500,11 +1500,9 @@
)
;; definition for method 20 of type part-spawner
;; INFO: Return type mismatch symbol vs none.
(defmethod dummy-20 part-spawner ((obj part-spawner))
(sphere<-vector+r! (-> obj world-sphere) (-> obj root trans) (-> obj radius))
(sphere-in-view-frustum? (-> obj world-sphere))
(none)
)
;; failed to figure out what this is:
@ -2469,7 +2467,7 @@
)
((= v1-0 'exit)
(set! v0-0 (the-as none (-> arg3 param 0)))
(set! (-> self run-function) (the-as (function none) v0-0))
(set! (-> self run-function) (the-as (function object) v0-0))
v0-0
)
((= v1-0 'eval)
@ -2555,12 +2553,9 @@
(set! (-> self event) #f)
(set! (-> self callback) #f)
(set! (-> self run-function)
(the-as
(function none)
(lambda :behavior touch-tracker
()
(< (- (-> *display* base-frame-counter) (-> self state-time)) (the-as int (-> self duration)))
)
(lambda :behavior touch-tracker
()
(< (- (-> *display* base-frame-counter) (-> self state-time)) (the-as int (-> self duration)))
)
)
(set! (-> self event-hook) (-> touch-tracker-idle event))

View file

@ -146,7 +146,7 @@
(dummy-42 (_type_) none 42)
(TODO-RENAME-43 (_type_) symbol 43)
(play-reminder (_type_) symbol 44)
(dummy-45 (_type_) none 45)
(dummy-45 (_type_) symbol 45)
(dummy-46 (_type_) none 46)
(target-above-threshold? (_type_) symbol 47)
(draw-npc-shadow (_type_) none 48)

View file

@ -86,7 +86,7 @@
(s4-0 (-> ((method-of-type res-lump lookup-tag-idx) (the-as entity s5-1) 'vol 'exact 0.0) lo))
)
(when (>= (the-as int s4-0) 0)
(let ((s3-0 (the-as uint s4-0))
(let ((s3-0 (the-as int s4-0))
(s2-0 (-> s5-1 tag s4-0))
)
0
@ -108,7 +108,7 @@
(s4-1 (-> ((method-of-type res-lump lookup-tag-idx) (the-as entity s5-2) 'cutoutvol 'exact 0.0) lo))
)
(when (>= (the-as int s4-1) 0)
(let ((s3-1 (the-as uint s4-1))
(let ((s3-1 (the-as int s4-1))
(s2-1 (-> s5-2 tag s4-1))
)
0

View file

@ -385,7 +385,7 @@
(TODO-RENAME-18 (_type_ vector) nav-poly 18)
(dummy-19 (_type_ vector collide-shape-moving vector float) none 19)
(dummy-20 () none 20)
(dummy-21 (_type_ vector) none 21)
(dummy-21 (_type_ vector) symbol 21)
(dummy-22 () none 22)
(dummy-23 (_type_ vector check-vector-collision-with-nav-spheres-info) float 23)
(dummy-24 (_type_ float clip-travel-vector-to-mesh-return-info) none 24)

View file

@ -83,7 +83,7 @@
:size-assert #x118
:flag-assert #x1b00b00118
(:methods
(dummy-14 (_type_) none 14)
(dummy-14 (_type_) symbol 14)
(dummy-15 (_type_) none 15)
(TODO-RENAME-16 (_type_ int int) none 16)
(dummy-17 (_type_) none 17)

View file

@ -212,10 +212,8 @@
)
;; definition for method 14 of type hud
;; INFO: Return type mismatch symbol vs none.
(defmethod dummy-14 hud ((obj hud))
(= (-> obj next-state name) 'hud-hidden)
(none)
)
;; failed to figure out what this is:

View file

@ -438,12 +438,11 @@
)
;; definition for method 45 of type citb-sage
;; INFO: Return type mismatch int vs none.
;; INFO: Return type mismatch int vs symbol.
;; Used lq/sq
(defmethod dummy-45 citb-sage ((obj citb-sage))
(set! (-> obj spawn-pos quad) (-> obj root-override trans quad))
0
(none)
(the-as symbol 0)
)
;; definition for method 42 of type citb-sage
@ -621,7 +620,7 @@
)
;; definition for method 45 of type red-sagecage
;; INFO: Return type mismatch int vs none.
;; INFO: Return type mismatch int vs symbol.
(defmethod dummy-45 red-sagecage ((obj red-sagecage))
(set! (-> *part-id-table* 2455 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2455 init-specs 13 initial-valuef) (-> obj rot-x))
@ -629,8 +628,7 @@
(set! (-> *part-id-table* 2457 init-specs 13 initial-valuef) (-> obj rot-x))
(set! (-> *part-id-table* 2454 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2454 init-specs 13 initial-valuef) (-> obj rot-x))
0
(none)
(the-as symbol 0)
)
;; definition for method 44 of type red-sagecage
@ -753,7 +751,7 @@
)
;; definition for method 45 of type blue-sagecage
;; INFO: Return type mismatch int vs none.
;; INFO: Return type mismatch int vs symbol.
(defmethod dummy-45 blue-sagecage ((obj blue-sagecage))
(set! (-> *part-id-table* 2448 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2448 init-specs 13 initial-valuef) (-> obj rot-x))
@ -761,8 +759,7 @@
(set! (-> *part-id-table* 2450 init-specs 13 initial-valuef) (-> obj rot-x))
(set! (-> *part-id-table* 2447 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2447 init-specs 13 initial-valuef) (-> obj rot-x))
0
(none)
(the-as symbol 0)
)
;; definition for method 44 of type blue-sagecage
@ -890,7 +887,7 @@
)
;; definition for method 45 of type yellow-sagecage
;; INFO: Return type mismatch int vs none.
;; INFO: Return type mismatch int vs symbol.
(defmethod dummy-45 yellow-sagecage ((obj yellow-sagecage))
(set! (-> *part-id-table* 2462 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2462 init-specs 13 initial-valuef) (-> obj rot-x))
@ -898,8 +895,7 @@
(set! (-> *part-id-table* 2464 init-specs 13 initial-valuef) (-> obj rot-x))
(set! (-> *part-id-table* 2461 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2461 init-specs 13 initial-valuef) (-> obj rot-x))
0
(none)
(the-as symbol 0)
)
;; definition for method 44 of type yellow-sagecage
@ -992,7 +988,7 @@
)
;; definition for method 45 of type green-sagecage
;; INFO: Return type mismatch int vs none.
;; INFO: Return type mismatch int vs symbol.
(defmethod dummy-45 green-sagecage ((obj green-sagecage))
(set! (-> *part-id-table* 2469 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2469 init-specs 13 initial-valuef) (-> obj rot-x))
@ -1000,8 +996,7 @@
(set! (-> *part-id-table* 2471 init-specs 13 initial-valuef) (-> obj rot-x))
(set! (-> *part-id-table* 2468 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2468 init-specs 13 initial-valuef) (-> obj rot-x))
0
(none)
(the-as symbol 0)
)
;; definition for method 44 of type green-sagecage

View file

@ -381,35 +381,37 @@
)
;; definition for method 45 of type sage-finalboss
;; INFO: Return type mismatch object vs none.
;; INFO: Return type mismatch object vs symbol.
(defmethod dummy-45 sage-finalboss ((obj sage-finalboss))
(let ((s5-0 (entity-by-name "assistant-lavatube-end-3")))
(when s5-0
(let ((s4-0 (get-process *default-dead-pool* manipy #x4000)))
(set! (-> obj assistant)
(ppointer->handle
(when s4-0
(let ((t9-2 (method-of-type manipy activate)))
(t9-2 (the-as manipy s4-0) obj 'manipy (the-as pointer #x70004000))
(the-as
symbol
(when s5-0
(let ((s4-0 (get-process *default-dead-pool* manipy #x4000)))
(set! (-> obj assistant)
(ppointer->handle
(when s4-0
(let ((t9-2 (method-of-type manipy activate)))
(t9-2 (the-as manipy s4-0) obj 'manipy (the-as pointer #x70004000))
)
(run-now-in-process s4-0 manipy-init (-> obj root-override trans) s5-0 *assistant-lavatube-end-sg* #f)
(-> s4-0 ppointer)
)
(run-now-in-process s4-0 manipy-init (-> obj root-override trans) s5-0 *assistant-lavatube-end-sg* #f)
(-> s4-0 ppointer)
)
)
)
(let ((s5-1 (handle->process (-> obj assistant))))
(if (the-as manipy s5-1)
(set! (-> (the-as manipy s5-1) draw level-index) (the-as uint (-> (level-get *level* 'finalboss) index)))
)
)
(send-event (handle->process (-> obj assistant)) 'anim-mode 'clone-anim)
(send-event (handle->process (-> obj assistant)) 'blend-shape #t)
(send-event (handle->process (-> obj assistant)) 'center-joint 3)
(send-event (handle->process (-> obj assistant)) 'origin-joint-index 3)
)
(let ((s5-1 (handle->process (-> obj assistant))))
(if (the-as manipy s5-1)
(set! (-> (the-as manipy s5-1) draw level-index) (the-as uint (-> (level-get *level* 'finalboss) index)))
)
)
(send-event (handle->process (-> obj assistant)) 'anim-mode 'clone-anim)
(send-event (handle->process (-> obj assistant)) 'blend-shape #t)
(send-event (handle->process (-> obj assistant)) 'center-joint 3)
(send-event (handle->process (-> obj assistant)) 'origin-joint-index 3)
)
)
(none)
)
;; definition for method 32 of type sage-finalboss

View file

@ -692,7 +692,7 @@
:size-assert #xc0
:flag-assert #x14005000c0
(:states
reflector-mirror-broken
(reflector-mirror-broken symbol)
reflector-mirror-idle
)
)
@ -2162,8 +2162,7 @@
(case arg2
(('attack)
(sound-play-by-name (static-sound-name "mirror-smash") (new-sound-id) 1024 0 0 1 #t)
enter-state
(go reflector-mirror-broken)
(go reflector-mirror-broken #f)
)
)
)
@ -2212,8 +2211,7 @@
;; failed to figure out what this is:
(defstate reflector-mirror-broken (reflector-mirror)
:code
(behavior ()
(local-vars (a0-0 none))
(behavior ((arg0 symbol))
(ja-channel-set! 0)
(clear-collide-with-as (-> self root-override))
(ja-post)
@ -2239,7 +2237,7 @@
)
)
)
(when (not a0-0)
(when (not arg0)
(ambient-hint-spawn "gamcam21" (the-as vector #f) *entity-pool* 'camera)
(let* ((gp-1 (get-process *default-dead-pool* manipy #x4000))
(v1-11 (when gp-1
@ -2344,16 +2342,10 @@
(-> obj beam-end)
)
)
(cond
((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))
enter-state
#t
(go reflector-mirror-broken)
)
(else
(if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))
(go reflector-mirror-broken #t)
(go reflector-mirror-idle)
)
)
(none)
)

View file

@ -368,7 +368,6 @@
)
;; definition for method 45 of type sage
;; INFO: Return type mismatch symbol vs none.
(defmethod dummy-45 sage ((obj sage))
(cond
((and (closed? (-> obj tasks) (game-task beach-ecorocks) (task-status need-reminder))
@ -385,9 +384,9 @@
#t
)
(else
#f
)
)
(none)
)
;; definition for method 31 of type sage

View file

@ -160,12 +160,13 @@
)
;; definition for method 45 of type sage-bluehut
;; INFO: Return type mismatch symbol vs none.
(defmethod dummy-45 sage-bluehut ((obj sage-bluehut))
(cond
((= (current-status (-> obj tasks)) (task-status unknown))
#f
)
((= (current-status (-> obj tasks)) (task-status invalid))
#f
)
((and (closed? (-> obj tasks) (game-task rolling-plants) (task-status need-reminder))
(= (get-reminder (-> obj tasks) 0) 0)
@ -181,9 +182,9 @@
#t
)
(else
#f
)
)
(none)
)
;; definition for method 31 of type sage-bluehut