summaryrefslogtreecommitdiff
path: root/games-emulation
diff options
context:
space:
mode:
author(no author) <(no author)@4d9a9b59-111c-4e0b-8f7a-7640551abb98>2009-03-16 07:55:01 +0000
committer(no author) <(no author)@4d9a9b59-111c-4e0b-8f7a-7640551abb98>2009-03-16 07:55:01 +0000
commitf1e95daae05c57d935b00e611c624c5e75cd21ec (patch)
tree4065ab51d9e64882d9001a59ede7d9a4e372a4a6 /games-emulation
uploading my overlay ), initial commit
git-svn-id: http://172.18.13.13/svn/sss_overlay@1 4d9a9b59-111c-4e0b-8f7a-7640551abb98
Diffstat (limited to 'games-emulation')
-rw-r--r--games-emulation/epsxe/epsxe-1.6.0-r3.ebuild40
-rw-r--r--games-emulation/epsxe/files/epsxe72
-rw-r--r--games-emulation/gens/files/gens-2.12b-gcc4.patch37
-rw-r--r--games-emulation/gens/files/gens-2.12b-romsdir.patch13
-rw-r--r--games-emulation/gens/files/gens-rc3_to_mythgame.patch674
-rw-r--r--games-emulation/gens/gens-2.12b.ebuild49
-rw-r--r--games-emulation/pcsx2/files/pcsx2-0.9.4-add-nls.patch21
-rw-r--r--games-emulation/pcsx2/files/pcsx2-0.9.4-custom-cflags.patch34
-rw-r--r--games-emulation/pcsx2/files/pcsx2-0.9.4-plugin-inis.patch15
-rw-r--r--games-emulation/pcsx2/files/pcsx2-add-nls.patch21
-rw-r--r--games-emulation/pcsx2/files/pcsx2-custom-cflags.patch34
-rw-r--r--games-emulation/pcsx2/files/pcsx2-gcc43.patch12
-rw-r--r--games-emulation/pcsx2/files/pcsx2-plugin-inis.patch15
-rw-r--r--games-emulation/pcsx2/pcsx2-0.9.4.ebuild140
-rw-r--r--games-emulation/pcsx2/pcsx2-9999.ebuild142
-rw-r--r--games-emulation/ps2emu-cdvdiso/ps2emu-cdvdiso-0.7.ebuild44
-rw-r--r--games-emulation/ps2emu-cdvdiso/ps2emu-cdvdiso-9999.ebuild43
-rw-r--r--games-emulation/ps2emu-cdvdlinuz/ps2emu-cdvdlinuz-0.4.ebuild45
-rw-r--r--games-emulation/ps2emu-cdvdlinuz/ps2emu-cdvdlinuz-9999.ebuild44
-rw-r--r--games-emulation/ps2emu-cdvdnull/ps2emu-cdvdnull-0.6.ebuild42
-rw-r--r--games-emulation/ps2emu-cdvdnull/ps2emu-cdvdnull-9999.ebuild41
-rw-r--r--games-emulation/ps2emu-dev9null/ps2emu-dev9null-0.3.ebuild40
-rw-r--r--games-emulation/ps2emu-dev9null/ps2emu-dev9null-9999.ebuild39
-rw-r--r--games-emulation/ps2emu-fwnull/ps2emu-fwnull-0.4.ebuild42
-rw-r--r--games-emulation/ps2emu-fwnull/ps2emu-fwnull-9999.ebuild41
-rw-r--r--games-emulation/ps2emu-peopsspu2/ps2emu-peopsspu2-1.9.0.ebuild67
-rw-r--r--games-emulation/ps2emu-peopsspu2/ps2emu-peopsspu2-9999.ebuild65
-rw-r--r--games-emulation/ps2emu-spu2null/ps2emu-spu2null-0.7.1.ebuild40
-rw-r--r--games-emulation/ps2emu-spu2null/ps2emu-spu2null-9999.ebuild39
-rw-r--r--games-emulation/ps2emu-usbnull/ps2emu-usbnull-0.4-r1.ebuild42
-rw-r--r--games-emulation/ps2emu-usbnull/ps2emu-usbnull-9999.ebuild41
-rw-r--r--games-emulation/ps2emu-zerogs/files/ps2emu-zerogs-consistent-naming.patch14
-rw-r--r--games-emulation/ps2emu-zerogs/files/ps2emu-zerogs-devbuild-paths.patch44
-rw-r--r--games-emulation/ps2emu-zerogs/files/ps2emu-zerogs-gcc43.patch12
-rw-r--r--games-emulation/ps2emu-zerogs/ps2emu-zerogs-0.96.7.ebuild72
-rw-r--r--games-emulation/ps2emu-zerogs/ps2emu-zerogs-9999.ebuild70
-rw-r--r--games-emulation/ps2emu-zeropad/files/ps2emu-zeropad-consistent-naming.patch13
-rw-r--r--games-emulation/ps2emu-zeropad/ps2emu-zeropad-0.1.0.ebuild49
-rw-r--r--games-emulation/ps2emu-zeropad/ps2emu-zeropad-9999.ebuild47
39 files changed, 2355 insertions, 0 deletions
diff --git a/games-emulation/epsxe/epsxe-1.6.0-r3.ebuild b/games-emulation/epsxe/epsxe-1.6.0-r3.ebuild
new file mode 100644
index 0000000..40a3b05
--- /dev/null
+++ b/games-emulation/epsxe/epsxe-1.6.0-r3.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/games-emulation/epsxe/epsxe-1.6.0-r3.ebuild,v 1.5 2004/09/13 04:45:07 mr_bones_ Exp $
+
+inherit games
+
+DESCRIPTION="ePSXe Playstation Emulator"
+HOMEPAGE="http://www.epsxe.com/"
+SRC_URI="http://www.epsxe.com/files/epsxe${PV//.}lin.zip"
+
+LICENSE="freedist"
+SLOT="0"
+KEYWORDS="-* x86 ~amd64"
+IUSE="opengl"
+RESTRICT="nostrip" # For some strange reason, strip truncates the whole file
+
+DEPEND="app-arch/unzip"
+RDEPEND="!amd64? ( >=dev-libs/glib-1.2 =x11-libs/gtk+-1.2* =sys-libs/ncurses-5* =sys-libs/zlib-1* net-misc/wget games-emulation/psemu-peopsspu )
+ opengl? ( games-emulation/psemu-gpupetemesagl games-emulation/psemu-peopssoftgpu )
+ amd64? ( app-emulation/emul-linux-x86-gtklibs )"
+
+S="${WORKDIR}"
+
+src_install() {
+ local dir=${GAMES_PREFIX_OPT}/${PN}
+ dogamesbin "${FILESDIR}"/epsxe
+ sed -i \
+ -e "s:GAMES_PREFIX_OPT:${GAMES_PREFIX_OPT}:" \
+ -e "s:GAMES_LIBDIR:$(games_get_libdir):" \
+ "${D}${GAMES_BINDIR}"/epsxe \
+ || die "sed failed"
+ exeinto "${dir}"
+ doexe epsxe || die "doexe failed"
+ insinto "${dir}"
+ doins keycodes.lst || die "doins failed"
+ insinto "$(games_get_libdir)"/psemu/cheats
+ doins cheats/* || die "doins failed"
+ dodoc docs/*
+ prepgamesdirs
+}
diff --git a/games-emulation/epsxe/files/epsxe b/games-emulation/epsxe/files/epsxe
new file mode 100644
index 0000000..f50f33a
--- /dev/null
+++ b/games-emulation/epsxe/files/epsxe
@@ -0,0 +1,72 @@
+#!/bin/sh
+
+PSEMUDIR=GAMES_LIBDIR/psemu
+EPSXEDIR=GAMES_PREFIX_OPT/epsxe
+
+mkdir -p ~/.epsxe
+cd ~/.epsxe
+cleanlinks
+mkdir -p memcards bios cfg cheats snap sstates patches plugins
+
+shopt -s nullglob
+
+for f in `find "${EPSXEDIR}" -maxdepth 1 -type f -printf '%f '` ; do
+ [[ -e "${f}" ]] && continue
+ ln -s "${EPSXEDIR}/${f}" "${f}" >& /dev/null
+done
+
+if [[ -d "${PSEMUDIR}" ]] ; then
+ if [[ -d "${PSEMUDIR}/plugins" ]] ; then
+ for plugin in `find "${PSEMUDIR}/plugins" -maxdepth 1 -type f -printf '%f '` ; do
+ if [[ ! -e "plugins/${plugin}" ]] ; then
+ echo "Loading new plugin: ${plugin}"
+ ln -s "${PSEMUDIR}/plugins/${plugin}" "plugins/${plugin}"
+ fi
+ done
+ fi
+
+ if [[ -d "${PSEMUDIR}/cfg" ]] ; then
+ for configlib in `find "${PSEMUDIR}/cfg" -maxdepth 1 -iname '*.cfg' -prune -o -type f -printf '%f '`; do
+ if [[ ! -e "cfg/${configlib}" ]] ; then
+ echo "Loading config utility: ${configlib}"
+ ln -s "${PSEMUDIR}/cfg/${configlib}" "cfg/${configlib}"
+ fi
+ done
+
+ for config in `find "${PSEMUDIR}/cfg" -maxdepth 1 -iname '*.cfg' -type f -printf '%f '`; do
+ if [[ ! -e "cfg/${config}" ]] ; then
+ echo "Loading default config: ${config}"
+ cp "${PSEMUDIR}/cfg/${config}" "cfg/${config}"
+ fi
+ done
+ fi
+
+ if [[ -d "${PSEMUDIR}/cheats" ]] ; then
+ for cheat in `find "${PSEMUDIR}/cheats" -maxdepth 1 -type f -printf '%f '`; do
+ if [[ ! -e "cheats/${cheat}" ]] ; then
+ ln -s "${PSEMUDIR}/cheats/${cheat}" "cheats/${cheat}"
+ fi
+ done
+ fi
+
+ if [[ -d "${PSEMUDIR}/bios" ]] ; then
+ for bios in `find "${PSEMUDIR}/bios" -maxdepth 1 -type f -printf '%f '`; do
+ if [[ ! -e "bios/${bios}" ]] ; then
+ ln -s "${PSEMUDIR}/bios/${bios}" "bios/${bios}"
+ fi
+ done
+ fi
+fi
+
+# check for bios
+if [[ -z "`cd bios && ls`" ]] ; then
+ # if the bios directory is empty, then ... well ...
+ echo
+ echo "*** Put your BIOS file into ~/.epsxe/bios/"
+ echo " or ePSXe may not work!"
+ echo
+fi
+
+# execute program (with args)
+export LD_PRELOAD="libpthread.so.0:${LD_PRELOAD}" # fix for Bug #26121
+exec ./epsxe "$@"
diff --git a/games-emulation/gens/files/gens-2.12b-gcc4.patch b/games-emulation/gens/files/gens-2.12b-gcc4.patch
new file mode 100644
index 0000000..88cf9b0
--- /dev/null
+++ b/games-emulation/gens/files/gens-2.12b-gcc4.patch
@@ -0,0 +1,37 @@
+diff --git a/src/gens/emulator/g_main.c b/src/gens/emulator/g_main.c
+index 1c9f4f5..3ac13eb 100644
+--- a/src/gens/emulator/g_main.c
++++ b/src/gens/emulator/g_main.c
+@@ -5,6 +5,7 @@
+ #include <sys/stat.h>
+ #include <stdlib.h>
+ #include <stdio.h>
++#include <string.h>
+ #include "g_main.h"
+ #include "timer.h"
+ #include "gens.h"
+diff --git a/src/gens/emulator/g_main.h b/src/gens/emulator/g_main.h
+index c7ea4b2..9090766 100644
+--- a/src/gens/emulator/g_main.h
++++ b/src/gens/emulator/g_main.h
+@@ -36,6 +36,8 @@ extern char **language_name;
+ extern unsigned char Keys[];
+ extern unsigned char joystate[];
+
++static int Build_Language_String (void);
++
+ void SetWindowText(const char *text);
+
+ int Set_Render(int Full, int Num, int Force);
+diff --git a/src/gens/emulator/parse.c b/src/gens/emulator/parse.c
+index 5bece4a..67f8b49 100644
+--- a/src/gens/emulator/parse.c
++++ b/src/gens/emulator/parse.c
+@@ -1,6 +1,7 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <getopt.h>
++#include <string.h>
+ #include "port.h"
+ #include "save.h"
+ #include "cpu_68k.h"
diff --git a/games-emulation/gens/files/gens-2.12b-romsdir.patch b/games-emulation/gens/files/gens-2.12b-romsdir.patch
new file mode 100644
index 0000000..76b066b
--- /dev/null
+++ b/games-emulation/gens/files/gens-2.12b-romsdir.patch
@@ -0,0 +1,13 @@
+diff -ruN gens-rc3.5-opengl/src/gens/util/rom.c gens-rc3.5-opengl-patched/src/gens/util/rom.c
+--- gens-rc3.5-opengl/src/gens/util/rom.c 2005-01-10 22:24:01.000000000 +0100
++++ gens-rc3.5-opengl-patched/src/gens/util/rom.c 2006-10-29 14:58:14.000000000 +0100
+@@ -411,6 +411,9 @@
+ create_file_chooser_dialog ("Open Rom", GTK_FILE_CHOOSER_ACTION_OPEN);
+ // fileselection_set_dir (fd.filesel, Rom_Dir);
+ addRomsFilter (widget);
++
++ gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (widget), Rom_Dir);
++
+ res = gtk_dialog_run (GTK_DIALOG (widget));
+ if (res == GTK_RESPONSE_OK)
+ {
diff --git a/games-emulation/gens/files/gens-rc3_to_mythgame.patch b/games-emulation/gens/files/gens-rc3_to_mythgame.patch
new file mode 100644
index 0000000..f32897a
--- /dev/null
+++ b/games-emulation/gens/files/gens-rc3_to_mythgame.patch
@@ -0,0 +1,674 @@
+--- old/src/gens/emulator/g_main.h 2004-04-15 16:22:49.000000000 -0400
++++ new/src/gens/emulator/g_main.h 2006-12-30 12:50:37.000000000 -0500
+@@ -22,6 +22,7 @@
+ extern int Intro_Style;
+ extern int SegaCD_Accurate;
+ extern int Active;
++extern int Quick_Exit;
+
+ extern POINT Window_Pos;
+
+@@ -36,6 +37,8 @@
+ extern unsigned char Keys[];
+ extern unsigned char joystate[];
+
++static int Build_Language_String (void);
++
+ void SetWindowText(const char *text);
+
+ int Set_Render(int Full, int Num, int Force);
+--- old/src/gens/emulator/g_main.c 2004-05-18 16:34:00.000000000 -0400
++++ new/src/gens/emulator/g_main.c 2006-12-30 13:13:00.000000000 -0500
+@@ -5,6 +5,7 @@
+ #include <sys/stat.h>
+ #include <stdlib.h>
+ #include <stdio.h>
++#include <string.h>
+ #include "g_main.h"
+ #include "timer.h"
+ #include "gens.h"
+@@ -54,6 +55,7 @@
+ int Intro_Style = 2;
+ int SegaCD_Accurate = 0;
+ int Kaillera_Client_Running = 0;
++int Quick_Exit = 0;
+
+ static int Gens_Running = 0;
+
+@@ -96,6 +98,11 @@
+ switch (event.key.keysym.sym)
+ {
+ case SDLK_ESCAPE:
++ if (Quick_Exit)
++ {
++ close_gens();
++ }
++
+ if (Debug)
+ {
+ Change_Debug (0);
+@@ -427,21 +434,73 @@
+ break;
+
+ case SDL_JOYAXISMOTION:
+- if (event.jaxis.axis < 2)
++ if (event.jaxis.axis < 6)
++ {
++ if (event.jaxis.value < -10000)
++ {
++ if (event.jaxis.axis == 0)
++ {
++ joystate[0x100 * event.jaxis.which + 0x3] = 1;
++ joystate[0x100 * event.jaxis.which + 0x4] = 0;
++ }
++ else if (event.jaxis.axis == 1)
++ {
++ joystate[0x100 * event.jaxis.which + 0x1] = 1;
++ joystate[0x100 * event.jaxis.which + 0x2] = 0;
++ }
++ else if (event.jaxis.axis == 2)
++ {
++ joystate[0x100 * event.jaxis.which + 0x7] = 1;
++ joystate[0x100 * event.jaxis.which + 0x8] = 0;
++ }
++ else if (event.jaxis.axis == 3)
++ {
++ joystate[0x100 * event.jaxis.which + 0x5] = 1;
++ joystate[0x100 * event.jaxis.which + 0x6] = 0;
++ }
++ else if (event.jaxis.axis == 4)
++ {
++ joystate[0x100 * event.jaxis.which + 0xB] = 1;
++ joystate[0x100 * event.jaxis.which + 0xC] = 0;
++ }
++ else if (event.jaxis.axis == 5)
++ {
++ joystate[0x100 * event.jaxis.which + 0x9] = 1;
++ joystate[0x100 * event.jaxis.which + 0xA] = 0;
++ }
++ }
++ else if (event.jaxis.value > 10000)
++ {
++ if (event.jaxis.axis == 0)
++ {
++ joystate[0x100 * event.jaxis.which + 0x3] = 0;
++ joystate[0x100 * event.jaxis.which + 0x4] = 1;
++ }
++ else if (event.jaxis.axis == 1)
+ {
+- if (event.jaxis.value < -500)
++ joystate[0x100 * event.jaxis.which + 0x1] = 0;
++ joystate[0x100 * event.jaxis.which + 0x2] = 1;
++ }
++ else if (event.jaxis.axis == 2)
+ {
+- joystate[0x100 * event.jaxis.which +
+- ((event.jaxis.axis == 0) ? 0x3 : 0x1)] = 1;
+- joystate[0x100 * event.jaxis.which +
+- ((event.jaxis.axis == 0) ? 0x4 : 0x2)] = 0;
++ joystate[0x100 * event.jaxis.which + 0x7] = 0;
++ joystate[0x100 * event.jaxis.which + 0x8] = 1;
+ }
+- else if (event.jaxis.value > 500)
++ else if (event.jaxis.axis == 3)
+ {
+- joystate[0x100 * event.jaxis.which +
+- ((event.jaxis.axis == 0) ? 0x4 : 0x2)] = 1;
+- joystate[0x100 * event.jaxis.which +
+- ((event.jaxis.axis == 0) ? 0x3 : 0x1)] = 0;
++ joystate[0x100 * event.jaxis.which + 0x5] = 0;
++ joystate[0x100 * event.jaxis.which + 0x6] = 1;
++ }
++ else if (event.jaxis.axis == 4)
++ {
++ joystate[0x100 * event.jaxis.which + 0xB] = 0;
++ joystate[0x100 * event.jaxis.which + 0xC] = 1;
++ }
++ else if (event.jaxis.axis == 5)
++ {
++ joystate[0x100 * event.jaxis.which + 0x9] = 0;
++ joystate[0x100 * event.jaxis.which + 0xA] = 1;
++ }
+ }
+ else
+ {
+@@ -455,7 +514,26 @@
+ joystate[0x100 * event.jaxis.which + 0x2] = 0;
+ joystate[0x100 * event.jaxis.which + 0x1] = 0;
+ }
+-
++ else if (event.jaxis.axis == 2)
++ {
++ joystate[0x100 * event.jaxis.which + 0x8] = 0;
++ joystate[0x100 * event.jaxis.which + 0x7] = 0;
++ }
++ else if (event.jaxis.axis == 3)
++ {
++ joystate[0x100 * event.jaxis.which + 0x6] = 0;
++ joystate[0x100 * event.jaxis.which + 0x5] = 0;
++ }
++ else if (event.jaxis.axis == 4)
++ {
++ joystate[0x100 * event.jaxis.which + 0xC] = 0;
++ joystate[0x100 * event.jaxis.which + 0xB] = 0;
++ }
++ else if (event.jaxis.axis == 5)
++ {
++ joystate[0x100 * event.jaxis.which + 0xA] = 0;
++ joystate[0x100 * event.jaxis.which + 0x9] = 0;
++ }
+ }
+ }
+
+@@ -679,6 +757,24 @@
+ sync_gens_ui ();
+ gtk_widget_show_all (gens_window);
+
++ //If a rom is passed in on the command line then open it
++ if (strcmp(Rom_Name, "") != 0)
++ {
++ struct stat buf;
++ char Rom_Path[2048];
++ strcpy (Rom_Path, Rom_Dir);
++ strcat (Rom_Path, Rom_Name);
++ if (stat (Rom_Path, &buf) == 0)
++ {
++ printf("Opening %s\n", Rom_Path);
++ Open_Rom(Rom_Path);
++ }
++ else
++ {
++ printf("%s not found\n", Rom_Path);
++ }
++ }
++
+ while (is_gens_running ())
+ {
+ update_SDL_events ();
+--- old/src/gens/emulator/parse.h 2004-05-19 15:12:02.000000000 -0400
++++ new/src/gens/emulator/parse.h 2006-12-30 12:40:16.000000000 -0500
+@@ -4,8 +4,8 @@
+ #define MM "--"
+ #define ENABLE "enable"
+ #define DISABLE "disable"
+-// 1 arg option
+
++// 1 arg option
+ #define ROMPATH "rompath"
+ #define SAVEPATH "savepath"
+ #define SRAMPATH "srampath"
+@@ -38,6 +38,7 @@
+
+ #define FS "fs"
+ #define WINDOW "window"
++#define QUICKEXIT "quickexit"
+
+ // enable and disable options
+ #define STRETCH "stretch"
+--- old/src/gens/emulator/parse.c 2004-05-19 15:21:00.000000000 -0400
++++ new/src/gens/emulator/parse.c 2007-01-03 01:29:41.210902112 -0500
+@@ -1,6 +1,7 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <getopt.h>
++#include <string.h>
+ #include "port.h"
+ #include "save.h"
+ #include "cpu_68k.h"
+@@ -33,67 +34,71 @@
+ #include "support.h"
+ #include "parse.h"
+
+-#define print_usage(option, helpmsg) fprintf(stderr, MM option"\n" helpmsg)
+-#define print_usage2(option, helpmsg) fprintf(stderr, MM ENABLE "-" option ", " MM DISABLE "-" option "\n" helpmsg "\n\n")
++#define print_usage(option, helpmsg) fprintf(stderr, MM option"\t" helpmsg"\n")
++#define print_usage2(option, helpmsg) fprintf(stderr, MM "en/disable-" option "\t" helpmsg "\n")
+
+ static void _usage()
+ {
+- fprintf (stderr, "Gens for Linux v2.12-rc3\n");
++ fprintf (stderr, "Gens for Linux v2.12-mythgame\n");
+ fprintf (stderr, "Usage : gens [options] romfile\n");
+- print_usage( HELP, "print this help");
++ print_usage( HELP, "\t\tprint this help");
+
+- print_usage( ROMPATH ,"path where your roms are stored");
+- print_usage( SAVEPATH ,"path where to save your states file");
+- print_usage( SRAMPATH ,"path where to save your states file");
+- print_usage( BRAMPATH ,"path where to save your states file");
+- print_usage( DUMPPATH ,"path where to save your states file");
+- print_usage( DUMPGYMPATH ,"path where to save your states file");
+- print_usage( SCRSHTPATH ,"path where to save your states file");
+- print_usage( PATPATH ,"path where to save your states file");
+- print_usage( IPSPATH ,"path where to save your states file");
+- print_usage( GCOFFPATH ,"path where to save your states file");
+- print_usage( GENSMANPATH ,"path where to save your states file");
+- print_usage( GENBIOS ,"");
+- print_usage( USABIOS ,"");
+- print_usage( EURBIOS ,"");
+- print_usage( JAPBIOS ,"");
+- print_usage( _32X68kBIOS ,"");
+- print_usage( _32XMBIOS ,"");
+- print_usage( _32XSBIOS ,"");
+- print_usage( CONTRAST ,"");
+- print_usage( BRIGHTNESS ,"");
+- print_usage( WINDOWMODE ,"");
+- print_usage( FSMODE ,"");
+- print_usage( FRAMESKIP ,"");
+- print_usage( SOUNDRATE ,"");
+- print_usage( MSH2SPEED ,"");
+- print_usage( SSH2SPEED ,"");
+- print_usage( RAMCARTSIZE,"");
+-
+- print_usage2( STRETCH,"stretch mode");
+- print_usage2( SWBLIT,"software blitting");
+- print_usage2( GREYSCALE,"greyscale");
+- print_usage2( INVERT,"");
+- print_usage2( SPRITELIMIT,"");
+- print_usage2( SOUND,"");
+- print_usage2( STEREO,"");
+- print_usage2( Z80,"");
+- print_usage2( YM2612,"");
+- print_usage2( PSG,"");
+- print_usage2( DAC,"");
+- print_usage2( PCM,"");
+- print_usage2( PWM,"");
+- print_usage2( CDDA,"");
++ print_usage( ROMPATH ,"\tdirectory roms are located in");
++ print_usage( SAVEPATH ,"\tpath to save states file");
++ print_usage( SRAMPATH ,"\tpath to save SRAM (battery backup) files");
++ print_usage( BRAMPATH ,"\tpath to save BRAM (Sega CD battery backup) files");
++ print_usage( DUMPPATH ,"\tpath to save wav sound dumps");
++ print_usage( DUMPGYMPATH ,"\tpath to save GYM sound dumps");
++ print_usage( SCRSHTPATH ,"path to save screen shots");
++ print_usage( PATPATH ,"\tpath for game genie patch files");
++ print_usage( IPSPATH ,"\tpath for patch files");
++ print_usage( GCOFFPATH ,"\tpath to GCOffline (offline version of Genesis Collective)");
++ print_usage( GENSMANPATH ,"path to Gens manual");
++ print_usage( GENBIOS ,"\tpath to the Genesis bios");
++ print_usage( USABIOS ,"\tpath to the USA Sega CD bios");
++ print_usage( EURBIOS ,"\tpath to the European Sega CD bios");
++ print_usage( JAPBIOS ,"\tpath to the Japanese Sega CD bios");
++ print_usage( _32X68kBIOS ,"\tpath to the 32X 68k bios");
++ print_usage( _32XMBIOS ,"\tpath to the 32X Master bios");
++ print_usage( _32XSBIOS ,"\tpath to the 32X Slave bios");
++ print_usage( CONTRAST ,"\tadjust contrast up to (0-200, default 100)");
++ print_usage( BRIGHTNESS ,"\tadjust brightness up to (0-200, default 100)");
++ print_usage( FS ,"\t\trun the emulator full screen (0/1)");
++ print_usage( FSMODE ,"\trendering mode for full screen (1-11)\n\t\t\t 0 - normal\t\t 6 - interpolated scanline\n\t\t\t 1 - double\t\t 7 - interpolated 50%% scanline\n\t\t\t 2 - interpolated\t 8 - interpolated 25%% scanline\n\t\t\t 3 - scanline\t\t 9 - 2xSAI (Kreed)\n\t\t\t 4 - 50%% scanline\t 10 - Scale2x\n\t\t\t 5 - 25%% scanline\t 11 - Hq2x");
++ print_usage( WINDOW ,"\trun the emulator in a window (0/1)");
++ print_usage( WINDOWMODE ,"\trendering mode for window (0-11)\n\t\t\t same options as fs-mode");
++ print_usage( FRAMESKIP ,"\tskip frames at this relative rate, useful on slower cpus (0-8, -1 auto)");
++ print_usage( SOUNDRATE ,"\tthe sound sampling rate (11025, 22050, 44100)");
++ print_usage( MSH2SPEED ,"\tmaster SH2 speed (0-200, default 100)");
++ print_usage( SSH2SPEED ,"\tslave SH2 speed (0-200, default 100)");
++ print_usage( RAMCARTSIZE ,"\tSega CD SRAM size (-1 = none, 0 = 8k, 1 = 16k, 2 = 32k, 3 = 64k)");
++ print_usage( QUICKEXIT ,"\tmake the ESC key exit Gens instead of pause (0/1)");
++ fprintf (stderr, "\n");
++
++ print_usage2( STRETCH,"\tstretch mode");
++ print_usage2( SWBLIT,"\tsoftware blitting");
++ print_usage2( GREYSCALE,"\tdisplay in greyscale mode");
++ print_usage2( INVERT,"\tdisplay colors inverted");
++ print_usage2( SPRITELIMIT,"limit the number of sprites on screen");
++ print_usage2( SOUND,"\tsound is to be enabled");
++ print_usage2( STEREO,"stereo sound is to be enabled");
++ print_usage2( Z80,"\tZ80 sound processor");
++ print_usage2( YM2612,"\tYM2612 sound chip");
++ print_usage2( PSG,"\tPSG 76489 sound chip");
++ print_usage2( DAC,"\tpart of YM2612 chip");
++ print_usage2( PCM,"\tsound chip for Sega CD");
++ print_usage2( PWM,"\t10-channel PWM mixing for 32X");
++ print_usage2( CDDA,"\tCDDA data access mode for Sega CD");
+ print_usage2( PSGIMPROVED,"");
+ print_usage2( YMIMPROVED,"");
+ print_usage2( DACIMPROVED,"");
+- print_usage2( PERFECTSYNC,"");
+- print_usage2( FASTBLUR,"");
+- print_usage2( FPS,"");
+- print_usage2( MSG,"");
+- print_usage2( LED,"");
+- print_usage2( FIXCHKSUM,"");
+- print_usage2( AUTOPAUSE,"");
++ print_usage2( PERFECTSYNC,"synch main and sub CPUs for Sega CD");
++ print_usage2( FASTBLUR,"\tmode to simulate output to tv");
++ print_usage2( FPS,"\tFPS display");
++ print_usage2( MSG,"\tGens system messages");
++ print_usage2( LED,"\tSega CD power and access LEDs");
++ print_usage2( FIXCHKSUM,"\ttoggle that may fix red screen checksum errors");
++ print_usage2( AUTOPAUSE,"\tset gens to pause when screen loses focus");
+
+ exit (0);
+ }
+@@ -184,6 +189,7 @@
+ {AUTOPAUSE1, no_argument, 0, 0},
+ {AUTOPAUSE0, no_argument, 0, 0},
+ {RAMCARTSIZE, required_argument, 0, 0},
++ {QUICKEXIT, no_argument, 0, 0},
+ {HELP, no_argument, 0, 0},
+ {0, 0, 0, 0}
+ };
+@@ -499,6 +505,10 @@
+ {
+ BRAM_Ex_Size = strtol (optarg, (char **) NULL, 10);
+ }
++ else if (!strcmp (long_options[option_index].name, QUICKEXIT))
++ {
++ Quick_Exit = 1;
++ }
+ else if (!strcmp (long_options[option_index].name, HELP))
+ {
+ _usage();
+@@ -510,6 +520,12 @@
+
+ if (optind < argc)
+ {
++ //The first non ARGV element is the romfile parameter
++ strcpy (Rom_Name, argv[optind++]);
++ }
++
++ if (optind < argc)
++ {
+ printf ("non-option ARGV-elements: ");
+ while (optind < argc)
+ printf ("%s ", argv[optind++]);
+--- old/src/gens/sdllayer/g_sdlinput.h 2004-05-18 16:45:07.000000000 -0400
++++ new/src/gens/sdllayer/g_sdlinput.h 2006-12-30 12:47:40.000000000 -0500
+@@ -28,7 +28,7 @@
+ void open_joystick();
+ void close_joystick();
+
+-extern SDL_Joystick* joy[2];
++extern SDL_Joystick* joy[6];
+
+ #define CHECK_BUTTON(player, ctrl, button) \
+ if (Check_Key_Pressed(Keys_Def[player].button)) \
+--- old/src/gens/sdllayer/g_sdlinput.c 2004-05-18 16:46:01.000000000 -0400
++++ new/src/gens/sdllayer/g_sdlinput.c 2006-12-30 12:43:35.000000000 -0500
+@@ -16,7 +16,7 @@
+ unsigned char Keys[1024];
+
+ unsigned char Kaillera_Keys[16];
+-unsigned char joystate[0x80 + 0x100 + 0x10 * 3 + 0x4];
++unsigned char joystate[0x530];
+
+ struct K_Def Keys_Def[8] = {
+ {SDLK_RETURN, SDLK_RSHIFT,
+@@ -29,7 +29,7 @@
+ SDLK_y, SDLK_h, SDLK_g, SDLK_j}
+ };
+
+-SDL_Joystick *joy[2] = { NULL, NULL };
++SDL_Joystick *joy[6] = { NULL, NULL, NULL, NULL, NULL, NULL };
+
+ void
+ End_Input ()
+@@ -40,28 +40,32 @@
+ void
+ open_joystick ()
+ {
++ int Cur_Joy = 0;
+ Nb_Joys = 0;
+ SDL_JoystickEventState (SDL_ENABLE);
+- joy[0] = SDL_JoystickOpen (0);
+- if (joy[0])
+- Nb_Joys++;
+- joy[1] = SDL_JoystickOpen (1);
+- if (joy[1])
++
++ while (Cur_Joy < 6)
++ {
++ joy[Cur_Joy] = SDL_JoystickOpen (Cur_Joy);
++ if (joy[Cur_Joy])
+ Nb_Joys++;
++ Cur_Joy++;
++ }
+ }
+
+ void
+ close_joystick ()
+ {
+- if (SDL_JoystickOpened (0))
++ int Cur_Joy = 0;
++
++ while (Cur_Joy < 6)
+ {
+- SDL_JoystickClose (joy[0]);
+- joy[0] = NULL;
+- }
+- if (SDL_JoystickOpened (1))
++ if (SDL_JoystickOpened (Cur_Joy))
+ {
+- SDL_JoystickClose (joy[1]);
+- joy[1] = NULL;
++ SDL_JoystickClose (joy[Cur_Joy]);
++ joy[Cur_Joy] = NULL;
++ }
++ Cur_Joy++;
+ }
+ }
+
+@@ -95,7 +99,7 @@
+ {
+ Num_Joy = ((key >> 8) & 0xF);
+
+- if ((Num_Joy < 2) && joy[Num_Joy])
++ if ((Num_Joy < 6) && joy[Num_Joy])
+ {
+ if (key & 0x80) // Test POV Joys
+ {
+@@ -146,6 +150,46 @@
+ if (joystate[0x100 * Num_Joy + 0x4])
+ return 1;
+ break;
++
++ case 5:
++ if (joystate[0x100 * Num_Joy + 0x5])
++ return 1;
++ break;
++
++ case 6:
++ if (joystate[0x100 * Num_Joy + 0x6])
++ return 1;
++ break;
++
++ case 7:
++ if (joystate[0x100 * Num_Joy + 0x7])
++ return 1;
++ break;
++
++ case 8:
++ if (joystate[0x100 * Num_Joy + 0x8])
++ return 1;
++ break;
++
++ case 9:
++ if (joystate[0x100 * Num_Joy + 0x9])
++ return 1;
++ break;
++
++ case 10:
++ if (joystate[0x100 * Num_Joy + 0xA])
++ return 1;
++ break;
++
++ case 11:
++ if (joystate[0x100 * Num_Joy + 0xB])
++ return 1;
++ break;
++
++ case 12:
++ if (joystate[0x100 * Num_Joy + 0xC])
++ return 1;
++ break;
+ }
+ }
+ }
+@@ -437,11 +481,15 @@
+ {
+ GdkEvent *event;
+ SDL_Event sdl_event;
+- SDL_Joystick *js[2];
++ SDL_Joystick *js[6];
+ SDL_JoystickEventState (SDL_ENABLE);
+
+ js[0] = SDL_JoystickOpen (0);
+ js[1] = SDL_JoystickOpen (1);
++ js[2] = SDL_JoystickOpen (2);
++ js[3] = SDL_JoystickOpen (3);
++ js[4] = SDL_JoystickOpen (4);
++ js[5] = SDL_JoystickOpen (5);
+
+ while (gtk_events_pending ())
+ gtk_main_iteration ();
+@@ -453,19 +501,73 @@
+ switch (sdl_event.type)
+ {
+ case SDL_JOYAXISMOTION:
+- if (sdl_event.jaxis.value < -500)
++ if (sdl_event.jaxis.value < -10000)
++ {
++ if (sdl_event.jaxis.axis == 0)
++ {
++ return (0x1000 +
++ (0x100 * sdl_event.jaxis.which + 0x3));
++ }
++ else if (sdl_event.jaxis.axis == 1)
++ {
++ return (0x1000 +
++ (0x100 * sdl_event.jaxis.which + 0x1));
++ }
++ else if (sdl_event.jaxis.axis == 2)
+ {
+ return (0x1000 +
+- (0x100 * sdl_event.jaxis.which +
+- ((sdl_event.jaxis.axis == 0) ? 0x3 : 0x1)));
++ (0x100 * sdl_event.jaxis.which + 0x7));
+ }
+- else if (sdl_event.jaxis.value > 500)
++ else if (sdl_event.jaxis.axis == 3)
+ {
+ return (0x1000 +
+- (0x100 * sdl_event.jaxis.which +
+- ((sdl_event.jaxis.axis == 0) ? 0x4 : 0x2)));
++ (0x100 * sdl_event.jaxis.which + 0x5));
+ }
+- else if (sdl_event.jaxis.value == 0)
++ else if (sdl_event.jaxis.axis == 4)
++ {
++ return (0x1000 +
++ (0x100 * sdl_event.jaxis.which + 0xB));
++ }
++ else if (sdl_event.jaxis.axis == 5)
++ {
++ return (0x1000 +
++ (0x100 * sdl_event.jaxis.which + 0x9));
++ }
++ }
++ else if (sdl_event.jaxis.value > 10000)
++ {
++ if (sdl_event.jaxis.axis == 0)
++ {
++ return (0x1000 +
++ (0x100 * sdl_event.jaxis.which + 0x4));
++ }
++ else if (sdl_event.jaxis.axis == 1)
++ {
++ return (0x1000 +
++ (0x100 * sdl_event.jaxis.which + 0x2));
++ }
++ else if (sdl_event.jaxis.axis == 2)
++ {
++ return (0x1000 +
++ (0x100 * sdl_event.jaxis.which + 0x8));
++ }
++ else if (sdl_event.jaxis.axis == 3)
++ {
++ return (0x1000 +
++ (0x100 * sdl_event.jaxis.which + 0x6));
++ }
++ else if (sdl_event.jaxis.axis == 4)
++ {
++ return (0x1000 +
++ (0x100 * sdl_event.jaxis.which + 0xC));
++ }
++ else if (sdl_event.jaxis.axis == 5)
++ {
++ return (0x1000 +
++ (0x100 * sdl_event.jaxis.which + 0xA));
++ }
++ }
++ else
+ {
+ return (Get_Key ());
+ }
+--- old/src/gens/util/rom.h 2004-03-14 09:33:06.000000000 -0500
++++ new/src/gens/util/rom.h 2006-12-30 17:30:58.000000000 -0500
+@@ -52,7 +52,7 @@
+ int Detect_Format(char *Name);
+
+ int Get_Rom(void);
+-
++int Open_Rom(char *Name);
+ int Pre_Load_Rom(char *Name);
+ int Load_Rom_CC(char *Name, int Size);
+ struct Rom *Load_Bios(char *Name);
+--- old/src/gens/util/rom.c 2004-05-18 16:33:59.000000000 -0400
++++ new/src/gens/util/rom.c 2007-01-05 13:23:45.596482516 -0500
+@@ -99,7 +99,7 @@
+ void
+ Update_Rom_Dir (char *Path)
+ {
+- Get_Dir_From_Path (Path, Rom_Dir);
++ sprintf (Rom_Dir, "%s", Path);;
+ }
+
+
+@@ -390,11 +390,10 @@
+ gint res;
+ char Name[2048];
+ gchar *filename;
+- int sys;
+
+ widget =
+ create_file_chooser_dialog ("Open Rom", GTK_FILE_CHOOSER_ACTION_OPEN);
+-// fileselection_set_dir (fd.filesel, Rom_Dir);
++ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER(widget), Rom_Dir);
+ addRomsFilter (widget);
+ res = gtk_dialog_run (GTK_DIALOG (widget));
+ if (res == GTK_RESPONSE_OK)
+@@ -407,6 +406,15 @@
+ g_free (filename);
+ Free_Rom (Game);
+
++ return Open_Rom(Name);
++
++}
++
++int
++Open_Rom(char *Name)
++{
++ int sys;
++
+ sys = Detect_Format (Name);
+
+ if (sys < 1)
+@@ -458,6 +466,7 @@
+ break;
+ }
+ return -1;
++
+ }
+
+ int
+--- old/src/gens/gtkui/glade/interface.c 2004-05-19 15:49:28.000000000 -0400
++++ new/src/gens/gtkui/glade/interface.c 2007-01-03 13:13:28.113596925 -0500
+@@ -1825,7 +1825,7 @@
+ gtk_widget_show (image1);
+ gtk_box_pack_start (GTK_BOX (hbox1), image1, TRUE, TRUE, 0);
+
+- label1 = gtk_label_new ("Gens for Linux\nversion 2.12-rc3\n\nSega Genesis / Megadrive,\nSega CD / Mega CD,\nSega 32X emulator");
++ label1 = gtk_label_new ("Gens for Linux\nversion 2.12-mythgame\n\nSega Genesis / Megadrive,\nSega CD / Mega CD,\nSega 32X emulator");
+ gtk_widget_set_name (label1, "label1");
+ gtk_widget_show (label1);
+ gtk_box_pack_start (GTK_BOX (hbox1), label1, FALSE, FALSE, 0);
diff --git a/games-emulation/gens/gens-2.12b.ebuild b/games-emulation/gens/gens-2.12b.ebuild
new file mode 100644
index 0000000..c81a780
--- /dev/null
+++ b/games-emulation/gens/gens-2.12b.ebuild
@@ -0,0 +1,49 @@
+# v-fox's private overlay: dfx.homeftp.net
+
+inherit flag-o-matic eutils games
+
+DESCRIPTION="A Sega Genesis/CD/32X emulator"
+HOMEPAGE="http://gens.consolemul.com/"
+
+SRC_URI="mirror://sourceforge/gens/gens-rc3.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 x86"
+IUSE="vanilla"
+
+RDEPEND="x86? ( >=x11-libs/gtk+-2.4
+ >=media-libs/libsdl-1.2 )
+ amd64? ( app-emulation/emul-linux-x86-sdl
+ app-emulation/emul-linux-x86-gtklibs )"
+DEPEND="${RDEPEND}
+ >=dev-lang/nasm-0.98"
+
+S=${WORKDIR}/GensForLinux
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ if use vanilla; then
+ epatch \
+ "${FILESDIR}"/${P}-gcc4.patch \
+ "${FILESDIR}"/${P}-romsdir.patch
+ else
+ epatch \
+ "${FILESDIR}"/gens-rc3_to_mythgame.patch
+ fi
+ append-ldflags -Wl,-z,noexecstack
+}
+
+src_compile() {
+ use amd64 && multilib_toolchain_setup x86
+ egamesconf \
+ $(use_enable x86 gtktest) || die # shut up and eat emul-linux-x86-gtklibs
+ emake || die "emake failed"
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die "make install failed"
+ dodoc AUTHORS BUGS README gens.txt history.txt
+ prepgamesdirs
+}
diff --git a/games-emulation/pcsx2/files/pcsx2-0.9.4-add-nls.patch b/games-emulation/pcsx2/files/pcsx2-0.9.4-add-nls.patch
new file mode 100644
index 0000000..7add9fa
--- /dev/null
+++ b/games-emulation/pcsx2/files/pcsx2-0.9.4-add-nls.patch
@@ -0,0 +1,21 @@
+--- configure.ac.old 2008-02-23 22:42:48.751259786 +0000
++++ configure.ac 2008-02-23 22:44:38.140260060 +0000
+@@ -107,7 +107,12 @@
+ AC_CHECK_LIB(stdc++,main,[LIBS="$LIBS -lstdc++"])
+ AC_CHECK_LIB(z,main,[LIBS="$LIBS -lz"])
+
+-AC_CHECK_HEADER([libintl.h], [AC_DEFINE(ENABLE_NLS,1,[__x86_64__])])
++AC_ARG_ENABLE(nls, AC_HELP_STRING([--disable-nls], [Disable nls support]),
++ nls=$enableval,nls=yes)
++if test "x$nls" == xyes
++then
++ AC_CHECK_HEADER([libintl.h], [AC_DEFINE(ENABLE_NLS,1,[__x86_64__])])
++fi
+
+ AC_OUTPUT([
+ Makefile
+@@ -132,3 +137,4 @@
+ echo " Force sse3? $sse3"
+ echo " Recompilers enabled? $recbuild"
+ echo " Virtual memory build? $vmbuild"
++echo " nls support? $nls"
diff --git a/games-emulation/pcsx2/files/pcsx2-0.9.4-custom-cflags.patch b/games-emulation/pcsx2/files/pcsx2-0.9.4-custom-cflags.patch
new file mode 100644
index 0000000..7bc8df3
--- /dev/null
+++ b/games-emulation/pcsx2/files/pcsx2-0.9.4-custom-cflags.patch
@@ -0,0 +1,34 @@
+--- configure.ac.old 2008-03-02 14:49:49.564590000 +0000
++++ configure.ac 2008-03-02 14:52:53.589590315 +0000
+@@ -11,10 +11,9 @@
+ dnl necessary for compiling assembly
+ AM_PROG_AS
+
+-CFLAGS=
+-CPPFLAGS=
+-CXXFLAGS=
+-CCASFLAGS=
++CFLAGS="-O1 -finline-functions ${CFLAGS}"
++CXXFLAGS="-O1 -finline-functions ${CXXFLAGS}"
++CCASFLAGS="-O1 -finline-functions ${CCASFLAGS}"
+
+ dnl Check for debug build
+ AC_MSG_CHECKING(debug build)
+@@ -23,16 +22,10 @@
+ if test "x$debug" == xyes
+ then
+ AC_DEFINE(_DEBUG,1,[_DEBUG])
+- CFLAGS+=" -g "
+- CPPFLAGS+=" -g "
+- CXXFLAGS+=" -g "
+- CCASFLAGS+=" -D_DEBUG -g "
++ CCASFLAGS+=" -D_DEBUG "
+ MYOBJDIR="Debug"
+ else
+ AC_DEFINE(NDEBUG,1,[NDEBUG])
+- CFLAGS+=" -O3 -fomit-frame-pointer "
+- CPPFLAGS+=" -O3 -fomit-frame-pointer "
+- CXXFLAGS+=" -O3 -fomit-frame-pointer "
+ MYOBJDIR="Release"
+ fi
+ AC_MSG_RESULT($debug)
diff --git a/games-emulation/pcsx2/files/pcsx2-0.9.4-plugin-inis.patch b/games-emulation/pcsx2/files/pcsx2-0.9.4-plugin-inis.patch
new file mode 100644
index 0000000..93d3155
--- /dev/null
+++ b/games-emulation/pcsx2/files/pcsx2-0.9.4-plugin-inis.patch
@@ -0,0 +1,15 @@
+--- Linux.old/GtkGui.c 2007-11-19 07:21:55.000000000 +0000
++++ Linux/GtkGui.c 2008-02-25 11:57:37.167773962 +0000
+@@ -723,12 +723,9 @@
+ strcpy(file, Config.PluginsDir); \
+ strcat(file, plugin); \
+ drv = SysLoadLibrary(file); \
+- getcwd(file, ARRAYSIZE(file)); /* store current dir */ \
+- chdir(Config.PluginsDir); /* change dirs so that plugins can find their config file*/ \
+ if (drv == NULL) return; \
+ conf = (src) SysLoadSym(drv, name); \
+ if (SysLibError() == NULL) conf(); \
+- chdir(file); /* change back*/ \
+ SysCloseLibrary(drv);
+
+ #define TestPlugin(src, confs, plugin, name) \
diff --git a/games-emulation/pcsx2/files/pcsx2-add-nls.patch b/games-emulation/pcsx2/files/pcsx2-add-nls.patch
new file mode 100644
index 0000000..7add9fa
--- /dev/null
+++ b/games-emulation/pcsx2/files/pcsx2-add-nls.patch
@@ -0,0 +1,21 @@
+--- configure.ac.old 2008-02-23 22:42:48.751259786 +0000
++++ configure.ac 2008-02-23 22:44:38.140260060 +0000
+@@ -107,7 +107,12 @@
+ AC_CHECK_LIB(stdc++,main,[LIBS="$LIBS -lstdc++"])
+ AC_CHECK_LIB(z,main,[LIBS="$LIBS -lz"])
+
+-AC_CHECK_HEADER([libintl.h], [AC_DEFINE(ENABLE_NLS,1,[__x86_64__])])
++AC_ARG_ENABLE(nls, AC_HELP_STRING([--disable-nls], [Disable nls support]),
++ nls=$enableval,nls=yes)
++if test "x$nls" == xyes
++then
++ AC_CHECK_HEADER([libintl.h], [AC_DEFINE(ENABLE_NLS,1,[__x86_64__])])
++fi
+
+ AC_OUTPUT([
+ Makefile
+@@ -132,3 +137,4 @@
+ echo " Force sse3? $sse3"
+ echo " Recompilers enabled? $recbuild"
+ echo " Virtual memory build? $vmbuild"
++echo " nls support? $nls"
diff --git a/games-emulation/pcsx2/files/pcsx2-custom-cflags.patch b/games-emulation/pcsx2/files/pcsx2-custom-cflags.patch
new file mode 100644
index 0000000..7bc8df3
--- /dev/null
+++ b/games-emulation/pcsx2/files/pcsx2-custom-cflags.patch
@@ -0,0 +1,34 @@
+--- configure.ac.old 2008-03-02 14:49:49.564590000 +0000
++++ configure.ac 2008-03-02 14:52:53.589590315 +0000
+@@ -11,10 +11,9 @@
+ dnl necessary for compiling assembly
+ AM_PROG_AS
+
+-CFLAGS=
+-CPPFLAGS=
+-CXXFLAGS=
+-CCASFLAGS=
++CFLAGS="-O1 -finline-functions ${CFLAGS}"
++CXXFLAGS="-O1 -finline-functions ${CXXFLAGS}"
++CCASFLAGS="-O1 -finline-functions ${CCASFLAGS}"
+
+ dnl Check for debug build
+ AC_MSG_CHECKING(debug build)
+@@ -23,16 +22,10 @@
+ if test "x$debug" == xyes
+ then
+ AC_DEFINE(_DEBUG,1,[_DEBUG])
+- CFLAGS+=" -g "
+- CPPFLAGS+=" -g "
+- CXXFLAGS+=" -g "
+- CCASFLAGS+=" -D_DEBUG -g "
++ CCASFLAGS+=" -D_DEBUG "
+ MYOBJDIR="Debug"
+ else
+ AC_DEFINE(NDEBUG,1,[NDEBUG])
+- CFLAGS+=" -O3 -fomit-frame-pointer "
+- CPPFLAGS+=" -O3 -fomit-frame-pointer "
+- CXXFLAGS+=" -O3 -fomit-frame-pointer "
+ MYOBJDIR="Release"
+ fi
+ AC_MSG_RESULT($debug)
diff --git a/games-emulation/pcsx2/files/pcsx2-gcc43.patch b/games-emulation/pcsx2/files/pcsx2-gcc43.patch
new file mode 100644
index 0000000..34b89b8
--- /dev/null
+++ b/games-emulation/pcsx2/files/pcsx2-gcc43.patch
@@ -0,0 +1,12 @@
+diff -Nur pcsx2.orig/GS.cpp pcsx2/GS.cpp
+--- pcsx2.orig/GS.cpp 2008-06-03 14:26:12.000000000 +0200
++++ pcsx2/GS.cpp 2008-06-03 14:29:17.000000000 +0200
+@@ -28,6 +28,8 @@
+
+ #include <vector>
+ #include <list>
++#include <cstring>
++#include <cstdlib>
+
+ using namespace std;
+
diff --git a/games-emulation/pcsx2/files/pcsx2-plugin-inis.patch b/games-emulation/pcsx2/files/pcsx2-plugin-inis.patch
new file mode 100644
index 0000000..93d3155
--- /dev/null
+++ b/games-emulation/pcsx2/files/pcsx2-plugin-inis.patch
@@ -0,0 +1,15 @@
+--- Linux.old/GtkGui.c 2007-11-19 07:21:55.000000000 +0000
++++ Linux/GtkGui.c 2008-02-25 11:57:37.167773962 +0000
+@@ -723,12 +723,9 @@
+ strcpy(file, Config.PluginsDir); \
+ strcat(file, plugin); \
+ drv = SysLoadLibrary(file); \
+- getcwd(file, ARRAYSIZE(file)); /* store current dir */ \
+- chdir(Config.PluginsDir); /* change dirs so that plugins can find their config file*/ \
+ if (drv == NULL) return; \
+ conf = (src) SysLoadSym(drv, name); \
+ if (SysLibError() == NULL) conf(); \
+- chdir(file); /* change back*/ \
+ SysCloseLibrary(drv);
+
+ #define TestPlugin(src, confs, plugin, name) \
diff --git a/games-emulation/pcsx2/pcsx2-0.9.4.ebuild b/games-emulation/pcsx2/pcsx2-0.9.4.ebuild
new file mode 100644
index 0000000..904150d
--- /dev/null
+++ b/games-emulation/pcsx2/pcsx2-0.9.4.ebuild
@@ -0,0 +1,140 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit games autotools eutils flag-o-matic
+
+DESCRIPTION="PlayStation2 emulator"
+HOMEPAGE="http://www.pcsx2.net/"
+SRC_URI="mirror://sourceforge/pcsx2/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="alsa debug devbuild nls oss vmbuild"
+
+CDEPEND="sys-libs/zlib
+ >=x11-libs/gtk+-2"
+
+DEPEND="${CDEPEND}
+ x11-proto/xproto"
+
+RDEPEND="${CDEPEND}
+ games-emulation/ps2emu-zerogs
+ games-emulation/ps2emu-zeropad
+ games-emulation/ps2emu-cdvdnull
+ games-emulation/ps2emu-dev9null
+ games-emulation/ps2emu-spu2null
+ games-emulation/ps2emu-fwnull
+ >=games-emulation/ps2emu-usbnull-0.4-r1
+ alsa? ( games-emulation/ps2emu-peopsspu2 )
+ oss? ( games-emulation/ps2emu-peopsspu2 )"
+
+LANGS="ar bg cz de du el es fr hb it ja pe pl po po_BR ro ru sh sw tc tr"
+
+for i in ${LANGS}; do
+ IUSE="${IUSE} linguas_${i}"
+done
+
+S="${WORKDIR}/${P}/${PN}"
+
+pkg_setup() {
+ local x
+
+ if ! use nls; then
+ for x in ${LANGS}; do
+ if [ -n "$(usev linguas_${x})" ]; then
+ eerror "Any language other than English is not supported with USE=\"-nls\""
+ die "Language ${x} not supported with USE=\"-nls\""
+ fi
+ done
+ fi
+
+ if use vmbuild; then
+ ewarn "Warning: Compilation is known to fail with the vmbuild use flag"
+ ewarn "enabled. The recommended use flags are USE=\"sse2 -vmbuild\"."
+ ewarn "Do not file a bug unless you are using the above USE flags."
+ ewarn "If you can get it to compile however, please file a bug or "
+ ewarn "contact me at eatnumber1@gmail.com. (i'll give you a cookie)"
+ ebeep 5
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ # Preserve custom CFLAGS passed to configure.
+ epatch "${FILESDIR}"/${PN}-custom-cflags.patch
+
+ # Add nls support to the configure script.
+ epatch "${FILESDIR}"/${PN}-add-nls.patch
+
+ # Allow plugin inis to be stored in ~/.pcsx2/inis.
+ epatch "${FILESDIR}"/${PN}-plugin-inis.patch
+
+ epatch "${FILESDIR}"/${PN}-gcc43.patch
+
+ eautoreconf -v --install || die
+}
+
+src_compile() {
+ local myconf
+ filter-flags -O0
+
+ if ! use x86 && ! use amd64; then
+ einfo "Recompiler not supported on this architecture. Disabling."
+ myconf=" --disable-recbuild"
+ fi
+
+ egamesconf \
+ $(use_enable devbuild) \
+ $(use_enable debug) \
+ $(use_enable nls) \
+ $(use_enable vmbuild) \
+ ${myconf} \
+ || die
+
+ emake || die
+}
+
+src_install() {
+ local x
+
+ keepdir "`games_get_libdir`/ps2emu/plugins"
+ dodoc Docs/*.txt || die "dodoc failed"
+ newgamesbin Linux/${PN} ${PN}.bin || die
+
+ sed \
+ -e "s:%GAMES_BINDIR%:${GAMES_BINDIR}:" \
+ -e "s:%GAMES_DATADIR%:${GAMES_DATADIR}:" \
+ -e "s:%GAMES_LIBDIR%:`games_get_libdir`:" \
+ "${FILESDIR}/${PN}" > "${D}${GAMES_BINDIR}/${PN}" || die
+
+ cd ../bin
+ dohtml -r compat_list/* || die
+ insinto "${GAMES_DATADIR}/${PN}"
+ doins -r *.xml .pixmaps patches || die
+ insinto "${GAMES_DATADIR}/${PN}/Langs"
+
+ for x in ${LANGS}; do
+ if use linguas_${x}; then
+ [[ "${x/_/}" == "${x}" ]] && x=${x}_`echo ${x} | tr 'a-z' 'A-Z'`
+ doins -r Langs/${x} || die "doins for language ${x} failed"
+ fi
+ done
+
+ prepgamesdirs
+}
+
+pkg_postinst() {
+ if ! use devbuild; then
+ ewarn "If this package exhibits random crashes, recompile ${PN}"
+ ewarn "with the devbuild use flag enabled. If that fixes it, file a bug."
+ echo
+ fi
+
+ elog "Please note that this ebuild does not install all the available plugins."
+ elog "You will need to install other ps2emu plugins in order for the emulator"
+ elog "to be usable."
+}
diff --git a/games-emulation/pcsx2/pcsx2-9999.ebuild b/games-emulation/pcsx2/pcsx2-9999.ebuild
new file mode 100644
index 0000000..3a28c63
--- /dev/null
+++ b/games-emulation/pcsx2/pcsx2-9999.ebuild
@@ -0,0 +1,142 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+ESVN_REPO_URI="https://pcsx2.svn.sourceforge.net/svnroot/${PN}/${PN}"
+inherit games autotools eutils flag-o-matic subversion
+
+DESCRIPTION="PlayStation2 emulator"
+HOMEPAGE="http://www.pcsx2.net/"
+SVN_PCSX2_BINDIR="https://pcsx2.svn.sourceforge.net/svnroot/${PN}/bin"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="alsa debug devbuild nls oss vmbuild"
+
+CDEPEND="sys-libs/zlib
+ >=x11-libs/gtk+-2"
+
+DEPEND="${CDEPEND}
+ x11-proto/xproto"
+
+RDEPEND="${CDEPEND}
+ games-emulation/ps2emu-zerogs
+ games-emulation/ps2emu-zeropad
+ games-emulation/ps2emu-cdvdnull
+ games-emulation/ps2emu-dev9null
+ games-emulation/ps2emu-spu2null
+ games-emulation/ps2emu-fwnull
+ >=games-emulation/ps2emu-usbnull-0.4-r1
+ alsa? ( games-emulation/ps2emu-peopsspu2 )
+ oss? ( games-emulation/ps2emu-peopsspu2 )"
+
+LANGS="ar bg cz de du el es fr hb it ja pe pl po po_BR ro ru sh sw tc tr"
+
+for i in ${LANGS}; do
+ IUSE="${IUSE} linguas_${i}"
+done
+
+S="${WORKDIR}/${P}/${PN}"
+
+pkg_setup() {
+ local x
+
+ if ! use nls; then
+ for x in ${LANGS}; do
+ if [ -n "$(usev linguas_${x})" ]; then
+ eerror "Any language other than English is not supported with USE=\"-nls\""
+ die "Language ${x} not supported with USE=\"-nls\""
+ fi
+ done
+ fi
+
+ if use vmbuild; then
+ ewarn "Warning: Compilation is known to fail with the vmbuild use flag"
+ ewarn "enabled. The recommended use flags are USE=\"sse2 -vmbuild\"."
+ ewarn "Do not file a bug unless you are using the above USE flags."
+ ewarn "If you can get it to compile however, please file a bug or "
+ ewarn "contact me at eatnumber1@gmail.com. (i'll give you a cookie)"
+ ebeep 5
+ fi
+}
+
+src_unpack() {
+ subversion_src_unpack
+ subversion_fetch ${SVN_PCSX2_BINDIR} "../bin"
+ cd "${S}"
+
+ # Preserve custom CFLAGS passed to configure.
+ epatch "${FILESDIR}"/${PN}-custom-cflags.patch
+
+ # Add nls support to the configure script.
+ epatch "${FILESDIR}"/${PN}-add-nls.patch
+
+ # Allow plugin inis to be stored in ~/.pcsx2/inis.
+ epatch "${FILESDIR}"/${PN}-plugin-inis.patch
+
+ epatch "${FILESDIR}"/${PN}-gcc43.patch
+
+ eautoreconf -v --install || die
+}
+
+src_compile() {
+ local myconf
+ filter-flags -O0
+
+ if ! use x86 && ! use amd64; then
+ einfo "Recompiler not supported on this architecture. Disabling."
+ myconf=" --disable-recbuild"
+ fi
+
+ egamesconf \
+ $(use_enable devbuild) \
+ $(use_enable debug) \
+ $(use_enable nls) \
+ $(use_enable vmbuild) \
+ ${myconf} \
+ || die
+
+ emake || die
+}
+
+src_install() {
+ local x
+
+ keepdir "$(games_get_libdir)/ps2emu/plugins"
+ dodoc Docs/*.txt || die "dodoc failed"
+ newgamesbin Linux/${PN} ${PN}.bin || die
+
+ sed \
+ -e "s:%GAMES_BINDIR%:${GAMES_BINDIR}:" \
+ -e "s:%GAMES_DATADIR%:${GAMES_DATADIR}:" \
+ -e "s:%GAMES_LIBDIR%:$(games_get_libdir):" \
+ "${FILESDIR}/${PN}" > "${D}${GAMES_BINDIR}/${PN}" || die
+
+ cd ../bin
+ dohtml -r compat_list/* || die
+ insinto "${GAMES_DATADIR}/${PN}"
+ doins -r *.xml .pixmaps patches || die
+ insinto "${GAMES_DATADIR}/${PN}/Langs"
+
+ for x in ${LANGS}; do
+ if use linguas_${x}; then
+ [[ "${x/_/}" == "${x}" ]] && x=${x}_$(echo ${x} | tr 'a-z' 'A-Z')
+ doins -r Langs/${x} || die "doins for language ${x} failed"
+ fi
+ done
+
+ prepgamesdirs
+}
+
+pkg_postinst() {
+ if ! use devbuild; then
+ ewarn "If this package exhibits random crashes, recompile ${PN}"
+ ewarn "with the devbuild use flag enabled. If that fixes it, file a bug."
+ echo
+ fi
+
+ elog "Please note that this ebuild does not install all the available plugins."
+ elog "You will need to install other ps2emu plugins in order for the emulator"
+ elog "to be usable."
+}
diff --git a/games-emulation/ps2emu-cdvdiso/ps2emu-cdvdiso-0.7.ebuild b/games-emulation/ps2emu-cdvdiso/ps2emu-cdvdiso-0.7.ebuild
new file mode 100644
index 0000000..e0ad8c0
--- /dev/null
+++ b/games-emulation/ps2emu-cdvdiso/ps2emu-cdvdiso-0.7.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit games
+
+PCSX2="pcsx2-0.9.4"
+
+DESCRIPTION="PS2Emu ISO CDVD plugin"
+HOMEPAGE="http://www.pcsx2.net/"
+SRC_URI="mirror://sourceforge/pcsx2/${PCSX2}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="app-arch/bzip2
+ sys-libs/zlib
+ >=x11-libs/gtk+-2"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${PCSX2}/plugins/cdvd/CDVDiso/src/Linux"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e '/\bstrip\b/d' \
+ -e 's/-g\b//g' \
+ -e 's/CFLAGS =/CFLAGS +=/' \
+ Makefile || die
+}
+
+src_install() {
+ exeinto "`games_get_libdir`/ps2emu/plugins"
+ newexe libCDVDiso.so libCDVDiso.so.${PV} || die
+ exeinto "`games_get_libdir`/ps2emu/plugins/cfg"
+ doexe cfgCDVDiso || die
+ dodoc ../../ReadMe.txt || die
+ prepgamesdirs
+}
diff --git a/games-emulation/ps2emu-cdvdiso/ps2emu-cdvdiso-9999.ebuild b/games-emulation/ps2emu-cdvdiso/ps2emu-cdvdiso-9999.ebuild
new file mode 100644
index 0000000..ba732c2
--- /dev/null
+++ b/games-emulation/ps2emu-cdvdiso/ps2emu-cdvdiso-9999.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+ESVN_REPO_URI="https://pcsx2.svn.sourceforge.net/svnroot/pcsx2/plugins/cdvd/CDVDiso"
+inherit eutils games subversion
+
+DESCRIPTION="PS2Emu ISO CDVD plugin"
+HOMEPAGE="http://www.pcsx2.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="doc"
+
+DEPEND=">=app-arch/bzip2-1.0.0
+ >=sys-libs/zlib-1.1.3
+ >=x11-libs/gtk+-1.2.5"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/CDVDiso"
+
+src_unpack() {
+ subversion_src_unpack
+ S="${S}/src/Linux"
+ cd "${S}"
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e '/\bstrip\b/d' \
+ -e 's/-g\b//g' \
+ -e 's/CFLAGS =/CFLAGS +=/' \
+ Makefile || die
+}
+
+src_install() {
+ exeinto "$(games_get_libdir)/ps2emu/plugins"
+ doexe libCDVDiso.so || die
+ exeinto "$(games_get_libdir)/ps2emu/plugins/cfg"
+ doexe cfgCDVDiso || die
+ use doc && dodoc ../../ReadMe.txt || die
+ prepgamesdirs
+}
diff --git a/games-emulation/ps2emu-cdvdlinuz/ps2emu-cdvdlinuz-0.4.ebuild b/games-emulation/ps2emu-cdvdlinuz/ps2emu-cdvdlinuz-0.4.ebuild
new file mode 100644
index 0000000..d533fb7
--- /dev/null
+++ b/games-emulation/ps2emu-cdvdlinuz/ps2emu-cdvdlinuz-0.4.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit games
+
+PCSX2="pcsx2-0.9.4"
+
+DESCRIPTION="PS2Emu CDVD plugin"
+HOMEPAGE="http://www.pcsx2.net/"
+SRC_URI="mirror://sourceforge/pcsx2/${PCSX2}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="app-arch/bzip2
+ sys-libs/zlib
+ >=x11-libs/gtk+-2"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${PCSX2}/plugins/cdvd/CDVDlinuz/Src/Linux"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e '/\bstrip\b/d' \
+ -e 's/-O[0-9]\b//g' \
+ -e 's/-fomit-frame-pointer\b//g' \
+ -e 's/-fPIC/$(CFLAGS) -fPIC/g' \
+ Makefile || die
+}
+
+src_install() {
+ exeinto "`games_get_libdir`/ps2emu/plugins"
+ newexe libCDVDlinuz.so libCDVDlinuz.so.${PV} || die
+ exeinto "`games_get_libdir`/ps2emu/plugins/cfg"
+ doexe cfgCDVDlinuz || die
+ dodoc ../../readme.txt ../../ChangeLog.txt || die
+ prepgamesdirs
+}
diff --git a/games-emulation/ps2emu-cdvdlinuz/ps2emu-cdvdlinuz-9999.ebuild b/games-emulation/ps2emu-cdvdlinuz/ps2emu-cdvdlinuz-9999.ebuild
new file mode 100644
index 0000000..c02b4af
--- /dev/null
+++ b/games-emulation/ps2emu-cdvdlinuz/ps2emu-cdvdlinuz-9999.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+ESVN_REPO_URI="https://pcsx2.svn.sourceforge.net/svnroot/pcsx2/plugins/cdvd/CDVDlinuz"
+inherit eutils games subversion
+
+DESCRIPTION="PS2Emu CDVD plugin"
+HOMEPAGE="http://www.pcsx2.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="doc"
+
+DEPEND="app-arch/bzip2
+ sys-libs/zlib
+ >=x11-libs/gtk+-2"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/CDVDlinuz"
+
+src_unpack() {
+ subversion_src_unpack
+ S="${S}/Src/Linux"
+ cd "${S}"
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e '/\bstrip\b/d' \
+ -e 's/-O[0-9]\b//g' \
+ -e 's/-fomit-frame-pointer\b//g' \
+ -e 's/-fPIC/$(CFLAGS) -fPIC/g' \
+ Makefile || die
+}
+
+src_install() {
+ exeinto "$(games_get_libdir)/ps2emu/plugins"
+ doexe libCDVDlinuz.so || die
+ exeinto "$(games_get_libdir)/ps2emu/plugins/cfg"
+ doexe cfgCDVDlinuz || die
+ use doc && dodoc ../../readme.txt ../../ChangeLog.txt || die
+ prepgamesdirs
+}
diff --git a/games-emulation/ps2emu-cdvdnull/ps2emu-cdvdnull-0.6.ebuild b/games-emulation/ps2emu-cdvdnull/ps2emu-cdvdnull-0.6.ebuild
new file mode 100644
index 0000000..473c63b
--- /dev/null
+++ b/games-emulation/ps2emu-cdvdnull/ps2emu-cdvdnull-0.6.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit games
+
+PCSX2="pcsx2-0.9.4"
+
+DESCRIPTION="PS2Emu null CDVD plugin"
+HOMEPAGE="http://www.pcsx2.net/"
+SRC_URI="mirror://sourceforge/pcsx2/${PCSX2}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+S="${WORKDIR}/${PCSX2}/plugins/cdvd/CDVDnull/Src"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e '/\${STRIP}/d' \
+ -e 's/-O[0-9]\b//g' \
+ -e 's/-fomit-frame-pointer\b//g' \
+ -e 's/-ffast-math\b//g' \
+ -e "s/^OPTIMIZE = /OPTIMIZE = ${CFLAGS} /" \
+ Makefile || die
+}
+
+src_install() {
+ exeinto "`games_get_libdir`/ps2emu/plugins"
+ newexe libCDVDnull.so libCDVDnull.so.${PV} || die
+ dodoc ../ReadMe.txt || die
+ prepgamesdirs
+}
diff --git a/games-emulation/ps2emu-cdvdnull/ps2emu-cdvdnull-9999.ebuild b/games-emulation/ps2emu-cdvdnull/ps2emu-cdvdnull-9999.ebuild
new file mode 100644
index 0000000..871efde
--- /dev/null
+++ b/games-emulation/ps2emu-cdvdnull/ps2emu-cdvdnull-9999.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+ESVN_REPO_URI="https://pcsx2.svn.sourceforge.net/svnroot/pcsx2/plugins/cdvd/CDVDnull"
+inherit eutils games subversion
+
+DESCRIPTION="PS2Emu null CDVD plugin"
+HOMEPAGE="http://www.pcsx2.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="doc"
+
+DEPEND=""
+RDEPEND=""
+
+S="${WORKDIR}/CDVDnull"
+
+src_unpack() {
+ subversion_src_unpack
+ S="${S}/Src"
+ cd "${S}"
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e '/\${STRIP}/d' \
+ -e 's/-O[0-9]\b//g' \
+ -e 's/-fomit-frame-pointer\b//g' \
+ -e 's/-ffast-math\b//g' \
+ -e "s/^OPTIMIZE = /OPTIMIZE = ${CFLAGS} /" \
+ Makefile || die
+}
+
+src_install() {
+ exeinto "$(games_get_libdir)/ps2emu/plugins"
+ doexe libCDVDnull.so || die
+ use doc && dodoc ../ReadMe.txt || die
+ prepgamesdirs
+}
diff --git a/games-emulation/ps2emu-dev9null/ps2emu-dev9null-0.3.ebuild b/games-emulation/ps2emu-dev9null/ps2emu-dev9null-0.3.ebuild
new file mode 100644
index 0000000..55ebd64
--- /dev/null
+++ b/games-emulation/ps2emu-dev9null/ps2emu-dev9null-0.3.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit games
+
+PCSX2="pcsx2-0.9.4"
+
+DESCRIPTION="PS2Emu null DEV9 plugin"
+HOMEPAGE="http://www.pcsx2.net/"
+SRC_URI="mirror://sourceforge/pcsx2/${PCSX2}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+S="${WORKDIR}/${PCSX2}/plugins/dev9/dev9null/src"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e '/\bstrip\b/d' \
+ -e 's/-O[0-9]\b//g' \
+ -e 's/-fomit-frame-pointer\b//g' \
+ Makefile || die
+}
+
+src_install() {
+ exeinto "`games_get_libdir`/ps2emu/plugins"
+ newexe libDEV9null.so libDEV9null.so.${PV} || die
+ dodoc ../ReadMe.txt || die
+ prepgamesdirs
+}
diff --git a/games-emulation/ps2emu-dev9null/ps2emu-dev9null-9999.ebuild b/games-emulation/ps2emu-dev9null/ps2emu-dev9null-9999.ebuild
new file mode 100644
index 0000000..080bc55
--- /dev/null
+++ b/games-emulation/ps2emu-dev9null/ps2emu-dev9null-9999.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+ESVN_REPO_URI="https://pcsx2.svn.sourceforge.net/svnroot/pcsx2/plugins/dev9/dev9null"
+inherit eutils games subversion
+
+DESCRIPTION="PS2Emu null DEV9 plugin"
+HOMEPAGE="http://www.pcsx2.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="doc"
+
+DEPEND=""
+RDEPEND=""
+
+S="${WORKDIR}/dev9null"
+
+src_unpack() {
+ subversion_src_unpack
+ S="${S}/src"
+ cd "${S}"
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e '/\bstrip\b/d' \
+ -e 's/-O[0-9]\b//g' \
+ -e 's/-fomit-frame-pointer\b//g' \
+ Makefile || die
+}
+
+src_install() {
+ exeinto "$(games_get_libdir)/ps2emu/plugins"
+ doexe libDEV9null.so || die
+ use doc && dodoc ../ReadMe.txt || die
+ prepgamesdirs
+}
diff --git a/games-emulation/ps2emu-fwnull/ps2emu-fwnull-0.4.ebuild b/games-emulation/ps2emu-fwnull/ps2emu-fwnull-0.4.ebuild
new file mode 100644
index 0000000..4216282
--- /dev/null
+++ b/games-emulation/ps2emu-fwnull/ps2emu-fwnull-0.4.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit games
+
+PCSX2="pcsx2-0.9.4"
+
+DESCRIPTION="PS2Emu null FireWire plugin"
+HOMEPAGE="http://www.pcsx2.net/"
+SRC_URI="mirror://sourceforge/pcsx2/${PCSX2}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=x11-libs/gtk+-2"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${PCSX2}/plugins/fw/FWnull/Linux"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e '/\bstrip\b/d' \
+ -e 's/-O[0-9]\b//g' \
+ -e 's/-fomit-frame-pointer\b//g' \
+ Makefile || die
+}
+
+src_install() {
+ exeinto "`games_get_libdir`/ps2emu/plugins"
+ newexe libFWnull.so libFWnull.so.${PV} || die
+ exeinto "`games_get_libdir`/ps2emu/plugins/cfg"
+ doexe cfgFWnull || die
+ dodoc ../ReadMe.txt || die
+ prepgamesdirs
+}
diff --git a/games-emulation/ps2emu-fwnull/ps2emu-fwnull-9999.ebuild b/games-emulation/ps2emu-fwnull/ps2emu-fwnull-9999.ebuild
new file mode 100644
index 0000000..b68493e
--- /dev/null
+++ b/games-emulation/ps2emu-fwnull/ps2emu-fwnull-9999.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+ESVN_REPO_URI="https://pcsx2.svn.sourceforge.net/svnroot/pcsx2/plugins/fw/FWnull"
+inherit eutils games subversion
+
+DESCRIPTION="PS2Emu null FireWire plugin"
+HOMEPAGE="http://www.pcsx2.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="doc"
+
+DEPEND=">=x11-libs/gtk+-2"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/FWnull"
+
+src_unpack() {
+ subversion_src_unpack
+ S="${S}/Linux"
+ cd "${S}"
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e '/\bstrip\b/d' \
+ -e 's/-O[0-9]\b//g' \
+ -e 's/-fomit-frame-pointer\b//g' \
+ Makefile || die
+}
+
+src_install() {
+ exeinto "$(games_get_libdir)/ps2emu/plugins"
+ doexe libFWnull.so || die
+ exeinto "$(games_get_libdir)/ps2emu/plugins/cfg"
+ doexe cfgFWnull || die
+ use doc && dodoc ../ReadMe.txt || die
+ prepgamesdirs
+}
diff --git a/games-emulation/ps2emu-peopsspu2/ps2emu-peopsspu2-1.9.0.ebuild b/games-emulation/ps2emu-peopsspu2/ps2emu-peopsspu2-1.9.0.ebuild
new file mode 100644
index 0000000..a13e59e
--- /dev/null
+++ b/games-emulation/ps2emu-peopsspu2/ps2emu-peopsspu2-1.9.0.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit games
+
+PCSX2="pcsx2-0.9.4"
+
+DESCRIPTION="P.E.Op.S PS2Emu sound plugin"
+HOMEPAGE="http://www.pcsx2.net/"
+SRC_URI="mirror://sourceforge/pcsx2/${PCSX2}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="alsa oss"
+
+DEPEND="alsa? ( media-libs/alsa-lib )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${PCSX2}/plugins/spu2/PeopsSPU2"
+
+pkg_setup() {
+ if ! use oss && ! use alsa; then
+ die "Either the alsa or oss USE flag must be enabled!"
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e '/\bstrip\b/d' \
+ -e 's/-O[0-9]\b//g' \
+ -e 's/-fomit-frame-pointer\b//g' \
+ -e 's/-ffast-math\b//g' \
+ -e 's/CCFLAGS3 =/CCFLAGS3 = $(CFLAGS)/' \
+ Makefile || die
+}
+
+src_compile() {
+ if use oss; then
+ sed -i 's/USEALSA = .*$/USEALSA = FALSE/' Makefile
+ emake || die
+ fi
+
+ if use alsa; then
+ sed -i 's/USEALSA = .*$/USEALSA = TRUE/' Makefile
+ emake || die
+ fi
+}
+
+src_install() {
+ exeinto "`games_get_libdir`/ps2emu/plugins"
+
+ if use oss; then
+ newexe libspu2PeopsOSS.so.* libspu2PeopsOSS.so.${PV} || die
+ fi
+
+ if use alsa; then
+ newexe libspu2PeopsALSA.so.* libspu2PeopsALSA.so.${PV} || die
+ fi
+
+ prepgamesdirs
+}
diff --git a/games-emulation/ps2emu-peopsspu2/ps2emu-peopsspu2-9999.ebuild b/games-emulation/ps2emu-peopsspu2/ps2emu-peopsspu2-9999.ebuild
new file mode 100644
index 0000000..3dc0589
--- /dev/null
+++ b/games-emulation/ps2emu-peopsspu2/ps2emu-peopsspu2-9999.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+ESVN_REPO_URI="https://pcsx2.svn.sourceforge.net/svnroot/pcsx2/plugins/spu2/PeopsSPU2"
+inherit eutils games subversion
+
+DESCRIPTION="P.E.Op.S PS2Emu sound plugin"
+HOMEPAGE="http://www.pcsx2.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="alsa oss"
+
+DEPEND="alsa? ( media-libs/alsa-lib )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/PeopsSPU2"
+
+pkg_setup() {
+ if ! use oss && ! use alsa; then
+ die "Either the alsa or oss USE flag must be enabled!"
+ fi
+}
+
+src_unpack() {
+ subversion_src_unpack
+ cd "${S}"
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e '/\bstrip\b/d' \
+ -e 's/-O[0-9]\b//g' \
+ -e 's/-fomit-frame-pointer\b//g' \
+ -e 's/-ffast-math\b//g' \
+ -e 's/CCFLAGS3 =/CCFLAGS3 = $(CFLAGS)/' \
+ Makefile || die
+}
+
+src_compile() {
+ if use oss; then
+ sed -i 's/USEALSA = .*$/USEALSA = FALSE/' Makefile
+ emake || die
+ fi
+
+ if use alsa; then
+ sed -i 's/USEALSA = .*$/USEALSA = TRUE/' Makefile
+ emake || die
+ fi
+}
+
+src_install() {
+ exeinto "$(games_get_libdir)/ps2emu/plugins"
+
+ if use oss; then
+ doexe libspu2PeopsOSS.so.* || die
+ fi
+
+ if use alsa; then
+ doexe libspu2PeopsALSA.so.*|| die
+ fi
+
+ prepgamesdirs
+}
diff --git a/games-emulation/ps2emu-spu2null/ps2emu-spu2null-0.7.1.ebuild b/games-emulation/ps2emu-spu2null/ps2emu-spu2null-0.7.1.ebuild
new file mode 100644
index 0000000..28490d0
--- /dev/null
+++ b/games-emulation/ps2emu-spu2null/ps2emu-spu2null-0.7.1.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit games
+
+PCSX2="pcsx2-0.9.4"
+
+DESCRIPTION="PS2Emu null sound plugin"
+HOMEPAGE="http://www.pcsx2.net/"
+SRC_URI="mirror://sourceforge/pcsx2/${PCSX2}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=x11-libs/gtk+-2"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${PCSX2}/plugins/spu2/SPU2null/Src"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e '/\bstrip\b/d' \
+ -e 's/-O[0-9]\b//g' \
+ -e 's/-fomit-frame-pointer\b//g' \
+ Makefile || die
+}
+
+src_install() {
+ exeinto "`games_get_libdir`/ps2emu/plugins"
+ newexe libSPU2null.so libSPU2null.so.${PV} || die
+ dodoc ../ReadMe.txt Changelog.txt || die
+ prepgamesdirs
+}
diff --git a/games-emulation/ps2emu-spu2null/ps2emu-spu2null-9999.ebuild b/games-emulation/ps2emu-spu2null/ps2emu-spu2null-9999.ebuild
new file mode 100644
index 0000000..5885bbd
--- /dev/null
+++ b/games-emulation/ps2emu-spu2null/ps2emu-spu2null-9999.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+ESVN_REPO_URI="https://pcsx2.svn.sourceforge.net/svnroot/pcsx2/plugins/spu2/SPU2null"
+inherit eutils games subversion
+
+DESCRIPTION="PS2Emu null sound plugin"
+HOMEPAGE="http://www.pcsx2.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="doc"
+
+DEPEND=">=x11-libs/gtk+-2"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${PCSX2}/SPU2null"
+
+src_unpack() {
+ subversion_src_unpack
+ S="${S}/Src"
+ cd "${S}"
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e '/\bstrip\b/d' \
+ -e 's/-O[0-9]\b//g' \
+ -e 's/-fomit-frame-pointer\b//g' \
+ Makefile || die
+}
+
+src_install() {
+ exeinto "$(games_get_libdir)/ps2emu/plugins"
+ doexe libSPU2null.so || die
+ use doc && dodoc ../ReadMe.txt Changelog.txt || die
+ prepgamesdirs
+}
diff --git a/games-emulation/ps2emu-usbnull/ps2emu-usbnull-0.4-r1.ebuild b/games-emulation/ps2emu-usbnull/ps2emu-usbnull-0.4-r1.ebuild
new file mode 100644
index 0000000..8482ed5
--- /dev/null
+++ b/games-emulation/ps2emu-usbnull/ps2emu-usbnull-0.4-r1.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit games
+
+PCSX2="pcsx2-0.9.4"
+
+DESCRIPTION="PS2Emu null USB plugin"
+HOMEPAGE="http://www.pcsx2.net/"
+SRC_URI="mirror://sourceforge/pcsx2/${PCSX2}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=x11-libs/gtk+-2"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${PCSX2}/plugins/usb/USBnull/Linux"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e '/\bstrip\b/d' \
+ -e 's/-O[0-9]\b//g' \
+ -e 's/-fomit-frame-pointer\b//g' \
+ Makefile || die
+}
+
+src_install() {
+ exeinto "`games_get_libdir`/ps2emu/plugins"
+ newexe libUSBnull.so libUSBnull.so.${PV} || die
+ exeinto "`games_get_libdir`/ps2emu/plugins/cfg"
+ doexe cfgUSBnull || die
+ dodoc ../ReadMe.txt || die
+ prepgamesdirs
+}
diff --git a/games-emulation/ps2emu-usbnull/ps2emu-usbnull-9999.ebuild b/games-emulation/ps2emu-usbnull/ps2emu-usbnull-9999.ebuild
new file mode 100644
index 0000000..57a71df
--- /dev/null
+++ b/games-emulation/ps2emu-usbnull/ps2emu-usbnull-9999.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+ESVN_REPO_URI="https://pcsx2.svn.sourceforge.net/svnroot/pcsx2/plugins/usb/USBnull"
+inherit eutils games subversion
+
+DESCRIPTION="PS2Emu null USB plugin"
+HOMEPAGE="http://www.pcsx2.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="doc"
+
+DEPEND=">=x11-libs/gtk+-2"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/USBnull"
+
+src_unpack() {
+ subversion_src_unpack
+ S="${S}/Linux"
+ cd "${S}"
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e '/\bstrip\b/d' \
+ -e 's/-O[0-9]\b//g' \
+ -e 's/-fomit-frame-pointer\b//g' \
+ Makefile || die
+}
+
+src_install() {
+ exeinto "$(games_get_libdir)/ps2emu/plugins"
+ doexe libUSBnull.so || die
+ exeinto "$(games_get_libdir)/ps2emu/plugins/cfg"
+ doexe cfgUSBnull || die
+ use doc && dodoc ../ReadMe.txt || die
+ prepgamesdirs
+}
diff --git a/games-emulation/ps2emu-zerogs/files/ps2emu-zerogs-consistent-naming.patch b/games-emulation/ps2emu-zerogs/files/ps2emu-zerogs-consistent-naming.patch
new file mode 100644
index 0000000..bbcf0d6
--- /dev/null
+++ b/games-emulation/ps2emu-zerogs/files/ps2emu-zerogs-consistent-naming.patch
@@ -0,0 +1,14 @@
+--- opengl/Makefile.am.orig 2008-06-08 11:50:59.000000000 -0400
++++ opengl/Makefile.am 2008-06-08 11:51:16.000000000 -0400
+@@ -14,11 +14,6 @@
+ # Create a shared object by faking an exe (thanks to ODE makefiles)
+ traplibdir=$(prefix)
+
+-
+-if RELEASE_TO_PUBLIC
+-preext=r
+-endif
+-
+ EXEEXT=$(preext)@so_ext@
+
+ traplib_PROGRAMS=libZeroGSogl
diff --git a/games-emulation/ps2emu-zerogs/files/ps2emu-zerogs-devbuild-paths.patch b/games-emulation/ps2emu-zerogs/files/ps2emu-zerogs-devbuild-paths.patch
new file mode 100644
index 0000000..5fce13a
--- /dev/null
+++ b/games-emulation/ps2emu-zerogs/files/ps2emu-zerogs-devbuild-paths.patch
@@ -0,0 +1,44 @@
+--- opengl/zerogs.cpp.orig 2008-06-08 22:12:33.000000000 -0400
++++ opengl/zerogs.cpp 2008-06-08 22:15:37.000000000 -0400
+@@ -112,8 +112,8 @@
+ char* EFFECT_DIR = "C:\\programming\\ps2dev\\zerogs\\opengl\\";
+ char* EFFECT_NAME = "C:\\programming\\ps2dev\\zerogs\\opengl\\ps2hw.fx";
+ #else
+-char EFFECT_DIR[255] = "~/pcsx2/plugins/gs/zerogs/opengl/";
+-char EFFECT_NAME[255] = "~/pcsx2/plugins/gs/zerogs/opengl/ps2hw.fx";
++char EFFECT_DIR[255] = "~/.pcsx2/";
++char EFFECT_NAME[255] = "ps2hw.fx";
+ #endif
+
+ #endif
+@@ -1335,25 +1335,17 @@
+ char curwd[255];
+ getcwd(curwd, ARRAY_SIZE(curwd));
+
+- strcpy(tempstr, "../plugins/gs/zerogs/opengl/");
+- sprintf(EFFECT_NAME, "%sps2hw.fx", tempstr);
++ strcpy(tempstr, curwd);
++ sprintf(EFFECT_NAME, "%s/ps2hw.fx", tempstr);
+ FILE* f = fopen(EFFECT_NAME, "r");
+ if( f == NULL ) {
+-
+- strcpy(tempstr, "../../plugins/gs/zerogs/opengl/");
+- sprintf(EFFECT_NAME, "%sps2hw.fx", tempstr);
+- f = fopen(EFFECT_NAME, "r");
+-
+- if( f == NULL ) {
+- ERROR_LOG("Failed to find %s, try compiling a non-devbuild\n", EFFECT_NAME);
+- return false;
+- }
++ return false;
+ }
+
+ fclose(f);
+
+- sprintf(EFFECT_DIR, "%s/%s", curwd, tempstr);
+- sprintf(EFFECT_NAME, "%sps2hw.fx", EFFECT_DIR);
++ sprintf(EFFECT_DIR, "%s", tempstr);
++ sprintf(EFFECT_NAME, "%s/ps2hw.fx", EFFECT_DIR);
+ #endif
+
+ #endif // RELEASE_TO_PUBLIC
diff --git a/games-emulation/ps2emu-zerogs/files/ps2emu-zerogs-gcc43.patch b/games-emulation/ps2emu-zerogs/files/ps2emu-zerogs-gcc43.patch
new file mode 100644
index 0000000..8d28eea
--- /dev/null
+++ b/games-emulation/ps2emu-zerogs/files/ps2emu-zerogs-gcc43.patch
@@ -0,0 +1,12 @@
+diff -Nur opengl.orig/Mem.h opengl/Mem.h
+--- opengl.orig/Mem.h 2008-06-03 11:28:33.000000000 +0200
++++ opengl/Mem.h 2008-06-03 11:35:17.000000000 +0200
+@@ -21,6 +21,8 @@
+
+ #include <assert.h>
+ #include <vector>
++#include <cstring>
++#include <cstdlib>
+
+ // works only when base is a power of 2
+ #define ROUND_UPPOW2(val, base) (((val)+(base-1))&~(base-1))
diff --git a/games-emulation/ps2emu-zerogs/ps2emu-zerogs-0.96.7.ebuild b/games-emulation/ps2emu-zerogs/ps2emu-zerogs-0.96.7.ebuild
new file mode 100644
index 0000000..fc9a801
--- /dev/null
+++ b/games-emulation/ps2emu-zerogs/ps2emu-zerogs-0.96.7.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit games autotools eutils
+
+PCSX2="pcsx2-0.9.4"
+
+DESCRIPTION="PS2Emu ZeroGS OpenGL plugin"
+HOMEPAGE="http://www.pcsx2.net/"
+SRC_URI="mirror://sourceforge/pcsx2/${PCSX2}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+# I'm seeing better grahics with devbuild on.
+IUSE="debug +devbuild sse2"
+
+RDEPEND="media-gfx/nvidia-cg-toolkit
+ media-libs/glew
+ media-libs/jpeg
+ sys-libs/zlib
+ virtual/opengl
+ x11-libs/libX11
+ x11-libs/libXxf86vm
+ >=x11-libs/gtk+-2"
+DEPEND="${RDEPEND}
+ x11-proto/xproto
+ x11-proto/xf86vidmodeproto"
+
+S="${WORKDIR}/${PCSX2}/plugins/gs/zerogs/opengl"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}/${PN}-gcc43.patch"
+ epatch "${FILESDIR}/${PN}-devbuild-paths.patch"
+ epatch "${FILESDIR}/${PN}-consistent-naming.patch"
+
+ sed -r -i \
+ -e 's/-O[0-9]\b//g' \
+ -e 's/-fomit-frame-pointer\b//g' \
+ -e 's/C(..)?FLAGS=/C\1FLAGS+=/' \
+ configure.ac || die
+
+ eautoreconf -v --install || die
+ chmod +x configure
+}
+
+src_compile() {
+ egamesconf \
+ $(use_enable devbuild) \
+ $(use_enable debug) \
+ $(use_enable sse2) \
+ || die
+
+ emake || die
+}
+
+src_install() {
+ exeinto "$(games_get_libdir)/ps2emu/plugins"
+ insinto "$(games_get_libdir)/ps2emu/plugins"
+ doexe libZeroGSogl.so.* || die
+ if use devbuild; then
+ doins ps2hw.fx || die
+ doins ctx1/ps2hw_ctx.fx || die
+ else
+ doins Win32/ps2hw.dat || die
+ fi
+ prepgamesdirs
+}
diff --git a/games-emulation/ps2emu-zerogs/ps2emu-zerogs-9999.ebuild b/games-emulation/ps2emu-zerogs/ps2emu-zerogs-9999.ebuild
new file mode 100644
index 0000000..51b186e
--- /dev/null
+++ b/games-emulation/ps2emu-zerogs/ps2emu-zerogs-9999.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+ESVN_REPO_URI="https://pcsx2.svn.sourceforge.net/svnroot/pcsx2/plugins/gs/zerogs/opengl"
+inherit eutils games subversion autotools
+
+DESCRIPTION="PS2Emu ZeroGS OpenGL plugin"
+HOMEPAGE="http://www.pcsx2.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+# I'm seeing better grahics with devbuild on.
+IUSE="debug +devbuild sse2"
+
+RDEPEND="media-gfx/nvidia-cg-toolkit
+ media-libs/glew
+ media-libs/jpeg
+ sys-libs/zlib
+ virtual/opengl
+ x11-libs/libX11
+ x11-libs/libXxf86vm
+ >=x11-libs/gtk+-2"
+DEPEND="${RDEPEND}
+ x11-proto/xproto
+ x11-proto/xf86vidmodeproto"
+
+S="${WORKDIR}/opengl"
+
+src_unpack() {
+ subversion_src_unpack
+ cd "${S}"
+
+ epatch "${FILESDIR}/${PN}-gcc43.patch"
+ epatch "${FILESDIR}/${PN}-devbuild-paths.patch"
+ epatch "${FILESDIR}/${PN}-consistent-naming.patch"
+
+ sed -r -i \
+ -e 's/-O[0-9]\b//g' \
+ -e 's/-fomit-frame-pointer\b//g' \
+ -e 's/C(..)?FLAGS=/C\1FLAGS+=/' \
+ configure.ac || die
+
+ eautoreconf -v --install || die
+ chmod +x configure
+}
+
+src_compile() {
+ egamesconf \
+ $(use_enable devbuild) \
+ $(use_enable debug) \
+ $(use_enable sse2) \
+ || die
+
+ emake || die
+}
+
+src_install() {
+ exeinto "$(games_get_libdir)/ps2emu/plugins"
+ insinto "$(games_get_libdir)/ps2emu/plugins"
+ doexe libZeroGSogl.so.* || die
+ if use devbuild; then
+ doins ps2hw.fx || die
+ doins ctx1/ps2hw_ctx.fx || die
+ else
+ doins Win32/ps2hw.dat || die
+ fi
+ prepgamesdirs
+}
diff --git a/games-emulation/ps2emu-zeropad/files/ps2emu-zeropad-consistent-naming.patch b/games-emulation/ps2emu-zeropad/files/ps2emu-zeropad-consistent-naming.patch
new file mode 100644
index 0000000..834d811
--- /dev/null
+++ b/games-emulation/ps2emu-zeropad/files/ps2emu-zeropad-consistent-naming.patch
@@ -0,0 +1,13 @@
+--- zeropad/Makefile.am.orig 2008-06-08 22:29:35.000000000 -0400
++++ zeropad/Makefile.am 2008-06-08 22:29:45.000000000 -0400
+@@ -13,10 +13,6 @@
+ # Create a shared object by faking an exe (thanks to ODE makefiles)
+ traplibdir=$(prefix)
+
+-if DEBUGBUILD
+-preext=d
+-endif
+-
+ EXEEXT=$(preext)@so_ext@
+
+ traplib_PROGRAMS=libZeroPAD
diff --git a/games-emulation/ps2emu-zeropad/ps2emu-zeropad-0.1.0.ebuild b/games-emulation/ps2emu-zeropad/ps2emu-zeropad-0.1.0.ebuild
new file mode 100644
index 0000000..aec4e75
--- /dev/null
+++ b/games-emulation/ps2emu-zeropad/ps2emu-zeropad-0.1.0.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit games autotools
+
+PCSX2="pcsx2-0.9.4"
+
+DESCRIPTION="PS2Emu pad plugin"
+HOMEPAGE="http://www.pcsx2.net/"
+SRC_URI="mirror://sourceforge/pcsx2/${PCSX2}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug"
+
+RDEPEND=">=x11-libs/gtk+-2"
+DEPEND="${RDEPEND}
+ x11-proto/xproto"
+
+S="${WORKDIR}/${PCSX2}/plugins/pad/zeropad"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}/${PN}-consistent-naming.patch"
+
+ sed -r -i \
+ -e '/C(..)?FLAGS=/d' \
+ -e 's/-O[0-9]\b//g' \
+ -e 's/-fomit-frame-pointer\b//g' \
+ -e 's/C(..)?FLAGS\+="/C\1FLAGS+=" /' \
+ configure.ac || die
+
+ eautoreconf -v --install || die
+}
+
+src_compile() {
+ egamesconf $(use_enable debug) || die
+ emake || die
+}
+
+src_install() {
+ exeinto "$(games_get_libdir)/ps2emu/plugins"
+ doexe libZeroPAD.so.${PV} || die
+ prepgamesdirs
+}
diff --git a/games-emulation/ps2emu-zeropad/ps2emu-zeropad-9999.ebuild b/games-emulation/ps2emu-zeropad/ps2emu-zeropad-9999.ebuild
new file mode 100644
index 0000000..8459546
--- /dev/null
+++ b/games-emulation/ps2emu-zeropad/ps2emu-zeropad-9999.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+ESVN_REPO_URI="https://pcsx2.svn.sourceforge.net/svnroot/pcsx2/plugins/pad/zeropad"
+inherit eutils games subversion autotools
+
+DESCRIPTION="PS2Emu pad plugin"
+HOMEPAGE="http://www.pcsx2.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="debug"
+
+RDEPEND=">=x11-libs/gtk+-2"
+DEPEND="${RDEPEND}
+ x11-proto/xproto"
+
+S="${WORKDIR}/zeropad"
+
+src_unpack() {
+ subversion_src_unpack
+ cd "${S}"
+
+ epatch "${FILESDIR}/${PN}-consistent-naming.patch"
+
+ sed -r -i \
+ -e '/C(..)?FLAGS=/d' \
+ -e 's/-O[0-9]\b//g' \
+ -e 's/-fomit-frame-pointer\b//g' \
+ -e 's/C(..)?FLAGS\+="/C\1FLAGS+=" /' \
+ configure.ac || die
+
+ eautoreconf -v --install || die
+}
+
+src_compile() {
+ egamesconf $(use_enable debug) || die
+ emake || die
+}
+
+src_install() {
+ exeinto "$(games_get_libdir)/ps2emu/plugins"
+ doexe libZeroPAD.so.* || die
+ prepgamesdirs
+}