Commit 2892d29

Nick Faro committed on
Add coffee's UGE file format spec
commit 2892d2930656e4457d76cb8ef545f0c9cfceff6b parent c422a2f
3 changed files +153−6
Modifiedmanual/src/SUMMARY.md +1−0
@@ -20,6 +20,7 @@
20 - [Hotkeys](hUGETracker/hotkeys.md) 20 - [Hotkeys](hUGETracker/hotkeys.md)
21 - [Subpatterns](hUGETracker/subpatterns.md) 21 - [Subpatterns](hUGETracker/subpatterns.md)
22 - [Routines](hUGETracker/routines.md) 22 - [Routines](hUGETracker/routines.md)
23 - [UGE file format](hUGETracker/uge-format.md)
23 - [Miscellaneous](hUGETracker/miscellaneous.md) 24 - [Miscellaneous](hUGETracker/miscellaneous.md)
24 25
25 # hUGEDriver 26 # hUGEDriver
Modifiedmanual/src/hUGETracker/miscellaneous.md +0−6
@@ -11,9 +11,3 @@ Note that the effects are not converted when pasted, so you'll need to manually
11 ![Screenshot of the clipboard format of hUGETracker and ModPlug](../img/clipboards.png) 11 ![Screenshot of the clipboard format of hUGETracker and ModPlug](../img/clipboards.png)
12 12
13 ![Screenshot of the same clipboards, pasted into hUGETracker and ModPlug](../img/pasted.png) 13 ![Screenshot of the same clipboards, pasted into hUGETracker and ModPlug](../img/pasted.png)
14
15 ## File format
16
17 The hUGETracker file format is very simple; the reading/writing code [can be found here](https://github.com/SuperDisk/hUGETracker/blob/hUGETracker/src/song.pas).
18
19 The file format might change to an NBT-, JSON-, or XML-based format in the future.
Addedmanual/src/hUGETracker/uge-format.md +152−0
@@ -0,0 +1,152 @@
1 # hUGETracker .UGE v5/v6 format spec
2 ## Data types
3
4 | Name | Byte length | Description |
5 |---------------|-------------|--------------------------------------------------------------------------|
6 | `uint8` | 1 | Also known as char, ranges from 0 to 255. |
7 | `uint32` | 4 | Also known as word, ranges from 0 to 4,294,967,295. |
8 | `int8` | 1 | Ranges from -127 to 127. |
9 | `bool` | 1 | If not-zero, then True. |
10 | `shortstring` | 256 | Consists of a byte defining the readable length and then 255 characters. |
11 | `string` | - | A stream of characters, with 0x00 being the terminator value. |
12
13 All types are little endian unless noted otherwise.
14
15 ## Header
16 - `uint32` Version number
17 - `shortstring` Song name
18 - `shortstring` Song artist
19 - `shortstring` Song comment
20
21 ## Duty Instruments
22
23 - Repeat 15 times:
24 - `uint32` Type (0)
25 - `shortstring` Instrument name
26 - `uint32` Length
27 - `bool` Length enabled
28 - `uint8` Initial volume
29 - `uint32` Volume sweep direction (0 = Increase, 1 = Decrease)
30 - `uint8` Volume sweep change
31 - `uint32` Frequency sweep time
32 - `uint32` Sweep enabled (1 = Enabled, 0 = Disabled)
33 - `uint32` Frequency sweep shift
34 - `uint8` Duty cycle
35 - `uint32` Unused
36 - `uint32` Unused
37 - If `Version number` < 6:
38 - `uint32` Unused
39 - `uint32` Unused
40 - If `Version number` < 6:
41 - `uint32` Unused
42 - Else:
43 - `bool` Subpattern enabled
44 - Repeat 64 times:
45 - `uint32` Row note (0 through 72, 90 if not used)
46 - `uint32` Unused
47 - `uint32` Jump command value (0 if empty)
48 - `uint32` Effect code
49 - `uint8` Effect parameter
50 - If `Version number` >= 4 and `Version number` < 6:
51 - Repeat 6 times:
52 - `int8` unused
53
54 ## Wave Instruments
55
56 - Repeat 15 times:
57 - `uint32` Type (1)
58 - `shortstring` Instrument name
59 - `uint32` Length
60 - `bool` Length enabled
61 - `uint8` Unused
62 - `uint32` Unused
63 - `uint8` Unused
64 - `uint32` Unused
65 - `uint32` Unused
66 - `uint32` Unused
67 - `uint8` Unused
68 - `uint32` Volume
69 - `uint32` Wave index
70 - If `Version number` < 6:
71 - `uint32` Unused
72 - `uint32` Unused
73 - If `Version number` < 6:
74 - `uint32` Unused
75 - Else:
76 - `bool` Subpattern enabled
77 - Repeat 64 times:
78 - `uint32` Row note (0 through 72, 90 if not used)
79 - `uint32` Unused
80 - `uint32` Jump command value (0 if empty)
81 - `uint32` Effect code
82 - `uint8` Effect parameter
83 - If `Version number` >= 4 and `Version number` < 6:
84 - Repeat 6 times:
85 - `int8` Unused
86
87 ## Noise Instruments
88
89 - Repeat 15 times:
90 - `uint32` Type (2)
91 - `shortstring` Instrument name
92 - `uint32` Length
93 - `bool` Length enabled
94 - `uint8` Initial volume
95 - `uint32` Volume sweep direction (0 = Increase, 1 = Decrease)
96 - `uint8` Volume sweep change
97 - `uint32` Unused
98 - `uint32` Unused
99 - `uint32` Unused
100 - `uint8` Unused
101 - `uint32` Unused
102 - `uint32` Unused
103 - If `Version number` < 6:
104 - `uint32` Unused
105 - `uint32` Noise mode (0 = 15 bit, 1 = 7 bit)
106 - If `Version number` < 6:
107 - `uint32` Unused
108 - Else:
109 - `bool` Subpattern enabled
110 - Repeat 64 times:
111 - `uint32` Row note (0 through 72, 90 if not used)
112 - `uint32` Unused
113 - `uint32` Jump command value (0 if empty)
114 - `uint32` Effect code
115 - `uint8` Effect parameter
116 - If `Version number` >= 4 and `Version number` < 6:
117 - Repeat 6 times:
118 - `int8` Noise macro data
119
120 ## Wavetable data
121 - Repeat 16 times:
122 - Repeat 32 times:
123 - `uint8` Wavetable nibble data
124 - If `Version Number` < 3:
125 - `uint8` Off by one filler
126
127 ## Song Patterns
128 - `uint32` Initial ticks per row
129 - If `Version number` >= 6:
130 - `bool` Timer based tempo enabled
131 - `uint32` Timer based tempo devider
132 - `uint32` Number of song patterns
133 - Repeat `Number of song patterns` times:
134 - `uint32` Pattern index
135 - Repeat 64 times:
136 - `uint32` Row note (0 through 72, 90 if not used)
137 - `uint32` Instrument value (0 if not used)
138 - If `Version number` >= 6:
139 - `uint32` Unused
140 - `uint32` Effect code
141 - `uint8` Effect parameter
142
143 ## Song Orders
144 - Repeat 4 times (Duty 1, Duty 2, Wave, Noise):
145 - `uint32` Order length + 1 (Off by one bug)
146 - Repeat `Order length` times:
147 - `uint32` Order index
148 - `uint32` Off by one bug filler (0)
149
150 ## Routines
151 - Repeat 16 times:
152 - `string` Routine code data