English Amiga Board


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

 
 
Thread Tools
Old 27 January 2020, 13:50   #1
Auscoder
Registered User
 
Join Date: Jan 2019
Location: Brisbane
Posts: 99
FMODE 0 to FMODE 1

Hey all

I am trying to move my game to AGA from ECS version, and would like to set the FMODE now higher than the Normal Fetch. I am trying just $01 for now...

I am seeing visual error when setting $01, this is looking much like what would be a bad modulo.... All works well with Normal Fetch.

I have ensured the following which I can find is required for FMODE $01

Bitmap data located on an 8 byte aligned memory address.
Bitmap data bytes width is multiple of 8 bytes
Also modulos are multiple of 8 bytes

Cooper list is also located on 8 byte aligned memory address

DDFSTART is #$30
DDFSTOP is #$D0

Not sure where else to look? Is there something I missed that is still needed.

Changing FMODE back to 0 with all above changes, things are looking fine .
Auscoder is offline  
Old 27 January 2020, 13:58   #2
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
You have to adjust the modulo depending on what fetch mode you are in, try setting your bitplane modulo but with -6 or -4.

There is a calculation but i dont have it to hand atm.
mcgeezer is offline  
Old 27 January 2020, 14:36   #3
Auscoder
Registered User
 
Join Date: Jan 2019
Location: Brisbane
Posts: 99
Quote:
Originally Posted by mcgeezer View Post
You have to adjust the modulo depending on what fetch mode you are in, try setting your bitplane modulo but with -6 or -4.

There is a calculation but i dont have it to hand atm.
Thanks mcgeezer, I tried a few variations, positive and negative, a few made things look a bit better, some much worse. actually -2 came closest. Looks like that at least one bitplane is right like so, but following bitplanes are weirdly offset. Almost like following bitplane pointers are being set too late...

I realized that having original style horizontal scrolling running in FMODE 1 that would no longer be appropriate and could be causing issues?
Auscoder is offline  
Old 27 January 2020, 14:53   #4
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,437
This is from memory, so it could be wrong but here goes: AFAIK the modulo for FMODE 4x is -8 and FMODE 2x is -4.

I remember having similar issues when I set up an FMODE 4x screen and it turned out that my bitplane data was incorrectly aligned. My first step would be to check if the individual bitplane pointers are all aligned to 4 bytes (for FMODE 2x, or 8 bytes if using FMODE 4x).

In my case it turned out they were not because I added a scrolling offset to the bitplane pointers. Remember, when horizontally scrolling an FMODE 2x/4x screen you need to scroll for 32/64 pixels rather than just 16 and update the bitplane pointers by 4 or 8 bytes for the new offsets rather than just 2 bytes.

Another error I made was not updating the Blitter modulo's (I had made my bitmap wider because of the new alignment, but I forgot to update the constants I used for the Blitter). Last but not least, I had the wrong DDFSTOP, which also caused issues that looked like wrong modulo values.

Last edited by roondar; 27 January 2020 at 14:59.
roondar is offline  
Old 27 January 2020, 15:02   #5
Auscoder
Registered User
 
Join Date: Jan 2019
Location: Brisbane
Posts: 99
Quote:
Originally Posted by roondar View Post
This is from memory, so it could be wrong but here goes: AFAIK the modulo for FMODE 4x is -8 and FMODE 2x is -4.

I remember having similar issues when I set up an FMODE 4x screen and it turned out that my bitplane data was incorrectly aligned. My first step would be to check if the individual bitplane pointers are all aligned to 4 bytes (or 8 bytes if using FMODE 4x).

In my case it turned out they were not because I added a scrolling offset to the bitplane pointers. Remember, when horizontally scrolling an FMODE 2x/4x screen you need to scroll for 32/64 pixels rather than just 16 and update the bitplane pointers by 4 or 8 bytes for the new offsets rather than just 2 bytes.

Another error I made was not updating the Blitter modulo's (I had made my bitmap wider because of the new alignment, but I forgot to update the constants I used for the Blitter). Last but not least, I had the wrong DDFSTOP, which also caused issues that looked like wrong modulo values.
Thanks Roondar, there are some nice options for me to go through tomorrow evening. Its getting a little late to be doing much more here now.

You probably are on to it with the scroll offset . I am adjusting byte offsets on even (but multiple of 2) bytes.. So I will look in to that. For now I will just disable original scroll code completely and reset any offsets to 0. I had hoped old scroll code would continue to function "as is".

Back to it tomorrow night. Thanks for the info chaps.
Auscoder is offline  
Old 27 January 2020, 15:56   #6
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Set your DDFSTOP to $c8, this will fix your display problems too without having to mess with the modulos.
StingRay is offline  
Old 27 January 2020, 17:18   #7
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,571
Yeah, you only waste DMA time (and possible trigger bitplane DMA to refresh slot conflicts = screen gets very corrupted) if you try to fix the display by adjusting modulo instead of using correct DDFSTOP.
Toni Wilen is online now  
Old 27 January 2020, 17:56   #8
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,491
Quote:
Originally Posted by Toni Wilen View Post
Yeah, you only waste DMA time (and possible trigger bitplane DMA to refresh slot conflicts = screen gets very corrupted) if you try to fix the display by adjusting modulo instead of using correct DDFSTOP.
Is it possible to trigger a WinUAE HALT condition if the refresh slots are invaded? (not only in log)
I remember that my real Amiga alway crashed when I accidentally made these conditions (with code in chip or fake fast ram).
Just for a even more real emulation and to make the programmer conscious if the glitches are due to other reasons
ross is offline  
Old 28 January 2020, 12:01   #9
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,437
Huh... I need to go and change my DDFSTOP setting in AGA code then. I could've sworn I read the "you need to change modulo to -4/-8 for AGA FMODE 2x/4x" in several places and always assumed that was just the way it was.

Good to learn something new, so thanks for the info.
roondar is offline  
Old 28 January 2020, 13:16   #10
Auscoder
Registered User
 
Join Date: Jan 2019
Location: Brisbane
Posts: 99
Quote:
Originally Posted by roondar View Post
This is from memory, so it could be wrong but here goes: AFAIK the modulo for FMODE 4x is -8 and FMODE 2x is -4.

In my case it turned out they were not because I added a scrolling offset to the bitplane pointers. Remember, when horizontally scrolling an FMODE 2x/4x screen you need to scroll for 32/64 pixels rather than just 16 and update the bitplane pointers by 4 or 8 bytes for the new offsets rather than just 2 bytes.

Headsup, Thanks Roondar, it was exactly this. In conjunction I had some padding being added at runtime to the bitplane pointers to avoid having to do small amounts of clipping on blits. Adding some validation to where I wrote the bitplane pointers picked it right up.

All good now! Thanks for the learned tips.
Auscoder is offline  
Old 28 January 2020, 13:20   #11
Auscoder
Registered User
 
Join Date: Jan 2019
Location: Brisbane
Posts: 99
Quote:
Originally Posted by StingRay View Post
Set your DDFSTOP to $c8, this will fix your display problems too without having to mess with the modulos.
Thank you for this advice, I have update DDFSTOP, but did still have to update Modulos. I don't quite understand these registers and how they work properly, so it's time to do some reading.
Auscoder is offline  
Old 28 January 2020, 16:37   #12
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,437
No problem, glad to be of assistance
roondar 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
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

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 16:01.

Top

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