Direct access mode?

HxC Floppy emulator support for all others computers...
Post Reply
tuukka
Posts: 2
Joined: Tue Sep 06, 2016 8:20 pm

Direct access mode?

Post by tuukka »

Hi everyone!

I just installed an SD slim floppy emulator into my Kaypro 4/84, as drive C (I made a drive select decoder to handle it). It works fine as a quad density floppy, and I can change the image by pushing the button.

I tried to write a program to select image file, but can't get it working. Here is the crucial part of my program (Aztec C 80)

Code: Select all

static struct {
  char DAHEADERSIGNATURE[8];  /* Must be set to HxCFEDA */
  unsigned char cmd_code;     /* Command code */
  unsigned char params[8];    /* Parameters */
  unsigned char cmd_checksum; /* Parameters checksum */
  unsigned char filler[1024]; /* Make enough space to read a 1k sector into struct */
} cmd;

slot = atoi(argv[1]);

  /* Prepare command sector */
  strcpy(cmd.DAHEADERSIGNATURE, "HxCFEDA");
  cmd.cmd_code = 4; /* select image index */
  cmd.params[0] = slot&0xff; /* Set index */
  cmd.params[1] = slot>>8;

  /* Calculate checksum */

  cmd.cmd_checksum = 0;
  for(a=0; a<=7; a++)
    cmd.cmd_checksum += cmd.params[a];

  /* Write command */

  printf("Selecting slot %d... ", slot);

  bios(9,2,0);      /* Select disk C */
  bios(10,255,0);   /* Set track 255 */
  bios(11,0,0);     /* Set sector 0 */
  bios(12,&cmd,0);  /* Set DMA buffer */
  a=bios(14,1,0);   /* Write sector */
  printf(a?"FAIL\n":"OK\n");
It seems to do the seek, according to a long buzz sound from the board, but the sector write command fails. Documentation is a bit unclear on the checksum - is it done over the parameters or over the whole struct?


tuukka
Posts: 2
Joined: Tue Sep 06, 2016 8:20 pm

Re: Direct access mode?

Post by tuukka »

Thanks. I see the checksum is not used at all.

I found the problem, my CP/M BIOS does not allow seeks to track>159, so I have to do some debugging to bypass the check to access track 255.

Post Reply