16 July 2017, 12:17 | #1 |
Registered User
Join Date: Dec 2013
Location: Auckland
Posts: 3,541
|
Updating part of a CopperList's palette? (DisplayLibrary)
Is there a simple way of replacing a couple of colours on the Palette of a copper list, rather than replacing the entire Palette with DisplayPalette? (the colour-offset parameter in DisplayPalette seems to copy from an offset in the Palette, not an offset into the copper list)
|
16 July 2017, 23:09 | #2 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
|
DisplayRGB Coplist#, Register, line, r, g, b, [copoffset]
CustomColors Coplist#, CCOffset, YPos, Palette, startcol, numcols, [thru256flag] |
24 July 2017, 09:07 | #3 |
Registered User
Join Date: Dec 2013
Location: Auckland
Posts: 3,541
|
|
29 August 2018, 02:49 | #4 |
Registered User
Join Date: Dec 2013
Location: Auckland
Posts: 3,541
|
I ended up writing my own solution for what I wanted to do (replace colors 32-47 on an AGA copperlist, which I'm using for sprite colors). This is a very niche implementation, but I'm posting it here on the off chance it's of any help.
In brief, I have a "Sprite Palette" object for holding the 24 bit RGB values (split into upper and lower parts), which I fill with a regular Blitz palette object. I then paste that into the part of the copper list that sets colors 32-47 Code:
NEWTYPE .SpritePalette UpperRGB.w[16] LowerRGB.w[16] End NEWTYPE Statement FillSpritePalette{*SP.SpritePalette,PaletteIndex} PaletteInfo PaletteIndex for i = 0 to 15 UpperRed = (AGAPalRed(i) LSR 4) LSL 8 UpperGreen = (AGAPalGreen(i) LSR 4) LSL 4 UpperBlue = (AGAPalBlue(i) LSR 4) LowerRed = (AGAPalRed(i) & $f) LSL 8 LowerGreen = (AGAPalGreen(i) & $f) LSL 4 LowerBlue = (AGAPalBlue(i) & $f) *SP\UpperRGB[i] = UpperRed | UpperGreen | UpperBlue *SP\LowerRGB[i] = LowerRed | LowerGreen | LowerBlue next End Statement Statement UseSpritePalette{*SP.SpritePalette,CopperList} *cl.coplist = Addr CopList(CopperList) offset.l = *cl\colors + 270 for i = 0 to 15 Poke.w offset.l, *SP\UpperRGB[i] Poke.w offset.l+132, *SP\LowerRGB[i] offset + 4 next End Statement |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
The proper way of disabling a sprite? (Using DisplayLibrary) | earok | Coders. Blitz Basic | 6 | 05 June 2018 10:36 |
Copperlist optimizations for my tutorial #4 | Vikke | Coders. Asm / Hardware | 3 | 23 March 2013 22:29 |
Modifying a copperlist | CmdrVimes | Coders. General | 5 | 06 September 2010 12:08 |
Setting up a copperlist | oRBIT | Coders. General | 5 | 08 April 2010 14:18 |
Error in copperlist? | Nyarlathotep | support.WinUAE | 7 | 12 August 2003 23:44 |
|
|