Kodi Community Forum
Over-complication of emulators turning me off to XBMC - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: Over-complication of emulators turning me off to XBMC (/showthread.php?tid=137159)

Pages: 1 2


Over-complication of emulators turning me off to XBMC - JTG2003 - 2012-07-29

Let me start by saying that I love XBMC's ease of use and intuitive interface. It has become a great media hub for playing movies and TV shows. However, the other main reason I put my HTPC together was as an emulation box. I built a powerful system that should be able to support some more-recent emulators.

I have has nothing but the worst trouble dealing with Launcher and Advanced Launcher. From starting the game, getting it to show up in fullscreen, to exiting the game.. there always seems to be something going wrong. I downloaded the latest XBMC yesterday to replace my v10 install, and now my emulators don't work at ALL. At least before I could get them to start.

My biggest problems:
1) Starting an emulator in fullscreen then getting XBMC to resume fullscreen after (This is my #1 issue)
.. actually I think if that first problem was solved, it would fix most of the rest.

It seems like whenever I run ANY external application, XBMC either wont resume fullscreen or for some reason it changes the resolution. I have had problems with this for over a year. And since I don't have a mouse+keyboaard handy in the living room for the hours of configuration it takes to get just one application to work right, I need to constantly remote to the HTPC over the network.

In short, as much as I love XBMC for video playback, the external application launchers are so frustrating, it's making me want to switch to another front end. Can anyone relate or does anyone have any suggestions?

I appreciate you taking the time to read this.
Thanks,
Jeremy


RE: Over-complication turning me off to XBMC - artrafael - 2012-07-30

You could write a script that terminates XBMC, runs your external application and, upon exiting the applicatiaon, restarts XBMC. This way, XBMC doesn't step on the external app and/or vice versa. See here for a rudimentary example. The script can be added to a favourite and, if your skin supports it, you can even create a homepage shortcut to the favourite.

To ensure XBMC always starts in fullscreen, you can add the following to advancedsettings.xml:
Code:
<advancedsettings>
  <fullscreen>true</fullscreen>
</advancedsettings>



RE: Over-complication turning me off to XBMC - JTG2003 - 2012-07-30

Sounds good.. that would fix a lot of issues. This scripting is a bit over my head though .. what executes the script?


Edit: I'm running XBMC over Windows .. could I use EventGhost to handle this? I still don't really know how that works so if I someone could walk me through that, I would appreciate it....


RE: Over-complication turning me off to XBMC - artrafael - 2012-07-30

(2012-07-30, 01:39)JTG2003 Wrote: Edit: I'm running XBMC over Windows .. could I use EventGhost to handle this? I still don't really know how that works so if I someone could walk me through that, I would appreciate it....
Sorry, since you hadn't mentioned any OS in your initial post, I mistakenly assumed you were running XBMCbuntu. I'll have to defer to Windows users regarding EventGhost or for an equivalent script that can terminate XBMC, run an external application and then restart XBMC.



RE: Over-complication turning me off to XBMC - Carb0 - 2012-07-30

I use AutoIt on Windows 7. Here is an example:

Code:
Run ( '"C:\HTPC\Emulatoren\PCSX2\pcsx2.exe" --fullboot --nogui --fullscreen "' & $CmdLine[1] & '"', "C:\HTPC\Emulatoren\PCSX2\" )
ProcessWaitClose ( "pcsx2.exe" )
Run ( "C:\Program Files (x86)\XBMC\XBMC.exe" )

The first line starts PCSX2 (a PS2 emulator) with the arguments "--fullboot --nogui --fullscreen" and the path to the ISO file "$CmdLine[1]" passed to the script by XBMC/Advanced Launcher. The second line pauses the script until PCSX2 is closed. And the third line maximizes XBMC.

You can create an executable of this script with AutoIt and then choose the created executable as a file launcher in Advanced Launcher. In Advanced Launcher you have to go to "Edit Launcher -> Advanced Modifications" and set "Toggle XBMC Fullscreen" to "Off". In this example you also have to set "Modify Arguments" to "%rom%".

There is a wiki page for Advanced Launcher where the possible command line options for some emulators are explained. http://www.gwenael.org/xbmc/index.php





RE: Over-complication turning me off to XBMC - JTG2003 - 2012-07-30

Thanks, Carb0. I will give this a shot tonight. One other problem is the lack of a universal button to close emulators. Project 64 for example.. the button on my remote emulates an "esc" keypress and in Project 64, that simply toggles fullscreen.

Is there any way to use this AutoIt to assist with closing an emulator based on a keypress?


RE: Over-complication turning me off to XBMC - reksveks - 2012-07-30

This is an example of my launcher; might help.

Code:
HotKeySet("{ESC}", "Terminate")

If $CmdLine[0] == 1 Then
    Run ( 'pssuspend XBMC.exe' )
    Run ('"C:\Users\Anon\Downloads\XBMC tools\Xpadder.exe" "C:\Users\Anon\Downloads\XBMC tools\PStwo.xpadderprofile"')
    Run ( '"Z:\Games\Playstation 2\Emulator\pcsx2.exe" --nogui --fullscreen "' & $CmdLine[1] & '"', "Z:\Games\Playstation 2\Emulator\" )
    While 1
       Sleep(100)
    WEnd
    EndIf

Func Terminate()
    ProcessClose ( "pcsx2.exe" )
    Run ('"C:\Users\Anon\Downloads\XBMC tools\Xpadder.exe" "C:\Users\Anon\Downloads\XBMC tools\xbmc.xpadderprofile"')
    Run ( 'pssuspend -r "XBMC.exe"' )
    Exit 0

Basically it allows me to just use my xbox controller, my xpadder profile is setup so that if I press L1, R1, LT and RT in order; xpadder emulates a key press of ESC which then close the emulator and xbmc is resumed. I would like it to be setup so the order isn't relevant. PS if anyone has an autoit script example that does the same by using the controllers output, I would be very grateful.


RE: Over-complication turning me off to XBMC - JTG2003 - 2012-07-30

Code:
HotKeySet("{ESC}", "Terminate")
Run ( '"C:\HTPC\Emulatoren\PCSX2\pcsx2.exe" --fullboot --nogui --fullscreen "' & $CmdLine[1] & '"', "C:\HTPC\Emulatoren\PCSX2\" )
ProcessWaitClose ( "pcsx2.exe" )
Run ( "C:\Program Files (x86)\XBMC\XBMC.exe" )

Func Terminate()
    ProcessClose ( "pcsx2.exe" )
    Exit 0

Mmkay, I'm at work so I can't test this. Would this work? I mashed the two examples together. I would think this would start the emulator then resume XBMC when the emulator closes. The emulator can be forced to closed by pressing "ESC".

Thoughts?

Edit: I'm perfectly fine just using ESC to close it. My remote has a big 'back' button which sends "ESC" - I'd rather use the remote to close rather than buttons on the controller.


RE: Over-complication turning me off to XBMC - Eldorado - 2012-07-30

(2012-07-30, 17:10)JTG2003 Wrote: Thanks, Carb0. I will give this a shot tonight. One other problem is the lack of a universal button to close emulators. Project 64 for example.. the button on my remote emulates an "esc" keypress and in Project 64, that simply toggles fullscreen.

Is there any way to use this AutoIt to assist with closing an emulator based on a keypress?

Isn't this more a configuration issue with the emulator?

PJ64 should have a keymap that you can edit, change what the ESC key is doing to make it exit the emulator

I've had to do this for pretty much every emulator I'm using


RE: Over-complication turning me off to XBMC - JTG2003 - 2012-07-30

(2012-07-30, 19:33)Eldorado Wrote: Isn't this more a configuration issue with the emulator?

PJ64 should have a keymap that you can edit, change what the ESC key is doing to make it exit the emulator

I've had to do this for pretty much every emulator I'm using

I'm about 90% sure Project 64 doesn't have an option to change what the keys do (at least, it doesn't let you map a button to exit). Nestopia and ZSNES can both exit with "ESC" so no problems there. I don't know if the others can change the keys, haven't gotten that far yet.




RE: Over-complication turning me off to XBMC - reksveks - 2012-07-30

(2012-07-30, 19:17)JTG2003 Wrote: Mmkay, I'm at work so I can't test this. Would this work? I mashed the two examples together. I would think this would start the emulator then resume XBMC when the emulator closes. The emulator can be forced to closed by pressing "ESC".

Thoughts?

Edit: I'm perfectly fine just using ESC to close it. My remote has a big 'back' button which sends "ESC" - I'd rather use the remote to close rather than buttons on the controller.

Yeah, that looks okay but not an expert in autoit so i don't know if you need the while loop probably not[/code]


RE: Over-complication of emulators turning me off to XBMC - JTG2003 - 2012-07-30

I guess it depends on how the

ProcessWaitClose ( "pcsx2.exe" )

works. If it hangs the script there waiting for that process to close, then I think I will need to re-format it with a while loop.

Something like: (pseudocode)

Close XBMC
Start emulator (args)
While (emulator running)
{
If (ESC PRESSED)
{
Close emulator
}
}
Start XBMC

I don't know how autoit script works, I will look up the documentation when I get home to see if I can make this work, but if someone were to post the solution before I got home, I wouldn't be upset.


Edit: Been trying this for an hour, failing miserably..

Edit 2: Think I got it.

Code:
HotKeySet("{ESC}", "Terminate")
ProcessClose ( "PROGRAM1" )
Run ( "PROGRAM2" )
ProcessWaitClose ( "PROGRAM2" )
Run ( "PROGRAM1" )

Func Terminate()
    ProcessClose ( "PROGRAM2" )
    EndFunc



RE: Over-complication of emulators turning me off to XBMC - JTG2003 - 2012-08-01

Ok, I feel like I'm SO close.. but it's not quite working yet.

Right now I have
Code:
HotKeySet("{ESC}", "Terminate")
ProcessClose ( "XBMC.exe" )
Run ( '"C:\xbmc media\Emulation\Nintendo 64\Project64.exe ""' & $CmdLine[1] & '"', "C:\xbmc media\Emulation\Nintendo 64\" )
ProcessWaitClose ( "Project64.exe" )
Run ( "C:\Program Files (x86)\XBMC\XBMC.exe" )
Exit 0

Func Terminate()
    ProcessClose ( "Project64.exe" )
    EndFunc

So far what happens is I run it, XBMC doesn't close, firstly.. then Project64 loads up but I get a"Unable to load" error. Obviously I have some syntax off somewhere.. could someone possibly clean this up?

Thanks,
Jeremy


RE: Over-complication of emulators turning me off to XBMC - Angelscry - 2012-08-01

(2012-08-01, 02:42)JTG2003 Wrote: Ok, I feel like I'm SO close.. but it's not quite working yet.

Right now I have
Code:
HotKeySet("{ESC}", "Terminate")
ProcessClose ( "XBMC.exe" )
Run ( '"C:\xbmc media\Emulation\Nintendo 64\Project64.exe ""' & $CmdLine[1] & '"', "C:\xbmc media\Emulation\Nintendo 64\" )
ProcessWaitClose ( "Project64.exe" )
Run ( "C:\Program Files (x86)\XBMC\XBMC.exe" )
Exit 0

Func Terminate()
    ProcessClose ( "Project64.exe" )
    EndFunc

So far what happens is I run it, XBMC doesn't close, firstly.. then Project64 loads up but I get a"Unable to load" error. Obviously I have some syntax off somewhere.. could someone possibly clean this up?

Thanks,
Jeremy
Try to change launcher argument from "%rom%" to symply %rom%. Double quotes are already indicated into your script.




RE: Over-complication of emulators turning me off to XBMC - JTG2003 - 2012-08-01

(2012-08-01, 03:53)Angelscry Wrote: Try to change launcher argument from "%rom%" to symply %rom%. Double quotes are already indicated into your script.

It's already %rom% ... but maybe it shouldn't be in quotes at all? I'm not really sure how the double and single quotes are interpreted by AutoIt

Edit: I should also mention "ESC" no longer closes the window either.. although I think this may all be stemming from one error because when I tested this on my own desktop using firefox and notepad as my programs, it worked fine. (but there was also no arguments involved)