home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of A1200
/
World_Of_A1200.iso
/
programs
/
disk
/
cdrom
/
amicdfs
/
src
/
cdrom.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-02-27
|
3KB
|
105 lines
/* cdrom.h: */
#ifndef _CDROM_H_
#define _CDROM_H_
#include <exec/types.h>
#include <exec/memory.h>
#include <exec/io.h>
#include <devices/scsidisk.h>
#ifdef DEBUG
void __stdargs kprintf(STRPTR str,...);
#define D(x) x
#else
#define D(x)
#endif
#define SCSI_BUFSIZE 2048
typedef enum model {
MODEL_ANY,
MODEL_TOSHIBA_3401,
MODEL_CDU_8002,
} t_model;
typedef struct CDROM {
unsigned char *buffer;
unsigned char **buffers;
unsigned char *buffer_data;
unsigned char sense[20];
short scsi_compliance; /* 1 or 2 */
t_model model;
long startoffset;
short use_trackdisk;
short lun;
short std_buffers;
short file_buffers;
unsigned long t_changeint;
unsigned long t_changeint2;
long *current_sectors;
unsigned long *last_used;
unsigned long tick;
struct MsgPort *port;
struct IOStdReq *scsireq;
struct SCSICmd cmd;
unsigned short block_length;
unsigned short blocking_factor;
short device_open;
short motor;
} CDROM;
typedef struct inquiry_data {
char peripheral_type;
char modifier;
char version;
char flags1;
char additional_length;
char reserved[2];
char flags2;
char vendor[8];
char product[16];
char revision[4];
} t_inquiry_data;
typedef struct toc_header {
unsigned short length;
unsigned char first_track;
unsigned char last_track;
} t_toc_header;
typedef struct toc_data {
char reserved1;
unsigned char flags;
unsigned char track_number;
char reserved2;
unsigned long address;
} t_toc_data;
CDROM *Open_CDROM (char *p_device, int p_scsi_id, int p_flags,
long p_startoffset,
int p_use_trackdisk,
unsigned long p_memory_type, int p_std_buffers,
int p_file_buffers,BOOL addchangeint);
int Read_Sector (CDROM *p_cd, long p_sector);
int Read_Contiguous_Sectors (CDROM *p_cd, long p_sector, long p_last_sector);
void Cleanup_CDROM (CDROM *p_cd);
int Test_Unit_Ready (CDROM *p_cd);
int Mode_Select (CDROM *p_cd, int p_on, int p_block_length);
int Inquire (CDROM *p_cd, t_inquiry_data *p_data);
VOID Motor_Off(CDROM *p_cd);
int Is_XA_Mode_Disk (CDROM *p_cd);
t_toc_data *Read_TOC (CDROM *p_cd, t_toc_header *p_toc_header);
int Has_Audio_Tracks (CDROM *p_cd);
int Data_Tracks (CDROM *p_cd, unsigned long** p_buf);
int Start_Play_Audio (CDROM *p_cd);
int Stop_Play_Audio (CDROM *p_cd);
int Block_Length (CDROM *p_cd);
void Clear_Sector_Buffers (CDROM *p_cd);
int Find_Last_Session (CDROM *p_cd, unsigned long *p_result);
#endif /* _CDROM_H_ */