26 August 2018, 00:19 | #1 |
Pixel Vixen
Join Date: Feb 2018
Location: Mie, Japan
Posts: 219
|
Copper List Rainbow - Sorry, but where do I begin?
Hey gang,
You'll have to excuse my idiocy. So I've created a nice graphic... But I can't for the life of me work out how to display one of those copper rainbows. I can see the DisplayRainbow command in the manual but as always it's about as well described as the mating habits of blind marmots that like broccoli but only on a Tuesday between the hours of 2.37pm and 3.32pm, on a leap year, during an eclipse.... I can issue lots of DisplayRGB commands but it seems more logical to use some kind of For loop but that is moaning at me about custom copper space. My code is as the screenshot.... All I want to do is display a nice pastel shaded blue into pink rainbow (appreciate my code will just create a rather white into pure blue rainbow if it worked) but can't seem to figure this out! The second screenshot is the little piece I want to display, essentially I want to show how the Amiga can display a gently rippling rainbow effect with a cool graphic and maybe a game title coming down over the top, but failing at the second hurdle. Thanks! Vx p.s. no marmots were hurt in the process of writing this post |
26 August 2018, 11:51 | #2 |
Gets there in the end...
Join Date: Sep 2005
Location: Wales
Posts: 862
|
|
26 August 2018, 12:36 | #3 |
Pixel Vixen
Join Date: Feb 2018
Location: Mie, Japan
Posts: 219
|
Thanks! It does I think I didn't have enough palette entries, so I have it working in a fashion now. Will post a result here as it's thrown up another question...
|
26 August 2018, 14:29 | #4 |
Pixel Vixen
Join Date: Feb 2018
Location: Mie, Japan
Posts: 219
|
Ok, so here's my question. I want to cycle the copper rainbow palette, so that the colours scroll behind the picture. I have tried CyclePalette but it only seems to affect the top bit of the display and then when I exit the screen, I get a crash (at least I do on UAE, not been working on my real A600 today) - if I remove CyclePalette -- all good again, no crashing.
So I have devised this code, there's a lot of set up for palette colours etc. and during the display loop, it shuffles the colours, maybe I am just being a total n00b in how I am doing this, but as you can imagine it's not fast, taking more than one vwait to complete (the for i=0 to 255 isn't going to help every single frame...), am I missing something blindingly obvious? I would have thought the Amiga even a 68000 can do this given all the demos that seem to do this so I must be doing something terribly wrong? Thank you so much, I have much to learn it seems! (I only ever used Blitz for Amiga mode programming back in the day so this is all pretty new stuff to me!) Code:
DEFTYPE.w NEWTYPE.rgb r.b g.b b.b End NEWTYPE Dim pal.rgb(31) pal(0)\r=15 : pal(0)\g=14 : pal(0)\b=12 pal(1)\r=15 : pal(1)\g=14 : pal(1)\b=11 pal(2)\r=15 : pal(2)\g=14 : pal(2)\b=10 pal(3)\r=15 : pal(3)\g=13 : pal(3)\b=10 pal(4)\r=15 : pal(4)\g=12 : pal(4)\b=10 pal(5)\r=15 : pal(5)\g=12 : pal(5)\b=9 pal(6)\r=15 : pal(6)\g=11 : pal(6)\b=9 pal(7)\r=14 : pal(7)\g=11 : pal(7)\b=9 pal(8)\r=14 : pal(8)\g=11 : pal(8)\b=9 pal(9)\r=14 : pal(9)\g=11 : pal(9)\b=9 pal(10)\r=14 : pal(10)\g=11 : pal(10)\b=9 pal(11)\r=14 : pal(11)\g=11 : pal(11)\b=10 pal(12)\r=14 : pal(12)\g=11 : pal(12)\b=10 pal(13)\r=14 : pal(13)\g=11 : pal(13)\b=11 pal(14)\r=14 : pal(14)\g=11 : pal(14)\b=11 pal(15)\r=14 : pal(15)\g=10 : pal(15)\b=10 pal(16)\r=14 : pal(16)\g=10 : pal(16)\b=11 pal(17)\r=14 : pal(17)\g=11 : pal(17)\b=12 pal(18)\r=14 : pal(18)\g=12 : pal(18)\b=13 pal(19)\r=14 : pal(19)\g=12 : pal(19)\b=14 pal(20)\r=12 : pal(20)\g=12 : pal(20)\b=14 pal(21)\r=10 : pal(21)\g=11 : pal(21)\b=14 pal(22)\r=8 : pal(22)\g=10 : pal(22)\b=14 pal(23)\r=8 : pal(23)\g=10 : pal(23)\b=14 pal(24)\r=7 : pal(24)\g=10 : pal(24)\b=14 pal(25)\r=6 : pal(25)\g=10 : pal(25)\b=14 pal(26)\r=6 : pal(26)\g=10 : pal(26)\b=13 pal(27)\r=5 : pal(27)\g=10 : pal(27)\b=13 pal(28)\r=4 : pal(28)\g=10 : pal(28)\b=13 pal(29)\r=4 : pal(29)\g=11 : pal(29)\b=13 pal(30)\r=3 : pal(30)\g=11 : pal(30)\b=13 pal(31)\r=3 : pal(31)\g=12 : pal(31)\b=13 InitPalette 1,256 For i=0 To 255 n = i LSR 3 PalRGB 1,i,pal(n)\r,pal(n)\g,pal(n)\b Next BitMap 0,320,256,5 LoadBitMap 0,"Asuka Colour 3.iff",0 PalRGB 0,0,0,0,0 InitCopList 0,44,256,$15,8,32,-4 VWait 100 ; wait for disk activity end BLITZ CreateDisplay 0 DisplayPalette 0,0 DisplayBitMap 0,0 DisplayRainbow 0,0,1 n=0 Repeat VWait DisplayRainbow 0,0,1 n = QWrap(n,0,32) ; store the current colour register index tmp.rgb\r=pal(n)\r tmp.rgb\g=pal(n)\g tmp.rgb\b=pal(n)\b For i=0 To 30 pal(i)\r = pal(i+1)\r pal(i)\g = pal(i+1)\g pal(i)\b = pal(i+1)\b Next pal(31)\r = tmp\r pal(31)\g = tmp\g pal(31)\b = tmp\b For i=0 To 255 n = i LSR 3 PalRGB 1,i,pal(n)\r,pal(n)\g,pal(n)\b Next n+1 Until Joyb(0) QAMIGA Free BitMap 0 Free Palette 0 Free Palette 0 End |
26 August 2018, 14:44 | #5 |
Pixel Vixen
Join Date: Feb 2018
Location: Mie, Japan
Posts: 219
|
Sorry, spoke too soon suddenly had a brainwave!
I'm leaving the above as others who have this problem may find it helpful to see the evolution. I have replaced the display loop with the below, plenty fast enough (too quick with just one vwait!), but if there's a more optimal way still I am all ears! Code:
Repeat VWait 2 n = QWrap(n,0,32) x = n For y=0 To 31 x = x+1 x = QWrap(x,0,32) DisplayRGB 0,0,y LSL 3,pal(x)\r,pal(x)\g,pal(x)\b Next n+1 Until Joyb(0) |
20 November 2019, 05:13 | #6 |
Registered User
Join Date: Mar 2018
Location: Austria
Posts: 617
|
Which you can further simplify to:
Code:
Repeat VWait 2 x = n For y = 0 To 31 x = QWrap(x+1,0,32) DisplayRGB 0,0,y LSL 3, pal(x)\r,pal(x)\g,pal(x)\b Next n = QWrap(n+1,0,32) Until Joyb(0) PS: Sorry for diggin' this out. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Copper list assistance | mcgeezer | Coders. General | 6 | 29 December 2017 00:14 |
Updating copper list every frame | carrion | Coders. Blitz Basic | 12 | 02 October 2017 11:31 |
Copper list execution start. | nandius_c | Coders. Asm / Hardware | 11 | 14 August 2014 22:28 |
Copper Rainbow Corruption | Leandro Jardim | support.WinUAE | 6 | 20 August 2012 16:04 |
Copper list setup for runtime library | Samurai_Crow | Coders. General | 7 | 26 August 2010 16:14 |
|
|