Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Layout broken after changing resolution (Stella)  (Read 6831 times)

0 Members and 1 Guest are viewing this topic.

shodan

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 9
  • Last login:May 09, 2011, 09:54:39 am
Layout broken after changing resolution (Stella)
« on: January 11, 2011, 08:00:26 am »
Hello,

I've got three emus running in Mala: Stella, WinVice. All of them got the same Layout (except a different Logo). My desktop is running with a 1024er resolution. If I start Winvice or Mame, play a game (fullscreen) and quit, all is fine in mala. If I start a game in Stella, after quitting and returning to Mala the layout is broken. Changing to the vice-screen and back to the Atari-screen in Mala "repairs" the Atariscreen again.

Any ideas? I think it has something to do with changing the fullscreen resolution.

Here is a screenshot:
http://cl.ly/2F202L0p0f2O35172s0C

markronz

  • We traced the call, and it came from....INSIDE YOUR ARCADE MACHINE!
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 821
  • Last login:April 12, 2019, 12:03:08 am
  • Game on!
Re: Layout broken after changing resolution (Stella)
« Reply #1 on: January 13, 2011, 09:58:47 am »
Hey shodan.   Unfortunately I cannot get to your screenshot since I am at work right now, but, I have a good guess as to what's happening.  I experienced a problem with Stella myself where the background screen gets shifted when exiting Stella.   That is covered in this post here:

http://forum.arcadecontrols.com/index.php?topic=88602.0

Not sure if there is a definitive fix in that thread or not, but it's worth reading either way.   Personally, I was not able to fix this problem with using Stella.    It's something to do with it switching resolutions between when Stella is running and your normal Windows resolution.    What I had to do was set Stella to use the same resolution as my Windows resolution.   This seemed to correct the issue.  However, the down fall to this, was that I was unable to run Stella emulation in full screen.   It only uses up maybe 75% of the screen.  For me, I was satisfied with this.   You could also consider using a different emulator for Atari too.   I have used MESS in the past to do Atari 2600 emulation and it worked pretty well.  None of the weird background shifting problems either.    The only thing that kept me with Stella is the Save/Load support I guess.   But do you really need to save a state in an Atari game?  Probably not, but I'm picky that way.

If you're experiencing a different type of problem with Stella, shown in your screenshot, I apologize!

shodan

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 9
  • Last login:May 09, 2011, 09:54:39 am
Re: Layout broken after changing resolution (Stella)
« Reply #2 on: January 13, 2011, 05:04:20 pm »
My problem is exactly the same. I thought it’s a bug in Mala, and not Stella. I run Mala in a 1024er resolution, that’s too big for VCS. I'll have a look at Mess...

markronz

  • We traced the call, and it came from....INSIDE YOUR ARCADE MACHINE!
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 821
  • Last login:April 12, 2019, 12:03:08 am
  • Game on!
Re: Layout broken after changing resolution (Stella)
« Reply #3 on: January 13, 2011, 05:11:46 pm »
Well it's possible it is still a bug in Mala, but it's generated by Stella and the way it switches resolution I guess.   And yeah if you're running at 1024x768 resolution, my guess is that you aren't going to be able to fix this issue while still using Stella.  At least if you want Stella to be run full screen.  But in that link I posted, there are a few things to try at least.  So you could give those a shot still if you wanted to.  Failing that, yeah you could try out other emulators for Atari.   Good luck!

sa666666

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:May 08, 2012, 07:01:00 pm
Re: Layout broken after changing resolution (Stella)
« Reply #4 on: January 16, 2011, 12:11:50 pm »
Hello, I'm the maintainer of the Stella project.  Someone recently contacted me by email and pointed me to this thread.  Here's the response I gave:


I read through this thread, and also through all the posts in the other
thread that initiated this discussion.  First of all, make sure everyone
is testing with the very latest version (3.3).  Next, I'll need some
instructions on how to set up 'Mala', as I've never heard of this program
before.  Basically, I want to duplicate the issue you're seeing, since
otherwise I have no idea how to fix it.

