Redirect Console CPM Telnet Server

The RetroNET Cloud CP/M operating system for the NABU PC.
User avatar
DJ Sures
Posts: 345
Joined: Tue Mar 28, 2023 8:36 pm
Location: nabu.ca
Contact:

Redirect Console CPM Telnet Server

Post by DJ Sures »

With the Internet Adapter 2023.03.30.00+ and Cloud CPM 7.7+, you can redirect the console input and output to a TCP telnet server. Oh, and it supports up to 32 connections at the same time, so you can telnet into your nabu and control it from multiple computers, etc...

Use this with the accompanying adm3 emulator software: viewtopic.php?t=72

(See CPM input/output mapping: https://www.seasip.info/Cpm/iobyte.html)
TCP Console Output Device: UC1:
TCP Reader Input Device UR1:






TESTING
First, let's test to see how this works...

1) Enable TCP Server in RetroNET in the Internet Adapter settings window
Capture.JPG
Capture.JPG (62.85 KiB) Viewed 9230 times

2) Go to A: User Area #1 and type TCPSRVR. The program will load
Capture.JPG
Capture.JPG (91.95 KiB) Viewed 9229 times

3) Telnet to your Internet Adapter's computer. You can do that locally by simply TELNET 127.0.0.1 5815
You can now type on either the NABU or the Telnet window and see the text back and forth
Capture.JPG
Capture.JPG (66 KiB) Viewed 9228 times

4) Press CTRL-C to exit the application



SEND CONSOLE OUTPUT
Don't close your telnet window yet! Now that you have tested and seen how this works, let's redirect just the CPM console output to the same telnet window.

1) Make sure you're on A: User Area 0

2) Type STAT CON:=UC1:

3) Now you can type on the NABU keyboard and see the output in the TELNET session
Capture.JPG
Capture.JPG (53.22 KiB) Viewed 9227 times



GET CONSOLE INPUT
Now let's get the input from the TELNET window. That is done from the READER device and assigning it to the UR1: device

1) type STAT RDR:=UR1:

2) Now you can use the telnet session entirely (I recommend using putty. If you use the windows telnet, you'll need to press CTRL-ENTER) otherwise the wrong enter code is set
Capture.JPG
Capture.JPG (62.7 KiB) Viewed 9227 times



RESTORE TO CRT CONSOLE
This is how you can restore the input and output to the console. Or, you can just restart CPM hehe

1) type STAT CON:=CRT:
this will redirect all output to the CRT. So the next stuff you type won't come out of the telnet window

2) type STAT RDR:=TTY:
this will use the NABU tty input device
User avatar
superbenk
Posts: 54
Joined: Wed Mar 29, 2023 10:44 am

Re: Redirect Console CPM Telnet Server

Post by superbenk »

Well that just simplifies everything, now, doesn't it! Fantastic addition! I'm quickly remembering how much I hated serial in the 90s :D
- Ben
User avatar
DJ Sures
Posts: 345
Joined: Tue Mar 28, 2023 8:36 pm
Location: nabu.ca
Contact:

Re: Redirect Console CPM Telnet Server

Post by DJ Sures »

superbenk wrote: Fri Mar 31, 2023 6:08 pm Well that just simplifies everything, now, doesn't it! Fantastic addition! I'm quickly remembering how much I hated serial in the 90s :D
Thanks! My goals you might notice are to do the most with what we got. Rather than having to purchase expensive ads-ons
User avatar
DJ Sures
Posts: 345
Joined: Tue Mar 28, 2023 8:36 pm
Location: nabu.ca
Contact:

Re: Redirect Console CPM Telnet Server

Post by DJ Sures »

added a video on the first post that explains how to do this
alitel
Posts: 5
Joined: Wed Apr 12, 2023 2:34 pm

Re: Redirect Console CPM Telnet Server

Post by alitel »

Hi all,

