CPCWiki forum

General Category => Applications (CPC and CPC-related) => Topic started by: arnoldemu on 21:23, 21 September 10

Title: addhead
Post by: arnoldemu on 21:23, 21 September 10
My "addhead" tool has been updated.

http://www.cpctech.org.uk/download/addhead.zip

As well as adding or removing an amsdos header from a file, you can also now check if a file exceeds a maximum memory address, useful if you want to limit the length of the file.

addhead -c <max address> <file>

You can use -s to override start address (if the file has header), or to set start if the file doesn't have a header.
If file has header you can use -h to use length from header otherwise length of file on filesystem is used.
If file doesn't have a header length on filesystem is used.

I use this tool when I make my games.
Title: Re: addhead
Post by: TFM on 00:50, 22 September 10
For removing headers I use a hex editor :-) But adding one it a good idea ;-)

Does it support FutureOS headers?

Title: Re: addhead
Post by: arnoldemu on 09:13, 22 September 10
Quote from: TFM/FS on 00:50, 22 September 10
For removing headers I use a hex editor :-) But adding one it a good idea ;-)

Does it support FutureOS headers?
no it doesn't.

But it could ;)
Title: Re: addhead
Post by: TFM on 16:11, 22 September 10
Quote from: arnoldemu on 09:13, 22 September 10
no it doesn't.

But it could ;)

That sounds promising... let me provide some basic informations... and if you like to add these featrues, don't hesitate to ask for details. Here is an overview about Amsdos and FutureOS headers:

 

Construction of a 128 byte file-header under Amsdos and FutureOS
----------------------------------------------------------------




AMSDOS:
=======
    0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
00 UU N0 N1 N2 N3 N4 N5 N6  N7 E0 E1 E2 00 00 00 00 - User, Name, Ext.
10 00 00 TY 00 00 SL SH 00  LL LH AL AH 00 00 00 00 - Typ,St.,Len,A.St
20 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00 - unused
30 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00 - unused
40 LL LH 00 CL CH ?? ?? ??  ?? ?? ?? ?? ?? ?? ?? ?? - Lenght, Checksum
50 ?? ?? ?? ?? ?? ?? ?? ??  ?? ?? ?? ?? ?? ?? ?? ?? - not defined
60 ?? ?? ?? ?? ?? ?? ?? ??  ?? ?? ?? ?? ?? ?? ?? ?? - not defined
70 ?? ?? ?? ?? ?? ?? ?? ??  ?? ?? ?? ?? ?? ?? ?? ?? - not defined
Abbreviations: Typ = file-type, St = Start-/Load-Address,
Len = file-length and A.St = Auto-Start-Address. L = low, H = high.
   

Under Future OS a file-header is expanded. The bytes which are defined
by AMSDOS keep their function. But all other bytes are used too.







FutureOS:
=========
    0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
00 UU N0 N1 N2 N3 N4 N5 N6  N7 E0 E1 E2 I0 I1 I2 I3 - User, Name, Ext.
10 I4 I5 TT XX YY SL SH SB  LL LH AL AH OL AB I6 I7 - Typ,X,Y,St,L,ASt
20 I8 I9 IA IB IC ID IE IF  I0 I1 I2 I3 I4 I5 I6 I7 - Icon-data 08-17
30 I8 I9 IA IB IC ID IE IF  I0 I1 I2 I3 I4 I5 I6 I7 - Icon-data 18-27
40 LL LH IT PL PH I8 I9 IA  IB IC ID IE IF I0 I1 I2 - Len,IcoTyp,PrSm.
50 I3 I4 I5 I6 I7 I8 I9 IA  IB IC ID IE IF I0 I1 I2 - Icon-data 33-42
60 I3 I4 I5 I6 I7 I8 I9 IA  IB IC ID IE IF I0 I1 I2 - Icon-data 43-52
70 I3 I4 I5 I6 I7 I8 I9 IA  IB IC ID IE IF I0 I1 I2 - Icon-data 53-62



FutureOS - 128 byte file-header, byte by byte:
----------------------------------------------


Byte(s) ! meaning, function
--------!----------------------------
     00 ! Usernumber of file &00..&FE, don't use &E5 or &FF!
