Add the Game Fix, Speed Hack, and Advanced Dialogs to the Linux port.

git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@186 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
arcum42 2008-10-10 12:00:49 +00:00 committed by Gregory Hainaut
parent 7f8380e2ba
commit ba9157ef68
11 changed files with 3251 additions and 1550 deletions

View File

@ -88,6 +88,17 @@ int LoadConfig() {
// cpu
GetValuel("Options", Config.Options);
//hacks
GetValuel("Hacks", Config.Hacks);
GetValuel("Fixes", Config.GameFixes);
Config.sseMXCSR = DEFAULT_sseMXCSR;
Config.sseVUMXCSR = DEFAULT_sseVUMXCSR;
//sseMXCSR
GetValuel("sseMXCSR", Config.sseMXCSR);
//sseVUMXCSR
GetValuel("sseVUMXCSR", Config.sseVUMXCSR);
GetValuel("Patch", Config.Patch);
@ -137,6 +148,13 @@ void SaveConfig() {
SetValue("FW", Config.FW);
//cpu
SetValuel("Options", Config.Options);
//hacks
SetValuel("Hacks", Config.Hacks);
SetValuel("Fixes", Config.GameFixes);
//sseMXCSR
SetValuel("sseMXCSR", Config.sseMXCSR);
//sseVUMXCSR
SetValuel("sseVUMXCSR", Config.sseVUMXCSR);
// misc
SetValuel("Patch", Config.Patch);

File diff suppressed because it is too large Load Diff

View File

@ -19,29 +19,63 @@
#ifndef __LINUX_H__
#define __LINUX_H__
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdbool.h>
#include <dirent.h>
#include <dlfcn.h>
#include <fcntl.h>
#include <errno.h>
#include <signal.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/time.h>
#include <pthread.h>
#include <X11/keysym.h>
#include <gtk/gtk.h>
#include <glib/gthread.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtkdialog.h>
#include "../Paths.h"
#include "Common.h"
typedef struct {
char lang[256];
} _langs;
typedef enum
{
GS,
PAD1,
PAD2,
SPU,
CDVD,
DEV9,
USB,
FW,
BIOS
} plugin_types;
GtkWidget *check_eerec, *check_vu0rec, *check_vu1rec;
GtkWidget *check_mtgs , *check_cpu_dc;
GtkWidget *check_console , *check_patches;
GtkWidget *radio_normal_limit, *radio_limit_limit, *radio_fs_limit, *radio_vuskip_limit;
_langs *langs;
unsigned int langsMax;
extern int UseGui;
extern int g_SaveGSStream;
extern int g_ZeroGSOptions;
char cfgfile[256];
int LoadConfig();
void SaveConfig();
void StartGui();
void RunGui();
int Pcsx2Configure();
void InitLanguages();
char *GetLanguageNext();
void CloseLanguages();
void ChangeLanguage(char *lang);
#endif /* __LINUX_H__ */

View File

@ -16,53 +16,33 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <dirent.h>
#include <dlfcn.h>
#include <fcntl.h>
#include <errno.h>
//#include <error.h>
#include <signal.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <time.h>
#include <X11/keysym.h>
#include <gtk/gtk.h>
#include <glib/gthread.h>
#include <unistd.h>
#include "Common.h"
#include "PsxCommon.h"
#include "Linux.h"
#include "LnxMain.h"
#include "../Paths.h"
int UseGui = 1;
int needReset = 1;
int RunExe = 0;
extern int g_SaveGSStream;
extern int g_ZeroGSOptions;
DIR *dir;
#ifdef PCSX2_DEVBUILD
TESTRUNARGS g_TestRun;
char* g_pRunGSState = NULL;
#endif
#ifdef PCSX2_VIRTUAL_MEM
static int s_nPageSize = 0;
static int s_nShmCounter = 0;
#endif
int main(int argc, char *argv[]) {
char *file = NULL;
char elfname[256];
char *lang;
int runcd=0;
int efile = 0;
char* g_pRunGSState = NULL;
int i;
//char* g_pRunGSState = NULL;
int i = 1;
struct stat buf;
#ifdef PCSX2_VIRTUAL_MEM
@ -75,7 +55,6 @@ int main(int argc, char *argv[]) {
}
#endif
#ifdef ENABLE_NLS
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, "Langs");
@ -91,38 +70,10 @@ int main(int argc, char *argv[]) {
memset(&g_TestRun, 0, sizeof(g_TestRun));
#endif
i = 1;
while(i < argc) {
char* token = argv[i++];
if( stricmp(token, "-help") == 0 || stricmp(token, "--help") == 0 || stricmp(token, "-h") == 0 ) {
char* phelpmsg =
"\tpcsx2 [options] [file]\n\n"
"-cfg [file] {configuration file}\n"
"-efile [efile] {0 - reset, 1 - runcd (default), 2 - loadelf}\n"
"-help {display this help file}\n"
"-nogui {Don't use gui when launching}\n"
"-loadgs [file} {Loads a gsstate}\n"
"\n"
#ifdef PCSX2_DEVBUILD
"Testing Options: \n"
"\t-frame [frame] {game will run up to this frame before exiting}\n"
"\t-image [name] {path and base name of image (do not include the .ext)}\n"
"\t-jpg {save images to jpg format}\n"
"\t-log [name] {log path to save log file in}\n"
"\t-logopt [hex] {log options in hex (see debug.h) }\n"
"\t-numimages [num] {after hitting frame, this many images will be captures every 20 frames}\n"
"\t-test {Triggers testing mode (only for dev builds)}\n"
"\n"
#endif
"Load Plugins:\n"
"\t-cdvd [dllpath] {specify the dll load path of the CDVD plugin}\n"
"\t-gs [dllpath] {specify the dll load path of the GS plugin}\n"
"-pad [tsxcal] {specify to hold down on the triangle, square, circle, x, start, select buttons}\n"
"\t-spu [dllpath] {specify the dll load path of the SPU2 plugin}\n"
"\n";
//SysMessage(phelpmsg);
return 0;
}
@ -133,7 +84,7 @@ int main(int argc, char *argv[]) {
}
}
else if( stricmp(token, "-nogui") == 0 ) {
UseGui = 0;
UseGui = FALSE;
}
else if( stricmp(token, "-loadgs") == 0 ) {
g_pRunGSState = argv[i++];
@ -202,15 +153,25 @@ int main(int argc, char *argv[]) {
g_TestRun.ptitle = file;
#endif
if (LoadConfig() == -1) {
// make gtk thread safe if using MTGS
if( CHECK_MULTIGS ) {
g_thread_init(NULL);
gdk_threads_init();
}
if (UseGui) gtk_init(NULL, NULL);
if (UseGui) {
gtk_init(NULL, NULL);
}
if (LoadConfig() == -1) {
memset(&Config, 0, sizeof(Config));
strcpy(Config.BiosDir, DEFAULT_BIOS_DIR "/");
strcpy(Config.PluginsDir, DEFAULT_PLUGINS_DIR "/");
Config.Patch = 1;
Config.Options = PCSX2_EEREC|PCSX2_VU0REC|PCSX2_VU1REC|PCSX2_COP2REC;
Config.Options = PCSX2_EEREC | PCSX2_VU0REC | PCSX2_VU1REC | PCSX2_COP2REC;
Config.sseMXCSR = DEFAULT_sseMXCSR;
Config.sseVUMXCSR = DEFAULT_sseVUMXCSR;
SysMessage(_("Pcsx2 needs to be configured"));
Pcsx2Configure();
@ -218,28 +179,7 @@ int main(int argc, char *argv[]) {
return 0;
}
// make gtk thread safe if using MTGS
if( CHECK_MULTIGS ) {
g_thread_init(NULL);
gdk_threads_init();
}
if (UseGui) gtk_init(NULL, NULL);
if (Config.Lang[0] == 0) {
strcpy(Config.Lang, "en");
}
langs = (_langs*)malloc(sizeof(_langs));
strcpy(langs[0].lang, "en");
InitLanguages(); i=1;
while ((lang = GetLanguageNext()) != NULL) {
langs = (_langs*)realloc(langs, sizeof(_langs)*(i+1));
strcpy(langs[i].lang, lang);
i++;
}
CloseLanguages();
langsMax = i;
InitLanguages();
if( Config.PsxOut ) {
// output the help commands
@ -264,21 +204,19 @@ int main(int argc, char *argv[]) {
}
#endif
if (UseGui&&file==NULL) {
if (UseGui && (file == NULL)) {
StartGui();
return 0;
}
if (OpenPlugins(file) == -1) {
return -1;
}
if (OpenPlugins(file) == -1) return -1;
SysReset();
SetCPUState(Config.sseMXCSR, Config.sseVUMXCSR);
cpuExecuteBios();
if (file)
strcpy(elfname, file);
if (!efile)
efile=GetPS2ElfName(elfname);
if (file) strcpy(elfname, file);
if (!efile) efile=GetPS2ElfName(elfname);
loadElfFile(elfname);
if( GSsetGameCRC != NULL )
@ -289,10 +227,26 @@ int main(int argc, char *argv[]) {
return 0;
}
DIR *dir;
void InitLanguages() {
char *lang;
int i = 1;
if (Config.Lang[0] == 0) {
strcpy(Config.Lang, "en");
}
langs = (_langs*)malloc(sizeof(_langs));
strcpy(langs[0].lang, "en");
dir = opendir(LANGS_DIR);
while ((lang = GetLanguageNext()) != NULL) {
langs = (_langs*)realloc(langs, sizeof(_langs)*(i+1));
strcpy(langs[i].lang, lang);
i++;
}
CloseLanguages();
langsMax = i;
}
char *GetLanguageNext() {
@ -322,26 +276,19 @@ void ChangeLanguage(char *lang) {
}
void KeyEvent(keyEvent* ev) {
char Text[256];
int ret;
static int shift = 0;
if (ev == NULL)
return;
if (ev == NULL) return;
if( GSkeyEvent != NULL )
GSkeyEvent(ev);
if( GSkeyEvent != NULL ) GSkeyEvent(ev);
if( ev->event == KEYPRESS ) {
if( ev->event == KEYPRESS )
if( ev->key == XK_Shift_L || ev->key == XK_Shift_R )
shift = 1;
}
else {
else
if (ev->event == KEYRELEASE) {
if( ev->key == XK_Shift_L || ev->key == XK_Shift_R )
shift = 0;
}
return;
}
@ -372,8 +319,7 @@ void KeyEvent(keyEvent* ev) {
#endif
ClosePlugins();
if (!UseGui)
exit(0);
if (!UseGui) exit(0);
RunGui();
break;
default:
@ -404,7 +350,7 @@ int SysInit() {
return -1;
while (LoadPlugins() == -1) {
if (Pcsx2Configure() == 0)
if (Pcsx2Configure() == FALSE)
exit(1);
}
@ -446,16 +392,6 @@ void SysPrintf(char *fmt, ...) {
return;
}
// due to various linux ways of writing lines, convert all \r\n to \n
// src = msg;
// while( (ptr = strstr(src, "\r\n")) != NULL ) {
// ptr[0] = 0;
// printf("%s\n", src);
// src = ptr+2;
// }
//
// if( src[0] != 0 )
// printf("%s", src);
printf("%s", msg);
#ifdef EMU_LOG
@ -517,9 +453,6 @@ void SysMunmap(uptr base, u32 size) {
#ifdef PCSX2_VIRTUAL_MEM
static int s_nPageSize = 0;
static int s_nShmCounter = 0;
int SysPhysicalAlloc(u32 size, PSMEMORYBLOCK* pblock)
{
assert( pblock != NULL );

View File

@ -1,20 +1,3 @@
/* Pcsx2 - Pc Ps2 Emulator
* Copyright (C) 2002-2008 Pcsx2 Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <gtk/gtk.h>
@ -130,6 +113,18 @@ void
OnConf_Cpu (GtkMenuItem *menuitem,
gpointer user_data);
void
on_Game_Fixes (GtkMenuItem *menuitem,
gpointer user_data);
void
on_Speed_Hacks (GtkMenuItem *menuitem,
gpointer user_data);
void
on_Advanced (GtkMenuItem *menuitem,
gpointer user_data);
void
on_patch_browser1_activate (GtkMenuItem *menuitem,
gpointer user_data);
@ -401,3 +396,39 @@ OnMemWrite32_Ok (GtkButton *button,
void
OnMemWrite32_Cancel (GtkButton *button,
gpointer user_data);
void
on_Game_Fix_OK (GtkButton *button,
gpointer user_data);
void
on_Game_Fix_Cancel (GtkButton *button,
gpointer user_data);
void
on_Speed_Hack_Compatability (GtkButton *button,
gpointer user_data);
void
on_Speed_Hack_Speed (GtkButton *button,
gpointer user_data);
void
on_Speed_Hack_OK (GtkButton *button,
gpointer user_data);
void
on_Speed_Hack_Cancel (GtkButton *button,
gpointer user_data);
void
on_Advanced_Defaults (GtkButton *button,
gpointer user_data);
void
on_Advanced_OK (GtkButton *button,
gpointer user_data);
void
on_Advanced_Cancel (GtkButton *button,
gpointer user_data);

File diff suppressed because it is too large Load Diff

View File

@ -1,20 +1,3 @@
/* Pcsx2 - Pc Ps2 Emulator
* Copyright (C) 2002-2008 Pcsx2 Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
@ -32,3 +15,6 @@ GtkWidget* create_DumpRDlg (void);
GtkWidget* create_Logging (void);
GtkWidget* create_CmdLine (void);
GtkWidget* create_MemWrite32 (void);
GtkWidget* create_GameFixDlg (void);
GtkWidget* create_SpeedHacksDlg (void);
GtkWidget* create_AdvDlg (void);

File diff suppressed because it is too large Load Diff

View File

@ -1,20 +1,3 @@
/* Pcsx2 - Pc Ps2 Emulator
* Copyright (C) 2002-2008 Pcsx2 Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/

View File

@ -1,20 +1,3 @@
/* Pcsx2 - Pc Ps2 Emulator
* Copyright (C) 2002-2008 Pcsx2 Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/

View File

@ -17,6 +17,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
#export PCSX2OPTIONS="--enable-debug --enable-devbuild --enable-sse2 --enable-sse3 --prefix `pwd`"
echo ---------------
echo Building Pcsx2
echo ---------------