English Amiga Board


Go Back   English Amiga Board > Requests > request.Apps

 
 
Thread Tools
Old 16 May 2007, 13:21   #1
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Graphics converter - RAW to source

Does anyone know of an app that can be used to change graphics files that are in RAW format into ASCII source format (dc.b / dc.w / dc.l) so that these files can be included directly as text into assembler source codes rather than including the actual RAW files with incbin directives?

I've seen Kefrens IFF Converter but this only seems to allow saving of files like this by either reformatting as 4 / 16 colour sprites (not sure if this is any use for what I want?) or as copper colour table lists. The other one I tried, AGRACONV, seems to have this as a menu option but it's greyed out / not implemented...
pmc is offline  
Old 16 May 2007, 14:00   #2
Zetr0
Ya' like it Retr0?
 
Zetr0's Avatar
 
Join Date: Jul 2005
Location: United Kingdom
Age: 49
Posts: 9,768
I used to use ppaint as there is an option to save it out as C source code.
Zetr0 is offline  
Old 16 May 2007, 14:16   #3
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
@Zetr0 - thanks for the heads up - all that looking around for exotic apps and PPaint was under my nose all the time!

I've got no experience with C at all, but looking at the ASCII text produced from saving a graphics file as C source using PPaint there's a section listed as data. Can I just change the 0x???? constructs in that section to dc.w $???? for use in assembler? Or am I assuming something too obvious and therefore completely wrong!

Last edited by pmc; 18 May 2007 at 14:36.
pmc is offline  
Old 16 May 2007, 22:31   #4
Frog
Junior Member
 
Frog's Avatar
 
Join Date: Aug 2001
Location: France
Posts: 1,385
AFAIR there was an excellent gfx converter http://aminet.net/package/gfx/conv/ArtPRO1.20 that can save in asm and lot of others formats.
Frog is offline  
Old 16 May 2007, 22:34   #5
musashi5150
move.w #$4489,$dff07e
 
musashi5150's Avatar
 
Join Date: Sep 2005
Location: Norfolk, UK
Age: 42
Posts: 2,351
I can recommend ArtPro as well pmc - that's what I always use. It produces nice dc.x statements among other things
musashi5150 is online now  
Old 16 May 2007, 23:13   #6
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
@Frog & musashi5150 - nice one chaps. I'll download it and have a play.

Out of interest, does anyone who understands both C and asm know the answer to my previous question? I'm intrigued now...
pmc is offline  
Old 16 May 2007, 23:14   #7
musashi5150
move.w #$4489,$dff07e
 
musashi5150's Avatar
 
Join Date: Sep 2005
Location: Norfolk, UK
Age: 42
Posts: 2,351
I'm a C and Asm guy - you were right, just replace the 0x with $ and stick a dc.w at the beginning of the line and you're away
musashi5150 is online now  
Old 17 May 2007, 00:47   #8
WayneK
Registered User
 
Join Date: May 2004
Location: Somewhere secret
Age: 50
Posts: 366
I used to use IFFCutter for exactly the same purposes as you PMC, but Stingray pointed me at the excellent PicCon instead... either of these should do everything you need by the sounds of things!
WayneK is offline  
Old 17 May 2007, 02:32   #9
Zetr0
Ya' like it Retr0?
 
Zetr0's Avatar
 
Join Date: Jul 2005
Location: United Kingdom
Age: 49
Posts: 9,768
before i wrote my own iff/bitmap loader i used to compile the picture sources as object code and then include them in the compile line.

if memory servers

dcc picture.c -picture.o

then

dcc m_exe.c -routines.c -picture.o

hmmm its been a long... long time.... and elowar pointed out that microsoft has nerfed my skills....
Zetr0 is offline  
Old 17 May 2007, 03:10   #10
eLowar
Citizen of Elthesh
 
eLowar's Avatar
 
Join Date: Sep 2003
Location: UK
Posts: 949
I have done no such thing. You're the one who said it.
eLowar is offline  
Old 17 May 2007, 03:13   #11
Zetr0
Ya' like it Retr0?
 
Zetr0's Avatar
 
Join Date: Jul 2005
Location: United Kingdom
Age: 49
Posts: 9,768
@eLowar
i didnt mean to offend you, after all you help me

microsoft made me soft
Zetr0 is offline  
Old 17 May 2007, 03:14   #12
eLowar
Citizen of Elthesh
 
eLowar's Avatar
 
Join Date: Sep 2003
Location: UK
Posts: 949
*scratches head* what have I ever done for you?
eLowar is offline  
Old 17 May 2007, 16:28   #13
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
@musashi5150 - thanks for clearing that up mate, good stuff...

