-
Notifications
You must be signed in to change notification settings - Fork 1
/
module.h
59 lines (49 loc) · 1.3 KB
/
module.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#pragma once
#include "common.h"
#define kModTitleMaxLen 20
#define kSampleNameMaxLen 22
#define kNumPatternsMax 100
#define kNumSamplesMax 31
#define kSongMaxLen 0x80
#define kDivsPerPattern 0x40
typedef struct {
UBYTE title[kModTitleMaxLen];
struct {
UBYTE name[kSampleNameMaxLen];
UWORD length_w;
UBYTE finetune;
UBYTE volume;
UWORD loop_start_w;
UWORD loop_length_w;
} sample_info[kNumSamplesMax];
UBYTE pat_tbl_size;
UBYTE unused;
UBYTE pat_tbl[kSongMaxLen];
ULONG tracker_id;
} ModuleHeader;
typedef struct {
ULONG sample_hi:4;
ULONG parameter:12;
ULONG sample_lo:4;
ULONG effect:12;
} PatternCommand;
typedef struct {
PatternCommand commands[4];
} PatternDivision;
typedef struct {
PatternDivision divisions[kDivsPerPattern];
} Pattern;
typedef struct {
ModuleHeader header;
Pattern patterns[];
} ModuleNonChip;
extern void module_open(STRPTR dir_path,
STRPTR file_name);
extern void module_close();
extern BOOL module_is_open();
extern Status module_load_header(); // StatusError, StatusInvalidMod
extern Status module_load_all(); // StatusError, StatusInvalidMod, StatusOutOfMemory
extern ModuleHeader* module_header();
extern UWORD module_num_patterns();
extern ModuleNonChip* module_nonchip();
extern APTR module_samples();