Stella uses SDL (Simple Directmedia Library) for graphics and sound, and
this is what allows it to work across multiple platforms.  Now, I have
seen an issue in Windows where if you return from fullscreen mode, the
desktop icons are rearranged, almost as if they're trying to be squeezed
into a lower resolution screen.  I suspect whatever is causing that issue
is related to your issue.  This seems to be an SDL issue that I haven't
really looked at, but if it's causing you major problems, then perhaps
it's time to fix it for good.

Also, make sure the 'center' option is set to 0 or false, as you don't
want Stella to move the window around itself.

Also, I noticed some people mentioning that options work from the
commandline but not from the stella.ini file.  There are two possible
reasons:

1)  You're not editing the right stella.ini file.  The INI file is always
located in %APPDATA%\stella\stella.ini.  Simply open Windows Explorer and
type %APPDATA%\stella, and it will bring you to the right location.

2)  You 'force-quitting' Stella.  If you force-quit Stella behind the
scenes, it won't save its settings.  As such, whatever changes you've made
won't 'stick'.  This part is a hack anyway; the proper way is to fix
Stella/SDL/whatever, instead of forcing it to quit.

Anyway, please get back to me with a detailed description on how to set up
Mala to give EXACTLY the same problems as you're seeing.

I'm also going to register on the site you mentioned and provide this
response there.


Anyway, here I am.  I'll try to find time over the next few weeks to look into this issue.  Can someone provide a precise description of setting up Mala and showing how Stella doesn't work?  I want to be getting exactly the same problem as you're getting; otherwise I don't have any chance of fixing it.

markronz

  • We traced the call, and it came from....INSIDE YOUR ARCADE MACHINE!
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 821
  • Last login:April 12, 2019, 12:03:08 am
  • Game on!
Re: Layout broken after changing resolution (Stella)
« Reply #5 on: January 17, 2011, 10:21:39 am »
Hello!   Always great when a developer is willing to come out and help try to resolve some issues!  We definitely appreciate the help.  I, for one, love Stella.   I continue to use it, but I do see this problem as a nuisance for us Mala users

Just a small description of what Mala is.   It's what we call a "front end" program.   We here at this site make arcade machines, and most of us use multiple emulators on them.   Mala is a program that links all these emulators together.  It acts as a launch screen.   It can show screen shots, video previews, box art, or anything you want for all of the games.   So on my machine, Stella is just one of many emulators that I have set up to work in Mala.

If you're at all curious to see it in operation, you can check the few videos below of my arcade machines.


There's no Stella footage in my videos, but it can show you the general idea of what Mala does anyway...

Now Mala was first and foremost designed to work with MAME.  Which is the emulator for arcade games.   So you will not actually be able to use Mala without having Mame installed on your machine.  But not to worry, its very easy to set up.   I've wrote up some quick instructions for you and attached them.   The instructions should show you how to install Mala, then Mame, and then configure Mala to work with Stella.    In that document it also shows you the settings, for me at least, that make this "screen shift" issue occur.   I cannot speak for others who have this problem, but I would assume that their settings and circumstances are pretty similar to my own.   Sorry the instructions are not totally polished, but they should be good enough to get you going I think.    Please let me know if you have any questions, or need me to do any testing on my side!  Otherwise, let us know what you find out.   My ultimate goal is to get Stella to run as large as possible on my screen, and then upon exit, have my Mala menu still in tact.  However, my work around right now works, but the size in which it's emulated on the screen is greatly decreased.
« Last Edit: January 17, 2011, 10:35:20 am by markronz »

sa666666

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:May 08, 2012, 07:01:00 pm
Re: Layout broken after changing resolution (Stella)
« Reply #6 on: January 17, 2011, 11:14:27 am »
OK, I'll try to look into this over the next week or so.  I'm actually off work due to surgery last Thursday, so I do have some time.  Of course, a lot of that time is taken up with the effects of painkillers, so no guarantee when I actually get to it  ;D

markronz

  • We traced the call, and it came from....INSIDE YOUR ARCADE MACHINE!
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 821
  • Last login:April 12, 2019, 12:03:08 am
  • Game on!
