View Single Post
Old 06 September 2019, 10:00   #28
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,423
Quote:
Originally Posted by NorthWay View Post
For AGA colours you bank in/out banks of 32 colours and upper/lower 12-bit halfs of the 24-bit colour.
Which means that on boot-up it will default to the first 32 colours and upper 12 bits.

Incidently, writing to the upper 12 bits will copy the exact same value to the lower 12 bits. So write the lower 12 bits last.
Now we're talking AGA setting anyway, here's the way to select banks & select between upper and lower 12 bits. To select the colour bank, use register BPLCON3 ($106). Bits 13-15 select which bank you wish to use (numbered 0-7). Each bank is the next 32 colours in the palette.

Code:
Copper example:
select bank 0: $0106,$0000 ; colours 0-31
select bank 1: $0106,$2000 ; colours 32-63
...
select bank 7: $0106,$E000 ; colours 224-255
Note: the other bits of BPLCON3 have other functions such as border blanking or the second playfields colour index offset*. I've set those to zero in the example above, but they should be set as required by the program.

To select whether writes to colour registers set the upper or lower colour 12 bits, register BPLCON3 is used again. Bit 9 selects upper or lower bits. Set this bit to 0 to set the upper 12 bits and set to 1 to set the lower 12 bits. This setting should be combined with the bank number.
Code:
Copper example:
select bank 0/upper 12 bits of colour: $0106,$0000 ; upper 12 bits of colours 0-31
select bank 0/lower 12 bits of colour: $0106,$0200 ; lower 12 bits of colours 0-31
select bank 1/upper 12 bits of colour: $0106,$2000 ; upper 12 bits of colours 32-63
select bank 1/lower 12 bits of colour: $0106,$2200 ; lower 12 bits of colours 32-63
...
select bank 7/upper 12 bits of colour: $0106,$E000 ; upper 12 bits of colours 224-255
select bank 7/lower 12 bits of colour: $0106,$E200 ; lower 12 bits of colours 224-255
As before: I've set all other bits to zero, but they should be set as required by the program.

*) for more information on all things AGA, including BPLCON3 settings, see: http://www.stashofcode.fr/code/affic...ndyOfComax.txt

On the 68000 vs X86 topic: not sure that is on topic and I do believe this thread is already a split thread of a split thread
(but I'd agree that 68000 is nicer to write )

Last edited by roondar; 06 September 2019 at 10:16. Reason: Added colour numbers
roondar is offline  
 
Page generated in 0.04328 seconds with 10 queries