diff --git a/plugins/CDVDnull/CDVD.cpp b/plugins/CDVDnull/CDVD.cpp new file mode 100644 index 0000000000..7d922872a7 --- /dev/null +++ b/plugins/CDVDnull/CDVD.cpp @@ -0,0 +1,140 @@ +/* CDVDnull + * 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 + +#include "CDVD.h" + +const char *LibName = "CDVDnull Driver"; + +const unsigned char version = PS2E_CDVD_VERSION; +const unsigned char revision = 0; +const unsigned char build = 6; + +EXPORT_C_(char*) PS2EgetLibName() +{ + return (char *)LibName; +} + +EXPORT_C_(u32) PS2EgetLibType() +{ + return PS2E_LT_CDVD; +} + +EXPORT_C_(u32) CALLBACK PS2EgetLibVersion2(u32 type) +{ + return (version << 16) | (revision << 8) | build; +} + +#ifdef _WIN32 +void SysMessage(const char *fmt, ...) +{ + va_list list; + char tmp[512]; + + va_start(list, fmt); + vsprintf(tmp, fmt, list); + va_end(list); + + MessageBox(0, tmp, "CDVDnull Msg", 0); +} +#endif + +EXPORT_C_(s32) CDVDinit() +{ + return 0; +} + +EXPORT_C_(s32) CDVDopen(const char* pTitle) +{ + return 0; +} + +EXPORT_C_(void) CDVDclose() +{ +} + +EXPORT_C_(void) CDVDshutdown() +{ +} + +EXPORT_C_(s32) CDVDreadTrack(u32 lsn, int mode) +{ + return -1; +} + +// return can be NULL (for async modes) +EXPORT_C_(u8*) CDVDgetBuffer() +{ + return NULL; +} + +EXPORT_C_(s32) CDVDreadSubQ(u32 lsn, cdvdSubQ* subq) +{ + return -1; +} + +EXPORT_C_(s32) CDVDgetTN(cdvdTN *Buffer) +{ + return -1; +} + +EXPORT_C_(s32) CDVDgetTD(u8 Track, cdvdTD *Buffer) +{ + return -1; +} + +EXPORT_C_(s32) CDVDgetTOC(void* toc) +{ + return -1; +} + +EXPORT_C_(s32) CDVDgetDiskType() +{ + return CDVD_TYPE_NODISC; +} + +EXPORT_C_(s32) CDVDgetTrayStatus() +{ + return CDVD_TRAY_CLOSE; +} + +EXPORT_C_(s32) CDVDctrlTrayOpen() +{ + return 0; +} + +EXPORT_C_(s32) CDVDctrlTrayClose() +{ + return 0; +} + +EXPORT_C_(void) CDVDconfigure() +{ + SysMessage("Nothing to Configure"); +} + +EXPORT_C_(void) CDVDabout() +{ + SysMessage("%s %d.%d", LibName, revision, build); +} + +EXPORT_C_(s32) CDVDtest() +{ + return 0; +} diff --git a/plugins/CDVDnull/CDVD.h b/plugins/CDVDnull/CDVD.h new file mode 100644 index 0000000000..370e09bf26 --- /dev/null +++ b/plugins/CDVDnull/CDVD.h @@ -0,0 +1,52 @@ +/* CDVDnull + * 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 + */ + + #ifndef __CDVD_H__ +#define __CDVD_H__ + +#ifdef _WIN32 +#include +#endif + +extern "C" +{ +#define CDVDdefs +#include "PS2Edefs.h" +} + +#ifdef __LINUX__ +#include +#else +#include +#include +#endif + +#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 *LibName; + +extern void SysMessage(const char *fmt, ...); +#endif /* __CDVD_H__ */ diff --git a/plugins/CDVDnull/Linux/Config.cpp b/plugins/CDVDnull/Linux/Config.cpp new file mode 100644 index 0000000000..fead9422be --- /dev/null +++ b/plugins/CDVDnull/Linux/Config.cpp @@ -0,0 +1,78 @@ +/* CDVDnull + * 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 "CDVD.h" + +#include +#include +#include +#include + +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() +{ +} diff --git a/plugins/CDVDnull/Makefile.am b/plugins/CDVDnull/Makefile.am new file mode 100644 index 0000000000..4ec1b0e135 --- /dev/null +++ b/plugins/CDVDnull/Makefile.am @@ -0,0 +1,27 @@ +# Create a shared library libCDVDnull +AUTOMAKE_OPTIONS = foreign +noinst_LIBRARIES = libCDVDnull.a +INCLUDES = -I@srcdir@/../../common/include -I@srcdir@/../../3rdparty -I@srcdir@/Linux + +libCDVDnull_a_CXXFLAGS = $(shell pkg-config --cflags gtk+-2.0) +libCDVDnull_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=libCDVDnull +libCDVDnull_SOURCES= +libCDVDnull_DEPENDENCIES = libCDVDnull.a +libCDVDnull_LDFLAGS= @SHARED_LDFLAGS@ +libCDVDnull_LDFLAGS+=-Wl,-soname,@libCDVDnull_SONAME@ +libCDVDnull_LDADD=$(libCDVDnull_a_OBJECTS) + +libCDVDnull_a_SOURCES = CDVD.cpp CDVD.h Linux/Config.cpp + +#SUBDIRS = Linux \ No newline at end of file diff --git a/plugins/CDVDnull/Src/CDVD.c b/plugins/CDVDnull/Src/CDVD.c deleted file mode 100644 index c4b3cfa04f..0000000000 --- a/plugins/CDVDnull/Src/CDVD.c +++ /dev/null @@ -1,145 +0,0 @@ -#include - -#include "CDVD.h" - -char *LibName = "CDVDnull Driver"; - -const unsigned char version = PS2E_CDVD_VERSION; -const unsigned char revision = 0; -const unsigned char build = 6; - - -char* CALLBACK PS2EgetLibName() { - return LibName; -} - -u32 CALLBACK PS2EgetLibType() { - return PS2E_LT_CDVD; -} - -u32 CALLBACK PS2EgetLibVersion2(u32 type) { - return (version << 16) | (revision << 8) | build; -} - -#ifdef _WIN32 -void SysMessage(char *fmt, ...) { - va_list list; - char tmp[512]; - - va_start(list,fmt); - vsprintf(tmp,fmt,list); - va_end(list); - - MessageBox(0, tmp, "CDVDnull Msg", 0); -} -#else - -void SysMessage(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), "GSsoft 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();*/ -} - -#endif - -s32 CALLBACK CDVDinit() { - return 0; -} - -s32 CALLBACK CDVDopen(const char* pTitle) { - return 0; -} - -void CALLBACK CDVDclose() { -} - -void CALLBACK CDVDshutdown() { -} - -s32 CALLBACK CDVDreadTrack(u32 lsn, int mode) { - return -1; -} - -// return can be NULL (for async modes) -u8* CALLBACK CDVDgetBuffer() { - return NULL; -} - -s32 CALLBACK CDVDreadSubQ(u32 lsn, cdvdSubQ* subq) { - return -1; -} - -s32 CALLBACK CDVDgetTN(cdvdTN *Buffer) { - return -1; -} - -s32 CALLBACK CDVDgetTD(u8 Track, cdvdTD *Buffer) { - return -1; -} - -s32 CALLBACK CDVDgetTOC(void* toc) { - return -1; -} - -s32 CALLBACK CDVDgetDiskType() { - return CDVD_TYPE_NODISC; -} - -s32 CALLBACK CDVDgetTrayStatus() { - return CDVD_TRAY_CLOSE; -} - -s32 CALLBACK CDVDctrlTrayOpen() { - return 0; -} - -s32 CALLBACK CDVDctrlTrayClose() { - return 0; -} - -void CALLBACK CDVDconfigure() { - SysMessage("Nothing to Configure"); -} - -void CALLBACK CDVDabout() { - SysMessage("%s %d.%d", LibName, revision, build); -} - -s32 CALLBACK CDVDtest() { - return 0; -} diff --git a/plugins/CDVDnull/Src/CDVD.h b/plugins/CDVDnull/Src/CDVD.h deleted file mode 100644 index e8c983e700..0000000000 --- a/plugins/CDVDnull/Src/CDVD.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __CDVD_H__ -#define __CDVD_H__ - -#ifdef _WIN32 -#include -#endif - -#define CDVDdefs -#include "PS2Edefs.h" - -#endif /* __CDVD_H__ */ diff --git a/plugins/CDVDnull/Src/Makefile b/plugins/CDVDnull/Src/Makefile deleted file mode 100644 index d9b83b8a82..0000000000 --- a/plugins/CDVDnull/Src/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -# -# Makefile for MINGW32 -# - -all: cdvdnull -install: all - -PLUGIN = libCDVDnull.so - -CC = gcc -NASM = nasmw -RM = rm -f -AR = ar -STRIP = strip -RC = windres - -OPTIMIZE = -O2 -fomit-frame-pointer -finline-functions -ffast-math -fno-strict-aliasing -FLAGS = -DENABLE_NLS -DPACKAGE=\"pcsx2\" -RC1FLAGS = -LIBS = -RESOBJ = cdvdnull.o - -OBJS = CDVD.o - -DEPS:= $(OBJS:.o=.d) - -CFLAGS = -Wall ${OPTIMIZE} -I../../../common/include -I. -I/usr/local/include ${FLAGS} -fPIC - -cdvdnull: ${OBJS} -# dllwrap --def plugin.def -o ${PLUGIN} ${OBJS} ${LIBS} - ${CC} -shared -Wl,-soname,${PLUGIN} ${CFLAGS} ${OBJS} -o ${PLUGIN} ${LIBS} - ${STRIP} ${PLUGIN} - -.PHONY: clean cdvdnull - -clean: - ${RM} ${OBJS} ${DEPS} ${PCSX2} - -%.o: %.asm - ${NASM} ${ASMFLAGS} -o $@ $< - -%.o: %.c - ${CC} ${CFLAGS} -c -o $@ $< -MD -MF $(patsubst %.o,%.d,$@) - -${RESOBJ}: CDVDnull.rc - ${RC} -D__MINGW32__ -I rc -O coff -o $@ -i $< - --include ${DEPS} diff --git a/plugins/CDVDnull/Src/CDVDnull.def b/plugins/CDVDnull/Windows/CDVDnull.def similarity index 100% rename from plugins/CDVDnull/Src/CDVDnull.def rename to plugins/CDVDnull/Windows/CDVDnull.def diff --git a/plugins/CDVDnull/Src/CDVDnull_vs2008.vcproj b/plugins/CDVDnull/Windows/CDVDnull_vs2008.vcproj similarity index 92% rename from plugins/CDVDnull/Src/CDVDnull_vs2008.vcproj rename to plugins/CDVDnull/Windows/CDVDnull_vs2008.vcproj index 3e7a210ec4..26d4c17132 100644 --- a/plugins/CDVDnull/Src/CDVDnull_vs2008.vcproj +++ b/plugins/CDVDnull/Windows/CDVDnull_vs2008.vcproj @@ -102,11 +102,11 @@ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" >