From e9a67d0abd9097283c5f32cd7d1cf9519a78097b Mon Sep 17 00:00:00 2001 From: cpg Date: Thu, 16 Nov 2000 21:38:00 +0000 Subject: [PATCH] removed leading _ from dio functions and types; added small explanation of each function git-svn-id: svn://svn.cc65.org/cc65/trunk@436 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- include/dio.h | 65 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 24 deletions(-) diff --git a/include/dio.h b/include/dio.h index ad5c3df81..9ae64a6ab 100644 --- a/include/dio.h +++ b/include/dio.h @@ -31,41 +31,58 @@ #ifndef _DIO_H #define _DIO_H -typedef unsigned char _driveid_t; -typedef unsigned int _sectnum_t; -typedef unsigned int _sectsize_t; -typedef struct __dhandle_t *_dhandle_t; +typedef unsigned char driveid_t; +typedef unsigned int sectnum_t; +typedef unsigned int sectsize_t; +typedef struct __dhandle_t *dhandle_t; typedef struct { unsigned char head; unsigned track; unsigned sector; -} _dio_phys_pos; +} dio_phys_pos; #ifdef __ATARI__ -#define _dio_query_sectsize(x) ((_sectsize_t)128) +#define dio_query_sectsize(x) ((_sectsize_t)128) #else -#define _dio_query_sectsize(x) ((_sectsize_t)256) +#define dio_query_sectsize(x) ((_sectsize_t)256) #endif +/* queries sector size, currently hardcoded */ -extern _dhandle_t __fastcall__ _dio_open(_driveid_t drive_id); -extern unsigned char __fastcall__ _dio_close(_dhandle_t handle); -extern unsigned char __fastcall__ _dio_read(_dhandle_t handle, - _sectnum_t sect_num, - void *buffer); -extern unsigned char __fastcall__ _dio_write(_dhandle_t handle, - _sectnum_t sect_num, - const void *buffer); -extern unsigned char __fastcall__ _dio_write_verify(_dhandle_t handle, - _sectnum_t sect_num, - const void *buffer); +extern dhandle_t __fastcall__ dio_open(driveid_t drive_id); +/* open drive for subsequent dio access */ -extern unsigned char __fastcall__ _dio_phys_to_log(_dhandle_t handle, - const _dio_phys_pos *physpos, /* input */ - _sectnum_t *sectnum); /* output */ -extern unsigned char __fastcall__ _dio_log_to_phys(_dhandle_t handle, - _dio_phys_pos *physpos, /* output */ - const _sectnum_t *sectnum); /* input */ +extern unsigned char __fastcall__ dio_close(dhandle_t handle); +/* close drive */ + +extern unsigned char __fastcall__ dio_read(dhandle_t handle, + sectnum_t sect_num, + void *buffer); +/* read sector from drive to memory at */ +/* the number of bytes transferred depends on the sector size */ + +extern unsigned char __fastcall__ dio_write(dhandle_t handle, + sectnum_t sect_num, + const void *buffer); +/* write memory at to sector on drive , no verify */ +/* the number of bytes transferred depends on the sector size */ + +extern unsigned char __fastcall__ dio_write_verify(dhandle_t handle, + sectnum_t sect_num, + const void *buffer); +/* write memory at to sector on drive , verify after write */ +/* the number of bytes transferred depends on the sector size */ + + +extern unsigned char __fastcall__ dio_phys_to_log(dhandle_t handle, + const dio_phys_pos *physpos, /* input */ + sectnum_t *sectnum); /* output */ +/* convert physical sector address (head/track/sector) to logical sector number */ + +extern unsigned char __fastcall__ dio_log_to_phys(dhandle_t handle, + const sectnum_t *sectnum, /* input */ + dio_phys_pos *physpos); /* output */ +/* convert logical sector number to physical sector address (head/track/sector) */ #endif /* #ifndef _DIO_H */ -- 2.39.5