Using the TMS9918A Video Driver in ROMWBW

252 views
Skip to first unread message

positron (Jose L. Collado)

unread,
Jun 21, 2023, 8:03:51 PM6/21/23
to RC2014-Z80
I can successfuly boot CPM & ZPM3 to the Video console (using the TMS9918A card) by selecting the appropriate front panel CRT switch position. I get the 40 column output in the composite secondary monitor.

I can also boot into a Serial console and execute Marco Maccaferri's TMS Demo programs and the graphics are showing wonderfully.

So here comes my question: Is there a way to do this dynamically from within CPM or ZPM3 when already booted into a Serial console ? It seems like the DEVICE utility is not capable of handling this (doesn't recognize TMS0: or TERM0: physical device names) when trying to reassign the CON: device.

I want to use a serial console for normal "work" and display some status info in the secondary monitor without having to program this in Assembler. Maybe by messing arround with the IOBYTE ? Any help or clue appreciated.

Regards, JL.


Wayne Warthen

unread,
Jun 22, 2023, 11:58:37 AM6/22/23
to RC2014-Z80
On Wednesday, June 21, 2023 at 5:03:51 PM UTC-7 positron (Jose L. Collado) wrote:
So here comes my question: Is there a way to do this dynamically from within CPM or ZPM3 when already booted into a Serial console ? It seems like the DEVICE utility is not capable of handling this (doesn't recognize TMS0: or TERM0: physical device names) when trying to reassign the CON: device.

Assuming you are referring to CP/M 3 and/or ZPM3, then it is very easy.  When you boot up, you will see that TMS0: is assigned as a video unit.  Also notice that the Video Unit # is referred to in one of the Char Unit entries.  Under CP/M 3 or ZPM3, all of the Char Units map directly to COMn: devices.  So, you can refer to your TMS video by using the corresponding COMn: device.  Below is an example boot from one of my machines:

Unit        Device      Type              Capacity/Mode
----------  ----------  ----------------  --------------------
Char 0      ASCI0:      RS-232            38400,8,N,1
Char 1      ASCI1:      RS-232            38400,8,N,1
Char 2      UART0:      RS-232            38400,8,N,1
Char 3      UART1:      RS-232            38400,8,N,1
Char 4      UART2:      RS-232            38400,8,N,1
Char 5      UART3:      RS-232            38400,8,N,1
Char 6      TERM0:      Terminal          Video 0,ANSI
Char 7      PRPCON0:    Terminal          PropTerm,ANSI
Disk 0      MD0:        RAM Disk          256KB,LBA
Disk 1      MD1:        Flash Drive       384KB,LBA
Disk 2      FD0:        Floppy Disk       3.5",DS/HD,CHS
Disk 3      FD1:        Floppy Disk       3.5",DS/HD,CHS
Disk 4      IDE0:       CompactFlash      3815MB,LBA
Disk 5      IDE1:       Hard Disk         --
Disk 6      IDE2:       CompactFlash      3823MB,LBA
Disk 7      IDE3:       Hard Disk         --
Disk 8      IDE4:       Hard Disk         --
Disk 9      IDE5:       Hard Disk         --
Disk 10     SD0:        SD Card           1886MB,LBA
Disk 11     PRPSD0:     SD Card           15193MB,LBA
Video 0     TMS0:       CRT               Text,40x24
Sound 0     SND0:       AY-3-8910         3+1 CHANNELS


In this case, TMS0: is assigned as Video 0.  Video 0 is mapped to Char 5.  You can then refer to Char 5 as COM5: in CP/M 3 or ZPM3.

So, if you wanted to make the TMS video be your console device, you would use:

DEVICE CON=COM5

Thanks,

Wayne

positron (Jose L. Collado)

unread,
Jun 23, 2023, 3:05:05 PM6/23/23
to RC2014-Z80
Brilliant ! working great,  from serial to video and back. It always amazes me how flexible and capable ROMWBW is.
Thanks Wayne for this magnificent piece of software !

One additional question, does the TMS9918A driver handle ANSI colors at console level ? I checked with a Basic test program that I had (working when not in the video console) and it didn't seem to recognize the escape sequences.

Here are the sequences I've used, maybe I'm using the wrong ones...
  • \ESC[{NUM1};...;{NUMn}m
    Sets multiple display attribute settings. The following lists supported attributes:
    0 - Reset all attributes
    1 - Bright
    2 - Dim
    5 - Blink
    7 - Reverse
    25 - Blink off
    30..37 - Foreground color (black, red, green, yellow, blue, magenta, cyan, white)
    38;5;{NUM} - Foreground color to {NUM} (0-15)
    39;{NUM} - Default foreground color
    40..47 - Background color (black, red, green, yellow, blue, magenta, cyan, white)
    48;5;{NUM} - Background color to {NUM} (0-7)
    49;{NUM} - Default background color

Regards, JL.

Wayne Warthen

unread,
Jun 23, 2023, 6:42:40 PM6/23/23
to RC2014-Z80
On Friday, June 23, 2023 at 12:05:05 PM UTC-7 positron (Jose L. Collado) wrote:
One additional question, does the TMS9918A driver handle ANSI colors at console level ? I checked with a Basic test program that I had (working when not in the video console) and it didn't seem to recognize the escape sequences.

Well, no.  But that is because the TMS9918 chip does not do color or attributes when in character mode.  Well, actually, it is capable of changing the foreground and background colors of the entire screen, but it is not capable of per-character colors or attributes.

Sorry,

Wayne 
Reply all
Reply to author
Forward
0 new messages