• Please review our updated Terms and Rules here

Telnet BBSing double-spacing issue

As stated before, that's the expected behavior. A CR immediately after another CR is a wasted byte because once you do the carriage return, doing it again doesn't change the state of the terminal. (Generating delays for electro-mechanical devices are a different discussion.)

If your program is doing something on the second CR that visibly changes the state of the terminal, well, that's a bug for you to fix.
What would you expect to see if two CRs were shown? What does a CR control code do?

Yeah I think it finally got through my thick skull. On the Commodore CR does both carriage return and newline. So that's fine for PETSCII mode but for ASCII mode I need to change it so that it basically ignores CRs and interprets LFs as CRs instead.
 
I need to change it so that it basically ignores CRs and interprets LFs as CRs instead.
How do you think LFs and CRs should be interpreted? This looks like BBS output, so it should act like plain TTY text you would get over a modem session. With plain TTY text, CR should mean "go to column 1 of the current line" and LF should mean "go to the current column in the next line". When interpreted this way, a second CR is just a NOP. If there's a mode you have to deal with that only sends CRs or only sends LFs, then it's not plain TTY text. What the system does with PRINT statements shouldn't matter, this isn't the local console, this is text over a (virtual) modem to a (virtual) terminal.

It looks to me like both modes you have to deal with are weird, but the one that isn't sending CR-CR-LF is weirder.
 
Last edited:
Yeah I think it finally got through my thick skull. On the Commodore CR does both carriage return and newline. So that's fine for PETSCII mode but for ASCII mode I need to change it so that it basically ignores CRs and interprets LFs as CRs instead.
Nope. That's particularly dangerous in that it will appear to work in many situations. What you need to do is go find the standard meanings of the those control characters. ANSI X3.4-1977: The American National Standard Code for Information Interchange is a fairly readable version that is linked from the Wikipedia page on ASCII.

1715132557406.png

(Note that you don't have such agreement when calling a BBS, unless it's specifically a Unix-only BBS for Unix-only clients.)

1715132538104.png

(This, BTW, is about the eighth time this has been said by me and others....)
 
No I get what you're saying CR should CR (return carriage to start of line) and LF should LF (feed to the next line) but on the C128 (and other commodore machines) there is no character that does what CR means. If you print a CR character on a commodore its going to do the line feed whether you want it to or not. So unless you're doing the extra step to then move the cursor back up ... which you could do but I don't know if there's any value in doing that for communicating with bulletin board systems, *nix terminal sessions maybe.
 
...but on the C128 (and other commodore machines) there is no character that does what CR means. If you print a CR character on a commodore its going to do the line feed whether you want it to or not. So unless you're doing the extra step to then move the cursor back up ...
There's no need to do an extra step (and you should not do so, because you'll be scrolling the screen even you don't see a subsequent LF). Simply call the KERNAL PLOT routine at $FFF0 to get the cursor position, change the column number to 0, and call it again to set the new cursor position.

If you're trying to do this from BASIC, this page has a guide on how to use the SYS command to call PLOT.

There are certainly several more options, and some of the others may be better, but I'm not an expert on this area of the C64.
 
There's no need to do an extra step (and you should not do so, because you'll be scrolling the screen even you don't see a subsequent LF). Simply call the KERNAL PLOT routine at $FFF0 to get the cursor position, change the column number to 0, and call it again to set the new cursor position.

If you're trying to do this from BASIC, this page has a guide on how to use the SYS command to call PLOT.

There are certainly several more options, and some of the others may be better, but I'm not an expert on this area of the C64.
I'm doing this in C - using cc65 compiler. I'll look into the PLOT routine, whatever I do has to work for both VIC and VDC output as the program lets you switch between the two. Although I guess there might be one way to do it for the VIC and another for the VDC, I'm not sure yet.
 
Back
Top