VDA Driver for EF9345, help needed

462 views
Skip to first unread message

Laszlo Szolnoki

unread,
Dec 30, 2023, 12:49:51 PM12/30/23
to RC2014-Z80
Hello!
I am trying to create a driver for an EF9345 based graphics card without a keyboard interface. I have tested the VDA calls one by one and they are fine so far. Now I encounter an infinite loop after the first initialization. After the VDAQRY the system reports a console on unit #2 and that's it. Does anyone have a tip on how I can figure out the problem? I am using the SIO2 card as a terminal adapter and thought the terminal and VDA card would work in parallel and I could test my software right away. Many thanks for any feedback!
A belated Merry Christmas and Happy New Year to all of you.  
Cheers
Laszlo
Log:
RomWBW HBIOS v3.3.0-dev.14, 2023-12-30

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

CTC: IO=0x88 TIMER MODE=TIM16
SIO0: IO=0x81 SIO MODE=115200,8,N,1
SIO1: IO=0x83 SIO MODE=115200,8,N,1
DSRTC: MODE=STD IO=0xC0 Wed 2023-12-20 18:27:29 CHARGE=OFF
MD: UNITS=2 ROMDISK=384KB RAMDISK=256KB
FD: MODE=RCWDC IO=0x50
RESET FDC
DOR --> 00
DOR --> 0C UNITS=4
RESET FDC
DOR --> 00
DOR --> 0C
FD: SENSEINT 08 --> C0 00 [DISK CHANGE]
FD: SENSEINT 08 --> C1 00 [DISK CHANGE]
FD: SENSEINT 08 --> C2 00 [DISK CHANGE]
FD: SENSEINT 08 --> C3 00 [DISK CHANGE]
FD: SENSEINT 08 --> 80 [INVALID COMMAND]
IDE: IO=0x10 MODE=RC
IDE0: ATA 8-BIT LBA BLOCKS=0x003B:6800 SIZE=1901MB
IDE1: NO MEDIA
IDE: IO=0x20 MODE=RC
IDE2: ATA 8-BIT LBA BLOCKS=0x0EE2:B000 SIZE=121942MB
IDE3: NO MEDIA
[EF_INIT]
EF9345 : IO=0x40 MODE=80X24
[EF_CRTINIT]
[EF_LOAD_INDIR]
[EF_LOAD_INDIR]
[EF_LOAD_INDIR]
[EF_LOAD_INDIR]
[EF_LOAD_INDIR]
[EF_CLEARALL]
[EF_VDASCP]: 0204 0000
[EF_VDAFIL]0204 0020:0780
[EF_VDASCP]: 0204 0000
[EF_VDARES]: 0204
[EF_CLEARALL]
[EF_VDASCP]: 0204 0000
[EF_VDAFIL]0204 0020:0780
[EF_LOAD_INDIR]
[EF_VDASCP]: 0204 0000
[EF_VDAQRY]: 4100 0000

  Console on Unit #2

RomWBW HBIOS v3.3.0-dev.14, 2023-12-30

Wayne Warthen

unread,
Dec 30, 2023, 3:00:15 PM12/30/23
to RC2014-Z80
Hi Laszlo,

First, congrats on creating a VDA driver.  The VDA drivers are... hard.  😀

It looks like your initialization code completes.  The failure seems to occur when the boot process tries to switch the console to the video display.

It is not immediately obvious to me what is happening here.  You should confirm that you are not running out of space in the 32K HBIOS.  Video drivers (along with the ANSI support code) and fonts take a lot of space.  I would check that the HBIOS has 2K of slack space.

Does your video driver set TERMENABLE to TRUE?  That is critical.

Beyond this, feel free to send me your code and config files and I will take a look when I have time.

Thanks,

Wayne

Laszlo Szolnoki

