From: cpg Date: Mon, 9 Oct 2000 22:31:57 +0000 (+0000) Subject: dio.h - low-level disk-io functions X-Git-Tag: V2.12.0~3179 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e40995c8899d2a502538c55105c4d5493a213f39;p=cc65 dio.h - low-level disk-io functions git-svn-id: svn://svn.cc65.org/cc65/trunk@347 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/include/dio.h b/include/dio.h new file mode 100644 index 000000000..284eb0add --- /dev/null +++ b/include/dio.h @@ -0,0 +1,59 @@ +/*****************************************************************************/ +/* */ +/* dio.h */ +/* */ +/* Low-Level diskette I/O functions */ +/* */ +/* */ +/* */ +/* (C) 2000 Christian Groessler */ +/* */ +/* */ +/* This software is provided 'as-is', without any expressed or implied */ +/* warranty. In no event will the authors be held liable for any damages */ +/* arising from the use of this software. */ +/* */ +/* Permission is granted to anyone to use this software for any purpose, */ +/* including commercial applications, and to alter it and redistribute it */ +/* freely, subject to the following restrictions: */ +/* */ +/* 1. The origin of this software must not be misrepresented; you must not */ +/* claim that you wrote the original software. If you use this software */ +/* in a product, an acknowledgment in the product documentation would be */ +/* appreciated but is not required. */ +/* 2. Altered source versions must be plainly marked as such, and must not */ +/* be misrepresented as being the original software. */ +/* 3. This notice may not be removed or altered from any source */ +/* distribution. */ +/* */ +/*****************************************************************************/ + +#ifndef _DIO_H +#define _DIO_H + +typedef unsigned char _driveid_t; +typedef unsigned int _sectnum_t; + + +#ifdef __ATARI__ +#define _dio_query_sectsize(x) ((unsigned int)128) +#else +#define _dio_query_sectsize(x) ((unsigned int)256) +#endif + +extern unsigned char __fastcall__ _dio_setup (_driveid_t drive_id); +extern unsigned char __fastcall__ _dio_finish (_driveid_t drive_id); + +extern unsigned char __fastcall__ _dio_format (_driveid_t drive_id, unsigned int format); +extern unsigned char __fastcall__ _dio_read (_driveid_t drive_id, _sectnum_t sect_num, void *buffer); +extern unsigned char __fastcall__ _dio_write (_driveid_t drive_id, _sectnum_t sect_num, void *buffer); +extern unsigned char __fastcall__ _dio_write_verify(_driveid_t drive_id, _sectnum_t sect_num, void *buffer); + + +extern _sectnum_t __fastcall__ _dio_chs_to_snum(unsigned int cyl, unsigned int head, unsigned int sector); +extern void __fastcall__ _dio_snum_to_chs(_sectnum_t sect_num, + unsigned int *cyl, + unsigned int *head, + unsigned int *sector); + +#endif /* #ifndef _DIO_H */