1 #ifndef _neocdlist_
2 #define _neocdlist_
3 
4 struct NGCDGAME
5 {
6 	TCHAR*	pszName;		// Short name
7 	TCHAR*	pszTitle;		// Title
8 	TCHAR*	pszYear;		// Release Year
9 	TCHAR*	pszCompany;		// Developer
10 	unsigned int id;				// Game ID
11 };
12 
13 NGCDGAME*	GetNeoGeoCDInfo(unsigned int nID);
14 int			GetNeoCDTitle(unsigned int nGameID);
15 int			GetNeoGeoCD_Identifier();
16 
17 bool	IsNeoGeoCD();		// neo_run.cpp
18 TCHAR*	GetIsoPath();	// cd_isowav.cpp
19 
20 int		NeoCDInfo_Init();
21 TCHAR*	NeoCDInfo_Text(int nText);
22 int		NeoCDInfo_ID();
23 void    NeoCDInfo_SetTitle();
24 void	NeoCDInfo_Exit();
25 
26 // ------------------------------------------------------
27 // ISO9660 STUFF
28 
29 // ISO9660 date and time
30 struct iso9660_date
31 {
32 	unsigned char Year;		// Number of year since 1900
33 	unsigned char Month;	// Month (1 to 12)
34 	unsigned char Day;		// Day (1 to 31)
35 	unsigned char Hour;		// Hour (0 to 23)
36 	unsigned char Minute;	// Minute (0 to 59)
37 	unsigned char Second;	// Second (0 to 59)
38 	unsigned char Zone;		// Offset related to GMT, by 15-min interval (from -48 to +52)
39 };
40 
41 // ISO9660 BCD date and time
42 struct iso9660_bcd_date
43 {
44 	unsigned char Year[4];
45     unsigned char Month[2];
46     unsigned char Day[2];
47     unsigned char Hour[2];
48     unsigned char Minute[2];
49     unsigned char Second[2];
50 	unsigned char SecFrac[2];
51     char Zone;
52 };
53 
54 struct iso9660_DirectoryRecord
55 {
56     unsigned char len_dr;					// [1] Length of Directory Record (bytes)
57     unsigned char ext_attr_rec_len;			// [1] Extended Attribute Record Length (bytes)
58     unsigned char location_of_extent[8];	// [8] [LEF / BEF] LBN / Sector location of the file data
59     unsigned char data_lenth[8];			// [8] [LEF / BEF] Length of the file section (bytes)
60 	iso9660_date rec_date_time;				// [7] Recording Date and Time
61 	unsigned char file_flags;				// [1] 8-bit flags
62 												// [bit 0] File is Hidden if this bit is 1
63 												// [bit 1] Entry is a Directory if this bit is 1
64 												// [bit 2] Entry is an Associated file is this bit is 1
65 												// [bit 3] Information is structured according to the extended attribute record if this bit is 1
66 												// [bit 4] Owner, group and permissions are specified in the extended attribute record if this bit is 1
67 												// [bit 5] Reserved (0)
68 												// [bit 6] Reserved (0)
69 												// [bit 7] File has more than one directory record if this bit is 1
70 	unsigned char file_unit_size;			// [1] This field is only valid if the file is recorded in interleave mode, otherwise this field is (00)
71     unsigned char int_gap_size;				// [1] This field is only valid if the file is recorded in interleave mode, otherwise this field is (00)
72    	unsigned char vol_seq_number[4];		// [4] The ordinal number of the volume in the Volume Set on which the file described by the directory record is recorded.
73     unsigned char len_fi;					// [1] Length of File Identifier (LEN_FI)
74     char* file_id;							// [LEN_FI] File Identifier
75 };
76 
77 struct iso9660_PathTableRecord
78 {
79 	unsigned char len_di;					// [1] Length of Directory Identifier
80 	unsigned char extended_attr_len;		// [1] Extended Attribute Record Length
81 	unsigned char extent_location[4];		// [4] Extent Location (Sector)
82 	unsigned char parent_dir_num;			// [1] Parent Directory Number
83 	char* directory_id;						// [LEN_DI] Directory Identifier
84 };
85 
86 // Volume Descriptor Header (Sector 16)
87 struct iso9660_VDH
88 {
89 	char vdtype;	// [1] Volume Descriptor Type
90 	unsigned char stdid[5];	// [5] ISO9660 Standard Identifier
91 	char vdver;		// [1] Volume Descriptor Version
92 };
93 
94 // Primary Volume Descriptor (Volume Descriptor Type 1)
95 struct iso9660_PVD
96 {
97 	// -----------------------------
98 	// Volume Descriptor Header
99 	char type;
100 	unsigned char id[5];
101 	char version;
102 	// -----------------------------
103 	// Primary Volume Descriptor
104 	char unused1;
105 	unsigned char system_id[32];
106 	unsigned char volume_id[32];
107 	unsigned char unused2[8];
108 	unsigned char volume_space_size[8];
109 	unsigned char unused3[32];
110 	unsigned char volume_set_size[4];
111 	unsigned char volume_sequence_number[4];
112 	unsigned char logical_block_size[4];
113 	unsigned char path_table_size[8];
114 	unsigned char type_l_path_table[4];
115 	unsigned char opt_type_l_path_table[4];
116 	unsigned char type_m_path_table[4];
117 	unsigned char opt_type_m_path_table[4];
118 	iso9660_DirectoryRecord root_directory_record;
119 	unsigned char volume_set_id[128];
120 	unsigned char publisher_id[128];
121 	unsigned char preparer_id[128];
122 	unsigned char application_id[128];
123 	unsigned char copyright_file_id[37];
124 	unsigned char abstract_file_id[37];
125 	unsigned char bibliographic_file_id[37];
126 
127 	iso9660_bcd_date creation_date;		// [17]
128 	iso9660_bcd_date modification_date;	// [17]
129 	iso9660_bcd_date expiration_date;	// [17]
130 	iso9660_bcd_date effective_date;	// [17]
131 
132 	char file_structure_version;
133 	char unused4;
134 	unsigned char application_data[512];
135 	unsigned char unused5[643];
136 };
137 
138 void iso9660_ReadOffset(unsigned char *Dest, FILE* fp, unsigned int lOffset, unsigned int lSize, unsigned int lLength);
139 
140 // ------------------------------------------------------
141 
142 
143 #endif
144