unread,
Dec 30, 2023, 3:53:41 PM12/30/23
to RC2014-Z80
Hi Wayne,
Hi Wayne, what a generous offer!
I have attached my configuration file, the driver itself and two logs. TERMENABLE is TRUE. It looks like the terminal initialization is failing. Is it possible to run the VDA and the SIO terminal in parallel? That is not clear to me. That would be helpful for troubleshooting. The file size should be fine, the compiler has not protested. I'll keep you posted!
Thanks
Laszlo
rcz80.tar.gz

Wayne Warthen

unread,
Dec 30, 2023, 4:51:36 PM12/30/23
to RC2014-Z80
Great, I will take a look, but may need a day or two.

I'm not exactly sure what you mean by run in parallel.  For testing, I suggest that you start RomWBW with SIO as the terminal (normal startup).  Then, from CP/M, use PIP to send characters to the screen.  Something like this:

PIP CRT:=CON:

Thanks,

Wayne

Laszlo Szolnoki

unread,
Dec 30, 2023, 5:47:24 PM12/30/23
to RC2014-Z80
That would require a successful boot process, which I don't have. Right?  Can the instance data play a role? What is the meaning of this instance data? The graphics card does not have a keyboard function.  I suspect the problem is in this area. I see on the screen that the graphics card is initialized and the cursor is at position 0,0. Then the keyboard is dead. No more input. That's for now. Cheers Laszlo

Wayne Warthen

unread,
Dec 30, 2023, 5:55:36 PM12/30/23
to RC2014-Z80
Change CRTACT back to FALSE.  I suspect that will allow the boot process to complete normally on the SIO console.  Then use PIP to test.

I see that you have not yet implemented the keyboard functions.  However, I don't think that is causing the current problem.  You should at least see some characters on the video display.

The instance data in a video driver is a bit of an odd thing.  It is actually used by the keyboard driver that is attached to the video driver.  In your case, there is no keyboard.  Because you have VDAEMU_SERKBD set to 0, the SIO should continue to provide keyboard input and the video keyboard routines should never be called.

Thanks,

Wayne

Alan Cox

unread,
Dec 30, 2023, 7:52:20 PM12/30/23
to rc201...@googlegroups.com
How is your logging done - is your logging recursing into itself when
you try and log a command to the video now it is console ?

Also btw if you get stuck the rc2014 emulator has ef9345 emulation so
ought to be able to give you a debug trace
> --
> You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/rc2014-z80/5017d230-6960-4bea-941b-13ec41f985d3n%40googlegroups.com.

Laszlo Szolnoki

unread,
Dec 31, 2023, 7:34:40 AM12/31/23
to RC2014-Z80
Hi Alan,
I downloaded the emulator. Using rc2014 I was able to start it with my ROM image. Is there a list of option switches? I don't now how to configure the emulator for my setup.
Thanks
Laszlo
p.s. Happy New Year to you!

Alan Cox

unread,
Dec 31, 2023, 8:16:43 AM12/31/23
to rc201...@googlegroups.com
On Sun, 31 Dec 2023 at 12:34, Laszlo Szolnoki <lgszo...@gmail.com> wrote:
>
> Hi Alan,
> I downloaded the emulator. Using rc2014 I was able to start it with my ROM image. Is there a list of option switches? I don't now how to configure the emulator for my setup.

It's not very well documented and there are too many options so the
source is usually the reference.

I would start with rc2014_sdl with the options

-r rom ; your ROM
-b ; 16K banking 512/512K card style
-E ; with EF9345
-R ; RTC
-f ; run as fast as possible
-d 16 ; instruction level trace

and redirect stderr to a log (2>log)

you'll get an enormous instruction trace file you can then load into a
decent editor and see what is going on

Alan Cox

unread,
Dec 31, 2023, 8:35:00 AM12/31/23
to rc201...@googlegroups.com
The other option if the trace gets big or you know where to guess is
that the emulator has a fake I/O device at 0xFD

so just before the area you suspect you can do

push af
ld a,16
out (0xFD),a
pop af

to turn logging on (and xor a to turn it off)


Another trick is to run instead with "-d 8". This logs any writes to
unknown I/O devices. 0xFF is an unused port so you can then see any
writes to 0xFF in the log which means you can write values to 0xFF to
get a trace (akin to using the LEDs on the SC129 for this)

