scredit2notes.txt - Notes on scredit2, a reimplementation of SCREDIT.
SCREDIT was a terminal emulator and line-scraping text editor for
SCOPE/Hustler, written in 8080 and 8086 assembly language by me
starting in 1980, for Ontel terminals and IBM PCs. 
   /mrr   2005-12-26

I have started two versions of scredit2 right now: 
-- A Java version, begun on 12 Dec 2005, which has the beginnings
of a GUI and can receive and display lines of text with telnet 
negotiation, but nothing else.  No keyboard input.
This is in c:\mrr\netbeans\mrr2.
-- A C++ version, which I started 25 Dec 2005, which is even less
advanced.  It can do telnet negotiation, but can't display
anything.
This is in c:\mrr\cdc\SCOPEHustler\scredit2.

In other words, I haven't got much invested in either.

Right now, I'm trying to decide which way to go.  I am leaning
toward the less ambititous C++ scredit2.  The idea for this version
is to be a recreation of the original SCREDIT UI and functionality.
Later (the thinking goes) I would go back to the fancier Java
version, which has a tabbed interface and would probably feature
scroll bars and text selection with a mouse.

If I go with the C++ version, I would probably base the implementation
on the original 8080/8086 asm version.  The question is whether I should
do it in assembly or C.  And should I try to mechanically translate?

VC++6.0 uses ECX for the "this" pointer.  This argues for using
C rather than C++ if I decide to use assembly, since SCREDIT 
does use the 8080 B and C registers (CX on 8086).

Though assembly would make the program less portable, in practice
Win32 exes are likely to be runnable on just about any likely 
target machine, for years to come.

2005-12-27  Playing with ASM.
I wrote \mrr\prog\testasm\testasm.cpp to play around with the 
possibilities of x86 assembler in a .cpp file.  Looks promising.
Starting \mrr\cdc\SCOPEHustler\scredit2\ASMCompassToX86.py

================================================================
2006-02-25  Fleshed out screen display

A few days ago, I implemented font handling and other portions
of the screen display, though I do not display from a screen buffer
yet.  (Just constant text.)
I will probably display monochrome text at first, then later switch
to color, probably using the parallel attributes buffer used by the
PC version of scredit.

I am leaning towards an all-C++ version, staying away from assembly.
There are 8086-specific weirdnesses that would be difficult to 
translate.  And SCREDIT is a much more complex program than I
remembered.  All sorts of unusual conditions are handled.

Right now, my thinking is that I will write some skeletal initial
version by hand in C++, closely following the original SCREDIT.
Then later I will reevaluate the idea of partial mechanical translation.

Should I pass parameters to routines, or rely on global variables
(or possibly registers)?
(I decided on global vars for the most part.)
================================================================
2006-02-27  Creating SourceForge project

UNIX name: scredit2

Public description:

