Mercurial > hg > sidinfo
comparison sidlib.h @ 220:e79a93971d27
Cosmetic reorganization.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 27 Dec 2019 11:06:55 +0200 |
parents | 98563979859b |
children | 8db9830e5d97 |
comparison
equal
deleted
inserted
replaced
219:d4246534daad | 220:e79a93971d27 |
---|---|
14 #ifdef __cplusplus | 14 #ifdef __cplusplus |
15 extern "C" { | 15 extern "C" { |
16 #endif | 16 #endif |
17 | 17 |
18 | 18 |
19 // | |
19 // Some constants | 20 // Some constants |
21 // | |
20 #define PSID_MAGIC_LEN 4 | 22 #define PSID_MAGIC_LEN 4 |
21 #define PSID_STR_LEN 32 | 23 #define PSID_STR_LEN 32 |
22 #define PSID_BUFFER_SIZE (1024 * 16) | 24 #define PSID_BUFFER_SIZE (1024 * 16) |
23 | 25 |
24 | 26 |
27 enum | |
28 { | |
29 // Player flags | |
30 PSF_PLAYER_TYPE = 0x01, // 0 = built-in, 1 = Compute! SIDPlayer MUS | |
31 PSF_PLAYSID_TUNE = 0x02, // 0 = Real C64-compatible, 1 = PlaySID specific (v2NG) | |
32 | |
33 // Video standard used (v2NG+) | |
34 PSF_CLOCK_UNKNOWN = 0x00, | |
35 PSF_CLOCK_PAL = 0x01, | |
36 PSF_CLOCK_NTSC = 0x02, | |
37 PSF_CLOCK_ANY = 0x03, | |
38 PSF_CLOCK_MASK = 0x03, | |
39 | |
40 // SID model (v2NG+) | |
41 PSF_MODEL_UNKNOWN = 0x00, | |
42 PSF_MODEL_MOS6581 = 0x01, | |
43 PSF_MODEL_MOS8580 = 0x02, | |
44 PSF_MODEL_ANY = 0x03, | |
45 PSF_MODEL_MASK = 0x03, | |
46 }; | |
47 | |
48 | |
49 // | |
50 // Structures | |
51 // | |
25 typedef struct _SIDLibSLDBNode | 52 typedef struct _SIDLibSLDBNode |
26 { | 53 { |
27 th_md5hash_t hash; // MD5 hash-digest | 54 th_md5hash_t hash; // MD5 hash-digest |
28 int nlengths; // Number of lengths | 55 int nlengths; // Number of lengths |
29 int *lengths; // Lengths in seconds | 56 int *lengths; // Lengths in seconds |
68 SIDLibSLDBNode *lengths; // Songlength information node pointer | 95 SIDLibSLDBNode *lengths; // Songlength information node pointer |
69 | 96 |
70 } PSIDHeader; | 97 } PSIDHeader; |
71 | 98 |
72 | 99 |
73 enum | |
74 { | |
75 PSF_PLAYER_TYPE = 0x01, // 0 = built-in, 1 = Compute! SIDPlayer MUS | |
76 PSF_PLAYSID_TUNE = 0x02, // 0 = Real C64-compatible, 1 = PlaySID specific (v2NG) | |
77 | |
78 PSF_CLOCK_UNKNOWN = 0x00, // Video standard used (v2NG+) | |
79 PSF_CLOCK_PAL = 0x01, | |
80 PSF_CLOCK_NTSC = 0x02, | |
81 PSF_CLOCK_ANY = 0x03, | |
82 PSF_CLOCK_MASK = 0x03, | |
83 | |
84 PSF_MODEL_UNKNOWN = 0x00, // SID model (v2NG+) | |
85 PSF_MODEL_MOS6581 = 0x01, | |
86 PSF_MODEL_MOS8580 = 0x02, | |
87 PSF_MODEL_ANY = 0x03, | |
88 PSF_MODEL_MASK = 0x03, | |
89 }; | |
90 | |
91 | |
92 // | 100 // |
93 // Functions | 101 // Functions |
94 // | 102 // |
95 BOOL si_read_sid_file(th_ioctx *ctx, PSIDHeader **ppsid, const BOOL newSLDB); | 103 BOOL si_read_sid_file(th_ioctx *ctx, PSIDHeader **ppsid, const BOOL newSLDB); |
96 void si_free_sid_file(PSIDHeader *psid); | 104 void si_free_sid_file(PSIDHeader *psid); |
97 | 105 |
98 const char * si_get_sid_clock_str(const int flags); | 106 const char * si_get_sid_clock_str(const int flags); |
99 const char * si_get_sid_model_str(const int flags); | 107 const char * si_get_sid_model_str(const int flags); |
100 | 108 |
101 SIDLibSLDB * si_sldb_new(void); | 109 SIDLibSLDB * si_sldb_new(void); |
102 int si_sldb_read(th_ioctx *ctx, SIDLibSLDB *dbh); | 110 int si_sldb_read(th_ioctx *ctx, SIDLibSLDB *dbh); |
103 int si_sldb_build_index(SIDLibSLDB *dbh); | 111 int si_sldb_build_index(SIDLibSLDB *dbh); |
104 void si_sldb_free(SIDLibSLDB *dbh); | 112 void si_sldb_free(SIDLibSLDB *dbh); |
105 SIDLibSLDBNode *si_sldb_get_by_hash(SIDLibSLDB *dbh, th_md5hash_t hash); | 113 SIDLibSLDBNode * si_sldb_get_by_hash(SIDLibSLDB *dbh, th_md5hash_t hash); |
106 | 114 |
107 int si_sldb_read_bin(th_ioctx *ctx, SIDLibSLDB *dbh); | 115 int si_sldb_read_bin(th_ioctx *ctx, SIDLibSLDB *dbh); |
108 int si_sldb_write_bin(th_ioctx *ctx, SIDLibSLDB *dbh); | 116 int si_sldb_write_bin(th_ioctx *ctx, SIDLibSLDB *dbh); |
109 | 117 |
110 | 118 |
111 #ifdef __cplusplus | 119 #ifdef __cplusplus |
112 } | 120 } |
113 #endif | 121 #endif |