Unified · Split
| @@ -55,15 +55,16 @@ enum · 54 unmodified lines | ||
| 55 | 55 | #define MAX_SAMPLE_LEN 0x3FFFFFFF |
| 56 | 56 | #define PROG_NAME_STR "Fasttracker II clone" |
| 57 | 57 | |
| 58 | −/* Some of the following structs must be packed (e.g. not padded) since they | |
| 59 | −** are loaded directly into with fread and stuff. | |
| 58 | +/* Some of the following structs MUST be packed! | |
| 59 | +** Please do NOT edit these structs unless you | |
| 60 | +** absolutely know what you are doing! | |
| 60 | 61 | */ |
| 61 | 62 | |
| 62 | 63 | #ifdef _MSC_VER |
| 63 | 64 | #pragma pack(push) |
| 64 | 65 | #pragma pack(1) |
| 65 | 66 | #endif |
| 66 | −typedef struct songHeaderTyp_t // DO NOT TOUCH! | |
| 67 | +typedef struct songHeaderTyp_t | |
| 67 | 68 | { |
| 68 | 69 | char sig[17], name[21], progName[20]; |
| 69 | 70 | uint16_t ver; |
| @@ -76,7 +77,7 @@ __attribute__ ((packed)) · 6 unmodified lines | ||
| 76 | 77 | #endif |
| 77 | 78 | songHeaderTyp; |
| 78 | 79 | |
| 79 | −typedef struct patternHeaderTyp_t // DO NOT TOUCH! | |
| 80 | +typedef struct patternHeaderTyp_t | |
| 80 | 81 | { |
| 81 | 82 | int32_t patternHeaderSize; |
| 82 | 83 | uint8_t typ; |
| @@ -112,7 +113,7 @@ __attribute__ ((packed)) · 29 unmodified lines | ||
| 112 | 113 | #endif |
| 113 | 114 | songMOD31HeaderTyp; |
| 114 | 115 | |
| 115 | −typedef struct sampleHeaderTyp_t // DO NOT TOUCH! | |
| 116 | +typedef struct sampleHeaderTyp_t | |
| 116 | 117 | { |
| 117 | 118 | int32_t len, repS, repL; |
| 118 | 119 | uint8_t vol; |
| @@ -127,7 +128,7 @@ __attribute__ ((packed)) · 8 unmodified lines | ||
| 127 | 128 | #endif |
| 128 | 129 | sampleHeaderTyp; |
| 129 | 130 | |
| 130 | −typedef struct instrHeaderTyp_t // DO NOT TOUCH! | |
| 131 | +typedef struct instrHeaderTyp_t | |
| 131 | 132 | { |
| 132 | 133 | uint32_t instrSize; |
| 133 | 134 | char name[22]; |
| @@ -153,6 +154,29 @@ __attribute__ ((packed)) · 19 unmodified lines | ||
| 153 | 154 | #endif |
| 154 | 155 | instrHeaderTyp; |
| 155 | 156 | |
| 157 | +typedef struct tonTyp_t // must be packed on some systems, even though it consists of bytes only | |
| 158 | +{ | |
| 159 | + uint8_t ton, instr, vol, effTyp, eff; | |
| 160 | +} | |
| 161 | +#ifdef __GNUC__ | |
| 162 | +__attribute__ ((packed)) | |
| 163 | +#endif | |
| 164 | +tonTyp; | |
| 165 | + | |
| 166 | +typedef struct syncedChannel_t // used for audio/video sync queue (pack to save RAM) | |
| 167 | +{ | |
| 168 | + uint8_t status; | |
| 169 | + uint8_t pianoNoteNr; | |
| 170 | + uint8_t sampleNr, instrNr; | |
| 171 | + uint16_t smpStartPos; | |
| 172 | + uint8_t vol; | |
| 173 | + double dHz; | |
| 174 | +} | |
| 175 | +#ifdef __GNUC__ | |
| 176 | +__attribute__ ((packed)) | |
| 177 | +#endif | |
| 178 | +syncedChannel_t; | |
| 179 | + | |
| 156 | 180 | #ifdef _MSC_VER |
| 157 | 181 | #pragma pack(pop) |
| 158 | 182 | #endif |
| @@ -226,34 +250,6 @@ typedef struct songTyp_t · 67 unmodified lines | ||
| 226 | 250 | uint64_t musicTime64; |
| 227 | 251 | } songTyp; |
| 228 | 252 | |
| 229 | −typedef struct tonTyp_t | |
| 230 | −{ | |
| 231 | − uint8_t ton, instr, vol, effTyp, eff; | |
| 232 | −} tonTyp; | |
| 233 | − | |
| 234 | −#ifdef _MSC_VER | |
| 235 | −#pragma pack(push) | |
| 236 | −#pragma pack(1) | |
| 237 | −#endif | |
| 238 | − | |
| 239 | −typedef struct syncedChannel_t // used for audio/video sync queue | |
| 240 | −{ | |
| 241 | − uint8_t status; | |
| 242 | − uint8_t pianoNoteNr; | |
| 243 | − uint8_t sampleNr, instrNr; | |
| 244 | − uint16_t smpStartPos; | |
| 245 | − uint8_t vol; | |
| 246 | − double dHz; | |
| 247 | −} | |
| 248 | −#ifdef __GNUC__ | |
| 249 | −__attribute__ ((packed)) | |
| 250 | −#endif | |
| 251 | −syncedChannel_t; | |
| 252 | − | |
| 253 | −#ifdef _MSC_VER | |
| 254 | −#pragma pack(pop) | |
| 255 | −#endif | |
| 256 | − | |
| 257 | 253 | double getSampleC4Rate(sampleTyp *s); |
| 258 | 254 | |
| 259 | 255 | void setNewSongPos(int32_t pos); |