mirror of
https://github.com/libretro/pcsx2.git
synced 2024-11-27 19:30:36 +00:00
reformat null plugin with pointer symbol on the right
This commit is contained in:
parent
a678ae2529
commit
1f8a0db290
@ -27,7 +27,7 @@ const unsigned char version = PS2E_CDVD_VERSION;
|
|||||||
const unsigned char revision = 0;
|
const unsigned char revision = 0;
|
||||||
const unsigned char build = 6;
|
const unsigned char build = 6;
|
||||||
|
|
||||||
EXPORT_C_(char*)
|
EXPORT_C_(char *)
|
||||||
PS2EgetLibName()
|
PS2EgetLibName()
|
||||||
{
|
{
|
||||||
snprintf(libraryName, 255, "CDVDnull Driver %lld%s", SVN_REV, SVN_MODS ? "m" : "");
|
snprintf(libraryName, 255, "CDVDnull Driver %lld%s", SVN_REV, SVN_MODS ? "m" : "");
|
||||||
@ -53,7 +53,7 @@ CDVDinit()
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(s32)
|
EXPORT_C_(s32)
|
||||||
CDVDopen(const char* pTitle)
|
CDVDopen(const char *pTitle)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -75,32 +75,32 @@ CDVDreadTrack(u32 lsn, int mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// return can be NULL (for async modes)
|
// return can be NULL (for async modes)
|
||||||
EXPORT_C_(u8*)
|
EXPORT_C_(u8 *)
|
||||||
CDVDgetBuffer()
|
CDVDgetBuffer()
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(s32)
|
EXPORT_C_(s32)
|
||||||
CDVDreadSubQ(u32 lsn, cdvdSubQ* subq)
|
CDVDreadSubQ(u32 lsn, cdvdSubQ *subq)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(s32)
|
EXPORT_C_(s32)
|
||||||
CDVDgetTN(cdvdTN* Buffer)
|
CDVDgetTN(cdvdTN *Buffer)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(s32)
|
EXPORT_C_(s32)
|
||||||
CDVDgetTD(u8 Track, cdvdTD* Buffer)
|
CDVDgetTD(u8 Track, cdvdTD *Buffer)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(s32)
|
EXPORT_C_(s32)
|
||||||
CDVDgetTOC(void* toc)
|
CDVDgetTOC(void *toc)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -38,5 +38,5 @@ extern const unsigned char revision;
|
|||||||
extern const unsigned char build;
|
extern const unsigned char build;
|
||||||
extern const unsigned int minor;
|
extern const unsigned int minor;
|
||||||
|
|
||||||
extern void SysMessage(const char* fmt, ...);
|
extern void SysMessage(const char *fmt, ...);
|
||||||
#endif /* __CDVD_H__ */
|
#endif /* __CDVD_H__ */
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
void SaveConf();
|
void SaveConf();
|
||||||
void LoadConf();
|
void LoadConf();
|
||||||
void SysMessage(const char* fmt, ...);
|
void SysMessage(const char *fmt, ...);
|
||||||
|
|
||||||
#define is_checked(main_widget, widget_name) (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name))))
|
#define is_checked(main_widget, widget_name) (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name))))
|
||||||
#define set_checked(main_widget, widget_name, state) gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name)), state)
|
#define set_checked(main_widget, widget_name, state) gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name)), state)
|
||||||
|
@ -36,7 +36,7 @@ string s_strIniPath = "inis";
|
|||||||
string s_strLogPath = "logs";
|
string s_strLogPath = "logs";
|
||||||
|
|
||||||
u8 phyregs[16];
|
u8 phyregs[16];
|
||||||
s8* fwregs;
|
s8 *fwregs;
|
||||||
Config conf;
|
Config conf;
|
||||||
PluginLog FWLog;
|
PluginLog FWLog;
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ void LogInit()
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
FWsetLogDir(const char* dir)
|
FWsetLogDir(const char *dir)
|
||||||
{
|
{
|
||||||
// Get the path to the log directory.
|
// Get the path to the log directory.
|
||||||
s_strLogPath = (dir == NULL) ? "logs" : dir;
|
s_strLogPath = (dir == NULL) ? "logs" : dir;
|
||||||
@ -66,7 +66,7 @@ PS2EgetLibType()
|
|||||||
return PS2E_LT_FW;
|
return PS2E_LT_FW;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(char*)
|
EXPORT_C_(char *)
|
||||||
PS2EgetLibName()
|
PS2EgetLibName()
|
||||||
{
|
{
|
||||||
snprintf(libraryName, 255, "FWnull Driver %lld%s", SVN_REV, SVN_MODS ? "m" : "");
|
snprintf(libraryName, 255, "FWnull Driver %lld%s", SVN_REV, SVN_MODS ? "m" : "");
|
||||||
@ -89,7 +89,7 @@ FWinit()
|
|||||||
|
|
||||||
memset(phyregs, 0, sizeof(phyregs));
|
memset(phyregs, 0, sizeof(phyregs));
|
||||||
// Initializing our registers.
|
// Initializing our registers.
|
||||||
fwregs = (s8*)calloc(0x10000, 1);
|
fwregs = (s8 *)calloc(0x10000, 1);
|
||||||
if (fwregs == NULL) {
|
if (fwregs == NULL) {
|
||||||
FWLog.Message("Error allocating Memory");
|
FWLog.Message("Error allocating Memory");
|
||||||
return -1;
|
return -1;
|
||||||
@ -108,7 +108,7 @@ FWshutdown()
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(s32)
|
EXPORT_C_(s32)
|
||||||
FWopen(void* pDsp)
|
FWopen(void *pDsp)
|
||||||
{
|
{
|
||||||
FWLog.WriteLn("Opening FWnull.");
|
FWLog.WriteLn("Opening FWnull.");
|
||||||
|
|
||||||
@ -278,14 +278,14 @@ FWirqCallback(void (*callback)())
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
FWsetSettingsDir(const char* dir)
|
FWsetSettingsDir(const char *dir)
|
||||||
{
|
{
|
||||||
// Find out from pcsx2 where we are supposed to put our ini file.
|
// Find out from pcsx2 where we are supposed to put our ini file.
|
||||||
s_strIniPath = (dir == NULL) ? "inis" : dir;
|
s_strIniPath = (dir == NULL) ? "inis" : dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(s32)
|
EXPORT_C_(s32)
|
||||||
FWfreeze(int mode, freezeData* data)
|
FWfreeze(int mode, freezeData *data)
|
||||||
{
|
{
|
||||||
// This should store or retrieve any information, for if emulation
|
// This should store or retrieve any information, for if emulation
|
||||||
// gets suspended, or for savestates.
|
// gets suspended, or for savestates.
|
||||||
|
@ -23,9 +23,9 @@
|
|||||||
#include "PS2Eext.h"
|
#include "PS2Eext.h"
|
||||||
|
|
||||||
// Our main memory storage, and defines for accessing it.
|
// Our main memory storage, and defines for accessing it.
|
||||||
extern s8* fwregs;
|
extern s8 *fwregs;
|
||||||
#define fwRs32(mem) (*(s32*)&fwregs[(mem)&0xffff])
|
#define fwRs32(mem) (*(s32 *)&fwregs[(mem)&0xffff])
|
||||||
#define fwRu32(mem) (*(u32*)&fwregs[(mem)&0xffff])
|
#define fwRu32(mem) (*(u32 *)&fwregs[(mem)&0xffff])
|
||||||
|
|
||||||
//PHY Access Address for ease of use :P
|
//PHY Access Address for ease of use :P
|
||||||
#define PHYACC fwRu32(0x8414)
|
#define PHYACC fwRu32(0x8414)
|
||||||
|
@ -21,8 +21,8 @@ extern HINSTANCE hInst;
|
|||||||
void SaveConfig()
|
void SaveConfig()
|
||||||
{
|
{
|
||||||
|
|
||||||
Config* Conf1 = &conf;
|
Config *Conf1 = &conf;
|
||||||
char* szTemp;
|
char *szTemp;
|
||||||
char szIniFile[256], szValue[256];
|
char szIniFile[256], szValue[256];
|
||||||
|
|
||||||
GetModuleFileName(GetModuleHandle((LPCSTR)hInst), szIniFile, 256);
|
GetModuleFileName(GetModuleHandle((LPCSTR)hInst), szIniFile, 256);
|
||||||
@ -37,11 +37,11 @@ void SaveConfig()
|
|||||||
|
|
||||||
void LoadConfig()
|
void LoadConfig()
|
||||||
{
|
{
|
||||||
FILE* fp;
|
FILE *fp;
|
||||||
|
|
||||||
|
|
||||||
Config* Conf1 = &conf;
|
Config *Conf1 = &conf;
|
||||||
char* szTemp;
|
char *szTemp;
|
||||||
char szIniFile[256], szValue[256];
|
char szIniFile[256], szValue[256];
|
||||||
|
|
||||||
GetModuleFileName(GetModuleHandle((LPCSTR)hInst), szIniFile, 256);
|
GetModuleFileName(GetModuleHandle((LPCSTR)hInst), szIniFile, 256);
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
HINSTANCE hInst;
|
HINSTANCE hInst;
|
||||||
|
|
||||||
void SysMessage(char* fmt, ...)
|
void SysMessage(char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list list;
|
va_list list;
|
||||||
char tmp[512];
|
char tmp[512];
|
||||||
|
@ -42,7 +42,7 @@ bool GSShift = false, GSAlt = false;
|
|||||||
|
|
||||||
string s_strIniPath = "inis";
|
string s_strIniPath = "inis";
|
||||||
extern std::string s_strLogPath;
|
extern std::string s_strLogPath;
|
||||||
const char* s_iniFilename = "GSnull.ini";
|
const char *s_iniFilename = "GSnull.ini";
|
||||||
GSVars gs;
|
GSVars gs;
|
||||||
|
|
||||||
// Because I haven't bothered to get GSOpen2 working in Windows yet in GSNull.
|
// Because I haven't bothered to get GSOpen2 working in Windows yet in GSNull.
|
||||||
@ -62,7 +62,7 @@ PS2EgetLibType()
|
|||||||
return PS2E_LT_GS;
|
return PS2E_LT_GS;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(char*)
|
EXPORT_C_(char *)
|
||||||
PS2EgetLibName()
|
PS2EgetLibName()
|
||||||
{
|
{
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
@ -80,7 +80,7 @@ PS2EgetLibVersion2(u32 type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
GSprintf(int timeout, char* fmt, ...)
|
GSprintf(int timeout, char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list list;
|
va_list list;
|
||||||
char msg[512];
|
char msg[512];
|
||||||
@ -94,13 +94,13 @@ GSprintf(int timeout, char* fmt, ...)
|
|||||||
|
|
||||||
// basic funcs
|
// basic funcs
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
GSsetSettingsDir(const char* dir)
|
GSsetSettingsDir(const char *dir)
|
||||||
{
|
{
|
||||||
s_strIniPath = (dir == NULL) ? "inis" : dir;
|
s_strIniPath = (dir == NULL) ? "inis" : dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
GSsetLogDir(const char* dir)
|
GSsetLogDir(const char *dir)
|
||||||
{
|
{
|
||||||
// Get the path to the log directory.
|
// Get the path to the log directory.
|
||||||
s_strLogPath = (dir == NULL) ? "logs" : dir;
|
s_strLogPath = (dir == NULL) ? "logs" : dir;
|
||||||
@ -130,7 +130,7 @@ GSshutdown()
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(s32)
|
EXPORT_C_(s32)
|
||||||
GSopen(void* pDsp, const char* Title, int multithread)
|
GSopen(void *pDsp, const char *Title, int multithread)
|
||||||
{
|
{
|
||||||
int err = 0;
|
int err = 0;
|
||||||
GSLog::WriteLn("GS open.");
|
GSLog::WriteLn("GS open.");
|
||||||
@ -148,7 +148,7 @@ GSopen(void* pDsp, const char* Title, int multithread)
|
|||||||
|
|
||||||
#ifdef USE_GSOPEN2
|
#ifdef USE_GSOPEN2
|
||||||
EXPORT_C_(s32)
|
EXPORT_C_(s32)
|
||||||
GSopen2(void* pDsp, u32 flags)
|
GSopen2(void *pDsp, u32 flags)
|
||||||
{
|
{
|
||||||
GSLog::WriteLn("GS open2.");
|
GSLog::WriteLn("GS open2.");
|
||||||
|
|
||||||
@ -181,7 +181,7 @@ GSirqCallback(void (*callback)())
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(s32)
|
EXPORT_C_(s32)
|
||||||
GSfreeze(int mode, freezeData* data)
|
GSfreeze(int mode, freezeData *data)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -201,9 +201,9 @@ GSvsync(int field)
|
|||||||
|
|
||||||
// returns the last tag processed (64 bits)
|
// returns the last tag processed (64 bits)
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
GSgetLastTag(u64* ptag)
|
GSgetLastTag(u64 *ptag)
|
||||||
{
|
{
|
||||||
*(u32*)ptag = gs.nPath3Hack;
|
*(u32 *)ptag = gs.nPath3Hack;
|
||||||
gs.nPath3Hack = 0;
|
gs.nPath3Hack = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,12 +214,12 @@ GSgifSoftReset(u32 mask)
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
GSreadFIFO(u64* mem)
|
GSreadFIFO(u64 *mem)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
GSreadFIFO2(u64* mem, int qwc)
|
GSreadFIFO2(u64 *mem, int qwc)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -227,31 +227,31 @@ GSreadFIFO2(u64* mem, int qwc)
|
|||||||
|
|
||||||
// GSkeyEvent gets called when there is a keyEvent from the PAD plugin
|
// GSkeyEvent gets called when there is a keyEvent from the PAD plugin
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
GSkeyEvent(keyEvent* ev)
|
GSkeyEvent(keyEvent *ev)
|
||||||
{
|
{
|
||||||
HandleKeyEvent(ev);
|
HandleKeyEvent(ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
GSchangeSaveState(int, const char* filename)
|
GSchangeSaveState(int, const char *filename)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
GSmakeSnapshot(char* path)
|
GSmakeSnapshot(char *path)
|
||||||
{
|
{
|
||||||
|
|
||||||
GSLog::WriteLn("Taking a snapshot.");
|
GSLog::WriteLn("Taking a snapshot.");
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
GSmakeSnapshot2(char* pathname, int* snapdone, int savejpg)
|
GSmakeSnapshot2(char *pathname, int *snapdone, int savejpg)
|
||||||
{
|
{
|
||||||
GSLog::WriteLn("Taking a snapshot to %s.", pathname);
|
GSLog::WriteLn("Taking a snapshot to %s.", pathname);
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
GSsetBaseMem(void*)
|
GSsetBaseMem(void *)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,7 +273,7 @@ GSsetFrameSkip(int frameskip)
|
|||||||
// returns a non zero value if successful
|
// returns a non zero value if successful
|
||||||
// for now, pData is not used
|
// for now, pData is not used
|
||||||
EXPORT_C_(int)
|
EXPORT_C_(int)
|
||||||
GSsetupRecording(int start, void* pData)
|
GSsetupRecording(int start, void *pData)
|
||||||
{
|
{
|
||||||
if (start)
|
if (start)
|
||||||
GSLog::WriteLn("Pretending to record.");
|
GSLog::WriteLn("Pretending to record.");
|
||||||
@ -295,6 +295,6 @@ GSwriteCSR(u32 value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
GSgetDriverInfo(GSdriverInfo* info)
|
GSgetDriverInfo(GSdriverInfo *info)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -81,10 +81,10 @@ namespace GSLog
|
|||||||
{
|
{
|
||||||
extern bool Open();
|
extern bool Open();
|
||||||
extern void Close();
|
extern void Close();
|
||||||
extern void Log(char* fmt, ...);
|
extern void Log(char *fmt, ...);
|
||||||
extern void Message(char* fmt, ...);
|
extern void Message(char *fmt, ...);
|
||||||
extern void Print(const char* fmt, ...);
|
extern void Print(const char *fmt, ...);
|
||||||
extern void WriteLn(const char* fmt, ...);
|
extern void WriteLn(const char *fmt, ...);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern void SaveConfig();
|
extern void SaveConfig();
|
||||||
|
@ -32,7 +32,7 @@ std::string s_strLogPath("logs");
|
|||||||
|
|
||||||
namespace GSLog
|
namespace GSLog
|
||||||
{
|
{
|
||||||
FILE* gsLog;
|
FILE *gsLog;
|
||||||
|
|
||||||
bool Open()
|
bool Open()
|
||||||
{
|
{
|
||||||
@ -63,7 +63,7 @@ void Close()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Log(char* fmt, ...)
|
void Log(char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list list;
|
va_list list;
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ void Log(char* fmt, ...)
|
|||||||
va_end(list);
|
va_end(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Message(char* fmt, ...)
|
void Message(char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list list;
|
va_list list;
|
||||||
char msg[512];
|
char msg[512];
|
||||||
@ -87,7 +87,7 @@ void Message(char* fmt, ...)
|
|||||||
SysMessage("%s\n", msg);
|
SysMessage("%s\n", msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Print(const char* fmt, ...)
|
void Print(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list list;
|
va_list list;
|
||||||
char msg[512];
|
char msg[512];
|
||||||
@ -101,7 +101,7 @@ void Print(const char* fmt, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WriteLn(const char* fmt, ...)
|
void WriteLn(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list list;
|
va_list list;
|
||||||
char msg[512];
|
char msg[512];
|
||||||
|
@ -29,11 +29,11 @@ extern GSVars gs;
|
|||||||
PCSX2_ALIGNED16(u8 g_RealGSMem[0x2000]);
|
PCSX2_ALIGNED16(u8 g_RealGSMem[0x2000]);
|
||||||
|
|
||||||
template <int index>
|
template <int index>
|
||||||
void _GSgifTransfer(const u32* pMem, u32 size)
|
void _GSgifTransfer(const u32 *pMem, u32 size)
|
||||||
{
|
{
|
||||||
// FUNCLOG
|
// FUNCLOG
|
||||||
|
|
||||||
pathInfo* path = &gs.path[index];
|
pathInfo *path = &gs.path[index];
|
||||||
|
|
||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
//GSLog::Writeln(_T("Transfer(%08x, %d) START\n"), pMem, size);
|
//GSLog::Writeln(_T("Transfer(%08x, %d) START\n"), pMem, size);
|
||||||
@ -49,7 +49,7 @@ void _GSgifTransfer(const u32* pMem, u32 size)
|
|||||||
|
|
||||||
if (path->tag.PRE && (path->tag.FLG == GIF_FLG_PACKED)) {
|
if (path->tag.PRE && (path->tag.FLG == GIF_FLG_PACKED)) {
|
||||||
u32 tagprim = path->tag.PRIM;
|
u32 tagprim = path->tag.PRIM;
|
||||||
GIFRegHandlerPRIM((u32*)&tagprim);
|
GIFRegHandlerPRIM((u32 *)&tagprim);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -150,34 +150,34 @@ void _GSgifTransfer(const u32* pMem, u32 size)
|
|||||||
|
|
||||||
// Obsolete. Included because it's still in GSdef.
|
// Obsolete. Included because it's still in GSdef.
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
GSgifTransfer1(u32* pMem, u32 addr)
|
GSgifTransfer1(u32 *pMem, u32 addr)
|
||||||
{
|
{
|
||||||
#ifdef DO_GIF_TRANSFERS
|
#ifdef DO_GIF_TRANSFERS
|
||||||
_GSgifTransfer<0>((u32*)((u8*)pMem + addr), (0x4000 - addr) / 16);
|
_GSgifTransfer<0>((u32 *)((u8 *)pMem + addr), (0x4000 - addr) / 16);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
GSgifTransfer(const u32* pMem, u32 size)
|
GSgifTransfer(const u32 *pMem, u32 size)
|
||||||
{
|
{
|
||||||
#ifdef DO_GIF_TRANSFERS
|
#ifdef DO_GIF_TRANSFERS
|
||||||
_GSgifTransfer<3>(const_cast<u32*>(pMem), size);
|
_GSgifTransfer<3>(const_cast<u32 *>(pMem), size);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
GSgifTransfer2(u32* pMem, u32 size)
|
GSgifTransfer2(u32 *pMem, u32 size)
|
||||||
{
|
{
|
||||||
#ifdef DO_GIF_TRANSFERS
|
#ifdef DO_GIF_TRANSFERS
|
||||||
_GSgifTransfer<1>(const_cast<u32*>(pMem), size);
|
_GSgifTransfer<1>(const_cast<u32 *>(pMem), size);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
GSgifTransfer3(u32* pMem, u32 size)
|
GSgifTransfer3(u32 *pMem, u32 size)
|
||||||
{
|
{
|
||||||
#ifdef DO_GIF_TRANSFERS
|
#ifdef DO_GIF_TRANSFERS
|
||||||
_GSgifTransfer<2>(const_cast<u32*>(pMem), size);
|
_GSgifTransfer<2>(const_cast<u32 *>(pMem), size);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,14 +47,14 @@ union GIFTag
|
|||||||
u64 REGS : 64;
|
u64 REGS : 64;
|
||||||
};
|
};
|
||||||
|
|
||||||
void set(const u32* data)
|
void set(const u32 *data)
|
||||||
{
|
{
|
||||||
for (int i = 0; i <= 3; i++) {
|
for (int i = 0; i <= 3; i++) {
|
||||||
ai32[i] = data[i];
|
ai32[i] = data[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GIFTag(u32* data)
|
GIFTag(u32 *data)
|
||||||
{
|
{
|
||||||
set(data);
|
set(data);
|
||||||
}
|
}
|
||||||
@ -79,7 +79,7 @@ typedef struct
|
|||||||
u32 adonly;
|
u32 adonly;
|
||||||
GIFTag tag;
|
GIFTag tag;
|
||||||
|
|
||||||
void setTag(const u32* data)
|
void setTag(const u32 *data)
|
||||||
{
|
{
|
||||||
tag.set(data);
|
tag.set(data);
|
||||||
|
|
||||||
@ -123,10 +123,10 @@ typedef struct
|
|||||||
|
|
||||||
} pathInfo;
|
} pathInfo;
|
||||||
|
|
||||||
extern void _GSgifPacket(pathInfo* path, const u32* pMem);
|
extern void _GSgifPacket(pathInfo *path, const u32 *pMem);
|
||||||
extern void _GSgifRegList(pathInfo* path, const u32* pMem);
|
extern void _GSgifRegList(pathInfo *path, const u32 *pMem);
|
||||||
template <int index>
|
template <int index>
|
||||||
extern void _GSgifTransfer(const u32* pMem, u32 size);
|
extern void _GSgifTransfer(const u32 *pMem, u32 size);
|
||||||
extern GIFRegHandler GIFPackedRegHandlers[];
|
extern GIFRegHandler GIFPackedRegHandlers[];
|
||||||
extern GIFRegHandler GIFRegHandlers[];
|
extern GIFRegHandler GIFRegHandlers[];
|
||||||
#endif // GIFTRANSFER_H_INCLUDED
|
#endif // GIFTRANSFER_H_INCLUDED
|
||||||
|
@ -19,6 +19,6 @@
|
|||||||
void SaveConf();
|
void SaveConf();
|
||||||
void LoadConf();
|
void LoadConf();
|
||||||
|
|
||||||
extern long CFGmessage(char* msg);
|
extern long CFGmessage(char *msg);
|
||||||
extern void CFGconfigure();
|
extern void CFGconfigure();
|
||||||
extern void CFGabout();
|
extern void CFGabout();
|
||||||
|
@ -16,28 +16,28 @@
|
|||||||
#include "GS.h"
|
#include "GS.h"
|
||||||
#include "GSLinux.h"
|
#include "GSLinux.h"
|
||||||
|
|
||||||
Display* display;
|
Display *display;
|
||||||
int screen;
|
int screen;
|
||||||
GtkScrolledWindow* win;
|
GtkScrolledWindow *win;
|
||||||
|
|
||||||
int GSOpenWindow(void* pDsp, const char* Title)
|
int GSOpenWindow(void *pDsp, const char *Title)
|
||||||
{
|
{
|
||||||
display = XOpenDisplay(0);
|
display = XOpenDisplay(0);
|
||||||
screen = DefaultScreen(display);
|
screen = DefaultScreen(display);
|
||||||
|
|
||||||
if (pDsp != NULL)
|
if (pDsp != NULL)
|
||||||
*(Display**)pDsp = display;
|
*(Display **)pDsp = display;
|
||||||
else
|
else
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GSOpenWindow2(void* pDsp, u32 flags)
|
int GSOpenWindow2(void *pDsp, u32 flags)
|
||||||
{
|
{
|
||||||
GtkWidget* widget;
|
GtkWidget *widget;
|
||||||
if (pDsp != NULL)
|
if (pDsp != NULL)
|
||||||
win = *(GtkScrolledWindow**)pDsp;
|
win = *(GtkScrolledWindow **)pDsp;
|
||||||
else
|
else
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ void GSProcessMessages()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void HandleKeyEvent(keyEvent* ev)
|
void HandleKeyEvent(keyEvent *ev)
|
||||||
{
|
{
|
||||||
switch (ev->evt) {
|
switch (ev->evt) {
|
||||||
case KEYPRESS:
|
case KEYPRESS:
|
||||||
|
@ -20,10 +20,10 @@
|
|||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
|
|
||||||
extern int GSOpenWindow(void* pDsp, const char* Title);
|
extern int GSOpenWindow(void *pDsp, const char *Title);
|
||||||
extern int GSOpenWindow2(void* pDsp, u32 flags);
|
extern int GSOpenWindow2(void *pDsp, u32 flags);
|
||||||
extern void GSCloseWindow();
|
extern void GSCloseWindow();
|
||||||
extern void GSProcessMessages();
|
extern void GSProcessMessages();
|
||||||
extern void HandleKeyEvent(keyEvent* ev);
|
extern void HandleKeyEvent(keyEvent *ev);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -25,35 +25,35 @@ GIFRegHandler GIFRegHandlers[256];
|
|||||||
// For now, I'm just rigging this up to store all the register information coming in, without doing
|
// For now, I'm just rigging this up to store all the register information coming in, without doing
|
||||||
// any of the normal processing.
|
// any of the normal processing.
|
||||||
|
|
||||||
void __gifCall GIFPackedRegHandlerNull(const u32* data)
|
void __gifCall GIFPackedRegHandlerNull(const u32 *data)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// All these just call their non-packed equivalent.
|
// All these just call their non-packed equivalent.
|
||||||
void __gifCall GIFPackedRegHandlerPRIM(const u32* data) { GIFRegHandlerPRIM(data); }
|
void __gifCall GIFPackedRegHandlerPRIM(const u32 *data) { GIFRegHandlerPRIM(data); }
|
||||||
|
|
||||||
template <u32 i>
|
template <u32 i>
|
||||||
void __gifCall GIFPackedRegHandlerTEX0(const u32* data)
|
void __gifCall GIFPackedRegHandlerTEX0(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegHandlerTEX0<i>(data);
|
GIFRegHandlerTEX0<i>(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <u32 i>
|
template <u32 i>
|
||||||
void __gifCall GIFPackedRegHandlerCLAMP(const u32* data)
|
void __gifCall GIFPackedRegHandlerCLAMP(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegHandlerCLAMP<i>(data);
|
GIFRegHandlerCLAMP<i>(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFPackedRegHandlerTEX0_1(const u32* data) { GIFRegHandlerTEX0<0>(data); }
|
void __gifCall GIFPackedRegHandlerTEX0_1(const u32 *data) { GIFRegHandlerTEX0<0>(data); }
|
||||||
void __gifCall GIFPackedRegHandlerTEX0_2(const u32* data) { GIFRegHandlerTEX0<1>(data); }
|
void __gifCall GIFPackedRegHandlerTEX0_2(const u32 *data) { GIFRegHandlerTEX0<1>(data); }
|
||||||
void __gifCall GIFPackedRegHandlerCLAMP_1(const u32* data) { GIFRegHandlerCLAMP<0>(data); }
|
void __gifCall GIFPackedRegHandlerCLAMP_1(const u32 *data) { GIFRegHandlerCLAMP<0>(data); }
|
||||||
void __gifCall GIFPackedRegHandlerCLAMP_2(const u32* data) { GIFRegHandlerCLAMP<1>(data); }
|
void __gifCall GIFPackedRegHandlerCLAMP_2(const u32 *data) { GIFRegHandlerCLAMP<1>(data); }
|
||||||
void __gifCall GIFPackedRegHandlerXYZF3(const u32* data) { GIFRegHandlerXYZF3(data); }
|
void __gifCall GIFPackedRegHandlerXYZF3(const u32 *data) { GIFRegHandlerXYZF3(data); }
|
||||||
void __gifCall GIFPackedRegHandlerXYZ3(const u32* data) { GIFRegHandlerXYZ3(data); }
|
void __gifCall GIFPackedRegHandlerXYZ3(const u32 *data) { GIFRegHandlerXYZ3(data); }
|
||||||
|
|
||||||
void __gifCall GIFPackedRegHandlerRGBA(const u32* data)
|
void __gifCall GIFPackedRegHandlerRGBA(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFPackedRGBA* r = (GIFPackedRGBA*)(data);
|
GIFPackedRGBA *r = (GIFPackedRGBA *)(data);
|
||||||
gs.regs.RGBAQ.R = r->R;
|
gs.regs.RGBAQ.R = r->R;
|
||||||
gs.regs.RGBAQ.G = r->G;
|
gs.regs.RGBAQ.G = r->G;
|
||||||
gs.regs.RGBAQ.B = r->B;
|
gs.regs.RGBAQ.B = r->B;
|
||||||
@ -61,17 +61,17 @@ void __gifCall GIFPackedRegHandlerRGBA(const u32* data)
|
|||||||
gs.regs.RGBAQ.Q = gs.q;
|
gs.regs.RGBAQ.Q = gs.q;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFPackedRegHandlerSTQ(const u32* data)
|
void __gifCall GIFPackedRegHandlerSTQ(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFPackedSTQ* r = (GIFPackedSTQ*)(data);
|
GIFPackedSTQ *r = (GIFPackedSTQ *)(data);
|
||||||
gs.regs.ST.S = r->S;
|
gs.regs.ST.S = r->S;
|
||||||
gs.regs.ST.T = r->T;
|
gs.regs.ST.T = r->T;
|
||||||
gs.q = r->Q;
|
gs.q = r->Q;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFPackedRegHandlerUV(const u32* data)
|
void __gifCall GIFPackedRegHandlerUV(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFPackedUV* r = (GIFPackedUV*)(data);
|
GIFPackedUV *r = (GIFPackedUV *)(data);
|
||||||
gs.regs.UV.U = r->U;
|
gs.regs.UV.U = r->U;
|
||||||
gs.regs.UV.V = r->V;
|
gs.regs.UV.V = r->V;
|
||||||
}
|
}
|
||||||
@ -80,309 +80,309 @@ void __gifCall KickVertex(bool adc)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFPackedRegHandlerXYZF2(const u32* data)
|
void __gifCall GIFPackedRegHandlerXYZF2(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFPackedXYZF2* r = (GIFPackedXYZF2*)(data);
|
GIFPackedXYZF2 *r = (GIFPackedXYZF2 *)(data);
|
||||||
gs.regs.XYZ.X = r->X;
|
gs.regs.XYZ.X = r->X;
|
||||||
gs.regs.XYZ.Y = r->Y;
|
gs.regs.XYZ.Y = r->Y;
|
||||||
gs.regs.XYZ.Z = r->Z;
|
gs.regs.XYZ.Z = r->Z;
|
||||||
gs.regs.FOG.F = r->F;
|
gs.regs.FOG.F = r->F;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFPackedRegHandlerXYZ2(const u32* data)
|
void __gifCall GIFPackedRegHandlerXYZ2(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFPackedXYZ2* r = (GIFPackedXYZ2*)(data);
|
GIFPackedXYZ2 *r = (GIFPackedXYZ2 *)(data);
|
||||||
gs.regs.XYZ.X = r->X;
|
gs.regs.XYZ.X = r->X;
|
||||||
gs.regs.XYZ.Y = r->Y;
|
gs.regs.XYZ.Y = r->Y;
|
||||||
gs.regs.XYZ.Z = r->Z;
|
gs.regs.XYZ.Z = r->Z;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFPackedRegHandlerFOG(const u32* data)
|
void __gifCall GIFPackedRegHandlerFOG(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFPackedFOG* r = (GIFPackedFOG*)(data);
|
GIFPackedFOG *r = (GIFPackedFOG *)(data);
|
||||||
gs.regs.FOG.F = r->F;
|
gs.regs.FOG.F = r->F;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFPackedRegHandlerA_D(const u32* data)
|
void __gifCall GIFPackedRegHandlerA_D(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFPackedA_D* r = (GIFPackedA_D*)(data);
|
GIFPackedA_D *r = (GIFPackedA_D *)(data);
|
||||||
|
|
||||||
GIFRegHandlers[r->ADDR](data);
|
GIFRegHandlers[r->ADDR](data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFPackedRegHandlerNOP(const u32* data)
|
void __gifCall GIFPackedRegHandlerNOP(const u32 *data)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerNull(const u32* data)
|
void __gifCall GIFRegHandlerNull(const u32 *data)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerRGBAQ(const u32* data)
|
void __gifCall GIFRegHandlerRGBAQ(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegRGBAQ* r = (GIFRegRGBAQ*)(data);
|
GIFRegRGBAQ *r = (GIFRegRGBAQ *)(data);
|
||||||
gs.regs.RGBAQ._u64 = r->_u64;
|
gs.regs.RGBAQ._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerST(const u32* data)
|
void __gifCall GIFRegHandlerST(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegST* r = (GIFRegST*)(data);
|
GIFRegST *r = (GIFRegST *)(data);
|
||||||
gs.regs.ST._u64 = r->_u64;
|
gs.regs.ST._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerUV(const u32* data)
|
void __gifCall GIFRegHandlerUV(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegUV* r = (GIFRegUV*)(data);
|
GIFRegUV *r = (GIFRegUV *)(data);
|
||||||
gs.regs.UV._u64 = r->_u64;
|
gs.regs.UV._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerXYZF2(const u32* data)
|
void __gifCall GIFRegHandlerXYZF2(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegXYZF* r = (GIFRegXYZF*)(data);
|
GIFRegXYZF *r = (GIFRegXYZF *)(data);
|
||||||
gs.regs.XYZF._u64 = r->_u64;
|
gs.regs.XYZF._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerXYZ2(const u32* data)
|
void __gifCall GIFRegHandlerXYZ2(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegXYZ* r = (GIFRegXYZ*)(data);
|
GIFRegXYZ *r = (GIFRegXYZ *)(data);
|
||||||
gs.regs.XYZ._u64 = r->_u64;
|
gs.regs.XYZ._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <u32 i>
|
template <u32 i>
|
||||||
void __gifCall GIFRegHandlerTEX0(const u32* data)
|
void __gifCall GIFRegHandlerTEX0(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegTEX0* r = (GIFRegTEX0*)(data);
|
GIFRegTEX0 *r = (GIFRegTEX0 *)(data);
|
||||||
gs.ctxt_regs[i].TEX0._u64 = r->_u64;
|
gs.ctxt_regs[i].TEX0._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <u32 i>
|
template <u32 i>
|
||||||
void __gifCall GIFRegHandlerCLAMP(const u32* data)
|
void __gifCall GIFRegHandlerCLAMP(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegCLAMP* r = (GIFRegCLAMP*)(data);
|
GIFRegCLAMP *r = (GIFRegCLAMP *)(data);
|
||||||
gs.ctxt_regs[i].CLAMP._u64 = r->_u64;
|
gs.ctxt_regs[i].CLAMP._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerFOG(const u32* data)
|
void __gifCall GIFRegHandlerFOG(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegFOG* r = (GIFRegFOG*)(data);
|
GIFRegFOG *r = (GIFRegFOG *)(data);
|
||||||
gs.regs.FOG.F = r->F;
|
gs.regs.FOG.F = r->F;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerXYZF3(const u32* data)
|
void __gifCall GIFRegHandlerXYZF3(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegXYZF* r = (GIFRegXYZF*)(data);
|
GIFRegXYZF *r = (GIFRegXYZF *)(data);
|
||||||
gs.regs.XYZF._u64 = r->_u64;
|
gs.regs.XYZF._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerXYZ3(const u32* data)
|
void __gifCall GIFRegHandlerXYZ3(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegXYZ* r = (GIFRegXYZ*)(data);
|
GIFRegXYZ *r = (GIFRegXYZ *)(data);
|
||||||
gs.regs.XYZ._u64 = r->_u64;
|
gs.regs.XYZ._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerNOP(const u32* data)
|
void __gifCall GIFRegHandlerNOP(const u32 *data)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
template <u32 i>
|
template <u32 i>
|
||||||
void __fastcall GIFRegHandlerTEX1(const u32* data)
|
void __fastcall GIFRegHandlerTEX1(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegTEX1* r = (GIFRegTEX1*)(data);
|
GIFRegTEX1 *r = (GIFRegTEX1 *)(data);
|
||||||
gs.ctxt_regs[i].TEX1._u64 = r->_u64;
|
gs.ctxt_regs[i].TEX1._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <u32 i>
|
template <u32 i>
|
||||||
void __gifCall GIFRegHandlerTEX2(const u32* data)
|
void __gifCall GIFRegHandlerTEX2(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegTEX2* r = (GIFRegTEX2*)(data);
|
GIFRegTEX2 *r = (GIFRegTEX2 *)(data);
|
||||||
gs.ctxt_regs[i].TEX2._u64 = r->_u64;
|
gs.ctxt_regs[i].TEX2._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <u32 i>
|
template <u32 i>
|
||||||
void __gifCall GIFRegHandlerXYOFFSET(const u32* data)
|
void __gifCall GIFRegHandlerXYOFFSET(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegXYOFFSET* r = (GIFRegXYOFFSET*)(data);
|
GIFRegXYOFFSET *r = (GIFRegXYOFFSET *)(data);
|
||||||
gs.ctxt_regs[i].XYOFFSET.OFX = r->OFX;
|
gs.ctxt_regs[i].XYOFFSET.OFX = r->OFX;
|
||||||
gs.ctxt_regs[i].XYOFFSET.OFY = r->OFY;
|
gs.ctxt_regs[i].XYOFFSET.OFY = r->OFY;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fill out the vertex queue(prim) and the attributes.
|
// Fill out the vertex queue(prim) and the attributes.
|
||||||
void __gifCall GIFRegHandlerPRIM(const u32* data)
|
void __gifCall GIFRegHandlerPRIM(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegPRIM* r = (GIFRegPRIM*)(data);
|
GIFRegPRIM *r = (GIFRegPRIM *)(data);
|
||||||
gs.regs.PRIM._u64 = r->_u64;
|
gs.regs.PRIM._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fill out an alternate set of attributes.
|
// Fill out an alternate set of attributes.
|
||||||
void __gifCall GIFRegHandlerPRMODE(const u32* data)
|
void __gifCall GIFRegHandlerPRMODE(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegPRMODE* r = (GIFRegPRMODE*)(data);
|
GIFRegPRMODE *r = (GIFRegPRMODE *)(data);
|
||||||
gs.regs.PRMODE._u64 = r->_u64;
|
gs.regs.PRMODE._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Switch between the primary set of attributes and the secondary.
|
// Switch between the primary set of attributes and the secondary.
|
||||||
void __gifCall GIFRegHandlerPRMODECONT(const u32* data)
|
void __gifCall GIFRegHandlerPRMODECONT(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegPRMODECONT* r = (GIFRegPRMODECONT*)(data);
|
GIFRegPRMODECONT *r = (GIFRegPRMODECONT *)(data);
|
||||||
gs.regs.PRMODECONT._u64 = r->_u64;
|
gs.regs.PRMODECONT._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerTEXCLUT(const u32* data)
|
void __gifCall GIFRegHandlerTEXCLUT(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegTEXCLUT* r = (GIFRegTEXCLUT*)(data);
|
GIFRegTEXCLUT *r = (GIFRegTEXCLUT *)(data);
|
||||||
gs.regs.TEXCLUT._u64 = r->_u64;
|
gs.regs.TEXCLUT._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerSCANMSK(const u32* data)
|
void __gifCall GIFRegHandlerSCANMSK(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegSCANMSK* r = (GIFRegSCANMSK*)(data);
|
GIFRegSCANMSK *r = (GIFRegSCANMSK *)(data);
|
||||||
gs.regs.SCANMSK._u64 = r->_u64;
|
gs.regs.SCANMSK._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <u32 i>
|
template <u32 i>
|
||||||
void __gifCall GIFRegHandlerMIPTBP1(const u32* data)
|
void __gifCall GIFRegHandlerMIPTBP1(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegMIPTBP1* r = (GIFRegMIPTBP1*)(data);
|
GIFRegMIPTBP1 *r = (GIFRegMIPTBP1 *)(data);
|
||||||
gs.ctxt_regs[i].MIPTBP1._u64 = r->_u64;
|
gs.ctxt_regs[i].MIPTBP1._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <u32 i>
|
template <u32 i>
|
||||||
void __gifCall GIFRegHandlerMIPTBP2(const u32* data)
|
void __gifCall GIFRegHandlerMIPTBP2(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegMIPTBP2* r = (GIFRegMIPTBP2*)(data);
|
GIFRegMIPTBP2 *r = (GIFRegMIPTBP2 *)(data);
|
||||||
gs.ctxt_regs[i].MIPTBP2._u64 = r->_u64;
|
gs.ctxt_regs[i].MIPTBP2._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerTEXA(const u32* data)
|
void __gifCall GIFRegHandlerTEXA(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegTEXA* r = (GIFRegTEXA*)(data);
|
GIFRegTEXA *r = (GIFRegTEXA *)(data);
|
||||||
gs.regs.TEXA._u64 = r->_u64;
|
gs.regs.TEXA._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerFOGCOL(const u32* data)
|
void __gifCall GIFRegHandlerFOGCOL(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegFOGCOL* r = (GIFRegFOGCOL*)(data);
|
GIFRegFOGCOL *r = (GIFRegFOGCOL *)(data);
|
||||||
gs.regs.FOGCOL._u64 = r->_u64;
|
gs.regs.FOGCOL._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerTEXFLUSH(const u32* data)
|
void __gifCall GIFRegHandlerTEXFLUSH(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegTEXFLUSH* r = (GIFRegTEXFLUSH*)(data);
|
GIFRegTEXFLUSH *r = (GIFRegTEXFLUSH *)(data);
|
||||||
gs.regs.TEXFLUSH._u64 = r->_u64;
|
gs.regs.TEXFLUSH._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <u32 i>
|
template <u32 i>
|
||||||
void __gifCall GIFRegHandlerSCISSOR(const u32* data)
|
void __gifCall GIFRegHandlerSCISSOR(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegSCISSOR* r = (GIFRegSCISSOR*)(data);
|
GIFRegSCISSOR *r = (GIFRegSCISSOR *)(data);
|
||||||
gs.ctxt_regs[i].SCISSOR._u64 = r->_u64;
|
gs.ctxt_regs[i].SCISSOR._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <u32 i>
|
template <u32 i>
|
||||||
void __gifCall GIFRegHandlerALPHA(const u32* data)
|
void __gifCall GIFRegHandlerALPHA(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegALPHA* r = (GIFRegALPHA*)(data);
|
GIFRegALPHA *r = (GIFRegALPHA *)(data);
|
||||||
gs.ctxt_regs[i].ALPHA._u64 = r->_u64;
|
gs.ctxt_regs[i].ALPHA._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerDIMX(const u32* data)
|
void __gifCall GIFRegHandlerDIMX(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegDIMX* r = (GIFRegDIMX*)(data);
|
GIFRegDIMX *r = (GIFRegDIMX *)(data);
|
||||||
gs.regs.DIMX._u64 = r->_u64;
|
gs.regs.DIMX._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerDTHE(const u32* data)
|
void __gifCall GIFRegHandlerDTHE(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegDTHE* r = (GIFRegDTHE*)(data);
|
GIFRegDTHE *r = (GIFRegDTHE *)(data);
|
||||||
gs.regs.DTHE._u64 = r->_u64;
|
gs.regs.DTHE._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerCOLCLAMP(const u32* data)
|
void __gifCall GIFRegHandlerCOLCLAMP(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegCOLCLAMP* r = (GIFRegCOLCLAMP*)(data);
|
GIFRegCOLCLAMP *r = (GIFRegCOLCLAMP *)(data);
|
||||||
gs.regs.COLCLAMP._u64 = r->_u64;
|
gs.regs.COLCLAMP._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <u32 i>
|
template <u32 i>
|
||||||
void __gifCall GIFRegHandlerTEST(const u32* data)
|
void __gifCall GIFRegHandlerTEST(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegTEST* r = (GIFRegTEST*)(data);
|
GIFRegTEST *r = (GIFRegTEST *)(data);
|
||||||
gs.ctxt_regs[i].TEST._u64 = r->_u64;
|
gs.ctxt_regs[i].TEST._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerPABE(const u32* data)
|
void __gifCall GIFRegHandlerPABE(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegPABE* r = (GIFRegPABE*)(data);
|
GIFRegPABE *r = (GIFRegPABE *)(data);
|
||||||
gs.regs.PABE._u64 = r->_u64;
|
gs.regs.PABE._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <u32 i>
|
template <u32 i>
|
||||||
void __gifCall GIFRegHandlerFBA(const u32* data)
|
void __gifCall GIFRegHandlerFBA(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegFBA* r = (GIFRegFBA*)(data);
|
GIFRegFBA *r = (GIFRegFBA *)(data);
|
||||||
gs.ctxt_regs[i].FBA._u64 = r->_u64;
|
gs.ctxt_regs[i].FBA._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <u32 i>
|
template <u32 i>
|
||||||
void __gifCall GIFRegHandlerFRAME(const u32* data)
|
void __gifCall GIFRegHandlerFRAME(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegFRAME* r = (GIFRegFRAME*)(data);
|
GIFRegFRAME *r = (GIFRegFRAME *)(data);
|
||||||
gs.ctxt_regs[i].FRAME._u64 = r->_u64;
|
gs.ctxt_regs[i].FRAME._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <u32 i>
|
template <u32 i>
|
||||||
void __gifCall GIFRegHandlerZBUF(const u32* data)
|
void __gifCall GIFRegHandlerZBUF(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegZBUF* r = (GIFRegZBUF*)(data);
|
GIFRegZBUF *r = (GIFRegZBUF *)(data);
|
||||||
gs.ctxt_regs[i].ZBUF._u64 = r->_u64;
|
gs.ctxt_regs[i].ZBUF._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerBITBLTBUF(const u32* data)
|
void __gifCall GIFRegHandlerBITBLTBUF(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegBITBLTBUF* r = (GIFRegBITBLTBUF*)(data);
|
GIFRegBITBLTBUF *r = (GIFRegBITBLTBUF *)(data);
|
||||||
gs.regs.BITBLTBUF._u64 = r->_u64;
|
gs.regs.BITBLTBUF._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerTRXPOS(const u32* data)
|
void __gifCall GIFRegHandlerTRXPOS(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegTRXPOS* r = (GIFRegTRXPOS*)(data);
|
GIFRegTRXPOS *r = (GIFRegTRXPOS *)(data);
|
||||||
gs.regs.TRXPOS._u64 = r->_u64;
|
gs.regs.TRXPOS._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerTRXREG(const u32* data)
|
void __gifCall GIFRegHandlerTRXREG(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegTRXREG* r = (GIFRegTRXREG*)(data);
|
GIFRegTRXREG *r = (GIFRegTRXREG *)(data);
|
||||||
gs.regs.TRXREG._u64 = r->_u64;
|
gs.regs.TRXREG._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerTRXDIR(const u32* data)
|
void __gifCall GIFRegHandlerTRXDIR(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegTRXDIR* r = (GIFRegTRXDIR*)(data);
|
GIFRegTRXDIR *r = (GIFRegTRXDIR *)(data);
|
||||||
gs.regs.TRXDIR._u64 = r->_u64;
|
gs.regs.TRXDIR._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerHWREG(const u32* data)
|
void __gifCall GIFRegHandlerHWREG(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegHWREG* r = (GIFRegHWREG*)(data);
|
GIFRegHWREG *r = (GIFRegHWREG *)(data);
|
||||||
gs.regs.HWREG._u64 = r->_u64;
|
gs.regs.HWREG._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerSIGNAL(const u32* data)
|
void __gifCall GIFRegHandlerSIGNAL(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegSIGNAL* r = (GIFRegSIGNAL*)(data);
|
GIFRegSIGNAL *r = (GIFRegSIGNAL *)(data);
|
||||||
gs.regs.SIGNAL._u64 = r->_u64;
|
gs.regs.SIGNAL._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerFINISH(const u32* data)
|
void __gifCall GIFRegHandlerFINISH(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegFINISH* r = (GIFRegFINISH*)(data);
|
GIFRegFINISH *r = (GIFRegFINISH *)(data);
|
||||||
gs.regs.FINISH._u64 = r->_u64;
|
gs.regs.FINISH._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __gifCall GIFRegHandlerLABEL(const u32* data)
|
void __gifCall GIFRegHandlerLABEL(const u32 *data)
|
||||||
{
|
{
|
||||||
GIFRegLABEL* r = (GIFRegLABEL*)(data);
|
GIFRegLABEL *r = (GIFRegLABEL *)(data);
|
||||||
gs.regs.LABEL._u64 = r->_u64;
|
gs.regs.LABEL._u64 = r->_u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,8 +114,8 @@ enum GIF_A_D_REG {
|
|||||||
// In case we want to change to/from __fastcall for GIF register handlers:
|
// In case we want to change to/from __fastcall for GIF register handlers:
|
||||||
#define __gifCall __fastcall
|
#define __gifCall __fastcall
|
||||||
|
|
||||||
typedef void __gifCall FnType_GIFRegHandler(const u32* data);
|
typedef void __gifCall FnType_GIFRegHandler(const u32 *data);
|
||||||
typedef FnType_GIFRegHandler* GIFRegHandler;
|
typedef FnType_GIFRegHandler *GIFRegHandler;
|
||||||
|
|
||||||
extern FnType_GIFRegHandler GIFPackedRegHandlerNull;
|
extern FnType_GIFRegHandler GIFPackedRegHandlerNull;
|
||||||
extern FnType_GIFRegHandler GIFPackedRegHandlerRGBA;
|
extern FnType_GIFRegHandler GIFPackedRegHandlerRGBA;
|
||||||
|
@ -21,8 +21,8 @@ extern HINSTANCE hInst;
|
|||||||
void SaveConfig()
|
void SaveConfig()
|
||||||
{
|
{
|
||||||
|
|
||||||
Config* Conf1 = &conf;
|
Config *Conf1 = &conf;
|
||||||
char* szTemp;
|
char *szTemp;
|
||||||
char szIniFile[256], szValue[256];
|
char szIniFile[256], szValue[256];
|
||||||
|
|
||||||
GetModuleFileName(GetModuleHandle((LPCSTR)hInst), szIniFile, 256);
|
GetModuleFileName(GetModuleHandle((LPCSTR)hInst), szIniFile, 256);
|
||||||
@ -37,11 +37,11 @@ void SaveConfig()
|
|||||||
|
|
||||||
void LoadConfig()
|
void LoadConfig()
|
||||||
{
|
{
|
||||||
FILE* fp;
|
FILE *fp;
|
||||||
|
|
||||||
|
|
||||||
Config* Conf1 = &conf;
|
Config *Conf1 = &conf;
|
||||||
char* szTemp;
|
char *szTemp;
|
||||||
char szIniFile[256], szValue[256];
|
char szIniFile[256], szValue[256];
|
||||||
|
|
||||||
GetModuleFileName(GetModuleHandle((LPCSTR)hInst), szIniFile, 256);
|
GetModuleFileName(GetModuleHandle((LPCSTR)hInst), szIniFile, 256);
|
||||||
|
@ -33,7 +33,7 @@ LRESULT CALLBACK MsgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GSOpenWindow(void* pDsp, const char* Title)
|
int GSOpenWindow(void *pDsp, const char *Title)
|
||||||
{
|
{
|
||||||
WNDCLASSEX wc = {sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L,
|
WNDCLASSEX wc = {sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L,
|
||||||
GetModuleHandle(NULL), NULL, NULL, NULL, NULL,
|
GetModuleHandle(NULL), NULL, NULL, NULL, NULL,
|
||||||
@ -49,7 +49,7 @@ int GSOpenWindow(void* pDsp, const char* Title)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pDsp != NULL)
|
if (pDsp != NULL)
|
||||||
*(uptr*)pDsp = (uptr)GShwnd;
|
*(uptr *)pDsp = (uptr)GShwnd;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -64,6 +64,6 @@ void GSProcessMessages()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GSkeyEvent gets called when there is a keyEvent from the PAD plugin
|
// GSkeyEvent gets called when there is a keyEvent from the PAD plugin
|
||||||
void HandleKeyEvent(keyEvent* ev)
|
void HandleKeyEvent(keyEvent *ev)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <windowsx.h>
|
#include <windowsx.h>
|
||||||
|
|
||||||
extern int GSOpenWindow(void* pDsp, const char* Title);
|
extern int GSOpenWindow(void *pDsp, const char *Title);
|
||||||
extern void GSCloseWindow();
|
extern void GSCloseWindow();
|
||||||
extern void GSProcessMessages();
|
extern void GSProcessMessages();
|
||||||
extern void HandleKeyEvent(keyEvent* ev);
|
extern void HandleKeyEvent(keyEvent *ev);
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
HINSTANCE hInst;
|
HINSTANCE hInst;
|
||||||
extern HWND GShwnd;
|
extern HWND GShwnd;
|
||||||
|
|
||||||
void SysMessage(char* fmt, ...)
|
void SysMessage(char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list list;
|
va_list list;
|
||||||
char tmp[512];
|
char tmp[512];
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include <gdk/gdkx.h>
|
#include <gdk/gdkx.h>
|
||||||
#include "PadLinux.h"
|
#include "PadLinux.h"
|
||||||
|
|
||||||
Display* GSdsp;
|
Display *GSdsp;
|
||||||
int autoRepeatMode;
|
int autoRepeatMode;
|
||||||
|
|
||||||
void _PadUpdate(int pad)
|
void _PadUpdate(int pad)
|
||||||
@ -31,7 +31,7 @@ void _PadUpdate(int pad)
|
|||||||
XNextEvent(GSdsp, &evt);
|
XNextEvent(GSdsp, &evt);
|
||||||
switch (evt.type) {
|
switch (evt.type) {
|
||||||
case KeyPress:
|
case KeyPress:
|
||||||
key = XLookupKeysym((XKeyEvent*)&evt, 0);
|
key = XLookupKeysym((XKeyEvent *)&evt, 0);
|
||||||
|
|
||||||
// Add code to check if it's one of the keys we configured here on a real pda plugin..
|
// Add code to check if it's one of the keys we configured here on a real pda plugin..
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ void _PadUpdate(int pad)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case KeyRelease:
|
case KeyRelease:
|
||||||
key = XLookupKeysym((XKeyEvent*)&evt, 0);
|
key = XLookupKeysym((XKeyEvent *)&evt, 0);
|
||||||
|
|
||||||
// Add code to check if it's one of the keys we configured here on a real pda plugin..
|
// Add code to check if it's one of the keys we configured here on a real pda plugin..
|
||||||
|
|
||||||
@ -59,12 +59,12 @@ void _PadUpdate(int pad)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 _PADOpen(void* pDsp)
|
s32 _PADOpen(void *pDsp)
|
||||||
{
|
{
|
||||||
|
|
||||||
GtkScrolledWindow* win;
|
GtkScrolledWindow *win;
|
||||||
|
|
||||||
win = *(GtkScrolledWindow**)pDsp;
|
win = *(GtkScrolledWindow **)pDsp;
|
||||||
|
|
||||||
if (GTK_IS_WIDGET(win)) {
|
if (GTK_IS_WIDGET(win)) {
|
||||||
// Since we have a GtkScrolledWindow, for now we'll grab whatever display
|
// Since we have a GtkScrolledWindow, for now we'll grab whatever display
|
||||||
@ -73,7 +73,7 @@ s32 _PADOpen(void* pDsp)
|
|||||||
// be able to manage... --arcum42
|
// be able to manage... --arcum42
|
||||||
GSdsp = GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
|
GSdsp = GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
|
||||||
} else {
|
} else {
|
||||||
GSdsp = *(Display**)pDsp;
|
GSdsp = *(Display **)pDsp;
|
||||||
}
|
}
|
||||||
|
|
||||||
XAutoRepeatOff(GSdsp);
|
XAutoRepeatOff(GSdsp);
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
|
|
||||||
void _PadUpdate(int pad);
|
void _PadUpdate(int pad);
|
||||||
s32 _PADOpen(void* pDsp);
|
s32 _PADOpen(void *pDsp);
|
||||||
void _PADClose();
|
void _PADClose();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -32,7 +32,7 @@ static char libraryName[256];
|
|||||||
string s_strIniPath = "inis";
|
string s_strIniPath = "inis";
|
||||||
string s_strLogPath = "logs";
|
string s_strLogPath = "logs";
|
||||||
|
|
||||||
FILE* padLog;
|
FILE *padLog;
|
||||||
Config conf;
|
Config conf;
|
||||||
keyEvent event;
|
keyEvent event;
|
||||||
static keyEvent s_event;
|
static keyEvent s_event;
|
||||||
@ -43,7 +43,7 @@ PS2EgetLibType()
|
|||||||
return PS2E_LT_PAD;
|
return PS2E_LT_PAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(char*)
|
EXPORT_C_(char *)
|
||||||
PS2EgetLibName()
|
PS2EgetLibName()
|
||||||
{
|
{
|
||||||
snprintf(libraryName, 255, "Padnull Driver %lld%s", SVN_REV, SVN_MODS ? "m" : "");
|
snprintf(libraryName, 255, "Padnull Driver %lld%s", SVN_REV, SVN_MODS ? "m" : "");
|
||||||
@ -56,7 +56,7 @@ PS2EgetLibVersion2(u32 type)
|
|||||||
return (version << 16) | (revision << 8) | build;
|
return (version << 16) | (revision << 8) | build;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __Log(const char* fmt, ...)
|
void __Log(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list list;
|
va_list list;
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ void __Log(const char* fmt, ...)
|
|||||||
va_end(list);
|
va_end(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
void __LogToConsole(const char* fmt, ...)
|
void __LogToConsole(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list list;
|
va_list list;
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ void __LogToConsole(const char* fmt, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
PADsetSettingsDir(const char* dir)
|
PADsetSettingsDir(const char *dir)
|
||||||
{
|
{
|
||||||
s_strIniPath = (dir == NULL) ? "inis" : dir;
|
s_strIniPath = (dir == NULL) ? "inis" : dir;
|
||||||
}
|
}
|
||||||
@ -109,7 +109,7 @@ bool OpenLog()
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
PADsetLogDir(const char* dir)
|
PADsetLogDir(const char *dir)
|
||||||
{
|
{
|
||||||
// Get the path to the log directory.
|
// Get the path to the log directory.
|
||||||
s_strLogPath = (dir == NULL) ? "logs" : dir;
|
s_strLogPath = (dir == NULL) ? "logs" : dir;
|
||||||
@ -144,7 +144,7 @@ PADshutdown()
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(s32)
|
EXPORT_C_(s32)
|
||||||
PADopen(void* pDsp)
|
PADopen(void *pDsp)
|
||||||
{
|
{
|
||||||
memset(&event, 0, sizeof(event));
|
memset(&event, 0, sizeof(event));
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ PADclose()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// PADkeyEvent is called every vsync (return NULL if no event)
|
// PADkeyEvent is called every vsync (return NULL if no event)
|
||||||
EXPORT_C_(keyEvent*)
|
EXPORT_C_(keyEvent *)
|
||||||
PADkeyEvent()
|
PADkeyEvent()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -204,12 +204,12 @@ PADupdate(int pad)
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
PADgsDriverInfo(GSdriverInfo* info)
|
PADgsDriverInfo(GSdriverInfo *info)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(s32)
|
EXPORT_C_(s32)
|
||||||
PADfreeze(int mode, freezeData* data)
|
PADfreeze(int mode, freezeData *data)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -42,10 +42,10 @@ typedef struct
|
|||||||
} Config;
|
} Config;
|
||||||
|
|
||||||
extern Config conf;
|
extern Config conf;
|
||||||
extern FILE* padLog;
|
extern FILE *padLog;
|
||||||
extern keyEvent event;
|
extern keyEvent event;
|
||||||
|
|
||||||
extern void __Log(char* fmt, ...);
|
extern void __Log(char *fmt, ...);
|
||||||
extern void SaveConfig();
|
extern void SaveConfig();
|
||||||
extern void LoadConfig();
|
extern void LoadConfig();
|
||||||
|
|
||||||
|
@ -52,9 +52,9 @@ void _PadUpdate(int pad)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 _PADOpen(void* pDsp)
|
s32 _PADOpen(void *pDsp)
|
||||||
{
|
{
|
||||||
GShwnd = (HWND) * (long*)pDsp;
|
GShwnd = (HWND) * (long *)pDsp;
|
||||||
|
|
||||||
if (GShwnd != NULL && GSwndProc != NULL) {
|
if (GShwnd != NULL && GSwndProc != NULL) {
|
||||||
// revert
|
// revert
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
void _PadUpdate(int pad);
|
void _PadUpdate(int pad);
|
||||||
s32 _PADOpen(void* pDsp);
|
s32 _PADOpen(void *pDsp);
|
||||||
void _PADClose();
|
void _PADClose();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -36,14 +36,14 @@ const u32 minor = 0; // increase that with each version
|
|||||||
#define RELEASE_MS 437L
|
#define RELEASE_MS 437L
|
||||||
|
|
||||||
#ifdef PCSX2_DEBUG
|
#ifdef PCSX2_DEBUG
|
||||||
char* libraryName = "SPU2null (Debug)";
|
char *libraryName = "SPU2null (Debug)";
|
||||||
#else
|
#else
|
||||||
char* libraryName = "SPU2null ";
|
char *libraryName = "SPU2null ";
|
||||||
#endif
|
#endif
|
||||||
string s_strIniPath = "inis/";
|
string s_strIniPath = "inis/";
|
||||||
string s_strLogPath = "logs/";
|
string s_strLogPath = "logs/";
|
||||||
|
|
||||||
FILE* spu2Log;
|
FILE *spu2Log;
|
||||||
Config conf;
|
Config conf;
|
||||||
|
|
||||||
ADMA Adma4;
|
ADMA Adma4;
|
||||||
@ -52,9 +52,9 @@ ADMA Adma7;
|
|||||||
u32 MemAddr[2];
|
u32 MemAddr[2];
|
||||||
u32 g_nSpuInit = 0;
|
u32 g_nSpuInit = 0;
|
||||||
u16 interrupt = 0;
|
u16 interrupt = 0;
|
||||||
s8* spu2regs = NULL;
|
s8 *spu2regs = NULL;
|
||||||
u16* spu2mem = NULL;
|
u16 *spu2mem = NULL;
|
||||||
u16* pSpuIrq[2] = {NULL};
|
u16 *pSpuIrq[2] = {NULL};
|
||||||
u32 dwEndChannel2[2] = {0}; // keeps track of what channels have ended
|
u32 dwEndChannel2[2] = {0}; // keeps track of what channels have ended
|
||||||
u32 dwNoiseVal = 1; // global noise generator
|
u32 dwNoiseVal = 1; // global noise generator
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ PS2EgetLibType()
|
|||||||
return PS2E_LT_SPU2;
|
return PS2E_LT_SPU2;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(char*)
|
EXPORT_C_(char *)
|
||||||
PS2EgetLibName()
|
PS2EgetLibName()
|
||||||
{
|
{
|
||||||
return libraryName;
|
return libraryName;
|
||||||
@ -101,7 +101,7 @@ PS2EgetLibVersion2(u32 type)
|
|||||||
return (version << 16) | (revision << 8) | build | (minor << 24);
|
return (version << 16) | (revision << 8) | build | (minor << 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
void __Log(char* fmt, ...)
|
void __Log(char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list list;
|
va_list list;
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ void __Log(char* fmt, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
SPU2setSettingsDir(const char* dir)
|
SPU2setSettingsDir(const char *dir)
|
||||||
{
|
{
|
||||||
s_strIniPath = (dir == NULL) ? "inis/" : dir;
|
s_strIniPath = (dir == NULL) ? "inis/" : dir;
|
||||||
}
|
}
|
||||||
@ -142,7 +142,7 @@ bool OpenLog()
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
SPU2setLogDir(const char* dir)
|
SPU2setLogDir(const char *dir)
|
||||||
{
|
{
|
||||||
// Get the path to the log directory.
|
// Get the path to the log directory.
|
||||||
s_strLogPath = (dir == NULL) ? "logs/" : dir;
|
s_strLogPath = (dir == NULL) ? "logs/" : dir;
|
||||||
@ -160,14 +160,14 @@ SPU2init()
|
|||||||
{
|
{
|
||||||
OpenLog();
|
OpenLog();
|
||||||
|
|
||||||
spu2regs = (s8*)malloc(0x10000);
|
spu2regs = (s8 *)malloc(0x10000);
|
||||||
if (spu2regs == NULL) {
|
if (spu2regs == NULL) {
|
||||||
SysMessage("Error allocating Memory\n");
|
SysMessage("Error allocating Memory\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
memset(spu2regs, 0, 0x10000);
|
memset(spu2regs, 0, 0x10000);
|
||||||
|
|
||||||
spu2mem = (u16*)malloc(0x200000); // 2Mb
|
spu2mem = (u16 *)malloc(0x200000); // 2Mb
|
||||||
if (spu2mem == NULL) {
|
if (spu2mem == NULL) {
|
||||||
SysMessage("Error allocating Memory\n");
|
SysMessage("Error allocating Memory\n");
|
||||||
return -1;
|
return -1;
|
||||||
@ -185,9 +185,9 @@ SPU2init()
|
|||||||
// init each channel
|
// init each channel
|
||||||
for (u32 i = 0; i < ArraySize(voices); ++i) {
|
for (u32 i = 0; i < ArraySize(voices); ++i) {
|
||||||
|
|
||||||
voices[i].pLoop = voices[i].pStart = voices[i].pCurr = (u8*)spu2mem;
|
voices[i].pLoop = voices[i].pStart = voices[i].pCurr = (u8 *)spu2mem;
|
||||||
|
|
||||||
voices[i].pvoice = (_SPU_VOICE*)((u8*)spu2regs + voices[i].memoffset) + (i % 24);
|
voices[i].pvoice = (_SPU_VOICE *)((u8 *)spu2regs + voices[i].memoffset) + (i % 24);
|
||||||
voices[i].ADSRX.SustainLevel = 1024; // -> init sustain
|
voices[i].ADSRX.SustainLevel = 1024; // -> init sustain
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ SPU2init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(s32)
|
EXPORT_C_(s32)
|
||||||
SPU2open(void* pDsp)
|
SPU2open(void *pDsp)
|
||||||
{
|
{
|
||||||
LoadConfig();
|
LoadConfig();
|
||||||
SPUCycles = SPUWorkerCycles = 0;
|
SPUCycles = SPUWorkerCycles = 0;
|
||||||
@ -286,16 +286,16 @@ void InitADSR() // INIT ADSR
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int MixADSR(VOICE_PROCESSED* pvoice) // MIX ADSR
|
int MixADSR(VOICE_PROCESSED *pvoice) // MIX ADSR
|
||||||
{
|
{
|
||||||
if (pvoice->bStop) // should be stopped:
|
if (pvoice->bStop) // should be stopped:
|
||||||
{
|
{
|
||||||
if (pvoice->bIgnoreLoop == 0) {
|
if (pvoice->bIgnoreLoop == 0) {
|
||||||
pvoice->ADSRX.EnvelopeVol = 0;
|
pvoice->ADSRX.EnvelopeVol = 0;
|
||||||
pvoice->bOn = false;
|
pvoice->bOn = false;
|
||||||
pvoice->pStart = (u8*)(spu2mem + pvoice->iStartAddr);
|
pvoice->pStart = (u8 *)(spu2mem + pvoice->iStartAddr);
|
||||||
pvoice->pLoop = (u8*)(spu2mem + pvoice->iStartAddr);
|
pvoice->pLoop = (u8 *)(spu2mem + pvoice->iStartAddr);
|
||||||
pvoice->pCurr = (u8*)(spu2mem + pvoice->iStartAddr);
|
pvoice->pCurr = (u8 *)(spu2mem + pvoice->iStartAddr);
|
||||||
pvoice->bStop = true;
|
pvoice->bStop = true;
|
||||||
pvoice->bIgnoreLoop = false;
|
pvoice->bIgnoreLoop = false;
|
||||||
return 0;
|
return 0;
|
||||||
@ -335,9 +335,9 @@ int MixADSR(VOICE_PROCESSED* pvoice) // MIX ADSR
|
|||||||
if (pvoice->ADSRX.EnvelopeVol < 0) {
|
if (pvoice->ADSRX.EnvelopeVol < 0) {
|
||||||
pvoice->ADSRX.EnvelopeVol = 0;
|
pvoice->ADSRX.EnvelopeVol = 0;
|
||||||
pvoice->bOn = false;
|
pvoice->bOn = false;
|
||||||
pvoice->pStart = (u8*)(spu2mem + pvoice->iStartAddr);
|
pvoice->pStart = (u8 *)(spu2mem + pvoice->iStartAddr);
|
||||||
pvoice->pLoop = (u8*)(spu2mem + pvoice->iStartAddr);
|
pvoice->pLoop = (u8 *)(spu2mem + pvoice->iStartAddr);
|
||||||
pvoice->pCurr = (u8*)(spu2mem + pvoice->iStartAddr);
|
pvoice->pCurr = (u8 *)(spu2mem + pvoice->iStartAddr);
|
||||||
pvoice->bStop = true;
|
pvoice->bStop = true;
|
||||||
pvoice->bIgnoreLoop = false;
|
pvoice->bIgnoreLoop = false;
|
||||||
//pvoice->bReverb=0;
|
//pvoice->bReverb=0;
|
||||||
@ -469,10 +469,10 @@ int MixADSR(VOICE_PROCESSED* pvoice) // MIX ADSR
|
|||||||
// simulate SPU2 for 1ms
|
// simulate SPU2 for 1ms
|
||||||
void SPU2Worker()
|
void SPU2Worker()
|
||||||
{
|
{
|
||||||
u8* start;
|
u8 *start;
|
||||||
int ch, flags;
|
int ch, flags;
|
||||||
|
|
||||||
VOICE_PROCESSED* pChannel = voices;
|
VOICE_PROCESSED *pChannel = voices;
|
||||||
for (ch = 0; ch < SPU_NUMBER_VOICES; ch++, pChannel++) // loop em all... we will collect 1 ms of sound of each playing channel
|
for (ch = 0; ch < SPU_NUMBER_VOICES; ch++, pChannel++) // loop em all... we will collect 1 ms of sound of each playing channel
|
||||||
{
|
{
|
||||||
if (pChannel->bNew) {
|
if (pChannel->bNew) {
|
||||||
@ -497,7 +497,7 @@ void SPU2Worker()
|
|||||||
start = pChannel->pCurr; // set up the current pos
|
start = pChannel->pCurr; // set up the current pos
|
||||||
|
|
||||||
// special "stop" sign
|
// special "stop" sign
|
||||||
if (start == (u8*)-1) //!pChannel->bOn
|
if (start == (u8 *)-1) //!pChannel->bOn
|
||||||
{
|
{
|
||||||
pChannel->bOn = false; // -> turn everything off
|
pChannel->bOn = false; // -> turn everything off
|
||||||
pChannel->ADSRX.lVolume = 0;
|
pChannel->ADSRX.lVolume = 0;
|
||||||
@ -515,7 +515,7 @@ void SPU2Worker()
|
|||||||
// some callback and irq active?
|
// some callback and irq active?
|
||||||
if (pChannel->GetCtrl()->irq) {
|
if (pChannel->GetCtrl()->irq) {
|
||||||
// if irq address reached or irq on looping addr, when stop/loop flag is set
|
// if irq address reached or irq on looping addr, when stop/loop flag is set
|
||||||
u8* pirq = (u8*)pSpuIrq[ch >= 24];
|
u8 *pirq = (u8 *)pSpuIrq[ch >= 24];
|
||||||
if ((pirq > start - 16 && pirq <= start) || ((flags & 1) && (pirq > pChannel->pLoop - 16 && pirq <= pChannel->pLoop))) {
|
if ((pirq > start - 16 && pirq <= start) || ((flags & 1) && (pirq > pChannel->pLoop - 16 && pirq <= pChannel->pLoop))) {
|
||||||
IRQINFO |= 4 << (int)(ch >= 24);
|
IRQINFO |= 4 << (int)(ch >= 24);
|
||||||
irqCallbackSPU2();
|
irqCallbackSPU2();
|
||||||
@ -533,7 +533,7 @@ void SPU2Worker()
|
|||||||
//if(!(flags&2)) // 1+2: do loop... otherwise: stop
|
//if(!(flags&2)) // 1+2: do loop... otherwise: stop
|
||||||
if (flags != 3 || pChannel->pLoop == NULL) // PETE: if we don't check exactly for 3, loop hang ups will happen (DQ4, for example)
|
if (flags != 3 || pChannel->pLoop == NULL) // PETE: if we don't check exactly for 3, loop hang ups will happen (DQ4, for example)
|
||||||
{ // and checking if pLoop is set avoids crashes, yeah
|
{ // and checking if pLoop is set avoids crashes, yeah
|
||||||
start = (u8*)-1;
|
start = (u8 *)-1;
|
||||||
pChannel->bStop = true;
|
pChannel->bStop = true;
|
||||||
pChannel->bIgnoreLoop = false;
|
pChannel->bIgnoreLoop = false;
|
||||||
} else {
|
} else {
|
||||||
@ -596,7 +596,7 @@ void SPU2Worker()
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
SPU2readDMA4Mem(u16* pMem, int size)
|
SPU2readDMA4Mem(u16 *pMem, int size)
|
||||||
{
|
{
|
||||||
u32 spuaddr = C0_SPUADDR;
|
u32 spuaddr = C0_SPUADDR;
|
||||||
int i;
|
int i;
|
||||||
@ -604,7 +604,7 @@ SPU2readDMA4Mem(u16* pMem, int size)
|
|||||||
SPU2_LOG("SPU2 readDMA4Mem size %x, addr: %x\n", size, pMem);
|
SPU2_LOG("SPU2 readDMA4Mem size %x, addr: %x\n", size, pMem);
|
||||||
|
|
||||||
for (i = 0; i < size; i++) {
|
for (i = 0; i < size; i++) {
|
||||||
*pMem++ = *(u16*)(spu2mem + spuaddr);
|
*pMem++ = *(u16 *)(spu2mem + spuaddr);
|
||||||
if ((spu2Rs16(REG_C0_CTRL) & 0x40) && C0_IRQA == spuaddr) {
|
if ((spu2Rs16(REG_C0_CTRL) & 0x40) && C0_IRQA == spuaddr) {
|
||||||
spu2Ru16(SPDIF_OUT) |= 0x4;
|
spu2Ru16(SPDIF_OUT) |= 0x4;
|
||||||
C0_SPUADDR_SET(spuaddr);
|
C0_SPUADDR_SET(spuaddr);
|
||||||
@ -628,7 +628,7 @@ SPU2readDMA4Mem(u16* pMem, int size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
SPU2readDMA7Mem(u16* pMem, int size)
|
SPU2readDMA7Mem(u16 *pMem, int size)
|
||||||
{
|
{
|
||||||
u32 spuaddr = C1_SPUADDR;
|
u32 spuaddr = C1_SPUADDR;
|
||||||
int i;
|
int i;
|
||||||
@ -636,7 +636,7 @@ SPU2readDMA7Mem(u16* pMem, int size)
|
|||||||
SPU2_LOG("SPU2 readDMA7Mem size %x, addr: %x\n", size, pMem);
|
SPU2_LOG("SPU2 readDMA7Mem size %x, addr: %x\n", size, pMem);
|
||||||
|
|
||||||
for (i = 0; i < size; i++) {
|
for (i = 0; i < size; i++) {
|
||||||
*pMem++ = *(u16*)(spu2mem + spuaddr);
|
*pMem++ = *(u16 *)(spu2mem + spuaddr);
|
||||||
if ((spu2Rs16(REG_C1_CTRL) & 0x40) && C1_IRQA == spuaddr) {
|
if ((spu2Rs16(REG_C1_CTRL) & 0x40) && C1_IRQA == spuaddr) {
|
||||||
spu2Ru16(SPDIF_OUT) |= 0x8;
|
spu2Ru16(SPDIF_OUT) |= 0x8;
|
||||||
C1_SPUADDR_SET(spuaddr);
|
C1_SPUADDR_SET(spuaddr);
|
||||||
@ -676,9 +676,9 @@ int ADMAS4Write()
|
|||||||
|
|
||||||
spuaddr = C0_SPUADDR;
|
spuaddr = C0_SPUADDR;
|
||||||
// SPU2 Deinterleaves the Left and Right Channels
|
// SPU2 Deinterleaves the Left and Right Channels
|
||||||
memcpy((s16*)(spu2mem + spuaddr + 0x2000), (s16*)Adma4.MemAddr, 512);
|
memcpy((s16 *)(spu2mem + spuaddr + 0x2000), (s16 *)Adma4.MemAddr, 512);
|
||||||
Adma4.MemAddr += 256;
|
Adma4.MemAddr += 256;
|
||||||
memcpy((s16*)(spu2mem + spuaddr + 0x2200), (s16*)Adma4.MemAddr, 512);
|
memcpy((s16 *)(spu2mem + spuaddr + 0x2200), (s16 *)Adma4.MemAddr, 512);
|
||||||
Adma4.MemAddr += 256;
|
Adma4.MemAddr += 256;
|
||||||
spuaddr = (spuaddr + 256) & 511;
|
spuaddr = (spuaddr + 256) & 511;
|
||||||
C0_SPUADDR_SET(spuaddr);
|
C0_SPUADDR_SET(spuaddr);
|
||||||
@ -703,9 +703,9 @@ int ADMAS7Write()
|
|||||||
|
|
||||||
spuaddr = C1_SPUADDR;
|
spuaddr = C1_SPUADDR;
|
||||||
// SPU2 Deinterleaves the Left and Right Channels
|
// SPU2 Deinterleaves the Left and Right Channels
|
||||||
memcpy((s16*)(spu2mem + spuaddr + 0x2400), (s16*)Adma7.MemAddr, 512);
|
memcpy((s16 *)(spu2mem + spuaddr + 0x2400), (s16 *)Adma7.MemAddr, 512);
|
||||||
Adma7.MemAddr += 256;
|
Adma7.MemAddr += 256;
|
||||||
memcpy((s16*)(spu2mem + spuaddr + 0x2600), (s16*)Adma7.MemAddr, 512);
|
memcpy((s16 *)(spu2mem + spuaddr + 0x2600), (s16 *)Adma7.MemAddr, 512);
|
||||||
Adma7.MemAddr += 256;
|
Adma7.MemAddr += 256;
|
||||||
spuaddr = (spuaddr + 256) & 511;
|
spuaddr = (spuaddr + 256) & 511;
|
||||||
C1_SPUADDR_SET(spuaddr);
|
C1_SPUADDR_SET(spuaddr);
|
||||||
@ -721,7 +721,7 @@ int ADMAS7Write()
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
SPU2writeDMA4Mem(u16* pMem, int size)
|
SPU2writeDMA4Mem(u16 *pMem, int size)
|
||||||
{
|
{
|
||||||
u32 spuaddr;
|
u32 spuaddr;
|
||||||
|
|
||||||
@ -738,7 +738,7 @@ SPU2writeDMA4Mem(u16* pMem, int size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
spuaddr = C0_SPUADDR;
|
spuaddr = C0_SPUADDR;
|
||||||
memcpy((u8*)(spu2mem + spuaddr), (u8*)pMem, size << 1);
|
memcpy((u8 *)(spu2mem + spuaddr), (u8 *)pMem, size << 1);
|
||||||
spuaddr += size;
|
spuaddr += size;
|
||||||
C0_SPUADDR_SET(spuaddr);
|
C0_SPUADDR_SET(spuaddr);
|
||||||
|
|
||||||
@ -759,7 +759,7 @@ SPU2writeDMA4Mem(u16* pMem, int size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
SPU2writeDMA7Mem(u16* pMem, int size)
|
SPU2writeDMA7Mem(u16 *pMem, int size)
|
||||||
{
|
{
|
||||||
u32 spuaddr;
|
u32 spuaddr;
|
||||||
|
|
||||||
@ -776,7 +776,7 @@ SPU2writeDMA7Mem(u16* pMem, int size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
spuaddr = C1_SPUADDR;
|
spuaddr = C1_SPUADDR;
|
||||||
memcpy((u8*)(spu2mem + spuaddr), (u8*)pMem, size << 1);
|
memcpy((u8 *)(spu2mem + spuaddr), (u8 *)pMem, size << 1);
|
||||||
spuaddr += size;
|
spuaddr += size;
|
||||||
C1_SPUADDR_SET(spuaddr);
|
C1_SPUADDR_SET(spuaddr);
|
||||||
|
|
||||||
@ -878,7 +878,7 @@ SPU2write(u32 mem, u16 value)
|
|||||||
else
|
else
|
||||||
ch = (r >> 4);
|
ch = (r >> 4);
|
||||||
|
|
||||||
VOICE_PROCESSED* pvoice = &voices[ch];
|
VOICE_PROCESSED *pvoice = &voices[ch];
|
||||||
|
|
||||||
switch (r & 0x0f) {
|
switch (r & 0x0f) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -930,25 +930,25 @@ SPU2write(u32 mem, u16 value)
|
|||||||
|
|
||||||
ch += ((rx - 0x1c0) / 12);
|
ch += ((rx - 0x1c0) / 12);
|
||||||
rx -= (ch % 24) * 12;
|
rx -= (ch % 24) * 12;
|
||||||
VOICE_PROCESSED* pvoice = &voices[ch];
|
VOICE_PROCESSED *pvoice = &voices[ch];
|
||||||
|
|
||||||
switch (rx) {
|
switch (rx) {
|
||||||
case 0x1C0:
|
case 0x1C0:
|
||||||
pvoice->iStartAddr = (((u32)value & 0x3f) << 16) | (pvoice->iStartAddr & 0xFFFF);
|
pvoice->iStartAddr = (((u32)value & 0x3f) << 16) | (pvoice->iStartAddr & 0xFFFF);
|
||||||
pvoice->pStart = (u8*)(spu2mem + pvoice->iStartAddr);
|
pvoice->pStart = (u8 *)(spu2mem + pvoice->iStartAddr);
|
||||||
break;
|
break;
|
||||||
case 0x1C2:
|
case 0x1C2:
|
||||||
pvoice->iStartAddr = (pvoice->iStartAddr & 0x3f0000) | (value & 0xFFFF);
|
pvoice->iStartAddr = (pvoice->iStartAddr & 0x3f0000) | (value & 0xFFFF);
|
||||||
pvoice->pStart = (u8*)(spu2mem + pvoice->iStartAddr);
|
pvoice->pStart = (u8 *)(spu2mem + pvoice->iStartAddr);
|
||||||
break;
|
break;
|
||||||
case 0x1C4:
|
case 0x1C4:
|
||||||
pvoice->iLoopAddr = (((u32)value & 0x3f) << 16) | (pvoice->iLoopAddr & 0xFFFF);
|
pvoice->iLoopAddr = (((u32)value & 0x3f) << 16) | (pvoice->iLoopAddr & 0xFFFF);
|
||||||
pvoice->pLoop = (u8*)(spu2mem + pvoice->iLoopAddr);
|
pvoice->pLoop = (u8 *)(spu2mem + pvoice->iLoopAddr);
|
||||||
pvoice->bIgnoreLoop = pvoice->iLoopAddr > 0;
|
pvoice->bIgnoreLoop = pvoice->iLoopAddr > 0;
|
||||||
break;
|
break;
|
||||||
case 0x1C6:
|
case 0x1C6:
|
||||||
pvoice->iLoopAddr = (pvoice->iLoopAddr & 0x3f0000) | (value & 0xFFFF);
|
pvoice->iLoopAddr = (pvoice->iLoopAddr & 0x3f0000) | (value & 0xFFFF);
|
||||||
pvoice->pLoop = (u8*)(spu2mem + pvoice->iLoopAddr);
|
pvoice->pLoop = (u8 *)(spu2mem + pvoice->iLoopAddr);
|
||||||
pvoice->bIgnoreLoop = pvoice->iLoopAddr > 0;
|
pvoice->bIgnoreLoop = pvoice->iLoopAddr > 0;
|
||||||
break;
|
break;
|
||||||
case 0x1C8:
|
case 0x1C8:
|
||||||
@ -1084,7 +1084,7 @@ SPU2read(u32 mem)
|
|||||||
else
|
else
|
||||||
ch = (r >> 4);
|
ch = (r >> 4);
|
||||||
|
|
||||||
VOICE_PROCESSED* pvoice = &voices[ch];
|
VOICE_PROCESSED *pvoice = &voices[ch];
|
||||||
|
|
||||||
switch (r & 0x0f) {
|
switch (r & 0x0f) {
|
||||||
case 10:
|
case 10:
|
||||||
@ -1104,21 +1104,21 @@ SPU2read(u32 mem)
|
|||||||
|
|
||||||
ch += ((rx - 0x1c0) / 12);
|
ch += ((rx - 0x1c0) / 12);
|
||||||
rx -= (ch % 24) * 12;
|
rx -= (ch % 24) * 12;
|
||||||
VOICE_PROCESSED* pvoice = &voices[ch];
|
VOICE_PROCESSED *pvoice = &voices[ch];
|
||||||
|
|
||||||
switch (rx) {
|
switch (rx) {
|
||||||
case 0x1C0:
|
case 0x1C0:
|
||||||
return (u16)(((pvoice->pStart - (u8*)spu2mem) >> 17) & 0x3F);
|
return (u16)(((pvoice->pStart - (u8 *)spu2mem) >> 17) & 0x3F);
|
||||||
case 0x1C2:
|
case 0x1C2:
|
||||||
return (u16)(((pvoice->pStart - (u8*)spu2mem) >> 1) & 0xFFFF);
|
return (u16)(((pvoice->pStart - (u8 *)spu2mem) >> 1) & 0xFFFF);
|
||||||
case 0x1C4:
|
case 0x1C4:
|
||||||
return (u16)(((pvoice->pLoop - (u8*)spu2mem) >> 17) & 0x3F);
|
return (u16)(((pvoice->pLoop - (u8 *)spu2mem) >> 17) & 0x3F);
|
||||||
case 0x1C6:
|
case 0x1C6:
|
||||||
return (u16)(((pvoice->pLoop - (u8*)spu2mem) >> 1) & 0xFFFF);
|
return (u16)(((pvoice->pLoop - (u8 *)spu2mem) >> 1) & 0xFFFF);
|
||||||
case 0x1C8:
|
case 0x1C8:
|
||||||
return (u16)(((pvoice->pCurr - (u8*)spu2mem) >> 17) & 0x3F);
|
return (u16)(((pvoice->pCurr - (u8 *)spu2mem) >> 17) & 0x3F);
|
||||||
case 0x1CA:
|
case 0x1CA:
|
||||||
return (u16)(((pvoice->pCurr - (u8*)spu2mem) >> 1) & 0xFFFF);
|
return (u16)(((pvoice->pCurr - (u8 *)spu2mem) >> 1) & 0xFFFF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1184,9 +1184,9 @@ SPU2irqCallback(void (*SPU2callback)(), void (*DMA4callback)(), void (*DMA7callb
|
|||||||
}
|
}
|
||||||
|
|
||||||
// VOICE_PROCESSED definitions
|
// VOICE_PROCESSED definitions
|
||||||
SPU_CONTROL_* VOICE_PROCESSED::GetCtrl()
|
SPU_CONTROL_ *VOICE_PROCESSED::GetCtrl()
|
||||||
{
|
{
|
||||||
return ((SPU_CONTROL_*)(spu2regs + memoffset + REG_C0_CTRL));
|
return ((SPU_CONTROL_ *)(spu2regs + memoffset + REG_C0_CTRL));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VOICE_PROCESSED::SetVolume(int iProcessRight)
|
void VOICE_PROCESSED::SetVolume(int iProcessRight)
|
||||||
@ -1260,19 +1260,19 @@ typedef struct
|
|||||||
} SPU2freezeData;
|
} SPU2freezeData;
|
||||||
|
|
||||||
EXPORT_C_(s32)
|
EXPORT_C_(s32)
|
||||||
SPU2freeze(int mode, freezeData* data)
|
SPU2freeze(int mode, freezeData *data)
|
||||||
{
|
{
|
||||||
SPU2freezeData* spud;
|
SPU2freezeData *spud;
|
||||||
|
|
||||||
if (mode == FREEZE_LOAD) {
|
if (mode == FREEZE_LOAD) {
|
||||||
spud = (SPU2freezeData*)data->data;
|
spud = (SPU2freezeData *)data->data;
|
||||||
if (spud->version == 0x11223344) {
|
if (spud->version == 0x11223344) {
|
||||||
memcpy(spu2regs, spud->spu2regs, 0x10000);
|
memcpy(spu2regs, spud->spu2regs, 0x10000);
|
||||||
} else {
|
} else {
|
||||||
printf("SPU2null wrong format\n");
|
printf("SPU2null wrong format\n");
|
||||||
}
|
}
|
||||||
} else if (mode == FREEZE_SAVE) {
|
} else if (mode == FREEZE_SAVE) {
|
||||||
spud = (SPU2freezeData*)data->data;
|
spud = (SPU2freezeData *)data->data;
|
||||||
spud->version = 0x11223344;
|
spud->version = 0x11223344;
|
||||||
memcpy(spud->spu2regs, spu2regs, 0x10000);
|
memcpy(spud->spu2regs, spu2regs, 0x10000);
|
||||||
} else if (mode == FREEZE_SIZE) {
|
} else if (mode == FREEZE_SIZE) {
|
||||||
|
@ -41,14 +41,14 @@ extern "C" {
|
|||||||
#define EXPORT_C_(type) extern "C" __attribute__((stdcall, externally_visible, visibility("default"))) type
|
#define EXPORT_C_(type) extern "C" __attribute__((stdcall, externally_visible, visibility("default"))) type
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern FILE* spu2Log;
|
extern FILE *spu2Log;
|
||||||
#define SPU2_LOG __Log //debug mode
|
#define SPU2_LOG __Log //debug mode
|
||||||
|
|
||||||
extern const u8 version;
|
extern const u8 version;
|
||||||
extern const u8 revision;
|
extern const u8 revision;
|
||||||
extern const u8 build;
|
extern const u8 build;
|
||||||
extern const u32 minor;
|
extern const u32 minor;
|
||||||
extern char* libraryName;
|
extern char *libraryName;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@ -57,10 +57,10 @@ typedef struct
|
|||||||
|
|
||||||
extern Config conf;
|
extern Config conf;
|
||||||
|
|
||||||
void __Log(char* fmt, ...);
|
void __Log(char *fmt, ...);
|
||||||
void SaveConfig();
|
void SaveConfig();
|
||||||
void LoadConfig();
|
void LoadConfig();
|
||||||
void SysMessage(char* fmt, ...);
|
void SysMessage(char *fmt, ...);
|
||||||
|
|
||||||
////////////////////
|
////////////////////
|
||||||
// SPU2 Registers //
|
// SPU2 Registers //
|
||||||
@ -134,8 +134,8 @@ void SysMessage(char* fmt, ...);
|
|||||||
#define SPDIF_MODE 0x07C6
|
#define SPDIF_MODE 0x07C6
|
||||||
#define SPDIF_MEDIA 0x07C8
|
#define SPDIF_MEDIA 0x07C8
|
||||||
|
|
||||||
#define spu2Rs16(mem) (*(s16*)&spu2regs[(mem)&0xffff])
|
#define spu2Rs16(mem) (*(s16 *)&spu2regs[(mem)&0xffff])
|
||||||
#define spu2Ru16(mem) (*(u16*)&spu2regs[(mem)&0xffff])
|
#define spu2Ru16(mem) (*(u16 *)&spu2regs[(mem)&0xffff])
|
||||||
//#define spu2Rs32(mem) (*(s32*)&spu2regs[(mem) & 0xffff])
|
//#define spu2Rs32(mem) (*(s32*)&spu2regs[(mem) & 0xffff])
|
||||||
//#define spu2Ru32(mem) (*(u32*)&spu2regs[(mem) & 0xffff])
|
//#define spu2Ru32(mem) (*(u32*)&spu2regs[(mem) & 0xffff])
|
||||||
|
|
||||||
@ -236,7 +236,7 @@ struct ADSRInfoEx
|
|||||||
#define NSSIZE 48 // ~ 1 ms of data
|
#define NSSIZE 48 // ~ 1 ms of data
|
||||||
#define NSFRAMES 16 // gather at least NSFRAMES of NSSIZE before submitting
|
#define NSFRAMES 16 // gather at least NSFRAMES of NSSIZE before submitting
|
||||||
#define NSPACKETS 4
|
#define NSPACKETS 4
|
||||||
#define SPU_VOICE_STATE_SIZE (sizeof(VOICE_PROCESSED) - 4 * sizeof(void*))
|
#define SPU_VOICE_STATE_SIZE (sizeof(VOICE_PROCESSED) - 4 * sizeof(void *))
|
||||||
|
|
||||||
struct VOICE_PROCESSED
|
struct VOICE_PROCESSED
|
||||||
{
|
{
|
||||||
@ -254,7 +254,7 @@ struct VOICE_PROCESSED
|
|||||||
void FModChangeFrequency(int ns);
|
void FModChangeFrequency(int ns);
|
||||||
void Stop();
|
void Stop();
|
||||||
|
|
||||||
SPU_CONTROL_* GetCtrl();
|
SPU_CONTROL_ *GetCtrl();
|
||||||
|
|
||||||
// start save state
|
// start save state
|
||||||
|
|
||||||
@ -276,15 +276,15 @@ struct VOICE_PROCESSED
|
|||||||
///////////////////
|
///////////////////
|
||||||
// Sound Buffers //
|
// Sound Buffers //
|
||||||
///////////////////
|
///////////////////
|
||||||
u8* pStart; // start and end addresses
|
u8 *pStart; // start and end addresses
|
||||||
u8 *pLoop, *pCurr;
|
u8 *pLoop, *pCurr;
|
||||||
|
|
||||||
_SPU_VOICE* pvoice;
|
_SPU_VOICE *pvoice;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ADMA
|
struct ADMA
|
||||||
{
|
{
|
||||||
u16* MemAddr;
|
u16 *MemAddr;
|
||||||
s32 IntPointer;
|
s32 IntPointer;
|
||||||
s32 Index;
|
s32 Index;
|
||||||
s32 AmountLeft;
|
s32 AmountLeft;
|
||||||
|
@ -21,8 +21,8 @@ extern HINSTANCE hInst;
|
|||||||
void SaveConfig()
|
void SaveConfig()
|
||||||
{
|
{
|
||||||
|
|
||||||
Config* Conf1 = &conf;
|
Config *Conf1 = &conf;
|
||||||
char* szTemp;
|
char *szTemp;
|
||||||
char szIniFile[256], szValue[256];
|
char szIniFile[256], szValue[256];
|
||||||
|
|
||||||
GetModuleFileName(GetModuleHandle((LPCSTR)hInst), szIniFile, 256);
|
GetModuleFileName(GetModuleHandle((LPCSTR)hInst), szIniFile, 256);
|
||||||
@ -37,11 +37,11 @@ void SaveConfig()
|
|||||||
|
|
||||||
void LoadConfig()
|
void LoadConfig()
|
||||||
{
|
{
|
||||||
FILE* fp;
|
FILE *fp;
|
||||||
|
|
||||||
|
|
||||||
Config* Conf1 = &conf;
|
Config *Conf1 = &conf;
|
||||||
char* szTemp;
|
char *szTemp;
|
||||||
char szIniFile[256], szValue[256];
|
char szIniFile[256], szValue[256];
|
||||||
|
|
||||||
GetModuleFileName(GetModuleHandle((LPCSTR)hInst), szIniFile, 256);
|
GetModuleFileName(GetModuleHandle((LPCSTR)hInst), szIniFile, 256);
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
HINSTANCE hInst;
|
HINSTANCE hInst;
|
||||||
|
|
||||||
void SysMessage(char* fmt, ...)
|
void SysMessage(char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list list;
|
va_list list;
|
||||||
char tmp[512];
|
char tmp[512];
|
||||||
|
@ -44,7 +44,7 @@ void LogInit()
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
USBsetLogDir(const char* dir)
|
USBsetLogDir(const char *dir)
|
||||||
{
|
{
|
||||||
// Get the path to the log directory.
|
// Get the path to the log directory.
|
||||||
s_strLogPath = (dir == NULL) ? "logs" : dir;
|
s_strLogPath = (dir == NULL) ? "logs" : dir;
|
||||||
@ -60,7 +60,7 @@ PS2EgetLibType()
|
|||||||
return PS2E_LT_USB;
|
return PS2E_LT_USB;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(char*)
|
EXPORT_C_(char *)
|
||||||
PS2EgetLibName()
|
PS2EgetLibName()
|
||||||
{
|
{
|
||||||
snprintf(libraryName, 255, "USBnull Driver %lld%s", SVN_REV, SVN_MODS ? "m" : "");
|
snprintf(libraryName, 255, "USBnull Driver %lld%s", SVN_REV, SVN_MODS ? "m" : "");
|
||||||
@ -82,7 +82,7 @@ USBinit()
|
|||||||
USBLog.WriteLn("Initializing USBnull");
|
USBLog.WriteLn("Initializing USBnull");
|
||||||
|
|
||||||
// Initialize memory structures here.
|
// Initialize memory structures here.
|
||||||
usbregs = (s8*)calloc(0x10000, 1);
|
usbregs = (s8 *)calloc(0x10000, 1);
|
||||||
|
|
||||||
if (usbregs == NULL) {
|
if (usbregs == NULL) {
|
||||||
USBLog.Message("Error allocating memory");
|
USBLog.Message("Error allocating memory");
|
||||||
@ -104,7 +104,7 @@ USBshutdown()
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(s32)
|
EXPORT_C_(s32)
|
||||||
USBopen(void* pDsp)
|
USBopen(void *pDsp)
|
||||||
{
|
{
|
||||||
USBLog.WriteLn("Opening USBnull.");
|
USBLog.WriteLn("Opening USBnull.");
|
||||||
|
|
||||||
@ -245,14 +245,14 @@ USBirqHandler(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
USBsetRAM(void* mem)
|
USBsetRAM(void *mem)
|
||||||
{
|
{
|
||||||
ram = (s8*)mem;
|
ram = (s8 *)mem;
|
||||||
USBLog.WriteLn("*Setting ram.");
|
USBLog.WriteLn("*Setting ram.");
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
USBsetSettingsDir(const char* dir)
|
USBsetSettingsDir(const char *dir)
|
||||||
{
|
{
|
||||||
// Get the path to the ini directory.
|
// Get the path to the ini directory.
|
||||||
s_strIniPath = (dir == NULL) ? "inis" : dir;
|
s_strIniPath = (dir == NULL) ? "inis" : dir;
|
||||||
@ -261,7 +261,7 @@ USBsetSettingsDir(const char* dir)
|
|||||||
// extended funcs
|
// extended funcs
|
||||||
|
|
||||||
EXPORT_C_(s32)
|
EXPORT_C_(s32)
|
||||||
USBfreeze(int mode, freezeData* data)
|
USBfreeze(int mode, freezeData *data)
|
||||||
{
|
{
|
||||||
// This should store or retrieve any information, for if emulation
|
// This should store or retrieve any information, for if emulation
|
||||||
// gets suspended, or for savestates.
|
// gets suspended, or for savestates.
|
||||||
|
@ -36,11 +36,11 @@ static const s64 PSXCLK = 36864000; /* 36.864 Mhz */
|
|||||||
extern s8 *usbregs, *ram;
|
extern s8 *usbregs, *ram;
|
||||||
|
|
||||||
#define usbRs8(mem) usbregs[(mem)&0xffff]
|
#define usbRs8(mem) usbregs[(mem)&0xffff]
|
||||||
#define usbRs16(mem) (*(s16*)&usbregs[(mem)&0xffff])
|
#define usbRs16(mem) (*(s16 *)&usbregs[(mem)&0xffff])
|
||||||
#define usbRs32(mem) (*(s32*)&usbregs[(mem)&0xffff])
|
#define usbRs32(mem) (*(s32 *)&usbregs[(mem)&0xffff])
|
||||||
#define usbRu8(mem) (*(u8*)&usbregs[(mem)&0xffff])
|
#define usbRu8(mem) (*(u8 *)&usbregs[(mem)&0xffff])
|
||||||
#define usbRu16(mem) (*(u16*)&usbregs[(mem)&0xffff])
|
#define usbRu16(mem) (*(u16 *)&usbregs[(mem)&0xffff])
|
||||||
#define usbRu32(mem) (*(u32*)&usbregs[(mem)&0xffff])
|
#define usbRu32(mem) (*(u32 *)&usbregs[(mem)&0xffff])
|
||||||
|
|
||||||
extern void SaveConfig();
|
extern void SaveConfig();
|
||||||
extern void LoadConfig();
|
extern void LoadConfig();
|
||||||
|
@ -21,8 +21,8 @@ extern HINSTANCE hInst;
|
|||||||
void SaveConfig()
|
void SaveConfig()
|
||||||
{
|
{
|
||||||
|
|
||||||
Config* Conf1 = &conf;
|
Config *Conf1 = &conf;
|
||||||
char* szTemp;
|
char *szTemp;
|
||||||
char szIniFile[256], szValue[256];
|
char szIniFile[256], szValue[256];
|
||||||
|
|
||||||
GetModuleFileName(GetModuleHandle((LPCSTR)hInst), szIniFile, 256);
|
GetModuleFileName(GetModuleHandle((LPCSTR)hInst), szIniFile, 256);
|
||||||
@ -37,11 +37,11 @@ void SaveConfig()
|
|||||||
|
|
||||||
void LoadConfig()
|
void LoadConfig()
|
||||||
{
|
{
|
||||||
FILE* fp;
|
FILE *fp;
|
||||||
|
|
||||||
|
|
||||||
Config* Conf1 = &conf;
|
Config *Conf1 = &conf;
|
||||||
char* szTemp;
|
char *szTemp;
|
||||||
char szIniFile[256], szValue[256];
|
char szIniFile[256], szValue[256];
|
||||||
|
|
||||||
GetModuleFileName(GetModuleHandle((LPCSTR)hInst), szIniFile, 256);
|
GetModuleFileName(GetModuleHandle((LPCSTR)hInst), szIniFile, 256);
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
HINSTANCE hInst;
|
HINSTANCE hInst;
|
||||||
|
|
||||||
void SysMessage(char* fmt, ...)
|
void SysMessage(char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list list;
|
va_list list;
|
||||||
char tmp[512];
|
char tmp[512];
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
void SaveConfig();
|
void SaveConfig();
|
||||||
void LoadConfig();
|
void LoadConfig();
|
||||||
void SysMessage(char* fmt, ...);
|
void SysMessage(char *fmt, ...);
|
||||||
|
|
||||||
//#define is_checked(main_widget, widget_name) (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name))))
|
//#define is_checked(main_widget, widget_name) (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name))))
|
||||||
//#define set_checked(main_widget,widget_name, state) gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name)), state)
|
//#define set_checked(main_widget,widget_name, state) gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name)), state)
|
||||||
|
@ -61,7 +61,7 @@ void LogInit()
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
DEV9setLogDir(const char* dir)
|
DEV9setLogDir(const char *dir)
|
||||||
{
|
{
|
||||||
// Get the path to the log directory.
|
// Get the path to the log directory.
|
||||||
s_strLogPath = (dir == NULL) ? "logs" : dir;
|
s_strLogPath = (dir == NULL) ? "logs" : dir;
|
||||||
@ -77,7 +77,7 @@ PS2EgetLibType()
|
|||||||
return PS2E_LT_DEV9;
|
return PS2E_LT_DEV9;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(char*)
|
EXPORT_C_(char *)
|
||||||
PS2EgetLibName()
|
PS2EgetLibName()
|
||||||
{
|
{
|
||||||
snprintf(libraryName, 255, "DEV9null Driver %lld%s", SVN_REV, SVN_MODS ? "m" : "");
|
snprintf(libraryName, 255, "DEV9null Driver %lld%s", SVN_REV, SVN_MODS ? "m" : "");
|
||||||
@ -111,7 +111,7 @@ DEV9shutdown()
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(s32)
|
EXPORT_C_(s32)
|
||||||
DEV9open(void* pDsp)
|
DEV9open(void *pDsp)
|
||||||
{
|
{
|
||||||
Dev9Log.WriteLn("Opening Dev9null.");
|
Dev9Log.WriteLn("Opening Dev9null.");
|
||||||
// Get anything ready we need to. Opening and creating hard
|
// Get anything ready we need to. Opening and creating hard
|
||||||
@ -237,7 +237,7 @@ DEV9write32(u32 addr, u32 value)
|
|||||||
|
|
||||||
//#ifdef ENABLE_NEW_IOPDMA_DEV9
|
//#ifdef ENABLE_NEW_IOPDMA_DEV9
|
||||||
EXPORT_C_(s32)
|
EXPORT_C_(s32)
|
||||||
DEV9dmaRead(s32 channel, u32* data, u32 bytesLeft, u32* bytesProcessed)
|
DEV9dmaRead(s32 channel, u32 *data, u32 bytesLeft, u32 *bytesProcessed)
|
||||||
{
|
{
|
||||||
// You'll want to put your own DMA8 reading code here.
|
// You'll want to put your own DMA8 reading code here.
|
||||||
// Time to interact with your fake (or real) hardware.
|
// Time to interact with your fake (or real) hardware.
|
||||||
@ -247,7 +247,7 @@ DEV9dmaRead(s32 channel, u32* data, u32 bytesLeft, u32* bytesProcessed)
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(s32)
|
EXPORT_C_(s32)
|
||||||
DEV9dmaWrite(s32 channel, u32* data, u32 bytesLeft, u32* bytesProcessed)
|
DEV9dmaWrite(s32 channel, u32 *data, u32 bytesLeft, u32 *bytesProcessed)
|
||||||
{
|
{
|
||||||
// See above.
|
// See above.
|
||||||
Dev9Log.WriteLn("Writing DMA8 Mem.");
|
Dev9Log.WriteLn("Writing DMA8 Mem.");
|
||||||
@ -262,7 +262,7 @@ DEV9dmaInterrupt(s32 channel)
|
|||||||
}
|
}
|
||||||
//#else
|
//#else
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
DEV9readDMA8Mem(u32* pMem, int size)
|
DEV9readDMA8Mem(u32 *pMem, int size)
|
||||||
{
|
{
|
||||||
// You'll want to put your own DMA8 reading code here.
|
// You'll want to put your own DMA8 reading code here.
|
||||||
// Time to interact with your fake (or real) hardware.
|
// Time to interact with your fake (or real) hardware.
|
||||||
@ -270,7 +270,7 @@ DEV9readDMA8Mem(u32* pMem, int size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
DEV9writeDMA8Mem(u32* pMem, int size)
|
DEV9writeDMA8Mem(u32 *pMem, int size)
|
||||||
{
|
{
|
||||||
// See above.
|
// See above.
|
||||||
Dev9Log.WriteLn("Writing DMA8 Mem.");
|
Dev9Log.WriteLn("Writing DMA8 Mem.");
|
||||||
@ -299,7 +299,7 @@ DEV9irqHandler(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(void)
|
EXPORT_C_(void)
|
||||||
DEV9setSettingsDir(const char* dir)
|
DEV9setSettingsDir(const char *dir)
|
||||||
{
|
{
|
||||||
// Grab the ini directory.
|
// Grab the ini directory.
|
||||||
s_strIniPath = (dir == NULL) ? "inis" : dir;
|
s_strIniPath = (dir == NULL) ? "inis" : dir;
|
||||||
@ -314,7 +314,7 @@ DEV9test()
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(s32)
|
EXPORT_C_(s32)
|
||||||
DEV9freeze(int mode, freezeData* data)
|
DEV9freeze(int mode, freezeData *data)
|
||||||
{
|
{
|
||||||
// This should store or retrieve any information, for if emulation
|
// This should store or retrieve any information, for if emulation
|
||||||
// gets suspended, or for savestates.
|
// gets suspended, or for savestates.
|
||||||
|
@ -44,11 +44,11 @@ extern void (*DEV9irq)(int);
|
|||||||
|
|
||||||
extern __aligned16 s8 dev9regs[0x10000];
|
extern __aligned16 s8 dev9regs[0x10000];
|
||||||
#define dev9Rs8(mem) dev9regs[(mem)&0xffff]
|
#define dev9Rs8(mem) dev9regs[(mem)&0xffff]
|
||||||
#define dev9Rs16(mem) (*(s16*)&dev9regs[(mem)&0xffff])
|
#define dev9Rs16(mem) (*(s16 *)&dev9regs[(mem)&0xffff])
|
||||||
#define dev9Rs32(mem) (*(s32*)&dev9regs[(mem)&0xffff])
|
#define dev9Rs32(mem) (*(s32 *)&dev9regs[(mem)&0xffff])
|
||||||
#define dev9Ru8(mem) (*(u8*)&dev9regs[(mem)&0xffff])
|
#define dev9Ru8(mem) (*(u8 *)&dev9regs[(mem)&0xffff])
|
||||||
#define dev9Ru16(mem) (*(u16*)&dev9regs[(mem)&0xffff])
|
#define dev9Ru16(mem) (*(u16 *)&dev9regs[(mem)&0xffff])
|
||||||
#define dev9Ru32(mem) (*(u32*)&dev9regs[(mem)&0xffff])
|
#define dev9Ru32(mem) (*(u32 *)&dev9regs[(mem)&0xffff])
|
||||||
|
|
||||||
extern void setLoggingState();
|
extern void setLoggingState();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user