Author Topic: Windows 10 multiple monitor marquee  (Read 4698 times)

BrewMiester

  • Newbie
  • *
  • Posts: 1
    • View Profile
Windows 10 multiple monitor marquee
« on: June 26, 2016, 05:02:12 PM »
I am unable to display an image on marquee monitor.
AM is able to launch mameuifx properly and display multiple monitors.

running win 10 pro/64
Mamuifx64

any config options that might work?

the intent is to display static artwork on attract screen and then have it switch as normal within mameui.

palerider

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Windows 10 multiple monitor marquee
« Reply #1 on: November 06, 2016, 11:57:43 AM »
I am in the process of trying to switch from Hyperspin to Attractmode. So far, love how simple, fast, and straight forward it is.

However, I think there is a bug with the multiple monitor support on Windows 10, and I think you and I are both seeing it.

I am running Windows 10. I enabled Multiple Monitors within the General settings, and I also enabled the Multi-Mon plugin. I was disappointed to see that I cannot get artwork to display on the 2nd monitor. I have tried to access the Monitor Class instance held in fe.monitors[] in my own layouts, and it throws errors on everything but the num, width, height properties. Any of the Func or Overloads (add_text, add_image, add_artwork) throw errors.

If anyone wants to reproduce this bug:
1) Use Windows 10
2) Enable Multiple Monitors within Settings
3) Enable the Multi Mon plugin
4) Run AM from a commandline, so that you can see the errors

Multi-Mon throws an error when it tries to call the add_text function on the fe.monitors[] instance for the 2nd display:

*** Initializing display: 'MAME'
 - Loaded master romlist 'MAME' in 37 ms (2099 entries kept, 0 discarded)
 - Constructed 2 filters in 99 ms (4198 comparisons)
 + MultiMon Plug-in: Using Monitor #2 (1920x1080)

AN ERROR HAS OCCURED [this function isn't static]

CALLSTACK
*FUNCTION [constructor()] C:\attractmode\plugins/MultiMon.nut line [60]
*FUNCTION [main()] C:\attractmode\plugins/MultiMon.nut line [104]



mbalfour

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Windows 10 multiple monitor marquee
« Reply #2 on: March 04, 2017, 09:27:00 AM »
FWIW, I'm still seeing this on Windows 10 with Attract Mode 2.2.1.  In poking at it a bit more, I get a bit more information:

CALLSTACK
*FUNCTION [onTransition()] D:\msys64\home\Mike\attract\plugins/MultiMon.nut line [82]

LOCALS
[my_config] TABLE
[tag] "mon2"
[mon] INSTANCE
1
[transition_time] 0
[var] 2
[ttype] 0
[this] INSTANCE
Script Error in transition function: onTransition - wrong type (unknown expected, got N5Sqrat5ClassI9FeMonitorNS_13NoConstructorEEE)

The specific line it's failing on in Squirrel is this one:
        C* ptr = ClassType<C>::GetInstance(vm, 1);

I have no idea why this would be a Win10-specific error, can anyone confirm that Multimon.nut is working correctly on other OSs?

The only thing that looks uniquely different about the FEMonitor array is that I think it's the only one where instances are getting created solely from the C++ side.  The other arrays I've been looking at (FEShader, FEImage) has instances that have been added from .nut files.  If I had to guess, I would guess maybe something going wrong with name mangling and registration?  I haven't found a way to dump everything that Squirrel knows about yet.

mbalfour

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Windows 10 multiple monitor marquee
« Reply #3 on: March 05, 2017, 01:01:37 PM »
OK, tracked down the bug, I think.  I have no idea why this would be Win10-specific.  The problem is that FeMonitor derives from FePresentableParent, which is currently being defined in Squirrel.  This causes type lookups to go a bit, uh, squirrely.  (heh)

The fix appears to be changing fe_vm.cpp to look something like this:

   fe.Bind(_SC("PresentableParent"),
      Class<FePresentableParent, NoConstructor>()
      .Overload<FeImage * (FePresentableParent::*)(const char *, int, int, int, int)>(_SC("add_image"), &FePresentableParent::add_image)
      .Overload<FeImage * (FePresentableParent::*)(const char *, int, int)>(_SC("add_image"), &FePresentableParent::add_image)
      .Overload<FeImage * (FePresentableParent::*)(const char *)>(_SC("add_image"), &FePresentableParent::add_image)
      .Overload<FeImage * (FePresentableParent::*)(const char *, int, int, int, int)>(_SC("add_artwork"), &FePresentableParent::add_artwork)
      .Overload<FeImage * (FePresentableParent::*)(const char *, int, int)>(_SC("add_artwork"), &FePresentableParent::add_artwork)
      .Overload<FeImage * (FePresentableParent::*)(const char *)>(_SC("add_artwork"), &FePresentableParent::add_artwork)
      .Func(_SC("add_clone"), &FePresentableParent::add_clone)
      .Func(_SC("add_text"), &FePresentableParent::add_text)
      .Func(_SC("add_listbox"), &FePresentableParent::add_listbox)
      .Func(_SC("add_surface"), &FePresentableParent::add_surface)
   );

   fe.Bind( _SC("Monitor"),
      DerivedClass <FeMonitor, FePresentableParent, NoConstructor>()
      .Prop( _SC("num"), &FeMonitor::get_num )
      .Prop( _SC("width"), &FeMonitor::get_width )
      .Prop( _SC("height"), &FeMonitor::get_height )
   );

Max_FS

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Windows 10 multiple monitor marquee
« Reply #4 on: September 16, 2017, 12:53:46 PM »
I have the same problem as described below (though I use Win7 64bit) and I tried to use the fix mbalfour described but had no success so I hope it is ok to revive this topic.
I took the code provided below and copied it into fe_vm.cpp (Is there some certain place in the code where it should be placed?).
Then I got Visual Studio and tried to compile the main.cpp but it tells me that "SFML/Window/Event.hpp" is missing which is included in fe_input.hpp. Same applies to the next hpp-file fe_input.hpp tries to include.
I tried to find the files but I had no success, not on my harddrive and not somewhere else (e.g. github).

What am I doing wrong? Can anybody please help me?