scredit2 is a reimplementation of the SCREDIT terminal emulator and screen-scraping text editor written for CDC mainframes at Michigan State University in the early 1980's.  It's intended for use with FREND2 (http://frend2.sourceforge.net).

Registration Description:

scredit2 will be a Win32 GUI telnet terminal emulator.  There are about a zillion of those, but none like scredit2, which will be a reimplementation of a special-purpose terminal emulator and text editor named SCREDIT, which I wrote in the early 1980's at Michigan State University (MSU).  SCREDIT was used to access and edit files on our Control Data Corporation mainframe.  It was written in assembly language for the proprietary Ontel OEM terminal and later ported to the IBM PC.  The reimplementation will be done in C++.

The only likely audience for scredit2 will be users of frend2 and DtCyber, which emulate the CDC mainframe in question.  See http://sourceforge.net/projects/frend2/.  With DtCyber, frend2, and scredit2, you can have the complete computing experience that MSU users had in the early 1980's.  (DtCyber and frend2 are usable now, but current telnet emulators do not provide the full experience enjoyed by those historical users.) 

The original program had essentially four modes:
-- A terminal mode with a large scrollback buffer.  You could scroll back, edit, and retransmit lines previously entered in the session.
-- A "full-screen" screen editor vaguely similar to, say, EMACS.  This is a front-end to an old-fashioned mainframe line editor; scredit2 will invisibly, in the background, send editing commands to the mainframe to synchronize the mainframe file with what appears on the screen.
-- A VT220 emulator with no scrollback buffer.
-- A file transfer mode.  (Proprietary protocol, of course.)

I'm not sure I'll implement the VT220 mode, but I do plan on implementing the other modes.

The original SCREDIT was over 35,000 lines of interspersed 8080 and 8086 assembly language, so this reimplementation won't be done overnight.  However, my only other SourceForge project (frend2, a C reimplementation of a 20,000-line Interdata 7/32 assembly language program) was completed successfully, so this project has a decent chance.

Thank you for your time.   
Mark R
================================================================
2006-03-12  Troubles talking to MS telnet server

Putty (telnet mode) works OK, but scredit2 gets weird response from
Microsoft telnet server.  All seems OK until I send a CR after the
password. 
MS sends: FF FA 18 01 FF F0  
and scredit2 does not respond.

With Putty, after I send password CR, MS sends the same, but 
putty responds:   FF FA 18 00 58 54 45 52 4D FF F0      ....XTERM.
MS again sends:   FF FA 18 01 FF F0                   ......    
putty responds:   FF FA 18 00 58 54 45 52 4D FF F0    ....XTERM.
which is the same again.

I replaced that with ff fa 18 00 la36 ff f0
and it worked!

[18:47 12 March] Terminal mode is starting to get barely usable.
I can have a normal session, and the bottom line is
displayed OK.  Past lines are saved, but I can't scroll up to
see them yet.  I haven't implemented textblock splitting yet, so 
textblock 0 is growing beyond its nominal max size.

telnet to MS telnet server looks a little weird--the prompt line
is overriden by the response to the command.  I think that MS assumes
that CR sends CR LF or something.
================================================================
2006-04-02  Got trm mode minimally working

I got skeletal terminal mode more-or-less working a few days
ago, but hadn't gotten around to fixing omissions from handling
reallocation of textblocks.
On 1 April I got this working, and I added cmdline parameters to
enable debugging (and disabled it by default).
I would like to finally add scredit2 to Subversion on sourcforge,
and today I'm finally trying to figure that out.
Trying to create a directory gets me:
MKACTIVITY of
'/svnroot/scredit2/!svn/act/(long hex string)': 403 Forbidden (https://svn.sourceforge.net)

Having problems with TortoiseSVN; trying cmdline instead:

set SVN_EDITOR=notepad
svn --username riordanmr --password xxx mkdir https://svn.sourceforge.net/svnroot/scredit2/scredit2
Same thing.  Also same thing with http://

Note: psftp gets its settings from:
HKCU\Software\SimonTatham\PuTTY\...
I mention this because the command line 
  psftp riordanmr@sh.sf.net
logs me in without prompting me for a pw.  Apparently it is reading the private key
from c:\mrr\cdc\SCOPEHustler\riordanmr-key2.ppk
However, SVN is not using SSH, but rather HTTPS.

Trying this:

svn switch --relocate http://svn.sourceforge.net/svnroot/scredit2 https://svn.sourceforge.net/svnroot/scredit2
Didn't work.

Documenting what I tried:

TortoiseSVN | Import...

In the TortoiseSVN: Import dialog:
URL of respository:
https://svn.sourceforge.net/svnroot/scredit2

In the TortoiseSVN: Authentication dialog, I typed my SF username riordanmr
and my password.  (I know that the password is correct.)

I reply I get:
Error: MKACTIVITY of '/svnroot/scredit2/!svn/act/99788f7d-00c1-934d-9ee5-e10aab4ae813': 403 Forbidden (https://svn.sourceforge.net)  

Here's what I posted:
======================
Hello.  I am a first-time user of Subversion.
(I have successfully used CVS in my other SF.net project.)

While using either TortoiseSVN 1.3.2 or the Win32 command svn.exe, I get this error:

Error: MKACTIVITY of '/svnroot/scredit2/!svn/act/99788f7d-00c1-934d-9ee5-e10aab4ae813': 403 Forbidden (https://svn.sourceforge.net)  

when trying to import source code files, or trying to create a subdirectory in my project, scredit2.

I don't think this is a TortoiseSVN-specific problem, but I will tell you how I got the error in TortoiseSVN:
-----
I selected a directory, right-clicked, and chose 
TortoiseSVN | Import...

In the TortoiseSVN: Import dialog:
URL of respository:
https://svn.sourceforge.net/svnroot/scredit2

In the TortoiseSVN: Authentication dialog, I typed my SF username riordanmr
and my password.  (I know that the password is correct.)

I reply I get:
Error: MKACTIVITY of '/svnroot/scredit2/!svn/act/99788f7d-00c1-934d-9ee5-e10aab4ae813': 403 Forbidden (https://svn.sourceforge.net)  
-----
Likewise, when I tried an mkdir from the command line:

C:\mrr\cdc\SCOPEHustler\scredit2>svn --username riordanmr --password xxxxxx mkdir https://svn.sourceforge.net/svnroot/scredit2/scredit2

Log message unchanged or not specified
a)bort, c)ontinue, e)dit
c
svn: MKACTIVITY of '/svnroot/scredit2/!svn/act/e374188c-adb4-e54d-a9b8-953bc67c3
0a6': 403 Forbidden (https://svn.sourceforge.net)
---------
So, I can't even get to first base with SVN.
I am not trying to doing anything complicated--I am just trying to put my existing source files into this new and currently empty project.

I have tried reading the TortoiseSVN doc, the SVN doc,
and the docs on Sourceforge.net, as well as Googling the MKACTIVITY error, but I haven't a clue as to what I am doing wrong.

Can you help?

Thanks.

Mark Riordan
riordan@rocketmail.com
======================
2006-04-03  I needed to give riordanmr SVN permission

How to label the repository with my own version, like 0.4.0.0??
I guess you need to do a commit and use the label or log or comment field
(whatever it's called).
================================================================
2006-04-09  Implementing scredit2.int

Yesterday and today implemented scredit2.ini in Application Data.
Macros and default connection.

BTW, in Visual Studio, I am using this as Program Arguments:
localhost 6500 -m:macrostart

Tab handling:  If cursor is at offset 13, we want it to 
go to offset 16.
(13+8)/8 = 2
16-curcol = 3
0123456789a123456
        ^       ^
---------------------------------------
