Jump to content
IGNORED

Palettes confuse me


Recommended Posts

The problem with overlaid 320A is that since transparency is based on pixel pairs, you end up with essentially the same restrictions as 320C, and with more cycles used for DMA. 320C is usually better.

 

For 320C, set the colors something like this:

P0C2 = white

P1C2 = red

P2C2 = blue

 

(The order of those doesn't matter. What matters is that the colors you need are C2 of palettes that are either in P0-P3 or P4-P7.)

 

The first 4 bits of each byte specify which pixels to color, i.e. which are not transparent or background. The next 2 bits specify the color for the first pixel pair and the last 2 bits specify the color for the 2nd pixel pair.

 

So for example, if you want background-red-white-background, using the color definitions I listed above, set palette to 0 in the header and the graphics data byte will be 01100100 (look at it like this: 0110 01 00, which is off-on-on-off red white).

 

Yes, it's confusing. Play with it a bit and you'll catch on. As PacManPlus mentioned, you may have to tweak your bitmap.

  • Like 3
Link to comment
Share on other sites

  • 2 weeks later...
7 minutes ago, ZippyRedPlumber said:

Shifting things to 160, I get an error on Dev Studio saying "too many colors" WTF AM I DOING WRONG!?!

 

To be honest, it could be a bunch of things. It's hard to say without seeing your code. Most likely your graphics are configured incorrectly (too many colours - as the error says).

 

160A is 3 colours + transparency, 160B is 12 colours + transparency. In 160 mode, your PNG files will need to live within those parameters.

 

As I said, if you link your code, someone can take a look and make some suggestions.

  • Like 1
Link to comment
Share on other sites

3 hours ago, Muddyfunster said:

 

To be honest, it could be a bunch of things. It's hard to say without seeing your code. Most likely your graphics are configured incorrectly (too many colours - as the error says).

 

160A is 3 colours + transparency, 160B is 12 colours + transparency. In 160 mode, your PNG files will need to live within those parameters.

 

As I said, if you link your code, someone can take a look and make some suggestions.

Quote
  "incgraphic GFX/lyra1.png 160A"

 

Link to comment
Share on other sites

Producing images in the correct format (indexed PNGs) and importing them correctly was my biggest learning curve when learning 7800BASIC. How are you producing your images? The sprite editor in Atari Dev Studio will produce them in the correct format. The GIMP image editor is free and available for most platforms, and can produce indexed PNGs, too (though it has its own learning curve that I had to get used to at first).

 

To get better answers, it helps if you can zip up your whole project so people can try it out on their side and see what's going wrong. If you don't want to share your source, sometimes it can be useful to create a minimal project that only has enough code to demonstrate the problem (e.g. something that tries to just draw a single sprite on the screen along with your source image).

  • Like 3
Link to comment
Share on other sites

In your code you have 13 or so incgraphic calls. 

 

If you are still getting the "too many colours" error then I think it's likely that one of your graphics files has too many colours.

 

I would suggest that you check each file and make sure you didn't accidentally save it with too many colours. If you are using GimP you can set each file back to RGB then set them to indexed with a max of 4 colours (as you are using 160A).

 

 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
2 hours ago, ZippyRedPlumber said:

Not related to palettes, but can someone show me how to flip graphics modes on the fly ex. one screen could be 320, the other is 160?

You can change displaymode between screens using the displaymode command.

 

Remember to check what you are planning to display. Graphics are loaded with the displaymode in mind (ie 320 or 160). 

 

 

  • Like 2
Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...