Tyrop Posted October 23, 2007 Share Posted October 23, 2007 I want to be able to redirect the Atari's input and output from the keyboard/screen to the RS232 so that I could operate the Atari remotely, i.e., use a modem or telnet into the Atari and be able to access DOS and Basic. Basically, the Atari would look to R1: for its input instead of the keyboard, and it would send its output to R1: instead of the screen. Would it be as simple as swapping the 'E' and the 'R' in the handler address table (HATABS)? I remember that IBM made it easy to redirect the standard input and output "stdin" and "stdout" via a simple DOS command. How complicated would it be to do this on the Atari? Quote Link to comment Share on other sites More sharing options...
Rybags Posted October 23, 2007 Share Posted October 23, 2007 (edited) In BASIC, you can do it easily enough anyway. You just need to Close #0 then re-open it. But, BASIC doesn't let you do stuff with #0. But... there is a trick: just add 16 to the IOCB number. So, CLOSE #16:OPEN #16,12,0,"R:" Problem is though - if anything causes a new "E:" device to open, it will revert to the default. The alternative would be to just swap the letters in the HATABS region of memory. Another alternative - just use the ENTER "<filespec>" command. The input source doesn't have to contain a program, it can be any sequence of input strings. Edited October 23, 2007 by Rybags Quote Link to comment Share on other sites More sharing options...
Shannon Posted October 23, 2007 Share Posted October 23, 2007 Aren't Atari's ASCII codes different from most other machines? You might have problems with some of the character translations like (eol, eof, return, etc). Quote Link to comment Share on other sites More sharing options...
JamesD Posted October 23, 2007 Share Posted October 23, 2007 I don't know about the Atari but I know the TRS-80 series have ROM vectors in RAM that point to the keyboard and print routines. By modding those pointers to your own routines you could do such a thing. If the Atari has an equivalent you could do the same. Just remember, anything that bypasses those routines won't work. That usually means BASIC programs work but not all machine language programs. Quote Link to comment Share on other sites More sharing options...
Tyrop Posted October 24, 2007 Author Share Posted October 24, 2007 Wow, nice trick in Basic using OPEN #16,12,0,"R:"... I am using APE as an internet modem, and when I connect using WIndows Hyperterminal or telnet, I get the following repeated over and over again in Hyperterminal or in telnet: ERROR- ~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9 876543210/.-,+*)('&%$#"! Any idea what this is? Even when I do ENTER "R:", the same error shows up repeated over and over, except on the Atari side (all in inverse except "ERROR-") Quote Link to comment Share on other sites More sharing options...
Rybags Posted October 24, 2007 Share Posted October 24, 2007 As was stated before, I'd suspect you'd have problems due to ATASCII differences. e.g. Atari "RETURN" = $9B (155 dec), just about everyone else = $0D (13) Atari also ignores all of the control characters like LF, PF etc (ie anything less than 27) and just prints the graphics characters. Read the doco - maybe there's something like "R2:" which does translation? Or maybe someone out there has already produced a handler which does. Quote Link to comment Share on other sites More sharing options...
Shannon Posted October 24, 2007 Share Posted October 24, 2007 FWIW replacing device handlers on the Atari's is ridiculously easy. You can pretty much replace each function (command number) with anything you want. As long as you know a little bit assembly. It's just the translation between ASCII, ATASCII, and the internal keycodes may be a bit tricky. Quote Link to comment Share on other sites More sharing options...
Tyrop Posted October 25, 2007 Author Share Posted October 25, 2007 THe error does not seem to have anything to do with ATASCII differences. In fact, I cannot eveb get to type anytning in. The Atari sends that error over and over all by itself. Maybe it has something to do with APE? Quote Link to comment Share on other sites More sharing options...
kenfused Posted October 25, 2007 Share Posted October 25, 2007 Wow, nice trick in Basic using OPEN #16,12,0,"R:"... I am using APE as an internet modem, and when I connect using WIndows Hyperterminal or telnet, I get the following repeated over and over again in Hyperterminal or in telnet: ERROR- ~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9 876543210/.-,+*)('&%$#"! Any idea what this is? Even when I do ENTER "R:", the same error shows up repeated over and over, except on the Atari side (all in inverse except "ERROR-") Depending on the device, for most R: devices you need to enter concurrent mode with some XIO command after the open if you want the atari to be able to receive characters IIRC. Quote Link to comment Share on other sites More sharing options...
Tyrop Posted October 25, 2007 Author Share Posted October 25, 2007 Im not sure that concurrent mode matters. The Atari is receiveing something which is causing it to display this error over and over again. I can't figure this out, I think it may have something to do with APE. Quote Link to comment Share on other sites More sharing options...
Rybags Posted October 25, 2007 Share Posted October 25, 2007 How about just OPENing a file and then GET each character and display it, just to see exactly what is coming downstream? It may well be that there are bracketing and control characters being sent that you just wouldn't want to be passed on. Quote Link to comment Share on other sites More sharing options...
Tyrop Posted October 25, 2007 Author Share Posted October 25, 2007 Kenfused was right... I needed to set concurrent mode on channel 16, so that fixed the repeated errors. Now, the Atari can only output. It does not seem to accept input from R1. I am using Atari Terminal Simulator (an ATASCII terminal program from the APE web page) on the PC side to connect, so I am transmitting carriage returns as 155, but the Aatari is not even echoing characters. THe following program outputs to R1, and its output on the Atari Terminal simulator shows HELLO, followed by the program listing, followed by the READY prompt, followed by the cursor. But after that, if I try typing on the Atari Terminal Simulator, I see nothing (although the APE Internet Proxy Monitor is flashes RX every time I type a character). THank you all for responding to my post, I greatly appreciate all the helpful advice. I wrote a rudimentary BBS in the early 80's and I would like to try running it again, adding the ability to get into BASIC and DOS remotely. Here is the short program: 10 CLOSE #16:OPEN#16,12,0,"R:" 20 XIO 40,#16,0,0,"R:" (sets concurrent mode I/O) 30 XIO 36,#16,15,0,"R:" (sets 9600 baud, 8 bits, 1 stop bit, no line monitoring) 40 XIO 38,#16,32,0,"R:" (no ASCII translation, ignore parity, do not change parity bit, do not append line feeds) 50 PRINT"HELLO" 60 LIST That program outputs to R:, but does not accept input. If anyone is willing to give this a shot with APE, you can set APE's R: internet modem in server mode, and telnet from the same computer running APE by putting in your PC's ip address. If you are behind a router, you can use your local ip address. Quote Link to comment Share on other sites More sharing options...
Marius Posted January 20, 2011 Share Posted January 20, 2011 I think the 12 in line 10 has to be a 13. Strange enough that is needed with R: Quote Link to comment Share on other sites More sharing options...
+JAC! Posted January 20, 2011 Share Posted January 20, 2011 #13 means read & write with read from screen. It causes the handler to not wait for "RETURN" to read a line. It can be use to autorun basic programs for example also. You print 'RUN "D:PETER.BAS", put the curso above the text and type. OPEN #16,13,0,"E:" From OS: ; AUX1 EQUATES ; () INDICATES WHICH DEVICES USE BIT APPEND = $1 ;OPEN FOR WRITE APPEND (D), OR SCREEN READ (E) DIRECT = $2 ;OPEN FOR DIRECTORY ACCESS (D) OPNIN = $4 ;OPEN FOR INPUT (ALL DEVICES) OPNOT = $8 ;OPEN FOR OUTPUT (ALL DEVICES) OPNINO = OPNIN+OPNOT ;OPEN FOR INPUT AND OUTPUT (ALL DEVICES) MXDMOD = $10 ;OPEN FOR MIXED MODE (E,S) INSCLR = $20 ;OPEN WITHOUT CLEARING SCREEN (E,S) Quote Link to comment Share on other sites More sharing options...
Marius Posted January 21, 2011 Share Posted January 21, 2011 @jac The program has a: open #1,12,0,"R:" This does not exist with the "R: Device (unless you have a MIO which does accept a 12 there) with "R: it has to be a 13. So that line with the OPEN command has to be: OPEN #1,13,0,"R:" I'm working at the moment on a R: related program. It is working in BASIC and now I'm converting it to assembler. I was looking for some info on the forum, so I found this thread. The first thing what I thought reading was: why is that "12" there... I always had to use "13" on read/write with R: ... so that is why I answered. It is an old thread, and the topic starter doesn't mind anyway I guess Quote Link to comment Share on other sites More sharing options...
Kyle22 Posted March 10, 2015 Share Posted March 10, 2015 I am looking for info on that subject now... http://atariage.com/forums/topic/235991-slim-version-of-carina-ii-moe-source-code-for-sdx/ Quote Link to comment Share on other sites More sharing options...
UNIXcoffee928 Posted March 10, 2015 Share Posted March 10, 2015 It would be cool if somebody modded BASIC XL to default to fully working reversed E: & R: devices. Then you could use a linux box next to the Atari for the output. It would be pretty doable to make a terminal type on the linux side that was tailored for displaying the Atari output. Quote Link to comment Share on other sites More sharing options...
Kyle22 Posted March 10, 2015 Share Posted March 10, 2015 Yes, but better yet, make a SDX driver so it will work with all languages and programs, not just BXL. I may have to clean the rust off my SDX driver memory and attempt this thing, but, I'm afraid I'm severely lacking in skills after getting this far out of practice... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.