ZippyRedPlumber Posted November 8, 2021 Share Posted November 8, 2021 So the game I'm working on uses 320A/C graphics modes Using a zone height of 16, I'm able to make a 32x32 player, what I want to now is add the palette. Below is a mockup of what I'm going for, how can I do this? Quote Link to comment Share on other sites More sharing options...
PacManPlus Posted November 9, 2021 Share Posted November 9, 2021 If you're stuck with 320A, you'll need to use three different sprites (one each for red, white, and blue) as 320A is single color. 320C I'm unfortunately not familiar with, however I think you would have to change the bitmap to conform to the color restrictions. 1 Quote Link to comment Share on other sites More sharing options...
+Pat Brady Posted November 9, 2021 Share Posted November 9, 2021 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. 3 Quote Link to comment Share on other sites More sharing options...
ZippyRedPlumber Posted November 17, 2021 Author Share Posted November 17, 2021 Shifting things to 160, I get an error on Dev Studio saying "too many colors" WTF AM I DOING WRONG!?! Quote Link to comment Share on other sites More sharing options...
+Muddyfunster Posted November 17, 2021 Share Posted November 17, 2021 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. 1 Quote Link to comment Share on other sites More sharing options...
ZippyRedPlumber Posted November 18, 2021 Author Share Posted November 18, 2021 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" Quote Link to comment Share on other sites More sharing options...
+Muddyfunster Posted November 18, 2021 Share Posted November 18, 2021 Is that the only incgraphic statement ?, can you share your graphics file? Quote Link to comment Share on other sites More sharing options...
+Karl G Posted November 18, 2021 Share Posted November 18, 2021 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). 3 Quote Link to comment Share on other sites More sharing options...
ZippyRedPlumber Posted November 18, 2021 Author Share Posted November 18, 2021 11 hours ago, Muddyfunster said: Is that the only incgraphic statement ?, can you share your graphics file? Quote Link to comment Share on other sites More sharing options...
+Muddyfunster Posted November 18, 2021 Share Posted November 18, 2021 I used your graphics file and could compile and had no issues. There must be something else in your code causing the issue. If you can share your whole code like KarlG suggested, someone can take a look and offer some help. 1 Quote Link to comment Share on other sites More sharing options...
ZippyRedPlumber Posted November 19, 2021 Author Share Posted November 19, 2021 Here you go @Muddyfunster What I'm going for is a "Jetpac" inspired arcade platformer using @Synthpopalooza's Sky Scraper code as a base lyra.bas 1 Quote Link to comment Share on other sites More sharing options...
+Muddyfunster Posted November 19, 2021 Share Posted November 19, 2021 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). 1 Quote Link to comment Share on other sites More sharing options...
ZippyRedPlumber Posted November 29, 2021 Author Share Posted November 29, 2021 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? Quote Link to comment Share on other sites More sharing options...
+Muddyfunster Posted November 29, 2021 Share Posted November 29, 2021 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). 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.