summaryrefslogtreecommitdiff
path: root/src/js/primitives
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/primitives')
-rw-r--r--src/js/primitives/call.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/js/primitives/call.js b/src/js/primitives/call.js
index 687e758..06c5a77 100644
--- a/src/js/primitives/call.js
+++ b/src/js/primitives/call.js
@@ -156,4 +156,13 @@ function callnarg() {
calls4arg("thread_set_state", read_u32(th), ARM_THREAD_STATE, thread_state, ARM_THREAD_STATE_COUNT);
calls4arg("thread_resume", read_u32(th), 0, 0, 0);
+
+ while (true) {
+ write_u32(count, 0x1000);
+ calls4arg("thread_get_state", read_u32(th), ARM_THREAD_STATE, thread_state, count);
+ if ((read_u32(thread_state + (15 << 2)) - (0x23d751fc + dyld_shc_slide)) <= 8) {
+ return read_u32(thread_state);
+ }
+ calls4arg("usleep", 1000, 0, 0, 0);
+ }
} \ No newline at end of file