Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KA10: NLPT, device 464 #126

Open
larsbrinkhoff opened this issue Jul 9, 2019 · 44 comments
Open

KA10: NLPT, device 464 #126

larsbrinkhoff opened this issue Jul 9, 2019 · 44 comments
Assignees

Comments

@larsbrinkhoff
Copy link
Contributor

ITS' SALV 9 want to write loaded tape files to the "NLPT" printer, which has device code 464.

@rcornwell
Copy link
Owner

Feel free to add it. I will pick it up on the next release.

@larsbrinkhoff
Copy link
Contributor Author

I'd like the output to stdout. Is there already a way to get that?

@rcornwell
Copy link
Owner

I believe you can use sim_message. Why output to stdout, this was not the console?

@larsbrinkhoff
Copy link
Contributor Author

It's convenient to see the output directly on the screen rather than pull up a file.

@larsbrinkhoff
Copy link
Contributor Author

DATAO will output five 7-bit characters at a time. 177 is ignored.

@rcornwell
Copy link
Owner

This sounds exactly like LP10... perhaps they just moved it to another address?

@larsbrinkhoff
Copy link
Contributor Author

CONI bits.

7 - PIA
100 - done
200 - motor on

CONO bits.

100 - set output done
200 - clear done and PIA
1000 - image mode

DATAO

23 means start motor.
24 turn motor off.
177 is ignored.

@larsbrinkhoff
Copy link
Contributor Author

Yes, it seems they are the same or very similar.

@rcornwell
Copy link
Owner

If they are that similar then add in a second unit to LP. Set it disabled and give it the address of the new printer.

@larsbrinkhoff
Copy link
Contributor Author

A second DIB I guess?

@larsbrinkhoff
Copy link
Contributor Author

And a second DEVICE too?

@rcornwell
Copy link
Owner

Yes second device and DIB will be required. If CONI/CONO bits are the same, I can add it if you want. If not, just let me know what the differences between the CONI/CONO bits are and I can add support to existing dev_io routine.

@larsbrinkhoff
Copy link
Contributor Author

CONI/O bits seem mostly the same as far as I can see. There is CONO bit 1000 for image mode.

There seems to be some additional control characters:

  • 23 - turn on motor (BUSY set)
  • 24 - turn off motor (BUSY off)

@larsbrinkhoff
Copy link
Contributor Author

Here's a comment from ITS.

;"VOGUE" LPT (ACTUALLY ODEC)

Maybe this?

Or this?

@rcornwell
Copy link
Owner

What does start/stop motor do?

What does image mode do?

Looking at printer code this might be a bit more complex.

@larsbrinkhoff
Copy link
Contributor Author

I don't know what they do. I guess they should be accepted and mostly ingored. Motor on seems to set the BUSY flag.

Are you going to add the second unit? If so, I can experiment with adding characters and flags and report back what I find.

@rcornwell
Copy link
Owner

I think it will be a new device since the printer has some specifics that make it harder to add more units.

@larsbrinkhoff
Copy link
Contributor Author

larsbrinkhoff commented Aug 6, 2019 via email

@rcornwell
Copy link
Owner

Ok... please start with the current version on LPT, I made some fixes to handle some recent changes to SCP.

@rcornwell
Copy link
Owner

This fix makes the printer work:
`diff --git a/src/system/its.1648 b/src/system/its.1648
index ef763a9..2bc67c1 100644
--- a/src/system/its.1648
+++ b/src/system/its.1648
@@ -688,7 +688,7 @@ SUBTTL DEFINE DEVICE CODES, IOBFT CHNL NUMBERS

IFN STKP, STK==70 ;STANFORD KEYBOARD
IFN OLPTP, OLPT==124 ;LINE PRINTER
-IFN NLPTP, NLPT==464
+IFN NLPTP, NLPT==124
IFN TM10P, MTC==340 ;MAG TAPE CONTROL
IFN TM10P, MTS==344 ;MAG TAPE STATUS
IFN VIDP, NVDX==620 ;NEW VIDI X
`

@larsbrinkhoff
Copy link
Contributor Author

larsbrinkhoff commented Aug 10, 2019 via email

@rcornwell
Copy link
Owner

Ok... Don't we rebuild SALV?

I can see if I can do some changes to the printer to support device number changing. This seems like better idea then doing a whole new device.

@rcornwell
Copy link
Owner

I added a switch to set the device of LPT, however when I set it to 464 It does not appear to start. Yet when I changed the printer device to 124 it started correctly.

@larsbrinkhoff
Copy link
Contributor Author

larsbrinkhoff commented Aug 11, 2019 via email

@larsbrinkhoff
Copy link
Contributor Author

I think we should put UNSPOO aside for now. The normal way to print files is to use the TPL command from DDT. Some other programs use the TPL: device.

So, try this:

*:create foo bar
Hello printer world!
^C
*:TPL foo bar

@larsbrinkhoff
Copy link
Contributor Author

Maybe tpl^F to list files queued for output? Just guessing, but it's something ITS would typically do.

