Cc65: Does ser driver for plus4 actually work?

Created on 18 Oct 2018  路  5Comments  路  Source: cc65/cc65

Not sure whether it's VICE or the underlying emulator, but given this little program:

#include <stdlib.h>
#include <serial.h>
#include <plus4.h>
#include <stdio.h>
#include <conio.h>

  struct ser_params params = {
    SER_BAUD_1200,
    SER_BITS_8,
    SER_STOP_1,
    SER_PAR_NONE,
    SER_HS_HW
  };

void main(void)
{
  unsigned char res,ch;
  res=ser_install(plus4_stdser_ser);
  if (res!=SER_ERR_OK)
    {
      printf("ser_install(0x%02x)\n",res);
      exit(1);
    }

  res=ser_open(&params);
  if (res!=SER_ERR_OK)
    {
      printf("ser_open(0x%02x)\n",res);
      exit(1);
    }
  printf("tedterm 0.1\n\n");

    for (;;)
    {
      if (ser_get(&ch)!=SER_ERR_NO_DATA)
        putchar(ch);
      if (kbhit())
        {
          ch=cgetc();
          ser_put(ch);
        }
    }
}

and hooking up to tcpser in exactly the same way as the x64 and x128 versions of VICE, nothing comes across.

-Thom

bug

Most helpful comment

An ACIA chip is built into the CBM510, the CBM610/710, and the Plus4.

$DE00 is a C64 address for an ACIA. $FD00 is the Plus4 address. I fixed that bug; update your cc65 code base, and try again.

All 5 comments

xplus4's serial is verified to work with this terminal program:
term-80.zip so the ser driver is broken somehow...

Was there a Swiftlink compatible interface for the Plus/4? Apparently...

From what I can infer looking at the other code in the plus4 lib, the driver seems to miss the "sta ENABLE_RAM" and "sta ENABLE_ROM" parts. So it thinks it accesses a ACIA at $DE00, while in reality it accesses the RAM.
I don't know if ENABLE_ROM would also bank in the I/O ports, but I guess so.

Just adding these parts might not work, since it also must be made sure that the driver code and data resides in low memory and won't disappear if the ROM is enabled.

An ACIA chip is built into the CBM510, the CBM610/710, and the Plus4.

$DE00 is a C64 address for an ACIA. $FD00 is the Plus4 address. I fixed that bug; update your cc65 code base, and try again.

Yup, that seems to work. now I just need to do a TED version of TGI, and we'll have PLATOTerm for the PLUS4. :) Thanks @greg-king5 !

Seems to be fixed.

Was this page helpful?
0 / 5 - 0 ratings