summaryrefslogtreecommitdiff
path: root/src/js/primitives/mem.js
diff options
context:
space:
mode:
authorspv <aquaticvegetable@gmail.com>2022-04-24 21:30:15 -0400
committerspv <aquaticvegetable@gmail.com>2022-04-24 21:30:15 -0400
commit7de438565f03123d37f737d2cd905579e90bc21e (patch)
tree2459045c6f8035aac6340361170142a144c0274f /src/js/primitives/mem.js
parent5f9294a0e7aac5b9e105ccee737e42fc5c4cff63 (diff)
yeet
Diffstat (limited to 'src/js/primitives/mem.js')
-rw-r--r--src/js/primitives/mem.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/js/primitives/mem.js b/src/js/primitives/mem.js
index 85cd132..ff12fdd 100644
--- a/src/js/primitives/mem.js
+++ b/src/js/primitives/mem.js
@@ -91,6 +91,21 @@ function write_u32_buf(addy, buf, len) {
return buf;
}
+function fast_write_buf(addy, buf) {
+ var upper_i = Math.floor(buf.length / 0x100);
+
+ for (var i = 0; i < upper_i; i++) {
+ u8x4 = u32_to_u8x4(addy + (i * 0x100));
+ parent[VECTOR_OFFSET + 0x0] = u8x4[0];
+ parent[VECTOR_OFFSET + 0x1] = u8x4[1];
+ parent[VECTOR_OFFSET + 0x2] = u8x4[2];
+ parent[VECTOR_OFFSET + 0x3] = u8x4[3];
+ for (var j = (i * 0x100); (j < (i * 0x100) + 0x100) && (j < buf.length); j++) {
+ child[j % 0x100] = buf[j];
+ }
+ }
+}
+
/*
* write uint8_t
*/