Commit Graph

77 Commits

Author SHA1 Message Date
EmptyChaos c1922783f8 Core: Threadsafety Synchronization Fixes (Frame Advance / FifoPlayer)
Fix Frame Advance and FifoPlayer pause/unpause/stop.

CPU::EnableStepping is not atomic but is called from multiple threads
which races and leaves the system in a random state; also instruction
stepping was unstable, m_StepEvent had an almost random value because
of the dual purpose it served which could cause races where CPU::Run
would SingleStep when it was supposed to be sleeping.

FifoPlayer never FinishStateMove()d which was causing it to deadlock.
Rather than partially reimplementing CPU::Run, just use CPUCoreBase
and then call CPU::Run(). More DRY and less likely to have weird bugs
specific to the player (i.e the previous freezing on pause/stop).

Refactor PowerPC::state into CPU since it manages the state of the
CPU Thread which is controlled by CPU, not PowerPC. This simplifies
the architecture somewhat and eliminates races that can be caused by
calling PowerPC state functions directly instead of using CPU's
(because they bypassed the EnableStepping lock).
2016-05-13 09:23:44 +10:00
degasus 2030ad4577 SCM: Use std::string.
Those macros may be defined, or not. We should support both cases, so use std::string as it also defines the length of the string.
2016-05-05 00:22:49 +02:00
Ryan Houdek 628e9bad92 Support a headless EGL option.
This is a new option to support completely headless running of Dolphin without X11 on systems that can properly support it.
2016-01-27 15:04:14 -06:00
Lioncash cc036ca86c Common: Remove other Common prefixed headers from Common.h 2015-09-26 18:51:58 -04:00
Lioncash a11ae2cf30 CommonFuncs: Remove SLEEP macro
There's already a function in Thread for this.
2015-09-04 02:43:38 -04:00
Jules Blok b6c4d5792b Revert "Join the emu thread in Core::Stop. Get rid of Core::Shutdown which did that before."
This reverts commit ba664b3293.

Added documentation to Core::Shutdown() to prevent breaking changes.
2015-07-22 09:15:19 +02:00
degasus c375111076 Options: merge SCoreStartupParameter into SConfig 2015-06-12 19:07:45 +02:00
Matthew Parlane 9e1aab663f Revert "SDL: handle SDL_QUIT event" 2015-06-08 13:43:39 +12:00
Tillmann Karras 9ec5a4544f SDL: handle SDL_QUIT event
Using SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS which installs a signal
handler for SIGINT and SIGTERM. There will be a way to prevent this in
2.0.4 but for now we'll need to handle SDL_QUIT.
2015-06-05 19:34:06 +02:00
aerisarn f403bb09b0 MainNoGUI: support real Wiimotes
This should be restructured to move the connection logic into Core
instead of duplicating it in every Host, but alas, I'm too lazy for
that right now. ~flacs
2015-06-01 14:59:22 +02:00
Tillmann Karras 30ebb2459e Set copyright year to when a file was created 2015-05-25 13:22:31 +02:00
Tillmann Karras cefcb0ace9 Update license headers to GPLv2+ 2015-05-25 13:22:31 +02:00
degasus 8c209b3bc9 no-gui: fix help string 2015-04-18 15:03:42 +02:00
skidau f0593095b4 Merge pull request #2295 from comex/fix-usb-threading
Fix threading issues
2015-04-16 12:33:20 +10:00
Emmanuel Gil Peyrot 1e7ca7f579 NoGUI: Don’t segfault when the DISPLAY environment variable isn’t set 2015-04-16 01:10:57 +02:00
comex ba664b3293 Join the emu thread in Core::Stop. Get rid of Core::Shutdown which did that before.
Core::Shutdown was only called on app exit, yet the emu thread exits
whenever emulation stops; if you launched a new game it would just join
via the destructor when s_emu_thread was set to a new thread.
(Incidentally, the destructor also makes explicitly joining on app exit
rather pointless.)