... tested it myself, and it lists files in .LPTR. That makes sense.

@larsbrinkhoff
Copy link
Contributor Author

According to ITS comments, OLPT/124 was made by Data Products. NLPT/464 was made by Vogue, or actually ODEC.

@larsbrinkhoff
Copy link
Contributor Author

NLPT does this:

        CONO NLPT,1000  ;TURN LPT MOTOR OFF: 1ST PUT LPT IN IMAGE MODE
        DATAO NLPT,[.BYTE 7 ? 24 ? 177 ? 177 ? 177 ? 177] ;THEN TURN OFF.

and

        CONO NLPT,1000  ;PUT LPT INTERFACE IN IMAGE MODE,
        DATAO NLPT,[23*2]       ;TURN ON THE LPT'S MOTOR.
        MOVEI I,1000
        CONSZ NLPT,200  ;WAIT TILL IT IS ON.
         SOJG I,.-1

@larsbrinkhoff
Copy link
Contributor Author

Slightly different checks in interrupt service:

IFN OLPTP,[
        CONSZ OLPT,7
        CONSZ OLPT,10
        JRST .+2
        JRST LPENT1     ;LINE PRINTER
]
IFN NLPTP,[
        CONSZ NLPT,7
        CONSO NLPT,100  ;DONE
        JRST .+2
        JRST NLPENT     ;NEW LINE PRINTER
]

@rcornwell
Copy link
Owner

rcornwell commented Aug 11, 2019

The 124 device is a totally different device then the LP10 I emulate. The 464 appears to be basically the same as an LP10. I am unsure what the image mode is. I set NLPT to 124 and enabled NLPTP and was able to print stuff. When I moved printer to 464 and set the NLPT to 464 it did not work. I pushed out changes that allow you do do set LPT dev=octal#.

@larsbrinkhoff
Copy link
Contributor Author

I get this:

simh-13> set lpt dev=464
Invalid argument

@larsbrinkhoff
Copy link
Contributor Author

After you do

    lpt_dib.dev_num = (int)i;

Don't you need to rerun some device configuration code?

@larsbrinkhoff
Copy link
Contributor Author

Like call build_dev_tab?

@larsbrinkhoff
Copy link
Contributor Author

If I change LP_DEVNUM to 464, SALV will talk to it, but I get output like this:

^?^?^M^L^?^?S^?^?A^?^?L^?^?V^?^?A^?^?T^?^?I^?^?O^?^?N^?^? ^?^?9^?^? ^?^? ^?^? ^?^? 
^?^? ^?^?^M^?^?^M^L^?^?T^?^?U^?^?T^?^? ^?^?F^?^?O^?^?R^?^? ^?^?D^?^?I^?^?S^?^?K^?^?
 ^?^?#^?^?0^?^?^M^?^?^M^L^?^?Y^?^? ^?^?F^?^?I^?^?L^?^?E^?^? ^?^?C^?^?O^?^?U^?^?N^?
^?T^?^? ^?^? ^?^?0^?^? ^?^? ^?^? ^?^? ^?^?B^?^?L^?^?K^?^? ^?^?#^?^? ^?^?D^?^?F^?^?R^?
^?S^?^? ^?^?C^?^?O^?^?U^?^?N^?^?T^?^? ^?^?0^?^? ^?^? ^?^? ^?^? ^?^?U^?^?S^?^?E
^?^?R^?^? ^?^?C^?^?O^?^?U^?^?N^?^?T^?^? ^?^?0^?^?^M^?^?T^?^?O^?^?T^?^?A^?^?L^?^? ^?
^?U^?^?S^?^?E^?^?R^?^? ^?^?B^?^?L^?^?O^?^?C^?^?K^?^?S^?^? ^?^?T^?^?H^?^?I^?^?S^?^? 
^?^?D^?^?I^?^?S^?^?K^?^? ^?^?0^?^?^M^?^?T^?^?O^?^?T^?^?A^?^?L^?^? ^?^?U^?^?S^?^?E^?
^?R^?^? ^?^?B^?^?L^?^?O^?^?C^?^?K^?^?S^?^? ^?^?A^?^?L^?^?L^?^? ^?^?D^?^?I^?^?S^?^?K
^?^?S^?^? ^?^?0^?^?^M^L^?^?^M

The ^? characters should be ignored. Then we get this:

^M^L
SALVATION 9     ^M^M^L
TUT FOR DISK #0^M^M^L
Y FILE COUNT  0    BLK # DFRS COUNT 0    USER COUNT 0^M
TOTAL USER BLOCKS THIS DISK 0^M
TOTAL USER BLOCKS ALL DISKS 0^M^L^M

@rcornwell
Copy link
Owner

set lpt0 dev=464

It looks like SALV is sending one character per request with zeros in the rest of it. If these are 0177 characters then this is an escape to take the next character as a literal.

@larsbrinkhoff
Copy link
Contributor Author

