1 /***********************************************************
\r
3 * This source was taken from the Gens project *
\r
4 * Written by Stéphane Dallongeville *
\r
5 * Copyright (c) 2002 by Stéphane Dallongeville *
\r
6 * Modified/adapted for PicoDrive by notaz, 2007 *
\r
8 ***********************************************************/
\r
13 #include "cd_file.h"
\r
20 #define INT_TO_BCDB(c) \
\r
21 ((c) > 99)?(0x99):((((c) / 10) << 4) + ((c) % 10));
\r
23 #define INT_TO_BCDW(c) \
\r
24 ((c) > 99)?(0x0909):((((c) / 10) << 8) + ((c) % 10));
\r
26 #define BCDB_TO_INT(c) \
\r
27 (((c) >> 4) * 10) + ((c) & 0xF);
\r
29 #define BCDW_TO_INT(c) \
\r
30 (((c) >> 8) * 10) + ((c) & 0xF);
\r
42 // unsigned char Type; // always 1 (data) for 1st track, 0 (audio) for others
\r
43 // unsigned char Num; // unused
\r
46 char ftype; // TYPE_ISO, TYPE_BIN, TYPE_MP3
\r
49 int Offset; // sector offset, when single file is used for multiple virtual tracks
\r
50 short KBtps; // kbytes per sec for mp3s (bitrate / 1000 / 8)
\r
56 // unsigned char First_Track; // always 1
\r
57 _scd_track Tracks[100];
\r
58 unsigned int Last_Track;
\r
62 unsigned int Status_CDD;
\r
63 unsigned int Status_CDC;
\r
65 unsigned int Cur_Track;
\r
72 PICO_INTERNAL void LBA_to_MSF(int lba, _msf *MSF);
\r
73 PICO_INTERNAL int Track_to_LBA(int track);
\r
76 // int Insert_CD(char *iso_name, int is_bin);
\r
77 // void Stop_CD(void);
\r
79 PICO_INTERNAL void Check_CD_Command(void);
\r
81 PICO_INTERNAL int Init_CD_Driver(void);
\r
82 PICO_INTERNAL void End_CD_Driver(void);
\r
83 PICO_INTERNAL void Reset_CD(void);
\r
85 PICO_INTERNAL int Get_Status_CDD_c0(void);
\r
86 PICO_INTERNAL int Stop_CDD_c1(void);
\r
87 PICO_INTERNAL int Get_Pos_CDD_c20(void);
\r
88 PICO_INTERNAL int Get_Track_Pos_CDD_c21(void);
\r
89 PICO_INTERNAL int Get_Current_Track_CDD_c22(void);
\r
90 PICO_INTERNAL int Get_Total_Lenght_CDD_c23(void);
\r
91 PICO_INTERNAL int Get_First_Last_Track_CDD_c24(void);
\r
92 PICO_INTERNAL int Get_Track_Adr_CDD_c25(void);
\r
93 PICO_INTERNAL int Play_CDD_c3(void);
\r
94 PICO_INTERNAL int Seek_CDD_c4(void);
\r
95 PICO_INTERNAL int Pause_CDD_c6(void);
\r
96 PICO_INTERNAL int Resume_CDD_c7(void);
\r
97 PICO_INTERNAL int Fast_Foward_CDD_c8(void);
\r
98 PICO_INTERNAL int Fast_Rewind_CDD_c9(void);
\r
99 PICO_INTERNAL int CDD_cA(void);
\r
100 PICO_INTERNAL int Close_Tray_CDD_cC(void);
\r
101 PICO_INTERNAL int Open_Tray_CDD_cD(void);
\r
103 PICO_INTERNAL int CDD_Def(void);
\r