ROMWBW - TMS9918 operation on RC2014 - question about the keyboard

543 views
Skip to first unread message

Rodney Knaap

unread,
Oct 24, 2021, 8:13:24 AM10/24/21
to RC2014-Z80
Hello everyone,

I just finished building my TMS9918 board for my test RC2014 setup which I am using to get familiar with different parts that I want to integrate into a single mainboard.

I manually wired the TMS Board according to the design of J.B. Langston.
I can now get the console switched over to the TMS9918, either by activating it on boot through the build settings, or by manually switching using the boot command: I 1

What I am seeing looks like a good display of the console on the TMS9918, however I am losing the connection with my terminal keyboard as soon as the TMS is activated.
With automatic activation on boot, I can see the console information scrolling on the TMS output, so it seems to work fine and doesn't look like any freezing or instability. I just can't control the computer anymore after the TMS becomes active.

Does anyone know why this is happening?

I am using INT on the ACIA for my serial terminal, and I tested with the INT jumper enabled and disabled on the TMS board, and also I have tested with the TMSTIMENABLE build option set to TRUE and FALSE. I tried to use NMI on the TMS.

I am only using a CPU with ACIA, ROMWBW and the TMS board for testing right now.

When the TMS is active as the console, I can see pulses on INT when I type in my serial terminal, however it doesn't register on the TMS screen anymore.

Is this by design? Does it mean that I need to use a different keyboard interface with the TMS when it is active? I had hoped to keep the serial console for at least my PC keyboard. It doesn't need to echo back to serial when I type in TMS mode, but it would be nice to keep the serial keyboard function and combine it with the TMS CRT display.

My end goal is to create an expanded ROMWBW RC2014 system which combines as many interfaces as possible, which would make up a versatile computer similar to a PC, but then based on Z80, which requires a minimum of alteration while keeping the use of all the included RC2014 parts.

In order to achieve this, I am keeping as close to every standard I can find in the hope that my computer can function on the standard ROMWBW software, with the correct build settings and everything connected finally.

I could look into building the keyboard interface of an MSX, however that would mean a system with two keyboard options. It would be great to keep that serial keyboard!

So far my RC2014 has:
CPU/ACIA
ROMWBW
RCWDC
PPIDE
TMS9918 (working on it)

If anyone could shed some light on this matter, or give me some info about how the TMS mode works in ROMWBW regarding the keyboard, I would appreciate it!

Img_8060s.jpg
I was using double IC sockets during my hardware debugging because those sockets underneath felt a little loose! I still had some old ones of better quality!
Img_8061s.jpg

Alan Cox

unread,
Oct 24, 2021, 8:19:14 AM10/24/21
to rc201...@googlegroups.com
What I am seeing looks like a good display of the console on the TMS9918, however I am losing the connection with my terminal keyboard as soon as the TMS is activated.
With automatic activation on boot, I can see the console information scrolling on the TMS output, so it seems to work fine and doesn't look like any freezing or instability. I just can't control the computer anymore after the TMS becomes active.

If you are using the old ACIA card design it decodes to a very wide range of addresses and will clash with the TMS9918A at the MSX addresses. If so you should be able to add some tighter address decoding akin to the various third party ACIA designs.

Alan

Rodney Knaap

unread,
Oct 24, 2021, 8:42:30 AM10/24/21
to RC2014-Z80
Hi Alan,

Thanks for your reply!

Regarding the ACIA design, I used the standard port range setting of A0-A7.

It's a good point you are making though about the I/O ports!
I will look into a full decoder which also includes the A1 and A2 line of the Z80 on my next design.

Thanks again,

Kind regards,

Rodney

Op zondag 24 oktober 2021 om 14:19:14 UTC+2 schreef etched...@gmail.com:

Rodney Knaap

unread,
Oct 24, 2021, 8:46:05 AM10/24/21
to RC2014-Z80
I just found some posts which refer to the keyboard function also being changed while switching to the TMS output for the console in ROMWBW.
That would explain what I am seeing.

I hope that there may still be some other solution than a matrix keyboard which could be combined with the TMS video as a system console.

If anyone has some ideas or advice, I would appreciate it!

Op zondag 24 oktober 2021 om 14:42:30 UTC+2 schreef Rodney Knaap:

Wayne Warthen

