From 742cf43e30ea8e3ace93dfa4cb2fab19a7b74245 Mon Sep 17 00:00:00 2001 From: cuz Date: Wed, 30 Mar 2005 18:25:38 +0000 Subject: [PATCH] New function dio_query_sectcount and cosmetic changes git-svn-id: svn://svn.cc65.org/cc65/trunk@3433 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- include/dio.h | 60 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/include/dio.h b/include/dio.h index 018a4cbc8..694430657 100644 --- a/include/dio.h +++ b/include/dio.h @@ -28,9 +28,19 @@ /* */ /*****************************************************************************/ + + #ifndef _DIO_H #define _DIO_H + + +/*****************************************************************************/ +/* Data */ +/*****************************************************************************/ + + + typedef unsigned char driveid_t; typedef unsigned int sectnum_t; typedef unsigned int sectsize_t; @@ -43,50 +53,56 @@ typedef struct { } dio_phys_pos; -#ifdef __ATARI__ -extern sectsize_t __fastcall__ dio_query_sectsize(dhandle_t handle); -#else -#define dio_query_sectsize(x) ((sectsize_t)256) -#endif + +/*****************************************************************************/ +/* Code */ +/*****************************************************************************/ + + + +sectsize_t __fastcall__ dio_query_sectsize(dhandle_t handle); /* queries sector size, currently hardcoded */ -extern dhandle_t __fastcall__ dio_open(driveid_t drive_id); +sectnum_t __fastcall__ dio_query_sectcount(dhandle_t handle); +/* Return the sector count for a disk. */ + +dhandle_t __fastcall__ dio_open(driveid_t drive_id); /* open drive for subsequent dio access */ -extern unsigned char __fastcall__ dio_close(dhandle_t handle); +unsigned char __fastcall__ dio_close(dhandle_t handle); /* close drive, returns oserror (0 for success) */ -extern unsigned char __fastcall__ dio_read(dhandle_t handle, - sectnum_t sect_num, - void *buffer); +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 */ /* returns oserror (0 for success) */ -extern unsigned char __fastcall__ dio_write(dhandle_t handle, - sectnum_t sect_num, - const void *buffer); +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 */ /* returns oserror (0 for success) */ -extern unsigned char __fastcall__ dio_write_verify(dhandle_t handle, - sectnum_t sect_num, - const void *buffer); +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 */ /* returns oserror (0 for success) */ -extern unsigned char __fastcall__ dio_phys_to_log(dhandle_t handle, - const dio_phys_pos *physpos, /* input */ - sectnum_t *sectnum); /* output */ +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 */ /* returns oserror (0 for success) */ -extern unsigned char __fastcall__ dio_log_to_phys(dhandle_t handle, - const sectnum_t *sectnum, /* input */ - dio_phys_pos *physpos); /* output */ +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) */ /* returns oserror (0 for success) */ -- 2.39.5