mirror of
https://github.com/PCSX2/pcsx2-sourceforge.git
synced 2026-02-04 03:11:18 +01:00
fixed broken saved states for old versions, zeropad was broken under windows, updated some files...
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
gametitle=Katamari Damacy [SLUS 21008] (U) [FA7E3081]
|
||||
comment=Skips Video (sceMpegIsEnd)
|
||||
//Skip Videos
|
||||
patch=0,EE,0018e9e8,word,24020001
|
||||
gametitle=kata
|
||||
comment=
|
||||
//Skip Intro Videos
|
||||
patch=0,EE,0018e9e8,word,24020001
|
||||
//0018e4c8
|
||||
//0018e11c
|
||||
//0018e020
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <dlfcn.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <error.h>
|
||||
//#include <error.h>
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 <windows.h>
|
||||
#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 <windows.h>
|
||||
#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__ */
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 ) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 <windows.h>
|
||||
#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__ */
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 <windows.h>
|
||||
#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 <windows.h>
|
||||
#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__ */
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 <windows.h>
|
||||
#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__ */
|
||||
|
||||
Reference in New Issue
Block a user