Teletext AND ANSI?!

Electron Software Menu

Now that there is an easy way to access BeeBS in a Mode 7 supported web client, I felt I should really make the most of the opportunity and add the ability for OBBS to send full Mode 7 menus. I was initially using BGET to read each byte of the menu frame, however this resulted in a single frame taking 5 seconds to load. After asking for a little help over at the Stardot forums I was presented with two main options to speed things up.

Main Menu Mode 7

The fastest option was to use DIM to reserve a block of memory (...say the size of a teletext frame) and then LOAD the teletext frame (or in this case menu file to that location), using VDU to display each byte. This resulted in a frame being sent in less than 2 seconds at 9600 baud. Unfortunately OBBS is still setup to use Mode 7 on a BBC Micro (Model B) and so doesn't have the head room to reserve 1kb.

The second option was to use a buffer (which can be as low as 10 bytes) for speed improvements. I experimented with various buffer sizes and found that 256bytes to 512bytes was almost as fast as using *LOAD. This is the choice I opted for.

I realized that it would be a good time whilst I'm making these changed to add ANSI support to OBBS. Adding ANSI support was relatively simple...getting OBBS to save the users preference for ANSI in-between sessions however, was not! Data within the user file is accessed via BGET and PTR so the settings need to be saved within the current data structure. Luckily OBBS stores some user preferences in a user flag which is 8 bits long (1 byte) of which only the 3 bits are used.

 0000 0001 - Supports Lower Case
 0000 0010 - Requires Linefeeds
 0000 0100 - Supports Colour (Mode 7)

All I needed to do was to store the ANSI support in bit 4:

 0000 1000 - Supports ANSI

This byte is stored in the variable ff%, from the value of ff% BeeBS can set the menu folder to the appropriate location (Mode 7 menus are stored in the V directory and ANSI in 8).

ANSI Support

As it stands selecting ANSI overrides all other options (colour, linefeeds and uppercase only) however this shouldn't be a problem as I'm not aware of any ANSI terminals that don't support lowercase! The last bit of magic was to use the value of ff% to determine if control codes need to be filtered, and hey presto...

Ansi Menu

Loading an ANSI page takes around 4 seconds so I have opted for 60 column pages instead of 80.

A rather inelegant solution but is a working fix for now. BBS of the time would ask the user at the outset what type of terminal they are using (or ask for a key press, from which the host could deduce the terminal type).