English Amiga Board


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

 
 
Thread Tools
Old 27 July 2017, 09:04   #1
ovale
Registered User
 
Join Date: Jun 2014
Location: milan / italy
Posts: 174
Horizontal split screen with modulo trick

Hello,

I was wondering about how Agnus uses the bitplanes modulo registers to increment the bitplanes pointers.

When, during a scanline, the modulo is added instead of 2?

If it would possible to use the copper to trick Agnus and cause the use of the modulo at a precise place of the scanline the it would be an effective way to implement horizontal split screen.

For example implement a 160+160 pixels split screen requires a 10 words modulo and the two bitplanes rows interleaved in RAM.

By changing the modulo just before it is added it would be possible to fine scroll vertically and coarsely horizontally the 2 sides indipendently.

So, this is the idea and a possible use. Some reverse engineering and tests are required to understand how to trigger the modulo use.

Does anyone already knows how it works (emulators authors and FPGA developers maybe know this) or someone has time to try it out?

Thanks,
Ovale
ovale is offline  
Old 27 July 2017, 09:36   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
Modulos are added, plane by plane, when scan line's last plane words are fetched (after DDFSTOP).

You can restart bitplane DMA after DDFSTOP in same scanline but it only works with ECS (OCS refuses to do it until next scan line) but I don't think it is possible without visible gap.
Toni Wilen is online now  
Old 27 July 2017, 13:54   #3
ovale
Registered User
 
Join Date: Jun 2014
Location: milan / italy
Posts: 174
Quote:
Originally Posted by Toni Wilen View Post
You can restart bitplane DMA after DDFSTOP in same scanline but it only works with ECS (OCS refuses to do it until next scan line) but I don't think it is possible without visible gap.
Thanks Toni,
How playfield DMA can be restarted on ECS? Maybe this can be a starting point for experiments.

EDIT: typo
ovale is offline  
Old 27 July 2017, 14:27   #4
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
Quote:
Originally Posted by ovale View Post
Thanks Toni,
How playfield DMA can be restarted on ECS? Maybe this can be a starting point for experiments.
Move DDFSTRT after DDFSTOP (after first DDFSTRT started the DMA). One part in demo Subtle Shades (Nuance) does this. Easy to find by running it in OCS mode
Toni Wilen is online now  
Old 28 July 2017, 08:05   #5
ovale
Registered User
 
Join Date: Jun 2014
Location: milan / italy
Posts: 174
Hi Toni,

On the undocumented features thread you described a DDF state machine with 4 states and hidden temp BPLxDAT registers in Denise.

