![]() |
![]() |
#1 |
gone
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... |
![]() |
![]() |
#2 |
Ya' like it Retr0?
Join Date: Jul 2005
Location: United Kingdom
Age: 48
Posts: 9,768
|
I used to use ppaint as there is an option to save it out as C source code.
|
![]() |
![]() |
#3 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
@Zetr0 - thanks for the heads up
![]() 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. |
![]() |
![]() |
#4 |
Junior Member
Join Date: Aug 2001
Location: France
Posts: 1,382
|
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.
|
![]() |
![]() |
#5 |
move.w #$4489,$dff07e
Join Date: Sep 2005
Location: Norfolk, UK
Age: 42
Posts: 2,345
|
I can recommend ArtPro as well pmc - that's what I always use. It produces nice dc.x statements among other things
![]() |
![]() |
![]() |
#6 |
gone
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... |
![]() |
![]() |
#7 |
move.w #$4489,$dff07e
Join Date: Sep 2005
Location: Norfolk, UK
Age: 42
Posts: 2,345
|
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
![]() |
![]() |
![]() |
#8 |
Registered User
Join Date: May 2004
Location: Somewhere secret
Age: 49
Posts: 359
|
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!
|
![]() |
![]() |
#9 |
Ya' like it Retr0?
Join Date: Jul 2005
Location: United Kingdom
Age: 48
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.... |
![]() |
![]() |
#10 |
Citizen of Elthesh
Join Date: Sep 2003
Location: UK
Posts: 949
|
I have done no such thing. You're the one who said it.
|
![]() |
![]() |
#11 |
Ya' like it Retr0?
Join Date: Jul 2005
Location: United Kingdom
Age: 48
Posts: 9,768
|
@eLowar
i didnt mean to offend you, after all you help me ![]() microsoft made me soft ![]() |
![]() |
![]() |
#12 |
Citizen of Elthesh
Join Date: Sep 2003
Location: UK
Posts: 949
|
*scratches head* what have I ever done for you?
![]() |
![]() |
![]() |
#13 |
gone
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. |
![]() |
![]() |
#14 |
Ya' like it Retr0?
Join Date: Jul 2005
Location: United Kingdom
Age: 48
Posts: 9,768
|
C can have inline asembly routines.
C would be a great way to prototype your ASM really fast ![]() |
![]() |
![]() |
#15 |
Citizen of Elthesh
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
![]() Last edited by eLowar; 18 May 2007 at 23:06. Reason: changed back after re-merge |
![]() |
![]() |
#16 |
Ya' like it Retr0?
Join Date: Jul 2005
Location: United Kingdom
Age: 48
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 ![]() |
![]() |
![]() |
#17 |
Citizen of Elthesh
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.
![]() |
![]() |
![]() |
#18 |
gone
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? |
![]() |
![]() |
#19 |
Ya' like it Retr0?
Join Date: Jul 2005
Location: United Kingdom
Age: 48
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. ![]() |
![]() |
![]() |
#20 | |
Banned
Join Date: Aug 2005
Location: London / Sydney
Age: 46
Posts: 20,420
|
Quote:
![]() 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. |
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
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 |
|
|