View Single Post
Old 07 April 2019, 16:15   #4
Registered User

Join Date: Dec 2014
Location: germany
Posts: 228
Originally Posted by mc6809e View Post
How about trying to make a copper-driven blitter queue that even crosses frame boundaries? In other words, it works even when VBLANK resets the copper address pointer?
I was also thinking about such a thing at some point. I was toying around with another approach that probably is less powerful and requires some cpu assistance, but may be easier to implement. It's totally untested and could be nonsense, but this may be a good place to share it:

ADKCON/ADKCONR is a register that can be written by the copper and read by the CPU, so it can be abused for information exchange between those two. During game play, audio is typically active, but disk and serial is not, so the disk (and UART) related bits 08-14 are available, giving a 7-bit code.

After every write to BLTSIZE in your copper list, add a CMOVE to ADKCON that sets the index of the blit. During VBlank, check the value of ADKCONR and restart/rebuild the copper list with the next index. If it's the last index, indicating that everything started in the last frame, wait for blitter to finish and go to the next list.

There's a significant possibility, however, that a vblank occurs between the writes to BLTSIZE and ADKCON. For 50 blits per frame it would be approx. every 30s if I'm not mistaken. With common blits this simply repeats a blit that was already carried out, which does no harm, but if the blit changes its source there may be some corruption (e.g. in-place fill).

As writes to ADKCON can only either set or delete bits, it is inconvenient to use a linear index 0-127, as one needs up to two writes to ADKCON, it's better to construct a series of numbers where n+1 is constructed from n only by setting or deleting bits. For example, [0,1,3,2,6,7,5,4,12,13,15,10,11,9,8,14] is such a series for numbers less than 16.

As said, it's untested and I may have overlooked something significant.

Last edited by chb; 07 April 2019 at 16:24.
chb is online now  
Page generated in 0.04140 seconds with 11 queries