Re: Layout broken after changing resolution (Stella)
« Reply #7 on: January 17, 2011, 11:21:04 am »
Sounds good!  Hope you get better!  Save some meds for me!  lol    ;D

sa666666

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:May 08, 2012, 07:01:00 pm
Re: Layout broken after changing resolution (Stella)
« Reply #8 on: January 17, 2011, 11:26:50 am »
As a workaround, if you have OpenGL drivers installed on your machine, try the following (in Options -> Video Settings):

1)  Set Stella 'renderer' to OpenGL
2)  Set resolution to match desktop (in your case, 800x600)
3)  Turn on 'GL FS Stretch'

This will show fullscreen resolution in 800x600, which should fix the repositioning issue.  And the 'stretch' option will allow the image to fill the entire screen, as much as possible.  You see, the problem here is that the software renderer will only scale in whole number increments (ie, 1x, 2x, 3x, etc).  And since the base size of a Stella game is 320x210 or so, an 800x600 screen will only allow 2x.  This is why you can only select 2x in the settings.  OpenGL, however, is much more lenient, since the hardware is doing the scaling.  It can scale to non-integer values (ie, 2.5, 2.6, etc) to entirely fill your screen.  Also note that if supported, OpenGL is the much better option anyway, because you can turn on vsync updates and eliminate tearing in the video updates.

Also note that there's a configuration option not present in the UI called 'uselauncher'.  If you edit the INI file and set this to 0 or false, it will disable using the ROM launcher at all.  As such, pressing Escape will exit the ROM and never show the launcher at all.  This was specifically added for frontend users like yourself.

Finally, this isn't a fix for the original problem.  Stella still shouldn't be screwing up the display on exit.  I'll still look into it.

markronz

  • We traced the call, and it came from....INSIDE YOUR ARCADE MACHINE!
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 821
  • Last login:April 12, 2019, 12:03:08 am
  • Game on!
Re: Layout broken after changing resolution (Stella)
« Reply #9 on: January 17, 2011, 12:06:18 pm »
Hey, thats great!  I had played with the OpenGL renderer before, but didn't think it fixed anything.  For myself with my desktop set to 800 x 600, and Stella set to 800 x 600, Open GL, GL FS Stretch, this fixes my own problem!   I'm not sure if it will fix everyones though.  As people discuss in this thread I think they experience the problem more because they have differing resolutions between windows and Stella.   So while my own problems are fixed, others still might not be.   Thusly, I will help test if I can, but I am hoping others with this problem with chime in if needed.   So I appreciate you still looking into this.    I guess with my directions, you can at least set up Mala and Stella and be able to play around with the different resolutions to see if you can get it to break yourself.

One thing you could clarify for me though.  You said to "turn on vsync updates".  What setting is this?   Is this just the setting that's labeled "GL VSync"?   You suggest I turn that setting on then, now that I am using OpenGL?

Thanks again for the help!

sa666666

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:May 08, 2012, 07:01:00 pm
Re: Layout broken after changing resolution (Stella)
« Reply #10 on: January 17, 2011, 12:24:21 pm »
Hey, thats great!  I had played with the OpenGL renderer before, but didn't think it fixed anything.  For myself with my desktop set to 800 x 600, and Stella set to 800 x 600, Open GL, GL FS Stretch, this fixes my own problem!   I'm not sure if it will fix everyones though.  As people discuss in this thread I think they experience the problem more because they have differing resolutions between windows and Stella.   So while my own problems are fixed, others still might not be.   Thusly, I will help test if I can, but I am hoping others with this problem with chime in if needed.   So I appreciate you still looking into this.    I guess with my directions, you can at least set up Mala and Stella and be able to play around with the different resolutions to see if you can get it to break yourself.
Yes, this is just a workaround that allows you to use the whole screen.  I suspect that if you set the resolution to 'Auto', you'll get the same problems even in OpenGL mode (ie, the main problem still isn't fixed).  And I will still look into it.

Quote
One thing you could clarify for me though.  You said to "turn on vsync updates".  What setting is this?   Is this just the setting that's labeled "GL VSync"?   You suggest I turn that setting on then, now that I am using OpenGL?
Yes, that's the option I meant.  It will synchronize the video updates to the refresh rate of your monitor, which is likely 60Hz (for either an LCD or a TV in a cabinet).  It will eliminate 'tearing' in the video updates.  Note that if your monitor refresh rate isn't 60Hz or so, then you should probably leave the option turned off.  Otherwise, games may run slower or faster than on a real system.  I suggest experimenting with it, to see what gives you the best results.

markronz

  • We traced the call, and it came from....INSIDE YOUR ARCADE MACHINE!
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 821
  • Last login:April 12, 2019, 12:03:08 am
  • Game on!
Re: Layout broken after changing resolution (Stella)
« Reply #11 on: January 17, 2011, 12:37:21 pm »
Thanks again.  I tried it with GL VSync on, and it worked very well.   So I will leave that setting on, on my machine.   So that's great.  Thanks again for the help.   I did post on the other thread I mentioned and asked anyone to chime in on this thread here, if they are still having the issue and have anything to add.

sa666666

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:May 08, 2012, 07:01:00 pm
Re: Layout broken after changing resolution (Stella)
« Reply #12 on: January 17, 2011, 12:49:49 pm »
Just to clarify and summarize my above posts:

 - Problems occur with 'shifting' if the resolution you select for fullscreen mode is smaller than the desktop resolution.  This can be worked around (for now) by setting the fullscreen resolution to match the desktop resolution (ie, don't use 'Auto').

 - Don't change the launcher resolution.  In fact, I suggest adding 'uselauncher=0' to the INI file, to disable the built-in ROM launcher completely.  That way, pressing Escape will exit Stella (Control-Q will still work, of course).

Using the same fullscreen resolution as your desktop can result in the image not taking advantage of the entire screen (ie, there may be huge black borders).  There are several ways around this:

 - Use OpenGL mode for the renderer, and turn on 'GL FS Stretch'.  OpenGL mode allows to stretch the video to the entire size of the screen (while keeping aspect ratio the same), eliminating black borders as much as possible.

 - If your computer doesn't support OpenGL, pick a fullscreen and desktop resolution that more closely matches multiples of 320x240 or so.  This is because software mode only supports integer scaling (ie, 2x, 3x, 4x), unlike OpenGL where the scaling will be whatever amount is required to fill the screen.  For example:
    - 640x480 allows 2x with small borders
    - 1024x768 is better than 800x600, since 3x mode in 1024x768 fills the screen more than 2x mode in 800x600

 - If you use OpenGL mode, also experiment with 'GL VSync'.  This allows tear-free video updates.

Overall, the problem still isn't fixed.  But if you can use OpenGL mode, you'll get faster video using less CPU time, and work around the problem.

OK, that's it for now.  The painkillers are kicking in and I have to go lie down ...

sa666666

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:May 08, 2012, 07:01:00 pm
Re: Layout broken after changing resolution (Stella)
« Reply #13 on: January 18, 2011, 04:03:13 pm »
I've confirmed this issue in Stella.  In fact, it can be seen by running Stella in standalone mode, apart from Mala.  When launching Stella in fullscreen mode from Windows, after exiting the program any windows on the desktop are moved around (pushed to the bottom-right of the screen).  I'm willing to bet this is what's happening with Mala, as it looks to be shifted down and right as well.

So it's great that I can reproduce the bug.  Next is to figure why it's happening and find a fix for it.

markronz

  • We traced the call, and it came from....INSIDE YOUR ARCADE MACHINE!
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 821
  • Last login:April 12, 2019, 12:03:08 am
  • Game on!
Re: Layout broken after changing resolution (Stella)
« Reply #14 on: January 19, 2011, 08:45:24 am »
That's great!  Let us know what you find out!

loadman

  • Moderator
  • Trade Count: (+3)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 4306
  • Last login:May 26, 2024, 05:14:32 am
  • Cocktail Cab owner and MaLa FE developer
    • MaLa
Re: Layout broken after changing resolution (Stella)
« Reply #15 on: January 20, 2011, 10:02:19 pm »
How dare you blame MaLa !!!    :laugh2:

markronz

  • We traced the call, and it came from....INSIDE YOUR ARCADE MACHINE!
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 821
  • Last login:April 12, 2019, 12:03:08 am
  • Game on!
Re: Layout broken after changing resolution (Stella)
« Reply #16 on: January 20, 2011, 10:26:51 pm »
Hey, I said maybe!  :)

sa666666

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:May 08, 2012, 07:01:00 pm
Re: Layout broken after changing resolution (Stella)
« Reply #17 on: January 30, 2011, 08:56:55 pm »
Just chiming in to let you know that I'm still investigating this.  No luck in fixing it so far, since it seems to not be a Stella problem after all.  It's actually being caused by SDL, the cross-platform graphics/sound library that Stella uses.  I'm seeing the same results when I create a small SDL-based test program that opens a blank window and doesn't draw anything at all.  And it only happens in Windows; Linux and OSX are fine.

So I need to go deeper, into the SDL library itself.  That will take more time ...

markronz

  • We traced the call, and it came from....INSIDE YOUR ARCADE MACHINE!
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 821
  • Last login:April 12, 2019, 12:03:08 am
  • Game on!
Re: Layout broken after changing resolution (Stella)
« Reply #18 on: January 30, 2011, 09:08:09 pm »
Appreciate the effort!   Thanks for the update.

sa666666

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:May 08, 2012, 07:01:00 pm
Re: Layout broken after changing resolution (Stella)
« Reply #19 on: February 09, 2011, 02:18:37 pm »
OK, I've had a chance to look into this in more detail.  After talking with the developers of the SDL library and looking at the source code, it seems to be a problem in how screens are toggled (known as mode-switching).  The current stable release of SDL (1.2.14) uses mode-switch code based Windows DirectX 5!  As you probably know, DirectX 5 is very old and is basically obsolete (I believe DirectX is up to version 10 or 11 now).  I also tested out some older DirectX games in Windows, both ones that use SDL and ones that don't, and noticed the same problem.  This confirms that it's DirectX causing the problem.

A new way of doing mode-switching was introduced around DirectX 7/8.  However, adding this code to SDL would be very difficult, since it was written with DirectX 5 in mind.  As well, SDL 1.2.14 is the last release that will be done in the 1.x line, so it will never be fixed in the official 1.x release.  Development has moved on to what will become SDL 2.0. with a release due sometime this year.  This problem has been fixed in the newer release, and Stella will move to it once it's available.

OK, so long story short: the problem can't be fixed right now.  There's still the workaround though, that will function perfectly if you have OpenGL installed.  In fact, using OpenGL will give you better performance and tear-free updates anyway, and will take advantage of hardware acceleration in the video card:
1)  Use OpenGL rendering
2)  Use the same fullscreen resolution in Stella as you have on the Windows desktop
3)  Use 'GL FS Stretch' to eliminate black borders, and stretch the image to the entire contents of fullscreen resolution

I've added this item to the Stella FAQ, located at http://stella.sourceforge.net/faq.php.

Thanks for the report, and hopefully with this workaround you can keep using Stella, and reporting any bugs you find.

Steve Anthony
Stella maintainer
« Last Edit: February 09, 2011, 02:21:35 pm by sa666666 »

markronz

  • We traced the call, and it came from....INSIDE YOUR ARCADE MACHINE!
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 821
  • Last login:April 12, 2019, 12:03:08 am
  • Game on!
Re: Layout broken after changing resolution (Stella)
« Reply #20 on: February 09, 2011, 04:11:58 pm »
Fantastic!  I wish all developers were as willing to get to the root causes as you.  I appreciate your thorough look into this.   I am very satisfied with the workaround for the time being, so I will continue to use Stella.   I will keep an eye out for the latest release in maybe a year or so!  Thanks again!!

 :cheers: