English Amiga Board


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

 
 
Thread Tools
Old 15 July 2018, 12:51   #21
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by Toni Wilen View Post
Does hires resolution also have exact same extra delay? (EDIT: I'll try to do some real hardware tests later today)
Attached an hires version.
Video timings changed due to 3 (2pf) hires planes (so similar DMA usage as 6 lowres planes), changed also DDFSTRT/STOP but DIWSTRT/STOP in sync to copper COLOR00 changes.

FSizzle please can you check if half pixel mismatch is visible in your A1200?
(maybe there are different versions that have different behaviors?)

Waiting real test from Master Wilen for a definitive response.

--
Quote:
I probably explained it in some other thread but here is quick explanation:

This requires large rewrite, currently single Amiga lores/hires/shres pixel is single bit in whole display emulation path. Until finally output pixel color is decided (background, sprite or bitplane pixel) where single pixel becomes 1, 2 or 4 native horizontal pixels using optimized generated code. (every doubling mode has separate routine)

Everything is optimized for this behavior.

Sprites already support it because they are relatively simple and can't have weird side-effects. (like writing to BPLCON1 mid-scanline does)
Thanks Toni, I did not see the thread in which you explained this (sorry)

You write so many interesting things that it would take a secretary to collect everything and make an encyclopedia

Well, when you have time it's an interesting change to increase AGA compatibility.
Attached Files
File Type: zip halfhres.zip (867 Bytes, 99 views)
ross is offline  
Old 15 July 2018, 19:28   #22
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
Quote:
Originally Posted by ross View Post
Attached an hires version.
Video timings changed due to 3 (2pf) hires planes (so similar DMA usage as 6 lowres planes), changed also DDFSTRT/STOP but DIWSTRT/STOP in sync to copper COLOR00 changes.
It is too difficult to see, it has too random looking graphics.

EDIT: I did some tests and it happens in hires too, same 1 hires pixel extra delay.

Last edited by Toni Wilen; 15 July 2018 at 20:00.
Toni Wilen is offline  
Old 15 July 2018, 19:59   #23
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Cumulative EDIT:

Ok, thanks!

A solution in a real Amiga, if a game use this feature, can be:
Code:
 if (AGA) {
   set a fixed delay, to all playfields, of half lores pixel for every BPLCON1's value
   set DIWHIGH accordingly
 }

Last edited by ross; 15 July 2018 at 21:20. Reason: cumulative edit
ross is offline  
Old 15 July 2018, 20:01   #24
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
I just edited above post (first test case was not that good). It happens in lores and hires, same 1 hires pixel delay in both modes.
Toni Wilen is offline  
Old 15 July 2018, 20:32   #25
FSizzle
Registered User
 
Join Date: Nov 2017
Location: Los Angeles
Posts: 49
Quote:
FSizzle please can you check if half pixel mismatch is visible in your A1200?
When I boot the halfhres exe there are differences vs WinUAE as follows (for the 5 different states of the test):
- 1 - every second pixel misaligned on left side. Right shows extra non-white pixel column
- 2 - same as 1
- 3 - same as 1
- 4 - right side shows two non-white pixels (left side now matches)
- 5 - same as 4

In hires mode, the mismatches seem to be one hi-res pixel, which is consistent with lowres (half a lowres pixel = one hires pixel after all )

I attached an image showing these 2 states, comparing left and right on real HW vs WinUAE
Attached Thumbnails
Click image for larger version

Name:	Hires_Overview.jpg
Views:	199
Size:	37.0 KB
ID:	58865  
FSizzle is offline  
Old 15 July 2018, 20:36   #26
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by FSizzle View Post
In hires mode, the mismatches seem to be one hi-res pixel, which is consistent with lowres (half a lowres pixel = one hires pixel after all )
Thanks!

So I know how to patch this 'feature'
ross is offline  
Old 15 July 2018, 20:46   #27
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by FSizzle View Post
When I boot the halfhres exe there are differences vs WinUAE as follows (for the 5 different states of the test):
- 1 - every second pixel misaligned on left side. Right shows extra non-white pixel column
- 2 - same as 1
- 3 - same as 1
- 4 - right side shows two non-white pixels (left side now matches)
- 5 - same as 4
Just a conclusive word: the results are exactly as I expected.
Actually states are 4, one was a mistake in my code due to an erroneous shift initialization

Thanks for your time!
ross is offline  
Old 17 July 2018, 10:14   #28
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
winuae.7z now adds hires pixel delay to all color register writes if AGA which seems to "fix" this problem. It was very simple change and has nothing to do with BPLCON1 hires/shres missing feature.

But because this causes quite ugly mismatched borders in some games, it most likely looks like new UAE bug..

EDIT: I guess delay may come from BPLCON4 XOR operation. Because when BPLCON4 is modified, it isn't instant but adds another hires pixel delay (was lores previously in emulation but it is actually extra hires = 1 + 1 hires = 1 lores) before colors change after BPLCON4 modification.

EDIT2: HAM and EHB needs testing, some HAM/EHB bits bypass BPLCON4 so in worst case there are 2 possible delays.. (http://eab.abime.net/showthread.php?t=85588)

Last edited by Toni Wilen; 17 July 2018 at 10:28.
Toni Wilen is offline  
Old 17 July 2018, 12:14   #29
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by Toni Wilen View Post
winuae.7z now adds hires pixel delay to all color register writes if AGA which seems to "fix" this problem.


Quote:
It was very simple change and has nothing to do with BPLCON1 hires/shres missing feature.
Sure, but the only possibility that comes to my mind to patch games that use this feature is by setting PFxH1=1 in every BPLCON1 write and set DIWHIGH(H1,bit12/4)=1

Quote:
But because this causes quite ugly mismatched borders in some games, it most likely looks like new UAE bug..
Unfortunately most of these games use double playfields and fall into the PF1!=PF2 unsupported shift casuistry, so..
It is not better to leave as before and mask-out H1 in lores screens cases?
At least as long as there is no full AGA shires/hires shift support.


Quote:
EDIT: I guess delay may come from BPLCON4 XOR operation. Because when BPLCON4 is modified, it isn't instant but adds another hires pixel delay (was lores previously in emulation but it is actually extra hires = 1 + 1 hires = 1 lores) before colors change after BPLCON4 modification.

EDIT2: HAM and EHB needs testing, some HAM/EHB bits bypass BPLCON4 so in worst case there are 2 possible delays.. (http://eab.abime.net/showthread.php?t=85588)
Very interesting.

Thanks as always!
ross is offline  
Old 17 July 2018, 20:57   #30
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
I started implementing proper subpixel support, more information when/if it starts working... I'll probably enable hires pixel color delay emulation only when subpixel emulation is also enabled.
Toni Wilen is offline  
Old 17 July 2018, 22:36   #31
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by Toni Wilen View Post
I started implementing proper subpixel support, more information when/if it starts working... I'll probably enable hires pixel color delay emulation only when subpixel emulation is also enabled.
ross is offline  
Old 18 July 2018, 07:33   #32
FSizzle
Registered User
 
Join Date: Nov 2017
Location: Los Angeles
Posts: 49
Quote:
I started implementing proper subpixel support, more information when/if it starts working... I'll probably enable hires pixel color delay emulation only when subpixel emulation is also enabled.
@Toni - Very nice. For what it's worth, I think going for accuracy is the right approach - I like the idea of all bugs and hardware quirks being emulated correctly (something WinUAE already does an amazing job of!)

Quote:
if (AGA) {
set a fixed delay, to all playfields, of half lores pixel for every BPLCON1's value
set DIWHIGH accordingly
}
@ross - I think this is a good option - I need to similarly adjust sprite positioning as well. Alternatively, I also realized that I might be able to solve the problem on AGA by using BRDRBLNK in BPLCON3 (i.e. don't bother syncing at the edges precisely (or even at all), but just mask the border to black instead).
FSizzle is offline  
Old 18 July 2018, 08:47   #33
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by FSizzle View Post
@ross - I think this is a good option - I need to similarly adjust sprite positioning as well. Alternatively, I also realized that I might be able to solve the problem on AGA by using BRDRBLNK in BPLCON3.
Yes, this is a viable alternative
Anyway you've to set DIWHIGH appropriately and there're two little drawback:
- forced black at border with loss in that area of any graphic element (sprite or copper effects)
- the lose of one half-pixel at the left edge (but this is really insignificant )

EDIT: thinking about it better, the former can be a not too little problem for AGA productions that use FMODE=3/7 and cover left edge with sprite(s) to compensate the bigger DDFSTRT and large 64bit scroll. Therefore the use of BRDRBLNK should be carefully weighed and the pros and cons evaluated.

Quote:
(i.e. don't bother syncing at the edges precisely (or even at all), but just mask the border to black instead)
If you need OCS/ECS compatibility you have to sync

Last edited by ross; 18 July 2018 at 09:13.
ross is offline  
Old 19 July 2018, 03:54   #34
FSizzle
Registered User
 
Join Date: Nov 2017
Location: Los Angeles
Posts: 49
Quote:
If you need OCS/ECS compatibility you have to sync
My target is OCS, so I will continue to sync there. I just want to do some extra stuff on AGA to make it look correct (not have the misalignment)

My plan is to check if running on AGA and build the copperlist differently, so that for OCS I continue to change the background color in sync with DIWSTRT/STOP as I do now, but for AGA, I instead change the color only before the start of each display line and use BRDRBLNK to mask off the border. If I do this, I don't need to tweak DIWHIGH either.

In my case I want the border black in all cases, as I think it looks nicer, so the effect of BRDRBLNK masking is desirable. I would use it for OCS if it was available instead of the explicit timing which burns a lot of copper cycles

I believe BRDRBLNK is avilable on ECS as well, but it's simpler for me to keep it the same as OCS so I don't complicate the copper list construction code with a 3rd set of timings to handle (it's already complex enough with all the sprite multiplexing interleaved with palette changes and other display trickery

Last edited by FSizzle; 19 July 2018 at 03:55. Reason: typo
FSizzle is offline  
Old 19 July 2018, 10:49   #35
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Yep, for your needs it's the best way to do

Unlucky my 'patch' habit for old demos/games require a different approach.

Back to Lionheart's example: it has a hell of copper list (dynamic, synced, even a little illegal, full of tricks).
To satisfy my need for perfection I did a complete (insane..) re-sourcing of the code.
And from here i've fixed all BPLCON1 (OCS) illegal usage (distibuted in variuos code, tables, copper snippet..) that make all sort of glitches on AGA machines.. not even visible to an untrained eye.
[Well, actually i've optimized MANY other thinghs (this is only a little fraction), but I do not even know if I will eventually get something finished out of it, as I often do..]

Using BRDRBLNK would have solved only the 'edges' part of the video.
And the 2nd possible (monster) AGA copper-list would've required a complete rewrite of the video routine.
So changing H1 (on BPLCON1/DIWHIGH) it's to be considered only a side effect and with small impact on the whole process (and seem to work, I need a beta tester..)

Always a pleasure that there is still someone who enjoys playing with these chipsets.
Good job and fun!
ross is offline  
Old 19 July 2018, 15:31   #36
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
http://www.winuae.net/files/b/winuae.7z updated with experimental subpixel display emulation support.

- option in chipset panel
- display panel resolution selects internally emulated resolution.
- most speed optimization tricks are not implemented.
- option also works in ocs/ecs modes (but does nothing visible, only slows down emulation, easier test case for me to confirm non-corrupted display)
- 1 hires pixel AGA color delay is only emulated if subpixel emulation is enabled.

Quote:
Originally Posted by FSizzle View Post
I believe BRDRBLNK is avilable on ECS as well
Border blank feature was introduced in ECS Denise. (Which was part of new genlock features that probably no one used..)

Last edited by Toni Wilen; 19 July 2018 at 20:13.
Toni Wilen is offline  
Old 19 July 2018, 18:56   #37
ReadOnlyCat
Code Kitten
 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
Quote:
Originally Posted by ross View Post
Back to Lionheart's example: it has a hell of copper list (dynamic, synced, even a little illegal, full of tricks).
To satisfy my need for perfection I did a complete (insane..) re-sourcing of the code.
And from here i've fixed all BPLCON1 (OCS) illegal usage (distibuted in variuos code, tables, copper snippet..) that make all sort of glitches on AGA machines.. not even visible to an untrained eye.

[Well, actually i've optimized MANY other thinghs (this is only a little fraction), but I do not even know if I will eventually get something finished out of it, as I often do..]
You should consider creating a new thread about your changes!

I have been harping for quite a while about how there is likely room for optimization in most commercial Amiga games because: they were built under time pressure, profiling and debugging tools were usually very primitive (especially compared with modern ones like VTune) and oftentimes teams included coders which were not necessarily super experienced.

So I would be super interested in which kinds of avenues for optimization and rework you found in LionHeart.
ReadOnlyCat is offline  
Old 19 July 2018, 20:15   #38
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by Toni Wilen View Post
..updated with experimental subpixel display emulation support.
Great, I'll try it!


Quote:
Originally Posted by ReadOnlyCat View Post
You should consider creating a new thread
Well, I've to make it working first, in this period I have very low rhythms
Some unfinished changes:
- optimized various generic code (too much to list), more pc-relative or base-relative code
- changed memory manager (doesnt require anymore a patch that mess memory)
- native support for whdload (yes, in main code!)
- optimized some blitter routine (with faster blitter wait) and faster objects mirror routine
- all the fix of the whdload version (and more..)
- glitches free and full AGA support (see this thread)

But do not expect significative performace change, this game is really a jewel in Amiga history (maybe less slowdown, which are indeed rare).

Bye!
ross is offline  
Old 20 July 2018, 00:59   #39
FSizzle
Registered User
 
Join Date: Nov 2017
Location: Los Angeles
Posts: 49
I have discovered another interesting thing related to all this. On AGA the BRDRBLNK is applied a half pixel early on the left hand side on real hardware! Interestingly it is applied at the expected place on the right hand side.

I've attached an updated HalfPixelTest.exe. If you press and hold the right mouse button, the BRDRBLNK will be applied and you can see the third line is correctly cropped on the right, but is cropped a half pixel early on the left.
Attached Files
File Type: zip HalfPixelTest.zip (1.6 KB, 89 views)

Last edited by FSizzle; 20 July 2018 at 01:17. Reason: Updated HalfPixelTest.7z with source for reference
FSizzle is offline  
Old 20 July 2018, 01:05   #40
FSizzle
Registered User
 
Join Date: Nov 2017
Location: Los Angeles
Posts: 49
Quote:
You should consider creating a new thread about your changes!
@ross +1 I would also find this very interesting.
FSizzle 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
Alien Breed II title pixel by pixel logo removal dex project.Sprites 17 06 May 2020 15:23
Needed: A1200 Delay Line & Bandpass Filter PARALAX support.Hardware 0 04 December 2016 18:44
A1200 reset delay Cobe support.Hardware 18 09 May 2016 18:31
Problem running copper master demo on A1200 whitebird support.Demos 26 17 August 2014 17:41
Wanted - A1200 Tin Shield Bottom Half - NEW Peter MarketPlace 0 15 September 2010 17:06

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 09:37.

Top

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