'I found it. Well, a very early version of it. This code is not all my work. If I remember I got the 'original idea from an AMOS pro demo somewhere. I simply modified it to allow more rainbows 'side-by-side. Unfortunately, the code is not very clear either. Maybe someone can tidy it up a bit. 'Anyway, it works in AMOS 1.3 and should work in AMOS Pro too. I did code a better procedure but 'I can't find it yet. I will post it here if I find it. Anyway, enjoy this cool code which allows you to get 'many more colours on the screen....
'
'
Set Buffer 32
'
'
Screen Open 0,320,256,8,Lowres : Flash Off : Curs Off : Cls 0
'
Rem *** reserve some memory for the arrays
'
Dim C(7),CC(7,279)
Global C(),CC(),NRAIN
NRAIN=7
Rem *** define colours to be affected
'
C(0)=1 : C(1)=2 : C(2)=3 : C(3)=4 : C(4)=5 : C(5)=6 : C(6)=7
Rem *** read the data into the arrays
'
For N=0 To NRAIN-1
Restore "Rn"+Mid$(Str$(N),2)
For C=0 To 279
Read CC(C(N),C)
Next
Next
'
'
Ink 1 : Bar 0,0 To 40,256
Ink 2 : Bar 41,0 To 80,256
Ink 3 : Bar 81,0 To 120,256
Ink 4 : Bar 121,0 To 160,256
Ink 5 : Bar 161,0 To 200,256
Ink 6 : Bar 201,0 To 240,256
Ink 7 : Bar 241,0 To 280,256
'
'
Print "8 colour screen. (3 bit planes)"
Print "Press Mouse Button to get 7 rainbows"
Print "and 1792 unique colours!"
Repeat : Wait 5 : Until Mouse Key
'
Rem *** call the multi_rainbow procedure
'
Proc _MULTIPLE_RAINBOWS[30]
'
Repeat : Until Mouse Key
Copper On : Wait 100 : Fade 2 : Wait 30
End
'
Procedure _MULTIPLE_RAINBOWS[Y]
' Ensure the display is stable
Wait Vbl : View : Wait Vbl : View : Wait Vbl
' Copy the actual copper list in a memory bank
Reserve As Work 10,11*1024
L=0
Repeat
C=Leek(Cop Logic+L)
Loke Start(10)+L,C
L=L+4
Until C=$FFFFFFFE
' No more copper
Copper Off : Wait Vbl
' Where to poke the new list
ACOP=Cop Logic : ACH=Start(10)
' Copy the sprites definitions
Cop Move 0,0
Loke ACOP,Leek(ACH)
Add ACOP,4 : Add ACH,4
For N=0 To 15
Cop Move 0,0
Loke ACOP,Leek(ACH)
Add ACOP,4 : Add ACH,4
Next
' Copper-list creation loop
Y=30 : YRAIN=0
Do
' Wait for the first line
Cop Wait 7,Y : ACOP=ACOP+4
' Get the first position from AMOS list
CY=Deek(ACH)/256+YBASE
If Y=CY
' We take the first instruction in AMOS original
' copper list. This instruction is a WAIT...
ACH=ACH+4 : C1=Deek(ACH)
If(C1 and 1)=0
' We are defining a new screen. Best solution is
' to copy the original definition. We must only
' change the colours according to the new rainbows...
Do
C1=Deek(ACH) : C2=Deek(ACH+2)
Exit If(C1 and 1)<>0
' Is the colour copied a colour included in one
' of the rainbow?
For C=0 To NRAIN-1
If C1=C(C)*2+$180
C2=CC(C(C),YRAIN)
End If
Next
Add ACH,4
Cop Move 0,0
Doke ACOP,C1 : Doke ACOP+2,C2 : Add ACOP,4
Loop
End If
Else
' It is not a screen, lets simply put the current
' colours for all the rainbows
For C=0 To NRAIN-1
Cop Move $180+C(C)*2,CC(C(C),YRAIN) : Add ACOP,4
Next
End If
' Next line
Inc Y : Inc YRAIN
' In PAL, lets skip the 255 wait
If Y=256 : YBASE=256 : End If
' When do we exit?
Exit If Y>311
Exit If YRAIN>279
Exit If ACOP-Cop Logic>10*1024
Loop
' The end of the list!
Cop Wait 255,255
' Everything is finished, lets display it
Cop Swap : Wait Vbl
End Proc
'
Rem *** the first rainbow definition
RN0:
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$0,$0
Data $75,$75,$75,$75,$75,$75,$75,$75
Data $75,$75,$75,$75,$75,$75,$75,$75
Data $175,$175,$175,$175,$175,$175,$175,$175
Data $275,$275,$275,$275,$275,$275,$275,$275
Data $375,$375,$375,$375
Data $475,$475,$475,$475,$475,$475,$475,$475
Data $575,$575,$575,$575,$575,$575,$575,$575
Data $675,$675,$675,$675,$675,$675,$675,$675
Data $775,$775,$775,$775,$775,$775,$775,$775
Data $875,$875,$875,$875,$875,$875,$875,$875
Data $975,$975,$975,$975,$975,$975,$975,$975
Data $A75,$A75,$A75,$A75,$A75,$A75,$A75,$A75
Data $B75,$B75,$B75,$B75,$B75,$B75,$B75,$B75
Data $C75,$C75,$C75,$C75,$C75,$C75,$C75,$C75
Data $D75,$D75,$D75,$D75,$D75,$D75,$D75,$D75
Data $E75,$E75,$E75,$E75,$E75,$E75,$E75,$E75
Data $F75,$F75,$F75,$F75,$F75,$F75,$F75,$F75
Data $F85,$F85,$F85,$F85,$F85,$F85,$F85,$F85
Data $F95,$F95,$F95,$F95,$F95,$F95,$F95,$F95
Data $FA5,$FA5,$FA5,$FA5,$FA5,$FA5,$FA5,$FA5
Data $FB5,$FB5,$FB5,$FB5,$FB5,$FB5,$FB5,$FB5
Data $FC5,$FC5,$FC5,$FC5,$FC5,$FC5,$FC5,$FC5
Data $A00,$900,$800,$700,$600,$500,$400,$300
Data $200,$100,$600,$600,$600,$600,$600,$300
Data $400,$500,$600,$700,$800,$900,$A00,$A00
Data $900,$800,$700,$600,$500,$400,$300,$200
Data $100,$600,$600,$600,$600,$600,$300,$400
Data $500,$600,$700,$800,$900,$A00,$A00,$900
Data $800,$700,$600,$500,$400,$300,$200,$100
Data $600,$600,$600,$600,$600,$300,$400,$500
Data $600,$700,$800,$900,$A00,$A00,$900,$800
Data $700,$600,$500,$400,$300,$200,$100,$600
Data $600,$600,$600,$600,$300,$400,$500,$600
Data $700,$800,$900,$A00,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
'
'
Rem *** the second rainbow definition
'
RN1:
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$479,$479,$479
Data $579,$579,$579,$579,$579,$579,$579,$579
Data $679,$679,$679,$679,$679,$679,$679,$679
Data $779,$779,$779,$779,$779,$779,$779,$779
Data $879,$879,$879,$879,$879,$879,$879,$879
Data $979,$979,$979,$979,$979,$979,$979,$979
Data $A79,$A79,$A79,$A79,$A79,$A79,$A79,$A79
Data $B79,$B79,$B79,$B79,$B79,$B79,$B79,$B79
Data $C79,$C79,$C79,$C79,$C79,$C79,$C79,$C79
Data $D79,$D79,$D79,$D79,$D79,$D79,$D79,$D79
Data $E79,$E79,$E79,$E79,$E79,$E79,$E79,$E79
Data $F79,$F79,$F79,$F79,$F79,$F79,$F79,$F79
Data $100,$100,$100,$100,$100,$100,$100,$100
Data $110,$110,$110,$110,$110,$110,$110,$110
Data $220,$220,$220,$220,$220,$220,$220,$220
Data $330,$330,$330,$330,$330,$330,$330,$330
Data $440,$440,$440,$440,$440,$440,$440,$440
Data $540,$540,$540,$540,$540,$540,$540,$540
Data $640,$640,$640,$640,$640,$640,$640,$640
Data $740,$740,$740,$740,$740,$740,$740,$740
Data $840,$840,$840,$840,$840,$840,$840,$840
Data $940,$940,$940,$940,$940,$940,$940,$940
Data $A40,$A40,$A40,$A40,$A40,$A40,$A40,$A40
Data $B40,$B40,$B40,$B40,$B40,$B40,$B40,$B40
Data $C40,$C40,$C40,$C40,$C40,$C40,$C40,$C40
Data $D40,$D40,$D40,$D40,$0,$0,$0,$0
Data $2A1,$2A1,$2A1,$2A1,$2A1,$2A1,$2A1,$2A1
Data $2A1,$2A1,$2A1,$2A1,$EE0,$CC0,$AA0,$880
Data $660,$E0E,$C0C,$A0A,$808,$606,$EE,$CC
Data $AA,$88,$66,$2A1,$2A1,$2A1,$EE0,$CC0
Data $AA0,$880,$660,$E0E,$C0C,$A0A,$808,$606
Data $EE,$CC,$AA,$88,$66,$2A1,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
'
Rem *** the 3rd rainbow definition
'
RN2:
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $88,$88,$88,$88,$88,$88,$88,$88
Data $98,$98,$98,$98,$98,$98,$98,$98
Data $A8,$A8,$A8,$A8,$A8,$A8,$A8,$A8
Data $B8,$B8,$B8,$B8,$B8,$B8,$B8,$B8
Data $C8,$C8,$C8,$C8,$C8,$C8,$C8,$C8
Data $D8,$D8,$D8,$D8,$D8,$D8,$D8,$D8
Data $D40,$C30,$B20,$F61,$E50,$D40,$C30,$B20
Data $F61,$E50,$D40,$C30,$B20,$A10,$F61,$E50
Data $D40,$C30,$B20,$A10,$F61,$E50,$D40,$C30
Data $B20,$A10,$900,$F61,$E50,$D40,$C30,$B20
Data $A10,$900,$F61,$E50,$D40,$C30,$B20,$A10
Data $900,$800,$F61,$E50,$D40,$C30,$B20,$A10
Data $900,$800,$F61,$E50,$D40,$C30,$B20,$A10
Data $EEE,$DDD,$EEE,$DDD,$EEE,$DDD,$CCC,$EEE
Data $DDD,$CCC,$EEE,$DDD,$CCC,$BBB,$EEE,$DDD
Data $CCC,$BBB,$EEE,$DDD,$CCC,$BBB,$AAA,$EEE
Data $DDD,$CCC,$BBB,$AAA,$EEE,$DDD,$CCC,$BBB
Data $AAA,$999,$EEE,$DDD,$CCC,$BBB,$AAA,$999
Data $EEE,$DDD,$CCC,$BBB,$AAA,$999,$888,$EEE
Data $DDD,$CCC,$BBB,$AAA,$999,$888,$EEE,$DDD
Data $CCC,$BBB,$AAA,$999,$888,$777,$EEE,$DDD
Data $CCC,$BBB,$AAA,$999,$888,$777,$EEE,$DDD
Data $CCC,$BBB,$AAA,$999,$888,$777,$666,$555
Data $444,$333,$222,$111,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$F00,$0,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
'
'
' the 4th
'
RN3:
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $888,$888,$888,$888,$888,$888,$888,$888
Data $898,$898,$898,$898,$898,$898,$898,$898
Data $8A8,$8A8,$8A8,$8A8,$8A8,$8A8,$8A8,$8A8
Data $8B8,$8B8,$8B8,$8B8,$8B8,$8B8,$8B8,$8B8
Data $8C8,$8C8,$8C8,$8C8,$8C8,$8C8,$8C8,$8C8
Data $8D8,$8D8,$8D8,$8D8,$8D8,$8D8,$8D8,$8D8
Data $D4,$C3,$B2,$F6,$E5,$D4,$C3,$B2
Data $F6,$E5,$D4,$C3,$B2,$A1,$F6,$E5
Data $D4,$C3,$B2,$A1,$F6,$E5,$D4,$C3
Data $B2,$A1,$90,$F6,$E5,$D4,$C3,$B2
Data $A1,$90,$F6,$E5,$D4,$C3,$B2,$A1
Data $90,$80,$F6,$E5,$D4,$C3,$B2,$A1
Data $90,$80,$F6,$E5,$D4,$C3,$B2,$A1
Data $EE,$DD,$EE,$DD,$EE,$DD,$CC,$EE
Data $DD,$CC,$EE,$DD,$CC,$BB,$EE,$DD
Data $CC,$BB,$EE,$DD,$CC,$BB,$AA,$EE
Data $DD,$CC,$BB,$AA,$EE,$DD,$CC,$BB
Data $AA,$99,$EE,$DD,$CC,$BB,$AA,$99
Data $EE,$DD,$CC,$BB,$AA,$99,$88,$EE
Data $DD,$CC,$BB,$AA,$99,$88,$EE,$DD
Data $CC,$BB,$AA,$99,$88,$77,$EE,$DD
Data $CC,$BB,$AA,$99,$88,$77,$EE,$DD
Data $CC,$BB,$AA,$99,$88,$77,$66,$55
Data $44,$33,$22,$11,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$F00,$0,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
'
' the 5th
RN4:
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$0,$0
Data $111,$111,$111,$111,$111,$111,$111,$111
Data $222,$222,$222,$222,$222,$222,$222,$222
Data $333,$333,$333,$333,$333,$333,$333,$333
Data $444,$444,$444,$444,$444,$444,$444,$444
Data $555,$555,$555,$555
Data $666,$666,$666,$666,$666,$666,$666,$666
Data $777,$777,$777,$777,$777,$777,$777,$777
Data $888,$888,$888,$888,$888,$888,$888,$888
Data $999,$999,$999,$999,$999,$999,$999,$999
Data $AAA,$AAA,$AAA,$AAA,$AAA,$AAA,$AAA,$AAA
Data $BBB,$BBB,$BBB,$BBB,$BBB,$BBB,$BBB,$BBB
Data $CCC,$CCC,$CCC,$CCC,$CCC,$CCC,$CCC,$CCC
Data $DDD,$DDD,$DDD,$DDD,$DDD,$DDD,$DDD,$DDD
Data $EEE,$EEE,$EEE,$EEE,$EEE,$EEE,$EEE,$EEE
Data $FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF
Data $FF0,$FF0,$FF0,$FF0,$FF0,$FF0,$FF0,$FF0
Data $FF1,$FF1,$FF1,$FF1,$FF1,$FF1,$FF1,$FF1
Data $FF2,$FF2,$FF2,$FF2,$FF2,$FF2,$FF2,$FF2
Data $FF3,$FF3,$FF3,$FF3,$FF3,$FF3,$FF3,$FF3
Data $FF4,$FF4,$FF4,$FF4,$FF4,$FF4,$FF4,$FF4
Data $FF5,$FF5,$FF5,$FF5,$FF5,$FF5,$FF5,$FF5
Data $FF6,$FF6,$FF6,$FF6,$FF6,$FF6,$FF6,$FF6
Data $A01,$901,$801,$701,$601,$501,$401,$301
Data $202,$102,$602,$602,$602,$602,$602,$302
Data $403,$503,$603,$703,$803,$903,$A03,$A03
Data $904,$804,$704,$604,$504,$404,$304,$204
Data $105,$605,$605,$605,$605,$605,$305,$405
Data $506,$606,$706,$806,$906,$A06,$A06,$906
Data $807,$707,$607,$507,$407,$307,$207,$107
Data $608,$608,$608,$608,$608,$308,$408,$508
Data $609,$709,$809,$909,$A09,$A09,$909,$809
Data $70A,$60A,$50A,$40A,$30A,$20A,$10A,$60A
Data $60B,$60B,$60B,$60B,$30B,$40B,$50B,$60B
Data $70C,$80C,$90C,$A0C,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
'
'
' the 6th
'
RN5:
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$0,$0
Data $101,$101,$101,$101,$101,$101,$101,$101
Data $202,$202,$202,$202,$202,$202,$202,$202
Data $303,$303,$303,$303,$303,$303,$303,$303
Data $404,$404,$404,$404,$404,$404,$404,$404
Data $505,$505,$505,$505
Data $606,$606,$606,$606,$606,$606,$606,$606
Data $707,$707,$707,$707,$707,$707,$707,$707
Data $808,$808,$808,$808,$808,$808,$808,$808
Data $909,$909,$909,$909,$909,$909,$909,$909
Data $A0A,$A0A,$A0A,$A0A,$A0A,$A0A,$A0A,$A0A
Data $B0B,$B0B,$B0B,$B0B,$B0B,$B0B,$B0B,$B0B
Data $C0C,$C0C,$C0C,$C0C,$C0C,$C0C,$C0C,$C0C
Data $D0D,$D0D,$D0D,$D0D,$D0D,$D0D,$D0D,$D0D
Data $E0E,$E0E,$E0E,$E0E,$E0E,$E0E,$E0E,$E0E
Data $F0F,$F0F,$F0F,$F0F,$F0F,$F0F,$F0F,$F0F
Data $E0F,$E0F,$E0F,$E0F,$E0F,$E0F,$E0F,$E0F
Data $D0F,$D0F,$D0F,$D0F,$D0F,$D0F,$D0F,$D0F
Data $C0F,$C0F,$C0F,$C0F,$C0F,$C0F,$C0F,$C0F
Data $B0F,$B0F,$B0F,$B0F,$B0F,$B0F,$B0F,$B0F
Data $A0F,$A0F,$A0F,$A0F,$A0F,$A0F,$A0F,$A0F
Data $90F,$90F,$90F,$90F,$90F,$90F,$90F,$90F
Data $80F,$80F,$80F,$80F,$80F,$80F,$80F,$80F
Data $81E,$81E,$81E,$81E,$81E,$81E,$81E,$81E
Data $71D,$71D,$71D,$71D,$71D,$71D,$71D,$71D
Data $61C,$61C,$61C,$61C,$61C,$61C,$61C,$61C
Data $51B,$51B,$51B,$51B,$51B,$51B,$51B,$51B
Data $41A,$41A,$41A,$41A,$41A,$41A,$41A,$41A
Data $42A,$42A,$42A,$42A,$42A,$42A,$42A,$42A
Data $43A,$43A,$43A,$43A,$43A,$43A,$43A,$43A
Data $44A,$44A,$44A,$44A,$44A,$44A,$44A,$44A
Data $45A,$45A,$45A,$45A,$45A,$45A,$45A,$45A
Data $469,$469,$469,$469,$469,$469,$469,$469
Data $478,$478,$478,$478,$478,$478,$478,$478
Data $477,$477,$477,$477,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
'
' the 7th
'
RN6:
Data $0,$0,$0,$0,$0,$0,$0,$0
Data $0,$0,$0,$0
Data $11,$11,$11,$11,$11,$11,$11,$11
Data $22,$22,$22,$22,$22,$22,$22,$22
Data $33,$33,$33,$33,$33,$33,$33,$33
Data $44,$44,$44,$44,$44,$44,$44,$44
Data $55,$55,$55,$55
Data $66,$66,$66,$66,$66,$66,$66,$66
Data $77,$77,$77,$77,$77,$77,$77,$77
Data $88,$88,$88,$88,$88,$88,$88,$88
Data $99,$99,$99,$99,$99,$99,$99,$99
Data $AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA
Data $BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB
Data $CC,$CC,$CC,$CC,$CC,$CC,$CC,$CC
Data $DD,$DD,$DD,$DD,$DD,$DD,$DD,$DD
Data $EE,$EE,$EE,$EE,$EE,$EE,$EE,$EE
Data $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
Data $EF,$EF,$EF,$EF,$EF,$EF,$EF,$EF
Data $DF,$DF,$DF,$DF,$DF,$DF,$DF,$DF
Data $CF,$CF,$CF,$CF,$CF,$CF,$CF,$CF
Data $BF,$BF,$BF,$BF,$BF,$BF,$BF,$BF
Data $AF,$AF,$AF,$AF,$AF,$AF,$AF,$AF
Data $9F,$9F,$9F,$9F,$9F,$9F,$9F,$9F
Data $8F,$8F,$8F,$8F,$8F,$8F,$8F,$8F
Data $8E,$8E,$8E,$8E,$8E,$8E,$8E,$8E
Data $7D,$7D,$7D,$7D,$7D,$7D,$7D,$7D
Data $6C,$6C,$6C,$6C,$6C,$6C,$6C,$6C
Data $5B,$5B,$5B,$5B,$5B,$5B,$5B,$5B
Data $4A,$4A,$4A,$4A,$4A,$4A,$4A,$4A
Data $4A,$4A,$4A,$4A,$4A,$4A,$4A,$4A
Data $4A,$4A,$4A,$4A,$4A,$4A,$4A,$4A
Data $4A,$4A,$4A,$4A,$4A,$4A,$4A,$4A
Data $4A,$4A,$4A,$4A,$4A,$4A,$4A,$4A
Data $69,$69,$69,$69,$69,$69,$69,$69
Data $78,$78,$78,$78,$78,$78,$78,$78
Data $77,$77,$77,$77,$0,$0,$0,$0
Data $0,$0,$0,$0,$0,$0,$0,$0
'