2000-10-09 22:31:57 +00:00
|
|
|
/*****************************************************************************/
|
|
|
|
/* */
|
2000-10-20 15:55:46 +00:00
|
|
|
/* dio.h */
|
2000-10-09 22:31:57 +00:00
|
|
|
/* */
|
2000-10-20 15:55:46 +00:00
|
|
|
/* Low-Level diskette I/O functions */
|
2000-10-09 22:31:57 +00:00
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* (C) 2000 Christian Groessler <cpg@aladdin.de> */
|
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* 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
|
|
|
|
|
2000-10-20 15:55:46 +00:00
|
|
|
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;
|
2000-10-09 22:31:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef __ATARI__
|
2000-10-12 20:52:23 +00:00
|
|
|
#define _dio_query_sectsize(x) ((_sectsize_t)128)
|
2000-10-09 22:31:57 +00:00
|
|
|
#else
|
2000-10-12 20:52:23 +00:00
|
|
|
#define _dio_query_sectsize(x) ((_sectsize_t)256)
|
|
|
|
#endif
|
2000-10-09 22:31:57 +00:00
|
|
|
|
2000-10-18 23:41:03 +00:00
|
|
|
extern _dhandle_t __fastcall__ _dio_open (_driveid_t drive_id);
|
|
|
|
extern unsigned char __fastcall__ _dio_close (_dhandle_t handle);
|
|
|
|
extern unsigned char __fastcall__ _dio_format(_dhandle_t handle,
|
2000-10-17 21:47:24 +00:00
|
|
|
unsigned int format);
|
2000-10-18 23:41:03 +00:00
|
|
|
extern unsigned char __fastcall__ _dio_read(_dhandle_t handle,
|
2000-10-17 21:47:24 +00:00
|
|
|
_sectnum_t sect_num,
|
|
|
|
void *buffer);
|
2000-10-18 23:41:03 +00:00
|
|
|
extern unsigned char __fastcall__ _dio_write(_dhandle_t handle,
|
2000-10-17 21:47:24 +00:00
|
|
|
_sectnum_t sect_num,
|
|
|
|
const void *buffer);
|
2000-10-18 23:41:03 +00:00
|
|
|
extern unsigned char __fastcall__ _dio_write_verify(_dhandle_t handle,
|
2000-10-17 21:47:24 +00:00
|
|
|
_sectnum_t sect_num,
|
|
|
|
const void *buffer);
|
2000-10-09 22:31:57 +00:00
|
|
|
|
2000-10-20 15:55:46 +00:00
|
|
|
extern unsigned char __fastcall__ _dio_phys_to_log(_dhandle_t handle,
|
|
|
|
_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 */
|
|
|
|
_sectnum_t *sectnum); /* input */
|
2000-10-09 22:31:57 +00:00
|
|
|
|
|
|
|
#endif /* #ifndef _DIO_H */
|