27 July 2017, 09:04 | #1 |
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 |
27 July 2017, 09:36 | #2 |
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. |
27 July 2017, 13:54 | #3 | |
Registered User
Join Date: Jun 2014
Location: milan / italy
Posts: 174
|
Quote:
How playfield DMA can be restarted on ECS? Maybe this can be a starting point for experiments. EDIT: typo |
|
27 July 2017, 14:27 | #4 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
|
|
28 July 2017, 08:05 | #5 |
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? |
28 July 2017, 10:49 | #6 |
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)
|
28 July 2017, 12:31 | #7 |
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
|
28 July 2017, 14:10 | #8 |
Registered User
Join Date: Jun 2014
Location: milan / italy
Posts: 174
|
Cool!
|
28 July 2017, 14:24 | #9 |
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.
|
28 July 2017, 14:40 | #10 | |
Registered User
Join Date: Jun 2014
Location: milan / italy
Posts: 174
|
Quote:
Could you further explain your idea and how it is different from what I suggested? |
|
28 July 2017, 16:49 | #11 | |
Registered User
Join Date: Jun 2008
Location: Boston USA
Posts: 466
|
Quote:
It requires 16 copper moves to set all 8 plane pointers per line. You can do it in two instead via the modulos. |
|
28 July 2017, 18:45 | #12 |
Registered User
Join Date: Jun 2014
Location: milan / italy
Posts: 174
|
Got it
|
28 July 2017, 19:48 | #13 |
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.
|
29 July 2017, 19:45 | #14 |
Code Kitten
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
|
This is indeed interesting but excluding OCS means that the stock A500 and A1000 will not have access to that feature.
|
30 July 2017, 19:22 | #15 |
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.
|
30 July 2017, 20:20 | #16 |
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.) |
31 July 2017, 09:27 | #17 |
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. |
01 August 2017, 12:13 | #18 | ||
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
|
Quote:
Quote:
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) |
||
01 August 2017, 14:49 | #19 |
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? |
04 August 2017, 20:28 | #20 |
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? |
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 |
|
|