• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Development Discussion v
« Previous 1 ... 32 33 34 35 36 ... 116 Next »

Starting a game from external thread
View New Posts | View Today's Posts

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Starting a game from external thread
10-06-2015, 09:18 PM
#1
Felk
Unregistered
 
EDIT: Oops, I wanted to post this to Development Discussion and can't seem to find a way to delete or move it. Sorry.

Hello, I am currently trying to write some code for the functionality to start/stop/change games via the socket-api https://github.com/ProjectRevoTPP/dolphin (don't look at the code pls). What I want is to receive something like "BOOT path/to/game.iso" via a socket (so obviously different thread) and have dolphin boot up a new game.
I tried several things and I am out of ideas since I am not too familiar with the Dolphin code or wx.

My first attempt to change games was to quit the current game (if running) and just start a new one. Quitting is easy, using the Core interface I can just Stop() and the gui will notice and everything is fine. Starting however is indefinetely harder.

I can't just "boot" a new game, like with the BootManager interface's BootCore. new windows and more gui stuff need to be set up, and exactly that is done by the main frame's BootCore method. However, I am calling it from another thread and I highly believe this causes the following issue: When I call that method the game boots fine, but the gui becomes unresponsive. Windows (the os) marks my windows (the graphical user interface parts) as "unresponsive" (can't move, click, anything), although the game is actually running fine.

I then tried not to call these methods from another thread, but rather schedule wx events to start a game. For that I used main_frame->GetEventHandler()->AddPendingEvent(event). I tried several events, the event I wanted to work was wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_PLAY) but I don't quite know what I am doing at this point and all those events had no effect whatsoever.

My third attempt was to not bother with the gui at all. So for changing a game I used the DVDInterface to switch the iso and then pressed the reset button. This works for some games, but not for all. For example Mario party 4 will just freeze forever when trying to reset with another iso/disc inserted. Switching the iso from Mario Party 6 to 4 while 6 is running works, although not resetting fast enough can crash or freeze the game too. Why isn't the game noticing it when I switch the disc but continues to read from it? Isn't the DVDInterface supposed to fire interrupts for "the lid opening" and such? Anyway, this didn't work either.

So now I am out of ideas. Please give me a hint how I can accomplish this.
Reply
10-06-2015, 11:20 PM
#2
JosJuice Offline
Developer
**********
Developers (Some Administrators and Super Moderators)
Posts: 8,843
Threads: 7
Joined: Oct 2014
Do you need to launch a new game within the current Dolphin process, or is starting a completely new instance of Dolphin fine? You could use a non-Dolphin program to launch Dolphin with certain parameters each time it receives something via a socket.
Find
Reply
10-06-2015, 11:37 PM
#3
Felk
Unregistered
 
Completely restarting dolphin to launch it with /e to change the game is my last resort. I do not necessarily need to launch the game in the current instance of Dolphin, but it would make things my a magnitude of order harder. I really want this to work, and it seemed so simple at first...
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode