diff --git a/example_v86.html b/example_v86.html
index 75ba0c28..c528a770 100644
--- a/example_v86.html
+++ b/example_v86.html
@@ -55,6 +55,7 @@
V86Loader.scale(1),
V86Loader.emulatorJS("emulators/v86/libv86.js"),
V86Loader.emulatorWASM("emulators/v86/v86.wasm"),
+ V86Loader.memorySize(16),
V86Loader.mountFile("seabios.bin",
V86Loader.fetchFile("BIOS",
"emulators/v86/seabios.bin")),
diff --git a/loader.js b/loader.js
index 7b7654b6..31f5e7ff 100644
--- a/loader.js
+++ b/loader.js
@@ -1009,9 +1009,9 @@ var Module = null;
*/
function V86Loader() {
var config = Array.prototype.reduce.call(arguments, extend);
- config.memory_size = 32 << 20;
- config.vga_memory_size = 2 << 20;
- config.boot_order = 0x213;
+ config.memory_size = Math.round((config.memory_size || 32) * 1024 * 1024);
+ config.vga_memory_size = Math.round((config.vga_memory_size || 2) * 1024 * 1024);
+ config.boot_order = config.boot_order || 0x213;
config.runner = V86Runner;
return config;
}