[decompiler] process initialization macros (#807)

* implementation and a few working cases

* fix self issue

* fix run-function-in-process

* fix up set-to-run
This commit is contained in:
water111 2021-09-01 16:59:26 -04:00 committed by GitHub
parent 35e4b9907f
commit 9b0480c50d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 285 additions and 317 deletions

View file

@ -84,6 +84,10 @@ TP_Type SimpleAtom::get_type(const TypeState& input,
return TP_Type::make_from_ts(TypeSpec("pointer"));
} else if (m_string == "enter-state") {
return TP_Type::make_enter_state();
} else if (m_string == "run-function-in-process") {
return TP_Type::make_run_function_in_process_function();
} else if (m_string == "set-to-run" && env.func->guessed_name.to_string() != "enter-state") {
return TP_Type::make_set_to_run_function();
}
// look up the type of the symbol
@ -1204,6 +1208,33 @@ TypeState CallOp::propagate_types_internal(const TypeState& input,
in_type = state_to_go_function(state_type);
}
if (in_tp.kind == TP_Type::Kind::RUN_FUNCTION_IN_PROCESS_FUNCTION ||
in_tp.kind == TP_Type::Kind::SET_TO_RUN_FUNCTION) {
auto func_to_run_type = input.get(Register(Reg::GPR, arg_regs[1]));
auto func_to_run_ts = func_to_run_type.typespec();
if (func_to_run_ts.base_type() != "function" || func_to_run_ts.arg_count() == 0 ||
func_to_run_ts.arg_count() > 7) {
throw std::runtime_error(
fmt::format("Call to run-function-in-process or set-to-run at op {} with an invalid "
"function type: {}",
m_my_idx, func_to_run_type.print()));
}
std::vector<TypeSpec> new_arg_types;
if (in_tp.kind == TP_Type::Kind::RUN_FUNCTION_IN_PROCESS_FUNCTION) {
new_arg_types.push_back(TypeSpec("process"));
} else {
new_arg_types.push_back(TypeSpec("thread"));
}
new_arg_types.push_back(TypeSpec("function"));
for (size_t i = 0; i < func_to_run_ts.arg_count() - 1; i++) {
new_arg_types.push_back(func_to_run_ts.get_arg(i));
}
new_arg_types.push_back(TypeSpec("none"));
in_type = TypeSpec("function", new_arg_types);
}
if (in_type.arg_count() < 1) {
throw std::runtime_error("Called a function, but we do not know its type");
}

View file

@ -2666,6 +2666,35 @@ void FunctionCallElement::update_from_stack(const Env& env,
std::swap(all_pop_vars.at(0), all_pop_vars.at(1));
}
if (tp_type.kind == TP_Type::Kind::RUN_FUNCTION_IN_PROCESS_FUNCTION) {
if (unstacked.at(0)->to_string(env) != "run-function-in-process") {
throw std::runtime_error(
fmt::format("Expression pass could not find the run-function-in-process function. Found "
"{} instead. Make sure there are no casts on this function.",
all_pop_vars.at(0).to_string(env)));
}
unstacked.at(0) = pool.form<ConstantTokenElement>("run-now-in-process");
}
if (tp_type.kind == TP_Type::Kind::SET_TO_RUN_FUNCTION) {
if (unstacked.at(0)->to_string(env) != "set-to-run") {
throw std::runtime_error(
fmt::format("Expression pass could not find the set-to-run function. Found "
"{} instead. Make sure there are no casts on this function.",
all_pop_vars.at(0).to_string(env)));
}
unstacked.at(0) = pool.form<ConstantTokenElement>("run-next-time-in-process");
// also need to clean up (-> <blah> main-thread) to just <blah>
auto matcher =
Matcher::deref(Matcher::any(0), false, {DerefTokenMatcher::string("main-thread")});
auto mr = match(matcher, unstacked.at(1));
if (!mr.matched) {
throw std::runtime_error(fmt::format("set-to-run called on a strange thread: {}",
unstacked.at(1)->to_string(env)));
}
unstacked.at(1) = mr.maps.forms.at(0);
}
std::vector<Form*> arg_forms;
bool has_good_types = env.has_type_analysis() && function_type.arg_count() == nargs + 1;
TypeSpec first_arg_type;

View file

@ -7844,7 +7844,7 @@
(vertex-skip int32 :offset-assert 20)
(vertex-count int32 :offset-assert 24)
(current-loc int32 :offset-assert 28)
(data2 uint8 :dynamic :offset-assert 32) ;; renamed from data. suspect inline-array has some magic.
(data vector :inline :dynamic :offset-assert 32)
)
:method-count-assert 9
:size-assert #x20
@ -18921,7 +18921,7 @@
(define-extern camera-look-at function)
(define-extern camera-pov-from function)
(define-extern command-get-trans function)
(define-extern manipy-init (function trsqv vector entity skeleton-group symbol none)) ;; TODO - not confirmed yet
(define-extern manipy-init (function trsqv vector entity skeleton-group none)) ;; TODO - not confirmed yet
(define-extern part-tracker-notify function)
(define-extern clone-anim-once function)
(define-extern convert-to-hud-object function)
@ -18933,7 +18933,7 @@
(define-extern camera-tracker-init (function function none)) ;; TODO - not confirmed, see misty-warehouse::camera-view
(define-extern cam-launcher-joystick function)
(define-extern launcher-init-by-other function)
(define-extern touch-tracker-init function)
(define-extern touch-tracker-init (function object object object none))
(define-extern process-drawable-pair-random-point! function)
(define-extern birth-func-set-quat function)
(define-extern draw-eco-beam function)
@ -20308,7 +20308,7 @@
(define-extern ecovalve-init-by-other function)
(define-extern birth-pickup-at-point (function vector int float symbol process-drawable symbol none)) ;; TODO - unconfirmed - see beach-rocks
(define-extern fuel-cell-pick-anim function)
(define-extern othercam-init-by-other (function int symbol symbol none)) ;; TODO - unconfirmed - see beach-rocks
(define-extern othercam-init-by-other (function int symbol symbol symbol none)) ;; TODO - unconfirmed - see beach-rocks
(define-extern fuel-cell-animate function)
(define-extern add-blue-motion function)
(define-extern check-blue-suck function)
@ -20317,7 +20317,7 @@
(define-extern money-init-by-other function)
(define-extern money-init-by-other-no-bob function)
(define-extern fuel-cell-init-by-other function)
(define-extern fuel-cell-init-as-clone (function game-task none)) ;; TODO - unconfirmed - see beach-rocks
(define-extern fuel-cell-init-as-clone (function handle object none)) ;; TODO - unconfirmed - see beach-rocks
(define-extern buzzer-init-by-other function)
;; - Symbols

