Dolphin, the GameCube and Wii emulator - Forums
Wii Remote and Dolphinbar. How do you exit games? - Printable Version

+- Dolphin, the GameCube and Wii emulator - Forums (https://forums.dolphin-emu.org)
+-- Forum: Dolphin Emulator Discussion and Support (https://forums.dolphin-emu.org/Forum-dolphin-emulator-discussion-and-support)
+--- Forum: Controllers (https://forums.dolphin-emu.org/Forum-controllers)
+--- Thread: Wii Remote and Dolphinbar. How do you exit games? (/Thread-wii-remote-and-dolphinbar-how-do-you-exit-games)

Pages: 1 2


Wii Remote and Dolphinbar. How do you exit games? - Magic815 - 09-14-2015

When you are using an actual Wiimote connected through the Dolphinbar, how do you all exit your Wii games? My first instinct was to hit the 'Home' button, then select 'Wii Menu' then 'Return to Wii Menu: Yes' as a way to exit the game. However, this gives me an error because I haven't done a NAND dump, so I don't have my Wii Menu setup within Dolphin.

I don't really have a need for the Wii Menu. I have each Wii game available within my Kodi Media Center where I use 'Advanced Launcher' to load each individual ISO through Dolphin if I select that game in Kodi. Kodi then launches each ISO with the conditions '/b /e' so that it will send focus back to Kodi when Dolphin is exited. My problem is finding the best way to exit Dolphin when using a Wiimote.

For Gamecube games, I use a PS3 controller where I mapped the escape key on the keyboard to when I hold down the 'select' button for more than 3 seconds. This works perfect.

But for Wii games, where I'm using the Wiimote, I can't figure out how to do anything similar as a means to escape out of Dolphin when I'm done playing. Is there a way in Dolphin to map a Wiimote button to the escape key? My worry is that the Dolphinbar being in the middle of the controller and PC complicates things.

Any help is appreciated!


RE: Wii Remote and Dolphinbar. How do you exit games? - MayImilae - 09-14-2015

Um, hit escape on your keyboard? Tongue

But there's no way to map functions unto real wiimote. Every button is being used anyway...


RE: Wii Remote and Dolphinbar. How do you exit games? - Magic815 - 09-15-2015

(09-14-2015, 11:58 PM)MaJoR Wrote: Um, hit escape on your keyboard? Tongue

But there's no way to map functions unto real wiimote. Every button is being used anyway...

My computer is upstairs. I have it driving my media center which sends the signal down to my living room TV. So I'm trying to exit the game via controller on my living room couch (like you can do with an actual Wii).

I was hoping there would be a better way than to walk upstairs and hit escape on my keyboard, then walk back downstairs.

Are you saying they can't be mapped because all the buttons are already used? Or that it can't be mapped regardless? What about if a combination of buttons or a long press of a button was mapped? If dolphin can't do it, could a third party mapping program work? (like Xpadder with my PS3 controller?).


RE: Wii Remote and Dolphinbar. How do you exit games? - AnyOldName3 - 09-15-2015

While it won't solve the OP's problem immediately, is there any reason why we can't map the power button on a Wiimote to quit emulation at some point in the future? On a real console, holding it in would shut it down, so surely it's sensible for Dolphin to do its closest equivalent action.


RE: Wii Remote and Dolphinbar. How do you exit games? - MayImilae - 09-15-2015

The mapping for emulation functions to your PS3 controller would still work, even if you are using your real wiimote! So you could just bring the PS3 controller with you and use it to stop emulation Dolphin?


RE: Wii Remote and Dolphinbar. How do you exit games? - Magic815 - 09-15-2015

(09-15-2015, 02:10 AM)MaJoR Wrote: The mapping for emulation functions to your PS3 controller would still work, even if you are using your real wiimote! So you could just bring the PS3 controller with you and use it to stop emulation Dolphin?

Yes, I could do that as well. So it sounds like as programmed today, my two options are to either leverage a keyboard in another room, or use a controller that was not used in playing the game to send an escape command.

But I'll echo the idea AnyOldName3 brought up. Is there a reason the devs wouldn't want to just use the Wii power button? It shuts off the real life Wii - don't we want to be emulating that experience? Obviously it's time and energy spent by a dev to add that in, but I wasn't sure if there was another reason it wouldn't want to be coded that way.

Maybe I should make that a feature request?


RE: Wii Remote and Dolphinbar. How do you exit games? - jmorriz - 03-28-2016

I found a way to make Dolphin exit with the Wiimote.  It is a little complex, but I am very happy with it.

In Dolphin, Click View->Log Configuration, enable "OSReport" and "Write to File".

This causes Dolphin to write OS events to the log file in:
...\Documents\Dolphin Emulator\Logs\dolphin.log

I wrote a separate program to monitor the log file, and when it sees the exit sequence it sends an "Escape" keystroke to Dolphin.  The exit sequence is:

HW\\EXI_DeviceIPL.cpp:393 N[OSREPORT]: EXI IPL-DEV: write 0 at a1000800

So now, when a user selects "Home"->"Wii Menu" with the Wiimote, it exits Dolphin back into my frontend program.


RE: Wii Remote and Dolphinbar. How do you exit games? - jmorriz - 10-18-2016

(03-28-2016, 05:27 AM)jmorriz Wrote: I found a way to make Dolphin exit with the Wiimote.  It is a little complex, but I am very happy with it.

In Dolphin, Click View->Log Configuration, enable "OSReport" and "Write to File".

This causes Dolphin to write OS events to the log file in:
...\Documents\Dolphin Emulator\Logs\dolphin.log

I wrote a separate program to monitor the log file, and when it sees the exit sequence it sends an "Escape" keystroke to Dolphin.  The exit sequence is:

HW\\EXI_DeviceIPL.cpp:393 N[OSREPORT]: EXI IPL-DEV: write 0 at a1000800

So now, when a user selects "Home"->"Wii Menu" with the Wiimote, it exits Dolphin back into my frontend program.


Someone asked me to post the Java code I'm using.  You'll need some Java knowledge to put it into your own executable program.  Here it is:

Code:
               BufferedReader in = null;
               try {
                   File file = new File(Config.DOLPHIN_LOG);
                   String line;
                   boolean sentEscape = false;
                   while (process.isAlive()) {
                       if (in == null && !file.exists()) {
                           Thread.sleep(5000);
                       } else {
                           if (in == null) {
                               in = new BufferedReader(new FileReader(file));
                           }
                           while ((line = in.readLine()) != null) {
                               if (line.endsWith("N[OSREPORT]: EXI IPL-DEV: write 0 at a1000800")) {
                                   // wii menu was selected.  tell dolphin to exit
                                   Robot robot = new Robot();
                                   robot.keyPress(KeyEvent.VK_ESCAPE);
                                   sentEscape = true;
                               }
                           }
                           if (sentEscape) {
                               for (int i = 0; i < 5; i++) {
                                   if (process.isAlive()) {
                                       Thread.sleep(1000);
                                   }
                               }
                               if (process.isAlive()) {
                                   Runtime.getRuntime().exec("taskkill.exe /F /IM Dolphin.exe");
                               }
                           }
                       }
                   }
               } catch (Exception e) {
                   e.printStackTrace();
               }
               try { if (in != null) in.close(); } catch (Exception e) {}



RE: Wii Remote and Dolphinbar. How do you exit games? - leolam - 10-18-2016

That's pretty hacky, since you're relying on the fact that launching the system menu produces a log message, which may not always be the case (and there may be false positives). Though that's probably the only way right now…

The proper way would be using the Wiimote's power button, just like it's done on a real Wii, but that isn't working for some reason currently.

Quote:Is there a reason the devs wouldn't want to just use the Wii power button?
Unfortunately a very, very common misconception. It's not that devs don't want to support it. It's that no one has done it yet. Dolphin is an open-source project; if someone wants that to happen, they have to look into it. It is as simple as that.


RE: Wii Remote and Dolphinbar. How do you exit games? - jmorriz - 10-18-2016

(10-18-2016, 04:18 AM)leolam Wrote: That's pretty hacky, since you're relying on the fact that launching the system menu produces a log message, which may not always be the case (and there may be false positives). Though that's probably the only way right now…

The proper way would be using the Wiimote's power button, just like it's done on a real Wii, but that isn't working for some reason currently.

Unfortunately a very, very common misconception. It's not that devs don't want to support it. It's that no one has done it yet. Dolphin is an open-source project; if someone wants that to happen, they have to look into it. It is as simple as that.

Yeah, I agree it's very hacky.  I wish I was good enough at C++ to help with the real codebase.  In the meantime, this is just a temporary solution.  I will say, it has worked very reliably for me though.  I've never seen it fire incorrectly or fail to fire, so it seems like a good workaround since I really wanted that functionality in my system.