First web implementation draft of the draft
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
//app part not related to ESOP JS implementation
|
||||
|
||||
function main() {
|
||||
var devCfg = {
|
||||
audio: window.audioContext || window.webkitAudioContext,
|
||||
canvas: document.getElementById('C') //JS-specific implementation canvas DOM reference
|
||||
}
|
||||
|
||||
document.getElementById('apprun').addEventListener('click', function() {
|
||||
var fileObj = document.getElementById('appselect').files[0]
|
||||
if(fileObj.name.endsWith('.eso')) {
|
||||
var rdr = new FileReader()
|
||||
rdr.onload = function() {
|
||||
var vm = UxnCore()
|
||||
var ext = ESOPExtensions()
|
||||
vm.boot()
|
||||
ext.setup(vm, devCfg)
|
||||
vm.load(new Uint8Array(rdr.result))
|
||||
console.log('VM started')
|
||||
vm.start(0x100)
|
||||
}
|
||||
rdr.readAsArrayBuffer(fileObj)
|
||||
}
|
||||
else window.alert('Please select an .eso file to run on ESOP')
|
||||
})
|
||||
}
|
||||
|
||||
addEventListener('DOMContentLoaded', main)
|
||||
Reference in New Issue
Block a user