6 * 06-Mar-09 error - Removed madness, fixed insanity. Cleanup started
12 #include <exec/types.h>
13 #include <exec/memory.h>
15 #include <devices/scsidisk.h>
19 #define VERSION "CDROM-Handler 1.15 (03.11.94)"
21 #define SCSI_BUFSIZE 2048
25 #define __packed __attribute__((__packed__))
31 typedef struct CDROM
{
32 struct CDVDBase
*global
;
33 unsigned char *buffer
;
34 unsigned char **buffers
;
35 unsigned char *buffer_data
;
36 unsigned char *buffer_io
;
37 unsigned char sense
[20];
41 uint32_t t_changeint2
;
42 long *current_sectors
;
46 struct IOStdReq
*scsireq
;
49 struct IOStdReq
*iochangeint
;
50 struct Interrupt changeint
;
54 typedef struct inquiry_data
{
59 char additional_length
;
65 } __packed t_inquiry_data
;
67 typedef struct toc_header
{
68 unsigned short length
;
69 unsigned char first_track
;
70 unsigned char last_track
;
71 } __packed t_toc_header
;
73 typedef struct toc_data
{
76 unsigned char track_number
;
79 } __packed t_toc_data
;
83 struct CDVDBase
*global
,
86 uint32_t p_memory_type
,
91 int Read_Chunk(CDROM
*p_cd
, long p_sector
);
92 void Cleanup_CDROM(CDROM
*p_cd
);
93 int Test_Unit_Ready(CDROM
*p_cd
);
94 int Mode_Select(CDROM
*p_cd
, int p_on
, int p_block_length
);
95 int Inquire(CDROM
*p_cd
, t_inquiry_data
*p_data
);
101 int Has_Audio_Tracks(CDROM
*p_cd
);
102 int Data_Tracks(CDROM
*p_cd
, uint32_t** p_buf
);
103 void block2msf (uint32_t blk
, unsigned char *msf
);
104 int Start_Play_Audio(CDROM
*p_cd
);
105 int Stop_Play_Audio(CDROM
*p_cd
);
106 void Clear_Sector_Buffers (CDROM
*p_cd
);
107 int Find_Last_Session(CDROM
*p_cd
, uint32_t *p_result
);
110 CDROMERR_OK
= 0, /* no error */
111 CDROMERR_NO_MEMORY
, /* out of memory */
112 CDROMERR_MSGPORT
, /* cannot create message port */
113 CDROMERR_IOREQ
, /* cannot create I/O request */
114 CDROMERR_DEVICE
, /* cannot open scsi device */
115 CDROMERR_BLOCKSIZE
/* illegal blocksize */
118 #endif /* _CDROM_H_ */