Fix n-body visualization

This commit is contained in:
dcodeIO
2018-07-22 02:55:46 +02:00
parent 813d2e33c8
commit a1e2071da6
15 changed files with 134 additions and 43 deletions

View File

@ -477,6 +477,19 @@ function asmFunc(global, env, buffer) {
};
}
function assembly_index_getBody($0) {
$0 = $0 | 0;
var $1 = 0, $22 = 0, $20 = 0;
$1 = HEAPU32[assembly_index_system >> 2] | 0;
if ($0 >>> 0 < (HEAP32[($1 + 4 | 0) >> 2] | 0) >>> 0) {
$1 = HEAPU32[$1 >> 2] | 0;
if ($0 >>> 0 < ((HEAP32[$1 >> 2] | 0) >>> 2 | 0) >>> 0) $20 = HEAPU32[(($1 + ($0 << 2 | 0) | 0) + 8 | 0) >> 2] | 0; else abort();
$22 = $20;
} else $22 = 0;
$0 = $22;
return $0 | 0;
}
function start() {
$lib_allocator_arena_startOffset = 40;
$lib_allocator_arena_offset = $lib_allocator_arena_startOffset;
@ -521,6 +534,7 @@ function asmFunc(global, env, buffer) {
}),
init: assembly_index_init,
step: assembly_index_step,
bench: assembly_index_bench
bench: assembly_index_bench,
getBody: assembly_index_getBody
};
}