From 14923822531ef338c1594eab77fe603f0c48a6d6 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Wed, 4 Mar 2009 20:58:41 +0000 Subject: [PATCH] Linux: Get everything compiling again. There is still a nasty crahing bug or two from r675, in particular when using the menus for load and save states rather then keyboard commands. I'll work on fixing that tomorrow, but wanted it to at least compile and run. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@679 96395faa-99c1-11dd-bbfe-3dabce05a288 --- 3rdparty/SoundTouch/configure.ac | 2 +- pcsx2/Linux/ConfigDlg.h | 2 -- pcsx2/Linux/LnxMain.cpp | 26 +++++++++++++++++++++++--- pcsx2/Linux/LnxMain.h | 4 ++++ pcsx2/Linux/LnxSysExec.cpp | 30 ++++++++++++------------------ pcsx2/Linux/LnxSysExec.h | 2 +- pcsx2/System.cpp | 6 ++++++ pcsx2/x86/Makefile.am | 6 +++--- 8 files changed, 50 insertions(+), 28 deletions(-) diff --git a/3rdparty/SoundTouch/configure.ac b/3rdparty/SoundTouch/configure.ac index 42913005b8..5ce75d219b 100644 --- a/3rdparty/SoundTouch/configure.ac +++ b/3rdparty/SoundTouch/configure.ac @@ -1,7 +1,7 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -AC_PREREQ([2.63]) +//AC_PREREQ([2.63]) AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([BPMDetect.h]) diff --git a/pcsx2/Linux/ConfigDlg.h b/pcsx2/Linux/ConfigDlg.h index 6068a36af6..1788052f2b 100644 --- a/pcsx2/Linux/ConfigDlg.h +++ b/pcsx2/Linux/ConfigDlg.h @@ -71,6 +71,4 @@ void SetComboToGList(GtkComboBox *widget, GList *list); static void ConfPlugin(PluginConf confs, char* plugin, const char* name); static void TestPlugin(PluginConf confs, char* plugin, const char* name); -extern void CheckSlots(); - #endif // __CONFIGDLG_H__ \ No newline at end of file diff --git a/pcsx2/Linux/LnxMain.cpp b/pcsx2/Linux/LnxMain.cpp index 13f1943f84..70a109b90b 100644 --- a/pcsx2/Linux/LnxMain.cpp +++ b/pcsx2/Linux/LnxMain.cpp @@ -139,7 +139,7 @@ int main(int argc, char *argv[]) if (!efile) efile = GetPS2ElfName(elfname); loadElfFile(elfname); - ExecuteCpu(); + //ExecuteCpu(); return 0; } @@ -211,7 +211,27 @@ void On_Dialog_Cancelled(GtkButton* button, gpointer user_data) gtk_widget_set_sensitive(MainWindow, TRUE); gtk_main_quit(); } + +void RefreshMenuSlots() +{ + GtkWidget *Item; + char str[g_MaxPath], str2[g_MaxPath]; + + for (int i = 0; i < 5; i++) + { + sprintf(str, "load_slot_%d", i); + sprintf(str2, "save_slot_%d", i); + Item = lookup_widget(MainWindow, str); + if GTK_IS_WIDGET(Item) + gtk_widget_set_sensitive(Item, Slots[i]); + else + Console::Error("No such widget: %s", params str); + + Item = lookup_widget(MainWindow, str2); + gtk_widget_set_sensitive(Item, (ElfCRC != 0)); + } +} void StartGui() { GtkWidget *Menu; @@ -233,7 +253,7 @@ void StartGui() gtk_box_pack_start(GTK_BOX(lookup_widget(MainWindow, "status_box")), pStatusBar, TRUE, TRUE, 0); gtk_widget_show(pStatusBar); - StatusBar_SetMsg( "F1 - save, F2 - next state, Shift+F2 - prev state, F3 - load, F8 - snapshot"); + HostGui::SetStatusMsg( "F1 - save, F2 - next state, Shift+F2 - prev state, F3 - load, F8 - snapshot"); // add all the languages Item = lookup_widget(MainWindow, "GtkMenuItem_Language"); @@ -269,7 +289,7 @@ void StartGui() gtk_widget_destroy(lookup_widget(MainWindow, "GtkMenuItem_Debug")); #endif - ResetMenuSlots(); + RefreshMenuSlots(); gtk_widget_show_all(MainWindow); gtk_window_activate_focus(GTK_WINDOW(MainWindow)); diff --git a/pcsx2/Linux/LnxMain.h b/pcsx2/Linux/LnxMain.h index 8087eeff22..86b74cebd0 100644 --- a/pcsx2/Linux/LnxMain.h +++ b/pcsx2/Linux/LnxMain.h @@ -20,9 +20,11 @@ #define __LNXMAIN_H__ #include "Linux.h" +#include "LnxMain.h" #include "HostGui.h" extern bool applychanges; +extern bool Slots[5]; extern bool ParseCommandLine(int argc, char *argv[], char *file); extern void MemoryCard_Init(); @@ -34,6 +36,8 @@ void CloseLanguages(); void StartGui(); void pcsx2_exit(); +extern bool SysInit(); +extern void SysClose(); GtkWidget *MainWindow, *Status_Box; GtkWidget *pStatusBar = NULL; diff --git a/pcsx2/Linux/LnxSysExec.cpp b/pcsx2/Linux/LnxSysExec.cpp index fc026dc482..6bd70d48df 100644 --- a/pcsx2/Linux/LnxSysExec.cpp +++ b/pcsx2/Linux/LnxSysExec.cpp @@ -18,12 +18,15 @@ #include "Linux.h" #include "LnxSysExec.h" +#include "HostGui.h" bool UseGui = true; static bool sinit = false; GtkWidget *FileSel; +bool Slots[5] = { false, false, false, false, false }; + void InstallLinuxExceptionHandler() { struct sigaction sa; @@ -201,8 +204,9 @@ void OnStates_Load(GtkMenuItem *menuitem, gpointer user_data) } sscanf(name, "Slot %d", &i); - if( States_Load(i) ) - ExecuteCpu(); + //if (States_Load(i)) ExecuteCpu(); + States_Load(i); + RefreshMenuSlots(); } void OnLoadOther_Ok(GtkButton* button, gpointer user_data) @@ -214,8 +218,9 @@ void OnLoadOther_Ok(GtkButton* button, gpointer user_data) strcpy(str, File); gtk_widget_destroy(FileSel); - if( States_Load(str) ) - ExecuteCpu(); + //if (States_Load(str)) ExecuteCpu(); + States_Load(str); + RefreshMenuSlots(); } void OnLoadOther_Cancel(GtkButton* button, gpointer user_data) @@ -429,28 +434,17 @@ namespace HostGui { // mirror output to the console! Console::Status( text.c_str() ); - SetStatusMsg( test ); + SetStatusMsg( text ); } void ResetMenuSlots() { GtkWidget *Item; char str[g_MaxPath], str2[g_MaxPath]; - + for (int i = 0; i < 5; i++) { - sprintf(str, "load_slot_%d", i); - sprintf(str2, "save_slot_%d", i); - Item = lookup_widget(MainWindow, str); - - if GTK_IS_WIDGET(Item) - gtk_widget_set_sensitive(Item, Slots[i]); - else - Console::Error("No such widget: %s", params str); - - Item = lookup_widget(MainWindow, str2); - gtk_widget_set_sensitive(Item, (ElfCRC != 0)); - + Slots[i] = States_isSlotUsed(i); } } diff --git a/pcsx2/Linux/LnxSysExec.h b/pcsx2/Linux/LnxSysExec.h index 7b0527f392..639a7e7671 100644 --- a/pcsx2/Linux/LnxSysExec.h +++ b/pcsx2/Linux/LnxSysExec.h @@ -32,7 +32,7 @@ void __fastcall ReleaseLinuxExceptionHandler(); #define PCSX2_MEM_PROTECT_END() ReleaseLinuxExceptionHandler() extern void StartGui(); -extern void CheckSlots(); +extern void RefreshMenuSlots(); extern void SignalExit(int sig); extern const char* g_pRunGSState; diff --git a/pcsx2/System.cpp b/pcsx2/System.cpp index 89f4ab199b..ec2bd1ec41 100644 --- a/pcsx2/System.cpp +++ b/pcsx2/System.cpp @@ -314,10 +314,16 @@ void SysClearExecutionCache() __forceinline void SysUpdate() { +#ifdef __LINUX__ + // Doing things the other way results in no keys functioning under Linux! + HostGui::KeyEvent(PAD1keyEvent()); + HostGui::KeyEvent(PAD2keyEvent()); +#else keyEvent* ev1 = PAD1keyEvent(); keyEvent* ev2 = PAD2keyEvent(); HostGui::KeyEvent( (ev1 != NULL) ? ev1 : ev2); +#endif } void SysExecute() diff --git a/pcsx2/x86/Makefile.am b/pcsx2/x86/Makefile.am index 519e5a72d1..5e75983483 100644 --- a/pcsx2/x86/Makefile.am +++ b/pcsx2/x86/Makefile.am @@ -19,9 +19,9 @@ BaseblockEx.h iCOP0.h iCore.h iFPU.h iMMI.h iR3000A.h iR5900.h iR5900Arit.h iR59 iR5900LoadStore.h iR5900Move.h iR5900MultDiv.h iR5900Shift.h iVUmicro.h iVUops.h iVUzerorec.h #ifdef PCSX2_MICROVU -libx86recomp_a_SOURCES += \ -microVU.cpp microVU_Alloc.cpp microVU_Compile.cpp microVU_Lower.cpp microVU_Misc.cpp microVU_Upper.cpp aMicroVU.S \ -microVU.h microVU_Alloc.h microVU_Misc.h microVU_Tables.h +#libx86recomp_a_SOURCES += \ +#microVU.cpp microVU_Alloc.cpp microVU_Compile.cpp microVU_Lower.cpp microVU_Misc.cpp microVU_Upper.cpp aMicroVU.S \ +#microVU.h microVU_Alloc.h microVU_Misc.h microVU_Tables.h #endif libx86recomp_a_DEPENDENCIES = ix86/libix86.a