Hobets file format
ZXNet echo conference «zx.spectrum»
From Ilya Zverev → To All 29 October 1997
¥ [”] èءہغثة, All! ¨
ïقإخط خصضإخ سءآض, pls.
[Team Win95-Suxx] [Team Pascal] ًةسطحد ةسذدpشةج Ilya
[Team نءإغط CD ذد 5 شظp! ] [Team ZX - rulez]
... Hد×ةخثء - Microsoft Sux for Windows 95! (c)خإ حدت
From Alexei Bugai → To All 31 October 1997
Peace unto you, _Ilya_!
29 Oct 97 Ilya Zverev write to All about "hobeta file format":
IZ> The subject is really needed, pls.
== Cut ==
Structure of the 17-byte header added to TR-DOS
files by the HoBeta.exe program:
00-07 - name file
08 - file type
09-0A - Start
0B-0C - Length
0D-0E - Length in 256-byte records (byte 0E - size in sectors)
0F-10 - Checksum
Thus, the first 14 bytes are copied from the TR-DOS directory.
Calculation of the checksum sums: S=S+257*Di+i, where
S initial=0
Di - byte value
i - byte sequence number (if I’m not mistaken, starting from 0, not 1)
C src:
union {
struct {
unsigned char tr_filename[8];
unsigned char tr_filetype;
unsigned int tr_address;
unsigned int tr_length;
unsigned int tr_tr;
unsigned int tr_crc;
} tr_head;
unsigned char head[17];
} header;
unsigned int CheckSum;
int i;
CheckSum=0;
for (i=0; i<=14; CheckSum = CheckSum + (header.head[i] * 257) + i, i++);
header.tr_head.tr_crc = CheckSum;
In one of my programs I found such a funny way to calculate
the header checksum:
checksum=0;
for (i=0; i<=14; checksum+=(unsigned) char)*(bufptr+i), i++);
checksum*=257;
checksum+=105;
bufptr, obviously, a pointer to the beginning of the header.
=== Cut===
With best wishes, [ZX_Power Team]
Dr.Squizer. [Power_ZX Team]
... Don't try to understand me... You never will!