2009-09-12 10:09:59 +00:00
|
|
|
/* PCSX2 - PS2 Emulator for PCs
|
2010-05-03 14:08:02 +00:00
|
|
|
* Copyright (C) 2002-2010 PCSX2 Dev Team
|
2010-04-25 00:31:27 +00:00
|
|
|
*
|
2009-09-12 10:09:59 +00:00
|
|
|
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU Lesser General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
2009-02-09 21:15:56 +00:00
|
|
|
*
|
2009-09-12 10:09:59 +00:00
|
|
|
* PCSX2 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.
|
2009-03-15 09:30:31 +00:00
|
|
|
*
|
2009-09-12 10:09:59 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along with PCSX2.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
2009-02-09 21:15:56 +00:00
|
|
|
*/
|
2010-04-25 00:31:27 +00:00
|
|
|
|
2009-02-09 21:15:56 +00:00
|
|
|
#ifndef __PS2EDEFS_H__
|
|
|
|
#define __PS2EDEFS_H__
|
|
|
|
|
2010-02-06 22:18:26 +00:00
|
|
|
// Global enable/disable flag, disables all the parts if off
|
2011-01-15 23:55:38 +00:00
|
|
|
//#define ENABLE_NEW_IOPDMA
|
2010-01-23 03:28:32 +00:00
|
|
|
|
2010-02-06 22:18:26 +00:00
|
|
|
// Parts of the dmac, each one can be turned on independently
|
2010-01-23 03:28:32 +00:00
|
|
|
#ifdef ENABLE_NEW_IOPDMA
|
2011-01-15 23:55:38 +00:00
|
|
|
//#define ENABLE_NEW_IOPDMA_SPU2 /* working */
|
2010-02-06 22:18:26 +00:00
|
|
|
//#define ENABLE_NEW_IOPDMA_SIO /* working */
|
|
|
|
//#define ENABLE_NEW_IOPDMA_CDVD /* NOT IMPLEMENTED */
|
|
|
|
//#define ENABLE_NEW_IOPDMA_SIF /* NOT IMPLEMENTED */
|
|
|
|
//#define ENABLE_NEW_IOPDMA_DEV9 /* untested (no plugins) */
|
2010-01-23 03:28:32 +00:00
|
|
|
#endif
|
|
|
|
|
2009-02-09 21:15:56 +00:00
|
|
|
/*
|
|
|
|
* PS2E Definitions v0.6.2 (beta)
|
|
|
|
*
|
|
|
|
* Author: linuzappz@hotmail.com
|
|
|
|
* shadowpcsx2@yahoo.gr
|
|
|
|
* florinsasu@hotmail.com
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2009-03-15 09:30:31 +00:00
|
|
|
Notes:
|
2009-02-09 21:15:56 +00:00
|
|
|
* Since this is still beta things may change.
|
|
|
|
|
|
|
|
* OSflags:
|
2014-08-03 18:11:22 +00:00
|
|
|
__linux__ (linux OS)
|
2009-02-09 21:15:56 +00:00
|
|
|
_WIN32 (win32 OS)
|
|
|
|
|
|
|
|
* common return values (for ie. GSinit):
|
|
|
|
0 - success
|
|
|
|
-1 - error
|
|
|
|
|
|
|
|
* reserved keys:
|
|
|
|
F1 to F10 are reserved for the emulator
|
|
|
|
|
2009-03-15 09:30:31 +00:00
|
|
|
* plugins should NOT change the current
|
2009-02-09 21:15:56 +00:00
|
|
|
working directory.
|
|
|
|
(on win32, add flag OFN_NOCHANGEDIR for
|
|
|
|
GetOpenFileName)
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2009-04-29 11:47:05 +00:00
|
|
|
#include "Pcsx2Defs.h"
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2009-12-22 03:15:30 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
// freeze modes:
|
2016-11-12 15:28:37 +00:00
|
|
|
#define FREEZE_LOAD 0
|
|
|
|
#define FREEZE_SAVE 1
|
|
|
|
#define FREEZE_SIZE 2
|
2009-12-22 03:15:30 +00:00
|
|
|
|
|
|
|
// event values:
|
2016-11-12 15:28:37 +00:00
|
|
|
#define KEYPRESS 1
|
|
|
|
#define KEYRELEASE 2
|
2009-12-22 03:15:30 +00:00
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int size;
|
|
|
|
s8 *data;
|
2009-12-22 03:15:30 +00:00
|
|
|
} freezeData;
|
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef struct _keyEvent
|
|
|
|
{
|
|
|
|
u32 key;
|
|
|
|
u32 evt;
|
2009-12-22 03:15:30 +00:00
|
|
|
} keyEvent;
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////
|
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
#if defined(GSdefs) || defined(PADdefs) || defined(SIOdefs) || \
|
2009-02-09 21:15:56 +00:00
|
|
|
defined(SPU2defs) || defined(CDVDdefs) || defined(DEV9defs) || \
|
2016-11-12 15:28:37 +00:00
|
|
|
defined(USBdefs) || defined(FWdefs)
|
2009-02-09 21:15:56 +00:00
|
|
|
#define COMMONdefs
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// PS2EgetLibType returns (may be OR'd)
|
2016-11-12 15:28:37 +00:00
|
|
|
#define PS2E_LT_GS 0x01
|
|
|
|
#define PS2E_LT_PAD 0x02 // -=[ OBSOLETE ]=-
|
2009-02-09 21:15:56 +00:00
|
|
|
#define PS2E_LT_SPU2 0x04
|
|
|
|
#define PS2E_LT_CDVD 0x08
|
|
|
|
#define PS2E_LT_DEV9 0x10
|
2016-11-12 15:28:37 +00:00
|
|
|
#define PS2E_LT_USB 0x20
|
|
|
|
#define PS2E_LT_FW 0x40
|
|
|
|
#define PS2E_LT_SIO 0x80
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
// PS2EgetLibVersion2 (high 16 bits)
|
2016-11-12 15:28:37 +00:00
|
|
|
#define PS2E_GS_VERSION 0x0006
|
|
|
|
#define PS2E_PAD_VERSION 0x0002 // -=[ OBSOLETE ]=-
|
2010-01-23 03:28:32 +00:00
|
|
|
#ifdef ENABLE_NEW_IOPDMA_SPU2
|
2016-11-12 15:28:37 +00:00
|
|
|
#define PS2E_SPU2_VERSION 0x0006
|
2010-01-23 03:28:32 +00:00
|
|
|
#else
|
2016-11-12 15:28:37 +00:00
|
|
|
#define PS2E_SPU2_VERSION 0x0005
|
2010-01-23 03:28:32 +00:00
|
|
|
#endif
|
2009-02-09 21:15:56 +00:00
|
|
|
#define PS2E_CDVD_VERSION 0x0005
|
2010-02-06 22:18:26 +00:00
|
|
|
#ifdef ENABLE_NEW_IOPDMA_DEV9
|
2016-11-12 15:28:37 +00:00
|
|
|
#define PS2E_DEV9_VERSION 0x0004
|
2010-02-06 22:18:26 +00:00
|
|
|
#else
|
2016-11-12 15:28:37 +00:00
|
|
|
#define PS2E_DEV9_VERSION 0x0003
|
2010-02-06 22:18:26 +00:00
|
|
|
#endif
|
2016-11-12 15:28:37 +00:00
|
|
|
#define PS2E_USB_VERSION 0x0003
|
|
|
|
#define PS2E_FW_VERSION 0x0002
|
|
|
|
#define PS2E_SIO_VERSION 0x0001
|
2009-02-09 21:15:56 +00:00
|
|
|
#ifdef COMMONdefs
|
|
|
|
|
2009-06-18 08:20:19 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
u32 CALLBACK PS2EgetLibType(void);
|
|
|
|
u32 CALLBACK PS2EgetLibVersion2(u32 type);
|
|
|
|
char *CALLBACK PS2EgetLibName(void);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2009-06-18 08:20:19 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-02-09 21:15:56 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// key values:
|
|
|
|
/* key values must be OS dependant:
|
|
|
|
win32: the VK_XXX will be used (WinUser)
|
|
|
|
linux: the XK_XXX will be used (XFree86)
|
|
|
|
*/
|
|
|
|
|
|
|
|
// for 64bit compilers
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef char __keyEvent_Size__[(sizeof(keyEvent) == 8) ? 1 : -1];
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
// plugin types
|
2016-11-12 15:28:37 +00:00
|
|
|
#define SIO_TYPE_PAD 0x00000001
|
|
|
|
#define SIO_TYPE_MTAP 0x00000004
|
|
|
|
#define SIO_TYPE_RM 0x00000040
|
|
|
|
#define SIO_TYPE_MC 0x00000100
|
|
|
|
|
|
|
|
typedef int(CALLBACK *SIOchangeSlotCB)(int slot);
|
|
|
|
|
|
|
|
typedef struct _cdvdSubQ
|
|
|
|
{
|
|
|
|
u8 ctrl : 4; // control and mode bits
|
|
|
|
u8 mode : 4; // control and mode bits
|
|
|
|
u8 trackNum; // current track number (1 to 99)
|
|
|
|
u8 trackIndex; // current index within track (0 to 99)
|
|
|
|
u8 trackM; // current minute location on the disc (BCD encoded)
|
|
|
|
u8 trackS; // current sector location on the disc (BCD encoded)
|
|
|
|
u8 trackF; // current frame location on the disc (BCD encoded)
|
|
|
|
u8 pad; // unused
|
|
|
|
u8 discM; // current minute offset from first track (BCD encoded)
|
|
|
|
u8 discS; // current sector offset from first track (BCD encoded)
|
|
|
|
u8 discF; // current frame offset from first track (BCD encoded)
|
2009-02-09 21:15:56 +00:00
|
|
|
} cdvdSubQ;
|
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef struct _cdvdTD
|
|
|
|
{ // NOT bcd coded
|
|
|
|
u32 lsn;
|
|
|
|
u8 type;
|
2009-02-09 21:15:56 +00:00
|
|
|
} cdvdTD;
|
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef struct _cdvdTN
|
|
|
|
{
|
|
|
|
u8 strack; //number of the first track (usually 1)
|
|
|
|
u8 etrack; //number of the last track
|
2009-02-09 21:15:56 +00:00
|
|
|
} cdvdTN;
|
|
|
|
|
|
|
|
// CDVDreadTrack mode values:
|
2016-11-12 15:28:37 +00:00
|
|
|
#define CDVD_MODE_2352 0 // full 2352 bytes
|
|
|
|
#define CDVD_MODE_2340 1 // skip sync (12) bytes
|
|
|
|
#define CDVD_MODE_2328 2 // skip sync+head+sub (24) bytes
|
|
|
|
#define CDVD_MODE_2048 3 // skip sync+head+sub (24) bytes
|
|
|
|
#define CDVD_MODE_2368 4 // full 2352 bytes + 16 subq
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
// CDVDgetDiskType returns:
|
2016-11-12 15:28:37 +00:00
|
|
|
#define CDVD_TYPE_ILLEGAL 0xff // Illegal Disc
|
|
|
|
#define CDVD_TYPE_DVDV 0xfe // DVD Video
|
|
|
|
#define CDVD_TYPE_CDDA 0xfd // Audio CD
|
|
|
|
#define CDVD_TYPE_PS2DVD 0x14 // PS2 DVD
|
|
|
|
#define CDVD_TYPE_PS2CDDA 0x13 // PS2 CD (with audio)
|
|
|
|
#define CDVD_TYPE_PS2CD 0x12 // PS2 CD
|
|
|
|
#define CDVD_TYPE_PSCDDA 0x11 // PS CD (with audio)
|
|
|
|
#define CDVD_TYPE_PSCD 0x10 // PS CD
|
|
|
|
#define CDVD_TYPE_UNKNOWN 0x05 // Unknown
|
|
|
|
#define CDVD_TYPE_DETCTDVDD 0x04 // Detecting Dvd Dual Sided
|
|
|
|
#define CDVD_TYPE_DETCTDVDS 0x03 // Detecting Dvd Single Sided
|
|
|
|
#define CDVD_TYPE_DETCTCD 0x02 // Detecting Cd
|
|
|
|
#define CDVD_TYPE_DETCT 0x01 // Detecting
|
|
|
|
#define CDVD_TYPE_NODISC 0x00 // No Disc
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
// CDVDgetTrayStatus returns:
|
2016-11-12 15:28:37 +00:00
|
|
|
#define CDVD_TRAY_CLOSE 0x00
|
|
|
|
#define CDVD_TRAY_OPEN 0x01
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
// cdvdTD.type (track types for cds)
|
2016-11-12 15:28:37 +00:00
|
|
|
#define CDVD_AUDIO_TRACK 0x01
|
|
|
|
#define CDVD_MODE1_TRACK 0x41
|
|
|
|
#define CDVD_MODE2_TRACK 0x61
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
#define CDVD_AUDIO_MASK 0x00
|
|
|
|
#define CDVD_DATA_MASK 0x40
|
2009-02-09 21:15:56 +00:00
|
|
|
// CDROM_DATA_TRACK 0x04 //do not enable this! (from linux kernel)
|
|
|
|
|
|
|
|
typedef void (*DEV9callback)(int cycles);
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef int (*DEV9handler)(void);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
typedef void (*USBcallback)(int cycles);
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef int (*USBhandler)(void);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef struct _GSdriverInfo
|
|
|
|
{
|
|
|
|
char name[8];
|
|
|
|
void *common;
|
2009-02-09 21:15:56 +00:00
|
|
|
} GSdriverInfo;
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* GS plugin API */
|
|
|
|
|
|
|
|
// if this file is included with this define
|
|
|
|
// the next api will not be skipped by the compiler
|
2016-03-30 07:47:27 +00:00
|
|
|
#if defined(GSdefs) || defined(BUILTIN_GS_PLUGIN)
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
// basic funcs
|
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK GSinit();
|
|
|
|
s32 CALLBACK GSopen(void *pDsp, const char *Title, int multithread);
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK GSclose();
|
|
|
|
void CALLBACK GSshutdown();
|
2016-11-12 15:28:37 +00:00
|
|
|
void CALLBACK GSsetSettingsDir(const char *dir);
|
|
|
|
void CALLBACK GSsetLogDir(const char *dir);
|
2009-12-19 18:30:56 +00:00
|
|
|
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK GSvsync(int field);
|
2010-07-19 15:49:30 +00:00
|
|
|
void CALLBACK GSgifTransfer(const u32 *pMem, u32 addr);
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK GSgifTransfer1(u32 *pMem, u32 addr);
|
|
|
|
void CALLBACK GSgifTransfer2(u32 *pMem, u32 size);
|
|
|
|
void CALLBACK GSgifTransfer3(u32 *pMem, u32 size);
|
2016-11-12 15:28:37 +00:00
|
|
|
void CALLBACK GSgetLastTag(u64 *ptag); // returns the last tag processed (64 bits)
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK GSgifSoftReset(u32 mask);
|
|
|
|
void CALLBACK GSreadFIFO(u64 *mem);
|
2014-05-02 21:03:02 +00:00
|
|
|
void CALLBACK GSinitReadFIFO(u64 *mem);
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK GSreadFIFO2(u64 *mem, int qwc);
|
2014-05-02 21:03:02 +00:00
|
|
|
void CALLBACK GSinitReadFIFO2(u64 *mem, int qwc);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
// extended funcs
|
|
|
|
|
|
|
|
// GSkeyEvent gets called when there is a keyEvent from the PAD plugin
|
|
|
|
void CALLBACK GSkeyEvent(keyEvent *ev);
|
2016-11-12 15:28:37 +00:00
|
|
|
void CALLBACK GSchangeSaveState(int, const char *filename);
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK GSmakeSnapshot(char *path);
|
2016-11-12 15:28:37 +00:00
|
|
|
void CALLBACK GSmakeSnapshot2(char *pathname, int *snapdone, int savejpg);
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK GSirqCallback(void (*callback)());
|
|
|
|
void CALLBACK GSprintf(int timeout, char *fmt, ...);
|
2016-11-12 15:28:37 +00:00
|
|
|
void CALLBACK GSsetBaseMem(void *);
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK GSsetGameCRC(int crc, int gameoptions);
|
|
|
|
|
|
|
|
// controls frame skipping in the GS, if this routine isn't present, frame skipping won't be done
|
|
|
|
void CALLBACK GSsetFrameSkip(int frameskip);
|
|
|
|
|
|
|
|
// if start is 1, starts recording spu2 data, else stops
|
|
|
|
// returns a non zero value if successful
|
|
|
|
// for now, pData is not used
|
2016-11-12 15:28:37 +00:00
|
|
|
int CALLBACK GSsetupRecording(int start, void *pData);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
void CALLBACK GSreset();
|
2010-12-03 21:18:29 +00:00
|
|
|
//deprecated: GSgetTitleInfo was used in PCSX2 but no plugin supported it prior to r4070:
|
|
|
|
//void CALLBACK GSgetTitleInfo( char dest[128] );
|
2016-11-12 15:28:37 +00:00
|
|
|
void CALLBACK GSgetTitleInfo2(char *dest, size_t length);
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK GSwriteCSR(u32 value);
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK GSfreeze(int mode, freezeData *data);
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK GSconfigure();
|
|
|
|
void CALLBACK GSabout();
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK GStest();
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* PAD plugin API -=[ OBSOLETE ]=- */
|
|
|
|
|
|
|
|
// if this file is included with this define
|
|
|
|
// the next api will not be skipped by the compiler
|
2016-03-30 07:47:27 +00:00
|
|
|
#if defined(PADdefs) || defined(BUILTIN_PAD_PLUGIN)
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
// basic funcs
|
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK PADinit(u32 flags);
|
|
|
|
s32 CALLBACK PADopen(void *pDsp);
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK PADclose();
|
|
|
|
void CALLBACK PADshutdown();
|
2016-11-12 15:28:37 +00:00
|
|
|
void CALLBACK PADsetSettingsDir(const char *dir);
|
|
|
|
void CALLBACK PADsetLogDir(const char *dir);
|
2009-12-19 18:30:56 +00:00
|
|
|
|
2009-02-09 21:15:56 +00:00
|
|
|
// PADkeyEvent is called every vsync (return NULL if no event)
|
2016-11-12 15:28:37 +00:00
|
|
|
keyEvent *CALLBACK PADkeyEvent();
|
|
|
|
u8 CALLBACK PADstartPoll(int pad);
|
|
|
|
u8 CALLBACK PADpoll(u8 value);
|
2009-02-09 21:15:56 +00:00
|
|
|
// returns: 1 if supported pad1
|
|
|
|
// 2 if supported pad2
|
|
|
|
// 3 if both are supported
|
2016-11-12 15:28:37 +00:00
|
|
|
u32 CALLBACK PADquery();
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
// call to give a hint to the PAD plugin to query for the keyboard state. A
|
|
|
|
// good plugin will query the OS for keyboard state ONLY in this function.
|
|
|
|
// This function is necessary when multithreading because otherwise
|
|
|
|
// the PAD plugin can get into deadlocks with the thread that really owns
|
|
|
|
// the window (and input). Note that PADupdate can be called from a different
|
|
|
|
// thread than the other functions, so mutex or other multithreading primitives
|
|
|
|
// have to be added to maintain data integrity.
|
|
|
|
void CALLBACK PADupdate(int pad);
|
|
|
|
|
2011-06-12 14:48:36 +00:00
|
|
|
// Send a key event from wx-gui to pad
|
|
|
|
// Note: On linux GSOpen2, wx-gui and pad share the same event buffer. Wx-gui reads and deletes event
|
|
|
|
// before the pad saw them. So the gui needs to send them back to the pad.
|
|
|
|
void CALLBACK PADWriteEvent(keyEvent &evt);
|
|
|
|
|
2009-02-09 21:15:56 +00:00
|
|
|
// extended funcs
|
|
|
|
|
|
|
|
void CALLBACK PADgsDriverInfo(GSdriverInfo *info);
|
|
|
|
void CALLBACK PADconfigure();
|
|
|
|
void CALLBACK PADabout();
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK PADtest();
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* SPU2 plugin API */
|
|
|
|
|
|
|
|
// if this file is included with this define
|
|
|
|
// the next api will not be skipped by the compiler
|
2016-03-30 07:47:27 +00:00
|
|
|
#if defined(SPU2defs) || defined(BUILTIN_SPU2_PLUGIN)
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
// basic funcs
|
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK SPU2init();
|
|
|
|
s32 CALLBACK SPU2open(void *pDsp);
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK SPU2close();
|
|
|
|
void CALLBACK SPU2shutdown();
|
2016-11-12 15:28:37 +00:00
|
|
|
void CALLBACK SPU2setSettingsDir(const char *dir);
|
|
|
|
void CALLBACK SPU2setLogDir(const char *dir);
|
2009-12-19 18:30:56 +00:00
|
|
|
|
2010-07-27 03:41:18 +00:00
|
|
|
void CALLBACK SPU2reset();
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK SPU2write(u32 mem, u16 value);
|
2016-11-12 15:28:37 +00:00
|
|
|
u16 CALLBACK SPU2read(u32 mem);
|
2010-01-23 03:28:32 +00:00
|
|
|
|
|
|
|
#ifdef ENABLE_NEW_IOPDMA_SPU2
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK SPU2dmaRead(s32 channel, u32 *data, u32 bytesLeft, u32 *bytesProcessed);
|
|
|
|
s32 CALLBACK SPU2dmaWrite(s32 channel, u32 *data, u32 bytesLeft, u32 *bytesProcessed);
|
2010-01-23 03:28:32 +00:00
|
|
|
void CALLBACK SPU2dmaInterrupt(s32 channel);
|
|
|
|
|
|
|
|
// dma irq callbacks not needed anymore, they are handled by the dmac
|
|
|
|
void CALLBACK SPU2irqCallback(void (*SPU2callback)());
|
|
|
|
#else
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK SPU2readDMA4Mem(u16 *pMem, int size);
|
|
|
|
void CALLBACK SPU2writeDMA4Mem(u16 *pMem, int size);
|
|
|
|
void CALLBACK SPU2interruptDMA4();
|
2016-11-12 15:28:37 +00:00
|
|
|
void CALLBACK SPU2readDMA7Mem(u16 *pMem, int size);
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK SPU2writeDMA7Mem(u16 *pMem, int size);
|
|
|
|
|
|
|
|
// all addresses passed by dma will be pointers to the array starting at baseaddr
|
|
|
|
// This function is necessary to successfully save and reload the spu2 state
|
|
|
|
void CALLBACK SPU2setDMABaseAddr(uptr baseaddr);
|
|
|
|
|
|
|
|
void CALLBACK SPU2interruptDMA7();
|
2010-01-23 03:28:32 +00:00
|
|
|
|
2009-02-09 21:15:56 +00:00
|
|
|
u32 CALLBACK SPU2ReadMemAddr(int core);
|
2016-11-12 15:28:37 +00:00
|
|
|
void CALLBACK SPU2WriteMemAddr(int core, u32 value);
|
2010-01-23 03:28:32 +00:00
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
void CALLBACK SPU2irqCallback(void (*SPU2callback)(), void (*DMA4callback)(), void (*DMA7callback)());
|
2010-01-23 03:28:32 +00:00
|
|
|
#endif
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
// extended funcs
|
|
|
|
// if start is 1, starts recording spu2 data, else stops
|
|
|
|
// returns a non zero value if successful
|
|
|
|
// for now, pData is not used
|
2016-11-12 15:28:37 +00:00
|
|
|
int CALLBACK SPU2setupRecording(int start, void *pData);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
void CALLBACK SPU2setClockPtr(u32 *ptr);
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK SPU2setTimeStretcher(short int enable);
|
|
|
|
|
|
|
|
void CALLBACK SPU2async(u32 cycles);
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK SPU2freeze(int mode, freezeData *data);
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK SPU2configure();
|
|
|
|
void CALLBACK SPU2about();
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK SPU2test();
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* CDVD plugin API */
|
|
|
|
|
|
|
|
// if this file is included with this define
|
|
|
|
// the next api will not be skipped by the compiler
|
2016-03-30 07:47:27 +00:00
|
|
|
#if defined(CDVDdefs) || defined(BUILTIN_CDVD_PLUGIN)
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
// basic funcs
|
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK CDVDinit();
|
|
|
|
s32 CALLBACK CDVDopen(const char *pTitleFilename);
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK CDVDclose();
|
|
|
|
void CALLBACK CDVDshutdown();
|
2016-11-12 15:28:37 +00:00
|
|
|
void CALLBACK CDVDsetSettingsDir(const char *dir);
|
|
|
|
void CALLBACK CDVDsetLogDir(const char *dir);
|
2009-12-19 18:30:56 +00:00
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK CDVDreadTrack(u32 lsn, int mode);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
// return can be NULL (for async modes)
|
2016-11-12 15:28:37 +00:00
|
|
|
u8 *CALLBACK CDVDgetBuffer();
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK CDVDreadSubQ(u32 lsn, cdvdSubQ *subq); //read subq from disc (only cds have subq data)
|
|
|
|
s32 CALLBACK CDVDgetTN(cdvdTN *Buffer); //disk information
|
|
|
|
s32 CALLBACK CDVDgetTD(u8 Track, cdvdTD *Buffer); //track info: min,sec,frame,type
|
|
|
|
s32 CALLBACK CDVDgetTOC(void *toc); //gets ps2 style toc from disc
|
|
|
|
s32 CALLBACK CDVDgetDiskType(); //CDVD_TYPE_xxxx
|
|
|
|
s32 CALLBACK CDVDgetTrayStatus(); //CDVD_TRAY_xxxx
|
|
|
|
s32 CALLBACK CDVDctrlTrayOpen(); //open disc tray
|
|
|
|
s32 CALLBACK CDVDctrlTrayClose(); //close disc tray
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
// extended funcs
|
|
|
|
|
|
|
|
void CALLBACK CDVDconfigure();
|
|
|
|
void CALLBACK CDVDabout();
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK CDVDtest();
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK CDVDnewDiskCB(void (*callback)());
|
|
|
|
|
2010-04-25 00:31:27 +00:00
|
|
|
// new funcs
|
2009-07-15 00:27:27 +00:00
|
|
|
|
|
|
|
// read a track directly
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK CDVDreadSector(u8 *buffer, s32 lsn, int mode);
|
2009-07-15 00:27:27 +00:00
|
|
|
|
|
|
|
// improved getBuffer
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK CDVDgetBuffer2(u8 *buffer);
|
2009-07-15 00:27:27 +00:00
|
|
|
|
|
|
|
// tool function
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK CDVDgetDualInfo(s32 *dualType, u32 *_layer1start);
|
2009-07-15 00:27:27 +00:00
|
|
|
|
2009-02-09 21:15:56 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* DEV9 plugin API */
|
|
|
|
|
|
|
|
// if this file is included with this define
|
|
|
|
// the next api will not be skipped by the compiler
|
2016-03-30 07:47:27 +00:00
|
|
|
#if defined(DEV9defs) || defined(BUILTIN_DEV9_PLUGIN)
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
// basic funcs
|
|
|
|
|
|
|
|
// NOTE: The read/write functions CANNOT use XMM/MMX regs
|
|
|
|
// If you want to use them, need to save and restore current ones
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK DEV9init();
|
|
|
|
s32 CALLBACK DEV9open(void *pDsp);
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK DEV9close();
|
|
|
|
void CALLBACK DEV9shutdown();
|
2016-11-12 15:28:37 +00:00
|
|
|
void CALLBACK DEV9setSettingsDir(const char *dir);
|
|
|
|
void CALLBACK DEV9setLogDir(const char *dir);
|
2009-12-19 18:30:56 +00:00
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
u8 CALLBACK DEV9read8(u32 addr);
|
|
|
|
u16 CALLBACK DEV9read16(u32 addr);
|
|
|
|
u32 CALLBACK DEV9read32(u32 addr);
|
|
|
|
void CALLBACK DEV9write8(u32 addr, u8 value);
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK DEV9write16(u32 addr, u16 value);
|
|
|
|
void CALLBACK DEV9write32(u32 addr, u32 value);
|
2010-02-06 22:18:26 +00:00
|
|
|
#ifdef ENABLE_NEW_IOPDMA_DEV9
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK DEV9dmaRead(s32 channel, u32 *data, u32 bytesLeft, u32 *bytesProcessed);
|
|
|
|
s32 CALLBACK DEV9dmaWrite(s32 channel, u32 *data, u32 bytesLeft, u32 *bytesProcessed);
|
2010-02-06 22:18:26 +00:00
|
|
|
void CALLBACK DEV9dmaInterrupt(s32 channel);
|
|
|
|
#else
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK DEV9readDMA8Mem(u32 *pMem, int size);
|
|
|
|
void CALLBACK DEV9writeDMA8Mem(u32 *pMem, int size);
|
2010-02-06 22:18:26 +00:00
|
|
|
#endif
|
2009-02-09 21:15:56 +00:00
|
|
|
// cycles = IOP cycles before calling callback,
|
|
|
|
// if callback returns 1 the irq is triggered, else not
|
|
|
|
void CALLBACK DEV9irqCallback(DEV9callback callback);
|
|
|
|
DEV9handler CALLBACK DEV9irqHandler(void);
|
|
|
|
|
|
|
|
// extended funcs
|
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK DEV9freeze(int mode, freezeData *data);
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK DEV9configure();
|
|
|
|
void CALLBACK DEV9about();
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK DEV9test();
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* USB plugin API */
|
|
|
|
|
|
|
|
// if this file is included with this define
|
|
|
|
// the next api will not be skipped by the compiler
|
2016-03-30 07:47:27 +00:00
|
|
|
#if defined(USBdefs) || defined(BUILTIN_USB_PLUGIN)
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
// basic funcs
|
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK USBinit();
|
|
|
|
s32 CALLBACK USBopen(void *pDsp);
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK USBclose();
|
|
|
|
void CALLBACK USBshutdown();
|
2016-11-12 15:28:37 +00:00
|
|
|
void CALLBACK USBsetSettingsDir(const char *dir);
|
|
|
|
void CALLBACK USBsetLogDir(const char *dir);
|
2009-12-19 18:30:56 +00:00
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
u8 CALLBACK USBread8(u32 addr);
|
|
|
|
u16 CALLBACK USBread16(u32 addr);
|
|
|
|
u32 CALLBACK USBread32(u32 addr);
|
|
|
|
void CALLBACK USBwrite8(u32 addr, u8 value);
|
2009-02-09 21:15:56 +00:00
|
|
|
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);
|
|
|
|
USBhandler CALLBACK USBirqHandler(void);
|
|
|
|
void CALLBACK USBsetRAM(void *mem);
|
|
|
|
|
|
|
|
// extended funcs
|
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK USBfreeze(int mode, freezeData *data);
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK USBconfigure();
|
|
|
|
void CALLBACK USBabout();
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK USBtest();
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* FW plugin API */
|
|
|
|
|
|
|
|
// if this file is included with this define
|
|
|
|
// the next api will not be skipped by the compiler
|
2016-03-30 07:47:27 +00:00
|
|
|
#if defined(BUILTIN_FW_PLUGIN) || defined(BUILTIN_FW_PLUGIN)
|
2009-02-09 21:15:56 +00:00
|
|
|
// basic funcs
|
|
|
|
|
|
|
|
// NOTE: The read/write functions CANNOT use XMM/MMX regs
|
|
|
|
// If you want to use them, need to save and restore current ones
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK FWinit();
|
|
|
|
s32 CALLBACK FWopen(void *pDsp);
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK FWclose();
|
|
|
|
void CALLBACK FWshutdown();
|
2016-11-12 15:28:37 +00:00
|
|
|
void CALLBACK FWsetSettingsDir(const char *dir);
|
|
|
|
void CALLBACK FWsetLogDir(const char *dir);
|
2009-12-19 18:30:56 +00:00
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
u32 CALLBACK FWread32(u32 addr);
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK FWwrite32(u32 addr, u32 value);
|
|
|
|
void CALLBACK FWirqCallback(void (*callback)());
|
|
|
|
|
|
|
|
// extended funcs
|
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK FWfreeze(int mode, freezeData *data);
|
2009-02-09 21:15:56 +00:00
|
|
|
void CALLBACK FWconfigure();
|
|
|
|
void CALLBACK FWabout();
|
2016-11-12 15:28:37 +00:00
|
|
|
s32 CALLBACK FWtest();
|
2009-02-09 21:15:56 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// might be useful for emulators
|
|
|
|
#ifdef PLUGINtypedefs
|
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef u32(CALLBACK *_PS2EgetLibType)(void);
|
|
|
|
typedef u32(CALLBACK *_PS2EgetLibVersion2)(u32 type);
|
|
|
|
typedef char *(CALLBACK *_PS2EgetLibName)(void);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef void(CALLBACK *_PS2EsetEmuVersion)(const char *emuId, u32 version); // HACK to let some plugins know it's 0.9.7 PCSX2 --air
|
2010-01-28 02:53:10 +00:00
|
|
|
|
2009-02-09 21:15:56 +00:00
|
|
|
// GS
|
|
|
|
// NOTE: GSreadFIFOX/GSwriteCSR functions CANNOT use XMM/MMX regs
|
|
|
|
// If you want to use them, need to save and restore current ones
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef s32(CALLBACK *_GSopen)(void *pDsp, const char *Title, int multithread);
|
|
|
|
typedef s32(CALLBACK *_GSopen2)(void *pDsp, u32 flags);
|
|
|
|
typedef void(CALLBACK *_GSvsync)(int field);
|
|
|
|
typedef void(CALLBACK *_GSgifTransfer)(const u32 *pMem, u32 size);
|
|
|
|
typedef void(CALLBACK *_GSgifTransfer1)(u32 *pMem, u32 addr);
|
|
|
|
typedef void(CALLBACK *_GSgifTransfer2)(u32 *pMem, u32 size);
|
|
|
|
typedef void(CALLBACK *_GSgifTransfer3)(u32 *pMem, u32 size);
|
|
|
|
typedef void(CALLBACK *_GSgifSoftReset)(u32 mask);
|
|
|
|
typedef void(CALLBACK *_GSreadFIFO)(u64 *pMem);
|
|
|
|
typedef void(CALLBACK *_GSreadFIFO2)(u64 *pMem, int qwc);
|
|
|
|
typedef void(CALLBACK *_GSinitReadFIFO)(u64 *pMem);
|
|
|
|
typedef void(CALLBACK *_GSinitReadFIFO2)(u64 *pMem, int qwc);
|
|
|
|
|
|
|
|
typedef void(CALLBACK *_GSchangeSaveState)(int, const char *filename);
|
|
|
|
typedef void(CALLBACK *_GSgetTitleInfo2)(char *dest, size_t length);
|
|
|
|
typedef void(CALLBACK *_GSirqCallback)(void (*callback)());
|
|
|
|
typedef void(CALLBACK *_GSprintf)(int timeout, char *fmt, ...);
|
|
|
|
typedef void(CALLBACK *_GSsetBaseMem)(void *);
|
|
|
|
typedef void(CALLBACK *_GSsetGameCRC)(int, int);
|
|
|
|
typedef void(CALLBACK *_GSsetFrameSkip)(int frameskip);
|
|
|
|
typedef void(CALLBACK *_GSsetFrameLimit)(int limit);
|
|
|
|
typedef void(CALLBACK *_GSsetVsync)(int enabled);
|
|
|
|
typedef void(CALLBACK *_GSsetExclusive)(int isExclusive);
|
|
|
|
typedef int(CALLBACK *_GSsetupRecording)(int, void *);
|
|
|
|
typedef void(CALLBACK *_GSreset)();
|
|
|
|
typedef void(CALLBACK *_GSwriteCSR)(u32 value);
|
|
|
|
typedef void(CALLBACK *_GSmakeSnapshot)(const char *path);
|
|
|
|
typedef void(CALLBACK *_GSmakeSnapshot2)(const char *path, int *, int);
|
2009-08-02 16:48:03 +00:00
|
|
|
|
2009-02-09 21:15:56 +00:00
|
|
|
// PAD
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef s32(CALLBACK *_PADinit)(u32 flags);
|
|
|
|
typedef s32(CALLBACK *_PADopen)(void *pDsp);
|
|
|
|
typedef u8(CALLBACK *_PADstartPoll)(int pad);
|
|
|
|
typedef u8(CALLBACK *_PADpoll)(u8 value);
|
|
|
|
typedef u32(CALLBACK *_PADquery)(int pad);
|
|
|
|
typedef void(CALLBACK *_PADupdate)(int pad);
|
|
|
|
typedef keyEvent *(CALLBACK *_PADkeyEvent)();
|
|
|
|
typedef void(CALLBACK *_PADgsDriverInfo)(GSdriverInfo *info);
|
|
|
|
typedef s32(CALLBACK *_PADsetSlot)(u8 port, u8 slot);
|
|
|
|
typedef s32(CALLBACK *_PADqueryMtap)(u8 port);
|
|
|
|
typedef void(CALLBACK *_PADWriteEvent)(keyEvent &evt);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
// SPU2
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef s32(CALLBACK *_SPU2open)(void *pDsp);
|
|
|
|
typedef void(CALLBACK *_SPU2reset)();
|
|
|
|
typedef void(CALLBACK *_SPU2write)(u32 mem, u16 value);
|
|
|
|
typedef u16(CALLBACK *_SPU2read)(u32 mem);
|
2010-01-23 03:28:32 +00:00
|
|
|
|
|
|
|
#ifdef ENABLE_NEW_IOPDMA_SPU2
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef s32(CALLBACK *_SPU2dmaRead)(s32 channel, u32 *data, u32 bytesLeft, u32 *bytesProcessed);
|
|
|
|
typedef s32(CALLBACK *_SPU2dmaWrite)(s32 channel, u32 *data, u32 bytesLeft, u32 *bytesProcessed);
|
|
|
|
typedef void(CALLBACK *_SPU2dmaInterrupt)(s32 channel);
|
2010-01-23 03:28:32 +00:00
|
|
|
|
|
|
|
// dma irq callbacks not needed anymore, they are handled by the dmac
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef void(CALLBACK *_SPU2irqCallback)(void (*SPU2callback)());
|
2010-01-23 03:28:32 +00:00
|
|
|
#else
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef void(CALLBACK *_SPU2readDMA4Mem)(u16 *pMem, int size);
|
|
|
|
typedef void(CALLBACK *_SPU2writeDMA4Mem)(u16 *pMem, int size);
|
|
|
|
typedef void(CALLBACK *_SPU2interruptDMA4)();
|
|
|
|
typedef void(CALLBACK *_SPU2readDMA7Mem)(u16 *pMem, int size);
|
|
|
|
typedef void(CALLBACK *_SPU2writeDMA7Mem)(u16 *pMem, int size);
|
|
|
|
typedef void(CALLBACK *_SPU2setDMABaseAddr)(uptr baseaddr);
|
|
|
|
typedef void(CALLBACK *_SPU2interruptDMA7)();
|
|
|
|
typedef void(CALLBACK *_SPU2irqCallback)(void (*SPU2callback)(), void (*DMA4callback)(), void (*DMA7callback)());
|
|
|
|
typedef u32(CALLBACK *_SPU2ReadMemAddr)(int core);
|
|
|
|
typedef void(CALLBACK *_SPU2WriteMemAddr)(int core, u32 value);
|
2010-01-23 03:28:32 +00:00
|
|
|
#endif
|
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef int(CALLBACK *_SPU2setupRecording)(int, void *);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef void(CALLBACK *_SPU2setClockPtr)(u32 *ptr);
|
|
|
|
typedef void(CALLBACK *_SPU2setTimeStretcher)(short int enable);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef void(CALLBACK *_SPU2async)(u32 cycles);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
// CDVD
|
|
|
|
// NOTE: The read/write functions CANNOT use XMM/MMX regs
|
|
|
|
// If you want to use them, need to save and restore current ones
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef s32(CALLBACK *_CDVDopen)(const char *pTitleFilename);
|
2009-08-28 14:57:51 +00:00
|
|
|
|
|
|
|
// Initiates an asynchronous track read operation.
|
|
|
|
// Returns -1 on error (invalid track)
|
|
|
|
// Returns 0 on success.
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef s32(CALLBACK *_CDVDreadTrack)(u32 lsn, int mode);
|
2009-08-28 14:57:51 +00:00
|
|
|
|
|
|
|
// *OBSOLETE* returns a pointer to the buffer, or NULL if data hasn't finished
|
|
|
|
// loading yet.
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef u8 *(CALLBACK *_CDVDgetBuffer)();
|
2009-08-28 14:57:51 +00:00
|
|
|
|
|
|
|
// Copies loaded data to the target buffer.
|
|
|
|
// Returns -2 if the asynchronous read is still pending.
|
2009-08-28 21:23:32 +00:00
|
|
|
// Returns -1 if the asyncronous read failed.
|
2009-08-28 14:57:51 +00:00
|
|
|
// Returns 0 on success.
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef s32(CALLBACK *_CDVDgetBuffer2)(u8 *buffer);
|
2009-08-28 14:57:51 +00:00
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef s32(CALLBACK *_CDVDreadSubQ)(u32 lsn, cdvdSubQ *subq);
|
|
|
|
typedef s32(CALLBACK *_CDVDgetTN)(cdvdTN *Buffer);
|
|
|
|
typedef s32(CALLBACK *_CDVDgetTD)(u8 Track, cdvdTD *Buffer);
|
|
|
|
typedef s32(CALLBACK *_CDVDgetTOC)(void *toc);
|
|
|
|
typedef s32(CALLBACK *_CDVDgetDiskType)();
|
|
|
|
typedef s32(CALLBACK *_CDVDgetTrayStatus)();
|
|
|
|
typedef s32(CALLBACK *_CDVDctrlTrayOpen)();
|
|
|
|
typedef s32(CALLBACK *_CDVDctrlTrayClose)();
|
|
|
|
typedef s32(CALLBACK *_CDVDreadSector)(u8 *buffer, u32 lsn, int mode);
|
|
|
|
typedef s32(CALLBACK *_CDVDgetDualInfo)(s32 *dualType, u32 *_layer1start);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef void(CALLBACK *_CDVDnewDiskCB)(void (*callback)());
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2009-07-15 00:27:27 +00:00
|
|
|
|
2009-02-09 21:15:56 +00:00
|
|
|
// DEV9
|
|
|
|
// NOTE: The read/write functions CANNOT use XMM/MMX regs
|
|
|
|
// If you want to use them, need to save and restore current ones
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef s32(CALLBACK *_DEV9open)(void *pDsp);
|
|
|
|
typedef u8(CALLBACK *_DEV9read8)(u32 mem);
|
|
|
|
typedef u16(CALLBACK *_DEV9read16)(u32 mem);
|
|
|
|
typedef u32(CALLBACK *_DEV9read32)(u32 mem);
|
|
|
|
typedef void(CALLBACK *_DEV9write8)(u32 mem, u8 value);
|
|
|
|
typedef void(CALLBACK *_DEV9write16)(u32 mem, u16 value);
|
|
|
|
typedef void(CALLBACK *_DEV9write32)(u32 mem, u32 value);
|
2010-02-06 22:18:26 +00:00
|
|
|
#ifdef ENABLE_NEW_IOPDMA_DEV9
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef s32(CALLBACK *_DEV9dmaRead)(s32 channel, u32 *data, u32 bytesLeft, u32 *bytesProcessed);
|
|
|
|
typedef s32(CALLBACK *_DEV9dmaWrite)(s32 channel, u32 *data, u32 bytesLeft, u32 *bytesProcessed);
|
|
|
|
typedef void(CALLBACK *_DEV9dmaInterrupt)(s32 channel);
|
2010-02-06 22:18:26 +00:00
|
|
|
#else
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef void(CALLBACK *_DEV9readDMA8Mem)(u32 *pMem, int size);
|
|
|
|
typedef void(CALLBACK *_DEV9writeDMA8Mem)(u32 *pMem, int size);
|
2010-02-06 22:18:26 +00:00
|
|
|
#endif
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef void(CALLBACK *_DEV9irqCallback)(DEV9callback callback);
|
|
|
|
typedef DEV9handler(CALLBACK *_DEV9irqHandler)(void);
|
|
|
|
typedef void(CALLBACK *_DEV9async)(u32 cycles);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
// USB
|
|
|
|
// NOTE: The read/write functions CANNOT use XMM/MMX regs
|
|
|
|
// If you want to use them, need to save and restore current ones
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef s32(CALLBACK *_USBopen)(void *pDsp);
|
|
|
|
typedef u8(CALLBACK *_USBread8)(u32 mem);
|
|
|
|
typedef u16(CALLBACK *_USBread16)(u32 mem);
|
|
|
|
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);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
//FW
|
2016-11-12 15:28:37 +00:00
|
|
|
typedef s32(CALLBACK *_FWopen)(void *pDsp);
|
|
|
|
typedef u32(CALLBACK *_FWread32)(u32 mem);
|
|
|
|
typedef void(CALLBACK *_FWwrite32)(u32 mem, u32 value);
|
|
|
|
typedef void(CALLBACK *_FWirqCallback)(void (*callback)());
|
2009-02-09 21:15:56 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef PLUGINfuncs
|
|
|
|
|
|
|
|
// GS
|
2016-03-30 07:47:27 +00:00
|
|
|
#ifndef BUILTIN_GS_PLUGIN
|
2016-11-12 15:28:37 +00:00
|
|
|
extern _GSopen GSopen;
|
|
|
|
extern _GSopen2 GSopen2;
|
|
|
|
extern _GSvsync GSvsync;
|
|
|
|
extern _GSgifTransfer GSgifTransfer;
|
|
|
|
extern _GSgifTransfer1 GSgifTransfer1;
|
|
|
|
extern _GSgifTransfer2 GSgifTransfer2;
|
|
|
|
extern _GSgifTransfer3 GSgifTransfer3;
|
|
|
|
extern _GSgifSoftReset GSgifSoftReset;
|
|
|
|
extern _GSreadFIFO GSreadFIFO;
|
|
|
|
extern _GSinitReadFIFO GSinitReadFIFO;
|
|
|
|
extern _GSreadFIFO2 GSreadFIFO2;
|
|
|
|
extern _GSinitReadFIFO2 GSinitReadFIFO2;
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
extern _GSchangeSaveState GSchangeSaveState;
|
2016-11-12 15:28:37 +00:00
|
|
|
extern _GSgetTitleInfo2 GSgetTitleInfo2;
|
|
|
|
extern _GSmakeSnapshot GSmakeSnapshot;
|
|
|
|
extern _GSmakeSnapshot2 GSmakeSnapshot2;
|
|
|
|
extern _GSirqCallback GSirqCallback;
|
|
|
|
extern _GSprintf GSprintf;
|
|
|
|
extern _GSsetBaseMem GSsetBaseMem;
|
|
|
|
extern _GSsetGameCRC GSsetGameCRC;
|
|
|
|
extern _GSsetFrameSkip GSsetFrameSkip;
|
|
|
|
extern _GSsetFrameLimit GSsetFrameLimit;
|
|
|
|
extern _GSsetVsync GSsetVsync;
|
|
|
|
extern _GSsetupRecording GSsetupRecording;
|
|
|
|
extern _GSreset GSreset;
|
|
|
|
extern _GSwriteCSR GSwriteCSR;
|
2016-03-30 07:47:27 +00:00
|
|
|
#endif
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2009-08-02 16:48:03 +00:00
|
|
|
// PAD
|
2016-03-30 07:47:27 +00:00
|
|
|
#ifndef BUILTIN_PAD_PLUGIN
|
2016-11-12 15:28:37 +00:00
|
|
|
extern _PADopen PADopen;
|
|
|
|
extern _PADstartPoll PADstartPoll;
|
|
|
|
extern _PADpoll PADpoll;
|
|
|
|
extern _PADquery PADquery;
|
|
|
|
extern _PADupdate PADupdate;
|
|
|
|
extern _PADkeyEvent PADkeyEvent;
|
|
|
|
extern _PADgsDriverInfo PADgsDriverInfo;
|
|
|
|
extern _PADsetSlot PADsetSlot;
|
|
|
|
extern _PADqueryMtap PADqueryMtap;
|
|
|
|
extern _PADWriteEvent PADWriteEvent;
|
2016-03-30 07:47:27 +00:00
|
|
|
#endif
|
2009-08-02 16:48:03 +00:00
|
|
|
|
2009-02-09 21:15:56 +00:00
|
|
|
// SPU2
|
2016-03-30 07:47:27 +00:00
|
|
|
#ifndef BUILTIN_SPU2_PLUGIN
|
2016-11-12 15:28:37 +00:00
|
|
|
extern _SPU2open SPU2open;
|
|
|
|
extern _SPU2reset SPU2reset;
|
|
|
|
extern _SPU2write SPU2write;
|
|
|
|
extern _SPU2read SPU2read;
|
2010-01-23 03:28:32 +00:00
|
|
|
|
|
|
|
#ifdef ENABLE_NEW_IOPDMA_SPU2
|
2016-11-12 15:28:37 +00:00
|
|
|
extern _SPU2dmaRead SPU2dmaRead;
|
|
|
|
extern _SPU2dmaWrite SPU2dmaWrite;
|
|
|
|
extern _SPU2dmaInterrupt SPU2dmaInterrupt;
|
2010-01-23 03:28:32 +00:00
|
|
|
#else
|
2016-11-12 15:28:37 +00:00
|
|
|
extern _SPU2readDMA4Mem SPU2readDMA4Mem;
|
|
|
|
extern _SPU2writeDMA4Mem SPU2writeDMA4Mem;
|
2009-02-09 21:15:56 +00:00
|
|
|
extern _SPU2interruptDMA4 SPU2interruptDMA4;
|
2016-11-12 15:28:37 +00:00
|
|
|
extern _SPU2readDMA7Mem SPU2readDMA7Mem;
|
|
|
|
extern _SPU2writeDMA7Mem SPU2writeDMA7Mem;
|
2009-02-09 21:15:56 +00:00
|
|
|
extern _SPU2setDMABaseAddr SPU2setDMABaseAddr;
|
|
|
|
extern _SPU2interruptDMA7 SPU2interruptDMA7;
|
2016-11-12 15:28:37 +00:00
|
|
|
extern _SPU2ReadMemAddr SPU2ReadMemAddr;
|
2009-02-09 21:15:56 +00:00
|
|
|
extern _SPU2setupRecording SPU2setupRecording;
|
2016-11-12 15:28:37 +00:00
|
|
|
extern _SPU2WriteMemAddr SPU2WriteMemAddr;
|
|
|
|
extern _SPU2irqCallback SPU2irqCallback;
|
2010-01-23 03:28:32 +00:00
|
|
|
#endif
|
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
extern _SPU2irqCallback SPU2irqCallback;
|
2010-01-23 03:28:32 +00:00
|
|
|
|
|
|
|
extern _SPU2setupRecording SPU2setupRecording;
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
extern _SPU2setClockPtr SPU2setClockPtr;
|
2009-02-09 21:15:56 +00:00
|
|
|
extern _SPU2setTimeStretcher SPU2setTimeStretcher;
|
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
extern _SPU2async SPU2async;
|
2016-03-30 07:47:27 +00:00
|
|
|
#endif
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
// DEV9
|
2016-03-30 07:47:27 +00:00
|
|
|
#ifndef BUILTIN_DEV9_PLUGIN
|
2016-11-12 15:28:37 +00:00
|
|
|
extern _DEV9open DEV9open;
|
|
|
|
extern _DEV9read8 DEV9read8;
|
|
|
|
extern _DEV9read16 DEV9read16;
|
|
|
|
extern _DEV9read32 DEV9read32;
|
|
|
|
extern _DEV9write8 DEV9write8;
|
|
|
|
extern _DEV9write16 DEV9write16;
|
|
|
|
extern _DEV9write32 DEV9write32;
|
2010-02-06 22:18:26 +00:00
|
|
|
#ifdef ENABLE_NEW_IOPDMA_DEV9
|
2016-11-12 15:28:37 +00:00
|
|
|
extern _DEV9dmaRead DEV9dmaRead;
|
|
|
|
extern _DEV9dmaWrite DEV9dmaWrite;
|
|
|
|
extern _DEV9dmaInterrupt DEV9dmaInterrupt;
|
2010-02-06 22:18:26 +00:00
|
|
|
#else
|
2016-11-12 15:28:37 +00:00
|
|
|
extern _DEV9readDMA8Mem DEV9readDMA8Mem;
|
|
|
|
extern _DEV9writeDMA8Mem DEV9writeDMA8Mem;
|
2010-02-06 22:18:26 +00:00
|
|
|
#endif
|
2016-11-12 15:28:37 +00:00
|
|
|
extern _DEV9irqCallback DEV9irqCallback;
|
|
|
|
extern _DEV9irqHandler DEV9irqHandler;
|
|
|
|
extern _DEV9async DEV9async;
|
2016-03-30 07:47:27 +00:00
|
|
|
#endif
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
// USB
|
2016-03-30 07:47:27 +00:00
|
|
|
#ifndef BUILTIN_USB_PLUGIN
|
2016-11-12 15:28:37 +00:00
|
|
|
extern _USBopen USBopen;
|
|
|
|
extern _USBread8 USBread8;
|
|
|
|
extern _USBread16 USBread16;
|
|
|
|
extern _USBread32 USBread32;
|
|
|
|
extern _USBwrite8 USBwrite8;
|
|
|
|
extern _USBwrite16 USBwrite16;
|
|
|
|
extern _USBwrite32 USBwrite32;
|
|
|
|
extern _USBasync USBasync;
|
|
|
|
|
|
|
|
extern _USBirqCallback USBirqCallback;
|
|
|
|
extern _USBirqHandler USBirqHandler;
|
|
|
|
extern _USBsetRAM USBsetRAM;
|
2016-03-30 07:47:27 +00:00
|
|
|
#endif
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
// FW
|
2016-03-30 07:47:27 +00:00
|
|
|
#ifndef BUILTIN_FW_PLUGIN
|
2016-11-12 15:28:37 +00:00
|
|
|
extern _FWopen FWopen;
|
|
|
|
extern _FWread32 FWread32;
|
|
|
|
extern _FWwrite32 FWwrite32;
|
|
|
|
extern _FWirqCallback FWirqCallback;
|
2016-03-30 07:47:27 +00:00
|
|
|
#endif
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
2016-11-12 15:28:37 +00:00
|
|
|
} // End extern "C"
|
2009-02-09 21:15:56 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* __PS2EDEFS_H__ */
|