From c6c9d266fad98310bb6f0118362d8dc7e60ecfae Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Tue, 9 Jul 2013 09:33:55 +0000 Subject: Make the bladesio1 driver work on OS X: Fix a bug where the wrong plug-in was being used in place of sio1, causing PCSXR to complain. Fix a bug where bladesio1's config window would cause PCSXR to crash. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@85936 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/Plugin.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'macosx/Plugin.c') diff --git a/macosx/Plugin.c b/macosx/Plugin.c index bbfec3c8..e501a5f5 100755 --- a/macosx/Plugin.c +++ b/macosx/Plugin.c @@ -42,6 +42,13 @@ void gpuShowPic() { } void PADhandleKey(int key) { + //TODO: get these set up properly! + GPU_keypressed(key); +#ifdef ENABLE_SIO1API + SIO1_keypressed(key); +#endif + if (Config.UseNet) NET_keypressed(key); + } long PAD1__open(void) { @@ -52,8 +59,6 @@ long PAD2__open(void) { return PAD2_open(&gpuDisp); } -void OnFile_Exit(); - void SignalExit(int sig) { ClosePlugins(); OnFile_Exit(); @@ -88,6 +93,11 @@ int _OpenPlugins() { if (ret < 0) { SysMessage("%s", _("Error Opening PAD2 Plugin")); return -1; } PAD2_registerVibration(GPU_visualVibration); PAD2_registerCursor(GPU_cursor); +#ifdef ENABLE_SIO1API + ret = SIO1_open(&gpuDisp); + if (ret < 0) { SysMessage("%s", _("Error opening SIO1 plugin!")); return -1; } + SIO1_registerCallback(SIO1irq); +#endif if (Config.UseNet && !NetOpened) { netInfo info; @@ -174,6 +184,10 @@ void ClosePlugins() { if (ret < 0) { SysMessage("%s", _("Error Closing PAD2 Plugin")); return; } ret = GPU_close(); if (ret < 0) { SysMessage("%s", _("Error Closing GPU Plugin")); return; } +#ifdef ENABLE_SIO1API + ret = SIO1_close(); + if (ret < 0) { SysMessage(_("Error closing SIO1 plugin!")); return; } +#endif if (Config.UseNet) { NET_pause(); @@ -188,6 +202,9 @@ void ResetPlugins() { SPU_shutdown(); PAD1_shutdown(); PAD2_shutdown(); +#ifdef ENABLE_SIO1API + SIO1_shutdown(); +#endif if (Config.UseNet) NET_shutdown(); ret = CDR_init(); @@ -200,6 +217,11 @@ void ResetPlugins() { if (ret < 0) { SysMessage(_("PAD1init error: %d"), ret); return; } ret = PAD2_init(2); if (ret < 0) { SysMessage(_("PAD2init error: %d"), ret); return; } +#ifdef ENABLE_SIO1API + ret = SIO1_init(); + if (ret < 0) { SysMessage(_("SIO1init error: %d!"), ret); return; } +#endif + if (Config.UseNet) { ret = NET_init(); if (ret < 0) { SysMessage(_("NETinit error: %d"), ret); return; } -- cgit v1.2.3