19 July 2016, 10:05 | #21 |
Registered User
Join Date: Jun 2016
Location: UK
Posts: 428
|
|
19 July 2016, 10:33 | #22 | |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,409
|
Quote:
Never tried stuff on the 68020 but IIRC the A1200 CPU can write to chipmemory at twice the speed of the copper so it may actually be interesting to so what that does to the advantage of the copperlist. I do want to add that on a 68000 without fastram, polling can be done for ~20 CPU / 10 DMA cycles total per blit by dynamically switching BLTPRI on and off while still working on faster CPU's (or 0 cycles by never switching it off ever - though this will break stuff on faster CPU's so I wouldn't do that). So polling overhead is not as high as you'd think. None of which changes that using the copper can result in gains, which is interesting and nice to know. --- Edit: I became a bit unsure about the amount of cycles for polling I stated, so I checked to be certain. My Blitter wait code including cycle count on a 68000: Code:
cycles code 16 move.w #$8400,dmacon(a6) 16 .bltwait btst.b #DMAB_BLTDONE-8,dmaconr(a6) 8 bne.b .bltwait 16 move.w #$0400,dmacon(a6) -- 56c Last edited by roondar; 19 July 2016 at 14:13. |
|
19 July 2016, 11:26 | #23 |
Registered User
Join Date: Feb 2010
Location: Espoo / Finland
Posts: 818
|
|
04 November 2016, 22:56 | #24 |
Registered User
Join Date: Sep 2015
Location: Germany
Posts: 256
|
BLTPRI-Bit in conjunction with the 680x0 processors & FAST memory
Actually I work on some AGA-routines that use the copper to set up the blitter for line-drawin/filling and moving BOBs.
I noticed, that the speed of the blitter is different on an A1200/020 without FAST memory and on an 68060/50 mHz with FAST memory. I waitet for the last blit to be finished in my copperlist and change the background colour. Funnily the blitter needs more time on the 68060 system. And on a friend's A1200/060 who has pushed it upto 83 Mhz the blitter is also much slower, too. Time critical routines on a 68020 machine which use the blitter&copper and finish at line $135 don't work on faster processors. Turning on BLTPRI doesn't help anyway, because of FAST memory. Or if the routine runs also on the 68060 then turning on BLTPRI freezes all. Is there any special behaviour of the BLTPRI-Bit in conjunction with FAST memory&Caches? |
05 November 2016, 08:32 | #25 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
It is most likely caused by slow CPU chip ram (and custom registers) access speed. (Blitter speed is still the exact same). It is "feature" of most accelerators.
|
05 November 2016, 09:26 | #26 |
Registered User
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,281
|
I think with fast processor is better to split works betwenn cpu and blitter, or better do all by cpu
|
06 November 2016, 09:44 | #27 |
Registered User
Join Date: Jan 2016
Location: NL
Posts: 32
|
Last week I just figured out how to let the copper 'drive' the blitter and I actually got it to work! (I'm still in assembly-noob-country)
In my original code I used the CPU to setup/trigger the (rather small) blit: Code:
lea $dff000,a6 ; a6 = custom chips base bsr.w WaitBlitter move.l #$09f00000,BLTCON0(a6) ; blit control 0 & 1 move.l #$ffffffff,BLTAFWM(a6) ; blit source A masks ;----- 1, row 1, tile 1 move.w #0,BLTAMOD(a6) ; blit source A modulo move.w #scrBpl-(tileBpl*1),BLTDMOD(a6) ; blit dest D modulo move.l #Sword,BLTAPTH(a6) ; blit source A move.l #Screen+(tileBpl*0),BLTDPTH(a6) ; blit destination D move.w #(tileH*BPLS)<<6+(tileW*1/16),BLTSIZE(a6); blit size = start Code:
dc.w $ffdf,WAIT ; line 255 ;----- trigger blitter dc.w $0001,$7ffe ; wait for blitter ;----- initialize blitter dc.w BLTCON0,$09f0 ; blit control 0 dc.w BLTCON1,$0000 ; blit control 1 dc.w BLTAFWM,$ffff ; blit source A first mask dc.w BLTALWM,$ffff ; blit source A last mask ;----- blit 1: row 1, tile 1 dc.w BLTAMOD,0 ; blit source A modulo dc.w BLTDMOD,scrBpl-(tileBpl*1) ; blit dest D modulo dc.w BLTAPTH ; blit source A blt1apth: dc.w 0 dc.w BLTAPTL ; blit source A blt1aptl: dc.w 0 dc.w BLTDPTH ; blit destination D blt1dpth: dc.w 0 dc.w BLTDPTL ; blit destination D blt1dptl: dc.w 0 dc.w BLTSIZE,(tileH*BPLS)<<6+(tileW*1/16) ; blit size = start Code:
;----- set COPPER = show picture ; bset.b #1,COPCON(a6) ; OLD enable blitter control move #2,COPCON(a6) ; CORRECT enable blitter control move.l #Copper,COP1LCH(a6) ; COP1LCH -> custom copperlist ;----- initialize blit 1 move.l #Sword,d0 move.w d0,blt1aptl swap d0 move.w d0,blt1apth move.l #Screen+(tileBpl*0),d0 move.w d0,blt1dptl swap d0 move.w d0,blt1dpth Last edited by borchen; 10 November 2016 at 20:25. |
06 November 2016, 10:11 | #28 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
|
06 November 2016, 10:33 | #29 | |
Registered User
Join Date: Jan 2016
Location: NL
Posts: 32
|
Quote:
The COPCON-register apparently is a 1 bit register, so how does one set this? Should it be: Code:
bset.l #00,COPCON(a6) On how to set individual bits I used the following page: http://mrjester.hapisan.com/04_MC68/...t05/Index.html |
|
06 November 2016, 10:55 | #30 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Register is write-only, bset (and friends) are always byte-wide read-modify-write instructions when accessing memory: move #2,COPCON(a6) is the correct way. (or any value that has bit 1 set, other bits don't exist)
btw, why do you need to "trigger" the blitter with CPU? Code can easily become too timing sensitive if both CPU and copper list modifies blitter registers, especially when/if timing gets off enough to cause both to run at the same time.. Result will be undebuggable mess |
06 November 2016, 11:16 | #31 |
Registered User
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,281
|
@Toni
Since you know Amiga very well, I would ask you is it worth to do blitting via copper for a game, or it's just for a demo. |
06 November 2016, 12:14 | #32 | |||
Registered User
Join Date: Jan 2016
Location: NL
Posts: 32
|
Thanks Toni for pointing me in the right direction about setting the COPCON register. I just thought: "I have to set 1 bit so I have to use the bset command"...silly me.
I changed it to move #2,COPCON(a6) and it works like a charm. Quote:
It's a 'not because i have to, but because I can' thingy: [ Show youtube player ] (Dutch people will understand this...) Quote:
Quote:
That's why I was pretty happy with myself when it finally worked without glitches. The end-result is exactly the same, but uses hardly any CPU. There's still a little piece of code in the mainloop I still have to 'migrate' to the blitter: Code:
move.w #300,d0 ; wait for rasterline 300 = EOFrame bsr.w WaitRaster ;----- barrelshift picture 1px to left using CPU lea Sword,a0 moveq #(tileBplS*BPLS)/2-1,d0 ; 48 words .brlsl rol.w #1,(a0)+ dbf d0,.brlsl Last edited by borchen; 06 November 2016 at 12:23. |
|||
06 November 2016, 14:18 | #33 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
IMHO copper list blits can be only faster (=cpu can do stuff at the same time without ever wasting cycles for blitter waits) when there is lots of blits and each blit has at least one idle cycle and blit parameters don't change much (for example only A and D pointer changes, all other registers don't need updating, most of the copper list don't need updating/frame). Also line draws can be faster when using copper. (They have 2 idle cycles/pixel)
|
06 November 2016, 14:24 | #34 | |
Registered User
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,281
|
Quote:
|
|
06 November 2016, 15:05 | #35 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Quote:
I don't think copper list becomes too big, at least as long as as blits share same data (no need to update modulos, bltcon0/1 in copper list). |
|
06 November 2016, 15:37 | #36 | |
Registered User
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,281
|
Quote:
|
|
08 November 2016, 08:34 | #37 | |
Registered User
Join Date: Sep 2015
Location: Germany
Posts: 256
|
Quote:
|
|
08 November 2016, 08:54 | #38 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Exact same blitter start position in both tests? Exact same other (copper, bitplanes, same fmode etc) DMA channel usage in both tests?
|
08 November 2016, 21:49 | #39 | |
Registered User
Join Date: Sep 2015
Location: Germany
Posts: 256
|
Quote:
But apart from this I know that the overclocked 68060/83 Mhz CPU of my friend behaves different. Setting the BLTPRI-bit for my routines freezes this machine. Maybe the whole clock/bus handling is messed up there or incompatible due to the fact of overclocking. |
|
09 November 2016, 07:38 | #40 |
Registered User
Join Date: Jun 2008
Location: Boston USA
Posts: 466
|
Hi Toni.
Can you please describe how the arbitration works in blit nice mode? The HRM mentions that the blitter yields for one cycle (slot?) if the CPU is halted for several cycles. What happens if there are idle cycles in the blit? Can the CPU realign to use them? Will the blitter yield if the CPU is blocked by other DMA? I wonder if it would be worthwhile to use blitnice mode if the CPU is doing multiplies or divide instructions. Will the CPU get cycles if blocked by just the blitter? Do other DMA channels count in this case? |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Maximum speed of the internal serial port? | Iznougoud | support.Hardware | 32 | 06 November 2020 23:18 |
Blitter filling speed, how much? | sandruzzo | Coders. Asm / Hardware | 7 | 03 July 2015 14:38 |
FS-UAE uses always maximum CPU speed? | AGS | support.FS-UAE | 6 | 15 February 2015 13:08 |
Maximum MaxTransfer and ATAPI speed (IDEfix97) | Leandro Jardim | support.WinUAE | 2 | 04 August 2014 14:45 |
CD/DVD Drive Maximum Speed | Calgor | support.Hardware | 2 | 19 June 2007 16:18 |
|
|