@@ -97,11 +97,7 @@ func decodeBlock(d *decode.D) {
9797 length := d .FieldU24 ("length" ) // Length of data that follows
9898
9999 // Data as in .TAP files
100- d .FieldArray ("data" , func (d * decode.D ) {
101- for i := uint64 (0 ); i < length ; i ++ {
102- d .FieldU8 ("byte" )
103- }
104- })
100+ d .FieldRawLen ("data" , int64 (length )* 8 )
105101 },
106102
107103 // ID: 12h (18d) | Pure Tone
@@ -135,11 +131,7 @@ func decodeBlock(d *decode.D) {
135131 length := d .FieldU24 ("length" ) // Length of data that follows
136132
137133 // Data as in .TAP files
138- d .FieldArray ("data" , func (d * decode.D ) {
139- for i := uint64 (0 ); i < length ; i ++ {
140- d .FieldU8 ("byte" )
141- }
142- })
134+ d .FieldRawLen ("data" , int64 (length )* 8 )
143135 },
144136
145137 // ID: 15h (21d) | Direct Recording
@@ -151,17 +143,11 @@ func decodeBlock(d *decode.D) {
151143 // The preferred sampling frequencies are 22050 or 44100 Hz
152144 // (158 or 79 T-states/sample).
153145 0x15 : func (d * decode.D ) {
154- d .FieldU16 ("t_states" ) // Number of T-states per sample (bit of data)
155- d .FieldU16 ("pause" ) // Pause after this block in milliseconds (ms.)
156- d .FieldU8 ("used_bits" ) // Used bits (samples) in last byte of data (1-8)
157- length := d .FieldU24 ("length" ) // Length of data that follows
158-
159- // Samples data. Each bit represents a state on the EAR port
160- d .FieldArray ("data" , func (d * decode.D ) {
161- for i := uint64 (0 ); i < length ; i ++ {
162- d .FieldU8 ("byte" )
163- }
164- })
146+ d .FieldU16 ("t_states" ) // Number of T-states per sample (bit of data)
147+ d .FieldU16 ("pause" ) // Pause after this block in milliseconds (ms.)
148+ d .FieldU8 ("used_bits" ) // Used bits (samples) in last byte of data (1-8)
149+ length := d .FieldU24 ("length" ) // Length of data that follows
150+ d .FieldRawLen ("data" , int64 (length )* 8 ) // Samples data. Each bit represents a state on the EAR port
165151 },
166152
167153 // ID: 18h (24d) | CSW Recording
@@ -184,11 +170,7 @@ func decodeBlock(d *decode.D) {
184170 d .FieldU32 ("stored_pulse_count" )
185171
186172 // CSW data, encoded according to the CSW specification
187- d .FieldArray ("data" , func (d * decode.D ) {
188- for i := uint64 (0 ); i < length ; i ++ {
189- d .FieldU8 ("byte" )
190- }
191- })
173+ d .FieldRawLen ("data" , int64 (length )* 8 )
192174 },
193175
194176 // ID: 19h (25d) | Generalized Data
@@ -212,11 +194,7 @@ func decodeBlock(d *decode.D) {
212194 // PilotStreams []PilotRLE // 0x12+ (2*NPP+1)*ASP - PRLE[TOTP] Pilot and sync data stream
213195 // DataSymbols []Symbol // 0x12+ (TOTP>0)*((2*NPP+1)*ASP)+TOTP*3 - SYMDEF[ASD] Data symbols definition table
214196 // DataStreams []uint8 // 0x12+ (TOTP>0)*((2*NPP+1)*ASP)+ TOTP*3+(2*NPD+1)*ASD - BYTE[DS] Data stream
215- d .FieldArray ("data" , func (d * decode.D ) {
216- for i := uint64 (0 ); i < length ; i ++ {
217- d .FieldU8 ("byte" )
218- }
219- })
197+ d .FieldRawLen ("data" , int64 (length )* 8 )
220198 },
221199
222200 // ID: 20h (32d) | Pause Tape Command
@@ -409,13 +387,9 @@ func decodeBlock(d *decode.D) {
409387 // some information written by a utility, extra settings required by a
410388 // particular emulator, etc.
411389 0x35 : func (d * decode.D ) {
412- d .FieldStr ("identification" , 10 , charmap .ISO8859_1 )
390+ d .FieldStr ("identification" , 16 , charmap .ISO8859_1 )
413391 length := d .FieldU32 ("length" )
414- d .FieldArray ("info" , func (d * decode.D ) {
415- for i := uint64 (0 ); i < length ; i ++ {
416- d .FieldU8 ("byte" )
417- }
418- })
392+ d .FieldRawLen ("info" , int64 (length )* 8 )
419393 },
420394
421395 // ID: 5Ah (90d) | Glue Block
0 commit comments