English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General > Coders. Tutorials

 
 
Thread Tools
Old 04 June 2011, 12:53   #1
jman
Registered User
 
Join Date: Nov 2010
Location: Italy
Posts: 307
[REQ:ASM] Loading a static image and its palette

I'm after some info about loading a static image into my asm code.
I tried reading the various threads on EAB, but there's something I must be missing because I can't obtain the same image quality I see from PicCon.
My (emulated) Amiga is set to standard PAL lowres.

This is the procedure I'm following:
1) Grab any JPG from the interwebs
2) Open it with ImageStudio, set it to color-mapped with 32 colors, then save palette, then save as IFF
3) Open the IFF with PicCon, the image looks good (see piccon.png), save as RAW, 320x256, 5 bitplanes
4) Include in the code with its palette.... crap result (see code.png).

Including the palette whould save me the hassle to manually edit all the color registers, right?

Do I have to edit the palette before exporting it?

Also attached the src code for those interested. I'm pretty sure I'm setting the copper correctly: zero all sprites, set the window, load the image into bitplanes ... I think I'm doing the whole thing like I should.

Thanks.


EDIT: Teddybear programming: I just discovered a mistake, I was loading 3 bitplanes only, not 5. However the final result still isn't what I want (see code2.jpg). Source code fixed. sorry.
Attached Thumbnails
Click image for larger version

Name:	code.png
Views:	287
Size:	72.3 KB
ID:	28814   Click image for larger version

Name:	piccon.png
Views:	300
Size:	95.4 KB
ID:	28815   Click image for larger version

Name:	code2.jpg
Views:	283
Size:	35.5 KB
ID:	28816  
Attached Files
File Type: zip load_image.zip (714 Bytes, 192 views)

Last edited by jman; 04 June 2011 at 14:27.
jman is offline  
Old 04 June 2011, 13:59   #2
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,312
Looks like your palette is wrong, code seems to be OK. My guess is that you exported a standard raw palette (i.e. not for the copperlist) which won't work for obvious reasons. Choose "4 bits" and tick the "Copperlist" checkbox in PicCon's "Palette" settings.
StingRay is offline  
Old 04 June 2011, 14:55   #3
jman
Registered User
 
Join Date: Nov 2010
Location: Italy
Posts: 307
Quote:
Originally Posted by StingRay View Post
Looks like your palette is wrong, code seems to be OK. My guess is that you exported a standard raw palette (i.e. not for the copperlist) which won't work for obvious reasons. Choose "4 bits" and tick the "Copperlist" checkbox in PicCon's "Palette" settings.
Here comes again Winston Wolf ;-)

Thank you very much, that did the trick.
I was about to ask you why the suggested changes but then I've found proper answer in the PicCon guide (rtfm ftw).

One last question: the palette in 'copperlist' format is still a binary file. For the sake of learning, how can I check what's in that file? I'd like to replicate that palette setting $dff180-$dff1eb registers.

thanks again.

Last edited by jman; 04 June 2011 at 17:41.
jman is offline  
Old 04 June 2011, 15:08   #4
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,312
Quote:
Originally Posted by jman View Post
One last question: the palette in 'copperlist' format is still a binary file. For the sake of learning, how can I check what's in that file? I'd like to replicate that palette setting $dff180-$dff1eb.
If you use AsmOne/Pro you could easily import the palette data into your source using the "IH" (i.nsert h.ex) command.
Or, if you only want to check the data, you could use the "h.w" (view hex, word sized) command.

If you don't use AsmOne/Pro you will have to change PicCon's settings to export data as ASM source (Project->Save data as...-> Asm Source).


Quote:
Originally Posted by jman View Post
thanks again.
You're welcome.
StingRay 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
[REQ:ASM] Reading a keystroke jman Coders. Tutorials 32 08 October 2018 22:38
[REQ:ASM] Sprite collisions basics jman Coders. Tutorials 5 03 September 2011 01:07
[REQ:ASM] Assembling and running jman Coders. Tutorials 9 07 May 2011 19:39
REQ:ASM getting elapsed time on A1200 jman Coders. Tutorials 18 11 January 2011 23:24
REQ:ASM How to use buffers jman Coders. Tutorials 7 01 December 2010 02:41

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 15:48.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.06695 seconds with 14 queries