From 5aaf4b4c5ac7aba5e5fbe9f579d4058534c7aceb Mon Sep 17 00:00:00 2001 From: Bobuxstation <91587018+Bobuxstation@users.noreply.github.com> Date: Sun, 24 Dec 2023 18:04:55 +0700 Subject: [PATCH] update --- package.json | 2 +- scripts/index.js | 27 ++++++++++++++++++++++++--- style/style.css | 19 +++++++++++++++++-- 3 files changed, 42 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 454f984..83e004c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "venom86", - "version": "1.0.2", + "version": "1.0.3", "description": "x86 Emulation by Qrodex", "main": "index.js", "scripts": { diff --git a/scripts/index.js b/scripts/index.js index 17b443d..3e11fe2 100644 --- a/scripts/index.js +++ b/scripts/index.js @@ -39,7 +39,7 @@ async function init(name, fda, fdb, cdrom, hda, hdb, ram, vram) { ` document.getElementById('previews').appendChild(preview) - let controls = document.createElement('div') + let controls = document.createElement('footer') controls.className = 'vmitem' document.getElementById(contID).appendChild(controls) @@ -98,14 +98,35 @@ async function init(name, fda, fdb, cdrom, hda, hdb, ram, vram) { alttabbtn.innerText = 'Send Alt+Tab' controls.appendChild(alttabbtn) alttabbtn.onclick = function (e) { - vm.keyboard_send_keys([18, 9]) + vm.keyboard_send_scancodes([ + 0x38 | 0x80, + 0x0F | 0x80, + ]); } let cadbtn = document.createElement('button') cadbtn.innerText = 'Send Ctrl+Alt+Del' controls.appendChild(cadbtn) cadbtn.onclick = function (e) { - vm.keyboard_send_keys([17, 18, 46]) + vm.keyboard_send_scancodes([ + 0x1D, // ctrl + 0x38, // alt + 0x53, // delete + + // break codes + 0x1D | 0x80, + 0x38 | 0x80, + 0x53 | 0x80, + ]); + } + + let scaleinput = document.createElement('input') + scaleinput.value = 1.0 + scaleinput.type = 'number' + scaleinput.step = 0.25 + controls.appendChild(scaleinput) + scaleinput.onchange = function (e) { + vm.screen_set_scale(scaleinput.value, scaleinput.value) } let vmloop diff --git a/style/style.css b/style/style.css index 2306acd..aeb969f 100644 --- a/style/style.css +++ b/style/style.css @@ -128,6 +128,16 @@ details, border: #3d3d3d solid 1px; } +footer { + width: fit-content; +} + +container div { + text-align: center; + height: fit-content !important; + width: 100% !important; +} + fieldset { background: none; border: #3d3d3d dashed 2px; @@ -160,16 +170,21 @@ legend { width: 50%; } -.vmitem button { +.vmitem button, container input { background: none; border: #3d3d3d dashed 2px; padding: 10px; border-radius: 5px; margin: 5px; cursor: pointer; + width: fit-content; +} + +container input { + width: 75px; } -fieldset:hover, .vmitem button:hover { +fieldset:hover, .vmitem button:hover, container input:hover { border:#6d6d6d dashed 2px; }