Because the GUI thread wasn't waiting for the CPU thread to fully shut
down, Core::IsRunning would remain true briefly after CFrame::DoStop
which, given Dolphin's penchant for accessing variables belonging to
other threads, can only mean trouble... In my case, because the previous
commit caused UpdateGUI, which is called at the end of DoStop, to call
PauseAndLock, which checks IsRunning, pressing stop at the right time
would cause strange behavior.
2015-04-13 02:17:38 -04:00
skidau 1dcd0ad879 Merge pull request #2129 from Sonicadvance1/shuffle_user_dir
Move user directory detection location to UICommon.
2015-02-27 14:07:06 +11:00
Stevoisiak 93b16a4a2d Formatting/Whitespace Cleanup
Various fixes to formatting and whitespace
2015-02-25 10:48:21 -05:00
Ryan Houdek db06f058e4 Move user directory detection location to UICommon.
The UI should decide on where it wants the user directory, not our core system.
This is in anticipation of some upcoming work on Android which will need proper user directory setting.
2015-02-25 03:31:59 -06:00
Jules Blok b7e056c74d Host: Add Host_RendererIsFullscreen(). 2015-01-04 17:09:56 +01:00
Rohit Nirmal b030d29067 Silence some -Wswitch-default warnings. 2014-12-11 22:23:05 -06:00
Lioncash c0fd319295 VideoOGL: Move X11 wxWidgets utilities to DolphinWX 2014-11-24 21:15:52 -05:00
Lioncash b94dbca160 Host: Kill off GetRenderWindowSize 2014-11-17 13:44:49 -05:00
Lioncash 4c62bd2edb Remove unnecessary cstdarg header includes 2014-11-06 20:50:11 -05:00
Lioncash 884ec2ed13 Host: Kill off Host_SysMessage
Equivalent facilities already exist.
2014-11-05 02:30:48 -05:00
comex 890b788633 Merge pull request #1467 from waddlesplash/dolphin-qt
DolphinQt: Games now boot!
2014-11-02 18:08:55 -05:00
Augustin Cavalier 29593d403b Move GLInterface to the OGL VideoBackend's directory. 2014-11-02 12:16:33 -05:00
Ryan Houdek 6e43562496 Merge pull request #1468 from Tilka/cleanup
Small cleanup
2014-11-02 11:02:35 -06:00
Tillmann Karras ff41dd479b Fix warnings about non-static variables 2014-11-02 04:51:44 +01:00
Tillmann Karras a248db0b65 Reorder MainNoGUI shutdown
Before this change I always got this when closing dolphin-emu-nogui:

X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  10 (X_UnmapWindow)
  Resource id in failed request:  0x3400003
  Serial number of failed request:  215
  Current serial number in output stream:  219
terminate called without an active exception
Aborted
2014-11-02 03:31:47 +01:00
Augustin Cavalier 19109e2d01 Migrate global init stuff into UICommon.
This avoids code duplication in a bunch of places .
I also moved the NVIDIA Optimus export into VideoCommon.
2014-10-05 20:47:37 -04:00
Rohit Nirmal fbc64984ca Include CommonTypes.h instead of Common.h. 2014-09-08 15:39:58 -04:00
Ryan Houdek 30fef298bb Revert "Don't sleep in the event thread" 2014-09-05 00:50:40 -05:00
Jasper St. Pierre 5cb5a6ecd2 Don't sleep in the event thread
The person who wrote this seemed to misunderstand how XPending and
XNextEvent actually work. XNextEvent will wait in poll if there's
no event yet, meaning that we don't need to sleep after we process
all the events; the kernel will sleep for us.

