diff --git a/exec/dorkit/graphic.js b/exec/dorkit/graphic.js index 01e1a57fc913e437d84e45ed406f751fa4d73c50..ac40459dab2c7127c40c40a452a3a7d6988ee3c1 100644 --- a/exec/dorkit/graphic.js +++ b/exec/dorkit/graphic.js @@ -486,7 +486,7 @@ Graphic.prototype.draw = function(xpos,ypos,width,height,xoff,yoff) alert("Attempt to draw from outside of graphic: "+xoff+":"+yoff+" "+width+"x"+height+" "+this.width+"x"+this.height); return(false); } - if(xpos+width-1 > dk.console.cols || ypos+height-1 > dk.console.rows) { + if(xpos+width > dk.console.cols || ypos+height > dk.console.rows) { alert("Attempt to draw outside of screen: " + (xpos+width-1) + "x" + (ypos+height-1)); return(false); } diff --git a/exec/dorkit/jsexec_console.js b/exec/dorkit/jsexec_console.js index b1df0f3aed1e64cfa5d20a0db668ac2da33f20f0..ed2e8778152e1c3ccb9a8386f69c52cc0a8b1f65 100644 --- a/exec/dorkit/jsexec_console.js +++ b/exec/dorkit/jsexec_console.js @@ -1,38 +1,5 @@ -/* - * Clears the current screen and moves to location 1,1 - */ +load("ansi_console.js"); -dk.console.remote_io = { - clear:function() { - this.print("\x1b[2J\x1b[1;1H"); - }, - - /* - * Clears to end of line. - * Not available witout ANSI (???) - */ - cleareol:function() { - if(dk.console.ansi) - this.print('\x1b[K'); - }, - - /* - * Moves the cursor to the specified position. - * returns false on error. - * Not available without ANSI - */ - gotoxy:function(x,y) { - if(dk.console.ansi) - this.print(format("\x1b[%u;%uH", y, x)); - }, - - /* - * Writes a string unmodified. - */ - print:function(string) { - write(string); - }, +dk.console.remote_io.print = function(string) { + write(string); }; - -var input_queue = load(true, "jsexec_input.js"); -js.on_exit("input_queue.write(''); input_queue.poll(0x7fffffff);"); diff --git a/exec/dorkit/sbbs_console.js b/exec/dorkit/sbbs_console.js index 836e4d168f3197ffb9a025ab94ff0043f72f502a..7119ef17c1077be40ba9cecd49ee96ed53edb9c5 100644 --- a/exec/dorkit/sbbs_console.js +++ b/exec/dorkit/sbbs_console.js @@ -27,7 +27,7 @@ dk.console.remote_io = { * Not available without ANSI */ gotoxy:function(x,y) { - console.gotoxy(x,y); + console.gotoxy(x+1,y+1); }, /* diff --git a/exec/dorkit/socket_console.js b/exec/dorkit/socket_console.js index 4ce954101632283fb78a30d62852d0206adb79e9..a3ca227a1e1ecdb6e3d949a05cdd7ef70b640280 100644 --- a/exec/dorkit/socket_console.js +++ b/exec/dorkit/socket_console.js @@ -1,41 +1,9 @@ -/* - * Clears the current screen to black and moves to location 1,1 - */ +load("ansi_console.js"); -dk.console.remote_io = { - sock:new Socket(true, dk.connection.socket), - clear:function() { - this.print("\x0c"); - }, - - /* - * Clears to end of line. - * Not available witout ANSI (???) - */ - cleareol:function() { - if(dk.console.ansi) - this.print('\x1b[K'); - }, - - /* - * Moves the cursor to the specified position. - * returns false on error. - * Not available without ANSI - */ - gotoxy:function(x,y) { - if(dk.console.ansi) - this.print(format("\x1b[%u;%uH", y, x)); - }, - - /* - * Writes a string unmodified. - */ - print:function(string) { - this.sock.write(string.replace(/\xff/g, "\xff\xff")); - }, -}; +dk.console.remote_io.sock = new Socket(true, dk.connection.socket); if (!dk.console.remote_io.sock.is_connected) throw("Unable to create socket object"); -var input_queue = load(true, "socket_input.js", argv[0], argv[1]); -js.on_exit("input_queue.write(''); input_queue.poll(0x7fffffff);"); +dk.console.remote_io.print = function(string) { + this.sock.write(string.replace(/\xff/g, "\xff\xff")); +};