Compare commits

..

No commits in common. "3c58e9134a7ff68d86c74738114083d744378146" and "88c4b21818152800ab758c18196fcb5c0ebbb60e" have entirely different histories.

5 changed files with 545 additions and 555 deletions

View file

@ -44,7 +44,7 @@ if( typeof AFRAME != 'undefined '){
muteUntilPrompt:{ type: 'boolean',"default":true}, // mute stdout until a prompt is detected in ISO muteUntilPrompt:{ type: 'boolean',"default":true}, // mute stdout until a prompt is detected in ISO
HUD: { type: 'boolean',"default":false}, // link to camera movement HUD: { type: 'boolean',"default":false}, // link to camera movement
transparent: { type:'boolean', "default":false }, // need good gpu transparent: { type:'boolean', "default":false }, // need good gpu
memory: { type: 'number', "default":64 }, // VM memory (in MB) [NOTE: quest or smartphone might crash > 40mb ] memory: { type: 'number', "default":40 }, // VM memory (in MB) [NOTE: quest or smartphone might crash > 40mb ]
bufferLatency: { type: 'number', "default":1 }, // in ms: bufferlatency from webworker to xterm (batch-update every char to texture) bufferLatency: { type: 'number', "default":1 }, // in ms: bufferlatency from webworker to xterm (batch-update every char to texture)
debug: { type: 'boolean', "default":false } debug: { type: 'boolean', "default":false }
}, },
@ -311,7 +311,7 @@ if( typeof AFRAME != 'undefined '){
cols: this.cols, cols: this.cols,
rows: this.rows, rows: this.rows,
el_or_id: el, el_or_id: el,
max_scroll_lines: this.rows*2, max_scroll_lines: this.rows,
nodim: true, nodim: true,
rainbow: [VT100.COLOR_MAGENTA, VT100.COLOR_CYAN ], rainbow: [VT100.COLOR_MAGENTA, VT100.COLOR_CYAN ],
xr: AFRAME.scenes[0].renderer.xr, xr: AFRAME.scenes[0].renderer.xr,
@ -376,7 +376,7 @@ if( typeof AFRAME != 'undefined '){
this.data.width -= this.data.padding*2 this.data.width -= this.data.padding*2
this.data.height -= this.data.padding*2 this.data.height -= this.data.padding*2
this.cols = Math.floor(this.data.width/this.data.lineHeight*2) this.cols = Math.floor(this.data.width/this.data.lineHeight*2)
this.rows = Math.floor( (this.data.height*0.93)/this.data.lineHeight) this.rows = Math.floor(this.data.height*0.53/this.data.lineHeight*1.7)
}, },
events:{ events:{

View file

@ -123,11 +123,8 @@ ISOTerminal.prototype.start = function(opts){
url: "bios/vgabios.bin", url: "bios/vgabios.bin",
//urg|: "com/isoterminal/bios/VGABIOS-lgpl-latest.bin", //urg|: "com/isoterminal/bios/VGABIOS-lgpl-latest.bin",
}, },
network_relay_url: "wss://relay.widgetry.org/",
cmdline: "rw root=host9p rootfstype=9p rootflags=trans=virtio,cache=loose modules=virtio_pci tsc=reliable init_on_freg|=on vga=ask", //vga=0x122", cmdline: "rw root=host9p rootfstype=9p rootflags=trans=virtio,cache=loose modules=virtio_pci tsc=reliable init_on_freg|=on vga=ask", //vga=0x122",
net_device:{
relay_url:"fetch", // or websocket proxy "wss://relay.widgetry.org/",
type:"virtio"
},
//bzimage_initrd_from_filesystem: true, //bzimage_initrd_from_filesystem: true,
//filesystem: { //filesystem: {
// baseurl: "com/isoterminal/v86/images/alpine-rootfs-flat", // baseurl: "com/isoterminal/v86/images/alpine-rootfs-flat",
@ -227,8 +224,6 @@ ISOTerminal.prototype.startVM = function(opts){
\r https://www.w3.org/TR/webxr \r https://www.w3.org/TR/webxr
\r https://three.org \r https://three.org
\r https://aframe.org \r https://aframe.org
\r https://busybox.net
\r https://buildroot.org
` `
const text_color = "\r" const text_color = "\r"
@ -257,7 +252,7 @@ ISOTerminal.prototype.startVM = function(opts){
const str = e.detail const str = e.detail
// lets scan for a prompt so we can send a 'ready' event to the world // lets scan for a prompt so we can send a 'ready' event to the world
if( !this.ready && str.match(/\n(\/ #|~ #|~%|\[.*\]>)/) ) this.postBoot() if( !this.ready && str.match(/\n(\/ #|~%|\[.*\]>)/) ) this.postBoot()
if( this.ready || !this.opts.muteUntilPrompt ) this.emit('serial-output-string', e.detail ) if( this.ready || !this.opts.muteUntilPrompt ) this.emit('serial-output-string', e.detail )
}) })

View file

@ -100,8 +100,6 @@ function VT100(opts)
bg = VT100.COLOR_TRANSPARENT //COLOR_BLACK; bg = VT100.COLOR_TRANSPARENT //COLOR_BLACK;
} }
console.dir(opts)
var r; var r;
var c; var c;
var scr = typeof el_or_id == 'string' ? document.getElementById(el_or_id) : el_or_id var scr = typeof el_or_id == 'string' ? document.getElementById(el_or_id) : el_or_id
@ -122,9 +120,7 @@ function VT100(opts)
this.redraw_[r] = 1; this.redraw_[r] = 1;
} }
this.scr_ = scr; this.scr_ = scr;
this.scr_.style.display = 'block' this.scr_.style.display = 'inline'
this.scr_.style.overflowY = 'scroll'
this.scr_.style.height = '100%'
this.setupTouchInputFallback() // smartphone/android this.setupTouchInputFallback() // smartphone/android
this.cursor_vis_ = true; this.cursor_vis_ = true;
this.cursor_key_mode_ = VT100.CK_CURSOR; this.cursor_key_mode_ = VT100.CK_CURSOR;
@ -133,7 +129,7 @@ function VT100(opts)
this.key_buf_ = []; this.key_buf_ = [];
this.echo_ = false; this.echo_ = false;
this.esc_state_ = 0; this.esc_state_ = 0;
this.log_level_ = VT100.WARN //VT100.DEBUG this.log_level_ = VT100.WARN
this.clear_all(); this.clear_all();
@ -266,20 +262,14 @@ VT100.handle_onkeypress_ = function VT100_handle_onkeypress(event,cb)
ch = '\x1b'; ch = '\x1b';
case "Control": case "Control":
break; break;
case "PageDown":
ch = '\x1b[6~';
break;
case "PageUp":
ch = '\x1b[5~';
break;
default: default:
return true return true
break; break;
} }
// custom map override
if( vt.opts.map[ event.code ].ch ) ch = vt.opts.map[ event.code ].ch
if( vt.opts.map[ event.code ].ctrl && event.ctrlKey ) ch = vt.opts.map[ event.code ].ctrl
} }
// custom map override
if( vt.opts.map[ event.code ]?.ch ) ch = vt.opts.map[ event.code ].ch
if( vt.opts.map[ event.code ]?.ctrl && event.ctrlKey ) ch = vt.opts.map[ event.code ].ctrl
// Workaround: top the event from doing anything else. // Workaround: top the event from doing anything else.
// (prevent input from adding characters instead of via VM) // (prevent input from adding characters instead of via VM)
@ -663,10 +653,10 @@ VT100.prototype.refresh = function VT100_refresh()
// XXX: Remove older rows if past max_ht_ rows. // XXX: Remove older rows if past max_ht_ rows.
var num_rows = this.num_rows_ - this.start_row_id; var num_rows = this.num_rows_ - this.start_row_id;
if ( this.scr_.firstChild && num_rows >= (this.max_ht_ + 100)) { if (num_rows >= (this.max_ht_ + 100)) {
// Remove one group of rows (i.e. a 100 rows). // Remove one group of rows (i.e. a 100 rows).
this.scr_.removeChild(this.scr_.firstChild); this.scr_.removeChild(this.scr_.firstChild);
this.start_row_id += 100; this.start_row_id += 100;
} }
for (r = 0; r < ht; ++r) { for (r = 0; r < ht; ++r) {
@ -748,7 +738,6 @@ VT100.prototype.refresh = function VT100_refresh()
div_element.innerHTML = row_html; div_element.innerHTML = row_html;
//dump("adding row html: " + row_html + "\n"); //dump("adding row html: " + row_html + "\n");
} }
this.scr_.scrollTop = this.scr_.scrollHeight
this.curs_set(1) this.curs_set(1)
} }

File diff suppressed because it is too large Load diff

Binary file not shown.