endif
CFLAGS += -fPIC
-ifneq ($(platform),qnx)
+ifeq ($(platform),win)
+ MAIN_LDLIBS += -lws2_32
+else ifneq ($(platform),qnx)
LDLIBS += -lpthread
MAIN_LDLIBS += -ldl
endif
/*
- * (C) notaz, 2012
+ * (C) notaz, 2012,2014,2015
*
* This work is licensed under the terms of the GNU GPLv2 or later.
* See the COPYING file in the top-level directory.
}
}
-#ifdef __QNX__
+#if defined(__QNX__) || defined(_WIN32)
/* Blackberry QNX doesn't have strcasestr */
/*
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
-#include <dlfcn.h>
-#include <sys/stat.h>
-#include <sys/types.h>
#include <unistd.h>
#include <signal.h>
#include <time.h>
+#ifndef _WIN32
+#include <dlfcn.h>
+#endif
#include "main.h"
#include "plugin.h"
spu_config.iXAPitch = 0;
spu_config.iVolume = 768;
spu_config.iTempo = 0;
-#if defined(__arm__) && !defined(__ARM_ARCH_7A__) /* XXX */
+#if defined(__arm__) && !defined(__ARM_ARCH_7A__) /* XXX GPH hack */
spu_config.iUseReverb = 0;
spu_config.iUseInterpolation = 0;
spu_config.iTempo = 1;
}
#ifndef NO_FRONTEND
+
+#include <sys/stat.h>
+#include <sys/types.h>
+
static void create_profile_dir(const char *directory) {
char path[MAXPATHLEN];
return ret;
ret = SaveState(fname);
-#ifndef __ARM_ARCH_7A__ /* XXX */
+#if defined(__arm__) && !defined(__ARM_ARCH_7A__) /* XXX GPH hack */
sync();
#endif
SysPrintf("* %s \"%s\" [%d]\n",
void *SysLoadLibrary(const char *lib) {
const char *tmp = strrchr(lib, '/');
- void *ret;
+ void *ret = NULL;
int i;
SysPrintf("plugin: %s\n", lib);
return (void *)(long)(PLUGIN_DL_BASE + builtin_plugin_ids[i]);
}
+#ifndef _WIN32
ret = dlopen(lib, RTLD_NOW);
if (ret == NULL)
SysMessage("dlopen: %s", dlerror());
+#else
+ /* no external plugin support, abi is no longer
+ * compatible with psemu/pcsx anyway */
+#endif
return ret;
}
if (PLUGIN_DL_BASE <= plugid && plugid < PLUGIN_DL_BASE + ARRAY_SIZE(builtin_plugins))
return plugin_link(plugid - PLUGIN_DL_BASE, sym);
+#ifndef _WIN32
return dlsym(lib, sym);
+#else
+ return NULL;
+#endif
}
const char *SysLibError() {
+#ifndef _WIN32
return dlerror();
+#else
+ return "not supported";
+#endif
}
void SysCloseLibrary(void *lib) {
if (PLUGIN_DL_BASE <= plugid && plugid < PLUGIN_DL_BASE + ARRAY_SIZE(builtin_plugins))
return;
+#ifndef _WIN32
dlclose(lib);
+#endif
}
#include "../libpcsxcore/system.h"
#include "../plugins/cdrcimg/cdrcimg.h"
+#ifndef _WIN32
+#define CALLBACK
+#else
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#endif
+
static int dummy_func() {
return 0;
}
/* SPU */
-extern long SPUopen(void);
-extern long SPUinit(void);
-extern long SPUshutdown(void);
-extern long SPUclose(void);
-extern void SPUplaySample(unsigned char);
-extern void SPUwriteRegister(unsigned long, unsigned short, unsigned int);
-extern unsigned short SPUreadRegister(unsigned long);
-extern void SPUwriteDMA(unsigned short);
-extern unsigned short SPUreadDMA(void);
-extern void SPUwriteDMAMem(unsigned short *, int, unsigned int);
-extern void SPUreadDMAMem(unsigned short *, int, unsigned int);
-extern void SPUplayADPCMchannel(void *);
-extern void SPUregisterCallback(void (*cb)(void));
-extern void SPUregisterScheduleCb(void (*cb)(unsigned int));
-extern long SPUconfigure(void);
-extern long SPUtest(void);
-extern void SPUabout(void);
-extern long SPUfreeze(unsigned int, void *, unsigned int);
-extern void SPUasync(unsigned int, unsigned int);
-extern int SPUplayCDDAchannel(short *, int);
+extern long CALLBACK SPUopen(void);
+extern long CALLBACK SPUinit(void);
+extern long CALLBACK SPUshutdown(void);
+extern long CALLBACK SPUclose(void);
+extern void CALLBACK SPUplaySample(unsigned char);
+extern void CALLBACK SPUwriteRegister(unsigned long, unsigned short, unsigned int);
+extern unsigned short CALLBACK SPUreadRegister(unsigned long);
+extern void CALLBACK SPUwriteDMA(unsigned short);
+extern unsigned short CALLBACK SPUreadDMA(void);
+extern void CALLBACK SPUwriteDMAMem(unsigned short *, int, unsigned int);
+extern void CALLBACK SPUreadDMAMem(unsigned short *, int, unsigned int);
+extern void CALLBACK SPUplayADPCMchannel(void *);
+extern void CALLBACK SPUregisterCallback(void (*cb)(void));
+extern void CALLBACK SPUregisterScheduleCb(void (*cb)(unsigned int));
+extern long CALLBACK SPUconfigure(void);
+extern long CALLBACK SPUtest(void);
+extern void CALLBACK SPUabout(void);
+extern long CALLBACK SPUfreeze(unsigned int, void *, unsigned int);
+extern void CALLBACK SPUasync(unsigned int, unsigned int);
+extern int CALLBACK SPUplayCDDAchannel(short *, int);
/* PAD */
static long PADreadPort1(PadDataS *pad)
#include "ppf.h"
#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
#include <process.h>
#include <windows.h>
#define strcasecmp _stricmp
+#define usleep(x) Sleep((x) / 1000)
#else
#include <pthread.h>
#include <sys/time.h>
#define STATUS_ERROR (1<<0) // 0x01
/* Errors */
-#define ERROR_NOT_READY (1<<7) // 0x80
+#define ERROR_NOTREADY (1<<7) // 0x80
#define ERROR_INVALIDCMD (1<<6) // 0x40
#define ERROR_INVALIDARG (1<<5) // 0x20
case DRIVESTATE_PREPARE_CD:
SetResultSize(2);
cdr.Result[0] = cdr.StatP | STATUS_ERROR;
- cdr.Result[1] = ERROR_NOT_READY;
+ cdr.Result[1] = ERROR_NOTREADY;
cdr.Stat = DiskError;
break;
}
#include <errno.h>
#include <io.h>
-#include "mman.h"
+#include "memmap.h"
#ifndef FILE_MAP_EXECUTE
#define FILE_MAP_EXECUTE 0x0020
{
extern void (*psxCP2[64])();
extern void psxNULL();
- extern u_char *out;
+ extern unsigned char *out;
size_t i;
new_dynarec_init();
void *psxH_ptr;
void *zeromem_ptr;
u8 zero_mem[0x1000];
-u_char *out;
+unsigned char *out;
void *mem_rtab;
void *scratch_buf_ptr;
void new_dynarec_init() { (void)ari64_execute; }
map_rcnt_rcount2(rcnts[2].mode);
}
-int pcsxmem_is_handler_dynamic(u_int addr)
+int pcsxmem_is_handler_dynamic(unsigned int addr)
{
if ((addr & 0xfffff000) != 0x1f801000)
return 0;
void new_dyna_pcsx_mem_load_state(void);
void new_dyna_pcsx_mem_shutdown(void);
-int pcsxmem_is_handler_dynamic(u_int addr);
+int pcsxmem_is_handler_dynamic(unsigned int addr);
typedef void* HWND;\r
#define CALLBACK\r
\r
-typedef long (*GPUopen)(unsigned long *, char *, char *);\r
-typedef long (*SPUopen)(void);\r
-typedef long (*PADopen)(unsigned long *);\r
-typedef long (*NETopen)(unsigned long *);\r
-typedef long (*SIO1open)(unsigned long *);\r
-\r
#else\r
\r
+#define WIN32_LEAN_AND_MEAN\r
#include <windows.h>\r
\r
-typedef long (CALLBACK* GPUopen)(HWND);\r
-typedef long (CALLBACK* SPUopen)(HWND);\r
-typedef long (CALLBACK* PADopen)(HWND);\r
-typedef long (CALLBACK* NETopen)(HWND);\r
-typedef long (CALLBACK* SIO1open)(HWND);\r
-\r
#endif\r
\r
+typedef long (CALLBACK *GPUopen)(unsigned long *, char *, char *);\r
+typedef long (CALLBACK *SPUopen)(void);\r
+typedef long (CALLBACK *PADopen)(unsigned long *);\r
+typedef long (CALLBACK *NETopen)(unsigned long *);\r
+typedef long (CALLBACK *SIO1open)(unsigned long *);\r
+\r
#include "spu.h"\r
\r
#include "psemu_plugin_defs.h"\r
#include <string.h>
#include <stdlib.h>
#include <zlib.h>
+#ifndef _WIN32
+#define CALLBACK
#include <dlfcn.h>
+#else
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#endif
#include "cdrcimg.h"
static int current_block, current_sect_in_blk;
struct CdrStat;
-extern long CDR__getStatus(struct CdrStat *stat);
+extern long CALLBACK CDR__getStatus(struct CdrStat *stat);
struct CdrStat
{
return -1;
}
}
+#ifndef _WIN32
if (pBZ2_bzBuffToBuffDecompress == NULL) {
void *h = dlopen("/usr/lib/libbz2.so.1", RTLD_LAZY);
if (h == NULL)
}
}
}
+#endif
return 0;
}
* See the COPYING file in the top-level directory.
*/
+#ifndef _WIN32
+#define CALLBACK
+#else
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#endif
+
#include "main.h"
unsigned char CurPad, CurByte, CurCmd, CmdLen;
/* since this is not a proper plugin, so we'll hook emu internals in a hackish way like this */
extern void *PAD1_startPoll, *PAD1_poll;
extern void *PAD2_startPoll, *PAD2_poll;
-extern unsigned char PAD1__startPoll(int pad);
-extern unsigned char PAD2__startPoll(int pad);
-extern unsigned char PAD1__poll(unsigned char value);
-extern unsigned char PAD2__poll(unsigned char value);
+extern unsigned char CALLBACK PAD1__startPoll(int pad);
+extern unsigned char CALLBACK PAD2__startPoll(int pad);
+extern unsigned char CALLBACK PAD1__poll(unsigned char value);
+extern unsigned char CALLBACK PAD2__poll(unsigned char value);
static int old_controller_type1 = -1, old_controller_type2 = -1;
* *
***************************************************************************/
+#ifndef _WIN32
+#include <sys/time.h> // gettimeofday in xa.c
+#endif
#include "stdafx.h"
#define _IN_SPU
#include "arm_features.h"
#include "spu_config.h"
-#ifdef ENABLE_NLS
-#include <libintl.h>
-#include <locale.h>
-#define _(x) gettext(x)
-#define N_(x) (x)
-#else
-#define _(x) (x)
-#define N_(x) (x)
-#endif
-
#ifdef __ARM_ARCH_7A__
#define ssat32_to_16(v) \
asm("ssat %0,#16,%1" : "=r" (v) : "r" (v))
* *
***************************************************************************/
-#ifndef _MACOSX
-#include "config.h"
-#endif
#include <stdio.h>
#include <stdlib.h>
-#include <sys/ioctl.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <pthread.h>
-#define RRand(range) (random()%range)
#include <string.h>
-#include <sys/time.h>
-#include <math.h>
+#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#else
#undef CALLBACK
#define CALLBACK
#define DWORD unsigned int
-#define LOWORD(l) ((unsigned short)(l))
-#define HIWORD(l) ((unsigned short)(((unsigned int)(l) >> 16) & 0xFFFF))
+#define LOWORD(l) ((unsigned short)(l))
+#define HIWORD(l) ((unsigned short)(((unsigned int)(l) >> 16) & 0xFFFF))
+#endif
#ifndef INLINE
#define INLINE static inline
static unsigned long timeGetTime_spu()
{
+#ifdef _WIN32
+ return GetTickCount();
+#else
struct timeval tv;
gettimeofday(&tv, 0); // well, maybe there are better ways
return tv.tv_sec * 1000 + tv.tv_usec/1000; // to do that, but at least it works
+#endif
}
////////////////////////////////////////////////////////////////////////