This changes indentation, so view with -w or a similar feature to
understand what's actually changed here.
2014-09-04 17:24:51 -07:00
Rohit Nirmal 732bb7beb1 Change NULL to nullptr. 2014-09-03 22:22:12 -05:00
Jasper St. Pierre 6dbafa9238 Core: Move the titlebar / statusbar abstraction to DolphinWX
The concept of a "title bar" / "status bar" shouldn't be a core concept,
so remove the Host_UpdateStatusBar function, and move the code handles
whether to update the status bar or titlebar into DolphinWX.
2014-08-19 10:37:47 -04:00
Jasper St. Pierre 7ca8d8dfc7 Core: Don't pass through a reference to the window handle
Now that MainNoGUI is properly architected and GLX doesn't need to
sometimes craft its own windows sometimes which we have to thread back
into MainNoGUI, we don't need to thread the window handle that GLX
creates at all.

This removes the reference to pass back here, and the g_pWindowHandle
always be the same as the window returned by Host_GetRenderHandle().

A future cleanup could remove g_pWindowHandle entirely.
2014-08-19 10:05:58 -04:00
Jasper St. Pierre d6f4f4df42 MainNoGUI: Move a majority of the event handling from the GLX backend
The only reason the GLX backend handled this at all was because
MainNoGUI didn't make its own window before. This is unused in DolphinWX
builds.
2014-08-19 10:05:58 -04:00
Jasper St. Pierre 0dd7f6f5ea MainNoGUI: Supply a window in Host_GetRenderHandle
Our existing code was relying on the GLX backend to create the GLX
window properly, and for the rest of the code to patch that up, sort
of. If we rely on Host_GetRenderHandle() returning a valid window, we
can do a lot better about this.

Create a simple window inside MainNoGUI to make this happen.
2014-08-19 10:05:57 -04:00
Jasper St. Pierre 071e175a1d X11Utils: Explicitly pass the window to fullscreen into ToggleFullscreen
MainNoGUI is going to create its own window soon, and we need to
fullscreen that one instead of the GLX window.
2014-08-19 10:05:57 -04:00
Jasper St. Pierre 2eacf229ed X11Utils: Simplify the Fullscreen interface
Since we only use the toggle action, only keep that.
2014-08-19 10:05:57 -04:00
Jasper St. Pierre 09eb30ea3b MainNoGUI: Remove old OS X backend that doesn't work, rearchitect 2014-08-19 10:05:57 -04:00
Jasper St. Pierre 12f073c56b Remove support for EGL under X11
Now, the only supported EGL platform is Android. We might eventually add
back support for EGL/X11 or EGL/Wayland, but it will have to be
architected differently.
2014-08-19 10:05:57 -04:00
Jasper St. Pierre 8bd4b9d2f9 Remove support for Wayland
Yes, this is a fancy new feature, but our Wayland support was
particularly bitrotten, and ideally this would be handled by a platform
layer like SDL. If not, we can always add this back in when GLInterface
has caught up. We might be able to even support wxWidgets and GL
together with subsurfaces!
2014-08-19 10:05:56 -04:00
Lioncash cf46ac7dc9 Core: Kill off Host_ShowJitResults
Another host function that can be killed off by simple wx event handling
2014-08-15 15:18:28 -04:00
Lioncash e266635f40 Merge pull request #740 from lioncash/host
Core: Kill off a few Host interface functions.
2014-08-09 00:50:14 -04:00
Lioncash 7bf82f1989 Core: Kill off Host_UpdateLogDisplay()
This was actually never used as far as I can tell. There was no wx event handling done whatsoever for the global ID, So this is basically a dead function.
2014-08-08 19:21:40 -04:00
Lioncash d4eb0684f7 Core: Kill off Host_UpdateBreakPointView()
Uses wxWidgets event propagation to the parent window which then appropriately handles the breakpoint list updating.
2014-08-08 19:21:29 -04:00
Tillmann Karras f927af20f2 Fix more warnings from #579 2014-08-07 03:24:42 +02:00
Pierre Bourdon e15ec56bf0 Merge pull request #716 from delroth/vertex-loader
Make vertex loader testable
2014-08-03 21:14:59 -07:00