Jump to content
Sign in to follow this  
atari2600land

Trouble with images divisible by 16

Recommended Posts

Both the height and the width of the picture I want to show is divisible by 16. So what am I doing wrong here? Why won't it show anything but green? It's supposed to be an orange.

oranges.zip

Share this post


Link to post
Share on other sites

Next time please include more information of what you're trying to do - it'll save some time for everyone!

 

Your image is 8 bitplanes in depth and the object is set up to handle that. No probs there. The problem is that 8 bpp images are in fact paletted, so you need to tell assets.txt to dump a palette. And then you need to tell rb+ to load the palette at startup using loadclut.

 

I'll omit the fix as an excersise to the user :)

Share this post


Link to post
Share on other sites

I'm trying to make the orange show up on the screen. But it won't. All the documents say that 8 bpp graphics don't have a CLUT.

Share this post


Link to post
Share on other sites

All the documents say that 8 bpp graphics don't have a CLUT.

Citation needed.

Edited by ggn
  • Like 2

Share this post


Link to post
Share on other sites

From the rapinit.s file:

 

    dc.l    no_CLUT                ; no_CLUT                            ; Define sprite colours.                                            ;   R_sprite_CLUT
                                                                ; no_CLUT for 8, 16 and 24bit
                                                                ; CLUT number 0 to 15 for 1, 2 and 4bit

Share this post


Link to post
Share on other sites

I gave it a CLUT of 1 and it displays a black orange instead of an orange one.

Share this post


Link to post
Share on other sites

I gave it a CLUT of 1 and it displays a black orange instead of an orange one.

Try 0.

Share this post


Link to post
Share on other sites

Try deleteing the orange CLUT and gfx data files from the build folder. Then build it again and see how it looks. Basically just re-wright the clut file

Share this post


Link to post
Share on other sites

8-bit images, 256 colours, use all 256 colour registers - the whole CLUT. It's not like 16-bit where it's Red-Blue-Green values described per pixel, it's like 1-, 2- and 4-bit images that have an array of colours indexed by these bits.

 

You need to set your object to CLUT 0 or no_CLUT (IIRC, both will work), and have assets.txt create a CLUT file and fire that data at the CLUT.

 

If that doesn't work, maybe your image tool is shipping broken files, or maybe you're overwriting sections of the CLUT with other palette data for other objects.

 

Simple solution if you do not require palette adjusting for the object is make it 16-bit. If that doesn't suit your needs, you're going to have to make your orange graphic's 256 colour palette suitable for both it and any other sub-16-bit objects you want to use and carefully manage your CLUT.

Share this post


Link to post
Share on other sites

Out of interest is this for a different game to the one you are working on with Jeffrey Bonez?

Yes, this is a different game.

Share this post


Link to post
Share on other sites

So it's been a week without this getting solved, so it's hand holding time yet again!

  • Download and extract zip
  • In assets.txt Change gfx_noclut to gfx_clut
  • In oranges.bas add loadclut(strptr(ORANGEFRUIT_clut),0,256) before the DO statement
  • Build and run

Neither suggestion worked. Why won't this stupid picture go in?

Because you didn't read my first reply?

Edited by ggn
  • Like 1

Share this post


Link to post
Share on other sites

Sorry to be such a pain. I didn't realize the number after the CLUT was the number of colors.

Share this post


Link to post
Share on other sites

Sorry to be such a pain. I didn't realize the number after the CLUT was the number of colors.

Well, it's ok. If my explanations aren't making sense to you don't hesitate to ask for clarifications.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...