Laszlo Szolnoki

unread,
Jan 1, 2024, 5:12:36 PM1/1/24
to RC2014-Z80
I have made some progress. The driver seems to work, I can use the VDA functions via the HBIOS calls from ZSID. I have no idea how to turn on the service. When I look at figure 7.1 in the system guide, CIOXXXX only has UART and ASCI hardware outputs. When I call the emulation services, I don't know how to bypass the keyboard input expected from the VDA device. The keyboard is connected to SIO, not VDA. So I look forward to your ideas.
Thanks
Laszlo

Wayne Warthen

unread,
Jan 1, 2024, 6:45:08 PM1/1/24
to rc201...@googlegroups.com
Great to hear you are making progress.

I'm afraid that the System Guide is in need of some updating.  It is on my list.  Although it only shows UART and ASCI, the SIO driver would also be included.

Anyway, I think the crux of your question is how to get the keyboard input from your VDA device instead of the serial port.  If you look at your config file, you will see that VDAEMU_SERKBD is set to 0.  That means that keyboard input will come from serial unit 0 when the VDA is active.  You can change VDAEMU_SERKBD to $FF to cause keyboard input to come from your VDA device driver.

Thanks,

Wayne

--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+...@googlegroups.com.

Laszlo Szolnoki

unread,
Jan 2, 2024, 7:49:31 AM1/2/24
to RC2014-Z80
Wayne, I apologize for my unclear wording. My VDA board does not have keyboard functionality. I have to use the SIO2 board. We have two ATTACH calls. One for VDA_ADDENT, I can see the reason since we are adding a VDA board. The second one for TERM_ATTACH. I assume this is for keyboard control. Is it not? Here I would like to have an input from the SIO keyboard and a VDA/CRT output to my VDA card. The SIO input seems to work, but the CRT output does not. I can boot with TERMENABLE=false and access the VDA card via HBIOS calls. However, the system does not use these calls on its own. Where is the place that manages the redirection/distribution?
Cheers
Laszlo

Wayne Warthen

unread,
Jan 2, 2024, 3:57:27 PM1/2/24
to rc201...@googlegroups.com
Hi Laszlo,

The TERM_ATTACH call is not purely for the keyboard.  This call attaches the VDA driver to the ANSI terminal emulation.  In order for character output to go to a VDA device, it must go through something that converts escape sequences into VDA calls.  The TERM driver does this.  When you boot your system, you should see something like this:

RomWBW HBIOS v3.4.0-rc.1, 2023-12-28

Mark IV [MK4_wbw] Z8S180-N @ 18.432MHz IO=0x40
0 MEM W/S, 1 I/O W/S, INT MODE 2, Z180 MMU
512KB ROM, 512KB RAM, RAMBANKS=0x10, RTCDEF=0x20

ROM VERIFY: 00 00 00 00 PASS

ASCI0: IO=0x40 ASCI W/BRG MODE=38400,8,N,1
ASCI1: IO=0x41 ASCI W/BRG MODE=38400,8,N,1
TMS: MODE=SCG IO=0x98
MD: FLASH=1 1=39F040 FLASH FILE SYSTEM ENABLED
MD: UNITS=2 ROMDISK=384KB RAMDISK=352KB
SD: MODE=MK4 FAST OPR=0x89 CNTR=0x4A TRDR=0x4B DEVICES=1
SD0: NO MEDIA

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      TERM0:      Terminal          Video 0,ANSI
Disk 0      MD0:        RAM Disk          352KB,LBA
Disk 1      MD1:        Flash Drive       384KB,LBA
Disk 2     SD0:        SD Card           --
Video 0     TMS0:       CRT               Text,40x24


Mark IV [MK4_wbw] Boot Loader

Boot [H=Help]:


The TMS driver is roughly equivalent to your EF9345 driver.  The line starting with "Video 0" is the VDA video driver.  Notice the line that starts with "Char 2".  If you look at the right, you will see that Char 2 is attached to Video 0.  So, Char 2 is the character interface for the VDA driver.

