English Amiga Board


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

 
 
Thread Tools
Old 24 August 2019, 14:07   #21
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
Quote:
Originally Posted by Havie View Post
Could you show me this in code as I don't understand what you mean...sorry, being a bit thick.
Basically, the DisplayControls command appears to carry out an Exclusive-OR with the arguments for BPLCON2 and BPLCON4 and their defaults, but not with BPLCON3. Exclusive-OR (XOR) is a simple logical function that reverses all the bits involved. So, carrying it out twice on the same value will give you back the original value, meaning you can eliminate the effects of the XOR on BPLCON2 and 4 by carrying out a pre-XOR on them.

Something like this:
Code:
; Xor %100001 with the default $224 to get the rear playfield behind all sprites, and the front playfield behind channels 0 & 1 only
; $1C00 sets 2nd playfield palette to start at 16
; Xor $23 with the default $11 to set sprite bank 3 for odd & joined sprites, and bank 2 for even sprites
DisplayControls 0, Xor(%100001, $224), $1C00, Xor($23, $11)
Daedalus is offline  
Old 14 January 2020, 23:40   #22
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,164
I just want all sprites to be above the bitplanes (no dual playfield)

BPLCON2 was set to 0, and sprites are behind the bitplanes.

Tried to set to $1F made no difference. Someone help?
jotd is offline  
Old 15 January 2020, 00:57   #23
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,212
$24
DanScott is offline  
Old 15 January 2020, 06:45   #24
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,164
bplcon2 <= $24: that works. Thanks! All sprites are on the foreground.

I wonder why the documentation is so hard to understand / lacks simple basic examples like this. That's the second time someone answers with an hex value and I put it in my code and it works exactly as I intended. Thanks again.
jotd is offline  
Old 15 January 2020, 09:52   #25
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
Just to explain the magic number: some examples are sadly lacking from the Blitz documentation, but the register is universal across languages so you can read more detail about it here. For a non-dual-playfield display, bits 5-3 set the priority, with %100 being what you're looking for to put all sprites above the playfield. So you want a value of %00100000, which is $20 (or %00100100 to also cover dual playfield displays, which is $24).

The additional problem is that Blitz XORs the default value with the given value, so to apply a value, you need to bear this in mind as simply giving the desired value won't always work. That's why I pre-XOR the values in my examples, so I would do it this way for sprite priority:

Code:
DisplayControls 0, Xor(%00100100, $224), $1C00, 0
The information is there, it's just not as clear as it should be unfortunately...
Daedalus is offline  
Old 15 January 2020, 17:02   #26
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,164
thanks! I see that a lot of things can be done with sprites/playfields, and it can depend on the sprite number as well!
jotd is offline  
Old 15 January 2020, 18:37   #27
rcman
Long time Amiga Owner
 
rcman's Avatar
 
Join Date: Jun 2017
Location: Uxbridge Canada
Age: 56
Posts: 182
Daedalus:

I am always so impressed with you. Your wealth of knowledge is amazing.

Is there not a autobiography on you? Your accomplishments, reward etc? I for one would read that.


RC
rcman is offline  
Old 15 January 2020, 22:03   #28
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
Haha, cheers! That's just a misspent youth, nothing more
Daedalus is offline  
Old 15 January 2020, 22:57   #29
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,410
On the topic of sprite priorities, are there some good examples in either games of demos of sprites used while having "odd" or unusual priority schemes?

I've often wondered what could be achieved this way and some examples always kickstart my imagination.
roondar 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
Changing sprite images in long display lists phx Coders. Asm / Hardware 2 12 March 2016 20:13
MagicMenu Task Priority NovaCoder support.Apps 2 10 February 2013 10:42
More settings in priority panel Thom87 request.UAE Wishlist 2 24 January 2008 15:23
priority resets after reset jrom support.WinUAE 0 10 April 2004 16:05

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 18:30.

Top

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