English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 19 August 2020, 01:26   #1
Quagliarulo
Registered User
 
Quagliarulo's Avatar
 
Join Date: Mar 2010
Location: Napoli, Italia
Posts: 76
Changing 3 registers every 16 horiz. pixels via Copper

Hello, I'm on OCS and I have 2 bitplanes. DMA for sprites and audio will need to be enabled as well, if I get anywhere with this project.
My screen is made up of 16x16 pixels tiles, 2 bitplanes each.
I need color 0 to always be black and I'd like to set the other 3 colors on a per-tile basis, through a very very long copperlist (I'm trying to use the fewest possible bitplanes to get more freedom for sprite colors).
I tried, but I ran into 2 problems:
- The least significant bit of the horizontal position must be 1
- The Copper's response comes too late, that is, it won't change the colors 16 pixels after the last change.
Is this doable or should I just increase the number of bitplanes?
Quagliarulo is offline  
Old 19 August 2020, 01:36   #2
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,209
With 4 (or less) bitplanes enabled, you can only write to one hardware register every 8 low-res pixels

The trouble is, for what I interpret as what you want to achive, the colour changes will affect the tiles "before" the destination tile.
DanScott is offline  
Old 19 August 2020, 04:05   #3
Jobbo
Registered User
 
Jobbo's Avatar
 
Join Date: Jun 2020
Location: Druidia
Posts: 386
With a 3 bitplane screen you could reserve 2 unique colors for each 16x16 tile and then have the background and three other colors as shared.

You'd then want to have two copies of each tile so you could blit ones that used alternating unique colors each column.

Then your copper list could change 2 colors every 16 pixels ahead of the tiles about to be displayed.

You would probably want to setup a looping copper list so it'll repeat the same color changes for 16 lines.

It'd be like the color attributes on the Speccy.

Horizontal scrolling would be limited to 4 pixel steps since the copper wait for a line can gives you 4 pixel accuracy.

I think it's an interesting quirky idea, not sure anyone has taken advantage of something like that in any meaningful way in the past.

Last edited by Jobbo; 19 August 2020 at 04:23.
Jobbo is offline  
Old 19 August 2020, 10:24   #4
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,214
Quote:
Originally Posted by Quagliarulo View Post
My screen is made up of 16x16 pixels tiles, 2 bitplanes each.
I need color 0 to always be black and I'd like to set the other 3 colors on a per-tile basis, through a very very long copperlist (I'm trying to use the fewest possible bitplanes to get more freedom for sprite colors).

Is this doable or should I just increase the number of bitplanes?
This wouldn't work. The copper cannot instantaneously change two (or more) colors at once. Reading a command and executing a command takes some time, and hence takes some space on the screen.
Thomas Richter is offline  
Old 19 August 2020, 11:27   #5
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,408
Quote:
Originally Posted by Jobbo View Post
I think it's an interesting quirky idea, not sure anyone has taken advantage of something like that in any meaningful way in the past.
That is indeed a very interesting setup!
Not too sure about the DMA costs vs the benefits but it's certainly a neat trick
roondar is online now  
Old 20 September 2020, 10:21   #6
Hypex
Registered User
 
Join Date: May 2015
Location: Australia
Posts: 131
That's a neat idea. I've thought of these tricks myself. I think it could work but you may need an extra plane. Essentially you will need to double buffer or interleave the operations.

So, the first tile, you will need to change the colours before it appears. Say 16 pixels before, depending on how long your changes need. Then wait for first tile left pixel position. Now write the colours for the second tile while the first is displaying. Wait for the next tile. Rinse and repeat, so to speak.

Your tile bitmap will need be set up so the tiles are interleaved. First tile has one palette, second tile other palette. So tile 1 would be colours 0 to 3, tile 2 colours 4 to 7. Then loop across. You would share colour 0 and reuse colour 4 if you don't need it.

Using the top bitplane as a msb should do the switching trick, With a checker pattern. So one palette is lower, then other is higher.

The timing used to be one copper write every four pixels, but I don't know if it can be kept constant at the timing. I note the issue with scrolling, but it should be possible to still scroll if the palettes are set in time before each tile. Or you will get a C16 style soft sprite back block effect. :P
Hypex 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
DblPAL vs changing the screen bitmap using Copper BSzili Coders. System 2 23 August 2016 14:49
2 questions: Not used DFFxxx location Copper behavior and Indivision ECS registers pandy71 Coders. Asm / Hardware 2 13 January 2015 14:13
Zooming using BPLCON1 (horiz. shift) — am I doing it wrong? losso Coders. Asm / Hardware 10 14 January 2014 17:00
Copper color-changing restrictions? Dan Locke Coders. General 24 01 February 2010 03:00
Glitchy Horiz Lines With WinUAE2000 Ed Cruse support.WinUAE 34 18 December 2009 23:06

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 11:38.

Top

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