- 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:
Laurence Muller 2008-07-23 18:53:54 +00:00
parent 485ec4b341
commit d8ed24fd29
9 changed files with 70 additions and 29 deletions

View File

@ -26,7 +26,7 @@ dirs = ["Source/Core/Common/Src",
"Source/Plugins/Plugin_DSP_NULL/Src", "Source/Plugins/Plugin_DSP_NULL/Src",
"Source/Plugins/Plugin_DSP_LLE/Src", "Source/Plugins/Plugin_DSP_LLE/Src",
"Source/Plugins/Plugin_PadSimple/Src", "Source/Plugins/Plugin_PadSimple/Src",
"Source/Plugins/Plugin_nJoy_SDL/Plugin_nJoy_SDL", "Source/Plugins/Plugin_nJoy_SDL/Src",
"Source/Core/DolphinWX/src", "Source/Core/DolphinWX/src",
] ]

View File

@ -14,7 +14,7 @@ files = ["LogWindow.cpp",
"RegisterWindow.cpp", "RegisterWindow.cpp",
"RegisterView.cpp", "RegisterView.cpp",
] ]
wxenv = env.Copy(CXXFLAGS = "`wx-config --cppflags --debug` -DUSE_XPM_BITMAPS -DwxNEEDS_CHARPP", wxenv = env.Copy(CXXFLAGS = "`wx-config --cppflags` -DUSE_XPM_BITMAPS -DwxNEEDS_CHARPP",
LINKFLAGS = "-L/usr/local/lib -pthread `wx-config --libs --debug`") LINKFLAGS = "-L/usr/local/lib -pthread `wx-config --libs --debug`")
wxenv.StaticLibrary("debwx", files, LIBS = ["common"]) wxenv.StaticLibrary("debwx", files, LIBS = ["common"])

View File

@ -13,7 +13,7 @@ files = ["BootManager.cpp",
"PluginOptions.cpp", "PluginOptions.cpp",
"stdafx.cpp", "stdafx.cpp",
] ]
wxenv = env.Copy(CXXFLAGS = "`wx-config --cppflags --debug` -DUSE_XPM_BITMAPS -DwxNEEDS_CHARPP", wxenv = env.Copy(CXXFLAGS = "`wx-config --cppflags` -DUSE_XPM_BITMAPS -DwxNEEDS_CHARPP",
LINKFLAGS = "-L/usr/local/lib -pthread `wx-config --libs --debug`") LINKFLAGS = "-L/usr/local/lib -pthread `wx-config --libs`")
wxenv.Program("../../../../Binary/linux/Dolphin", files, LIBS = ["debwx", "discio", "core", "bdisasm", "videocommon", "common"]) wxenv.Program("../../../../Binary/linux/Dolphin", files, LIBS = ["debwx", "discio", "core", "bdisasm", "videocommon", "common"])

View File

@ -24,6 +24,6 @@ files = ["BPStructs.cpp",
"GUI/ConfigDlg.cpp", "GUI/ConfigDlg.cpp",
] ]
gfxenv=env.Copy(CXXFLAGS = " `wx-config --cppflags --debug` `pkg-config --cflags xxf86vm` ", LINKFLAGS = "`wx-config --libs --debug` `pkg-config --libs xxf86vm` ") gfxenv=env.Copy(CXXFLAGS = " `wx-config --cppflags` `pkg-config --cflags xxf86vm` ", LINKFLAGS = "`wx-config --libs` `pkg-config --libs xxf86vm` ")
gfxenv.SharedLibrary("../../../../Binary/linux/Plugins/zeroogl.so", files, LIBS=["videocommon", "common", "cairo", "GL", "GLEW", "CgGL", "Cg", "X11"]) gfxenv.SharedLibrary("../../../../Binary/linux/Plugins/zeroogl.so", files, LIBS=["videocommon", "common", "cairo", "GL", "GLEW", "CgGL", "Cg", "X11"])

View File

@ -0,0 +1,6 @@
Import('env')
output = "../../../../Binary/linux/Plugins/Plugin_nJoy_SDL.so"
files = ["nJoy.cpp"
]
padenv=env.Copy(CXXFLAGS = " `pkg-config --cflags sdl`", LINKFLAGS = " `pkg-config --libs sdl`")
padenv.SharedLibrary(output, files, LIBS=["common"])

View File

@ -29,6 +29,9 @@
// //
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// whole file... until we fix the GUI
#ifdef _WIN32
#include "nJoy.h" #include "nJoy.h"
extern CONTROLLER_INFO *joyinfo; extern CONTROLLER_INFO *joyinfo;
@ -613,3 +616,4 @@ BOOL CALLBACK AboutDlg(HWND abouthWnd, UINT message, WPARAM wParam, LPARAM lPara
return FALSE; return FALSE;
} }
#endif

View File

@ -29,6 +29,9 @@
// //
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// whole file... until we fix the GUI
#ifdef _WIN32
#include <windows.h> // includes basic windows functionality #include <windows.h> // includes basic windows functionality
#include <Windowsx.h> #include <Windowsx.h>
#include <stdio.h> #include <stdio.h>
@ -67,3 +70,5 @@ void SetButton(HWND hDlg, int item, int value);
void OpenAbout(HINSTANCE hInst, HWND _hParent); void OpenAbout(HINSTANCE hInst, HWND _hParent);
BOOL CALLBACK AboutDlg(HWND abouthWnd, UINT message, WPARAM wParam, LPARAM lParam); BOOL CALLBACK AboutDlg(HWND abouthWnd, UINT message, WPARAM wParam, LPARAM lParam);
#endif

