English Amiga Board How to do AGA copperbars in Blitz using display library
 Register Amiga FAQ Rules & Help Members List  /  Moderators List Today's Posts Mark Forums Read

 09 June 2013, 11:57 #1 Coagulus Gets there in the end...   Join Date: Sep 2005 Location: Wales Posts: 637 How to do AGA copperbars in Blitz using display library Hi, I know it's very old hat but I'm retro through and through . Anyone know if it's possible to do the classic bouncing AGA copper bars in Blitz using the display library? Coagulus
 02 November 2013, 19:03 #2 Coagulus Gets there in the end...   Join Date: Sep 2005 Location: Wales Posts: 637 Well, I decided to play with the Displayrainbow command and bars can be done. The code is not the best I'm sure, but it produces AGA bars! Code: ```; AGA copperbars by Coagulus InitPalette 0,256 BitMap 0,320,256,8 For a=0 To 255 AGAPalRGB 0,a,0,0,0 Next Dim bar(32) Dim bary(3) ; 1-red 2-green 3-blue Dim baryt(3) Dim barydir(3) For a=1 To 16 bar(a-1)=(a*16)-1 Next For a=16 To 1 Step -1 bar(15+(17-a))=(a*16)-1 Next baryt(0)=-3 baryt(2)=3 barydir(0)=1 barydir(1)=1 barydir(2)=1 VWait 150 BLITZ SpriteMode 2 InitCopList 0,34,256,\$10000|\$08|\$10|\$400,8,256,-4 CreateDisplay 0 DisplayPalette 0,0 Cls 0 Repeat DisplayBitMap 0,0 DisplayRainbow 0,0,0 For a=0 To 255 AGAPalRGB 0,a,0,0,0 ; blank the palette Next For a=0 To 2 bary(a)=bary(a)+baryt(a) baryt(a)=baryt(a)+barydir(a) If Abs(baryt(a))=13 Then barydir(a)=0-barydir(a) Next For a=0 To 31 AGAPalRGB 0,32+a+bary(0),bar(a),0,0 Next For a=0 To 31 AGAPalRGB 0,32+a+bary(1),0,bar(a),0 Next For a=0 To 31 AGAPalRGB 0,32+a+bary(2),0,0,bar(a) Next VWait Until Joyb(0) OR Joyb(1) End```
 11 January 2015, 21:39 #3 Cylon Registered User   Join Date: Oct 2014 Location: Europe Posts: 466 (dig out) I hope you use Newtypes for this kind of stuff nowadays? It looks a little bit Amos-like to me....
 13 January 2015, 00:02 #4 Coagulus Gets there in the end...   Join Date: Sep 2005 Location: Wales Posts: 637 Haha, I have been known to use them. I'm afraid my code hasn't changed much since the zx spectrum!
01 February 2015, 02:38   #5
Cylon
Registered User

Join Date: Oct 2014
Location: Europe
Posts: 466
Quote:
 Originally Posted by Coagulus Haha, I have been known to use them. I'm afraid my code hasn't changed much since the zx spectrum!

Code:
``` For a=0 To 31
AGAPalRGB 0,32+a+bary(0),bar(a),0,0
;Next
;For a=0 To 31
AGAPalRGB 0,32+a+bary(1),0,bar(a),0
;Next
;For a=0 To 31
AGAPalRGB 0,32+a+bary(2),0,0,bar(a)
Next```
also,

Code:
```DisplayBitMap 0,0
Repeat
;DisplayBitMap 0,0
DisplayRainbow 0,0,0

;For a=0 To 255
;  AGAPalRGB 0,a,0,0,0 ; blank the palette
;Next
InitPalette 0,256   ;< this is an ASM routine inside the blitzlib! trust me: it is faster!

For a=0 To 2
bary(a)=bary(a)+baryt(a)
baryt(a)=baryt(a)+barydir(a)
If Abs(baryt(a))=13 Then barydir(a)=0-barydir(a)
Next```
And, while setting up the bars:
this
Code:
```For a=1 To 16
bar(a-1)=(a*16)-1
Next
For a=16 To 1 Step -1
bar(15+(17-a))=(a*16)-1
Next```
becomes
Code:
```;we try to create bars of 32pixl height:
;the saturation value should spread from 0to255 (AGA),
;the bar appears to be 3d-like.

For a=0 To 15
bar(a)   = (a*16)       ;we donot reach 255 here...
bar(a+15)= ((16-a)*16)
Next```
Isn't that nice?

