13 January 2020, 16:38 | #1 |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
AGA Dual Playfield Colour Assignment
I'm mucking around with some dual playfield stuff on the A1200.
I've assigned my colours into the colour regs 0-31 and I'm expecting 0-15 to be assigned to playfield 1 and 16-31 assigned to playfield 2. While Playfield 1 is fine it seems playtfield 2 has all of the colours screwed up. I've had a read of the bits on BPLCON3 regarding if Playfield 2 is given priority - however this isn't the case. Is there anything special I need to do to get dual playfield working on AGA, am I missing something obvious? I'll probably get to the bottom of it later through trial and error but just wanted to ask as it wasn't shown after a search. mcgeezer |
13 January 2020, 16:50 | #2 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,409
|
Hmm, the documentation I could find does suggest you use BPLCON3 to set the palette offset. Is this the same documentation as you used?
Code:
bplcon3 EQU $106 ; 0 = EXTBLNKEN - external blank enable ; 1 = BRDSPRT - EXTBLKZD - external blank ored ; into trnsprncy- sprites on BORDERS! ; 2 = ZDCLKEN - zd pin outputs a 14mhz cloc ; 3 = NO FUNCTIONS - SET TO ZERO ; 4 = ECS BRDRTRAN Border opaque ; 5 = ECS BRDRBLNK Border blank ; 6 = AGA SPRES1 \sprite hires,lores,superhires ; 7 = AGA SPRES0 / ; 8 = NO FUNCTIONS - SET TO ZERO ; 9 = LOCT - palette high or low nibble colour ; 10 = PF2OF2 \ ; 11 = PF2OF1 } second playfield's offset in coltab ; 12 = PF2OF0 / ; 13 = BANK0 \ ; 14 = BANK1 } LOCT palette select 256 ; 15 = BANK2 / ; BANKx = Selects one of eight color banks, x=0-2. Bits PF2OF2,1,0 in BPLCON3 determine second playfield's offset into the colour table. This is now necessary since playfields in DPF mode can have up to 4 bitplanes. Offset values are as defined in register map. The bits 10 and 11 must be set as default to made the old 16 colours dual playfiled, so remember that ($106,$c00) (Thanx to MUCSI/Muffbusters) PF20Fx = Determine bit plane color table offset whe playfield 2 has priority in dual playfield mode: PF20F || AFFECTED BITPLANE ||OFFSET (From C-18 AGA doc) ------------------------------------------------------- | 2 | 1 | 0 || 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 ||(decimal) ------------------------------------------------------- | 0 | 0 | 0 || - | - | - | - | - | - | - | - || none | 0 | 0 | 1 || - | - | - | - | - | - | 1 | - || 2 | 0 | 1 | 0 || - | - | - | - | - | 1 | - | - || 4 | 0 | 1 | 1 || - | - | - | - | - | 1 | - | - || 8 (default) | 1 | 0 | 0 || - | - | - | 1 | - | - | - | - || 16 | 1 | 0 | 1 || - | - | 1 | - | - | - | - | - || 32 | 1 | 1 | 0 || - | 1 | - | - | - | - | - | - || 64 | 1 | 1 | 1 || 1 | - | - | - | - | - | - | - || 128 Never used AGA Dual Playfield yet so perhaps we're missing something? |
13 January 2020, 16:52 | #3 |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
So yeah, i read those docs...
and then I read this doc... https://github.com/rkrajnc/minimig-m.../aga/AGA.guide Specifically.... Code:
| 12 | PF2OF2=0 | Determine bit plane color table offset when playfield 2| | | | has priority in dual playfield mode ...when playfield 2 has priority... that condition is false. |
13 January 2020, 16:56 | #4 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,409
|
I find it oddly worded to be honest. Perhaps because I'm not a native speaker. To me it could both mean "whenever PF2 colours are shown" (i.e. PF1 pixel = transparent so PF2 has priority), or "whenever PF2 is set to be the top playfield".
Don't have any access to an emulator or Amiga here so can't check it either. Edit: this thread also seems to suggest it's not about priority but simply colour choice - http://eab.abime.net/showthread.php?t=71661 Last edited by roondar; 13 January 2020 at 17:00. Reason: Found a potentially useful thread |
13 January 2020, 17:14 | #5 | |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Quote:
Yeah, I read this one too... and the default does not make sense. Code:
| 12 | PF2OF2=0 | Determine bit plane color table offset when playfield 2| | | | has priority in dual playfield mode: | | | +-----------+-------------------------------+------------+ | | | PF20F | AFFECTED BITPLANE | OFFSET | | | +---+---+---+-------------------------------+------------+ | | | 2 | 1 | 0 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | (decimal) | | | +---+---+---+-------------------------------+------------+ | | | 0 | 0 | 0 | - | - | - | - | - | - | - | - | none | | | | 0 | 0 | 1 | - | - | - | - | - | - | 1 | - | 2 | | | | 0 | 1 | 0 | - | - | - | - | - | 1 | - | - | 4 | | | | 0 | 1 | 1 | - | - | - | - | - | 1 | - | - | 8 (default)| | | | 1 | 0 | 0 | - | - | - | 1 | - | - | - | - | 16 | | | 1 | 0 | 1 | - | - | 1 | - | - | - | - | - | 32 | | | | 1 | 1 | 0 | - | 1 | - | - | - | - | - | - | 64 | | | | 1 | 1 | 1 | 1 | - | - | - | - | - | - | - | 128 | Code:
|
|
13 January 2020, 17:29 | #6 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,409
|
If you find the correct values, I'd be interesting in knowing them. Perhaps I'll try something as well - but I'm not sure I'll have time tonight.
|
13 January 2020, 17:31 | #7 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Quote:
Code:
PF2OF2|PF2OF1|PF2OF0 1 | 0 | 0 -> offset 16 If you want to change bank also for PF1 you need to change BPLAMx bits in BPLCON4. |
|
13 January 2020, 17:37 | #8 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,409
|
So the documentation does number the bits the wrong way round then?
|
13 January 2020, 17:43 | #9 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Quote:
It's simply a log(2) for the starting point. So for example if I want a start from 32=2^5 I select 101 and set in bit 12 to 10. The default value is for a base=8=2^3->011->bit12=0,bit11=1,bit10=1->BPLCON3=$0C00 |
|
13 January 2020, 18:25 | #10 | |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Quote:
I'm still wrapping my head around the logic slightly. I'll get there. Graeme |
|
14 January 2020, 10:13 | #11 | |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,409
|
Quote:
Eh, thinking is hard sometimes Next time, I'll just read the table and accept it as is, instead of doing silly things like interpreting the values without considering if that makes sense. After all, that's what I normally do and it works great |
|
15 January 2020, 12:06 | #12 |
Inviyya Dude!
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,770
|
I hope I may use this thread to ask a simple question that's in a similar vein, though...
If I can assign 16 colours to pf1, and another 16 colours to pf2, can I assign another bank of 16 colours to the sprites, then? So I'd have 48 colours in total.. |
15 January 2020, 12:15 | #13 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Quote:
So, if you use 4 colors sprites, 24 more colors. |
|
15 January 2020, 12:45 | #14 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,409
|
Even more cool, BPLCON4 and BPLCON3 actually allow you to set this at any time, so you can divide your 256 colours up in several palettes and switch them on the fly to have way more colours on screen for the cost of just setting one or two registers with the Copper.
Because of the low overhead this is a very efficient way of improving colours when using AGA Dual Playfield |
15 January 2020, 13:00 | #15 |
Inviyya Dude!
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,770
|
Okay, that's cool. With 48 colours on screen without trickery you can already have a quite vivid image.
|
24 January 2020, 04:56 | #16 |
Registered User
Join Date: Jan 2019
Location: Brisbane
Posts: 99
|
I have been reading and reading this thread, but still don't get it... Dyslexic I must be. I am also setting up an AGA dual playfield trying to transition for an AGA version of my OCS/ECS project :
[ Show youtube player ]
my AGA configuration is currently like... PF1 4 bitplanes (just more foreground color) PF2 3 bitplanes (maybe I will increase this later.. but can stay at 8 color for now) For writing the AGA palette I write : Write 16 color for PF1 in bank 0 colors 0-15 Write 8 colors for PF2 in bank 0 colors 16-23 Write 16 colors for use with attached sprites in bank 1 colors 0-15 PF1 has priority over PF2 Sprites has priority over PF1 Is this possible with this configuration? I am currently writing only 12 bit colors to the high order bits as I don't have any 24bit palette code working outside of writing to a specific bank yet. I understand that this will copy to low order bits anyway. Where I struggle to understand, how do I get the Miggy to use the correct banks + offsets for PF1, PF2 and sprite. In OCS/ECS I am using 0-7 for PF1, 8-15 for PF2 and 16-31 for Sprites. |
24 January 2020, 09:32 | #17 |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Do you have any example code you can show?
BPLCON3 and BPLCON4 is primarily what controls these - did you look at their docs? |
24 January 2020, 09:57 | #18 | |
Registered User
Join Date: Jan 2019
Location: Brisbane
Posts: 99
|
Quote:
I do this to set the palette per bank Code:
; Write palette to bank 0 hi and low order bits ; Bank 0 - Colors 0-31 dc.w $0106,$0000 ; First 12-bit color palette (LOCT=0) dc.w $0180,$0F00 dc.w $0182,$00F0 dc.w $0184,$000F .. For all colors in bank 0 dc.w $0106,$0200 ; Second 12-bit color palette (LOCT=1) dc.w $0180,$0F00 dc.w $0182,$00F0 dc.w $0184,$000F .. For all colors in bank 0 ; Now I switch banks ; Bank 1 - Colors 32-63 dc.w $0106,$2000 ; First 12-bit color palette (LOCT=0) dc.w $0180,$0F00 dc.w $0182,$00F0 dc.w $0184,$000F .. For all colors in bank 1 dc.w $0106,$2200 ; Second 12-bit color palette (LOCT=1) dc.w $0180,$0F00 dc.w $0182,$00F0 dc.w $0184,$000F .. For all colors in bank 1 Bank 0 - Color 0-15 for PF1 Bank 0 - Color 16-23 for PF2 - Or even 16-31 but currently i am keeping PF2 at 3 Bitplanes Bank 1 - Color 0-15 for sprites Last edited by Auscoder; 24 January 2020 at 10:02. |
|
24 January 2020, 10:39 | #19 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
This:
Code:
;Bank 0 - Color 0-15 for PF1 ;Bank 0 - Color 16-31 for PF2 ;Bank 1 - Color 32-47 for odd (or 16 colors) sprites [0010] ;Bank 1 - Color 48-63 for even sprites [0011<<4], just in case dc.w $010C,%00110010 ;BPLCON4 high order bit for sprite colors ; Write palette to bank 0 hi and low order bits ; Bank 0 - Colors 0-31 dc.w $0106,%0001000001000000 ; [BANK0|PF2OF,16|LOCT0|SPRLORES|0] dc.w $0180,$0F00 dc.w $0182,$00F0 dc.w $0184,$000F .. For all colors in bank 0 dc.w $0106,%0001001001000000 ; [BANK0|PF2OF,16|LOCT1|SPRLORES|0] dc.w $0180,$0F00 dc.w $0182,$00F0 dc.w $0184,$000F .. For all colors in bank 0 ; Now I switch banks ; Bank 1 - Colors 32-63 dc.w $0106,%0011000001000000 ; [BANK1|PF2OF,16|LOCT0|SPRLORES|0] dc.w $0180,$0F00 dc.w $0182,$00F0 dc.w $0184,$000F .. For all colors in bank 1 dc.w $0106,%0011001001000000 ; [BANK1|PF2OF,16|LOCT1|SPRLORES|0] dc.w $0180,$0F00 dc.w $0182,$00F0 dc.w $0184,$000F .. For all colors in bank 1 |
24 January 2020, 11:19 | #20 | |
Registered User
Join Date: Jan 2019
Location: Brisbane
Posts: 99
|
Quote:
So I don't "seem" to be modifying BPLCON3 outside of setting the colors in bank 0 / range 16-23, what I see is PF2 using palette from PF1. Few more things to double check... mission continues. Last edited by Auscoder; 24 January 2020 at 12:33. Reason: Further Info |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
16c single playfield vs dual playfield for bobs n sprites | donnie | Nostalgia & memories | 1 | 20 January 2019 17:24 |
AGA Sprite + Dual Playfield Limits | Marle | Coders. Blitz Basic | 14 | 12 January 2019 14:14 |
Help with Dual Playfield | Shatterhand | Coders. Blitz Basic | 15 | 14 December 2015 13:05 |
Dual playfield colors and AGA | losso | Coders. Asm / Hardware | 1 | 03 December 2013 02:48 |
Dual Playfield | BippyM | project.Maptapper | 6 | 03 July 2013 00:43 |
|
|