English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 20 December 2018, 02:05   #1
E-Penguin
Banana

E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 873
Sprite multiplexing & copper bars?

I like the background gradient effects the copper gives, and this is relatively easy to get with DisplayRGB, but that's incompatible with CustomSprites (one is per line, one is per display, so far so understood). I'd really like both, and I'm sure it must be possible.

I've read the post here about CustomColours but I can't see how to make that work in practice - the palette change would have to take place in between the scanlines. One sets up the "changed" palette and CustomColours effects those changes at a given vertical position - difficult to repeatedly bang the same register. If I've misunderstood please let me know!

Which leaves us with CustomStrings, which is a Copper Wait for vertical position, from what I can tell. Can I use this to trigger a Copper Interrupt at a given vpos, which I then process with an interrupt handler? (SetInt 4).

Am I overthinking it?
E-Penguin is offline  
Old 20 December 2018, 02:12   #2
E-Penguin
Banana

E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 873
Ah, no, it can do it directly, but the question is how do I get this into the "string" format Blitz wants? I've tried #1800000 and "1800000" but no luck

Quote:
dc.w $180,$0000 - Background colour to black
dc.w $180,$0f00 - Background colour to red
E-Penguin is offline  
Old 20 December 2018, 23:59   #3
E-Penguin
Banana

E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 873
This is apparently how one uses CustomStrings
Code:
co$=Mki$($180)+Mki$($0f00) ; move f to col0
CustomString 0,0,8,co$
but only the last "CustomString" or "CustomSprite" takes effect. Ones before are overwritten, or ignored, or something. I tried playing with the COOffset parameter but I have had no luck and frankly am none the wiser.
E-Penguin is offline  
Old 22 December 2018, 02:42   #4
Shatterhand
Warhasneverbeensomuchfun

Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 36
Posts: 3,437
I've managed to use CustomSprites in both my games Roadtrip and Santa Chaos, but it's VERY limited and it eats a lot of Copper time.

With it you can basically divide your display on 2 sections... the upper one have its own sprites ( from 0 to 7) and the lower one will get their own sprites too (from 8 to 15). If you try to draw sprites from one section on the other section you'll get lots of glitches on screen.

That's all you can do with it. You can do some interesting stuff with it with some planning, but you can't pull off a Mega Typhoon thing with a shitload of sprites all around the screen

I really would love to be able to draw sprites with the Copper on Blitz Basic, but I have no idea of how to do it. I am pretty sure it can be done without wasting so much time from the copper as CustomSprites does.
Shatterhand is offline  
Old 22 December 2018, 10:31   #5
E-Penguin
Banana

E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 873
I see from your Santa Chaos source (thanks, by the way!) that you have managed to get both DisplayRGB and CustomSprites working together. I totally failed at that, always getting errors about not enough copper space, no matter how many "custom coppers" I allocated in InitCopper.

Why CCOffset=6? I don't really understand what that variable does.
E-Penguin is offline  
Old 22 December 2018, 14:38   #6
Shatterhand
Warhasneverbeensomuchfun

Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 36
Posts: 3,437
Quote:
Originally Posted by E-Penguin View Post

Why CCOffset=6? I don't really understand what that variable does.
I was expecting you to ask me this, and I am glad you did it......

... because I have NO IDEA and the manual doesn't explain it either! I got it right by luck! (Well, actually after testing it for a while, I cound half understand it)

I can tell you what I did

If you look at the mess that's my code, I use a Display RGB to do the gradient on the sky.

With CCOffset = 0, the DisplayRGB there does not work, but the sprite split was done properly. As I use higher values, it's like the split is done at lower parts of the screen, as DisplayRGB works partially. With the value I inserted, I could use display RGB up until the first horizontal orange line on the image. The vertical area shows an area where if I try to draw ANY sprites there, I get glitches. So I figured out all this area is used by the copper to "reset" the sprites.



So I feel the CCOffset somehow tells the display where it should start doing the "sprite reset", and from this line up to the next few lines you won't be able to use any other copper commands.. But I am not sure about that.

On Roadtrip I usde CCOffset = 0 and on the next argument I just passed the height I wanted the sprite reset to be done, but as the space between the "upper" sprites and the "lower" sprites was rather big, I had no trouble with it. And the DisplayRGB I used there was way below on screen, so I had zero trouble using everything together.
Shatterhand is offline  
Old 22 December 2018, 18:07   #7
Cobe
Registered User

 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 37
Posts: 701
Once I used displayscroll that has ccoffset at the end and after experimenting i figured out that its value actully has to match the value of custom copper space at the end of the initcop.

Meaning, the way I understood it, if you already use some command like displayrgb that allocates certain number of copper instructions per line, thats the number that ccoffset's gonna be.
For example in my instance I had AGA copper bars and if I had ccoffset lower than 4 copper bars appeared less colorful(ocs like).

Last edited by Cobe; 22 December 2018 at 21:21.
Cobe is offline  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Midi and Bars & Pipes and presentation Gustau support.Amiga Forever 1 15 July 2018 20:42
Sprite multiplexing on Amiga majikeyric Coders. General 28 25 January 2018 18:03
Bars & Pipes Internal Sounds? Vaninna support.Apps 4 06 August 2016 13:55
Bars & Pipes Professional Ricebug New to Emulation or Amiga scene 0 08 February 2012 04:32
Copper Bars Vortex Coders. Tutorials 51 27 June 2009 00:23

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 Jump


All times are GMT +2. The time now is 17:15.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.06654 seconds with 13 queries