View file

@ -874,15 +874,12 @@
],
"main-cheats": [
[1221, "t9", "(function cpu-thread function none)"],
[[1123, 1126], "v1", "dma-packet"]
],
"on": [[33, "t9", "(function cpu-thread function none)"]],
"bg": [[37, "a0", "symbol"]],
"start": [[27, "t9", "(function process function symbol object)"]],
"level-update-after-load": [
[[29, 55], "s2", "drawable-tree"],
[[121, 146], "s1", "drawable-inline-array-tfrag"],
@ -1701,11 +1698,6 @@
[[187, 231], "gp", "camera-slave"]
],
"cam-start": [
[[18, 22], "t9", "(function process object function)"],
[[38, 42], "t9", "(function process object function)"]
],
"cam-master-init": [
[[0, 999], "s6", "camera-master"],
[[111, 115], "t9", "(function cpu-thread function)"],
@ -1810,10 +1802,6 @@
],
"draw-ocean-transition": [[255, "v1", "ocean-mid-mask"]],
"init-target": [
[408, "t9", "(function process function object)"]
],
"do-target-shadow": [
[46, "v1", "collide-shape-prim"] // `event-other` from collide-shape
@ -1928,7 +1916,6 @@
],
"misty-camera-view": [
[19, "t9", "(function object object object object)"],
[25, "v1", "handle"]
],
@ -2084,18 +2071,11 @@
[19, "v1", "float"]
],
"(method 32 bird-lady-beach)": [
[44, "t9", "(function process function object object object object object)"],
[119, "t9", "(function process function object object object object object)"]
],
"muse-to-idle": [
[36, "t9", "(function process function object object object object object)"],
[57, "v1", "muse"]
],
"(method 32 sculptor)": [
[66, "t9", "(function process function object object object object object)"],
[87, "v1", "muse"]
],
@ -2135,11 +2115,6 @@
[11, "v1", "collide-shape"]
],
"(method 11 oracle)": [
[83, "t9", "(function process function object object object object object)"],
[166, "t9", "(function process function object object object object object)"]
],
"(method 43 farmer)": [
[19, "v1", "float"]
],
@ -2197,7 +2172,6 @@
"(method 32 sage)": [
[76, "v1", "float"],
[175, "t9", "(function process function object object object object object)"],
[262, "v1", "assistant"]
],
@ -2241,9 +2215,7 @@
[258, "v1", "target"],
[272, "v1", "target"],
[287, "v1", "target"],
[298, "v1", "target"],
[556, "t9", "(function process function vector meters int none)"],
[635, "t9", "(function cpu-thread function process-drawable none)"]
[298, "v1", "target"]
],
"(method 7 process)": [
@ -2585,8 +2557,6 @@
],
"(code falling beach-rock)": [
[63, "t9", "(function object object object object object object)"],
[98, "t9", "(function object object object object object)"],
[138, "gp", "handle"],
[150, "gp", "handle"],
[[158, 165], "s5", "handle"]

View file

@ -73,6 +73,10 @@ std::string TP_Type::print() const {
return fmt::format("<label-{}>", m_int);
case Kind::ENTER_STATE_FUNCTION:
return "<enter-state-func>";
case Kind::SET_TO_RUN_FUNCTION:
return "<set-to-run-func>";
case Kind::RUN_FUNCTION_IN_PROCESS_FUNCTION:
return "<run-function-in-process-func>";
case Kind::INVALID:
default:
assert(false);
@ -127,6 +131,8 @@ bool TP_Type::operator==(const TP_Type& other) const {
return m_pcpyud == other.m_pcpyud && m_ts == other.m_ts;
case Kind::LABEL_ADDR:
case Kind::ENTER_STATE_FUNCTION:
case Kind::RUN_FUNCTION_IN_PROCESS_FUNCTION:
case Kind::SET_TO_RUN_FUNCTION:
return true;
case Kind::INVALID:
default:
@ -189,6 +195,8 @@ TypeSpec TP_Type::typespec() const {
case Kind::LABEL_ADDR:
return TypeSpec("pointer"); // ?
case Kind::ENTER_STATE_FUNCTION:
case Kind::RUN_FUNCTION_IN_PROCESS_FUNCTION:
case Kind::SET_TO_RUN_FUNCTION:
// give a general function so we can't call it normally.
return TypeSpec("function");
case Kind::INVALID:

View file

@ -37,6 +37,8 @@ class TP_Type {
LEFT_SHIFTED_BITFIELD, // (bitfield << some-constant)
LABEL_ADDR,
ENTER_STATE_FUNCTION,
RUN_FUNCTION_IN_PROCESS_FUNCTION,
SET_TO_RUN_FUNCTION,
INVALID
} kind = Kind::UNINITIALIZED;
TP_Type() = default;
@ -67,6 +69,8 @@ class TP_Type {
case Kind::PCPYUD_BITFIELD_AND:
case Kind::LABEL_ADDR:
case Kind::ENTER_STATE_FUNCTION:
case Kind::RUN_FUNCTION_IN_PROCESS_FUNCTION:
case Kind::SET_TO_RUN_FUNCTION:
return false;
case Kind::UNINITIALIZED:
case Kind::OBJECT_NEW_METHOD:
@ -269,6 +273,18 @@ class TP_Type {
return result;
}
static TP_Type make_run_function_in_process_function() {
TP_Type result;
result.kind = Kind::RUN_FUNCTION_IN_PROCESS_FUNCTION;
return result;
}
static TP_Type make_set_to_run_function() {
TP_Type result;
result.kind = Kind::SET_TO_RUN_FUNCTION;
return result;
}
const TypeSpec& get_objects_typespec() const {
assert(kind == Kind::TYPESPEC || kind == Kind::INTEGER_CONSTANT_PLUS_VAR);
return m_ts;

View file

@ -23,49 +23,41 @@
(defun cam-start ((arg0 symbol))
(cam-stop)
(let ((s5-0 (get-process *camera-dead-pool* camera-combiner #x4000)))
(when s5-0
(let ((t9-2 (method-of-type camera-combiner activate)))
(t9-2
(the-as camera-combiner s5-0)
*camera-pool*
'camera-combiner
(the-as pointer #x70004000)
)
)
((the-as (function process object function) run-function-in-process)
s5-0
cam-combiner-init
)
(-> s5-0 ppointer)
)
)
(let* ((s5-1 (get-process *camera-master-dead-pool* camera-master #x4000))
(v1-5 (when s5-1
(let ((t9-5 (method-of-type camera-master activate)))
(t9-5
(the-as camera-master s5-1)
*camera-pool*
'camera-master
(the-as pointer #x70004000)
)
)
((the-as (function process object function) set-to-run)
(the-as process (-> s5-1 main-thread))
cam-master-init
)
(-> s5-1 ppointer)
)
(when s5-0
(let ((t9-2 (method-of-type camera-combiner activate)))
(t9-2
(the-as camera-combiner s5-0)
*camera-pool*
'camera-combiner
(the-as pointer #x70004000)
)
)
(run-now-in-process s5-0 cam-combiner-init)
(-> s5-0 ppointer)
)
)
(let ((s5-1 (get-process *camera-master-dead-pool* camera-master #x4000)))
(set! *camera*
(the-as camera-master
(ppointer->process
(when s5-1
(let ((t9-5 (method-of-type camera-master activate)))
(t9-5 (the-as camera-master s5-1)
*camera-pool*
'camera-master
(the-as pointer #x70004000)
)
)
(run-next-time-in-process s5-1 cam-master-init)
(-> s5-1 ppointer)
)
)
)
)
)
(set! *camera* (the-as camera-master (if v1-5
(-> v1-5 0 self)
)
)
)
)
(if arg0
(reset-cameras)
)
(reset-cameras)
)
0
(none)
)

View file

@ -78,4 +78,4 @@
:size-assert #x19c
:flag-assert #x1f0130019c
)
(define-extern fuel-cell-init-as-clone (function game-task none))
(define-extern fuel-cell-init-as-clone (function handle object none))

View file

@ -562,7 +562,7 @@
)
(declare-type vent process-drawable)
(define-extern touch-tracker-init function)
(define-extern touch-tracker-init (function object object object none))
(defmethod pickup-collectable! fact-info-target ((obj fact-info-target) (kind pickup-type) (amount float) (source-handle handle))
"Pickup a thing!"
@ -820,7 +820,7 @@
(let ((t9-28 (method-of-type touch-tracker activate)))
(t9-28 (the-as touch-tracker s3-5) s5-1 'touch-tracker (the-as pointer #x70004000))
)
(run-next-time-in-process s3-5 touch-tracker-init (-> s5-1 root trans) (-> *FACT-bank* suck-bounce-dist) 300)
(run-now-in-process s3-5 touch-tracker-init (-> s5-1 root trans) (-> *FACT-bank* suck-bounce-dist) 300)
(-> s3-5 ppointer)
)
)
@ -890,11 +890,7 @@
(let ((t9-35 (method-of-type process activate)))
(t9-35 s4-4 s5-1 'process (the-as pointer #x70004000))
)
((the-as
(function cpu-thread function process-drawable none)
set-to-run
)
(-> s4-4 main-thread)
(run-next-time-in-process s4-4
(lambda ((arg0 process-drawable))
(with-pp
(let ((start-time (-> *display* base-frame-counter)))

View file

@ -19,6 +19,6 @@
(define-extern camera-change-to (function string int symbol none)) ;; TODO - not confirmed yet
(define-extern process-release? (function process symbol))
;; TODO - for bird-lady-beach
(define-extern manipy-init (function trsqv vector entity skeleton-group symbol none)) ;; TODO - not confirmed yet
(define-extern manipy-init (function trsqv vector entity skeleton-group none)) ;; TODO - not confirmed yet
;; TODO - for projectiles | dark-eco-pool
(define-extern part-tracker-init (function sparticle-launch-group int basic basic basic vector none)) ;; TODO - not confirmed

View file

@ -899,35 +899,35 @@
(if (when game-end-proc
(let ((t9-28 (method-of-type process activate)))
(t9-28
game-end-proc
*default-pool*
'process
(the-as pointer #x70004000)
)
game-end-proc
*default-pool*
'process
(the-as pointer #x70004000)
)
)
(run-next-time-in-process
game-end-proc
(lambda ()
(set-blackout-frames #x7530)
(set! (-> *setting-control* default allow-pause) #f)
(set! (-> *setting-control* default allow-progress) #f)
(copy-settings-from-target! *setting-control*)
(set! (-> *setting-control* default sfx-volume) 0.0)
(set! (-> *setting-control* default music-volume) 0.0)
(set! (-> *setting-control* default dialog-volume) 0.0)
(set! (-> *setting-control* default ambient-volume) 0.0)
(let ((gp-0 (-> *display* base-frame-counter)))
(until (begin
(suspend)
(>= (the-as int (- (-> *display* base-frame-counter) gp-0)) 30)
)
(empty)
)
)
(kernel-shutdown)
(none)
)
)
((the-as (function cpu-thread function none) set-to-run)
(-> game-end-proc main-thread)
(lambda ()
(set-blackout-frames #x7530)
(set! (-> *setting-control* default allow-pause) #f)
(set! (-> *setting-control* default allow-progress) #f)
(copy-settings-from-target! *setting-control*)
(set! (-> *setting-control* default sfx-volume) 0.0)
(set! (-> *setting-control* default music-volume) 0.0)
(set! (-> *setting-control* default dialog-volume) 0.0)
(set! (-> *setting-control* default ambient-volume) 0.0)
(let ((gp-0 (-> *display* base-frame-counter)))
(until (begin
(suspend)
(>= (the-as int (- (-> *display* base-frame-counter) gp-0)) 30)
)
(empty)
)
)
(kernel-shutdown)
(none)
)
)
(-> game-end-proc ppointer)
)
;; failed to create process, just die.

View file

@ -6,4 +6,4 @@
;; dgos: GAME, ENGINE
;; TODO - for beach-rocks
(define-extern othercam-init-by-other (function int symbol symbol none))
(define-extern othercam-init-by-other (function int symbol symbol symbol none))

View file

@ -10,7 +10,7 @@
(vertex-skip int32 :offset-assert 20)
(vertex-count int32 :offset-assert 24)
(current-loc int32 :offset-assert 28)
(data2 uint8 :dynamic :offset-assert 32) ;; renamed from data. suspect inline-array has some magic.
(data vector :inline :dynamic :offset-assert 32)
)
:method-count-assert 9
:size-assert #x20

View file

@ -2936,10 +2936,7 @@
)
)
)
((the-as
(function process function object)
run-function-in-process
)
(run-now-in-process
s5-1
init-sidekick
)
@ -2988,14 +2985,7 @@
(&-> *dram-stack* 14336)
)
)
((the-as
(function process function symbol object)
run-function-in-process
)
s5-0
init-target
(the-as symbol arg1)
)
(run-now-in-process s5-0 init-target arg1)
(-> s5-0 ppointer)
)
)

View file

@ -1327,26 +1327,13 @@
(the-as pointer #x70004000)
)
)
(let
((t9-6
(the-as function run-function-in-process)
)
(a0-9 gp-1)
(a1-4 othercam-init-by-other)
(a3-2 7)
(t0-1 #f)
)
(run-now-in-process
gp-1
othercam-init-by-other
self
7
#f
#t
((the-as
(function object object object object object object)
t9-6
)
a0-9
a1-4
self
a3-2
t0-1
)
)
(-> gp-1 ppointer)
)
@ -1363,10 +1350,7 @@
(the-as pointer #x70004000)
)
)
((the-as
(function object object object object object)
run-function-in-process
)
(run-now-in-process
s5-0
fuel-cell-init-as-clone
(process->handle self)

View file

@ -87,10 +87,7 @@
(the-as pointer #x70004000)
)
)
((the-as
(function process function object object object object object)
run-function-in-process
)
(run-now-in-process
s5-1
manipy-init
(-> obj root trans)
@ -134,10 +131,7 @@
(the-as pointer #x70004000)
)
)
((the-as
(function process function object object object object object)
run-function-in-process
)
(run-now-in-process
s5-2
manipy-init
(-> obj root trans)

View file

@ -155,10 +155,7 @@
)
)
)
((the-as
(function process function object object object object object)
run-function-in-process
)
(run-now-in-process
s5-0
manipy-init
(->
@ -338,10 +335,7 @@
(the-as pointer #x70004000)
)
)
((the-as
(function process function object object object object object)
run-function-in-process
)
(run-now-in-process
s5-1
manipy-init
(-> obj root trans)

View file

@ -1186,7 +1186,7 @@
(the-as pointer #x70004000)
)
)
(run-function-in-process
(run-now-in-process
s4-1
part-tracker-init
(-> *part-group-id-table* 445)
@ -1194,7 +1194,7 @@
#f
#f
#f
(+ (+ (* s3-0 16) 28) (the-as int s5-0))
(-> s5-0 data s3-0)
)
(-> s4-1 ppointer)
)
@ -1218,5 +1218,3 @@
)

View file

@ -91,10 +91,7 @@
(the-as pointer #x70004000)
)
)
((the-as
(function object object object object)
run-function-in-process
)
(run-now-in-process
gp-0
camera-tracker-init
(lambda :behavior camera-tracker

View file

@ -643,10 +643,7 @@
(the-as pointer #x70004000)
)
)
((the-as
(function process function object object object object object)
run-function-in-process
)
(run-now-in-process
s5-2
manipy-init
(-> obj root trans)

View file

@ -87,7 +87,7 @@
(the-as pointer #x70004000)
)
)
(run-function-in-process
(run-now-in-process
gp-0
pov-camera-init-by-other
(-> self spawn-pos)
@ -120,7 +120,7 @@
(the-as pointer #x70004000)
)
)
(run-function-in-process
(run-now-in-process
gp-1
pov-camera-init-by-other
(-> self spawn-pos)
@ -177,7 +177,7 @@
(the-as pointer #x70004000)
)
)
(run-function-in-process
(run-now-in-process
gp-0
pov-camera-init-by-other
(-> self spawn-pos)

View file

@ -697,10 +697,7 @@
)
)
)
((the-as
(function process function object object object object object)
run-function-in-process
)
(run-now-in-process
s3-0
manipy-init
s4-0
@ -725,9 +722,10 @@
uint
(lambda :behavior oracle
()
(let ((v0-0 (create-launch-control (-> *part-group-id-table* 63) self)))
(let
((v0-0 (create-launch-control (-> *part-group-id-table* 63) self)))
(set! (-> self part) v0-0)
v0-0
(the-as sparticle-launch-group v0-0)
)
)
)
@ -770,10 +768,7 @@
)
)
)
((the-as
(function process function object object object object object)
run-function-in-process
)
(run-now-in-process
s3-1
manipy-init
s4-0
@ -798,9 +793,10 @@
uint
(lambda :behavior oracle
()
(let ((v0-0 (create-launch-control (-> *part-group-id-table* 63) self)))
(let
((v0-0 (create-launch-control (-> *part-group-id-table* 63) self)))
(set! (-> self part) v0-0)
v0-0
(the-as sparticle-launch-group v0-0)
)
)
)
@ -819,4 +815,8 @@
(dummy-42 obj)
(none)
)
)
)

View file

@ -493,4 +493,24 @@
*res-static-buf*
)
)
)
;; run the given function in a process right now.
;; will return to here when:
;; - you return
;; - you deactivate
;; - you go
;; - you throw to 'initialize
(defmacro run-now-in-process (proc func &rest args)
`((the (function _varargs_ object) run-function-in-process)
,proc ,func ,@args
)
)
;; sets the main thread of the given process to run the given thing.
;; this resets the main thread stack back to the top
(defmacro run-next-time-in-process (proc func &rest args)
`((the (function _varargs_ object) set-to-run)
(-> ,proc main-thread) ,func ,@args
)
)

View file

@ -28,10 +28,7 @@
(the-as pointer #x70004000)
)
)
((the-as (function process object function) run-function-in-process)
s5-0
cam-combiner-init
)
(run-now-in-process s5-0 cam-combiner-init)
(-> s5-0 ppointer)
)
)
@ -58,17 +55,8 @@
)
)
)
((the-as
(function process object function)
set-to-run
)
(the-as
process
(->
s5-1
main-thread
)
)
(run-next-time-in-process
s5-1
cam-master-init
)
(-> s5-1 ppointer)
@ -86,3 +74,7 @@
;; failed to figure out what this is:
(cam-start #f)

View file

@ -939,10 +939,7 @@
(the-as pointer #x70004000)
)
)
((the-as
(function process function vector meters int none)
run-function-in-process
)
(run-now-in-process
s3-5
touch-tracker-init
(-> s5-1 root trans)
@ -1033,28 +1030,45 @@
(let ((t9-35 (method-of-type process activate)))
(t9-35 s4-4 s5-1 'process (the-as pointer #x70004000))
)
((the-as
(function cpu-thread function process-drawable none)
set-to-run
)
(-> s4-4 main-thread)
(lambda ((arg0 process-drawable))
(with-pp
(let ((s5-0 (-> *display* base-frame-counter)))
(until (>= (- (-> *display* base-frame-counter) s5-0) 180)
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-0 from) pp)
(set! (-> a1-0 num-params) 1)
(set! (-> a1-0 message) 'effect)
(set! (-> a1-0 param 0) (the-as uint 'eco-blue))
(send-event-function arg0 a1-0)
)
(suspend)
)
)
(none)
)
)
(run-next-time-in-process s4-4 (lambda ((arg0 process-drawable))
(with-pp
(let
((s5-0
(-> *display* base-frame-counter)
)
)
(until
(>=
(-
(->
*display*
base-frame-counter
)
s5-0
)
180
)
(let
((a1-0
(new 'stack-no-clear 'event-message-block
)
)
)
(set! (-> a1-0 from) pp)
(set! (-> a1-0 num-params) 1)
(set! (-> a1-0 message) 'effect)
(set!
(-> a1-0 param 0)
(the-as uint 'eco-blue)
)
(send-event-function arg0 a1-0)
)
(suspend)
)
)
(none)
)
)
s5-1
)
(-> s4-4 ppointer)

View file

@ -3,11 +3,11 @@
;; definition of type ripple-merc-query
(deftype ripple-merc-query (inline-array-class)
((start-vertex int32 :offset-assert 16)
(vertex-skip int32 :offset-assert 20)
(vertex-count int32 :offset-assert 24)
(current-loc int32 :offset-assert 28)
(data2 uint8 :dynamic :offset-assert 32)
((start-vertex int32 :offset-assert 16)
(vertex-skip int32 :offset-assert 20)
(vertex-count int32 :offset-assert 24)
(current-loc int32 :offset-assert 28)
(data vector :inline :dynamic :offset-assert 32)
)
:method-count-assert 9
:size-assert #x20
@ -23,7 +23,7 @@
(format #t "~Tvertex-skip: ~D~%" (-> obj vertex-skip))
(format #t "~Tvertex-count: ~D~%" (-> obj vertex-count))
(format #t "~Tcurrent-loc: ~D~%" (-> obj current-loc))
(format #t "~Tdata[0] @ #x~X~%" (-> obj data2))
(format #t "~Tdata[0] @ #x~X~%" (-> obj data))
obj
)

View file

@ -2929,10 +2929,7 @@
)
)
)
((the-as
(function process function object)
run-function-in-process
)
(run-now-in-process
s5-1
init-sidekick
)
@ -2981,14 +2978,7 @@
(&-> *dram-stack* 14336)
)
)
((the-as
(function process function symbol object)
run-function-in-process
)
s5-0
init-target
(the-as symbol arg1)
)
(run-now-in-process s5-0 init-target arg1)
(-> s5-0 ppointer)
)
)

View file

@ -1321,26 +1321,13 @@
(the-as pointer #x70004000)
)
)
(let
((t9-6
(the-as function run-function-in-process)
)
(a0-9 gp-1)
(a1-4 othercam-init-by-other)
(a3-2 7)
(t0-1 #f)
)
(run-now-in-process
gp-1
othercam-init-by-other
self
7
#f
#t
((the-as
(function object object object object object object)
t9-6
)
a0-9
a1-4
self
a3-2
t0-1
)
)
(-> gp-1 ppointer)
)
@ -1357,10 +1344,7 @@
(the-as pointer #x70004000)
)
)
((the-as
(function object object object object object)
run-function-in-process
)
(run-now-in-process
s5-0
fuel-cell-init-as-clone
(process->handle self)

View file

@ -91,10 +91,7 @@
(the-as pointer #x70004000)
)
)
((the-as
(function process function object object object object object)
run-function-in-process
)
(run-now-in-process
s5-1
manipy-init
(-> obj root trans)
@ -138,10 +135,7 @@
(the-as pointer #x70004000)
)
)
((the-as
(function process function object object object object object)
run-function-in-process
)
(run-now-in-process
s5-2
manipy-init
(-> obj root trans)

View file

@ -124,10 +124,7 @@
)
)
)
((the-as
(function process function object object object object object)
run-function-in-process
)
(run-now-in-process
s5-0
manipy-init
(->
@ -307,10 +304,7 @@
(the-as pointer #x70004000)
)
)
((the-as
(function process function object object object object object)
run-function-in-process
)
(run-now-in-process
s5-1
manipy-init
(-> obj root trans)

View file

@ -1190,7 +1190,7 @@
(the-as pointer #x70004000)
)
)
(run-function-in-process
(run-now-in-process
s4-1
part-tracker-init
(-> *part-group-id-table* 445)
@ -1198,7 +1198,7 @@
#f
#f
#f
(+ (+ (* s3-0 16) 28) (the-as int s5-0))
(-> s5-0 data s3-0)
)
(-> s4-1 ppointer)
)

View file

@ -88,10 +88,7 @@
(the-as pointer #x70004000)
)
)
((the-as
(function object object object object)
run-function-in-process
)
(run-now-in-process
gp-0
camera-tracker-init
(lambda :behavior camera-tracker

View file

@ -647,10 +647,7 @@
(the-as pointer #x70004000)
)
)
((the-as
(function process function object object object object object)
run-function-in-process
)
(run-now-in-process
s5-2
manipy-init
(-> obj root trans)
@ -1398,7 +1395,3 @@
(dummy-42 obj)
(none)
)

View file

@ -95,7 +95,7 @@
(the-as pointer #x70004000)
)
)
(run-function-in-process
(run-now-in-process
gp-0
pov-camera-init-by-other
(-> self spawn-pos)
@ -128,7 +128,7 @@
(the-as pointer #x70004000)
)
)
(run-function-in-process
(run-now-in-process
gp-1
pov-camera-init-by-other
(-> self spawn-pos)
@ -185,7 +185,7 @@
(the-as pointer #x70004000)
)
)
(run-function-in-process
(run-now-in-process
gp-0
pov-camera-init-by-other
(-> self spawn-pos)

View file

@ -703,10 +703,7 @@
)
)
)
((the-as
(function process function object object object object object)
run-function-in-process
)
(run-now-in-process
s3-0
manipy-init
s4-0
@ -777,10 +774,7 @@
)
)
)
((the-as
(function process function object object object object object)
run-function-in-process
)
(run-now-in-process
s3-1
manipy-init
s4-0