04 February 2021, 01:09 | #1 |
Registered User
Join Date: Mar 2012
Location: UK
Posts: 1,893
|
AGA Sprite Palette
Help!
So I know that if I use AGA sprites with a dual playfield screen I can use 16+16 colours for the dual screens and as far as I know I can use a different 16 colours for the sprite palette but have no idea how to point the sprites to the correct palette? I'm guessing it's something to do with Displaycontrols? Thanks. |
04 February 2021, 05:18 | #2 |
Registered User
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 41
Posts: 999
|
Yup, I had the same question few years ago
http://eab.abime.net/showpost.php?p=...&postcount=129 |
04 February 2021, 09:50 | #3 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
|
BPLCON4 is used to select the colour banks used for sprites. Bits 0-3 select the 16-colour bank for odd numbered sprite channels & 16-colour sprites, and bits 4-7 set the bank for even numbered sprite channels. By default, they're both set to bank 1 (to match ECS), so the register will look like %00010001. Bank 2 is colours 32-47, bank 3 is 48-63 and so on.
Last edited by Daedalus; 04 February 2021 at 12:30. |
04 February 2021, 15:32 | #4 | |
Registered User
Join Date: Mar 2012
Location: UK
Posts: 1,893
|
Quote:
Are you saying I can have separate palettes for odd and even sprites - I thought they'd need to share the same palette? And just to be clear, if I do: Displaycontrols 0,0,0,%00100010 I will set the sprites to use palette entries 32-47? Would I need to set up an initial 64 colour palette through the Initcopperlist? And finally - how do you know this stuff? It's not clear in the manual and I couldn't find it on the Internet! |
|
04 February 2021, 15:33 | #5 | |
Registered User
Join Date: Mar 2012
Location: UK
Posts: 1,893
|
Quote:
I have just about got a handle on most Amiga programming stuff now but palettes are surprisingly complex! |
|
04 February 2021, 15:59 | #6 | ||||
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
|
Quote:
Quote:
Code:
Displaycontrols 0, 0, $c00, Xor($11, %00100010) Bizarrely, it appears that BPLCON3 values are directly applied instead of being XORed, so you might find you need to include the default as shown too. Quote:
Quote:
Still, at this level we're dealing with the Amiga hardware directly and not so much with Blitz, so thankfully there are other resources for these details. One such site is amiga-dev.wikidot.com, which covers all the registers in the Amiga Hardware Manual, as well AGA registers that aren't covered in the Hardware Manual. On this page in particular it has some details of the BPLCON4 register, and the hardware page lists all the custom registers with information on each. It's a great website to have bookmarked! Last edited by Daedalus; 04 February 2021 at 16:05. |
||||
06 February 2021, 11:36 | #7 |
Registered User
Join Date: Oct 2019
Location: Spain
Posts: 23
|
Hi Havie,
In my game projects (that uses the DPF displays) I normally used the following statement : Displayadjust Copnum, 0, $1c00, $00ee where "Copnum" is the number of the copperlist initializated with the "InitCoplist" command and this gives me the following color palette: Foreground playfield -> colours 0 to 15 Background playfield -> colours 16 to 31 Sprite color palette -> colours 240 to 255 I recognize that this command is a bit complicated to handle. I have been playing with different values ??in bplcon3 and bplcon4 (following the documents on AGA registers) and I have had quite strange results |
06 February 2021, 14:40 | #8 | |
Registered User
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 41
Posts: 999
|
Quote:
Looking at some other my code Displayadjust Copnum, 0, $1c00, $0033 Would be for 16/16 dpf split and sprite colors from 32 to 48 |
|
06 February 2021, 17:44 | #9 | |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
|
Quote:
And the same here - XOR $33 with $11 and you get $22 - bank 2, which is 32-47. |
|
06 February 2021, 20:00 | #10 |
Registered User
Join Date: Mar 2012
Location: UK
Posts: 1,893
|
Thanks guys - will implement in my SF2 demo code!
|
07 February 2021, 01:52 | #11 |
Registered User
Join Date: Mar 2012
Location: UK
Posts: 1,893
|
Thanks to all your help, I got it working. You guys are stars!
http://eab.abime.net/showpost.php?p=...&postcount=398 |
07 February 2021, 17:55 | #12 |
Registered User
Join Date: Mar 2012
Location: UK
Posts: 1,893
|
Now added an additional background that shows floor effect better:
https://eab.abime.net/zone/Streetfigher2test.adf You can also chose background with 1 or 2 buttons. Would like to add a few more moves and get Chunli animated too just too see! |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[blitz] InitCopList, dual playfield, AGA - palette question | peceha | Coders. Blitz Basic | 2 | 15 November 2020 10:33 |
issue with getting palette for sprite... | xboxown | Coders. AMOS | 2 | 17 February 2019 14:32 |
AGA Sprite + Dual Playfield Limits | Marle | Coders. Blitz Basic | 14 | 12 January 2019 14:14 |
AGA Palette... how to implement | Steve | Coders. Asm / Hardware | 23 | 25 November 2018 22:26 |
Brian the Lion AGA - 1.6.0 sprite not displayed | Ian | support.WinUAE | 2 | 20 July 2009 11:49 |
|
|