From f9aaf3179060da740bf9fe9117a3b7923a5a883a Mon Sep 17 00:00:00 2001 From: copy Date: Mon, 29 Dec 2014 17:43:49 +0100 Subject: [PATCH] adapt basic example to bus communication --- docs/samples/basic.html | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/samples/basic.html b/docs/samples/basic.html index ddb70c16a0..8242813aff 100644 --- a/docs/samples/basic.html +++ b/docs/samples/basic.html @@ -8,7 +8,7 @@ - + @@ -58,8 +58,16 @@ return; } + var bus = Bus.create(); + var container = document.getElementById("screen_container"); - var cpu = new v86(); + var cpu = new v86(bus[0]); + + // Adapters implement the communication from or to the emulator. These + // default adapters (defined in browser/*.js) implement what you see + // on copy.sh/v86. You could change them to programatically control the emulator + var keyboard = new KeyboardAdapter(bus[1]); + var screen = new ScreenAdapter(container, bus[1]); cpu.init({ // load_devices has to be set to true, otherwise no OS can run @@ -78,12 +86,6 @@ bios: images.seabios, vga_bios: images.vga_bios, - // Adapters implement the communication from or to the emulator. These - // default adapters (defined in browser/*.js) implement what you see - // on copy.sh/v86. You could change them to programatically control the emulator - screen_adapter: new ScreenAdapter(container), - keyboard_adapter: new KeyboardAdapter(), - vga_memory_size: 2 * 1024 * 1024, // default 8M memory_size: 32 * 1024 * 1024, // default 64M });