emufreak / iAmiga

iAmiga sources
44 stars 17 forks source link

Beautiful Amiga Hires Output Fix: Use of 640 iOS horizontal pixels in… #63

Closed mithrendal closed 7 years ago

mithrendal commented 7 years ago

…stead of only 320. Removed the shrinked drawing code of hires and replaced it with 1pixel to 1pixel output. Because of 640 native pixel amiga lores drawing had now to be stretched.

27

testing at mithrendal/iAmiga/dev

simontoens commented 7 years ago

@mithrendal I just tried it, looks great! Finally Workbench/DOS doesn't look like crap anymore! Thanks!!!

simontoens commented 7 years ago

@emufreak could you merge this?

emufreak commented 7 years ago

Hi there. Great news. Thanks @mithrendal. I do have one question. What do you mean with stretched. The whole screen won't get stretched to 16:9 does it?

mithrendal commented 7 years ago

Hi @emufreak

you are referring to the statement "Because of 640 native pixel amiga lores drawing had now to be stretched." are you ?

Well, in this case I don't mean the 16:9 stretching thing which you can enable in the user settings. I mean fix programmed pixel doubling for lores and medres. We now open a 640 width pixel SDL view instead of 320 in order to display amiga hires. Now we must to draw 320 horizontal lores amiga pixels to 640 pixels of the iPhone right ? If we would not do the doubling of horizontal pixels then the amiga screen would only be drawn to the first half of the iPhone screen only, right?

mithrendal commented 7 years ago

@emufreak you might also like to take a look at issues #62 #64 and #27 for further details on problems which are fixed by the commits of this pull request. ( at least I hope ;-) )

mithrendal commented 7 years ago

The last commit solved issue #65 .

emufreak commented 7 years ago

Hi @mithrendal. Plan to have a look at it today

emufreak commented 7 years ago

Hi @mithrendal. I do have some display related bug with your fix. Sometimes only part of the screen gets displayed but magnified. Any one else encountered this?

mithrendal commented 7 years ago

Hi @emufreak , Did you tried with the very latest commit? Because there was still a bug and it fixed it for me. Which ADF does show the problem?

emufreak commented 7 years ago

Hi @mithrendal. I downloaded your pull request on January 20, so all your commits should be included. I encountered this on Wb13 and Wb31.

emufreak commented 7 years ago

Test device is an Ipad 3 IOS 9

mithrendal commented 7 years ago

Hi @emufreak , I will test and debug it on an iPad later today. When you turn off stretching everything is okay then? Could you attach the screenshot?

mithrendal commented 7 years ago

Hi @emufreak , I tested it thoroughly. Also on ipad2 ios10 NTSC I indeed saw some magnification hickups every 8-14 seconds or so. Not on iphone though an not on ipad with PAL. Made it more conservative now. I see no hickups anymore. What about you ?

UPDATE: Wait I again see them again after some minutes of running the workbench screen...

mithrendal commented 7 years ago

Hi @emufreak ,

I found the bug and fixed it. See explanation of latest commit. Thanks for testing. ;-)

simontoens commented 7 years ago

@mithrendal @emufreak is there something I can help with to get this PR merged? Is it only a matter of testing?

mithrendal commented 7 years ago

I am ready with my testing. Tested maybe 20 Titles or so and some freaking demo-scene stuff. Everthing seems neat fine and beautiful now especially hires titles and Workbench and AmigaDOS since we are on 640 horizontal pixel resolution now. Some lores PAL titles were in the past clipped at the bottom, not anymore now because I changed vertical resolution from 240 to 256. The new automatic vertical adaptive stretching makes amiga games "greater" on little devices like iPhones. With the latest commits I ironed out some bugs found by @emufreak and myself. @simontoens Should be pretty ready to merge now.

simontoens commented 7 years ago

@emufreak could you merge this or if there's more work here, could you let me know how I can help?

emufreak commented 7 years ago

Hello @mithrendal @simontoens Sorry for the long waiting time. I had some Issue with ZakMcKraken and Whdload. Screen tunred black every few minutes. Most likely this has nothing to do with this but I want to doublecheck. Unfortunately I don't have much time for iUAE at the moment. But I'll look into it as soon as possible.

simontoens commented 7 years ago

I will play Zak a bit without Whdload to see if I notice any problem.

mithrendal commented 7 years ago

When the screen turns black, does it stay black for all the time or only for a fraction of a second ?

mithrendal commented 7 years ago

@simontoens when you are able to reproduce this, then describe it a little bit and I will fix it this evening.

simontoens commented 7 years ago

