mirror of
https://github.com/cc65/cc65.git
synced 2025-08-08 06:25:17 +00:00
Code review changes and build fix.
This commit is contained in:
@@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
/* I/O control block */
|
/* I/O control block */
|
||||||
|
|
||||||
typedef struct {
|
struct __iocb {
|
||||||
unsigned char handler; /* handler index number (0xff free) */
|
unsigned char handler; /* handler index number (0xff free) */
|
||||||
unsigned char drive; /* device number (drive) */
|
unsigned char drive; /* device number (drive) */
|
||||||
unsigned char command; /* command */
|
unsigned char command; /* command */
|
||||||
@@ -71,22 +71,26 @@ typedef struct {
|
|||||||
unsigned char aux4; /* 4th auxiliary byte */
|
unsigned char aux4; /* 4th auxiliary byte */
|
||||||
unsigned char aux5; /* 5th auxiliary byte */
|
unsigned char aux5; /* 5th auxiliary byte */
|
||||||
unsigned char spare; /* spare byte */
|
unsigned char spare; /* spare byte */
|
||||||
} IOCB;
|
};
|
||||||
|
|
||||||
|
typedef struct __iocb IOCB;
|
||||||
|
|
||||||
|
|
||||||
/* DOS 2.x zeropage variables */
|
/* DOS 2.x zeropage variables */
|
||||||
|
|
||||||
typedef struct {
|
struct __dos2x {
|
||||||
unsigned char* zbufp; /* points to user filename */
|
unsigned char* zbufp; /* points to user filename */
|
||||||
unsigned char* zdrva; /* points to serveral buffers (mostly VTOC) */
|
unsigned char* zdrva; /* points to serveral buffers (mostly VTOC) */
|
||||||
unsigned char* zsba; /* points to sector buffer */
|
unsigned char* zsba; /* points to sector buffer */
|
||||||
unsigned char errno; /* number of occured error */
|
unsigned char errno; /* number of occured error */
|
||||||
} DOS2X;
|
};
|
||||||
|
|
||||||
|
typedef struct __dos2x DOS2X;
|
||||||
|
|
||||||
|
|
||||||
/* A single device handler formed by it's routines */
|
/* A single device handler formed by it's routines */
|
||||||
|
|
||||||
typedef struct {
|
struct __devhdl {
|
||||||
void *open; /* address of OPEN routine -1 */
|
void *open; /* address of OPEN routine -1 */
|
||||||
void *close; /* address of CLOSE routine -1 */
|
void *close; /* address of CLOSE routine -1 */
|
||||||
void *get; /* address of GET BYTE routine -1 */
|
void *get; /* address of GET BYTE routine -1 */
|
||||||
@@ -95,26 +99,33 @@ typedef struct {
|
|||||||
void *special; /* address od SPECIAL routine -1 */
|
void *special; /* address od SPECIAL routine -1 */
|
||||||
void (*init)(void); /* init routine (JMP INIT) */
|
void (*init)(void); /* init routine (JMP INIT) */
|
||||||
void *reserved; /* unused */
|
void *reserved; /* unused */
|
||||||
} DEVHDL;
|
};
|
||||||
|
|
||||||
|
typedef struct __devhdl DEVHDL;
|
||||||
|
|
||||||
|
|
||||||
/* List of device handlers, as managed in HATABS */
|
/* List of device handlers, as managed in HATABS */
|
||||||
|
|
||||||
typedef struct {
|
struct __hatabs {
|
||||||
unsigned char id; /* ATASCII code of handler e.g. 'C','D','E','K','P','S','R' */
|
unsigned char id; /* ATASCII code of handler e.g. 'C','D','E','K','P','S','R' */
|
||||||
DEVHDL* devhdl; /* Pointer to routines of device */
|
DEVHDL* devhdl; /* Pointer to routines of device */
|
||||||
} HATABS;
|
};
|
||||||
|
|
||||||
|
typedef struct __hatabs HATABS;
|
||||||
|
|
||||||
|
|
||||||
/* Floating point register */
|
/* Floating point register */
|
||||||
|
|
||||||
typedef struct {
|
struct __fpreg {
|
||||||
#ifdef OS_REV2
|
#ifdef OS_REV2
|
||||||
unsigned char fr;
|
unsigned char fr;
|
||||||
unsigned char frm[5]; /* 5-byte register mantissa */
|
unsigned char frm[5]; /* 5-byte register mantissa */
|
||||||
#else
|
#else
|
||||||
unsigned char fr[6]; /* 6 bytes for single register */
|
unsigned char fr[6]; /* 6 bytes for single register */
|
||||||
#endif
|
#endif
|
||||||
} FPREG;
|
};
|
||||||
|
|
||||||
|
typedef struct __fpreg FPREG;
|
||||||
|
|
||||||
enum { /* enum for access of floating point registers */
|
enum { /* enum for access of floating point registers */
|
||||||
R0 = 0, /* (to use as index) */
|
R0 = 0, /* (to use as index) */
|
||||||
@@ -653,3 +664,4 @@ struct __basic {
|
|||||||
unsigned int binint; // = $D4/$D5 USR-CALL RETURN VALUE
|
unsigned int binint; // = $D4/$D5 USR-CALL RETURN VALUE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@@ -22,13 +22,11 @@ static char C_dev[] = "C:";
|
|||||||
|
|
||||||
static struct __iocb *findfreeiocb(void)
|
static struct __iocb *findfreeiocb(void)
|
||||||
{
|
{
|
||||||
struct __iocb *iocb = &IOCB; /* first IOCB (#0) */
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 8; i++) {
|
||||||
if (iocb->handler == 0xff)
|
if (OS.iocb[i].handler == 0xff)
|
||||||
return iocb;
|
return &OS.iocb[i];
|
||||||
iocb++;
|
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -52,7 +50,7 @@ int main(int argc, char **argv)
|
|||||||
fprintf(stderr, "couldn't find a free iocb\n");
|
fprintf(stderr, "couldn't find a free iocb\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
iocb_num = (iocb - &IOCB) * 16;
|
iocb_num = (iocb - OS.iocb) * 16;
|
||||||
if (verbose)
|
if (verbose)
|
||||||
printf("using iocb index $%02X ($%04X)\n", iocb_num, iocb);
|
printf("using iocb index $%02X ($%04X)\n", iocb_num, iocb);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user