2 * This file has been modified for the cdrkit suite.
4 * The behaviour and appearence of the program code below can differ to a major
5 * extent from the version distributed by the original author(s).
7 * For details, see Changelog file distributed with the cdrkit package. If you
8 * received this file from another source then ask the distributing person for
9 * a log of modifications.
13 /* @(#)interface.h 1.14 06/02/19 Copyright 1998-2001 Heiko Eissfeldt, Copyright 2005-2006 J. Schilling */
16 * CopyPolicy: GNU Public License 2 applies
17 * Copyright (C) by Heiko Eissfeldt
19 * header file interface.h for cdda2wav */
22 #define CD_FRAMESIZE 2048
25 #ifndef CD_FRAMESIZE_RAW
26 #define CD_FRAMESIZE_RAW 2352
29 #define CD_FRAMESAMPLES (CD_FRAMESIZE_RAW / 4)
31 extern unsigned interface;
33 extern int trackindex_disp;
39 #define GENERIC_SCSI 0
40 #define COOKED_IOCTL 1
42 /* constants for sub-q-channel info */
44 #define GET_POSITIONDATA 1
45 #define GET_CATALOGNUMBER 2
46 #define GET_TRACK_ISRC 3
48 typedef struct subq_chnl {
49 unsigned char reserved;
50 unsigned char audio_status;
51 unsigned short subq_length;
53 unsigned char control_adr;
56 unsigned char data[40]; /* this has subq_all, subq_position,
57 subq_catalog or subq_track_isrc format */
60 typedef struct subq_all {
61 unsigned char abs_min;
62 unsigned char abs_sec;
63 unsigned char abs_frame;
64 unsigned char abs_reserved;
65 unsigned char trel_min;
66 unsigned char trel_sec;
67 unsigned char trel_frame;
68 unsigned char trel_reserved;
69 unsigned char mc_valid; /* MSB */
70 unsigned char media_catalog_number[13];
73 unsigned char tc_valid; /* MSB */
74 unsigned char track_ISRC[15];
77 typedef struct subq_position {
78 unsigned char abs_reserved;
79 unsigned char abs_min;
80 unsigned char abs_sec;
81 unsigned char abs_frame;
82 unsigned char trel_reserved;
83 unsigned char trel_min;
84 unsigned char trel_sec;
85 unsigned char trel_frame;
88 typedef struct subq_catalog {
89 unsigned char mc_valid; /* MSB */
90 unsigned char media_catalog_number[13];
95 typedef struct subq_track_isrc {
96 unsigned char tc_valid; /* MSB */
97 unsigned char track_isrc[15];
100 #if !defined NO_SCSI_STUFF
104 /* cdrom access function pointer */
105 extern void (*EnableCdda)(SCSI *usalp, int Switch, unsigned uSectorsize);
106 extern unsigned (*doReadToc)(SCSI *usalp);
107 extern void (*ReadTocText)(SCSI *usalp);
108 extern unsigned (*ReadLastAudio)(SCSI *usalp);
109 extern int (*ReadCdRom)(SCSI *usalp, UINT4 *p, unsigned lSector,
110 unsigned SectorBurstVal);
111 extern int (*ReadCdRomSub)(SCSI *usalp, UINT4 *p, unsigned lSector,
112 unsigned SectorBurstVal);
113 extern int (*ReadCdRomData)(SCSI *usalp, unsigned char *p, unsigned lSector,
114 unsigned SectorBurstVal);
115 extern subq_chnl *(*ReadSubQ)(SCSI *usalp, unsigned char sq_format,
116 unsigned char track);
117 extern subq_chnl *(*ReadSubChannels)(SCSI *usalp, unsigned lSector);
118 extern void (*SelectSpeed)(SCSI *usalp, unsigned speed);
119 extern int (*Play_at)(SCSI *usalp, unsigned from_sector, unsigned sectors);
120 extern int (*StopPlay)(SCSI *usalp);
121 extern void (*trash_cache)(UINT4 *p, unsigned lSector, unsigned SectorBurstVal);
123 SCSI *get_scsi_p(void);
126 extern unsigned char *bufferTOC;
127 extern subq_chnl *SubQbuffer;
130 void SetupInterface(void);
131 int Toshiba3401(void);
133 void priv_init(void);