- 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_LLE/Src",
"Source/Plugins/Plugin_PadSimple/Src",
"Source/Plugins/Plugin_nJoy_SDL/Plugin_nJoy_SDL",
"Source/Plugins/Plugin_nJoy_SDL/Src",
"Source/Core/DolphinWX/src",
]

View File

@ -14,7 +14,7 @@ files = ["LogWindow.cpp",
"RegisterWindow.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`")
wxenv.StaticLibrary("debwx", files, LIBS = ["common"])

View File

@ -13,7 +13,7 @@ files = ["BootManager.cpp",
"PluginOptions.cpp",
"stdafx.cpp",
]
wxenv = env.Copy(CXXFLAGS = "`wx-config --cppflags --debug` -DUSE_XPM_BITMAPS -DwxNEEDS_CHARPP",
LINKFLAGS = "-L/usr/local/lib -pthread `wx-config --libs --debug`")
wxenv = env.Copy(CXXFLAGS = "`wx-config --cppflags` -DUSE_XPM_BITMAPS -DwxNEEDS_CHARPP",
LINKFLAGS = "-L/usr/local/lib -pthread `wx-config --libs`")
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",
]
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"])

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

@ -28,6 +28,9 @@
// http://code.google.com/p/dolphin-emu/
//
//////////////////////////////////////////////////////////////////////////////////////////
// whole file... until we fix the GUI
#ifdef _WIN32
#include "nJoy.h"
@ -613,3 +616,4 @@ BOOL CALLBACK AboutDlg(HWND abouthWnd, UINT message, WPARAM wParam, LPARAM lPara
return FALSE;
}
#endif

View File

@ -28,7 +28,10 @@
// http://code.google.com/p/dolphin-emu/
//
//////////////////////////////////////////////////////////////////////////////////////////
// whole file... until we fix the GUI
#ifdef _WIN32
#include <windows.h> // includes basic windows functionality
#include <Windowsx.h>
#include <stdio.h>
@ -66,4 +69,6 @@ void SetButton(HWND hDlg, int item, int value);
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
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

@ -44,7 +44,8 @@ bool emulator_running = FALSE;
//////////////////////////////////////////////////////////////////////////////////////////
// DllMain
// ¯¯¯¯¯¯¯
// ¯¯¯¯¯¯¯
#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
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
void DllAbout(HWND _hParent)
{
OpenAbout(nJoy_hInst, _hParent);
{
#ifdef _WIN32
OpenAbout(nJoy_hInst, _hParent);
#endif
}
// Call config dialog
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
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, "¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\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);
}

View File

@ -28,22 +28,28 @@
// http://code.google.com/p/dolphin-emu/
//
//////////////////////////////////////////////////////////////////////////////////////////
#ifdef _WIN32
#define _CRT_SECURE_NO_WARNINGS
#define WIN32_LEAN_AND_MEAN
#include <tchar.h>
#include <tchar.h>
#endif
#include <vector>
#include <stdio.h>
#include <time.h>
#include <time.h>
#include <SDL.h> // includes SDL
#include "Common.h" // only linux?
#include "pluginspecs_pad.h"
#include "config.h"
#include "IniFile.h"
#ifdef _WIN32
#pragma comment(lib, "SDL.lib")
// #pragma comment(lib, "SDLmain.lib")
#endif
//////////////////////////////////////////////////////////////////////////////////////////
// Define
@ -131,4 +137,4 @@ void DEBUG_INIT();
void DEBUG_QUIT();
void SaveConfig();
void LoadConfig();
void LoadConfig();