English Amiga Board


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

 
 
Thread Tools
Old 28 November 2022, 23:45   #1
torkildl
Registered User

 
Join Date: May 2021
Location: Norway
Posts: 18
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?
torkildl is offline  
Old 28 November 2022, 23:53   #2
jotd
This cat is no more

jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 51
Posts: 6,974
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
jotd is offline  
Old 29 November 2022, 11:57   #3
torkildl
Registered User

 
Join Date: May 2021
Location: Norway
Posts: 18
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 is offline  
Old 29 November 2022, 11:57   #4
torkildl
Registered User

 
Join Date: May 2021
Location: Norway
Posts: 18
And THANKS to you for letting me know!
torkildl is offline  
Old 29 November 2022, 19:41   #5
torkildl
Registered User

 
Join Date: May 2021
Location: Norway
Posts: 18
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.
torkildl is offline  
Old 29 November 2022, 19:51   #6
Jobbo
Registered User

Jobbo's Avatar
 
Join Date: Jun 2020
Location: Druidia
Posts: 320
Posting your code will make it easier for people to help.
Jobbo is offline  
Old 29 November 2022, 19:57   #7
paraj
Registered User

 
Join Date: Feb 2017
Location: Denmark
Posts: 500
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).
paraj is offline  
Old 29 November 2022, 19:57   #8
a/b
Registered User

 
Join Date: Jun 2016
Location: europe
Posts: 806
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.
a/b is offline  
Old 29 November 2022, 20:06   #9
Jobbo
Registered User

Jobbo's Avatar
 
Join Date: Jun 2020
Location: Druidia
Posts: 320
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
Jobbo is offline  
Old 29 November 2022, 20:18   #10
a/b
Registered User

 
Join Date: Jun 2016
Location: europe
Posts: 806
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.
a/b is offline  
Old 29 November 2022, 20:44   #11
paraj
Registered User

 
Join Date: Feb 2017
Location: Denmark
Posts: 500
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.
paraj is offline  
Old 29 November 2022, 20:49   #12
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 47
Posts: 25,741
OCS: <$40 is always unavailable. CDANG enables $40-$7e.
ECS/AGA: CDANG enables $00-$7e
Toni Wilen 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
Copper WAIT, copper SKIP and $80/$100 vpos problem defor Coders. Asm / Hardware 2 23 July 2021 09:32
Combining copper scrolling with copper background phx Coders. Asm / Hardware 16 13 February 2021 13:41
Blitting from main loop and level 3 interrupt (copper) nandius_c Coders. Asm / Hardware 9 07 February 2020 20:15
Best way to mix blitting with copper and copper effects roondar Coders. Asm / Hardware 3 12 September 2016 14:12
Problem with blitting.... xboxown Coders. Language 0 09 March 2014 22:51

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 19:21.


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