English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. Asm / Hardware (https://eab.abime.net/forumdisplay.php?f=112)
-   -   Blitting with the copper (https://eab.abime.net/showthread.php?t=112657)

torkildl 28 November 2022 22:45

Blitting with the copper
 
I've never used to copper to drive the blitter previously, but thought I'd give it a try.

Set up double-buffered screens with two copperlists. Each copperlist includes a branch to a table with blitter (and other) instructions. No other blitting is going on.

Using $180 changes, I can see that the branch happens. The main copperlist branches to the "subroutine" and turns the background red. Then it is supposed to do some blitting and turn the background green. This never happens. If I remove the blitter-related MOVEs, and replace them with some Vanilla copper instructions ($180, copper NOP, other modulo etc) the subroutine completes and turns the screen green. If I include blitter-related moves, the things stops.

I must doing something terribly wrong here. Now, I am wondering what on earth can cause this behavior. I've only used one blit (one write to BLTSIZE), made sure there is no other blitting going on, and DMA is on. For good measure I have also included copper blitwaits (dc.l $00010000) before and after the blitter instruction group). Same result: copper instructions do not execute.

Any ideas?

jotd 28 November 2022 22:53

There's the COPCON/CDANG register that you need to set first else copper ignore blitter registers. It's by design

http://amigadev.elowar.com/read/ADCD.../node0029.html

torkildl 29 November 2022 10:57

Holy macaroni! It was that easy. I guess I should RTFM next time I try to move outside of my competence area. Will try this tonight.

torkildl 29 November 2022 10:57

And THANKS to you for letting me know!

torkildl 29 November 2022 18:41

Now I added a MOVE $002e,$0002 to my copperlist, but the copper still seems to stop at the first blitter operation. Does it have to be set at a specific time (before enabling copper DMA or something like this)? I looked at the HRM but could not find anything about this.

Jobbo 29 November 2022 18:51

Posting your code will make it easier for people to help.

paraj 29 November 2022 18:57

You have to enable it using the CPU. If CDANG isn't enabled any write by the copper to registers below $80 will halt the copper until the next frame. Note that the OS relies (unintentionally) on this behavior so you should make sure to disable CDANG before returning to the OS. It's documented here (though the $40 limit only applies to OCS).

a/b 29 November 2022 18:57

Because that register is protected from copper writes as well. Poke it with the CPU once at the start, and restore back to 0 at the end before your program exits.

edit: paraj beat me thanks to time zone difference of 0 ;P.

Jobbo 29 November 2022 19:06

This is the page with the relevant address range info:
http://amigadev.elowar.com/read/ADCD.../node0052.html

This page would seem to be incorrect, it says the range is under $20?
http://amigadev.elowar.com/read/ADCD.../node004A.html

a/b 29 November 2022 19:18

HRM pg. 26 (control register).
Here's the elowar link: http://amigadev.elowar.com/read/ADCD.../node0052.html

Basically, imagine an entity that dictates what it can do and then saying it can do whatever it wants. Wait.... we do have that: it's called the govermnent :P.

ECS works differently, so that's probably the reason why.

paraj 29 November 2022 19:44

I don't have an ECS machine wired up to test, but for sure writing to any custom register works with AGA once CDANG is enabled. There's not much use in writing to the read only registers of course, but it doesn't halt the copper. In particular this:
Code:

        lea    $dff000,a6
        move.w  #$7fff,d0
        move.w  d0,$9a(a6)
        move.w  d0,$96(a6)
        move.w  #2,$2e(a6)
        lea    $100.w,a0
        move.l  a0,$80(a6)
        move.l  #$00000000,(a0)+ ; Adjust here to try different registers
        move.l  #$018000f0,(a0)+
        move.l  #-2,(a0)+
        clr.w  $88(a6)
        move.w  #$8280,$96(a6)
.x:    bra .x

will show a green screen on an A1200.

The documentation writer was probably trying to be describe what you can/should rely on, not what's actually possible. For ECS+ it was intended that you could use the copper to update registers in the $20-$40 range, but it just happens that the hardware doesn't disallow writes to $0-$20.

Toni Wilen 29 November 2022 19:49

OCS: <$40 is always unavailable. CDANG enables $40-$7e.
ECS/AGA: CDANG enables $00-$7e


All times are GMT +2. The time now is 20:04.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.08145 seconds with 11 queries