From da710571b75db7031b82924ab3ad47eb645ce215 Mon Sep 17 00:00:00 2001 From: notaz Date: Fri, 30 Nov 2012 02:51:45 +0200 Subject: mave plugin and core shared includes to single location --- Makefile | 6 +- frontend/config.h | 7 - frontend/menu.c | 2 +- frontend/pcnt.h | 132 ------------------- frontend/plugin.c | 2 +- frontend/plugin_lib.c | 2 +- frontend/psemu_plugin_defs.h | 1 - include/config.h | 7 + include/pcnt.h | 132 +++++++++++++++++++ include/psemu_plugin_defs.h | 285 ++++++++++++++++++++++++++++++++++++++++ jni/Android.mk | 2 +- libpcsxcore/psemu_plugin_defs.h | 285 ---------------------------------------- plugins/dfinput/main.h | 2 +- plugins/dfinput/pad.c | 2 +- plugins/dfxvideo/Makefile | 3 +- plugins/dfxvideo/draw_pl.c | 2 +- plugins/gpu_unai/Makefile | 1 + 17 files changed, 436 insertions(+), 437 deletions(-) delete mode 100644 frontend/config.h delete mode 100644 frontend/pcnt.h delete mode 100644 frontend/psemu_plugin_defs.h create mode 100644 include/config.h create mode 100644 include/pcnt.h create mode 100644 include/psemu_plugin_defs.h delete mode 100644 libpcsxcore/psemu_plugin_defs.h diff --git a/Makefile b/Makefile index 83f343f..493306c 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # default stuff goes here, so that config can override TARGET = pcsx -CFLAGS += -Wall -ggdb -Ifrontend -ffast-math +CFLAGS += -Wall -ggdb -Iinclude -ffast-math LDLIBS += -lpthread ifndef DEBUG CFLAGS += -O2 -DNDEBUG @@ -143,7 +143,7 @@ OBJS += frontend/libpicofe/pandora/plat.o OBJS += frontend/libpicofe/linux/fbdev.o frontend/libpicofe/linux/xenv.o OBJS += frontend/libpicofe/linux/in_evdev.o OBJS += frontend/plat_pandora.o frontend/plat_omap.o -frontend/main.o frontend/menu.o: CFLAGS += -include pandora/ui_feat.h +frontend/main.o frontend/menu.o: CFLAGS += -include frontend/pandora/ui_feat.h USE_PLUGIN_LIB = 1 USE_FRONTEND = 1 endif @@ -152,7 +152,7 @@ OBJS += frontend/libpicofe/gp2x/in_gp2x.o frontend/warm/warm.o OBJS += frontend/libpicofe/gp2x/soc_pollux.o OBJS += frontend/libpicofe/linux/in_evdev.o OBJS += frontend/plat_pollux.o frontend/in_tsbutton.o frontend/blit320.o -frontend/main.o frontend/menu.o: CFLAGS += -include 320240/ui_gp2x.h +frontend/main.o frontend/menu.o: CFLAGS += -include frontend/320240/ui_gp2x.h USE_PLUGIN_LIB = 1 USE_FRONTEND = 1 endif diff --git a/frontend/config.h b/frontend/config.h deleted file mode 100644 index dcfb598..0000000 --- a/frontend/config.h +++ /dev/null @@ -1,7 +0,0 @@ -#define MAXPATHLEN 256 -//#define NOPSXREC -#define __LINUX__ 1 -#define PACKAGE_NAME "pcsx" -#define PACKAGE_VERSION "1.9" -#define DEF_PLUGIN_DIR "." -//#define EMU_LOG printf diff --git a/frontend/menu.c b/frontend/menu.c index 57c8d17..7af718e 100644 --- a/frontend/menu.c +++ b/frontend/menu.c @@ -32,10 +32,10 @@ #include "../libpcsxcore/cdrom.h" #include "../libpcsxcore/cdriso.h" #include "../libpcsxcore/cheat.h" -#include "../libpcsxcore/psemu_plugin_defs.h" #include "../libpcsxcore/new_dynarec/new_dynarec.h" #include "../plugins/dfinput/externals.h" #include "../plugins/gpulib/cspace.h" +#include "psemu_plugin_defs.h" #include "revision.h" #define REARMED_BIRTHDAY_TIME 1293306830 /* 25 Dec 2010 */ diff --git a/frontend/pcnt.h b/frontend/pcnt.h deleted file mode 100644 index 9ddd500..0000000 --- a/frontend/pcnt.h +++ /dev/null @@ -1,132 +0,0 @@ - -enum pcounters { - PCNT_ALL, - PCNT_GPU, - PCNT_SPU, - PCNT_BLIT, - PCNT_GTE, - PCNT_TEST, - PCNT_CNT -}; - -#ifdef PCNT - -#if defined(__ARM_ARCH_7A__) || defined(ARM1176) -#define PCNT_DIV 1000 -#else -#include -#define PCNT_DIV 1 -#endif - -static const char *pcnt_names[PCNT_CNT] = { "", "gpu", "spu", "blit", "gte", "test" }; - -#define PCNT_FRAMES 10 - -extern unsigned int pcounters[PCNT_CNT]; -extern unsigned int pcounter_starts[PCNT_CNT]; - -#define pcnt_start(id) \ - pcounter_starts[id] = pcnt_get() - -#define pcnt_end(id) \ - pcounters[id] += pcnt_get() - pcounter_starts[id] - -void pcnt_hook_plugins(void); - -static inline void pcnt_print(float fps) -{ - static int print_counter; - unsigned int total, rem; - int i; - - for (i = 0; i < PCNT_CNT; i++) - pcounters[i] /= PCNT_DIV * PCNT_FRAMES; - - rem = total = pcounters[PCNT_ALL]; - for (i = 1; i < PCNT_CNT; i++) - rem -= pcounters[i]; - if (!total) - total++; - - if (--print_counter < 0) { - printf(" "); - for (i = 1; i < PCNT_CNT; i++) - printf("%5s ", pcnt_names[i]); - printf("%5s\n", "rem"); - print_counter = 30; - } - - printf("%4.1f ", fps); -#if 0 - static float pcounters_all[PCNT_CNT+1]; - static int pcounter_samples; - pcounter_samples++; - - for (i = 1; i < PCNT_CNT; i++) { - pcounters_all[i] += pcounters[i]; - printf("%5.0f ", pcounters_all[i] / pcounter_samples); - } - pcounters_all[i] += rem; - printf("%5.0f\n", pcounters_all[i] / pcounter_samples); -#else - for (i = 1; i < PCNT_CNT; i++) - printf("%5u ", pcounters[i]); - printf("%5u (", rem); - for (i = 1; i < PCNT_CNT; i++) - printf("%2u ", pcounters[i] * 100 / total); - printf("%2u) %u\n", rem * 100 / total, total); -#endif - memset(pcounters, 0, sizeof(pcounters)); -} - -static inline unsigned int pcnt_get(void) -{ - unsigned int val; -#ifdef __ARM_ARCH_7A__ - __asm__ volatile("mrc p15, 0, %0, c9, c13, 0" - : "=r"(val)); -#elif defined(ARM1176) - __asm__ volatile("mrc p15, 0, %0, c15, c12, 1" - : "=r"(val)); -#else - // all slow on ARM :( - //struct timespec tv; - //clock_gettime(CLOCK_MONOTONIC_RAW, &tv); - //val = tv.tv_sec * 1000000000 + tv.tv_nsec; - struct timeval tv; - gettimeofday(&tv, NULL); - val = tv.tv_sec * 1000000 + tv.tv_usec; -#endif - return val; -} - -static inline void pcnt_init(void) -{ -#ifdef __ARM_ARCH_7A__ - int v; - asm volatile("mrc p15, 0, %0, c9, c12, 0" : "=r"(v)); - v |= 5; // master enable, ccnt reset - v &= ~8; // ccnt divider 0 - asm volatile("mcr p15, 0, %0, c9, c12, 0" :: "r"(v)); - // enable cycle counter - asm volatile("mcr p15, 0, %0, c9, c12, 1" :: "r"(1<<31)); -#elif defined(ARM1176) - int v; - asm volatile("mrc p15, 0, %0, c15, c12, 0" : "=r"(v)); - v |= 5; // master enable, ccnt reset - v &= ~8; // ccnt divider 0 - asm volatile("mcr p15, 0, %0, c15, c12, 0" :: "r"(v)); -#endif -} - -void pcnt_gte_start(int op); -void pcnt_gte_end(int op); - -#else - -#define pcnt_start(id) -#define pcnt_end(id) -#define pcnt_hook_plugins() -#define pcnt_print(fps) - -#endif diff --git a/frontend/plugin.c b/frontend/plugin.c index b0cbc67..7e8e5c3 100644 --- a/frontend/plugin.c +++ b/frontend/plugin.c @@ -11,7 +11,7 @@ #include "plugin_lib.h" #include "plugin.h" -#include "../libpcsxcore/psemu_plugin_defs.h" +#include "psemu_plugin_defs.h" #include "../libpcsxcore/system.h" #include "../plugins/cdrcimg/cdrcimg.h" diff --git a/frontend/plugin_lib.c b/frontend/plugin_lib.c index 095d3be..aa771ed 100644 --- a/frontend/plugin_lib.c +++ b/frontend/plugin_lib.c @@ -28,8 +28,8 @@ #include "plat.h" #include "pcnt.h" #include "pl_gun_ts.h" +#include "psemu_plugin_defs.h" #include "../libpcsxcore/new_dynarec/new_dynarec.h" -#include "../libpcsxcore/psemu_plugin_defs.h" #include "../libpcsxcore/psxmem_map.h" #include "../plugins/gpulib/cspace.h" #include "../plugins/dfinput/externals.h" diff --git a/frontend/psemu_plugin_defs.h b/frontend/psemu_plugin_defs.h deleted file mode 100644 index d4cc29a..0000000 --- a/frontend/psemu_plugin_defs.h +++ /dev/null @@ -1 +0,0 @@ -#include "../libpcsxcore/psemu_plugin_defs.h" diff --git a/include/config.h b/include/config.h new file mode 100644 index 0000000..dcfb598 --- /dev/null +++ b/include/config.h @@ -0,0 +1,7 @@ +#define MAXPATHLEN 256 +//#define NOPSXREC +#define __LINUX__ 1 +#define PACKAGE_NAME "pcsx" +#define PACKAGE_VERSION "1.9" +#define DEF_PLUGIN_DIR "." +//#define EMU_LOG printf diff --git a/include/pcnt.h b/include/pcnt.h new file mode 100644 index 0000000..9ddd500 --- /dev/null +++ b/include/pcnt.h @@ -0,0 +1,132 @@ + +enum pcounters { + PCNT_ALL, + PCNT_GPU, + PCNT_SPU, + PCNT_BLIT, + PCNT_GTE, + PCNT_TEST, + PCNT_CNT +}; + +#ifdef PCNT + +#if defined(__ARM_ARCH_7A__) || defined(ARM1176) +#define PCNT_DIV 1000 +#else +#include +#define PCNT_DIV 1 +#endif + +static const char *pcnt_names[PCNT_CNT] = { "", "gpu", "spu", "blit", "gte", "test" }; + +#define PCNT_FRAMES 10 + +extern unsigned int pcounters[PCNT_CNT]; +extern unsigned int pcounter_starts[PCNT_CNT]; + +#define pcnt_start(id) \ + pcounter_starts[id] = pcnt_get() + +#define pcnt_end(id) \ + pcounters[id] += pcnt_get() - pcounter_starts[id] + +void pcnt_hook_plugins(void); + +static inline void pcnt_print(float fps) +{ + static int print_counter; + unsigned int total, rem; + int i; + + for (i = 0; i < PCNT_CNT; i++) + pcounters[i] /= PCNT_DIV * PCNT_FRAMES; + + rem = total = pcounters[PCNT_ALL]; + for (i = 1; i < PCNT_CNT; i++) + rem -= pcounters[i]; + if (!total) + total++; + + if (--print_counter < 0) { + printf(" "); + for (i = 1; i < PCNT_CNT; i++) + printf("%5s ", pcnt_names[i]); + printf("%5s\n", "rem"); + print_counter = 30; + } + + printf("%4.1f ", fps); +#if 0 + static float pcounters_all[PCNT_CNT+1]; + static int pcounter_samples; + pcounter_samples++; + + for (i = 1; i < PCNT_CNT; i++) { + pcounters_all[i] += pcounters[i]; + printf("%5.0f ", pcounters_all[i] / pcounter_samples); + } + pcounters_all[i] += rem; + printf("%5.0f\n", pcounters_all[i] / pcounter_samples); +#else + for (i = 1; i < PCNT_CNT; i++) + printf("%5u ", pcounters[i]); + printf("%5u (", rem); + for (i = 1; i < PCNT_CNT; i++) + printf("%2u ", pcounters[i] * 100 / total); + printf("%2u) %u\n", rem * 100 / total, total); +#endif + memset(pcounters, 0, sizeof(pcounters)); +} + +static inline unsigned int pcnt_get(void) +{ + unsigned int val; +#ifdef __ARM_ARCH_7A__ + __asm__ volatile("mrc p15, 0, %0, c9, c13, 0" + : "=r"(val)); +#elif defined(ARM1176) + __asm__ volatile("mrc p15, 0, %0, c15, c12, 1" + : "=r"(val)); +#else + // all slow on ARM :( + //struct timespec tv; + //clock_gettime(CLOCK_MONOTONIC_RAW, &tv); + //val = tv.tv_sec * 1000000000 + tv.tv_nsec; + struct timeval tv; + gettimeofday(&tv, NULL); + val = tv.tv_sec * 1000000 + tv.tv_usec; +#endif + return val; +} + +static inline void pcnt_init(void) +{ +#ifdef __ARM_ARCH_7A__ + int v; + asm volatile("mrc p15, 0, %0, c9, c12, 0" : "=r"(v)); + v |= 5; // master enable, ccnt reset + v &= ~8; // ccnt divider 0 + asm volatile("mcr p15, 0, %0, c9, c12, 0" :: "r"(v)); + // enable cycle counter + asm volatile("mcr p15, 0, %0, c9, c12, 1" :: "r"(1<<31)); +#elif defined(ARM1176) + int v; + asm volatile("mrc p15, 0, %0, c15, c12, 0" : "=r"(v)); + v |= 5; // master enable, ccnt reset + v &= ~8; // ccnt divider 0 + asm volatile("mcr p15, 0, %0, c15, c12, 0" :: "r"(v)); +#endif +} + +void pcnt_gte_start(int op); +void pcnt_gte_end(int op); + +#else + +#define pcnt_start(id) +#define pcnt_end(id) +#define pcnt_hook_plugins() +#define pcnt_print(fps) + +#endif diff --git a/include/psemu_plugin_defs.h b/include/psemu_plugin_defs.h new file mode 100644 index 0000000..3926ccd --- /dev/null +++ b/include/psemu_plugin_defs.h @@ -0,0 +1,285 @@ +#ifndef _PSEMU_PLUGIN_DEFS_H +#define _PSEMU_PLUGIN_DEFS_H + +#ifdef __cplusplus +extern "C" { +#endif + +// header version +#define _PPDK_HEADER_VERSION 3 + +#define PLUGIN_VERSION 1 + +// plugin type returned by PSEgetLibType (types can be merged if plugin is multi type!) +#define PSE_LT_CDR 1 +#define PSE_LT_GPU 2 +#define PSE_LT_SPU 4 +#define PSE_LT_PAD 8 +#define PSE_LT_NET 16 + +// DLL function return codes +#define PSE_ERR_SUCCESS 0 // every function in DLL if completed sucessfully should return this value +#define PSE_ERR_FATAL -1 // undefined error but fatal one, that kills all functionality + +// XXX_Init return values +// Those return values apply to all libraries +// currently obsolete - preserved for compatibilty + +#define PSE_INIT_ERR_SUCCESS 0 // initialization went OK +#define PSE_INIT_ERR_NOTCONFIGURED -2 // this driver is not configured +#define PSE_INIT_ERR_NOHARDWARE -3 // this driver can not operate properly on this hardware or hardware is not detected + +/* GPU PlugIn */ + +// GPU_Test return values + +// sucess, everything configured, and went OK. +#define PSE_GPU_ERR_SUCCESS 0 + +// ERRORS +// this error might be returned as critical error but none of below +#define PSE_GPU_ERR -20 + + +// this driver is not configured +#define PSE_GPU_ERR_NOTCONFIGURED PSE_GPU_ERR - 1 +// this driver failed Init +#define PSE_GPU_ERR_INIT PSE_GPU_ERR - 2 + +// WARNINGS +// this warning might be returned as undefined warning but allowing driver to continue +#define PSE_GPU_WARN 20 + +// GPU_Query - will be implemented soon + +typedef struct +{ + unsigned int flags; + unsigned int status; + void* window; + unsigned char reserved[100]; +} gpuQueryS; + +// gpuQueryS.flags +// if driver can operate in both modes it must support GPU_changeMode(); +#define PSE_GPU_FLAGS_FULLSCREEN 1 // this driver can operate in fullscreen mode +#define PSE_GPU_FLAGS_WINDOWED 2 // this driver can operate in windowed mode + +// gpuQueryS.status +#define PSE_GPU_STATUS_WINDOWWRONG 1 // this driver cannot operate in this windowed mode + +// GPU_Query End - will be implemented in v2 + + +/* CDR PlugIn */ + +// CDR_Test return values + +// sucess, everything configured, and went OK. +#define PSE_CDR_ERR_SUCCESS 0 + +// general failure (error undefined) +#define PSE_CDR_ERR_FAILURE -1 + +// ERRORS +#define PSE_CDR_ERR -40 +// this driver is not configured +#define PSE_CDR_ERR_NOTCONFIGURED PSE_CDR_ERR - 0 +// if this driver is unable to read data from medium +#define PSE_CDR_ERR_NOREAD PSE_CDR_ERR - 1 + +// WARNINGS +#define PSE_CDR_WARN 40 +// if this driver emulates lame mode ie. can read only 2048 tracks and sector header is emulated +// this might happen to CDROMS that do not support RAW mode reading - surelly it will kill many games +#define PSE_CDR_WARN_LAMECD PSE_CDR_WARN + 0 + + + + +/* SPU PlugIn */ + +// some info retricted (now!) + +// sucess, everything configured, and went OK. +#define PSE_SPU_ERR_SUCCESS 0 + +// ERRORS +// this error might be returned as critical error but none of below +#define PSE_SPU_ERR -60 + +// this driver is not configured +#define PSE_SPU_ERR_NOTCONFIGURED PSE_SPU_ERR - 1 +// this driver failed Init +#define PSE_SPU_ERR_INIT PSE_SPU_ERR - 2 + + +// WARNINGS +// this warning might be returned as undefined warning but allowing driver to continue +#define PSE_SPU_WARN 60 + + + + +/* PAD PlugIn */ + +/* + + functions that must be exported from PAD Plugin + + long PADinit(long flags); // called only once when PSEmu Starts + void PADshutdown(void); // called when PSEmu exits + long PADopen(PadInitS *); // called when PSEmu is running program + long PADclose(void); + long PADconfigure(void); + void PADabout(void); + long PADtest(void); // called from Configure Dialog and after PADopen(); + long PADquery(void); + + unsigned char PADstartPoll(int); + unsigned char PADpoll(unsigned char); + +*/ + +// PADquery responses (notice - values ORed) +// PSEmu will use them also in PADinit to tell Plugin which Ports will use +// notice that PSEmu will call PADinit and PADopen only once when they are from +// same plugin + +// might be used in port 1 +#define PSE_PAD_USE_PORT1 1 +// might be used in port 2 +#define PSE_PAD_USE_PORT2 2 + + + +// MOUSE SCPH-1030 +#define PSE_PAD_TYPE_MOUSE 1 +// NEGCON - 16 button analog controller SLPH-00001 +#define PSE_PAD_TYPE_NEGCON 2 +// GUN CONTROLLER - gun controller SLPH-00014 from Konami +#define PSE_PAD_TYPE_GUN 3 +// STANDARD PAD SCPH-1080, SCPH-1150 +#define PSE_PAD_TYPE_STANDARD 4 +// ANALOG JOYSTICK SCPH-1110 +#define PSE_PAD_TYPE_ANALOGJOY 5 +// GUNCON - gun controller SLPH-00034 from Namco +#define PSE_PAD_TYPE_GUNCON 6 +// ANALOG CONTROLLER SCPH-1150 +#define PSE_PAD_TYPE_ANALOGPAD 7 + + +// sucess, everything configured, and went OK. +#define PSE_PAD_ERR_SUCCESS 0 +// general plugin failure (undefined error) +#define PSE_PAD_ERR_FAILURE -1 + + +// ERRORS +// this error might be returned as critical error but none of below +#define PSE_PAD_ERR -80 +// this driver is not configured +#define PSE_PAD_ERR_NOTCONFIGURED PSE_PAD_ERR - 1 +// this driver failed Init +#define PSE_PAD_ERR_INIT PSE_PAD_ERR - 2 + + +// WARNINGS +// this warning might be returned as undefined warning but allowing driver to continue +#define PSE_PAD_WARN 80 + + +typedef struct +{ + // controler type - fill it withe predefined values above + unsigned char controllerType; + + // status of buttons - every controller fills this field + unsigned short buttonStatus; + + // for analog pad fill those next 4 bytes + // values are analog in range 0-255 where 127 is center position + unsigned char rightJoyX, rightJoyY, leftJoyX, leftJoyY; + + // for mouse fill those next 2 bytes + // values are in range -128 - 127 + unsigned char moveX, moveY; + + unsigned char reserved[91]; + +} PadDataS; + +/* NET PlugIn v2 */ +/* Added by linuzappz@pcsx.net */ + +/* Modes bits for NETsendData/NETrecvData */ +#define PSE_NET_BLOCKING 0x00000000 +#define PSE_NET_NONBLOCKING 0x00000001 + +/* note: unsupported fields should be zeroed. + +typedef struct { + char EmuName[32]; + char CdromID[9]; // ie. 'SCPH12345', no \0 trailing character + char CdromLabel[11]; + void *psxMem; + GPUshowScreenPic GPU_showScreenPic; + GPUdisplayText GPU_displayText; + PADsetSensitive PAD_setSensitive; + char GPUpath[256]; + char SPUpath[256]; + char CDRpath[256]; + char MCD1path[256]; + char MCD2path[256]; + char BIOSpath[256]; // 'HLE' for internal bios + char Unused[1024]; +} netInfo; + +*/ + +/* + basic funcs: + + long NETopen(HWND hWnd) + opens the connection. + shall return 0 on success, else -1. + -1 is also returned if the user selects offline mode. + + long NETclose() + closes the connection. + shall return 0 on success, else -1. + + void NETpause() + this is called when the user paused the emulator. + + void NETresume() + this is called when the user resumed the emulator. + + long NETqueryPlayer() + returns player number + + long NETsendPadData(void *pData, int Size) + this should be called for the first pad only on each side. + + long NETrecvPadData(void *pData, int Pad) + call this for Pad 1/2 to get the data sent by the above func. + + extended funcs: + + long NETsendData(void *pData, int Size, int Mode) + sends Size bytes from pData to the other side. + + long NETrecvData(void *pData, int Size, int Mode) + receives Size bytes from pData to the other side. + + void NETsetInfo(netInfo *info); + sets the netInfo struct. + + void NETkeypressed(int key) (linux only) + key is a XK_?? (X11) keycode. +*/ + +#ifdef __cplusplus +} +#endif +#endif // _PSEMU_PLUGIN_DEFS_H diff --git a/jni/Android.mk b/jni/Android.mk index 6be42b1..98f59f8 100644 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -98,7 +98,7 @@ LOCAL_SRC_FILES += ../frontend/linux/plat.c LOCAL_SRC_FILES += ../frontend/libretro.c LOCAL_CFLAGS += -O3 -ffast-math -funroll-loops -DNDEBUG -D_FILE_OFFSET_BITS=64 -DHAVE_LIBRETRO -DNO_FRONTEND -LOCAL_C_INCLUDES += $(LOCAL_PATH)/../frontend +LOCAL_C_INCLUDES += $(LOCAL_PATH)/../include LOCAL_LDLIBS := -lz -llog include $(BUILD_SHARED_LIBRARY) diff --git a/libpcsxcore/psemu_plugin_defs.h b/libpcsxcore/psemu_plugin_defs.h deleted file mode 100644 index 3926ccd..0000000 --- a/libpcsxcore/psemu_plugin_defs.h +++ /dev/null @@ -1,285 +0,0 @@ -#ifndef _PSEMU_PLUGIN_DEFS_H -#define _PSEMU_PLUGIN_DEFS_H - -#ifdef __cplusplus -extern "C" { -#endif - -// header version -#define _PPDK_HEADER_VERSION 3 - -#define PLUGIN_VERSION 1 - -// plugin type returned by PSEgetLibType (types can be merged if plugin is multi type!) -#define PSE_LT_CDR 1 -#define PSE_LT_GPU 2 -#define PSE_LT_SPU 4 -#define PSE_LT_PAD 8 -#define PSE_LT_NET 16 - -// DLL function return codes -#define PSE_ERR_SUCCESS 0 // every function in DLL if completed sucessfully should return this value -#define PSE_ERR_FATAL -1 // undefined error but fatal one, that kills all functionality - -// XXX_Init return values -// Those return values apply to all libraries -// currently obsolete - preserved for compatibilty - -#define PSE_INIT_ERR_SUCCESS 0 // initialization went OK -#define PSE_INIT_ERR_NOTCONFIGURED -2 // this driver is not configured -#define PSE_INIT_ERR_NOHARDWARE -3 // this driver can not operate properly on this hardware or hardware is not detected - -/* GPU PlugIn */ - -// GPU_Test return values - -// sucess, everything configured, and went OK. -#define PSE_GPU_ERR_SUCCESS 0 - -// ERRORS -// this error might be returned as critical error but none of below -#define PSE_GPU_ERR -20 - - -// this driver is not configured -#define PSE_GPU_ERR_NOTCONFIGURED PSE_GPU_ERR - 1 -// this driver failed Init -#define PSE_GPU_ERR_INIT PSE_GPU_ERR - 2 - -// WARNINGS -// this warning might be returned as undefined warning but allowing driver to continue -#define PSE_GPU_WARN 20 - -// GPU_Query - will be implemented soon - -typedef struct -{ - unsigned int flags; - unsigned int status; - void* window; - unsigned char reserved[100]; -} gpuQueryS; - -// gpuQueryS.flags -// if driver can operate in both modes it must support GPU_changeMode(); -#define PSE_GPU_FLAGS_FULLSCREEN 1 // this driver can operate in fullscreen mode -#define PSE_GPU_FLAGS_WINDOWED 2 // this driver can operate in windowed mode - -// gpuQueryS.status -#define PSE_GPU_STATUS_WINDOWWRONG 1 // this driver cannot operate in this windowed mode - -// GPU_Query End - will be implemented in v2 - - -/* CDR PlugIn */ - -// CDR_Test return values - -// sucess, everything configured, and went OK. -#define PSE_CDR_ERR_SUCCESS 0 - -// general failure (error undefined) -#define PSE_CDR_ERR_FAILURE -1 - -// ERRORS -#define PSE_CDR_ERR -40 -// this driver is not configured -#define PSE_CDR_ERR_NOTCONFIGURED PSE_CDR_ERR - 0 -// if this driver is unable to read data from medium -#define PSE_CDR_ERR_NOREAD PSE_CDR_ERR - 1 - -// WARNINGS -#define PSE_CDR_WARN 40 -// if this driver emulates lame mode ie. can read only 2048 tracks and sector header is emulated -// this might happen to CDROMS that do not support RAW mode reading - surelly it will kill many games -#define PSE_CDR_WARN_LAMECD PSE_CDR_WARN + 0 - - - - -/* SPU PlugIn */ - -// some info retricted (now!) - -// sucess, everything configured, and went OK. -#define PSE_SPU_ERR_SUCCESS 0 - -// ERRORS -// this error might be returned as critical error but none of below -#define PSE_SPU_ERR -60 - -// this driver is not configured -#define PSE_SPU_ERR_NOTCONFIGURED PSE_SPU_ERR - 1 -// this driver failed Init -#define PSE_SPU_ERR_INIT PSE_SPU_ERR - 2 - - -// WARNINGS -// this warning might be returned as undefined warning but allowing driver to continue -#define PSE_SPU_WARN 60 - - - - -/* PAD PlugIn */ - -/* - - functions that must be exported from PAD Plugin - - long PADinit(long flags); // called only once when PSEmu Starts - void PADshutdown(void); // called when PSEmu exits - long PADopen(PadInitS *); // called when PSEmu is running program - long PADclose(void); - long PADconfigure(void); - void PADabout(void); - long PADtest(void); // called from Configure Dialog and after PADopen(); - long PADquery(void); - - unsigned char PADstartPoll(int); - unsigned char PADpoll(unsigned char); - -*/ - -// PADquery responses (notice - values ORed) -// PSEmu will use them also in PADinit to tell Plugin which Ports will use -// notice that PSEmu will call PADinit and PADopen only once when they are from -// same plugin - -// might be used in port 1 -#define PSE_PAD_USE_PORT1 1 -// might be used in port 2 -#define PSE_PAD_USE_PORT2 2 - - - -// MOUSE SCPH-1030 -#define PSE_PAD_TYPE_MOUSE 1 -// NEGCON - 16 button analog controller SLPH-00001 -#define PSE_PAD_TYPE_NEGCON 2 -// GUN CONTROLLER - gun controller SLPH-00014 from Konami -#define PSE_PAD_TYPE_GUN 3 -// STANDARD PAD SCPH-1080, SCPH-1150 -#define PSE_PAD_TYPE_STANDARD 4 -// ANALOG JOYSTICK SCPH-1110 -#define PSE_PAD_TYPE_ANALOGJOY 5 -// GUNCON - gun controller SLPH-00034 from Namco -#define PSE_PAD_TYPE_GUNCON 6 -// ANALOG CONTROLLER SCPH-1150 -#define PSE_PAD_TYPE_ANALOGPAD 7 - - -// sucess, everything configured, and went OK. -#define PSE_PAD_ERR_SUCCESS 0 -// general plugin failure (undefined error) -#define PSE_PAD_ERR_FAILURE -1 - - -// ERRORS -// this error might be returned as critical error but none of below -#define PSE_PAD_ERR -80 -// this driver is not configured -#define PSE_PAD_ERR_NOTCONFIGURED PSE_PAD_ERR - 1 -// this driver failed Init -#define PSE_PAD_ERR_INIT PSE_PAD_ERR - 2 - - -// WARNINGS -// this warning might be returned as undefined warning but allowing driver to continue -#define PSE_PAD_WARN 80 - - -typedef struct -{ - // controler type - fill it withe predefined values above - unsigned char controllerType; - - // status of buttons - every controller fills this field - unsigned short buttonStatus; - - // for analog pad fill those next 4 bytes - // values are analog in range 0-255 where 127 is center position - unsigned char rightJoyX, rightJoyY, leftJoyX, leftJoyY; - - // for mouse fill those next 2 bytes - // values are in range -128 - 127 - unsigned char moveX, moveY; - - unsigned char reserved[91]; - -} PadDataS; - -/* NET PlugIn v2 */ -/* Added by linuzappz@pcsx.net */ - -/* Modes bits for NETsendData/NETrecvData */ -#define PSE_NET_BLOCKING 0x00000000 -#define PSE_NET_NONBLOCKING 0x00000001 - -/* note: unsupported fields should be zeroed. - -typedef struct { - char EmuName[32]; - char CdromID[9]; // ie. 'SCPH12345', no \0 trailing character - char CdromLabel[11]; - void *psxMem; - GPUshowScreenPic GPU_showScreenPic; - GPUdisplayText GPU_displayText; - PADsetSensitive PAD_setSensitive; - char GPUpath[256]; - char SPUpath[256]; - char CDRpath[256]; - char MCD1path[256]; - char MCD2path[256]; - char BIOSpath[256]; // 'HLE' for internal bios - char Unused[1024]; -} netInfo; - -*/ - -/* - basic funcs: - - long NETopen(HWND hWnd) - opens the connection. - shall return 0 on success, else -1. - -1 is also returned if the user selects offline mode. - - long NETclose() - closes the connection. - shall return 0 on success, else -1. - - void NETpause() - this is called when the user paused the emulator. - - void NETresume() - this is called when the user resumed the emulator. - - long NETqueryPlayer() - returns player number - - long NETsendPadData(void *pData, int Size) - this should be called for the first pad only on each side. - - long NETrecvPadData(void *pData, int Pad) - call this for Pad 1/2 to get the data sent by the above func. - - extended funcs: - - long NETsendData(void *pData, int Size, int Mode) - sends Size bytes from pData to the other side. - - long NETrecvData(void *pData, int Size, int Mode) - receives Size bytes from pData to the other side. - - void NETsetInfo(netInfo *info); - sets the netInfo struct. - - void NETkeypressed(int key) (linux only) - key is a XK_?? (X11) keycode. -*/ - -#ifdef __cplusplus -} -#endif -#endif // _PSEMU_PLUGIN_DEFS_H diff --git a/plugins/dfinput/main.h b/plugins/dfinput/main.h index 15d05e7..e83306a 100644 --- a/plugins/dfinput/main.h +++ b/plugins/dfinput/main.h @@ -1,4 +1,4 @@ -#include "../../libpcsxcore/psemu_plugin_defs.h" +#include "psemu_plugin_defs.h" #include "externals.h" extern unsigned char CurPad, CurByte, CurCmd, CmdLen; diff --git a/plugins/dfinput/pad.c b/plugins/dfinput/pad.c index a8019b9..53a254a 100644 --- a/plugins/dfinput/pad.c +++ b/plugins/dfinput/pad.c @@ -21,7 +21,7 @@ #include -#include "../../libpcsxcore/psemu_plugin_defs.h" +#include "psemu_plugin_defs.h" #include "main.h" enum { diff --git a/plugins/dfxvideo/Makefile b/plugins/dfxvideo/Makefile index 250cc49..580e735 100644 --- a/plugins/dfxvideo/Makefile +++ b/plugins/dfxvideo/Makefile @@ -1,7 +1,6 @@ CFLAGS += -Wall -ggdb -O2 CFLAGS += -fno-strict-aliasing -ffast-math -# ugh -CFLAGS += -I../../libpcsxcore +CFLAGS += -I../../include include ../../config.mak diff --git a/plugins/dfxvideo/draw_pl.c b/plugins/dfxvideo/draw_pl.c index ed07e75..61fb94c 100644 --- a/plugins/dfxvideo/draw_pl.c +++ b/plugins/dfxvideo/draw_pl.c @@ -11,7 +11,7 @@ #include "../gpulib/cspace.h" #include "../../frontend/plugin_lib.h" -#include "../../frontend/pcnt.h" +#include "pcnt.h" // misc globals long lLowerpart; diff --git a/plugins/gpu_unai/Makefile b/plugins/gpu_unai/Makefile index cf2e5d2..994997f 100644 --- a/plugins/gpu_unai/Makefile +++ b/plugins/gpu_unai/Makefile @@ -1,5 +1,6 @@ CFLAGS += -ggdb -Wall -O3 -ffast-math CFLAGS += -DREARMED +CFLAGS += -I../../include include ../../config.mak -- cgit v1.2.3