@WayneK - I'll hunt those apps out - can never hurt to have alternatives.

@Zetr0 - thanks for the info. Unfortunately I think it might be a bit wasted on me - to me, C is just a letter in the alphabet that comes after B and before D!

Last edited by pmc; 18 May 2007 at 14:36.
pmc is offline  
Old 17 May 2007, 20:33   #14
Zetr0
Ya' like it Retr0?
 
Zetr0's Avatar
 
Join Date: Jul 2005
Location: United Kingdom
Age: 49
Posts: 9,768
C can have inline asembly routines.

C would be a great way to prototype your ASM really fast
Zetr0 is offline  
Old 17 May 2007, 22:01   #15
eLowar
Citizen of Elthesh
 
eLowar's Avatar
 
Join Date: Sep 2003
Location: UK
Posts: 949
I don't do cross language stuff, so I don't entirely know what I'm talking about , but as far as I'm aware, C data can be accessed easily from other languages (since the datatypes supported by C are so basic), probably ASM too. You could probably compile the C source code containing the data to an object file and then link that against your program and use the data inside it.

Last edited by eLowar; 18 May 2007 at 23:06. Reason: changed back after re-merge
eLowar is offline  
Old 18 May 2007, 10:17   #16
Zetr0
Ya' like it Retr0?
 
Zetr0's Avatar
 
Join Date: Jul 2005
Location: United Kingdom
Age: 49
Posts: 9,768
@eLowar
its true you can, I used to do this often

I used to use DICE and STORM C on the amiga and i often compiled libraries to .o (object) as you suggest and then include them in the final project compile line.

Quite often if i remember correctly i used to have a file to execute that included all the c source files, asm source files and object code files.

This method seriously reduced compile times on my amiga, the only awkward bit is that there wasn`t much support to test your code you had compiled to object untill you compiled the whole project.

I have to admit when I got my 060 and Storm C i found myself doing less and less pre-compilation. but irony i would be that i would attempt to optimise the asembly routined by compiling the project to asm first and then onto executable code.

C is a great language, the fact that you can write in-line asembly really is a great way to learn ASM too and damn fast for optimising.
Zetr0 is offline  
Old 18 May 2007, 12:17   #17
eLowar
Citizen of Elthesh
 
eLowar's Avatar
 
Join Date: Sep 2003
Location: UK
Posts: 949
I'm not sure how you'd go about it in ASM, but all you have to do is retrieve the values associated with the symbols named in C. The symbol behind the name of a C array for example would simply be a native memory address to a continuous block of memory containing the actual data. I'd love to see a usage example, purely out of curiosity.
eLowar is offline  
Old 18 May 2007, 13:09   #18
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
@eLowar - in asm, you could for example use a list of values to represent a bitplane and then point the bitplane regsiters at it ready for display like this:

move.l #screen,d0
move.w d0,$dff0e2
swap d0
move.w d0,$dff0e0

screen: dc.w $xxxx,$xxxx,$xxxx,$xxxx etc.

for the sake of brevity I've obviously left out a lot of other code that's required. I can send you a full asm source if you'd find it interesting / useful?
pmc is offline  
Old 18 May 2007, 13:20   #19
Zetr0
Ya' like it Retr0?
 
Zetr0's Avatar
 
Join Date: Jul 2005
Location: United Kingdom
Age: 49
Posts: 9,768
@elowar

heres some reources for you to overview.

GCC
http://www.ibiblio.org/gferg/ldp/GCC...bly-HOWTO.html

heres another simpler method (again under linux)
http://linux4u.jinr.ru/usoft/WWW/www...lf/node22.html

hope it helps m8.
Zetr0 is offline  
Old 18 May 2007, 22:42   #20
DamienD
Banned
 
DamienD's Avatar
 
Join Date: Aug 2005
Location: London / Sydney
Age: 47
Posts: 20,420
Quote:
Originally Posted by eLowar
Maybe a mod could split this thread and move part of it into the Coder's Heaven forum?
Sure, hopefully I split the right parts

Edit: done... Please let me know if you guys want any posts moved either way or the new thread title changed to something else

New thread can be found under the Coder's Heaven section: C/C++ questions

Last edited by DamienD; 18 May 2007 at 23:09.
DamienD is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Raw Interleaved Graphics Hungry Horace Coders. General 12 28 January 2023 23:30
Open-source graphics library Don_Adan Coders. System 32 15 January 2013 22:15
decent IFF-2-RAW converter Herpes request.Apps 11 04 September 2012 16:37
IFF to Raw converter h0ffman Coders. General 7 13 January 2011 22:59
.raw ->.ipf orange support.Apps 2 12 September 2009 22:48

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 14:15.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09960 seconds with 13 queries