diff --git a/bin/patches/FA7E3081.pnach b/bin/patches/FA7E3081.pnach index aa9415b..a252a14 100644 --- a/bin/patches/FA7E3081.pnach +++ b/bin/patches/FA7E3081.pnach @@ -1,4 +1,7 @@ -gametitle=Katamari Damacy [SLUS 21008] (U) [FA7E3081] -comment=Skips Video (sceMpegIsEnd) -//Skip Videos -patch=0,EE,0018e9e8,word,24020001 \ No newline at end of file +gametitle=kata +comment= +//Skip Intro Videos +patch=0,EE,0018e9e8,word,24020001 +//0018e4c8 +//0018e11c +//0018e020 \ No newline at end of file diff --git a/pcsx2/Linux/LnxMain.c b/pcsx2/Linux/LnxMain.c index 12e2900..500649f 100644 --- a/pcsx2/Linux/LnxMain.c +++ b/pcsx2/Linux/LnxMain.c @@ -23,7 +23,7 @@ #include #include #include -#include +//#include #include #include #include diff --git a/pcsx2/Misc.c b/pcsx2/Misc.c index 838b4b4..ac79b92 100644 --- a/pcsx2/Misc.c +++ b/pcsx2/Misc.c @@ -40,7 +40,7 @@ #include "Cache.h" -u32 dwSaveVersion = 0x7a30000f; +u32 dwSaveVersion = 0x7a300010; u32 dwCurSaveStateVer = 0; extern u32 s_iLastCOP0Cycle; extern u32 s_iLastPERFCycle[2]; @@ -624,7 +624,8 @@ int LoadState(char *file) { if( dwCurSaveStateVer != dwSaveVersion ) { - if( dwCurSaveStateVer != 0x7a30000d && dwCurSaveStateVer != 0x7a30000e ) { + // pcsx2 supports opening these formats + if( dwCurSaveStateVer != 0x7a30000d && dwCurSaveStateVer != 0x7a30000e && dwCurSaveStateVer != 0x7a30000f) { gzclose(f); SysPrintf("Save state wrong version\n"); return 0; diff --git a/pcsx2/PS2Etypes.h b/pcsx2/PS2Etypes.h index db52bb8..101dba9 100644 --- a/pcsx2/PS2Etypes.h +++ b/pcsx2/PS2Etypes.h @@ -1,88 +1,88 @@ -#ifndef __PS2ETYPES_H__ -#define __PS2ETYPES_H__ - -#if defined (__linux__) && !defined(__LINUX__) // some distributions are lower case -#define __LINUX__ -#endif - +#ifndef __PS2ETYPES_H__ +#define __PS2ETYPES_H__ + +#if defined (__linux__) && !defined(__LINUX__) // some distributions are lower case +#define __LINUX__ +#endif + #ifdef __CYGWIN__ -#define _WIN32 -#endif - -#ifdef _WIN32 -#include -#endif - -#ifndef ARRAYSIZE -#define ARRAYSIZE(x) (sizeof(x)/sizeof((x)[0])) -#endif - - -// Basic types -#if defined(_MSC_VER) - -typedef __int8 s8; -typedef __int16 s16; -typedef __int32 s32; -typedef __int64 s64; - -typedef unsigned __int8 u8; -typedef unsigned __int16 u16; -typedef unsigned __int32 u32; -typedef unsigned __int64 u64; - -#define PCSX2_ALIGNED16(x) __declspec(align(16)) x -#define PCSX2_ALIGNED16_DECL(x) __declspec(align(16)) x - -#else - -typedef char s8; -typedef short s16; -typedef int s32; -typedef long long s64; - -typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned int u32; -typedef unsigned long long u64; - -#ifdef __LINUX__ -typedef union _LARGE_INTEGER -{ - long long QuadPart; -} LARGE_INTEGER; -#endif - -#if defined(__MINGW32__) -#define PCSX2_ALIGNED16(x) __declspec(align(16)) x -#else -#define PCSX2_ALIGNED16(x) x __attribute((aligned(16))) -#endif - -#define PCSX2_ALIGNED16_DECL(x) x - -#ifndef __forceinline -#define __forceinline inline -#endif - -#endif // _MSC_VER - -#if defined(__x86_64__) -typedef u64 uptr; -typedef s64 sptr; -#else -typedef u32 uptr; -typedef s32 sptr; -#endif - -typedef struct { - int size; - s8 *data; -} freezeData; - -/* common defines */ -#ifndef C_ASSERT -#define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1] -#endif - -#endif /* __PS2ETYPES_H__ */ +#define __LINUX__ +#endif + +#ifdef _WIN32 +#include +#endif + +#ifndef ARRAYSIZE +#define ARRAYSIZE(x) (sizeof(x)/sizeof((x)[0])) +#endif + + +// Basic types +#if defined(_MSC_VER) + +typedef __int8 s8; +typedef __int16 s16; +typedef __int32 s32; +typedef __int64 s64; + +typedef unsigned __int8 u8; +typedef unsigned __int16 u16; +typedef unsigned __int32 u32; +typedef unsigned __int64 u64; + +#define PCSX2_ALIGNED16(x) __declspec(align(16)) x +#define PCSX2_ALIGNED16_DECL(x) __declspec(align(16)) x + +#else + +typedef char s8; +typedef short s16; +typedef int s32; +typedef long long s64; + +typedef unsigned char u8; +typedef unsigned short u16; +typedef unsigned int u32; +typedef unsigned long long u64; + +#ifdef __LINUX__ +typedef union _LARGE_INTEGER +{ + long long QuadPart; +} LARGE_INTEGER; +#endif + +#if defined(__MINGW32__) +#define PCSX2_ALIGNED16(x) __declspec(align(16)) x +#else +#define PCSX2_ALIGNED16(x) x __attribute((aligned(16))) +#endif + +#define PCSX2_ALIGNED16_DECL(x) x + +#ifndef __forceinline +#define __forceinline inline +#endif + +#endif // _MSC_VER + +#if defined(__x86_64__) +typedef u64 uptr; +typedef s64 sptr; +#else +typedef u32 uptr; +typedef s32 sptr; +#endif + +typedef struct { + int size; + s8 *data; +} freezeData; + +/* common defines */ +#ifndef C_ASSERT +#define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1] +#endif + +#endif /* __PS2ETYPES_H__ */ diff --git a/pcsx2/PsxCounters.c b/pcsx2/PsxCounters.c index e504d1f..45a99d1 100644 --- a/pcsx2/PsxCounters.c +++ b/pcsx2/PsxCounters.c @@ -695,8 +695,23 @@ u64 psxRcntCycles(int index) { return (u64)(psxCounters[index].count + (u32)((psxRegs.cycle - psxCounters[index].sCycleT) / psxCounters[index].rate)); } -int psxRcntFreeze(gzFile f, int Mode) { - gzfreezel(psxCounters); +extern u32 dwCurSaveStateVer; +int psxRcntFreeze(gzFile f, int Mode) +{ + if( Mode == 0 && (dwCurSaveStateVer < 0x7a300010) ) { // reading + // struct used to be 32bit count and target + int i; + u32 val; + for(i = 0; i < ARRAYSIZE(psxCounters); ++i) { + gzfreeze(&val,4); psxCounters[i].count = val; + gzfreeze(&val,4); psxCounters[i].mode = val; + gzfreeze(&val,4); psxCounters[i].target = val; + gzfreeze((u8*)&psxCounters[i].rate, sizeof(psxCounters[i])-20); + } + } + else + gzfreezel(psxCounters); + return 0; } diff --git a/pcsx2/PsxCounters.h b/pcsx2/PsxCounters.h index 2ee2a5d..ab25d35 100644 --- a/pcsx2/PsxCounters.h +++ b/pcsx2/PsxCounters.h @@ -20,7 +20,8 @@ #define __PSXCOUNTERS_H__ typedef struct { - u64 count, mode, target; + u64 count, target; + u32 mode; u32 rate, interrupt, otarget; u32 sCycle, Cycle; u32 sCycleT, CycleT; diff --git a/pcsx2/R5900.c b/pcsx2/R5900.c index 86aaf45..f4781ab 100644 --- a/pcsx2/R5900.c +++ b/pcsx2/R5900.c @@ -542,6 +542,17 @@ void cpuExecuteBios() } bExecBIOS = FALSE; +// { +// FILE* f = fopen("eebios.bin", "wb"); +// fwrite(PSM(0x80000000), 0x100000, 1, f); +// fclose(f); +// exit(0); + +// f = fopen("iopbios.bin", "wb"); +// fwrite(PS2MEM_PSX, 0x80000, 1, f); +// fclose(f); +// } + // REC_CLEARM(0x00200008); // REC_CLEARM(0x00100008); // REC_CLEARM(cpuRegs.pc); @@ -578,7 +589,7 @@ void IntcpuBranchTest() g_EEFreezeRegs = 0; #endif - g_nextBranchCycle = cpuRegs.cycle + EE_WAIT_CYCLE; + g_nextBranchCycle = cpuRegs.cycle + EE_WAIT_CYCLE; if ((int)(cpuRegs.cycle - nextsCounter) >= nextCounter) rcntUpdate(); diff --git a/pcsx2/VU0micro.c b/pcsx2/VU0micro.c index 09f6447..ce615a4 100644 --- a/pcsx2/VU0micro.c +++ b/pcsx2/VU0micro.c @@ -74,6 +74,7 @@ int vu0Init() memLUT[0x11003].aPFNs = &s_psVuMem.aPFNs[0]; memLUT[0x11003].aVFNs = &s_psVuMem.aVFNs[0]; // since vuregisters are mapped in vumem0, go to diff addr, but mapping to same physical addr + VirtualFree((void*)0x11000000, 0x10000, MEM_RELEASE); // free just in case VU0.Mem = VirtualAlloc((void*)0x11000000, 0x10000, MEM_RESERVE|MEM_PHYSICAL, PAGE_READWRITE); if( VU0.Mem != (void*)0x11000000 ) { diff --git a/plugins/gs/zerogs/opengl/PS2Edefs.h b/plugins/gs/zerogs/opengl/PS2Edefs.h index b2f76c9..223a034 100644 --- a/plugins/gs/zerogs/opengl/PS2Edefs.h +++ b/plugins/gs/zerogs/opengl/PS2Edefs.h @@ -438,6 +438,8 @@ u32 CALLBACK USBread32(u32 addr); void CALLBACK USBwrite8(u32 addr, u8 value); void CALLBACK USBwrite16(u32 addr, u16 value); void CALLBACK USBwrite32(u32 addr, u32 value); +void CALLBACK USBasync(u32 cycles); + // cycles = IOP cycles before calling callback, // if callback returns 1 the irq is triggered, else not void CALLBACK USBirqCallback(USBcallback callback); @@ -636,6 +638,9 @@ typedef u32 (CALLBACK* _USBread32)(u32 mem); typedef void (CALLBACK* _USBwrite8)(u32 mem, u8 value); typedef void (CALLBACK* _USBwrite16)(u32 mem, u16 value); typedef void (CALLBACK* _USBwrite32)(u32 mem, u32 value); +typedef void (CALLBACK* _USBasync)(u32 cycles); + + typedef void (CALLBACK* _USBirqCallback)(USBcallback callback); typedef USBhandler (CALLBACK* _USBirqHandler)(void); typedef void (CALLBACK* _USBsetRAM)(void *mem); @@ -821,6 +826,8 @@ _USBread32 USBread32; _USBwrite8 USBwrite8; _USBwrite16 USBwrite16; _USBwrite32 USBwrite32; +_USBasync USBasync; + _USBirqCallback USBirqCallback; _USBirqHandler USBirqHandler; _USBsetRAM USBsetRAM; diff --git a/plugins/gs/zerogs/opengl/PS2Etypes.h b/plugins/gs/zerogs/opengl/PS2Etypes.h index 1ad73e2..101dba9 100644 --- a/plugins/gs/zerogs/opengl/PS2Etypes.h +++ b/plugins/gs/zerogs/opengl/PS2Etypes.h @@ -1,76 +1,88 @@ -#ifndef __PS2ETYPES_H__ -#define __PS2ETYPES_H__ - -#ifndef ARRAYSIZE -#define ARRAYSIZE(x) (sizeof(x)/sizeof((x)[0])) -#endif - -#if defined (__linux__) && !defined(__LINUX__) // some distributions are lower case -#define __LINUX__ -#endif - -// Basic types -#if defined(_MSC_VER) - -typedef __int8 s8; -typedef __int16 s16; -typedef __int32 s32; -typedef __int64 s64; - -typedef unsigned __int8 u8; -typedef unsigned __int16 u16; -typedef unsigned __int32 u32; -typedef unsigned __int64 u64; - -#define PCSX2_ALIGNED16(x) __declspec(align(16)) x - -#else - -typedef char s8; -typedef short s16; -typedef int s32; -typedef long long s64; - -typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned int u32; -typedef unsigned long long u64; - -#ifdef __LINUX__ -typedef union _LARGE_INTEGER -{ - long long QuadPart; -} LARGE_INTEGER; -#endif - -#if defined(__MINGW32__) -#define PCSX2_ALIGNED16(x) __declspec(align(16)) x -#else -#define PCSX2_ALIGNED16(x) x __attribute((aligned(16))) -#endif - -#ifndef __forceinline -#define __forceinline inline -#endif - -#endif // _MSC_VER - -#if defined(__x86_64__) -typedef u64 uptr; -typedef s64 sptr; -#else -typedef u32 uptr; -typedef s32 sptr; -#endif - -typedef struct { - int size; - s8 *data; -} freezeData; - -/* common defines */ -#ifndef C_ASSERT -#define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1] -#endif - -#endif /* __PS2ETYPES_H__ */ +#ifndef __PS2ETYPES_H__ +#define __PS2ETYPES_H__ + +#if defined (__linux__) && !defined(__LINUX__) // some distributions are lower case +#define __LINUX__ +#endif + +#ifdef __CYGWIN__ +#define __LINUX__ +#endif + +#ifdef _WIN32 +#include +#endif + +#ifndef ARRAYSIZE +#define ARRAYSIZE(x) (sizeof(x)/sizeof((x)[0])) +#endif + + +// Basic types +#if defined(_MSC_VER) + +typedef __int8 s8; +typedef __int16 s16; +typedef __int32 s32; +typedef __int64 s64; + +typedef unsigned __int8 u8; +typedef unsigned __int16 u16; +typedef unsigned __int32 u32; +typedef unsigned __int64 u64; + +#define PCSX2_ALIGNED16(x) __declspec(align(16)) x +#define PCSX2_ALIGNED16_DECL(x) __declspec(align(16)) x + +#else + +typedef char s8; +typedef short s16; +typedef int s32; +typedef long long s64; + +typedef unsigned char u8; +typedef unsigned short u16; +typedef unsigned int u32; +typedef unsigned long long u64; + +#ifdef __LINUX__ +typedef union _LARGE_INTEGER +{ + long long QuadPart; +} LARGE_INTEGER; +#endif + +#if defined(__MINGW32__) +#define PCSX2_ALIGNED16(x) __declspec(align(16)) x +#else +#define PCSX2_ALIGNED16(x) x __attribute((aligned(16))) +#endif + +#define PCSX2_ALIGNED16_DECL(x) x + +#ifndef __forceinline +#define __forceinline inline +#endif + +#endif // _MSC_VER + +#if defined(__x86_64__) +typedef u64 uptr; +typedef s64 sptr; +#else +typedef u32 uptr; +typedef s32 sptr; +#endif + +typedef struct { + int size; + s8 *data; +} freezeData; + +/* common defines */ +#ifndef C_ASSERT +#define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1] +#endif + +#endif /* __PS2ETYPES_H__ */ diff --git a/plugins/pad/zeropad/PS2Edefs.h b/plugins/pad/zeropad/PS2Edefs.h index b2f76c9..223a034 100644 --- a/plugins/pad/zeropad/PS2Edefs.h +++ b/plugins/pad/zeropad/PS2Edefs.h @@ -438,6 +438,8 @@ u32 CALLBACK USBread32(u32 addr); void CALLBACK USBwrite8(u32 addr, u8 value); void CALLBACK USBwrite16(u32 addr, u16 value); void CALLBACK USBwrite32(u32 addr, u32 value); +void CALLBACK USBasync(u32 cycles); + // cycles = IOP cycles before calling callback, // if callback returns 1 the irq is triggered, else not void CALLBACK USBirqCallback(USBcallback callback); @@ -636,6 +638,9 @@ typedef u32 (CALLBACK* _USBread32)(u32 mem); typedef void (CALLBACK* _USBwrite8)(u32 mem, u8 value); typedef void (CALLBACK* _USBwrite16)(u32 mem, u16 value); typedef void (CALLBACK* _USBwrite32)(u32 mem, u32 value); +typedef void (CALLBACK* _USBasync)(u32 cycles); + + typedef void (CALLBACK* _USBirqCallback)(USBcallback callback); typedef USBhandler (CALLBACK* _USBirqHandler)(void); typedef void (CALLBACK* _USBsetRAM)(void *mem); @@ -821,6 +826,8 @@ _USBread32 USBread32; _USBwrite8 USBwrite8; _USBwrite16 USBwrite16; _USBwrite32 USBwrite32; +_USBasync USBasync; + _USBirqCallback USBirqCallback; _USBirqHandler USBirqHandler; _USBsetRAM USBsetRAM; diff --git a/plugins/pad/zeropad/PS2Etypes.h b/plugins/pad/zeropad/PS2Etypes.h index db52bb8..101dba9 100644 --- a/plugins/pad/zeropad/PS2Etypes.h +++ b/plugins/pad/zeropad/PS2Etypes.h @@ -1,88 +1,88 @@ -#ifndef __PS2ETYPES_H__ -#define __PS2ETYPES_H__ - -#if defined (__linux__) && !defined(__LINUX__) // some distributions are lower case -#define __LINUX__ -#endif - +#ifndef __PS2ETYPES_H__ +#define __PS2ETYPES_H__ + +#if defined (__linux__) && !defined(__LINUX__) // some distributions are lower case +#define __LINUX__ +#endif + #ifdef __CYGWIN__ -#define _WIN32 -#endif - -#ifdef _WIN32 -#include -#endif - -#ifndef ARRAYSIZE -#define ARRAYSIZE(x) (sizeof(x)/sizeof((x)[0])) -#endif - - -// Basic types -#if defined(_MSC_VER) - -typedef __int8 s8; -typedef __int16 s16; -typedef __int32 s32; -typedef __int64 s64; - -typedef unsigned __int8 u8; -typedef unsigned __int16 u16; -typedef unsigned __int32 u32; -typedef unsigned __int64 u64; - -#define PCSX2_ALIGNED16(x) __declspec(align(16)) x -#define PCSX2_ALIGNED16_DECL(x) __declspec(align(16)) x - -#else - -typedef char s8; -typedef short s16; -typedef int s32; -typedef long long s64; - -typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned int u32; -typedef unsigned long long u64; - -#ifdef __LINUX__ -typedef union _LARGE_INTEGER -{ - long long QuadPart; -} LARGE_INTEGER; -#endif - -#if defined(__MINGW32__) -#define PCSX2_ALIGNED16(x) __declspec(align(16)) x -#else -#define PCSX2_ALIGNED16(x) x __attribute((aligned(16))) -#endif - -#define PCSX2_ALIGNED16_DECL(x) x - -#ifndef __forceinline -#define __forceinline inline -#endif - -#endif // _MSC_VER - -#if defined(__x86_64__) -typedef u64 uptr; -typedef s64 sptr; -#else -typedef u32 uptr; -typedef s32 sptr; -#endif - -typedef struct { - int size; - s8 *data; -} freezeData; - -/* common defines */ -#ifndef C_ASSERT -#define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1] -#endif - -#endif /* __PS2ETYPES_H__ */ +#define __LINUX__ +#endif + +#ifdef _WIN32 +#include +#endif + +#ifndef ARRAYSIZE +#define ARRAYSIZE(x) (sizeof(x)/sizeof((x)[0])) +#endif + + +// Basic types +#if defined(_MSC_VER) + +typedef __int8 s8; +typedef __int16 s16; +typedef __int32 s32; +typedef __int64 s64; + +typedef unsigned __int8 u8; +typedef unsigned __int16 u16; +typedef unsigned __int32 u32; +typedef unsigned __int64 u64; + +#define PCSX2_ALIGNED16(x) __declspec(align(16)) x +#define PCSX2_ALIGNED16_DECL(x) __declspec(align(16)) x + +#else + +typedef char s8; +typedef short s16; +typedef int s32; +typedef long long s64; + +typedef unsigned char u8; +typedef unsigned short u16; +typedef unsigned int u32; +typedef unsigned long long u64; + +#ifdef __LINUX__ +typedef union _LARGE_INTEGER +{ + long long QuadPart; +} LARGE_INTEGER; +#endif + +#if defined(__MINGW32__) +#define PCSX2_ALIGNED16(x) __declspec(align(16)) x +#else +#define PCSX2_ALIGNED16(x) x __attribute((aligned(16))) +#endif + +#define PCSX2_ALIGNED16_DECL(x) x + +#ifndef __forceinline +#define __forceinline inline +#endif + +#endif // _MSC_VER + +#if defined(__x86_64__) +typedef u64 uptr; +typedef s64 sptr; +#else +typedef u32 uptr; +typedef s32 sptr; +#endif + +typedef struct { + int size; + s8 *data; +} freezeData; + +/* common defines */ +#ifndef C_ASSERT +#define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1] +#endif + +#endif /* __PS2ETYPES_H__ */ diff --git a/plugins/pad/zeropad/Windows/win.cpp b/plugins/pad/zeropad/Windows/win.cpp index e7a7d48..6d7bba5 100644 --- a/plugins/pad/zeropad/Windows/win.cpp +++ b/plugins/pad/zeropad/Windows/win.cpp @@ -207,54 +207,44 @@ LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) event.key = wParam; break; - case WM_LBUTTONDBLCLK: - lanalog[0].button = 1; - lanalog[1].button = 1; - break; - case WM_LBUTTONDOWN: lbutton = true; break; case WM_LBUTTONUP: - lanalog[0].x = 0x80; - lanalog[0].y = 0x80; - lanalog[1].x = 0x80; - lanalog[1].y = 0x80; + g_lanalog[0].x = 0x80; + g_lanalog[0].y = 0x80; + g_lanalog[1].x = 0x80; + g_lanalog[1].y = 0x80; lbutton = false; break; - case WM_RBUTTONDBLCLK: - ranalog[0].button = 1; - ranalog[1].button = 1; - break; - case WM_RBUTTONDOWN: rbutton = true; break; case WM_RBUTTONUP: - ranalog[0].x = 0x80; - ranalog[0].y = 0x80; - ranalog[1].x = 0x80; - ranalog[1].y = 0x80; + g_ranalog[0].x = 0x80; + g_ranalog[0].y = 0x80; + g_ranalog[1].x = 0x80; + g_ranalog[1].y = 0x80; rbutton = false; break; case WM_MOUSEMOVE: if(lbutton) { - lanalog[0].x = LOWORD(lParam) & 254; - lanalog[0].y = HIWORD(lParam) & 254; - lanalog[1].x = LOWORD(lParam) & 254; - lanalog[1].y = HIWORD(lParam) & 254; + g_lanalog[0].x = LOWORD(lParam) & 254; + g_lanalog[0].y = HIWORD(lParam) & 254; + g_lanalog[1].x = LOWORD(lParam) & 254; + g_lanalog[1].y = HIWORD(lParam) & 254; } if(rbutton) { - ranalog[0].x = LOWORD(lParam) & 254; - ranalog[0].y = HIWORD(lParam) & 254; - ranalog[1].x = LOWORD(lParam) & 254; - ranalog[1].y = HIWORD(lParam) & 254; + g_ranalog[0].x = LOWORD(lParam) & 254; + g_ranalog[0].y = HIWORD(lParam) & 254; + g_ranalog[1].x = LOWORD(lParam) & 254; + g_ranalog[1].y = HIWORD(lParam) & 254; } break; diff --git a/plugins/spu2/zerospu2/PS2Edefs.h b/plugins/spu2/zerospu2/PS2Edefs.h index b2f76c9..223a034 100644 --- a/plugins/spu2/zerospu2/PS2Edefs.h +++ b/plugins/spu2/zerospu2/PS2Edefs.h @@ -438,6 +438,8 @@ u32 CALLBACK USBread32(u32 addr); void CALLBACK USBwrite8(u32 addr, u8 value); void CALLBACK USBwrite16(u32 addr, u16 value); void CALLBACK USBwrite32(u32 addr, u32 value); +void CALLBACK USBasync(u32 cycles); + // cycles = IOP cycles before calling callback, // if callback returns 1 the irq is triggered, else not void CALLBACK USBirqCallback(USBcallback callback); @@ -636,6 +638,9 @@ typedef u32 (CALLBACK* _USBread32)(u32 mem); typedef void (CALLBACK* _USBwrite8)(u32 mem, u8 value); typedef void (CALLBACK* _USBwrite16)(u32 mem, u16 value); typedef void (CALLBACK* _USBwrite32)(u32 mem, u32 value); +typedef void (CALLBACK* _USBasync)(u32 cycles); + + typedef void (CALLBACK* _USBirqCallback)(USBcallback callback); typedef USBhandler (CALLBACK* _USBirqHandler)(void); typedef void (CALLBACK* _USBsetRAM)(void *mem); @@ -821,6 +826,8 @@ _USBread32 USBread32; _USBwrite8 USBwrite8; _USBwrite16 USBwrite16; _USBwrite32 USBwrite32; +_USBasync USBasync; + _USBirqCallback USBirqCallback; _USBirqHandler USBirqHandler; _USBsetRAM USBsetRAM; diff --git a/plugins/spu2/zerospu2/PS2Etypes.h b/plugins/spu2/zerospu2/PS2Etypes.h index 1ad73e2..101dba9 100644 --- a/plugins/spu2/zerospu2/PS2Etypes.h +++ b/plugins/spu2/zerospu2/PS2Etypes.h @@ -1,76 +1,88 @@ -#ifndef __PS2ETYPES_H__ -#define __PS2ETYPES_H__ - -#ifndef ARRAYSIZE -#define ARRAYSIZE(x) (sizeof(x)/sizeof((x)[0])) -#endif - -#if defined (__linux__) && !defined(__LINUX__) // some distributions are lower case -#define __LINUX__ -#endif - -// Basic types -#if defined(_MSC_VER) - -typedef __int8 s8; -typedef __int16 s16; -typedef __int32 s32; -typedef __int64 s64; - -typedef unsigned __int8 u8; -typedef unsigned __int16 u16; -typedef unsigned __int32 u32; -typedef unsigned __int64 u64; - -#define PCSX2_ALIGNED16(x) __declspec(align(16)) x - -#else - -typedef char s8; -typedef short s16; -typedef int s32; -typedef long long s64; - -typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned int u32; -typedef unsigned long long u64; - -#ifdef __LINUX__ -typedef union _LARGE_INTEGER -{ - long long QuadPart; -} LARGE_INTEGER; -#endif - -#if defined(__MINGW32__) -#define PCSX2_ALIGNED16(x) __declspec(align(16)) x -#else -#define PCSX2_ALIGNED16(x) x __attribute((aligned(16))) -#endif - -#ifndef __forceinline -#define __forceinline inline -#endif - -#endif // _MSC_VER - -#if defined(__x86_64__) -typedef u64 uptr; -typedef s64 sptr; -#else -typedef u32 uptr; -typedef s32 sptr; -#endif - -typedef struct { - int size; - s8 *data; -} freezeData; - -/* common defines */ -#ifndef C_ASSERT -#define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1] -#endif - -#endif /* __PS2ETYPES_H__ */ +#ifndef __PS2ETYPES_H__ +#define __PS2ETYPES_H__ + +#if defined (__linux__) && !defined(__LINUX__) // some distributions are lower case +#define __LINUX__ +#endif + +#ifdef __CYGWIN__ +#define __LINUX__ +#endif + +#ifdef _WIN32 +#include +#endif + +#ifndef ARRAYSIZE +#define ARRAYSIZE(x) (sizeof(x)/sizeof((x)[0])) +#endif + + +// Basic types +#if defined(_MSC_VER) + +typedef __int8 s8; +typedef __int16 s16; +typedef __int32 s32; +typedef __int64 s64; + +typedef unsigned __int8 u8; +typedef unsigned __int16 u16; +typedef unsigned __int32 u32; +typedef unsigned __int64 u64; + +#define PCSX2_ALIGNED16(x) __declspec(align(16)) x +#define PCSX2_ALIGNED16_DECL(x) __declspec(align(16)) x + +#else + +typedef char s8; +typedef short s16; +typedef int s32; +typedef long long s64; + +typedef unsigned char u8; +typedef unsigned short u16; +typedef unsigned int u32; +typedef unsigned long long u64; + +#ifdef __LINUX__ +typedef union _LARGE_INTEGER +{ + long long QuadPart; +} LARGE_INTEGER; +#endif + +#if defined(__MINGW32__) +#define PCSX2_ALIGNED16(x) __declspec(align(16)) x +#else +#define PCSX2_ALIGNED16(x) x __attribute((aligned(16))) +#endif + +#define PCSX2_ALIGNED16_DECL(x) x + +#ifndef __forceinline +#define __forceinline inline +#endif + +#endif // _MSC_VER + +#if defined(__x86_64__) +typedef u64 uptr; +typedef s64 sptr; +#else +typedef u32 uptr; +typedef s32 sptr; +#endif + +typedef struct { + int size; + s8 *data; +} freezeData; + +/* common defines */ +#ifndef C_ASSERT +#define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1] +#endif + +#endif /* __PS2ETYPES_H__ */