@mithrendal @emufreak I played Zak for about 15 minutes and I can't reproduce the "black screen" issue. It plays and looks fine.
I noticed that the game looks slightly different in mithrendal's branch - the image seems more clear, but it is also a little shorter vertically. I can't really say which one looks more correct; mithrendal, is that expected? I guess it has to do with how we are now doubling pixels in lores mode, which we were not doing before? I am attaching the side-by-side comparison: on the left, the current dev branch, on the right mithrendal's dev branch. Summary: I didn't find any issues. zak

mithrendal commented 7 years ago

@simontoens What were the test settings? Ipad/iphone? Ntsc/pal? Stretching on/off? Thanks for testing.

mithrendal commented 7 years ago

Almost looks like iPad PAL without stretching. If that is the case, then +the slight "more" brilliance comes from the exact pixeldoubling as the opengl now has more pixel to work/scale with. (@simontoens as you said)

+the little shorter image comes from the fact it is rendering vertical 256 PAL pixels instead of 240 when stretching is off. (Because it has to pack 16 more lines into the output, the rest gets smaller in comparison...) When you enable stretching (then it uses only the games requested vertical lines) or even NTSC you should get other results with bigger graphics.

simontoens commented 7 years ago

@mithrendal correct, this is an iPad with pal and no stretching. I tried with stretching too, but then the image got just a little too distorted for my taste.

mithrendal commented 7 years ago

Hi @simontoens I was rethinking about the reason why you feel that switching stretching on for the ipad gives you a too distorted display. And why this seems only a problem on ipad and not the phones. I have tracked it down and will add another commit soon for this ipad related thing.

Here is my analysis (assuming a typical game with 200 vertical lines viewport): If you turn on fullscreen stretching on an iPhone it does map the amiga to the complete fullscreen in case of a Plus it scales horizontal x6 (320 to 1920) and vertically x5,4 (200 to 1080) in case of normal 6er phone it scales horizontal x4,16 (320 to 1334) and vertically x3,75 (200 to 750)

The ratio here also isnt quite the same but at least not very far off and for that small not relevant difference you dont see any borders and get max. fullscreen display as a pay off. The most important thing from a standpoint of taste is that it scales horizontal a bit more than vertical which is more acceptable than the other way around.

but in case of the ipad things get inversed:

in case of ipad it scales horizontal x6,4 (320 to 2048) and vertically x7,68 (200 to 1536)

  1. the difference in horizontal vs. vertical with -1.28 is much bigger as on the iphones with only 0,6
  2. the difference is inverse on ipads. It scales more vertically than horizontally. This looks much worse as the opposite way when the difference is not inverse.

new goal: address this ipad only specific issue and make stretching on ipads looking good

simontoens commented 7 years ago

@mithrendal thanks that makes sense.

mithrendal commented 7 years ago

Hi @simontoens, you may try again with stretching on now on the iPad ;-).

simontoens commented 7 years ago

Great I will try it again tonight (I am in JST)

mithrendal commented 7 years ago

@simontoens

I also found a statement about the aspect ratio of original amiga hardware. It says

The Amiga was capable of displaying various screen resolutions. All monitors and TV's of that time had a picture aspect ratio of 4:3 but the pixel aspect ratio varied greately. The ratios in the lists are pixel aspect ratios and the are rounded to the nearest neighbour. In reality PAL pixels are a tiny bit wider than they are tall (16:15) and NTSC pixels are a bit taller than they are wide (8:9).

http://amiga.lychesis.net/knowledge/ScreenModes.html

I myself remembering the times where I adjusted the width and height on my analog 1084 amiga monitor these days. It was never really exact and has always been quite a matter of taste. A circle should not be too eliptic though ;-)

Thanks for testing.

simontoens commented 7 years ago

@mithrendal yes I also remember playing around with the width and height settings on my Amiga monitor...I did not think about that until you mentioned it just now.

With your most recent changes, running with stretching enabled looks great - thanks!

As far as I am concerned this PR can be merged.

emufreak commented 7 years ago

@mithrendal Many thanks for your contribution and your patience. I tried it with some other applications and gad no Issue at all.

Display looks wonderful with this. I do have almost full screen even without the stretching on my iPad. I'll merge this now

simontoens commented 7 years ago

Yes thanks @mithrendal!

mithrendal commented 7 years ago

It was a pleasure ! ;-)

simontoens commented 7 years ago

@mithrendal I just noticed Lemmings looks better after these changes (no more bad graphics on left hand side) - just wanted to say thanks again.

mithrendal commented 7 years ago

@simontoens Then that means Lemmings runs on Hires. Cool must try out. Lefthand border issue was #62 right? When this runs on hires mode, that means it must also be much clearer than before this pullrequest due to doubled resolution. Cool.

simontoens commented 7 years ago

Yes I think it must have been #62.