You should be able to use Char 2 just like any other serial device, but the output should go to your VDA driver.  For example, from the Boot prompt, you could type "I 2" and the console should switch to Char 2 and you should see a Boot prompt on your EF9345.

It is critical that you see the TERM driver listed when you boot.  If you do not, then something is wrong with the TERM_ATTACH call.

Thanks,

Wayne

Laszlo Szolnoki

unread,
Jan 2, 2024, 5:12:43 PM1/2/24
to RC2014-Z80
I got it!
Thanks! After having fixed everything, I send you the details.
Laszlo
IMG_6866.jpg
RomWBW HBIOS v3.3.0-dev.14, 2024-01-02


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

CTC: IO=0x88 TIMER MODE=TIM16
SIO0: IO=0x81 SIO MODE=115200,8,N,1
SIO1: IO=0x83 SIO MODE=115200,8,N,1
DSRTC: MODE=STD IO=0xC0 Sat 2023-12-23 23:06:32 CHARGE=OFF
MD: UNITS=2 ROMDISK=384KB RAMDISK=256KB
FD: MODE=RCWDC IO=0x50 UNITS=4

IDE: IO=0x10 MODE=RC
IDE0: ATA 8-BIT LBA BLOCKS=0x003B:6800 SIZE=1901MB
IDE1: NO MEDIA
IDE: IO=0x20 MODE=RC
IDE2: ATA 8-BIT LBA BLOCKS=0x0EE2:B000 SIZE=121942MB
IDE3: NO MEDIA
EF9345 : IO=0x40 MODE=80X24

  Console on Unit #2

Wayne Warthen

unread,
Jan 2, 2024, 5:30:24 PM1/2/24
to rc201...@googlegroups.com
Nice!

Very good text quality.  Is your module producing a VGA signal?

-Wayne

Laszlo Szolnoki

unread,
Jan 2, 2024, 5:45:59 PM1/2/24
to RC2014-Z80
Not really. Currently I have series resistors, in the final version I will have voltage divider. But basically it is a VGA compatible signal. You need a monitor, what can deal with 15kHz hsync. 
I got an older Fujitsu monitor, that can do it.
ef9345.png

Laszlo Szolnoki

unread,
Feb 5, 2024, 5:22:50 AM2/5/24
to RC2014-Z80
I would like to report on my progress with the implementation of the EF9345 device. The hardware is ready and working well. The design files are available on github, see the link.


I made a few transcripts of previous test codes to be able to test the board and to set up the RomWBW driver. The preliminary final version is also on github. The driver basically does what it is supposed to. 
However, there is still a problem when using WS or ED/ZDE. I seem to be missing something, scroll up d
oes not work properly. The test routines provide regular behavior, the applications are interfering with something. 
See attached pictures. 

IMG_6955.jpgIMG_6956.jpg

I wonder if this problem can be fixed by a patch for WS? Should anyone have any idea where the cause of the problem might lie?
 
Finally, it's up to Wayne if the driver is added to RomWBW. The EF9345 is a special  circuit with many twists and turns, but it still exists.

A side effect of using the VDA & terminal driver was that XM stopped working. I didn't expect this kind of problem and don't know how to overcome it.

By the way, many thanks to Derek for the hint to use minicom. That gave me the opportunity to upload software for the first time.
I still have some bare boards left-over. If anyone is interested, please let me know.
Thanks a lot
Laszlo

Wayne Warthen

unread,
Feb 5, 2024, 5:39:11 PM2/5/24
to RC2014-Z80
Hi Laszlo,

On Monday, February 5, 2024 at 2:22:50 AM UTC-8 Laszlo Szolnoki wrote:
I would like to report on my progress with the implementation of the EF9345 device. The hardware is ready and working well. The design files are available on github, see the link.



I made a few transcripts of previous test codes to be able to test the board and to set up the RomWBW driver. The preliminary final version is also on github. The driver basically does what it is supposed to. 
However, there is still a problem when using WS or ED/ZDE. I seem to be missing something, scroll up d
oes not work properly. The test routines provide regular behavior, the applications are interfering with something. 
I wonder if this problem can be fixed by a patch for WS? Should anyone have any idea where the cause of the problem might lie?

