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: Attract Mode loses focus when GroovyMAME is using d3d9ex  (Read 4480 times)

0 Members and 1 Guest are viewing this topic.

chrisvg

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 28
  • Last login:August 03, 2019, 09:47:50 pm
  • Blast City fanboy!
Attract Mode loses focus when GroovyMAME is using d3d9ex
« on: December 08, 2015, 07:31:09 am »
Long time lurker, first time poster!

I've been using GroovyMAME and CRT_Emudriver for the last 6 months and absolutely love it! Thanks for the great work by Calamity and other contributors!

Recently, I've been playing around with the Attract Mode frontend and have found a bit of a problem when using GroovyMAME, in particular when it is configured to use d3d9ex.

When I exit a game in GroovyMAME, the Attract Mode window doesn't receive focus.  This only seems to occur when using d3d9ex, I have tested other video options like d3d and ddraw and have not had any trouble.

I have also tried setting up a separate hotkey in Attract Mode to force quit GroovyMAME which does resolve the issue, but I'd rather not do that and instead let GroovyMAME exit gracefully on it's own accord.

I have tested this on multiple machines (one is running Windows 7 and hooked up to my cab with CRT_Emudriver, the other is a regular desktop running Windows 10 and hooked up to an LCD monitor with GSYNC). Should be pretty easy for others to reproduce the problem I think.

@Cools, if you're out there, I know you're a big fan of Attract Mode and GroovyMAME - have you come across this problem?

It's no big trouble, just thought I'd point it out and see if others have experienced this.  In the meantime I'll go back to using d3d on my desktop machine and ddraw on my cab machine :)

cools

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 645
  • Last login:March 11, 2024, 02:59:06 pm
  • Arcade Otaku Sysadmin
    • Arcade Otaku
Re: Attract Mode loses focus when GroovyMAME is using d3d9ex
« Reply #1 on: December 09, 2015, 04:47:23 am »
I hadn't, so I plugged a keyboard in to check I was using d3d9ex and it happened immediately.

This machine normally runs off a PS3 USB joystick. The stick works perfectly at all times. The keyboard is lost every time I quit MAME.

I've not tried messing with the video switch at all.

intealls

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:Yesterday at 11:51:57 pm
  • I want to build my own arcade controls!
Re: Attract Mode loses focus when GroovyMAME is using d3d9ex
« Reply #2 on: December 09, 2015, 11:04:19 am »
I noticed this when testing, but didn't really think it would cause any problems. I'll try to find out what's happening.

Edit:

The issue appears to be related to D3D9Ex device reset.

This quick hack can be applied until it can be resolved cleanly.

(Line ~1114 src/osd/modules/render/drawd3d.cpp)
Code: [Select]
// free the device itself
if (m_device != NULL)
{
- (*d3dintf->device.reset)(d3dintf, m_device, &m_presentation);
+ if (!d3dintf->d3d9ex_available)
+ (*d3dintf->device.reset)(d3dintf, m_device, &m_presentation);
(*d3dintf->device.release)(m_device);
m_device = NULL;
}
« Last Edit: December 09, 2015, 12:45:23 pm by intealls »

chrisvg

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 28
  • Last login:August 03, 2019, 09:47:50 pm
  • Blast City fanboy!
Re: Attract Mode loses focus when GroovyMAME is using d3d9ex
« Reply #3 on: December 10, 2015, 07:39:30 am »
Thanks for the replies guys, glad to hear I'm not going crazy!

I just compiled a new build with the quick hack from intealls, and it works perfect now :)

Thanks again for the quick response and easy fix.

DudeRegular

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 279
  • Last login:January 23, 2024, 10:50:27 pm
  • I have no idea what I am doing
Re: Attract Mode loses focus when GroovyMAME is using d3d9ex
« Reply #4 on: December 13, 2015, 02:26:16 pm »
Cool to see such a quick fix. I am not familiar with the benefits of using an alternate d3d9ex vs the default. Mind a short explanation?

cools

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 645
  • Last login:March 11, 2024, 02:59:06 pm
  • Arcade Otaku Sysadmin
    • Arcade Otaku
Re: Attract Mode loses focus when GroovyMAME is using d3d9ex
« Reply #5 on: December 14, 2015, 06:45:37 am »

brywalker

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 13
  • Last login:August 13, 2018, 07:23:56 pm
  • I want to build my own arcade controls!