Just wanted to post a fun diversion -- I wanted to recreate my childhood WordStar and SuperCalc experience on an actual 80 column character terminal, so was trying the telnet redirect (DJ's work is so appreciated, thank you!), but the terminals I tried on linux (though they claimed it) didn't really seem to properly support ADM-3A, so the formatting was broken. I then got hold of a trial commercial ADM-3A emulator product to verify and it did work (unfortunately they are extremely proud of their software, big $$$, but I'm not spending money on this!). Now, I'm absolutely SURE there's a simple solution to this problem, but what I ended up doing was leveraging the very straightforward VT52 emulator project at https://github.com/kgober/VT52, adding a few lines of code to accept the ADM-3A control sequences for cursor movement and screen management, and boom it works a treat, looks great. Happy to post the mods to the project if anyone has interest. Note that it's a windows, not linux solution tho.

Cheers, A
User avatar
DJ Sures
Posts: 345
Joined: Tue Mar 28, 2023 8:36 pm
Location: nabu.ca
Contact:

Re: Redirect Console CPM Telnet Server

Post by DJ Sures »

alitel wrote: Wed Apr 12, 2023 10:38 pm Hi all,

Just wanted to post a fun diversion -- I wanted to recreate my childhood WordStar and SuperCalc experience on an actual 80 column character terminal, so was trying the telnet redirect (DJ's work is so appreciated, thank you!), but the terminals I tried on linux (though they claimed it) didn't really seem to properly support ADM-3A, so the formatting was broken. I then got hold of a trial commercial ADM-3A emulator product to verify and it did work (unfortunately they are extremely proud of their software, big $$$, but I'm not spending money on this!). Now, I'm absolutely SURE there's a simple solution to this problem, but what I ended up doing was leveraging the very straightforward VT52 emulator project at https://github.com/kgober/VT52, adding a few lines of code to accept the ADM-3A control sequences for cursor movement and screen management, and boom it works a treat, looks great. Happy to post the mods to the project if anyone has interest. Note that it's a windows, not linux solution tho.

Cheers, A
Nice little project. You can always use cloud gui or rncmd to copy the words star project to your c: drive and any user area. Then you can reconfigure it for vt100 or vt52 or what ever is supported. The installer for wordstar allows confusing the terminal type
User avatar
productiondave
Posts: 117
Joined: Tue Mar 28, 2023 10:01 pm

Re: Redirect Console CPM Telnet Server

Post by productiondave »

I'd be interested in this.
alitel
Posts: 5
Joined: Wed Apr 12, 2023 2:34 pm

Re: Redirect Console CPM Telnet Server

Post by alitel »

DJ Sures wrote: Wed Apr 12, 2023 11:21 pm
alitel wrote: Wed Apr 12, 2023 10:38 pm Hi all,

Just wanted to post a fun diversion -- I wanted to recreate my childhood WordStar and SuperCalc experience on an actual 80 column character terminal, so was trying the telnet redirect (DJ's work is so appreciated, thank you!), but the terminals I tried on linux (though they claimed it) didn't really seem to properly support ADM-3A, so the formatting was broken. I then got hold of a trial commercial ADM-3A emulator product to verify and it did work (unfortunately they are extremely proud of their software, big $$$, but I'm not spending money on this!). Now, I'm absolutely SURE there's a simple solution to this problem, but what I ended up doing was leveraging the very straightforward VT52 emulator project at https://github.com/kgober/VT52, adding a few lines of code to accept the ADM-3A control sequences for cursor movement and screen management, and boom it works a treat, looks great. Happy to post the mods to the project if anyone has interest. Note that it's a windows, not linux solution tho.

Cheers, A
Nice little project. You can always use cloud gui or rncmd to copy the words star project to your c: drive and any user area. Then you can reconfigure it for vt100 or vt52 or what ever is supported. The installer for wordstar allows confusing the terminal type
Yes I was wondering about that too -- that was going to be the next plan if I didn't have any success with the mod, and actually I'm going to try it out -- haven't yet played with the ability to make my own drives and so forth. Do you know if supercalc allows the same modification of the terminal settings?

I also ran across a cpm emulator on github that had a dbase II installation included, which was a complete blast from the distant past for me. Would love to recommend adding it to the cloud cpm suite if it's not already there!
alitel
Posts: 5
Joined: Wed Apr 12, 2023 2:34 pm

Re: Redirect Console CPM Telnet Server

Post by alitel »

productiondave wrote: Wed Apr 12, 2023 11:22 pm I'd be interested in this.
This is the code block I edited within the Output(Byte c) method in the VT52.cs file of the project (around line 877 in my editor). There are three areas, commented with BEGIN LS ADM3A and END LS ADM3A. Very minor changes. This is absolutely a hack and not complete, but it's fun and makes wordstar and supercalc display better for me lol.

You also need to change the hard-coded telnet port specified in the Connect method in Telnet.cs from 23 to 5815 (line 163 in my editor).

switch ((Char)c)
{
case '\r': // CR - Carriage Return
mDisplay.MoveCursorAbs(0, mDisplay.CursorY);
return;
case '\n': // LF - Line Feed
ny = mDisplay.CursorY + 1;
if (ny >= Display.ROWS)
{
if (mHoldCount > 0) mHoldCount--;
if (mHoldCount == 0)
{
mSilo.Enqueue(c);
Send(0x13); // XOFF
return;
}
ScrollUp();
ny = Display.ROWS - 1;
}
mDisplay.MoveCursorAbs(mDisplay.CursorX, ny);
return;
case '\b': // BS - Backspace
mDisplay.MoveCursorRel(-1, 0);
return;
case '\t': // HT - Horizontal Tab
if (mDisplay.CursorX >= 72)
mDisplay.MoveCursorRel(1, 0);
else
mDisplay.MoveCursorRel(8 - (mDisplay.CursorX % 8), 0);
return;
case '\a': // BEL - Ring the Bell
mDisplay.Beep();
return;
// ++++++++++++++++++++++++++++++++++++++++
// BEGIN LS ADM3A
// Addition of Lear-Siegler ADM-3A control sequences (does not use escape sequences for these functions)
case '\v': // VT - Up one line
mDisplay.MoveCursorRel(0, -1);
return;
case '\x0C': // FF - Forespace move cursor one right
mDisplay.MoveCursorRel(1, 0);
return;
case '\x1A': // CTRL-Z (SUB) in this case, clear screen
mDisplay.MoveCursorAbs(0, 0);
for (Int32 y = 0; y < Display.ROWS; y++)
{
for (Int32 x = 0; x < Display.COLS; x++) mDisplay[x, y] = 32;
}
return;
case '\x1E': // RS -- cursor to home
mDisplay.MoveCursorAbs(0, 0);
return;
// END LS ADM3A
// ++++++++++++++++++++++++++++++++++++++++
case '\x1B': // ESC - Escape Sequence
mEsc = 1;
return;
case 'A': // ESC A - Cursor Up
mEsc = 0;
mDisplay.MoveCursorRel(0, -1);
return;
case 'B': // ESC B - Cursor Down
mEsc = 0;
mDisplay.MoveCursorRel(0, 1);
return;
case 'C': // ESC C - Cursor Right
mEsc = 0;
mDisplay.MoveCursorRel(1, 0);
return;
case 'D': // ESC D - Cursor Left
mEsc = 0;
mDisplay.MoveCursorRel(-1, 0);
return;
case 'F': // ESC F - Enter Graphics Mode
mEsc = 0;
mGraphicsMode = true;
return;
case 'G': // ESC G - Exit Graphics Mode
mEsc = 0;
mGraphicsMode = false;
return;
case 'H': // ESC H - Cursor Home
mEsc = 0;
mDisplay.MoveCursorAbs(0, 0);
return;
case 'I': // ESC I - Reverse Line Feed
mEsc = 0;
ny = mDisplay.CursorY - 1;
if (ny < 0)
{
ScrollDown();
ny = 0;
}
mDisplay.MoveCursorAbs(mDisplay.CursorX, ny);
return;
case 'J': // ESC J - Erase to End-of-Screen
mEsc = 0;
for (Int32 x = mDisplay.CursorX; x < Display.COLS; x++) mDisplay[x, mDisplay.CursorY] = 32;
for (Int32 y = mDisplay.CursorY + 1; y < Display.ROWS; y++)
{
for (Int32 x = 0; x < Display.COLS; x++) mDisplay[x, y] = 32;
}
return;
case 'K': // ESC K - Erase to End-of-Line
mEsc = 0;
for (Int32 x = mDisplay.CursorX; x < Display.COLS; x++) mDisplay[x, mDisplay.CursorY] = 32;
return;
case 'Y': // ESC Y - Direct Cursor Addressing
mEsc = 2;
return;
// ++++++++++++++++++++++++++++++++++++++++
// BEGIN LS ADM3A
// LS uses ESC= rather than ESC Y for direct cursor addressing, but otherwise works same way I think
case '=': // ESC = - LS ADM3A Direct Cursor Addressing
mEsc = 2;
return;
// END LS ADM3A
// ++++++++++++++++++++++++++++++++++++++++
case 'Z': // ESC Z - Identify Terminal Type
mEsc = 0;
Send(0x1B);
Send((Byte)'/');
Send((Byte)'K');
return;
case '[': // ESC [ - Enter Hold-Screen Mode
mEsc = 0;
mHoldCount = 1;
return;
case '\\': // ESC \ - Exit Hold-Screen Mode
mEsc = 0;
mHoldCount = -1;
return;
// ++++++++++++++++++++++++++++++++++++++++
// BEGIN LS ADM3
// Remove this, used for cursor positioning in LS
//case '=': // ESC = - Enter Alternate-Keypad Mode
// mEsc = 0;
// KeypadMode = true;
// return;
// END LS ADM3
// ++++++++++++++++++++++++++++++++++++++++
case '>': // ESC > - Exit Alternate-Keypad Mode
mEsc = 0;
KeypadMode = false;
return;
default:
if ((c >= 32) && (c < 127)) mEsc = 0; // ignore unrecognized escape sequences
return;
}
User avatar
superbenk
Posts: 54
Joined: Wed Mar 29, 2023 10:44 am

Re: Redirect Console CPM Telnet Server

Post by superbenk »

I thought I'd go poking around to see what I could find. I have a terminal for BBS'ing on my Mac called SyncTERM (https://syncterm.bbsdev.net/) but it doesn't support ADM3a either.

Then I found this which looks like it could be fun! https://www.emustudio.net/documentation ... a-terminal

Haven't tried EmuStudio yet, though.
- Ben
Post Reply