Excellent progress.  Not sure how this symptom could be patched in WordStar itself.  I guess you could modify the terminal definition so that it doesn't do the reverse partial screen scroll.  It seems like the issue is with the VDACPY code somewhere.

Finally, it's up to Wayne if the driver is added to RomWBW. The EF9345 is a special  circuit with many twists and turns, but it still exists.

I definitely want to include this in RomWBW.  Would you like me to integrate the existing source from your GitHub repository?  The current port numbers being used conflict with the default FDC ports, so this would need to be enabled via a custom build as desired.

A side effect of using the VDA & terminal driver was that XM stopped working. I didn't expect this kind of problem and don't know how to overcome it.

If you are running XM while the VDA device is the active console, then yes, XM will not work because it has nothing to talk to.  The XM application supports the specification of alternate serial ports.  You just add the port number to the command.  For example, the following command will force XM to use serial port #2:

XM R2 TEST.DAT

Does this help?

Thanks,

Wayne

Alan Cox

unread,
Feb 6, 2024, 3:02:35 AM2/6/24
to rc201...@googlegroups.com
Looks like the direction of copy was wrong so that the display section copied the line over itself repeatedly. If you are also using the hardware scrolling feature the combination of that and software copies also complicated it a lot.

Alan

Laszlo Szolnoki

unread,
Feb 6, 2024, 3:57:39 AM2/6/24
to RC2014-Z80
Hi Wayne,
Please take the source code from Github and make the necessary changes for adaptation. The base address can be changed by modifying RCZ80_std.asm anyway.

I tried XM with the R2 option. It didn't work on the first run. I assume I need to connect the 2nd SIO port as well.

I'll take a look at the copy function and hope to fix the problem. 
Cheers
Laszlo

Wayne Warthen

unread,
Feb 6, 2024, 4:55:02 PM2/6/24
to rc201...@googlegroups.com
Hi Laszlo,

On Tue, Feb 6, 2024 at 12:57 AM Laszlo Szolnoki <lgszo...@gmail.com> wrote:
Please take the source code from Github and make the necessary changes for adaptation. The base address can be changed by modifying RCZ80_std.asm anyway.

I will integrate your code in the next couple of days.  Thank you for the contribution.

I tried XM with the R2 option. It didn't work on the first run. I assume I need to connect the 2nd SIO port as well.

Yes, the number specifies the specific RomWBW character unit port that you want to use for the transfer.  It must specify an existing character unit.

Thanks,

Wayne

Wayne Warthen

unread,
Feb 7, 2024, 10:51:51 PM2/7/24
to RC2014-Z80
Hi Laszlo,

I have completed the integration of your EF9345 driver into RomWBW.  I have produced RomWBW Development Snapshot v3.5.0-dev.9 which includes the driver.  Just a few notes:
  • The driver needs to be enabled using the "EFENABLE" config setting.
  • I modified the driver code to ensure that all labels are prefixed by "EF_".  This is mandatory to avoid namespace collisions in RomWBW.
  • I did some reformatting for consistency.
  • I am not able to test the code at this point.  Would you let me know if you are able to?
  • The hardware "PROBE" routine needs some work.  It relies on the "WAITRDY" routine which may loop forever if there is no EF9345 hardware present.
Thank you for contributing this work!

-Wayne

Laszlo Szolnoki

unread,
Feb 8, 2024, 3:31:07 AM2/8/24
to rc201...@googlegroups.com
Thanks Wayne!
I am going to test the code within the next few days and come back with the results. I also take a look at the PROBE routine.
Cheers Laszlo 

--
You received this message because you are subscribed to a topic in the Google Groups "RC2014-Z80" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rc2014-z80/Ulx_IfZkAbA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rc2014-z80+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rc2014-z80/6cc18ef5-9bda-4866-81c9-1020cd5ba4ean%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages