; This is the CD code taken from Marc Le Douarain's archive MaVaTi_Blitz.lha on ; Aminet. It has been modified to remove all of the unnecessary bits for GetCDDB
;#SCSI_CMD_SSU=$1B
#SCSIF_WRITE=0
#SCSIF_READ=1
#SCSIF_AUTOSENSE=2
;#SCSI_CMD_READSUBCHANNEL=$42
#SCSI_CMD_READTOC=$43
;#SCSI_CMD_PLAYAUDIO12=$A5
;#SCSI_CMD_PAUSERESUME=$4B
#SENSE_LEN=252
#MAX_DATA_LEN=252
#MAX_TOC_LEN=804
OPENDEVERROR=0;#_FALSE
; CDDA vars
STATUS_CDDA.b=0 ; How the CD drive is (playing:$11, paused:$12, stopped:other values)
TRACK.b=0 ; Track being played
ACTUALINDEX.l=0 ; address in actualtrack
TOTALINDEX.l=0 ; address in CD
TOClength.b=0 ; Number of tracks
validTOC.b=0 ; 1=We have read a valid TOC, 0=No
DEFTYPE .b *TOCbuf ; Buffer for Table Of Contents
Dim TOCflags.b(100) ; 0=CDDA, 1=Data
ONECDDAVALID.b=0 ; Is there at least one CDDA track ?
Dim TOCaddr.l(100) ; Track starts
TOCCDID$="" ; Id string of CD
TOCCDTITLE$="" ; Title of actual CD */
TOCCDARTIST$="" ; Artist
Dim TOCCDTITLESONG$(100) ; Title of the songs...
NEWTYPE.toc
f.w ;frames
s.w ;seconds
m.w ;minutes
End NEWTYPE
Dim cdtoc.toc(100)
; Global vars
DEFTYPE .MsgPort *msgport
DEFTYPE .IOStdReq *ioreq
DEFTYPE .b *scsidata
DEFTYPE .SCSICmd *scsicmd
DEFTYPE .b *scsisense
NEWTYPE .SCSICMD10
opcode.b
b1.b
b2.b
b3.b
b4.b
b5.b
b6.b
b7.b
b8.b
control.b
End NEWTYPE
; DoScsiCmd(UBYTE *Data, Int datasize, UBYTE *cmd, Int cmdsize, UBYTE flags)