View Single Post
Old 24 August 2019, 14:07   #21
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,335
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  
 
Page generated in 0.12281 seconds with 11 queries