This is the SALV subroutine to print one character from accumulator A:

        LSH A,1              ;Shift A left to make it the fifth character.
        IOR A,[-1,,777400]   ;Pad with ones to the left, i.e. four 177 characters.
        CONSO NLPT,100       ;Wait for printer to be ready.
        JRST .-1
        DATAO NLPT,A         ;Output data.

Comments added by me. It seems fairly certain those four 177 should all be ignored, rather than escaping two 177s. It seems in this respect NLPT is different from LP10.

@larsbrinkhoff
Copy link
Contributor Author

With a call to build_dev_tab() added after the dev_num change, I do get output to device 464.

@larsbrinkhoff
Copy link
Contributor Author

I was wrong about ITS not using both 124 and 464. ITS 785 has both OLPT and NLPT at the same time. However, maybe we can get away with just one. As far as I can see, no other version has two line printers, and for 785 we have source code which can be reconfigured.

@rcornwell
Copy link
Owner

build_dev_tab() should be called whenever the sim_instr is entered. There should be no reason to ever call that.

I will have to check out the BA10 manual on what happens if the character after a 177 is a 177.

@larsbrinkhoff
Copy link
Contributor Author

Right, the call to build_dev_tab wasn't necessary after all. It was the change to lpt0 that did the trick.

I have been testing with SALV 9, because that's where I first encountered the need for NLPT. I haven't tested with ITS 16xx yet.

@rcornwell
Copy link
Owner

I made 177 be ignored if not 128 character printer. See if that works.

@larsbrinkhoff
Copy link
Contributor Author

That's a big improvement. Output is now:

^LSALVATION 9^M^LTUT FOR DISK #0^M^LY FILE COUNT  0    BLK # DFRS COUNT 0    US\
ER COUNT 0^MTOTAL USER BLOCKS THIS DISK 0^MTOTAL USER BLOCKS ALL DISKS 0^M^L^LT\
UT FOR DISK #1^M^LY FILE COUNT  0    BLK # DFRS COUNT 0    USER COUNT 0^MTOTAL \
USER BLOCKS THIS DISK 0^MTOTAL USER BLOCKS ALL DISKS 0^M^L^LTUT FOR DISK #2^M^L\
Y FILE COUNT  0    BLK # DFRS COUNT 0    USER COUNT 0^MTOTAL USER BLOCKS THIS D\
ISK 0^MTOTAL USER BLOCKS ALL DISKS 0^M^L.      @      DDT    OK^M.      ITS724 \
BIN    OK^M.      SALV   BIN    OK^MSYS    TS     LISP   OK^MSYS    TS     DMP \
   OK^MSYS    SYSTEM MAIL   OK^MSYS    ATSIGN HACTRN OK^MSYS    SYSTEM MAIL   E\
XISTS^MSYSBIN MIDAS  135BIN OK^MSYSBIN DUMP   BIN    OK^MSYSBIN TECO   BIN    O\
K^MSYSBIN MMIDAS BIN    OK^MBACKUP BLISP  131E   OK^MBACKUP TS     OCHESS OK^MB\
ACKUP TS     OPEEK  OK^M.TAPE0 -READ- -THIS- OK^M.TAPE1 -READ- -THIS- OK^M

The backslashes are not part of the output. Those are from Emacs' display. So there are no line breaks in there.

@larsbrinkhoff
Copy link
Contributor Author

Reformatted with ^M as line break, this becomes:

^L
SALVATION 9
^L
TUT FOR DISK #35
^L
Y FILE COUNT  0    BLK # DFRS COUNT 0    USER COUNT 0
TOTAL USER BLOCKS THIS DISK 0
TOTAL USER BLOCKS ALL DISKS 0
^L^L
TUT FOR DISK #1
^L
Y FILE COUNT  0    BLK # DFRS COUNT 0    USER COUNT 0
TOTAL USER BLOCKS THIS DISK 0
TOTAL USER BLOCKS ALL DISKS 0
^L^L
TUT FOR DISK #2
^L
Y FILE COUNT  0    BLK # DFRS COUNT 0    USER COUNT 0
TOTAL USER BLOCKS THIS DISK 0
TOTAL USER BLOCKS ALL DISKS 0
^L
.      @      DDT    OK
.      ITS724 BIN    OK
.      SALV   BIN    OK
SYS    TS     LISP   OK
SYS    TS     DMP    OK
SYS    SYSTEM MAIL   OK
SYS    ATSIGN HACTRN OK
SYS    SYSTEM MAIL   EXISTS
SYSBIN MIDAS  135BIN OK
SYSBIN DUMP   BIN    OK
SYSBIN TECO   BIN    OK
SYSBIN MMIDAS BIN    OK
BACKUP BLISP  131E   OK
BACKUP TS     OCHESS OK
BACKUP TS     OPEEK  OK
.TAPE0 -READ- -THIS- OK
.TAPE1 -READ- -THIS- OK

@larsbrinkhoff
Copy link
Contributor Author

^L comes from a routine called LFORM so I think those should be form feeds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants