Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-monitor support #9

Closed
andyvans opened this issue Aug 13, 2018 · 13 comments
Closed

Multi-monitor support #9

andyvans opened this issue Aug 13, 2018 · 13 comments
Projects
Milestone

Comments

@andyvans
Copy link
Contributor

andyvans commented Aug 13, 2018

Hey there. I work with Matt and have also been playing around with your code. A nice distraction.

I have been toying with multi-support. At present only the primary monitor shows anything. I have tried a few options:

  1. Show a black screen on all but the primary monitor. A bit boring, but ok.
  2. Run multiple instances of mame e.g. one per monitor. The downside is that this needs more ram and opengl in mame. DirectX in mame fails to start due to a directx handle conflict.
  3. Run a single mame on the primary monitor and clone this screen to all other monitors.

Option 3 seem best, but still need to test it a bit more. I have made either option 1 or 3 available via a checkbox setting. You can check it out here if you are interested.

https://github.com/andyvans/mamesaver/commits/master

@mika76
Copy link
Owner

mika76 commented Aug 13, 2018

Hey @andyvans, that's awesome. I don't think I've ever tried it with multiple monitors before. I see mame itself has a -numscreens x command line option, have you tried that to see what it does?

I think I have an extra screen available so I'll give your branch a try as soon as I can...

@andyvans
Copy link
Contributor Author

It's pretty alpha at the moment. The screen cloning works but needs optimisation.

The -numscreens x option works in two ways:

  • When using opengl it fills other screens with a clone of the image
  • When using directx it fills other screens with a black screen

The problem with the opengl version of mame is that it just doesn't look as good. The directx 9 shaders make the games (particularly vector games) look much better on large screens.

I will keep tweaking the code. It may work out, it may not.

@nullpainter
Copy link
Contributor

The problem with the opengl version of mame is that it just doesn't look as good

A note on the OpenGL version - this can look okay, but you need to be using the GLSL shaders instead of the HLSL shaders which are Direct3D only. The GLSL shaders don't appear to come out of the box with the official Windows versions of MAME, and the only ones I could find at a quick Google no longer work.

That being said, I've tried raster GLSL shaders but not any vector ones. Your point may still stand.

@mika76
Copy link
Owner

mika76 commented Aug 14, 2018

Couple of thoughts I had:

  • what if you show a blank screen and only one mame, and then switch the screen it shows on every little bit? Ideally during a game session, but if that's not possible then at least when it re-loads a new game...
  • You could also just show screenshots of games or game titles (maybe dynamically download from somewhere like http://mamedb.org (seem you can easily just use the url http://mamedb.org/snaps/gunfight_K.png by replacing the game name)

After reading about the -numscreens argument it seems it's more meant for multi-monitor games anyway - so it would probably work much better for those (racing type games I guess) then for ones only developed for one screen.

@mika76
Copy link
Owner

mika76 commented Aug 15, 2018

Looking at http://wiki.mamedev.org/index.php/LAY_File_Basics_-_Part_I for #12 I notice that in the lay file you can control multi screens too - might be an option you could look into...

@mika76
Copy link
Owner

mika76 commented Aug 15, 2018

Hey @andyvans I just had a chance to try out the multi screen cloning - very very cool! 👍

@andyvans
Copy link
Contributor Author

The latest changes seem much faster as the graphics work is now all native win32 - hardware context to hardware context. It is no longer going via managed objects. It also supports monitors with different resolutions e.g. it will scale to the destination screen size. I will need to test a high DPI monitor.

Next, to improve speed of when exiting (mouse move/keystoke), I might force minimise the mame window to give the illusion of an instance shutdown.

@andyvans
Copy link
Contributor Author

The minimise of the mame window is really good. The screen saver exits instantly. No lag at all.

@andyvans
Copy link
Contributor Author

The layouts are interesting. Not quite for cloning, but for enhancing B&W games or adding a frame around the game. I guess game metadata could go into the layout if it was dynamically rendered per game.

@mika76
Copy link
Owner

mika76 commented Aug 16, 2018

The minimise of the mame window is really good.

Would you mind creating a pull request? Purely because I have an appveyor build server and then I don't have to recompile each branch myself - my multi monitors are on a separate laptop I don't use often :) I will only accept it once you are finished...

The layouts are interesting

Yeah they're not hugely useful in this scenario - although I notice that if you just add -numscreens 4 (it seems mame only supports up to 4 monitors) then the other screens go blank at least when a game is running and I thought layout could be used to at least show a game name by making a dynamic bezel image. Not useful here at all...

@andyvans
Copy link
Contributor Author

@mika76 The multi-monitor cloning works well. I have tried it with 2 & 3 monitors. It's hard to tell which is the original Mame screen. I will create a PR for you to look at.

@mika76
Copy link
Owner

mika76 commented Aug 21, 2018

The one I tried previous was already brilliant so I can just imagine - such a great PR thanks!

@andyvans
Copy link
Contributor Author

Cheers @mika76. I think I need to tweak the logic where the source and destination monitors don't have the same aspect ratio e.g. 16x9 vs 4x3.

@mika76 mika76 added this to the v2.0 milestone Sep 3, 2018
@mika76 mika76 added this to Done in v2.0 Sep 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
v2.0
  
Done
Development

No branches or pull requests

3 participants