Jump to content

Photo

Trouble with images divisible by 16


17 replies to this topic

#1 atari2600land OFFLINE  

atari2600land

    Channel F Viewer

  • 11,400 posts
  • Location:Salem, Oregon

Posted Wed Feb 28, 2018 6:36 PM

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.

Attached Files



#2 ggn OFFLINE  

ggn

    Stargunner

  • 1,378 posts
  • Location:Athens, Greece

Posted Thu Mar 1, 2018 2:29 AM

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 :)

#3 atari2600land OFFLINE  

atari2600land

    Channel F Viewer

  • Topic Starter
  • 11,400 posts
  • Location:Salem, Oregon

Posted Thu Mar 1, 2018 10:12 AM

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.



#4 ggn OFFLINE  

ggn

    Stargunner

  • 1,378 posts
  • Location:Athens, Greece

Posted Thu Mar 1, 2018 12:23 PM

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


Citation needed.

Edited by ggn, Thu Mar 1, 2018 12:25 PM.


#5 atari2600land OFFLINE  

atari2600land

    Channel F Viewer

  • Topic Starter
  • 11,400 posts
  • Location:Salem, Oregon

Posted Thu Mar 1, 2018 3:39 PM

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


#6 CyranoJ ONLINE  

CyranoJ

    Quadrunner

  • 5,400 posts
  • RAPTOR in LOCAL
  • Location:Adelaide, SA

Posted Thu Mar 1, 2018 3:53 PM

That does not mean it does not have a CLUT.



#7 atari2600land OFFLINE  

atari2600land

    Channel F Viewer

  • Topic Starter
  • 11,400 posts
  • Location:Salem, Oregon

Posted Sat Mar 3, 2018 11:54 PM

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



#8 ggn OFFLINE  

ggn

    Stargunner

  • 1,378 posts
  • Location:Athens, Greece

Posted Sat Mar 3, 2018 11:58 PM

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


Try 0.

#9 Jeffrey_Bones OFFLINE  

Jeffrey_Bones

    Stargunner

  • 1,026 posts
  • Location:Charlotte, NC

Posted Sun Mar 4, 2018 12:05 AM

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

#10 atari2600land OFFLINE  

atari2600land

    Channel F Viewer

  • Topic Starter
  • 11,400 posts
  • Location:Salem, Oregon

Posted Sun Mar 4, 2018 12:25 AM

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

 

Attached Files



#11 atari2600land OFFLINE  

atari2600land

    Channel F Viewer

  • Topic Starter
  • 11,400 posts
  • Location:Salem, Oregon

Posted Sun Mar 4, 2018 12:34 AM

And this is the result when I try to put it in:

Attached File  resultwhichisstupidandwrong.png   8.23KB   1 downloads



#12 sh3-rg OFFLINE  

sh3-rg

    River Patroller

  • 3,392 posts
  • doge + tie = dothemath
  • Location:BOLTON, England

Posted Sun Mar 4, 2018 3:24 AM

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.



#13 Welshworrier OFFLINE  

Welshworrier

    Chopper Commander

  • 249 posts

Posted Sun Mar 4, 2018 4:31 AM

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

#14 atari2600land OFFLINE  

atari2600land

    Channel F Viewer

  • Topic Starter
  • 11,400 posts
  • Location:Salem, Oregon

Posted Sun Mar 4, 2018 7:08 AM

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.



#15 ggn OFFLINE  

ggn

    Stargunner

  • 1,378 posts
  • Location:Athens, Greece

Posted Fri Mar 9, 2018 3:42 AM

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, Fri Mar 9, 2018 3:42 AM.


#16 atari2600land OFFLINE  

atari2600land

    Channel F Viewer

  • Topic Starter
  • 11,400 posts
  • Location:Salem, Oregon

Posted Fri Mar 9, 2018 6:04 AM

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



#17 ggn OFFLINE  

ggn

    Stargunner

  • 1,378 posts
  • Location:Athens, Greece

Posted Fri Mar 9, 2018 7:16 AM

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.

#18 atari2600land OFFLINE  

atari2600land

    Channel F Viewer

  • Topic Starter
  • 11,400 posts
  • Location:Salem, Oregon

Posted Fri Mar 9, 2018 8:06 AM

Kind of a bland factory, but oh well...

Attached File  orangesjaguarpic2.png   10.45KB   1 downloads





Reply to this topic



  


0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users