![]() |
![]() |
#1 |
Registered User
![]() Join Date: Jun 2020
Location: Druidia
Posts: 326
|
Fmode and blitter speeds
For AGA how do different Fmode settings affect blitter speeds?
I imagine that the peak blitter bandwidth is unaffected but you can free up more DMA slots that would've been needed for bitplanes and sprites otherwise. I have a demo effect that's using HAM5 which isn't possible on AGA. To make it compatible I'm detecting AGA and using HAM6, but this uses more bandwidth so the blitter ends up running slower for AGA. I'm thinking that I can get the speed back with Fmode, sound right? How accurate at this stuff is Winuae when emulating an A1200? Thanks |
![]() |
![]() |
#2 | |||
Defendit numerus
![]() Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 52
Posts: 3,962
|
Quote:
https://eab.abime.net/showpost.php?p...65&postcount=2 Not for sprites, they are just wider but same DMA slots usage. Quote:
Just change BPLCON0 from $7a00 to $6a00 and setup the masks previously in BPL5/6DAT as fetched data. Even FMODE=x2 is more than enough to recover loss of blitter speed due to the two more bitplane fetches needed. EDIT: uh, I realized that I have described to you what is usually used for a 7bpls/HAM4+ effect ![]() But obviously the same also applies to the HAM5 (BPLCON0=$5a00), indeed in the latter case you only have a bitplane of difference, so even less speed loss for the blitter. Quote:
Cheers. Last edited by ross; 29 December 2020 at 09:25. |
|||
![]() |
![]() |
#3 |
Registered User
![]() Join Date: Jun 2020
Location: Druidia
Posts: 326
|
Thanks Ross.
I have AGA allocating an extra blank plane just like you described. Fmode 4x seems to more than do the trick in Winuae to gain back the speed loss, but I wanted to double check. I also find I need to adjust Ddfstop. With Fmode set to 4x it seems like I need to stop the display fetch early by 48...64ish pixels. Does anyone know the exact rules for how Ddfstop should be setup? I know there's different rules for low and high resolution so I imagine the full rule set for AGA gets a bit complicated. |
![]() |
![]() |
#4 |
Defendit numerus
![]() Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 52
Posts: 3,962
|
DDFSTOP is where the last BPL DMA fetch is done, dependently of is wide.
So DDFSTOP=DDFSTRT+(px-DMA_width)/2 works. Example: 320 px, DDFSTRT=$38, FMODE=4x -> DDFSTOP=$38+(320-64)/2= $B8 EDIT: however if you put values slightly >$b8 (like $c0) there would be anyway a further fetch (so 320+64..), so you can use a 'range' Last edited by ross; 29 December 2020 at 20:29. |
![]() |
![]() |
#5 |
Registered User
![]() Join Date: Jun 2020
Location: Druidia
Posts: 326
|
That's what I've tried and it works fine for fmode 0, 1 and 3 but not for fmode 2?
Maybe there's a Winuae bug, it seems to swap each display word pair around in that mode. Edit, it's not swapping them but it seems like the second word is a copy of the first word, or something like that. |
![]() |
![]() |
#6 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 48
Posts: 25,813
|
DDFSTOP does not equal last fetch. (This is very common error, HRM does not explain it very well). After DDFSTOP has matched, there is always one more complete bitplane DMA "block" (all enabled planes fetched) before DMA stops.
End result can still be same even if value is technically wrong because there is 8/16/32 possible DDFSTOP values that have same result. |
![]() |
![]() |
#7 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 48
Posts: 25,813
|
Quote:
![]() FMODE=2 is useless. (EDIT: it has same cycle sequence as FMODE=1 so nothing useful was lost) |
|
![]() |
![]() |
#8 | |
Registered User
![]() Join Date: Jun 2020
Location: Druidia
Posts: 326
|
Quote:
I was expecting the same behavior as FMODE=1 but instead it does something very strange. I wonder if anyone found a creative use for whatever is happening. |
|
![]() |
![]() |
#9 | |
Defendit numerus
![]() Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 52
Posts: 3,962
|
Quote:
![]() But I tend to use the value calculate with my simple formula, because that's what the system seems to use when generating copper lists... Last edited by ross; 29 December 2020 at 20:56. |
|
![]() |
![]() |
#10 | ||
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 48
Posts: 25,813
|
Quote:
![]() Quote:
|
||
![]() |
![]() |
#11 | |
Defendit numerus
![]() Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 52
Posts: 3,962
|
Quote:
![]() However fortunately it is easy to be sure and check for a correct value. In any case, there is values of all kinds in AGA productions, even absurd things corrected through the modulo and wasted dma fetches... |
|
![]() |
![]() |
#12 |
OCS forever!
![]() Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
|
I've not done any AGA programming since coming back to Amiga but in my macros include from when I had my A1200 i'd set up these values. Can't remember if I got it out of some dodgy photocopy of the AGA spec I had or if something I just made up because it looked to work for OCS and AGA. It comes to $b8 for fmode=4x, 320px. What value does the OS use?
Code:
MEMORYFETCHMODE equ 0 ;0 (OCS),1 or 3 ifeq MEMORYFETCHMODE DDF_INCREMENT equ 1 else DDF_INCREMENT equ (MEMORYFETCHMODE+1)&$fffe endif ************************************************************* DDF_START set $38 DDF_WORDWIDTH set 20 DDF_STOP set DDF_START+((DDF_WORDWIDTH-DDF_INCREMENT)*8) |
![]() |
![]() |
#13 |
Defendit numerus
![]() Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 52
Posts: 3,962
|
|
![]() |
![]() |
#14 |
Registered User
![]() Join Date: Jun 2020
Location: Druidia
Posts: 326
|
Sorry to resurrect this thread but I've been looking at this code again and wondering if HAM5 is even a problem for AGA.
I think I had assume it was because of earlier HAM7 trick tests. But I tried it in Winuae and it seems fine. Before I delete my AGA specific code path can anyone confirm whether it's needed or not? Thanks |
![]() |
![]() |
#15 |
Defendit numerus
![]() Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 52
Posts: 3,962
|
Yes, it should work fine.
I wrote inaccuracies. See old message #2 and subsequent message for details.. The corner cases that I mentioned would foresee that HAM5 leaves the freedom to manually use BPL5DAT and that HAM could be usable with 5 bitlanes on AGA, which is not possible. Sorry paraj, I dragged you into my mistake ![]() Last edited by ross; 20 March 2023 at 07:25. Reason: I wrote inaccuracies... |
![]() |
![]() |
#16 |
Registered User
![]() Join Date: Feb 2017
Location: Denmark
Posts: 533
|
If you post a test executable I (or someone) else can try it out on on an A1200. If you avoid the corner cases that Ross mentions I don't see why it wouldn't work like on an ECS machine at least.
|
![]() |
![]() |
#17 |
Registered User
![]() Join Date: Jun 2020
Location: Druidia
Posts: 326
|
Thanks. I’ll test on my 1200 to be sure. But seems like I just got confused at the time and then did a bunch of unnecessary work.
|
![]() |
![]() |
#18 |
Defendit numerus
![]() Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 52
Posts: 3,962
|
Gah.., sorry.
I probably still mixed the HAM4+/7planes/OCS mode with the regular one. In OCS/normal HAM the unused plane is automatically set to 0, so there is no corner cases (no weirdness with BPL6DAT). To sum up: OCS/ECS: HAM works at any bitplane depth. - HAM4: both missing bitplane will be 0, so a 'regular' 16 colors mode - HAM4+/7: 4 bitplanes for Agnus, 6 for Denise, so you can manually use BPL5DAT and BPL6DAT to make effects - HAM5: the missing sixth bitplane will be 0, only blue color component can be modified - HAM6: regular HAM AGA: - HAM bit enable HAM mode only in 6 or 8 bitplanes mode - this means that to emulate HAM4+ and HAM5 modes you need to enable HAM with 6 bitplanes and let the DMA do a full data fetch (and 'emulate' the effect) So yeah, you need a separate path in your code to handle the different chipsets. If there is something more I will add a note ![]() Last edited by ross; 20 March 2023 at 07:15. Reason: message that should clarify the various cases |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Immediate Blitter & Wait for Blitter... | volvo_0ne | support.WinUAE | 32 | 18 September 2022 09:52 |
FMODE 0 to FMODE 1 | Auscoder | Coders. Asm / Hardware | 11 | 28 January 2020 16:37 |
DMA Time Slot Allocation / FMODE=1 Overrun | ross | Coders. Asm / Hardware | 5 | 03 December 2017 17:06 |
FMODE=2 is useless? | Toni Wilen | Coders. Asm / Hardware | 8 | 01 May 2017 22:07 |
Blitter busy flag with blitter DMA off? | NorthWay | Coders. Asm / Hardware | 9 | 23 February 2014 21:05 |
|
|