Last edited by Cylon; 01 February 2015 at 05:46. Reason: more text, updates

01 February 2015, 03:32   #6
Cylon
Registered User

Join Date: Oct 2014
Location: Europe
Posts: 466
AGA Copper Bars by Coagulus

So, my edits would lead to this:
Code:
```; AGA copperbars by Coagulus (EAB)
; modified by Cylon (EAB)

DEFTYPE.w

InitPalette 0,256

BitMap 0,320,256,1  ;just 1 bplane needed! saves chipmem!

Dim bar(32)    ;saturation value (0-255) of bar y line
Dim bary(3)    ; 1-red 2-green 3-blue
Dim baryt(3)
Dim barydir(3)

;we create bars of 32pixl height:
For a=0 To 15
bar(a)   = (a*16)
bar(a+15)= ((16-a)*16)
Next

baryt(0)=-3
baryt(2)=3
barydir(0)=1
barydir(1)=1
barydir(2)=1

VWait 100    ;two seconds is enough before takin' the machine over

BLITZ

;SpriteMode 2 ;not needed.

;1bitplane 24bit(256,256,256) aga coplist
;again: we use the copper only, so 1 bplane is enough.
InitCopList 0,34,256,\$10000|\$01|\$10|\$400,8,1,-4
CreateDisplay 0

DisplayPalette 0,0
DisplayBitMap 0,0

Repeat
VWait
DisplayRainbow 0,0,0

InitPalette0,256

For a=0 To 2
bary(a) +baryt(a)
baryt(a)+barydir(a)
If Abs(baryt(a)) = 13 Then barydir(a)=0-barydir(a)
Next

For a=0 To 31
AGAPalRGB 0,32+a+bary(0),bar(a),0,0
AGAPalRGB 0,32+a+bary(1),0,bar(a),0
AGAPalRGB 0,32+a+bary(2),0,0,bar(a)
Next

Until Joyb(0) OR Joyb(1)

End

CloseEd```
Next, we make it newtype style...maybe
Attached Thumbnails

Attached Files
 CoagulusAGAcops.lha (9.9 KB, 103 views)

Last edited by Cylon; 01 February 2015 at 04:34. Reason: adds, screenshot+exe

 01 February 2015, 17:13 #7 Coagulus Gets there in the end...   Join Date: Sep 2005 Location: Wales Posts: 637 That's cool, far more efficient!
 22 January 2016, 15:38 #8 nirvan75 Registered User   Join Date: Dec 2015 Location: italy Posts: 13 Hello guys, what about an OCS/ECS version of the above example?
24 January 2016, 22:47   #9
Cylon
Registered User

Join Date: Oct 2014
Location: Europe
Posts: 466
Quote:
 Originally Posted by nirvan75 Hello guys, what about an OCS/ECS version of the above example?
That is easy to adapt, why didn't you try it for yourself?