unread,
Oct 24, 2021, 9:58:46 AM10/24/21
to RC2014-Z80
On Sunday, October 24, 2021 at 5:46:05 AM UTC-7 rodne...@gmail.com wrote:
I just found some posts which refer to the keyboard function also being changed while switching to the TMS output for the console in ROMWBW.
That would explain what I am seeing.

Hi Rodney,

Just confirming that this is the correct answer.  In RomWBW, the Video drivers are expected to be CRT + Keyboard devices.  When you switch the console to one, the keyboard moves with it.  Prior to RC2014, all of the video boards had both a video interface and a keyboard interface.  Since there is no hardware keyboard for the TMS9918 on RC2014, there is no keyboard input.  It becomes a write only device in this case.

Dean Netherton has created a very nice hardware keyboard option for RC2014 (https://github.com/vipoo/yellow-msx-series-for-rc2014).  This keyboard option works nicely with the TMS9918 and will turn it into a complete terminal device under RomWBW.

I consider it a deficiency of RomWBW that you must have a dedicated keyboard with a video device in order to use it as a terminal.  Improving this is on a long list of things I need to work on.

Thanks,

Wayne

Rodney Knaap

unread,
Oct 24, 2021, 5:13:47 PM10/24/21
to RC2014-Z80
Hi Wayne,

Thanks for your clear explanation!

It is what it is right now, I see about the background of this principle to drive a whole console solution rather than separate video and keyboard devices.

To combine with a matrix keyboard is not really what I had in mind.
Of course, to be able to run MSX software is a concept which provides some nice functionality which is definately fun! But that is not my primary objective.
At best it's a nice "side feature" to me. I may design it on a separate plug-in board to play with, just because that's technically possible.

Rather, I would like to build a computer which has more PC-like qualities, but instead using the Z80.
I am really charmed by ROMWBW because of the advantages of having some form of standard and source code structure.
It's great to see the build process in action, very impressive!
This method is definately very suitable to try to expand upon, and it looks to be rather flexible in nature, which I am sure it is!

I am going to read more about what's available and supported with traditional PC keyboards such as PS/2 or USB, etc.
I just read in this thread:
that you mentioned that other types of keyboard interfaces could possibly be associated with the TMS9918.
Would that be an option for me, if I could find a candidate USB or PS/2 type keyboard interface for this purpose?
I would not mind to build a USB or PS/2 keyboard interface to be able to pair with the TMS9918, and/or other graphics display solutions in the future.

I also saw the RBC ECB cards which have very nice solutions to connect a PS/2 keyboard.
PS/2 is also not very new technology, but still feels like an improvement on matrix keyboards to me.
Also it is more in line with the idea of a Z80 PC.

At some point I want to start developing new technology to experiment and interface with my Z80 PC, but I don't want to unnecessarily invent things which are already made by others, or would be readily available to combine in new ways using ROMWBW.

I hope I can find some way to put together a Z80 mainboard design, which I can then use as a stepping stone for further development of code and new interfaces.
I am not very experienced in Z80 coding yet, but I am trying to read some of the source code to try to get a deeper understanding of the whole concept of ROMWBW.

Also, I am very much interested in learning to port code from other platforms to the Z80. The concept of moving from one platform to another by recoding software is an attractive idea to me, which also provides many learning experiences which could prove very useful in the future for new projects and ideas.

Long ago I obtained an obsolete DECpc AXP/150 system with a DEC Alpha processor. At one time, Microsoft developed Windows NT to run on an Alpha PC, and there was an FX!32 application which could run Intel software developed for Windows NT, and in an intelligent way this software could analyse and rewrite the original code or intepretation of it to further optimise those Intel programs on the powerful 64 bit Alpha processor, making them run faster finally! That felt really unique and inspiring to me at the time! It's a pity that DEC/Compaq decided to drop the unique cooperation with Microsoft so early, after the difficult process of obtaining their collaboration! There can be many overlapping development found and "borrowing" of ideas by different software developers in computer history! Just like before with CP/M and MS-DOS.

Anyway, just some ideas that I am thinking about. To be platform independant in some way sounds like a way into the future! Definately I want to get a Z80 PC mainboard done first. After that I will see where it will lead.

I do see what you mean about having many things to do, as I can appreciate how big the ROMWBW project is!

Kind regards,

Rodney
Op zondag 24 oktober 2021 om 15:58:46 UTC+2 schreef wwar...@gmail.com:

Wayne Warthen

unread,
Oct 24, 2021, 6:30:13 PM10/24/21
to RC2014-Z80
On Sunday, October 24, 2021 at 2:13:47 PM UTC-7 rodne...@gmail.com wrote:
Rather, I would like to build a computer which has more PC-like qualities, but instead using the Z80.
I am really charmed by ROMWBW because of the advantages of having some form of standard and source code structure.
It's great to see the build process in action, very impressive!
This method is definately very suitable to try to expand upon, and it looks to be rather flexible in nature, which I am sure it is!

Glad you like it.  Expandability is part of the concept.
 
I am going to read more about what's available and supported with traditional PC keyboards such as PS/2 or USB, etc.
I just read in this thread:
that you mentioned that other types of keyboard interfaces could possibly be associated with the TMS9918.
Would that be an option for me, if I could find a candidate USB or PS/2 type keyboard interface for this purpose?
I would not mind to build a USB or PS/2 keyboard interface to be able to pair with the TMS9918, and/or other graphics display solutions in the future.

Yes.  RomWBW has keyboard support for a PS/2 keyboard via an 8255 PPI or an 8242.  The 8242 is highly preferred over the PPI interface.
 
I also saw the RBC ECB cards which have very nice solutions to connect a PS/2 keyboard.
PS/2 is also not very new technology, but still feels like an improvement on matrix keyboards to me.
Also it is more in line with the idea of a Z80 PC.

Yes, the keyboard circuit of this board would work nicely for the RC2014 and could be easily integrated with the TMS9918 with just a few lines of code.
 
At some point I want to start developing new technology to experiment and interface with my Z80 PC, but I don't want to unnecessarily invent things which are already made by others, or would be readily available to combine in new ways using ROMWBW.

I hope I can find some way to put together a Z80 mainboard design, which I can then use as a stepping stone for further development of code and new interfaces.
I am not very experienced in Z80 coding yet, but I am trying to read some of the source code to try to get a deeper understanding of the whole concept of ROMWBW.

Sounds good.  🙂
 
Also, I am very much interested in learning to port code from other platforms to the Z80. The concept of moving from one platform to another by recoding software is an attractive idea to me, which also provides many learning experiences which could prove very useful in the future for new projects and ideas.

Long ago I obtained an obsolete DECpc AXP/150 system with a DEC Alpha processor. At one time, Microsoft developed Windows NT to run on an Alpha PC, and there was an FX!32 application which could run Intel software developed for Windows NT, and in an intelligent way this software could analyse and rewrite the original code or intepretation of it to further optimise those Intel programs on the powerful 64 bit Alpha processor, making them run faster finally! That felt really unique and inspiring to me at the time! It's a pity that DEC/Compaq decided to drop the unique cooperation with Microsoft so early, after the difficult process of obtaining their collaboration! There can be many overlapping development found and "borrowing" of ideas by different software developers in computer history! Just like before with CP/M and MS-DOS.

Anyway, just some ideas that I am thinking about. To be platform independant in some way sounds like a way into the future! Definately I want to get a Z80 PC mainboard done first. After that I will see where it will lead.

I think you will be busy!

-Wayne 

Rodney Knaap

unread,
Oct 25, 2021, 6:56:47 AM10/25/21
to RC2014-Z80
Thank you Wayne!

Actually with this simple solution to add a 8242 keyboard, to me that's an easy and elegant fix!

Such a keyboard is a good part to include on my mainboard!

I will build it and see if I can include it in the ROM.
If I run into some trouble, I will post it here.
Of course, I plan to share all my work with anyone who may be interested!

Kind regards,

Rodney


Op maandag 25 oktober 2021 om 00:30:13 UTC+2 schreef wwar...@gmail.com:

Rodney Knaap

unread,
Oct 29, 2021, 12:20:41 AM10/29/21
to RC2014-Z80
Hi Wayne,

I have built a 8242 PS/2 keyboard interface from the manufacturer's datasheet.
I have wired the I/O decoder for the interface to use data port E0 and command port E1 which are the ports of the 8242 keyboard which are used in vga.asm.

I made a backup of my source files and tried to modify my custom config and the tms.asm files in order to init kbd.asm, but with the compiled ROM I still cannot get any response from the keyboard on the tms display.

I am not sure if I am modifying the source files correctly, because I am not familiar with the structure of ROMWBW regarding to add an extra mode of the driver correctly.
Also, I don't have any experience with Z80 assembly programming to begin with.
So I was just trying to find my way.
I did get the ROM to compile without errors, but I believe I must have made a mistake somewhere!

If possible, could you advise me what the recommended way to handle this is?
I believe I must be missing something.

I would prefer to modify the ROMWBW sources in the right way according to how you see it.
Now I am not sure if I should be looking at the interface, or at the way I modified the sources!

Kind regards,

Rodney
Img_8103s.jpg




Op maandag 25 oktober 2021 om 12:56:47 UTC+2 schreef Rodney Knaap:

Wayne Warthen

unread,
Oct 29, 2021, 12:36:07 PM10/29/21
to RC2014-Z80
On Thursday, October 28, 2021 at 9:20:41 PM UTC-7 rodne...@gmail.com wrote:
I have built a 8242 PS/2 keyboard interface from the manufacturer's datasheet.
I have wired the I/O decoder for the interface to use data port E0 and command port E1 which are the ports of the 8242 keyboard which are used in vga.asm.

That was fast!

I made a backup of my source files and tried to modify my custom config and the tms.asm files in order to init kbd.asm, but with the compiled ROM I still cannot get any response from the keyboard on the tms display.

I am not sure if I am modifying the source files correctly, because I am not familiar with the structure of ROMWBW regarding to add an extra mode of the driver correctly.
Also, I don't have any experience with Z80 assembly programming to begin with.
So I was just trying to find my way.
I did get the ROM to compile without errors, but I believe I must have made a mistake somewhere!

If possible, could you advise me what the recommended way to handle this is?
I believe I must be missing something.

I would prefer to modify the ROMWBW sources in the right way according to how you see it.
Now I am not sure if I should be looking at the interface, or at the way I modified the sources!

The changes are not hard, but they are a little tricky because of the way that RomWBW integrates the keyboard drivers with the display drivers.  It is probably easiest if I just make the changes and you will be able to see what I did on GitHub check-in.  I won't be able to test the changes, but it should give you a very good place to start testing.  I will post here again when they changes are checked in.  Should be sometime today.

Thanks,

Wayne 

Rodney Knaap

unread,
Oct 29, 2021, 1:14:50 PM10/29/21
to RC2014-Z80
Hi Wayne,

Thank you for your help, that's a big support for my project!

I worked hard on the keyboard controller to get it finished. I was lucky to find an old VT82C42 which I removed from a mainboard long ago!

I am sure I can learn a lot from your changes to the code, thanks!

I tested the 8242 controller, it is clocking and has switched to PS/2 mode after power up, as I am seeing the output values low and high as described in the manual.
I used a crystal on the controller, I will switch to an external clock instead, that is probably more stable.

Right now, I am seeing all LEDs on the PS/2 keyboard turn on and staying on after power op of the RC2014.
I will continue checking everything to make sure.

Thanks a lot, Wayne!

Kind regards,

Rodney



Op vrijdag 29 oktober 2021 om 18:36:07 UTC+2 schreef wwar...@gmail.com:

Wayne Warthen

unread,
Oct 29, 2021, 2:20:09 PM10/29/21
to RC2014-Z80
Hi Rodney,

Happy to help.

I have checked in the changes.  As I said before, I am unable to test them without the required hardware, but this should be a good starting point for you.  Make sure to pick up the source code from the dev branch of the RomWBW GitHub repository.

You will need to make the following changes to the standard RCZ80 config file (RCZ80_std.asm):

TMSENABLE .SET TRUE ; TMS: ENABLE TMS9918 VIDEO/KBD DRIVER (TMS.ASM)
TMSMODE .SET TMSMODE_RCKBD ; TMS: DRIVER MODE: TMSMODE_[SCG|N8|RC|RCV9958|RCKBD]

Then build your ROM and test.  Let me know how it goes.

Thanks,

Wayne

Rodney Knaap

unread,
Oct 29, 2021, 6:04:32 PM10/29/21
to RC2014-Z80
Hi Wayne,

Thank you for your help!

I have changed the clock pulse for a proper clock generator, and replaced the 74LS05 by a 7406 which I found.

I have downloaded your new source code from the dev branch and followed your instructions.
I have built my custom config to include all my other hardware, and built the ROM.

After power up, I found that the hardware check stopped at the kbd interface.
I removed my INT jumper from the 8242 PCB, and the boot immediately continued!

I switched the console to the TMS, and it worked right away!
I tested a small basic program!

I am so pleased with this result, that is really great!!

Below you can find my new boot messages.

And a few photos of my setup!

I am going to enjoy playing around with the TMS!

I will continue my work on further additions quickly so I can get everything complete soon!

Thanks again Wayne, have a nice weekend!

Kind regards,

Rodney



-------------------------------------------------------------------------------------------
RomWBW HBIOS v3.1.1-pre.133, 2021-10-29

RC2014 Z80 @ 7.372MHz
0 MEM W/S, 1 I/O W/S, INT MODE 1, Z2 MMU
512KB ROM, 512KB RAM
ROM VERIFY: 00 00 00 00 PASS

ACIA0: IO=0xA0 ACIA MODE=115200,8,N,1
DSRTC: MODE=STD IO=0xC0 NOT PRESENT
TMS: MODE=RCKBD IO=0x98
KBD: IO=0xE0
MD: UNITS=2 ROMDISK=384KB RAMDISK=256KB
FD: MODE=RCWDC IO=0x50 UNITS=2
IDE: IO=0x10 MODE=RC
IDE0: NO MEDIA
IDE1: NO MEDIA
PPIDE: IO=0x20
PPIDE0: LBA BLOCKS=0x02542980 SIZE=19077MB
PPIDE1: NO MEDIA

Unit        Device      Type              Capacity/Mode
----------  ----------  ----------------  --------------------
Char 0      ACIA0:      RS-232            115200,8,N,1
Char 1      TERM0:      Terminal          Video 0,ANSI
Disk 0      MD0:        RAM Disk          256KB,LBA
Disk 1      MD1:        ROM Disk          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:       Hard Disk         --
Disk 5      IDE1:       Hard Disk         --
Disk 6      PPIDE0:     Hard Disk         19077MB,LBA
Disk 7      PPIDE1:     Hard Disk         --
Video 0     TMS0:       CRT               Text,40x24


RC2014 Boot Loader

Boot [H=Help]:
-------------------------------------------------------------------------------------------
Img_8104s.jpgImg_8105s.jpg


Op vrijdag 29 oktober 2021 om 20:20:09 UTC+2 schreef wwar...@gmail.com:

Wayne Warthen

unread,
Oct 29, 2021, 6:13:18 PM10/29/21
to RC2014-Z80
Excellent.  I love it when things just work they way they are supposed to!

The current RomWBW 8242 keyboard driver is not "interrupt aware", so removing your interrupt jumper makes sense.

Thanks,

Wayne

Martin Giese

unread,
Jul 4, 2025, 11:11:27 AMJul 4
to RC2014-Z80
Hi all,

just found this old thread.  I have a TMS9918 that I’d like to put to work.  

I wonder if it is still the case that keyboard input from a serial port can’t be combined with output to the VDP?

Martin

Wayne Warthen

unread,
Jul 4, 2025, 11:30:19 AMJul 4
to RC2014-Z80
Hi Martin,

Glad you asked...

RomWBW v3.4 (and above) fully supports keyboard input from a serial port combined with output to a VDP (such as TMS9918).  The only constraint is that it cannot be combined with automatic console detection (AUTOCON).

To utilize serial keyboard input with your VDP, assign the desired character unit (typically 0) using VDAEMU_SERKBD and set AUTOCON to FALSE.  Here is a typical example:

AUTOCON .SET FALSE ; ENABLE CONSOLE TAKEOVER AT LOADER PROMPT
VDAEMU_SERKBD .SET $00 ; VDA EMULATION: SERIAL KBD UNIT #, OR $FF FOR HW KBD

Thanks, Wayne

Martin Giese

unread,
Jul 4, 2025, 11:37:54 AMJul 4
to RC2014-Z80
Nice, that’s one less thing to worry about then!

Martin

Reply all
Reply to author
Forward
0 new messages