View File

@ -45,6 +45,7 @@ bool emulator_running = FALSE;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// DllMain // DllMain
// ¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯
#ifdef _WIN32
BOOL APIENTRY DllMain( HINSTANCE hinstDLL, // DLL module handle BOOL APIENTRY DllMain( HINSTANCE hinstDLL, // DLL module handle
DWORD dwReason, // reason called DWORD dwReason, // reason called
LPVOID lpvReserved) // reserved LPVOID lpvReserved) // reserved
@ -54,6 +55,7 @@ BOOL APIENTRY DllMain( HINSTANCE hinstDLL, // DLL module handle
nJoy_hInst = hinstDLL; nJoy_hInst = hinstDLL;
return TRUE; return TRUE;
} }
#endif
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// Input Plugin Functions (from spec's) // Input Plugin Functions (from spec's)
@ -77,13 +79,16 @@ void GetDllInfo(PLUGIN_INFO* _PluginInfo)
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
void DllAbout(HWND _hParent) void DllAbout(HWND _hParent)
{ {
#ifdef _WIN32
OpenAbout(nJoy_hInst, _hParent); OpenAbout(nJoy_hInst, _hParent);
#endif
} }
// Call config dialog // Call config dialog
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
void DllConfig(HWND _hParent) void DllConfig(HWND _hParent)
{ {
#ifdef _WIN32
if(SDL_Init(SDL_INIT_JOYSTICK ) < 0) if(SDL_Init(SDL_INIT_JOYSTICK ) < 0)
{ {
MessageBox(NULL, SDL_GetError(), "Could not initialize SDL!", MB_ICONERROR); MessageBox(NULL, SDL_GetError(), "Could not initialize SDL!", MB_ICONERROR);
@ -96,6 +101,7 @@ void DllConfig(HWND _hParent)
SaveConfig(); SaveConfig();
} }
LoadConfig(); // reload settings LoadConfig(); // reload settings
#endif
} }
// Init PAD (start emulation) // Init PAD (start emulation)
@ -109,7 +115,11 @@ void PAD_Initialize(SPADInitialize _PADInitialize)
if(SDL_Init(SDL_INIT_JOYSTICK ) < 0) if(SDL_Init(SDL_INIT_JOYSTICK ) < 0)
{ {
#ifdef _WIN32
MessageBox(NULL, SDL_GetError(), "Could not initialize SDL!", MB_ICONERROR); MessageBox(NULL, SDL_GetError(), "Could not initialize SDL!", MB_ICONERROR);
#else
printf("Could not initialize SDL! (%s)\n", SDL_GetError());
#endif
return; return;
} }
@ -347,7 +357,11 @@ int Search_Devices()
if(numjoy == 0) if(numjoy == 0)
{ {
#ifdef _WIN32
MessageBox(NULL, "No Joystick detected!", NULL, MB_ICONWARNING); MessageBox(NULL, "No Joystick detected!", NULL, MB_ICONWARNING);
#else
printf("No Joystick detected!\n");
#endif
return 0; return 0;
} }
@ -400,14 +414,18 @@ void DEBUG_INIT()
if(pFile) if(pFile)
return; return;
#ifdef _WIN32
char dateStr [9]; char dateStr [9];
_strdate( dateStr); _strdate( dateStr);
char timeStr [9]; char timeStr [9];
_strtime( timeStr ); _strtime( timeStr );
#endif
pFile = fopen ("nJoy-debug.txt","wt"); pFile = fopen ("nJoy-debug.txt","wt");
fprintf(pFile, "nJoy v"INPUT_VERSION" Debug\n"); fprintf(pFile, "nJoy v"INPUT_VERSION" Debug\n");
#ifdef _WIN32
fprintf(pFile, "Date: %s\nTime: %s\n", dateStr, timeStr); fprintf(pFile, "Date: %s\nTime: %s\n", dateStr, timeStr);
#endif
fprintf(pFile, "¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\n"); fprintf(pFile, "¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\n");
} }
@ -418,11 +436,13 @@ void DEBUG_QUIT()
if(!pFile) if(!pFile)
return; return;
#ifdef _WIN32
char timeStr [9]; char timeStr [9];
_strtime(timeStr); _strtime(timeStr);
fprintf(pFile, "_______________\n"); fprintf(pFile, "_______________\n");
fprintf(pFile, "Time: %s", timeStr); fprintf(pFile, "Time: %s", timeStr);
#endif
fclose(pFile); fclose(pFile);
} }

View File

@ -29,21 +29,27 @@
// //
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
#ifdef _WIN32
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <tchar.h> #include <tchar.h>
#endif
#include <vector> #include <vector>
#include <stdio.h> #include <stdio.h>
#include <time.h> #include <time.h>
#include <SDL.h> // includes SDL #include <SDL.h> // includes SDL
#include "Common.h" // only linux?
#include "pluginspecs_pad.h" #include "pluginspecs_pad.h"
#include "config.h" #include "config.h"
#include "IniFile.h" #include "IniFile.h"
#ifdef _WIN32
#pragma comment(lib, "SDL.lib") #pragma comment(lib, "SDL.lib")
// #pragma comment(lib, "SDLmain.lib") #endif
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// Define // Define