Code:
```; AGA copperbars by Coagulus (EAB)
; modified by Cylon (EAB)
; chg: added ecs support ( quick and dirty :P  )

DEFTYPE.w

InitPalette 0,256

BitMap 0,320,256,1  ;just 1 bplane needed! saves chipmem!

Dim bar(32)    ;saturation value (0-255) of bar y line
Dim bary(3)    ; 1-red 2-green 3-blue
Dim baryt(3)
Dim barydir(3)

;we create bars of 32pixl height:

If CheckAGA Then fact.w=16 Else fact.w=1

For a=0 To 15
bar(a)   = (a*fact)
bar(a+15)= ((16-a)*fact)
Next

baryt(0)=-3
baryt(2)=3
barydir(0)=1
barydir(1)=1
barydir(2)=1

VWait 100    ;two seconds is enough before takin' the machine over

BLITZ

;SpriteMode 2 ;not needed.

;1bitplane 24bit(256,256,256) aga coplist
;again: we use the copper only, so 1 bplane is enough.
InitCopList 0,34,256,\$10000|\$01|\$10|\$400,8,1,-4
CreateDisplay 0

DisplayPalette 0,0
DisplayBitMap 0,0

Repeat
VWait
DisplayRainbow 0,0,0

InitPalette0,256    ;256 cols eq 256 lines vertical

For a=0 To 2
bary(a) +baryt(a)
baryt(a)+barydir(a)
If QAbs(baryt(a)) = 13 Then barydir(a)=0-barydir(a)
Next

If CheckAGA
For a=0 To 31
AGAPalRGB 0,32+a+bary(0),bar(a),0,0
AGAPalRGB 0,32+a+bary(1),0,bar(a),0
AGAPalRGB 0,32+a+bary(2),0,0,bar(a)
Next
Else
For a=0 To 31
PalRGB 0,32+a+bary(0),bar(a),0,0
PalRGB 0,32+a+bary(1),0,bar(a),0
PalRGB 0,32+a+bary(2),0,0,bar(a)
Next
EndIf
Until Joyb(0) OR Joyb(1)

QAMIGA
VWait50

End

CloseEd
;eof```
Note: if you don't have the CheckAGA command than make it a variable like:
Code:
`CheckAGA=1`
Attached Files
 CoagulusCopBars.lha (10.5 KB, 66 views)

 25 January 2016, 15:53 #10 nirvan75 Registered User   Join Date: Dec 2015 Location: italy Posts: 13 so noobs like me can learn from the masters :P thanks!

 Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 Similar Threads Thread Thread Starter Forum Replies Last Post zombie10k support.Hardware 2 25 March 2010 20:54 doble07 support.Hardware 9 03 December 2009 08:56 Fingerlickin_B support.Hardware 6 11 September 2008 11:35 FrenchShark Coders. General 7 30 December 2007 16:40 Dela support.WinUAE 4 06 October 2002 21:59

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home News Main     Amiga scene     Retrogaming General Discussion     Nostalgia & memories Support     New to Emulation or Amiga scene         Member Introductions     support.WinUAE     support.WinFellow     support.OtherUAE     support.FS-UAE         project.AmigaLive     support.Hardware         Hardware mods         Hardware pics     support.Games     support.Demos     support.Apps     support.Amiga Forever     support.Amix     support.Other Requests     request.UAE Wishlist     request.Old Rare Games     request.Demos     request.Apps     request.Modules     request.Music     request.Other     Looking for a game name ?     Games images which need to be WHDified abime.net - Hall Of Light     HOL news     HOL suggestions and feedback     HOL data problems     HOL contributions abime.net - Amiga Magazine Rack     AMR news     AMR suggestions and feedback     AMR data problems     AMR contributions abime.net - Home Projects     project.Amiga Lore     project.EAB     project.IRC     project.Mods Jukebox     project.Wiki abime.net - Hosted Projects     project.aGTW     project.APoV     project.ClassicWB     project.Jambo!     project.Green Amiga Alien GUIDES     project.Maptapper     project.Sprites     project.WinUAE - Kaillera Other Projects     project.Amiga Demo DVD     project.Amiga Game Factory     project.CARE     project.EAB File Server     project.CD32 Conversion     project.Game Cover Art         GCA.Feedback and Suggestions         GCA.Work in Progress         GCA.Cover Requests         GCA.Usefull Programs         GCA.Helpdesk     project.KGLoad     project.MAGE     project.Missing Full Shareware Games     project.SPS (was CAPS)     project.TOSEC (amiga only)     project.WHDLoad         project.Killergorilla's WHD packs Misc     Amiga websites reviews     MarketPlace         Swapshop     Kinky Amiga Stuff     Collections     EAB's competition Coders     Coders. General         Coders. Releases         Coders. Tutorials     Coders. Asm / Hardware     Coders. System         Coders. Scripting         Coders. Nextgen     Coders. Language         Coders. C/C++         Coders. AMOS         Coders. Blitz Basic     Coders. Contest         Coders. Entries Off Topic     OT - General     OT - Entertainment     OT - Sports     OT - Technical     OT - Gaming

All times are GMT +2. The time now is 14:49.

 -- EAB3 skin ---- EAB2 skin ---- Mobile skin Archive - Top