Is it correct to assume the state machine is updated every memory cycle and therefore the pause in Denise feeding will be 4 cycles?
ovale is offline  
Old 28 July 2017, 10:49   #6
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
They are running all the time (even if all planes are switched off) and even if they would stop, you still can't stop monitor's horizontal scanning. (and result would be Amiga's horizontal counter not matching actual display position anymore)
Toni Wilen is online now  
Old 28 July 2017, 12:31   #7
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
I can do some logic analyzer checks with this (to exactly see what cycle does what DMA fetch), perhaps it is possible to adjust DDFSTOP and "new" DDFSTRT exactly right to not cause any gaps. It may even cause some previously unknown side-effect
Toni Wilen is online now  
Old 28 July 2017, 14:10   #8
ovale
Registered User
 
Join Date: Jun 2014
Location: milan / italy
Posts: 174
Cool!
ovale is offline  
Old 28 July 2017, 14:24   #9
frank_b
Registered User
 
Join Date: Jun 2008
Location: Boston USA
Posts: 466
You can use a similar trick to save loading 8*2 plane pointers at the end of every line. You just need to calculate the relative offset from the line to the line you want to get to, then set the modulo registers. Much faster.
frank_b is offline  
Old 28 July 2017, 14:40   #10
ovale
Registered User
 
Join Date: Jun 2014
Location: milan / italy
Posts: 174
Quote:
Originally Posted by frank_b View Post
You can use a similar trick to save loading 8*2 plane pointers at the end of every line. You just need to calculate the relative offset from the line to the line you want to get to, then set the modulo registers. Much faster.
Hello frank_b,
Could you further explain your idea and how it is different from what I suggested?
ovale is offline  
Old 28 July 2017, 16:49   #11
frank_b
Registered User
 
Join Date: Jun 2008
Location: Boston USA
Posts: 466
Quote:
Originally Posted by ovale View Post
Hello frank_b,
Could you further explain your idea and how it is different from what I suggested?
My idea is only useful for splitting the screen up into multiple vertical chunks.
It requires 16 copper moves to set all 8 plane pointers per line. You can do it in two instead via the modulos.
frank_b is offline  
Old 28 July 2017, 18:45   #12
ovale
Registered User
 
Join Date: Jun 2014
Location: milan / italy
Posts: 174
Got it
ovale is offline  
Old 28 July 2017, 19:48   #13
NorthWay
Registered User
 
Join Date: May 2013
Location: Grimstad / Norway
Posts: 839
I'd love to hear if this works with no gap. I've been toying with setting 8 low-word pointers on AGA to get a split with 64K aligned buffers, but this would be so much better. Working on ECS is also interesting.
NorthWay is offline  
Old 29 July 2017, 19:45   #14
ReadOnlyCat
Code Kitten
 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
Quote:
Originally Posted by NorthWay View Post
I'd love to hear if this works with no gap. I've been toying with setting 8 low-word pointers on AGA to get a split with 64K aligned buffers, but this would be so much better. Working on ECS is also interesting.
This is indeed interesting but excluding OCS means that the stock A500 and A1000 will not have access to that feature.
ReadOnlyCat is offline  
Old 30 July 2017, 19:22   #15
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
Gapless DDFSTRT/STOP horizontal split does not seem to be possible, new DDFSTRT value is ignored until last plane has been fetched after previous DDFSTOP -> It works but there is always a gap.
Toni Wilen is online now  
Old 30 July 2017, 20:20   #16
NorthWay
Registered User
 
Join Date: May 2013
Location: Grimstad / Norway
Posts: 839
How big is the gap? Is it dependent on the fetchmode? Can it be futzed by changing fetchmode?
(I'm coding something different right now, so I haven't had time to test myself. Yet.)
NorthWay is offline  
Old 31 July 2017, 09:27   #17
ovale
Registered User
 
Join Date: Jun 2014
Location: milan / italy
Posts: 174
Maybe the gap can be further reduced by reducing the number of bitplanes or going in hires mode. I mean, just during the gap.

If the Gap is caused by Denise, maybe to write BPL1DAT with the Copper could reduce the gap too.
ovale is offline  
Old 01 August 2017, 12:13   #18
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
Quote:
Originally Posted by NorthWay View Post
How big is the gap? Is it dependent on the fetchmode? Can it be futzed by changing fetchmode?
(I'm coding something different right now, so I haven't had time to test myself. Yet.)
16 lores pixels. I used ECS A500, I usually don't bother with AGA..

Quote:
Originally Posted by ovale View Post
Maybe the gap can be further reduced by reducing the number of bitplanes or going in hires mode. I mean, just during the gap.

If the Gap is caused by Denise, maybe to write BPL1DAT with the Copper could reduce the gap too.
Writing to BPL1DAT won't help, it does not affect DMA sequencing (which prevents DDFSTRT detection if "old" bitplane DMA is still active). Changing number of planes or resolution probably won't help because you don't have enough time to switch it back to original and also update DDFSTR in correct positions, without seeing wrong graphics.

What about using tall attached sprite to hide the gap? (But managing the graphics data may get a bit too tricky..)

(Note that horizontal split is possible with copper moves to BPLxPTL if number of planes is 3 or less, 4 would fit but unfortunately won't work due to back to back PTL write/DMA fetch feature preventing it)
Toni Wilen is online now  
Old 01 August 2017, 14:49   #19
ovale
Registered User
 
Join Date: Jun 2014
Location: milan / italy
Posts: 174
Indeed minimize the gap size with hires or lower bitplanes count and cover it with a sprite can be a good compromise.

Even better if would existing a way to switch a bit in a register and force Denise to output color 0. But I'm not aware of such feature. Is it possible?
ovale is offline  
Old 04 August 2017, 20:28   #20
NorthWay
Registered User
 
Join Date: May 2013
Location: Grimstad / Norway
Posts: 839
Can someone help with the testing of this? I don't know if my timing is off or what. (AGA 4x)

I tried setting $38/$38, wait, $3a/$9c, wait. Simply testing $38/$38 shows a weird extra fetch in the left hand side overscan. Can you do a display that is only 16(/64) pixels wide? I'm getting the impression it will always do at least two fetches.
My test above ended up looking like it was a regular $38/$9c display of a 320 pixels screen.
What position should I wait for before changing DDFSTART?
NorthWay 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
When is the modulo added to the bitplane pointers? DanScott Coders. Asm / Hardware 3 07 March 2016 18:24
Split screen 2D puzzle game with jewels BSzili Looking for a game name ? 3 06 February 2016 17:16
How does AGA impact modulo? NorthWay Coders. Asm / Hardware 56 24 October 2015 02:21
Top down four split-screen game. pickaweapon Looking for a game name ? 5 23 August 2012 01:06
split up screen filter settings zygzak request.UAE Wishlist 0 24 October 2009 18:58

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 08:49.

Top

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