mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
nJoy:
- This version should compile on linux. - The about and config dialogs are disabled (win32 should be replaced by wxWidgets) - This version is untested, so if you want to try it out, use a premade nJoy.ini from a windows install. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@70 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -44,7 +44,8 @@ bool emulator_running = FALSE;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// DllMain
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#ifdef _WIN32
|
||||
BOOL APIENTRY DllMain( HINSTANCE hinstDLL, // DLL module handle
|
||||
DWORD dwReason, // reason called
|
||||
LPVOID lpvReserved) // reserved
|
||||
@ -54,6 +55,7 @@ BOOL APIENTRY DllMain( HINSTANCE hinstDLL, // DLL module handle
|
||||
nJoy_hInst = hinstDLL;
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Input Plugin Functions (from spec's)
|
||||
@ -76,14 +78,17 @@ void GetDllInfo(PLUGIN_INFO* _PluginInfo)
|
||||
// Call about dialog
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void DllAbout(HWND _hParent)
|
||||
{
|
||||
OpenAbout(nJoy_hInst, _hParent);
|
||||
{
|
||||
#ifdef _WIN32
|
||||
OpenAbout(nJoy_hInst, _hParent);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Call config dialog
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void DllConfig(HWND _hParent)
|
||||
{
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if(SDL_Init(SDL_INIT_JOYSTICK ) < 0)
|
||||
{
|
||||
MessageBox(NULL, SDL_GetError(), "Could not initialize SDL!", MB_ICONERROR);
|
||||
@ -95,7 +100,8 @@ void DllConfig(HWND _hParent)
|
||||
{
|
||||
SaveConfig();
|
||||
}
|
||||
LoadConfig(); // reload settings
|
||||
LoadConfig(); // reload settings
|
||||
#endif
|
||||
}
|
||||
|
||||
// Init PAD (start emulation)
|
||||
@ -108,8 +114,12 @@ void PAD_Initialize(SPADInitialize _PADInitialize)
|
||||
#endif
|
||||
|
||||
if(SDL_Init(SDL_INIT_JOYSTICK ) < 0)
|
||||
{
|
||||
MessageBox(NULL, SDL_GetError(), "Could not initialize SDL!", MB_ICONERROR);
|
||||
{
|
||||
#ifdef _WIN32
|
||||
MessageBox(NULL, SDL_GetError(), "Could not initialize SDL!", MB_ICONERROR);
|
||||
#else
|
||||
printf("Could not initialize SDL! (%s)\n", SDL_GetError());
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@ -346,8 +356,12 @@ int Search_Devices()
|
||||
int numjoy = SDL_NumJoysticks();
|
||||
|
||||
if(numjoy == 0)
|
||||
{
|
||||
MessageBox(NULL, "No Joystick detected!", NULL, MB_ICONWARNING);
|
||||
{
|
||||
#ifdef _WIN32
|
||||
MessageBox(NULL, "No Joystick detected!", NULL, MB_ICONWARNING);
|
||||
#else
|
||||
printf("No Joystick detected!\n");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -399,15 +413,19 @@ void DEBUG_INIT()
|
||||
{
|
||||
if(pFile)
|
||||
return;
|
||||
|
||||
char dateStr [9];
|
||||
|
||||
#ifdef _WIN32
|
||||
char dateStr [9];
|
||||
_strdate( dateStr);
|
||||
char timeStr [9];
|
||||
char timeStr [9];
|
||||
_strtime( timeStr );
|
||||
#endif
|
||||
|
||||
pFile = fopen ("nJoy-debug.txt","wt");
|
||||
fprintf(pFile, "nJoy v"INPUT_VERSION" Debug\n");
|
||||
fprintf(pFile, "Date: %s\nTime: %s\n", dateStr, timeStr);
|
||||
fprintf(pFile, "nJoy v"INPUT_VERSION" Debug\n");
|
||||
#ifdef _WIN32
|
||||
fprintf(pFile, "Date: %s\nTime: %s\n", dateStr, timeStr);
|
||||
#endif
|
||||
fprintf(pFile, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
||||
}
|
||||
|
||||
@ -417,12 +435,14 @@ void DEBUG_QUIT()
|
||||
{
|
||||
if(!pFile)
|
||||
return;
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
char timeStr [9];
|
||||
_strtime(timeStr);
|
||||
|
||||
fprintf(pFile, "_______________\n");
|
||||
fprintf(pFile, "Time: %s", timeStr);
|
||||
fprintf(pFile, "Time: %s", timeStr);
|
||||
#endif
|
||||
fclose(pFile);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user