Annotation of hatari/src/includes/hdc.h, revision 1.1.1.3

1.1       root        1: /*
1.1.1.3 ! root        2:   Hatari - hdc.h
        !             3: 
        !             4:   This file is distributed under the GNU Public License, version 2 or at
        !             5:   your option any later version. Read the file gpl.txt for details.
1.1       root        6: 
1.1.1.3 ! root        7:   This file contains definitios used for hardware-level
        !             8:   harddrive emulation.
1.1       root        9: */
                     10: 
1.1.1.3 ! root       11: #ifndef HATARI_HDC_H
        !            12: #define HATARI_HDC_H
        !            13: 
1.1       root       14: 
                     15: /* HD Command packet macros */
                     16: #define HD_OPCODE(a) (a.command[0] & 0x1F)             /* get opcode (bit 0-4) */
                     17: #define HD_CONTROLLER(a) ((a.command[0] & 0xE0)>>5)    /* get HD controller # (5-7) */
                     18: #define HD_DRIVENUM(a) ((a.command[1] & 0xE0) >>5)     /* get drive # (5-7) */
                     19: 
                     20: #define HD_LBA_MSB(a) ((unsigned) a.command[1] & 0x1F) /* Logical Block adress, MSB */
                     21: #define HD_LBA_MID(a) ((unsigned) a.command[2])        /* Logical Block adress */
                     22: #define HD_LBA_LSB(a) ((unsigned) a.command[3])        /* Logical Block adress, LSB */
                     23: 
                     24: #define HD_SECTORCOUNT(a) (a.command[4] & 0xFF)        /* get sector count */
                     25: #define HD_CONTROL(a) (a.command[5] & 0xFF)            /* get control byte */
                     26: 
                     27: 
                     28: /* Opcodes */
                     29: /* The following are multi-sector transfers with seek implied */
                     30: #define HD_VERIFY_TRACK    0x05               /* Verify track */
                     31: #define HD_FORMAT_TRACK    0x06               /* Format track */
                     32: #define HD_READ_SECTOR     0x08               /* Read sector */
                     33: #define HD_WRITE_SECTOR    0x0A               /* Write sector */
                     34: 
                     35: /* other codes */
                     36: #define HD_SEEK            0x0B               /* Seek */
                     37: #define HD_CORRECTION      0x0D               /* Correction */
                     38: #define HD_INQUIRY         0x12               /* Inquiry */
                     39: #define HD_MODESENSE       0x1A               /* Mode sense */
                     40: #define HD_REQ_SENSE       0x03               /* Request sense */
                     41: #define HD_SHIP            0x1B               /* Ship drive */
                     42: 
                     43: #define HD_STATUS_OK          0               /* OK return status */
                     44: #define HD_STATUS_NODRIVE  0x25               /* Invalid drive */
                     45: #define HD_STATUS_OPCODE   0x20               /* Opcode not supported */
                     46: 
                     47: #define ACSI_EMU_ON         (nPartitions != 0) 
                     48: /* do we have hdc emulation */
                     49: /* 
                     50:    Structure representing an ACSI command block.
                     51: */
                     52: typedef struct {
                     53:   int byteCount;         /* count of number of command bytes written */
                     54:   unsigned char command[6]; 
                     55:   short int returnCode;  /* return code from the HDC operation */
                     56: } HDCOMMAND;
                     57: 
                     58: extern FILE *hd_image_file;
                     59: extern HDCOMMAND HDCCommand;
                     60: extern short int HDCSectorCount;
                     61: extern int nPartitions;
                     62: 
1.1.1.2   root       63: extern BOOL HDC_Init(char *filename);
1.1.1.3 ! root       64: extern void HDC_UnInit(void);
        !            65: extern void HDC_WriteCommandPacket(void);
        !            66: extern void HDC_DebugCommandPacket(FILE *hdlogFile);
        !            67: extern void HDC_EmulateCommandPacket(void);
        !            68: 
        !            69: #endif /* HATARI_HDC_H */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.