Re: Attract Mode loses focus when GroovyMAME is using d3d9ex
« Reply #6 on: January 10, 2016, 07:36:17 pm »
Not sure what I'm missing here, but compiling with this edited string keeps failing.

Compiling 3rdparty/zlib/crc32.c...
../../../../../src/osd/modules/render/drawd3d.cpp: In member function 'void d3d::renderer::device_delete()':
../../../../../src/osd/modules/render/drawd3d.cpp:1128:39: error: qualified-id in declaration before '(' token
 void renderer::device_delete_resources()
                                       ^
../../../../../src/osd/modules/render/drawd3d.cpp:3001:1: error: expected '}' at end of input
 }
 ^
../../../../../src/osd/modules/render/drawd3d.cpp: At global scope:
../../../../../src/osd/modules/render/drawd3d.cpp:3001:1: error: expected '}' at end of input
Compiling 3rdparty/zlib/deflate.c...
make[2]: *** [../../../../mingw-gcc/obj/x64/Release/osd_windows/src/osd/modules/render/drawd3d.o] Error 1
make[1]: *** [osd_windows] Error 2
make[1]: *** Waiting for unfinished jobs....

What am I missing here?

chrisvg

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 28
  • Last login:August 03, 2019, 09:47:50 pm
  • Blast City fanboy!
Re: Attract Mode loses focus when GroovyMAME is using d3d9ex
« Reply #7 on: January 15, 2016, 04:31:32 am »
Hmm, the patch still works for me (and is still needed in 0.169 for returning focus after quitting GM when using d3d9ex).

I apologize in advance for possibly stating the obvious, but you know that the code block that Intealls originally posted here is a "diff" right? If you're applying this manually by copying and pasting, you need to remove the "+" symbols at the start of the lines you're inserting.

I've attached a .diff file that you can apply after you have applied the main groovymame 0.169 patch.  The forums don't like the .diff extension, so I've renamed it .txt.  You can rename it back to .diff after you've downloaded the file.

You can use the following command line:
Code: [Select]
patch -p0 -E --binary <fix_d3d9ex.diff
I hope this helps!

brywalker

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 13
  • Last login:August 13, 2018, 07:23:56 pm
  • I want to build my own arcade controls!
Re: Attract Mode loses focus when GroovyMAME is using d3d9ex
« Reply #8 on: January 24, 2016, 10:10:13 am »
Was doing it manually, and properly. Didn't like it.

Patched. Works fine now.

Now just need to find a way to tweak the Killer Instinct driver so it doesn't load the CHD so quickly. Affects proper boot emulation.

Thanks!

intealls

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:Yesterday at 11:51:57 pm
  • I want to build my own arcade controls!
Re: Attract Mode loses focus when GroovyMAME is using d3d9ex
« Reply #9 on: January 24, 2016, 10:45:28 am »
Calamity added a similar fix in the official patch (0.169 final), so manual patching is not needed anymore.

albertodelsur

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:July 18, 2021, 09:45:35 pm
  • I want to build my own arcade controls!
Re: Attract Mode loses focus when GroovyMAME is using d3d9ex
« Reply #10 on: February 03, 2017, 07:42:50 pm »
Hmm, the patch still works for me (and is still needed in 0.169 for returning focus after quitting GM when using d3d9ex).

I apologize in advance for possibly stating the obvious, but you know that the code block that Intealls originally posted here is a "diff" right? If you're applying this manually by copying and pasting, you need to remove the "+" symbols at the start of the lines you're inserting.

I've attached a .diff file that you can apply after you have applied the main groovymame 0.169 patch.  The forums don't like the .diff extension, so I've renamed it .txt.  You can rename it back to .diff after you've downloaded the file.

You can use the following command line:
Code: [Select]
patch -p0 -E --binary <fix_d3d9ex.diff
Excuse me. Can I use that diff in windows XP?

Thank you!

I hope this helps!

Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7414
  • Last login:April 10, 2024, 02:02:31 pm
  • Quote me with care
Re: Attract Mode loses focus when GroovyMAME is using d3d9ex
« Reply #11 on: February 04, 2017, 10:40:36 am »
D3D9ex only works on Vista and up.
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi

albertodelsur

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:July 18, 2021, 09:45:35 pm
  • I want to build my own arcade controls!
Re: Attract Mode loses focus when GroovyMAME is using d3d9ex
« Reply #12 on: February 04, 2017, 02:30:05 pm »
Thank you very much for your answer, Calamity!!
I asked this because I have the same problem but yesterday night I saw in my mame.ini file that I am using d3d.