mirror of
https://github.com/copy/v86.git
synced 2025-12-31 04:23:15 +00:00
UI for floppy insertion/ejection
This commit is contained in:
parent
d6f3ffc340
commit
8c0448909e
4 changed files with 29 additions and 23 deletions
11
debug.html
11
debug.html
|
|
@ -262,6 +262,7 @@ function load_next()
|
|||
<input type="button" value="Get hard disk image" id="get_hda_image">
|
||||
<input type="button" value="Get second hard disk image" id="get_hdb_image">
|
||||
<input type="button" value="Get cdrom image" id="get_cdrom_image">
|
||||
<input type="button" value="Insert floppy image" id="change_fda_image">
|
||||
<input type="button" value="Save State" id="save_state">
|
||||
<input type="button" value="Load State" id="load_state"> <input type="file" style="display: none" id="load_state_input">
|
||||
<input type="button" value="Memory Dump" id="memory_dump">
|
||||
|
|
@ -278,16 +279,6 @@ function load_next()
|
|||
</label>
|
||||
|
||||
<br>
|
||||
<label id="change_fda" style="display: none">
|
||||
Change floppy:
|
||||
<input type="file">
|
||||
</label>
|
||||
|
||||
<label id="change_cdrom" style="display: none">
|
||||
Change CD:
|
||||
<input type="file">
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
<pre style="margin: 0" id="log_levels"></pre>
|
||||
|
|
|
|||
13
index.html
13
index.html
|
|
@ -185,6 +185,7 @@
|
|||
<input type="button" value="Get hard disk image" id="get_hda_image">
|
||||
<input type="button" value="Get second hard disk image" id="get_hdb_image">
|
||||
<input type="button" value="Get cdrom image" id="get_cdrom_image">
|
||||
<input type="button" value="Insert floppy image" id="change_fda_image">
|
||||
<input type="button" value="Save State" id="save_state">
|
||||
<input type="button" value="Load State" id="load_state"> <input type="file" style="display: none" id="load_state_input">
|
||||
<input type="button" value="Memory Dump" id="memory_dump">
|
||||
|
|
@ -201,18 +202,6 @@
|
|||
</label>
|
||||
|
||||
<br>
|
||||
<label id="change_fda" style="display: none">
|
||||
Change floppy:
|
||||
<input type="file">
|
||||
</label>
|
||||
|
||||
<label id="change_cdrom" style="display: none">
|
||||
Change CD:
|
||||
<input type="file">
|
||||
</label>
|
||||
|
||||
<br>
|
||||
|
||||
</div>
|
||||
<pre style="display: none" id="loading"></pre>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1704,6 +1704,32 @@
|
|||
};
|
||||
}
|
||||
|
||||
$("change_fda_image").value = settings.fda ? "Eject floppy image" : "Insert floppy image";
|
||||
$("change_fda_image").onclick = function()
|
||||
{
|
||||
if(emulator.v86.cpu.devices.fdc.fda_image)
|
||||
{
|
||||
emulator.eject_fda();
|
||||
$("change_fda_image").value = "Insert floppy image";
|
||||
}
|
||||
else
|
||||
{
|
||||
const file_input = document.createElement("input");
|
||||
file_input.type = "file";
|
||||
file_input.onchange = async function(e)
|
||||
{
|
||||
const file = file_input.files[0];
|
||||
if(file)
|
||||
{
|
||||
await emulator.set_fda({ buffer: file });
|
||||
$("change_fda_image").value = "Eject floppy image";
|
||||
}
|
||||
};
|
||||
file_input.click();
|
||||
}
|
||||
$("change_fda_image").blur();
|
||||
};
|
||||
|
||||
$("memory_dump").onclick = function()
|
||||
{
|
||||
const mem8 = emulator.v86.cpu.mem8;
|
||||
|
|
|
|||
|
|
@ -994,7 +994,7 @@ V86Starter.prototype.set_fda = async function(file)
|
|||
{
|
||||
this.v86.cpu.devices.fdc.set_fda(image);
|
||||
};
|
||||
image.load();
|
||||
await image.load();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue