summaryrefslogtreecommitdiff
path: root/src/js/primitives
diff options
context:
space:
mode:
authorspv420 <spv@spv.sh>2022-07-15 12:09:22 -0400
committerspv420 <spv@spv.sh>2022-07-15 12:09:22 -0400
commitd1da310f02adc0e9b5f8656ea063fd3231901611 (patch)
tree18c5f5ae07c39805018aad81a974288924dbb196 /src/js/primitives
parent3df21d6c8d6c978cedaac23dbbf4c106dee9120f (diff)
code
Diffstat (limited to 'src/js/primitives')
-rw-r--r--src/js/primitives/call.js6
-rw-r--r--src/js/primitives/mem.js2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/js/primitives/call.js b/src/js/primitives/call.js
index dfd3077..760ca40 100644
--- a/src/js/primitives/call.js
+++ b/src/js/primitives/call.js
@@ -11,6 +11,7 @@ if (build_for == N94AP_13G37) {
var pthread_exit = 0x20633048 | 1;
var pthread_join = 0x20636af4 | 1;
var add_sp_0x3c = 0x23d72b5a | 1;
+ var NDR_record = 0x36ebf00c;
} else if (build_for == N78AP_13G36) {
var __stack_chk_fail_lazy_addy = 0x347f7c48;
var __stack_chk_fail_resolver = 0x23d751fc;
@@ -19,6 +20,7 @@ if (build_for == N94AP_13G37) {
var pthread_exit = 0x20633048 | 1;
var pthread_join = 0x20636af4 | 1;
var add_sp_0x3c = 0x23d72b5a | 1;
+ var NDR_record = 0x364d200c;
}
var reserve_addr = 0x1a0000;
var sym_cache = {};
@@ -410,8 +412,12 @@ function scall() {
// printf("%s\n", args_to_pass.toString());
if (args_to_pass.length > 5 || force_callnarg) {
+// if (sptr_len > 100)
+// call4arg(sym_cache["puts"], sptr("callnarg"), 0, 0, 0);
return callnarg.apply(this, args_to_pass);
} else {
+// if (sptr_len > 100)
+// call4arg(sym_cache["puts"], sptr("call4arg"), 0, 0, 0);
var count_to_me = 5 - arguments.length;
for (var i = 0; i < count_to_me; i++) {
args_to_pass.push(0);
diff --git a/src/js/primitives/mem.js b/src/js/primitives/mem.js
index b5078eb..4025c2f 100644
--- a/src/js/primitives/mem.js
+++ b/src/js/primitives/mem.js
@@ -254,6 +254,7 @@ function _sptr(s) {
}
write_str(global_sptr_addy, s);
global_sptr_addy += s.length;
+ sptr_len += s.length;
return global_sptr_addy - s.length;
}
@@ -281,6 +282,7 @@ function shit_heap(v) {
}
// write_str(global_sptr_addy, s);
global_sptr_addy += v;
+ sptr_len += v;
return global_sptr_addy - v;
}