And that's dev9, which was about as barebones as CDVDnull.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1111 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2009-05-02 04:39:05 +00:00
parent 6cc85d6050
commit 465f35169f
15 changed files with 415 additions and 201 deletions

View File

@ -1,6 +1,6 @@
AC_INIT(CDVDnull, 0.5,arcum42@gmail.com) AC_INIT(CDVDnull, 0.6,arcum42@gmail.com)
AM_INIT_AUTOMAKE(CDVDnull,0.7) AM_INIT_AUTOMAKE(CDVDnull,0.6)
AC_PROG_CC([gcc g++ cl KCC CC cxx cc++ xlC aCC c++]) AC_PROG_CC([gcc g++ cl KCC CC cxx cc++ xlC aCC c++])
AC_PROG_CXX([gcc g++ cl KCC CC cxx cc++ xlC aCC c++]) AC_PROG_CXX([gcc g++ cl KCC CC cxx cc++ xlC aCC c++])

160
plugins/dev9null/DEV9.cpp Normal file
View File

@ -0,0 +1,160 @@
/* DEV9null
* Copyright (C) 2002-2009 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <stdarg.h>
#include <sys/stat.h>
#include <string.h>
#include "PS2Etypes.h"
#include "DEV9.h"
const unsigned char version = PS2E_DEV9_VERSION;
const unsigned char revision = 0;
const unsigned char build = 4; // increase that with each version
const char *libraryName = "DEV9null Driver";
void (*DEV9irq)();
FILE *dev9Log;
EXPORT_C_(u32) PS2EgetLibType()
{
return PS2E_LT_DEV9;
}
EXPORT_C_(char*) PS2EgetLibName()
{
return (char *)libraryName;
}
EXPORT_C_(u32) PS2EgetLibVersion2(u32 type)
{
return (version<<16) | (revision<<8) | build;
}
void __Log(char *fmt, ...)
{
va_list list;
va_start(list, fmt);
vfprintf(dev9Log, fmt, list);
va_end(list);
}
EXPORT_C_(s32) DEV9init()
{
return 0;
}
EXPORT_C_(void) DEV9shutdown()
{
}
EXPORT_C_(s32) DEV9open(void *pDsp)
{
return 0;
}
EXPORT_C_(void) DEV9close()
{
}
EXPORT_C_(u8) DEV9read8(u32 addr)
{
return 0;
}
EXPORT_C_(u16 ) DEV9read16(u32 addr)
{
return 0;
}
EXPORT_C_(u32 ) DEV9read32(u32 addr)
{
return 0;
}
EXPORT_C_(void) DEV9write8(u32 addr, u8 value)
{
}
EXPORT_C_(void) DEV9write16(u32 addr, u16 value)
{
}
EXPORT_C_(void) DEV9write32(u32 addr, u32 value)
{
}
EXPORT_C_(void) DEV9readDMA8Mem(u32 *pMem, int size)
{
}
EXPORT_C_(void) DEV9writeDMA8Mem(u32* pMem, int size)
{
}
EXPORT_C_(void) DEV9irqCallback(DEV9callback callback)
{
}
EXPORT_C_(DEV9handler) DEV9irqHandler(void)
{
return NULL;
}
// extended funcs
EXPORT_C_(s32) DEV9test()
{
return 0;
}
EXPORT_C_(void) DEV9configure()
{
SysMessage("Nothing to Configure");
}
EXPORT_C_(void) DEV9about()
{
}
#ifdef _WIN32
HINSTANCE hInst;
void SysMessage(char *fmt, ...)
{
va_list list;
char tmp[512];
va_start(list,fmt);
vsprintf(tmp,fmt,list);
va_end(list);
MessageBox(0, tmp, "DEV9null Msg", 0);
}
BOOL APIENTRY DllMain(HANDLE hModule, // DLL INIT
DWORD dwReason,
LPVOID lpReserved) {
hInst = (HINSTANCE)hModule;
return TRUE; // very quick :)
}
#endif

39
plugins/dev9null/DEV9.h Normal file
View File

@ -0,0 +1,39 @@
#ifndef __DEV9_H__
#define __DEV9_H__
#include <stdio.h>
#ifdef __LINUX__
#include <gtk/gtk.h>
#else
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#endif
extern "C"
{
#define DEV9defs
#include "PS2Edefs.h"
}
#ifdef _MSC_VER
#define EXPORT_C_(type) extern "C" __declspec(dllexport) type CALLBACK
#else
#define EXPORT_C_(type) extern "C" type
#endif
extern const unsigned char version;
extern const unsigned char revision;
extern const unsigned char build;
extern const unsigned int minor;
extern const char *libraryName;
extern void (*DEV9irq)();
extern void SysMessage(const char *fmt, ...);
extern FILE *dev9Log;
void __Log(char *fmt, ...);
#endif

View File

@ -0,0 +1,79 @@
/* DEV9null
* Copyright (C) 2002-2009 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "DEV9.h"
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
GtkWidget *MsgDlg;
void OnMsg_Ok()
{
gtk_widget_destroy(MsgDlg);
gtk_main_quit();
}
void SysMessage(const char *fmt, ...)
{
GtkWidget *Ok, *Txt;
GtkWidget *Box, *Box1;
va_list list;
char msg[512];
va_start(list, fmt);
vsprintf(msg, fmt, list);
va_end(list);
if (msg[strlen(msg)-1] == '\n') msg[strlen(msg)-1] = 0;
MsgDlg = gtk_window_new(GTK_WINDOW_POPUP);
gtk_window_set_position(GTK_WINDOW(MsgDlg), GTK_WIN_POS_CENTER);
gtk_window_set_title(GTK_WINDOW(MsgDlg), "SPU2null Msg");
gtk_container_set_border_width(GTK_CONTAINER(MsgDlg), 5);
Box = gtk_vbox_new(5, 0);
gtk_container_add(GTK_CONTAINER(MsgDlg), Box);
gtk_widget_show(Box);
Txt = gtk_label_new(msg);
gtk_box_pack_start(GTK_BOX(Box), Txt, FALSE, FALSE, 5);
gtk_widget_show(Txt);
Box1 = gtk_hbutton_box_new();
gtk_box_pack_start(GTK_BOX(Box), Box1, FALSE, FALSE, 0);
gtk_widget_show(Box1);
Ok = gtk_button_new_with_label("Ok");
gtk_signal_connect(GTK_OBJECT(Ok), "clicked", GTK_SIGNAL_FUNC(OnMsg_Ok), NULL);
gtk_container_add(GTK_CONTAINER(Box1), Ok);
GTK_WIDGET_SET_FLAGS(Ok, GTK_CAN_DEFAULT);
gtk_widget_show(Ok);
gtk_widget_show(MsgDlg);
gtk_main();
}
void LoadConfig()
{
}

View File

@ -0,0 +1,27 @@
# Create a shared library libDEV9null
AUTOMAKE_OPTIONS = foreign
noinst_LIBRARIES = libDEV9null.a
INCLUDES = -I@srcdir@/../../common/include -I@srcdir@/../../3rdparty -I@srcdir@/Linux
libDEV9null_a_CXXFLAGS = $(shell pkg-config --cflags gtk+-2.0)
libDEV9null_a_CFLAGS = $(shell pkg-config --cflags gtk+-2.0)
# 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=libDEV9null
libDEV9null_SOURCES=
libDEV9null_DEPENDENCIES = libDEV9null.a
libDEV9null_LDFLAGS= @SHARED_LDFLAGS@
libDEV9null_LDFLAGS+=-Wl,-soname,@libDEV9null_SONAME@
libDEV9null_LDADD=$(libDEV9null_a_OBJECTS)
libDEV9null_a_SOURCES = DEV9.cpp DEV9.h Linux/Config.cpp
#SUBDIRS = Linux

View File

@ -1,13 +1,32 @@
#!/bin/sh #!/bin/sh
echo ----------------- echo ---------------
echo Building dev9null echo Building DEV9null
echo ----------------- echo ---------------
curdir=`pwd` curdir=`pwd`
cd ${curdir}/src
make clean
make $@
cp libDEV9null.so ${PCSX2PLUGINS} if test "${DEV9nullOPTIONS+set}" != set ; then
export DEV9nullOPTIONS=""
fi
if [ $# -gt 0 ] && [ $1 = "all" ]
then
aclocal
automake -a
autoconf
./configure ${DEV9nullOPTIONS} --prefix=${PCSX2PLUGINS}
make clean
make install
else
make $@
fi
if [ $? -ne 0 ]
then
exit 1
fi

View File

@ -0,0 +1,80 @@
AC_INIT(DEV9null, 0.4,arcum42@gmail.com)
AM_INIT_AUTOMAKE(DEV9null,0.4)
AC_PROG_CC([gcc g++ cl KCC CC cxx cc++ xlC aCC c++])
AC_PROG_CXX([gcc g++ cl KCC CC cxx cc++ xlC aCC c++])
AC_PROG_CPP([gcc g++ cl KCC CC cxx cc++ xlC aCC c++])
AC_PROG_INSTALL
AC_PROG_RANLIB
dnl necessary for compiling assembly
AM_PROG_AS
AC_SUBST(DEV9null_CURRENT, 0)
AC_SUBST(DEV9null_REVISION, 8)
AC_SUBST(DEV9null_AGE, 0)
AC_SUBST(DEV9null_RELEASE,[$DEV9null_CURRENT].[$DEV9null_REVISION].[$DEV9null_AGE])
AC_SUBST(DEV9null_SONAME,libDEV9null.so.[$DEV9null_CURRENT].[$DEV9null_REVISION].[$DEV9null_AGE])
CFLAGS=
CPPFLAGS=
CXXFLAGS=
dnl Check for debug build
AC_MSG_CHECKING(debug build)
AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [debug build]),
debug=$enableval,debug=no)
if test "x$debug" == xyes
then
AC_DEFINE(_DEBUG,1,[_DEBUG])
CFLAGS+="-g -fPIC -Wall -Wno-unused-value "
CPPFLAGS+="-g -fPIC -Wall -Wno-unused-value "
CXXFLAGS+="-g -fPIC -Wall -Wno-unused-value "
else
AC_DEFINE(NDEBUG,1,[NDEBUG])
CFLAGS+="-O3 -fomit-frame-pointer -fPIC -Wall -Wno-unused-value "
CPPFLAGS+="-O3 -fomit-frame-pointer -fPIC -Wall -Wno-unused-value "
CXXFLAGS+="-O3 -fomit-frame-pointer -fPIC -Wall -Wno-unused-value "
fi
AM_CONDITIONAL(DEBUGBUILD, test x$debug = xyes)
AC_MSG_RESULT($debug)
AC_DEFINE(__LINUX__,1,[__LINUX__])
dnl Check for dev build
AC_MSG_CHECKING(for development build...)
AC_ARG_ENABLE(devbuild, AC_HELP_STRING([--enable-devbuild], [Special Build for developers that simplifies testing and adds extra checks]),
devbuild=$enableval,devbuild=no)
if test "x$devbuild" == xyes
then
AC_DEFINE(DEV9null_DEVBUILD,1,[DEV9null_DEVBUILD])
fi
AC_MSG_RESULT($devbuild)
AM_CONDITIONAL(RELEASE_TO_PUBLIC, test x$devbuild = xno)
AC_CHECK_FUNCS([ _aligned_malloc _aligned_free ], AC_DEFINE(HAVE_ALIGNED_MALLOC))
dnl gtk
AC_MSG_CHECKING(gtk2+)
AC_CHECK_PROG(GTK_CONFIG, pkg-config, pkg-config)
LIBS+=$(pkg-config --libs gtk+-2.0)
dnl bindir = pcsx2exe
dnl assuming linux environment
so_ext=".so.$DEV9null_RELEASE"
SHARED_LDFLAGS="-shared"
AC_SUBST(so_ext)
AC_SUBST(SHARED_LDFLAGS)
AC_CHECK_LIB(stdc++,main,[LIBS="$LIBS -lstdc++"])
AC_OUTPUT([
Makefile
])
echo "Configuration:"
echo " Debug build? $debug"
echo " Dev build? $devbuild"

1
plugins/dev9null/install-sh Symbolic link
View File

@ -0,0 +1 @@
/usr/share/automake-1.10/install-sh

1
plugins/dev9null/missing Symbolic link
View File

@ -0,0 +1 @@
/usr/share/automake-1.10/missing

View File

@ -1,17 +0,0 @@
#ifndef __DEV9_H__
#define __DEV9_H__
#include <stdio.h>
#define DEV9defs
#include "PS2Edefs.h"
FILE *dev9Log;
void __Log(char *fmt, ...);
void (*DEV9irq)();
void SysMessage(char *fmt, ...);
#endif

View File

@ -1,23 +0,0 @@
CC = gcc
PLUGIN = libDEV9null.so
CFLAGS+= -fPIC -Wall -O2 -fomit-frame-pointer -D__LINUX__ -I../../../common/include
OBJS = dev9null.o
DEPS:= $(OBJS:.o=.d)
all: plugin
install: all
plugin: ${OBJS}
rm -f ${PLUGIN}
gcc -shared -Wl,-soname,${PLUGIN} ${CFLAGS} ${OBJS} -o ${PLUGIN} ${LIBS}
strip --strip-unneeded --strip-debug ${PLUGIN}
clean:
rm -f ${OBJS} ${DEPS}
%.o: %.c
${CC} ${CFLAGS} -c -o $@ $< -MD -MF $(patsubst %.o,%.d,$@)
-include ${DEPS}

View File

@ -1,152 +0,0 @@
#ifdef _WIN32
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#endif
#include <stdio.h>
#include <stdarg.h>
#include <sys/stat.h>
#include <string.h>
#include "PS2Etypes.h"
#include "DEV9.h"
#ifdef _WIN32
HINSTANCE hInst;
void SysMessage(char *fmt, ...) {
va_list list;
char tmp[512];
va_start(list,fmt);
vsprintf(tmp,fmt,list);
va_end(list);
MessageBox(0, tmp, "DEV9null Msg", 0);
}
#else
#include <X11/Xlib.h>
void SysMessage(char *fmt, ...) {
}
#endif
const unsigned char version = PS2E_DEV9_VERSION;
const unsigned char revision = 0;
const unsigned char build = 3; // increase that with each version
static char *libraryName = "DEV9null Driver";
u32 CALLBACK PS2EgetLibType() {
return PS2E_LT_DEV9;
}
char* CALLBACK PS2EgetLibName() {
return libraryName;
}
u32 CALLBACK PS2EgetLibVersion2(u32 type) {
return (version<<16) | (revision<<8) | build;
}
void __Log(char *fmt, ...) {
va_list list;
// if (!Log) return;
va_start(list, fmt);
vfprintf(dev9Log, fmt, list);
va_end(list);
}
s32 CALLBACK DEV9init() {
return 0;
}
void CALLBACK DEV9shutdown() {
}
s32 CALLBACK DEV9open(void *pDsp) {
#ifdef _WIN32
#else
Display* dsp = *(Display**)pDsp;
#endif
return 0;
}
void CALLBACK DEV9close() {
}
u8 CALLBACK DEV9read8(u32 addr) {
return 0;
}
u16 CALLBACK DEV9read16(u32 addr) {
return 0;
}
u32 CALLBACK DEV9read32(u32 addr) {
return 0;
}
void CALLBACK DEV9write8(u32 addr, u8 value) {
}
void CALLBACK DEV9write16(u32 addr, u16 value) {
}
void CALLBACK DEV9write32(u32 addr, u32 value) {
}
void CALLBACK DEV9readDMA8Mem(u32 *pMem, int size) {
}
void CALLBACK DEV9writeDMA8Mem(u32* pMem, int size) {
}
void CALLBACK DEV9irqCallback(DEV9callback callback) {
}
DEV9handler CALLBACK DEV9irqHandler(void) {
return NULL;
}
// extended funcs
s32 CALLBACK DEV9test() {
return 0;
}
void CALLBACK DEV9configure()
{
SysMessage("Nothing to Configure");
}
void CALLBACK DEV9about(){}
#ifdef _WIN32
BOOL APIENTRY DllMain(HANDLE hModule, // DLL INIT
DWORD dwReason,
LPVOID lpReserved) {
hInst = (HINSTANCE)hModule;
return TRUE; // very quick :)
}
#endif