01 - 08 ! Filename (8 bytes)
09 - 0B ! Extent (3 bytes)
0C - 11 ! I00 to I05 (6 bytes) icon-data
     12 ! Filetype: &00 = basic, &02 = binary, &0A = Prowort
        ! Protected files: add &01, example: &01 = protected basic
        ! FutureOS files: add &80, 8. bit is set
     13 ! Horizontal range or X-width for semi-graphic-icon
     14 ! Vertical range or Y-lines for semi-graphic-icon
15 - 16 ! Low, High-byte start/load-address of file
     17 ! Physical RAM-block of start/load address: &C0,&C4,&C5-&FF
18 - 19 ! Low, High-byte file-length (first 16 bit)
1A - 1B ! Low, High-byte auto-start-address, else &0000
     1C ! Over-byte of file-length ==> file-length up to 16 MB
     1D ! Physical RAM-block of auto-start-address: &C0,&C4,&C5-&FF
1E - 3F ! I06 to I27 (34 bytes) icon-data
40 - 41 ! Repeat of L, H-byte file-length, but NOT USED!
     42 ! Icon-type: text-, graphic- or semi-graphic icon
43 - 44 ! Low, High-byte checksum of this file-header
45 - 7F ! I28 to I62 (59 bytes) icon-data
--------!----------------------------------


Such a header contains  &63  =  99  byte icon-data. The icon-type-byte
(&42) decides which kind of icon the file-header contains. This can be
a graphic icon with 4 * 3  or  6  *  2 chars, a semi-graphic-icon or a
text-icon. The're four different icon-types.  All  icons must be shown
in screen mode 1 with 32 chars and 32 lines.
If the icon is  a  text-icon  (icon-type  is  &00),  the text can give
informatinos about the contents of the file or what ever.
A semi-graphic-icon (type &02)  contains  text  in  its icon-data too.
These chars are displayd as  an  ASCII-rectangle. The header-bytes &13
and &14 contain the rectangles X and Y range. But X * Y must be < &64.
Text and semi-grafic icons can  contain  all  256 chars. All chars are
displayd as chars and NOT as control codes. The difference is that the
text of a text-icon is  displayd  as  one string, whereas a semigrafic
icon is a rectangle made of chars.
The true graphic icons contain  only  screen mode 1 graphic-data. They
can have the format of 2 * 3 (type &01) or 3 * 2 (type &03) chars.
Therefore a graphic-icon uses only 4 * 3  *  8 = 96 bytes from the 99.
The remaining three bytes can be used freely.


Title: Re: addhead
Post by: TFM on 18:37, 06 October 10
@Arnoldemu: Is it a good or a bad sign if you don't answer (immediately)?
Title: Re: addhead
Post by: redbox on 20:22, 06 October 10
Quote from: TFM/FS on 18:37, 06 October 10
@Arnoldemu: Is it a good or a bad sign if you don't answer (immediately)?

Obviously he has been too busy writing uber-fast Plus sprite routines to worry about FutureOS headers for now  ;)
Title: Re: addhead
Post by: TFM on 21:15, 06 October 10
Quote from: redbox on 20:22, 06 October 10
Obviously he has been too busy writing uber-fast Plus sprite routines to worry about FutureOS headers for now  ;)


Obviously he is busy integrating FutureOS file headers into his great application  ;)  (you know, hope dies last)
Title: Re: addhead
Post by: arnoldemu on 09:27, 07 October 10
Quote from: TFM/FS on 18:37, 06 October 10
@Arnoldemu: Is it a good or a bad sign if you don't answer (immediately)?
Neither good or bad.

I've read over the information, I understand it, and I will implement it, but at this time I have not done anything with the information.
(Blue Angel 69 is finished now I think, just one last thing to test).
Title: Re: addhead
Post by: TFM on 18:42, 07 October 10
Quote from: arnoldemu on 09:27, 07 October 10
I've read over the information, I understand it, and I will implement it, but at this time I have not done anything with the information.

Take you time, if you need more informations or what ever don't hesitate to tell me.

Title: Re: addhead
Post by: arnoldemu on 10:41, 20 December 10
Quote from: TFM/FS on 18:42, 07 October 10

Take you time, if you need more informations or what ever don't hesitate to tell me.
I haven't implemented futureos header yet, but I fixed some bugs.
I did not set basic file type correctly, and also it ignored any file type, start and execution that you forced.

Now this works
Title: Re: addhead
Post by: GUNHED on 12:08, 26 May 20
Hi Arnie, is there any update to this interesting project?
Powered by SMFPacks Menu Editor Mod