Author Topic: Launching game from outside Reicast  (Read 6645 times)

vektor

  • Newbie
  • *
  • Posts: 2
    • View Profile
Launching game from outside Reicast
« on: March 09, 2014, 02:25:18 PM »
Hello Reicast Team,

I developed an app that is basically able to identify games and download metadata (covers, description, title, etc.) for them, so that games are nicely shown, and to execute them with your favorite emulator.

Your emulator used to be compatible until the latest update that updates the UI.

Now if I try to launch Reicast from my app, Reicast starts and then returns to my app without starting the game, in LogCat I can see that it complains about missing config file:
http://pastebin.com/EYUBJg8K
Looks like it cannot read SharedPreferences and get config and bios path.

My code to start Reicast is as simple as this:
http://pastebin.com/KsriXDNz
Could you please check what’s wrong? Would be a such a pity to remove the only Dreamcast Emulator available :(

Thanks in Advance.

twistedumbrella

  • Developer
  • Newbie
  • *****
  • Posts: 27
    • View Profile
Re: Launching game from outside Reicast
« Reply #1 on: March 09, 2014, 10:27:06 PM »
The new layout has two activities that take intents and the configuration file is no longer used.

It should be fairly easy to follow in the source.

vektor

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Launching game from outside Reicast
« Reply #2 on: March 11, 2014, 11:45:12 AM »
The new layout has two activities that take intents and the configuration file is no longer used.

It should be fairly easy to follow in the source.

Hello twistedumbrella,

Even if you updated the source and make games start with GL2JNINative for versions above GingerBread, the activity is not declared in manifest and cannot be launched from outside your app.
If from a file browser I try opening a game with your emulator (intent with VIEW action with GL2JNIActivity) it behaves as if I'm launching the game from my app, it just starts and returns back to the browser. So I assume there's something working differently in Reicast.
« Last Edit: March 11, 2014, 09:40:57 PM by vektor »

zamastyle

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Launching game from outside Reicast
« Reply #3 on: March 30, 2014, 07:57:09 PM »
With the change to the application, is there supposed to be another declared view action in the manifest to allow calling the new activity? As it stands, I can only find the old view action used in r5.

twistedumbrella

  • Developer
  • Newbie
  • *****
  • Posts: 27
    • View Profile
Re: Launching game from outside Reicast
« Reply #4 on: April 03, 2014, 11:55:44 PM »
Intent i = new Intent("com.reicast.emulator.MainActivity");
i.setAction("android.intent.action.VIEW");
i.setData(romFile.getAbsolutePath());

zamastyle

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Launching game from outside Reicast
« Reply #5 on: April 04, 2014, 12:36:20 AM »
I looked over the manifest.xml commit from today and it looked perfect. And just tested with a test build including that change and this is working great now. Thanks for the update!

By the way, what is it that got edited out of your message over on ouya forum?
« Last Edit: April 04, 2014, 12:39:20 AM by zamastyle »

twistedumbrella

  • Developer
  • Newbie
  • *****
  • Posts: 27
    • View Profile
Re: Launching game from outside Reicast
« Reply #6 on: April 04, 2014, 08:05:50 AM »
I had said you needed to update the intent for the specific activity and it would be your own fault if you chose to wait for things to go back how they were because that way wouldn't work anymore. I was half awake so it came off harsh but it was just being direct. I tried to clarify but at that point the mods had already grabbed their riot gear.

Glad to hear it works. There is a minor issue returning to the list on our end because I didn't add a null check for the incoming intent but the fix won't disrupt anything.

You should consider a standard Android version if you haven't yet, I don't think it would take much to port. I have heard nothing but good reviews and something like the Xperia Play Sony app for emulators would be great.
« Last Edit: April 04, 2014, 08:09:33 AM by twistedumbrella »

zamastyle

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Launching game from outside Reicast
« Reply #7 on: April 06, 2014, 01:08:05 AM »
They are a little quick on the trigger over there, but they always have been and I don't foresee them chilling anytime soon. Thanks for updating the manifest for us. Reicast is awesome

twistedumbrella

  • Developer
  • Newbie
  • *****
  • Posts: 27
    • View Profile
Re: Launching game from outside Reicast
« Reply #8 on: April 06, 2014, 09:20:05 AM »
No problem. I tried Nostalgia on the Shield and it worked up until I had to pick a folder with mine being on the external sdcard. I guess that will have to wait until this fabled Android version ;)

As far as using the issue reports, most of us are pretty prompt with responding to issues so valid issues like yours don't get overlooked. hooby3dfx is pretty involved with OUYA and he is quick to resolve new reports, too. You can always @hooby3dfx or @loungekatt to get our attention.

zamastyle

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Launching game from outside Reicast
« Reply #9 on: April 09, 2014, 07:34:51 AM »
I don't remember this problem in my initial testing after the updates to the manifest.xml but the app hangs on a black screen after exiting all games now. Most of the time it will fail back to Nostalgia after a few seconds but the last one I tested is still hung. When opening the reicast application to look at settings, it reports that a previous crash was detected. Looks like the app is crashing for some reason on exit while using these intents. Is this a known issue or should I start reporting logs?

twistedumbrella

  • Developer
  • Newbie
  • *****
  • Posts: 27
    • View Profile
Re: Launching game from outside Reicast
« Reply #10 on: April 09, 2014, 09:55:15 AM »
There was an issue like that I had noticed with it not clearing out the intent when returning, but it should be resolved. I'll test a couple different games to make sure. It may be a matter of having to exit the activity differently to support external apps. I think the current way only focuses on returning to the menus.

zamastyle

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Launching game from outside Reicast
« Reply #11 on: April 09, 2014, 03:03:44 PM »
Hmmmm ... interesting issue. usually if the game play and menu are seperate activities then the activity.finish that would normally return you to the menu activity would do just as well with returning you to Nostalgia. Although I have never tried that with exiting out of native code.

By the way, I am actually using a shield to do the testing of the port over to google play. Let me know if you are interested in testing it out when I am up to that point.

twistedumbrella

  • Developer
  • Newbie
  • *****
  • Posts: 27
    • View Profile
Re: Launching game from outside Reicast
« Reply #12 on: April 22, 2014, 12:01:40 PM »
If I remember right, there was an issue with it double launching the file browser and that is why it exits a little oddly. School got a little crazy, so I haven't gotten to do much of anything else. I will be running some tests over the next couple days, though.

I would be more than happy to test it out when you are ready.

zamastyle

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Launching game from outside Reicast
« Reply #13 on: April 26, 2014, 09:14:00 AM »
Sorry I had a busy work week and just noticed your post.

I just grabbed the latest build. When I hit exit now, it exits quickly to the reicast menu and then immediately launches back into the game that was just exited. If I hit exit and then hit the back button very quickly, it will exit completely bnut otherwise its just the game launch loop.

zamastyle

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Launching game from outside Reicast
« Reply #14 on: July 26, 2014, 06:47:25 PM »
I'm back. I have been out for a while with work overload so Nostalgia has been out in the cold.

Anyway, I grabbed the latest loungekat build and tested again and the actual launch of the games works perfectly. The only problem remaining is that when exiting the game through the onscreen menu, it exits to the Reicast menu and then immediately restarts the same game. If timed perfectly you can exit and then press the back button on the controller and escape the loop but its difficult. If this can be fixed, compatibility with an external launcher will be working perfectly.