telstar cursor positioning

Here you can talk about anything related to BBC BASIC, not covered in another category
nelgin
Posts: 4
Joined: Sun 19 Jul 2020, 11:11

telstar cursor positioning

Post by nelgin »

Hi there,

Not sure where to but this question since it's really about videotex/viewdata rather than BBC Basic itself. But anyway, here goes.

I'm trying to send the codes to set the cursor in a specific location.

Using this document, I've tried a couple of options:
https://en.wikipedia.org/wiki/Videotex_character_set

From research I've tried both 1C and 1F with various combinations and no success. If anyone is familiar with videotex and could lend a hand, I'd appreciate it. I suppose it's possible the program doesn't support it but that'd seem odd since I can see the cursor moving but it's hard to tell what's going on.

Thanks,
Nigel
RichardRussell

Re: telstar cursor positioning

Post by RichardRussell »

nelgin wrote: Sun 19 Jul 2020, 12:38 I'm trying to send the codes to set the cursor in a specific location.
telstar.bbc does not currently implement the full set of Videotex control codes, but only those needed for the specific services it supports (e.g. Telstar and Teefax). Specifically it doesn't respond to the APS or APA commands for moving the cursor to a specific row and column.

So your choices are for telstar.bbc to be modified to accept the APS command, or for you to move the cursor to the desired location using a sequence of individual home/up/down/left/right commands. The latter may be more work but should improve compatibility with other Videotex clients, which may also not implement the full set of commands.
nelgin
Posts: 4
Joined: Sun 19 Jul 2020, 11:11

Re: telstar cursor positioning

Post by nelgin »

RichardRussell wrote: Sun 19 Jul 2020, 13:19 telstar.bbc does not currently implement the full set of Videotex control codes, but only those needed for the specific services it supports
Urgh, I've been up all night trying to get this work! I wasn't sure if it was some funky VDU stuff going on, and it's been some 35+ years since I last did any BBC coding.

I did snoop what CCl4 is doing and it makes sense so I'll probably just go with that.

Since there's so few Vidextex systems, it shouldn't be hard to get my system running on the emulators that support them.

Thanks,
Nigel
RichardRussell

Re: telstar cursor positioning

Post by RichardRussell »

nelgin wrote: Sun 19 Jul 2020, 13:39 Urgh, I've been up all night trying to get this work!
I am sorry. I am not at all sure that direct cursor addressing was supported in the original Prestel specification, I suspect it is something that was added later (that is suggested by the fact that two different codes are used, APS and APA, depending on the Data Syntax). As has been noted elsewhere (for example here) there doesn't seem to be a copy of the official Prestel Terminal Specification anywhere online, so there is no easy way to find out.

I can relatively easily add support for the APS and APA commands to telstar.bbc, although there's nothing in the Wikipedia article to say explicitly whether the row and column numbers are zero-based (as they are in BBC BASIC) or one-based (as they are in most other terminal protocols). One might guess that they are zero-based given that the range of characters is stated as being from 0x40 to 0x7F (rather than 0x41 to 0x7F) but that is not definite.

You could try asking the authors of other Videotex terminal emulators whether they support those commands and if so what base they assume. For example Soruk has written his own Telstar client and it would be interesting to find out what that does.

But undoubtedly the safest thing to do is to position the cursor using those control codes that are universally supported (e.g. home, left, right, down, up). You can optimise the number of bytes you need to send by relying on the documented 'wrapping' behaviour (for example that an 'up' code will move from the top row to the bottom row, and 'down' will move from the bottom row to the top row).
Soruk
Posts: 23
Joined: Mon 30 Jul 2018, 20:24

Re: telstar cursor positioning

Post by Soruk »

RichardRussell wrote: Sun 19 Jul 2020, 14:56 You could try asking the authors of other Videotex terminal emulators whether they support those commands and if so what base they assume. For example Soruk has written his own Telstar client and it would be interesting to find out what that does.
The Matrix Brandy telstar client (Windows binary linked above, BASIC source in the Matrix Brandy release) does not support APS or similar, however that does not appear to have any detrimental effect on either Telstar or CCl4. As I understand it, the server is supposed to keep track of the cursor, but if it's ever unsure you can always send HOME (&1E) followed by enough LF (&0A) and TAB (&09) to get the cursor where you want it.
RichardRussell

Re: telstar cursor positioning

Post by RichardRussell »

RichardRussell wrote: Sun 19 Jul 2020, 14:56One might guess that they are zero-based given that the range of characters is stated as being from 0x40 to 0x7F
There's confirmation here that the row and column numbers are zero-based.
nelgin
Posts: 4
Joined: Sun 19 Jul 2020, 11:11

Re: telstar cursor positioning

Post by nelgin »

When I wrote my text/videotext BBS back in the 80's, I do remember it was 0 based. I've got a routine to set the cursor so it's no big deal. I've got it integrated with my current BBS so a user can login, but I don't have any content yet. I will eventually get around to a built in editor but for now the online teletext editors seem to be doing the trick. No need to change telstar.bbc just for me, especially if it's likely only for something that may not be a standard.

Thanks,
Nigel
RichardRussell

Re: telstar cursor positioning

Post by RichardRussell »

nelgin wrote: Mon 20 Jul 2020, 07:47No need to change telstar.bbc just for me, especially if it's likely only for something that may not be a standard.
No, but I'll add it anyway since it's simple enough to do. I ought really to look at the source code of my ancient MS-DOS Videotex terminal (if I can find it) because that was written when the specification was probably more readily available than it is now, and it would be interesting to see whether I implemented that command or not.

Later: I've found it (source code dated 5th August 1999, but I think I started it in 1991), I've checked, and no I didn't. Which makes me even more confident that it wasn't in the original Prestel Terminal Specification.