dt2iff

OlafS3 · 35059

miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #45 on: November 19, 2021, 09:25:23 AM
Here is the latest DTConv commandline application sources.

If you can use gcc for x86 or 68k it's easy to compile:

gcc dtconv.c -o DTConv

That produces the DTConv binary which you then copy to C.

use DTConv in a shell for best results. Don't forget README.



AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3762
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #46 on: November 19, 2021, 10:41:55 AM

If you can use gcc for x86 or 68k it's easy to compile:

gcc dtconv.c -o DTConv


I tried compile without succeeding, see screentot errors.
I tried it on AROS x86, but then if I can I would like to compile it for AROS 68k and Amiga 68k.


miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #47 on: November 19, 2021, 11:11:31 AM
Try this one.

I added a missing include and removed the print error.



AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3762
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #48 on: November 19, 2021, 11:42:43 AM
Tried but there are still errors :)


miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #49 on: November 19, 2021, 11:49:29 AM
Tried but there are still errors :)

Quick fix. Open the dtconv.c file in an editor with line numbers.

Go to line 253. Enter // in front of "fh = BNULL". So it now reads:
//fh = BNULL;
That will disable it. It's nice to set it to NULL but not needed.

In the next line you are setting fh equal. So it's ok to disable it.

On line 426 make it say:
if(error != OK) Printf("%s: Error!\n", progname);

Save the file and try again. Welcome to C programming.  :)

Or try the file I attached.
« Last Edit: November 19, 2021, 12:00:38 PM by miker1264 »



AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3762
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #50 on: November 19, 2021, 12:14:45 PM
Ok done, see screenshot, of course I had to equip myself with an Editor that could count  ;D  then in addition to thank you, I have to thank the inventor of copy-paste and finally AROS for its simplicity !

I assume that now to compile it on AROS 68k and Amiga 68k I should look for a GCC compiler for these platforms or am I wrong?

Where do you compile AROS 68k executables ?


miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #51 on: November 19, 2021, 12:26:58 PM
AMIGASYSTEM

Congratulations! You did it.  ;D

I usually drop the code into a folder in my 68k Build System with a mmakefile.src

But this one is in Contrib. I would have to modify the mmakefile.

But I'm lazy.  :)

Maybe DevCPP. Set up a 68k project. Add dtconv.c and compile.
« Last Edit: November 19, 2021, 12:32:41 PM by miker1264 »



AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3762
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #52 on: November 19, 2021, 12:31:34 PM
Open a new world for me, I hope to understand it, as soon as i have some time i do some experiments !


miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #53 on: November 19, 2021, 12:35:37 PM
Open a new world for me, I hope to understand it, as soon as i have some time i do some experiments !

Look again at dirtree. Try to compile the original file with errors.

Then try the file with the two corrections. Open it in the editor.

Line 96: LONG becomes IPTR.
Line 335: g-> dt.dat_Flags = NULL;
becomes g->dt.dat_Flags = DTF_SUBST;

Take note of the line numbers and the corrections made.  8)
« Last Edit: November 19, 2021, 12:44:38 PM by miker1264 »



miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #54 on: November 20, 2021, 11:18:47 PM
After several hours I have re-written DTConv for 68k and now it works.

It should work well for x86 and x86_64 as well now that it works for 68k.



miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #55 on: November 21, 2021, 12:25:07 AM
Here is the 68k version of DTConv. It is working now to convert picture files. It also works with 8bit, 24bit and 32bit.

The next step is to get sound datatype conversion to work correctly.



miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #56 on: November 21, 2021, 12:40:24 AM
Nice.  8)

DTConv works with AROS Vision as well.



AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3762
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #57 on: November 21, 2021, 03:28:07 AM
DTConv 68k works well also on AROS One 68k, successfully tested with Dopus4 ;)


OlafS3

  • Legendary Member
  • *****
    • Posts: 544
    • Karma: +50/-8
Reply #58 on: November 21, 2021, 03:33:35 AM
fantastic  ;)

One question... as I understand it dtconvert from file to file as long both (source and destination) are supported by datatypes?

Are there still something open?

I will fuily integrate it in my filetypes then



AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3762
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #59 on: November 21, 2021, 03:38:12 AM
DTConv converts any graphic format to another format, but even in the same format of course an 8bit image will always be converted to 8bit, in practice you can not save an image from 32Bit to 8Bit, maybe this will be a next option :)