I need to create Datatype descriptor which relies on a function to indentify the file being opened.
DTDesc from teh DevCD DSIs for me (when loading an existing descriptor anyway).
I doenloaded dtmake from aminet and those tools can read "disassemble" and create the new descriptor, but I'm unsure of how to compile the function element so that it works.
On OS4 can it be PPC or 68k code or either?
The original I'm upgrading was 68k so I compiled the fixed (I hope) code with m68k-amigaos- ggc but the resultant descriptor crashes.
Comparing with the original it looks like gcc has placed the strings before the function so that it's not the first thing in the linked object.
My options were
m68k-amigaos-gcc -nostartfiles -nostdlib -noixemul desc_func.c -o DT.drec
Sun, 2016-04-17 23:56
#1
Creating datatypes descriptor and compiing the Function
I must confess I don't understand this whole datatypes function business. The wiki says, "A Function is a stand-alone executable", which must be compiled as salass00 has explained above. But where is the executable supposed to be placed on disk, and how is it referred to by the descriptor?
@trixie >
The old "DTDesc" utility from the OS3 developer CD's might have crashed for broadblues when loading an existing descriptor but it does work to create a descriptor from example files. When I used it to create a new descriptor for example 8SVX files and added a function, it embedded the function in the descriptor. The function I used to create the descriptor was just an old OS3 (68k) AmigaDOS command which would not actually work but it was embedded in the descriptor produced by "DTDesc".
@trixie
You're not supposed to install the executable anywhere. You just reference it from your #?.desc file which you then pass to dtdesc or MakeDT.rexx to generate the descriptor file.
The MakeDT.rexx script and dtdesc store the executable inside an IFF chunk in the descriptor file.
MakeDT.rexx is used to generate most, if not all of the AmigaOS 4.x datatype descriptors so that's the one I would recommend to use.
The MakeDT.rexx archive, which I linked above, also includes documentation on how you should write your .desc file.
@salass00, xenic
Thank you both. I had better find some time to update the relevant section in the Dev Wiki.