fix windows builds so that they can run without winpcap.dll being installed. this causes the initialization of softAP to be conditional. also add an assert where luigi needs to decide on a return value. also add an extensible driver system so that new platform-specific calls can be made from the core emulator without breaking all the other ports. look in windows port for an example of how to extend it. feel free to criticize the architecture before we get too stuck on it.
This commit is contained in:
parent
f10f44b0ac
commit
d515af0367
|
@ -47,6 +47,8 @@
|
||||||
//#define USE_REAL_BIOS
|
//#define USE_REAL_BIOS
|
||||||
|
|
||||||
TCommonSettings CommonSettings;
|
TCommonSettings CommonSettings;
|
||||||
|
static Driver _stub_driver;
|
||||||
|
Driver* driver = &_stub_driver;
|
||||||
|
|
||||||
static BOOL LidClosed = FALSE;
|
static BOOL LidClosed = FALSE;
|
||||||
static u8 countLid = 0;
|
static u8 countLid = 0;
|
||||||
|
@ -509,7 +511,8 @@ int NDS_Init( void) {
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_WIFI
|
#ifdef EXPERIMENTAL_WIFI
|
||||||
WIFI_Init(&wifiMac) ;
|
WIFI_Init(&wifiMac) ;
|
||||||
WIFI_SoftAP_Init(&wifiMac);
|
if(wifiMac.netEnabled)
|
||||||
|
WIFI_SoftAP_Init(&wifiMac);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
nds.FW_ARM9BootCode = NULL;
|
nds.FW_ARM9BootCode = NULL;
|
||||||
|
@ -529,7 +532,8 @@ void NDS_DeInit(void) {
|
||||||
gpu3D->NDS_3D_Close();
|
gpu3D->NDS_3D_Close();
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_WIFI
|
#ifdef EXPERIMENTAL_WIFI
|
||||||
WIFI_SoftAP_Shutdown(&wifiMac);
|
if(wifiMac.netEnabled)
|
||||||
|
WIFI_SoftAP_Shutdown(&wifiMac);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1023,8 +1027,10 @@ void NDS_Reset( void)
|
||||||
#ifdef EXPERIMENTAL_WIFI
|
#ifdef EXPERIMENTAL_WIFI
|
||||||
WIFI_Init(&wifiMac);
|
WIFI_Init(&wifiMac);
|
||||||
|
|
||||||
WIFI_SoftAP_Shutdown(&wifiMac);
|
if(wifiMac.netEnabled) {
|
||||||
WIFI_SoftAP_Init(&wifiMac);
|
WIFI_SoftAP_Shutdown(&wifiMac);
|
||||||
|
WIFI_SoftAP_Init(&wifiMac);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
memcpy(FW_Mac, (MMU.fw.data + 0x36), 6);
|
memcpy(FW_Mac, (MMU.fw.data + 0x36), 6);
|
||||||
|
|
|
@ -317,6 +317,15 @@ extern struct TCommonSettings {
|
||||||
|
|
||||||
extern char ROMserial[20];
|
extern char ROMserial[20];
|
||||||
|
|
||||||
|
//this should be moved to a driver.h later, but for now, here they are.
|
||||||
|
//each platform needs to implement this, although it doesnt need to implement any functions
|
||||||
|
class Driver {
|
||||||
|
public:
|
||||||
|
virtual BOOL WIFI_Host_InitSystem() { return FALSE; }
|
||||||
|
virtual void WIFI_Host_ShutdownSystem() {}
|
||||||
|
};
|
||||||
|
extern Driver* driver;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include "wifi.h"
|
#include "wifi.h"
|
||||||
#include "armcpu.h"
|
#include "armcpu.h"
|
||||||
#include "NDSSystem.h"
|
#include "NDSSystem.h"
|
||||||
|
@ -427,8 +428,12 @@ static void WIFI_triggerIRQ(wifimac_t *wifi, u8 irq)
|
||||||
void WIFI_Init(wifimac_t *wifi)
|
void WIFI_Init(wifimac_t *wifi)
|
||||||
{
|
{
|
||||||
WIFI_resetRF(&wifi->RF) ;
|
WIFI_resetRF(&wifi->RF) ;
|
||||||
WIFI_Host_InitSystem() ;
|
wifi->netEnabled = false;
|
||||||
wifi->udpSocket = WIFI_Host_OpenChannel(1) ;
|
if(driver->WIFI_Host_InitSystem())
|
||||||
|
{
|
||||||
|
wifi->netEnabled = true;
|
||||||
|
wifi->udpSocket = WIFI_Host_OpenChannel(1) ;
|
||||||
|
}
|
||||||
wifi->powerOn = FALSE;
|
wifi->powerOn = FALSE;
|
||||||
wifi->powerOnPending = FALSE;
|
wifi->powerOnPending = FALSE;
|
||||||
}
|
}
|
||||||
|
@ -922,7 +927,8 @@ u16 WIFI_read16(wifimac_t *wifi,u32 address)
|
||||||
//printf("wifi: read reg 0x0214\n");
|
//printf("wifi: read reg 0x0214\n");
|
||||||
return 0x0009;
|
return 0x0009;
|
||||||
case 0x19C:
|
case 0x19C:
|
||||||
break;
|
assert(false); //luigi, please pick something to return from here
|
||||||
|
return 0;
|
||||||
default:
|
default:
|
||||||
// printf("wifi: read unhandled reg %03X\n", address);
|
// printf("wifi: read unhandled reg %03X\n", address);
|
||||||
return wifi->ioMem[address >> 1];
|
return wifi->ioMem[address >> 1];
|
||||||
|
@ -1502,24 +1508,4 @@ u16 WIFI_Host_RecvData(socket_t sock, u8 *data, u16 maxLength)
|
||||||
return 0 ;
|
return 0 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL WIFI_Host_InitSystem(void)
|
|
||||||
{
|
|
||||||
#ifdef WIN32
|
|
||||||
WSADATA wsaData ;
|
|
||||||
WORD version = MAKEWORD(1,1) ;
|
|
||||||
if (WSAStartup(version,&wsaData))
|
|
||||||
{
|
|
||||||
return FALSE ;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return TRUE ;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WIFI_Host_ShutdownSystem(void)
|
|
||||||
{
|
|
||||||
#ifdef WIN32
|
|
||||||
WSACleanup() ;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -494,6 +494,7 @@ typedef struct
|
||||||
} SoftAP;
|
} SoftAP;
|
||||||
|
|
||||||
/* desmume host communication */
|
/* desmume host communication */
|
||||||
|
bool netEnabled;
|
||||||
socket_t udpSocket ;
|
socket_t udpSocket ;
|
||||||
u8 channel ;
|
u8 channel ;
|
||||||
|
|
||||||
|
|
|
@ -76,6 +76,7 @@
|
||||||
AdditionalDependencies="gdiplus\gdiplus.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib directx\dxguid.lib shell32.lib comdlg32.lib directx\dxerr8.lib directx\dsound.lib directx\dinput8.lib directx\ddraw.lib zlib-2005-x32.lib zziplib-2005-x32.lib shlwapi.lib winpcap\wpcap.lib"
|
AdditionalDependencies="gdiplus\gdiplus.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib directx\dxguid.lib shell32.lib comdlg32.lib directx\dxerr8.lib directx\dsound.lib directx\dinput8.lib directx\ddraw.lib zlib-2005-x32.lib zziplib-2005-x32.lib shlwapi.lib winpcap\wpcap.lib"
|
||||||
OutputFile="$(OutDir)\$(ProjectName)_debug.exe"
|
OutputFile="$(OutDir)\$(ProjectName)_debug.exe"
|
||||||
AdditionalLibraryDirectories=".\zlib123;.\zziplib"
|
AdditionalLibraryDirectories=".\zlib123;.\zziplib"
|
||||||
|
DelayLoadDLLs="wpcap.dll"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
GenerateMapFile="true"
|
GenerateMapFile="true"
|
||||||
/>
|
/>
|
||||||
|
@ -165,6 +166,7 @@
|
||||||
AdditionalDependencies="gdiplus\gdiplus.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib directx\dxguid.lib shell32.lib comdlg32.lib directx\dxerr8.lib directx\dsound.lib directx\dinput8.lib directx\ddraw.lib zlib-2005-x32.lib zziplib-2005-x32.lib shlwapi.lib"
|
AdditionalDependencies="gdiplus\gdiplus.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib directx\dxguid.lib shell32.lib comdlg32.lib directx\dxerr8.lib directx\dsound.lib directx\dinput8.lib directx\ddraw.lib zlib-2005-x32.lib zziplib-2005-x32.lib shlwapi.lib"
|
||||||
OutputFile="$(OutDir)\$(ProjectName).exe"
|
OutputFile="$(OutDir)\$(ProjectName).exe"
|
||||||
AdditionalLibraryDirectories=".\zlib123;.\zziplib"
|
AdditionalLibraryDirectories=".\zlib123;.\zziplib"
|
||||||
|
DelayLoadDLLs="wpcap.dll"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
|
@ -257,6 +259,7 @@
|
||||||
AdditionalDependencies="gdiplus\gdiplus.lib gdiplus.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib directx\dxguid.lib shell32.lib comdlg32.lib directx\dxerr8.lib directx\dsound.lib directx\dinput8.lib directx\ddraw.lib zlib-2005-x32.lib zziplib-2005-x32.lib shlwapi.lib winpcap\wpcap.lib"
|
AdditionalDependencies="gdiplus\gdiplus.lib gdiplus.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib directx\dxguid.lib shell32.lib comdlg32.lib directx\dxerr8.lib directx\dsound.lib directx\dinput8.lib directx\ddraw.lib zlib-2005-x32.lib zziplib-2005-x32.lib shlwapi.lib winpcap\wpcap.lib"
|
||||||
OutputFile="$(OutDir)\$(ProjectName)_sse2.exe"
|
OutputFile="$(OutDir)\$(ProjectName)_sse2.exe"
|
||||||
AdditionalLibraryDirectories=".\zlib123;.\zziplib"
|
AdditionalLibraryDirectories=".\zlib123;.\zziplib"
|
||||||
|
DelayLoadDLLs="wpcap.dll"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
GenerateMapFile="true"
|
GenerateMapFile="true"
|
||||||
EnableCOMDATFolding="0"
|
EnableCOMDATFolding="0"
|
||||||
|
@ -329,6 +332,7 @@
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalDependencies="gdiplus\gdiplus.lib gdiplus.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib directx\dxguid.lib shell32.lib comdlg32.lib directx\dxerr8.lib directx\dsound.lib directx\dinput8.lib directx\ddraw.lib zlib-2005-x32.lib zziplib-2005-x32.lib shlwapi.lib"
|
AdditionalDependencies="gdiplus\gdiplus.lib gdiplus.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib directx\dxguid.lib shell32.lib comdlg32.lib directx\dxerr8.lib directx\dsound.lib directx\dinput8.lib directx\ddraw.lib zlib-2005-x32.lib zziplib-2005-x32.lib shlwapi.lib"
|
||||||
|
DelayLoadDLLs="wpcap.dll"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCALinkTool"
|
Name="VCALinkTool"
|
||||||
|
@ -419,6 +423,7 @@
|
||||||
AdditionalDependencies="gdiplus\gdiplus.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib directx\dxguid.lib shell32.lib comdlg32.lib directx\dxerr8.lib directx\dsound.lib directx\dinput8.lib directx\ddraw.lib zlib-2005-x32.lib zziplib-2005-x32.lib shlwapi.lib"
|
AdditionalDependencies="gdiplus\gdiplus.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib directx\dxguid.lib shell32.lib comdlg32.lib directx\dxerr8.lib directx\dsound.lib directx\dinput8.lib directx\ddraw.lib zlib-2005-x32.lib zziplib-2005-x32.lib shlwapi.lib"
|
||||||
OutputFile="$(OutDir)\$(ProjectName)_sse2.exe"
|
OutputFile="$(OutDir)\$(ProjectName)_sse2.exe"
|
||||||
AdditionalLibraryDirectories=".\zlib123;.\zziplib"
|
AdditionalLibraryDirectories=".\zlib123;.\zziplib"
|
||||||
|
DelayLoadDLLs="wpcap.dll"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
GenerateMapFile="true"
|
GenerateMapFile="true"
|
||||||
EnableCOMDATFolding="0"
|
EnableCOMDATFolding="0"
|
||||||
|
|
|
@ -75,6 +75,7 @@
|
||||||
AdditionalDependencies="gdiplus\gdiplus.lib vfw32.lib winmm.lib comctl32.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib directx\dxguid.lib shell32.lib comdlg32.lib directx\dxerr8.lib directx\dsound.lib directx\dinput8.lib directx\ddraw.lib shlwapi.lib winpcap\wpcap.lib"
|
AdditionalDependencies="gdiplus\gdiplus.lib vfw32.lib winmm.lib comctl32.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib directx\dxguid.lib shell32.lib comdlg32.lib directx\dxerr8.lib directx\dsound.lib directx\dinput8.lib directx\ddraw.lib shlwapi.lib winpcap\wpcap.lib"
|
||||||
OutputFile="$(OutDir)\$(ProjectName)_debug.exe"
|
OutputFile="$(OutDir)\$(ProjectName)_debug.exe"
|
||||||
AdditionalLibraryDirectories=".\zlib123;.\zziplib"
|
AdditionalLibraryDirectories=".\zlib123;.\zziplib"
|
||||||
|
DelayLoadDLLs="wpcap.dll"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
GenerateMapFile="true"
|
GenerateMapFile="true"
|
||||||
RandomizedBaseAddress="1"
|
RandomizedBaseAddress="1"
|
||||||
|
@ -165,6 +166,7 @@
|
||||||
AdditionalDependencies="gdiplus\gdiplus.lib vfw32.lib winmm.lib comctl32.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib gdiplus.lib directx\dxguid.lib shell32.lib comdlg32.lib shlwapi.lib directx\dxerr8.lib directx\dsound.lib directx\dinput8.lib directx\ddraw.lib zlib-2008-x32.lib zziplib-2008-x32.lib wpcap.lib"
|
AdditionalDependencies="gdiplus\gdiplus.lib vfw32.lib winmm.lib comctl32.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib gdiplus.lib directx\dxguid.lib shell32.lib comdlg32.lib shlwapi.lib directx\dxerr8.lib directx\dsound.lib directx\dinput8.lib directx\ddraw.lib zlib-2008-x32.lib zziplib-2008-x32.lib wpcap.lib"
|
||||||
OutputFile="$(OutDir)\$(ProjectName)_interim_sse2.exe"
|
OutputFile="$(OutDir)\$(ProjectName)_interim_sse2.exe"
|
||||||
AdditionalLibraryDirectories=".\zlib123;.\zziplib;.\winpcap"
|
AdditionalLibraryDirectories=".\zlib123;.\zziplib;.\winpcap"
|
||||||
|
DelayLoadDLLs="wpcap.dll"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
RandomizedBaseAddress="1"
|
RandomizedBaseAddress="1"
|
||||||
DataExecutionPrevention="0"
|
DataExecutionPrevention="0"
|
||||||
|
@ -254,6 +256,7 @@
|
||||||
AdditionalDependencies="gdiplus\gdiplus.lib vfw32.lib winmm.lib comctl32.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib directx\dxguid.lib shell32.lib comdlg32.lib directx\dxerr8.lib directx\dsound.lib directx\dinput8.lib directx\ddraw.lib zlib-2008-x32.lib zziplib-2008-x32.lib shlwapi.lib"
|
AdditionalDependencies="gdiplus\gdiplus.lib vfw32.lib winmm.lib comctl32.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib directx\dxguid.lib shell32.lib comdlg32.lib directx\dxerr8.lib directx\dsound.lib directx\dinput8.lib directx\ddraw.lib zlib-2008-x32.lib zziplib-2008-x32.lib shlwapi.lib"
|
||||||
OutputFile="$(OutDir)\$(ProjectName)_interim.exe"
|
OutputFile="$(OutDir)\$(ProjectName)_interim.exe"
|
||||||
AdditionalLibraryDirectories=".\zlib123;.\zziplib"
|
AdditionalLibraryDirectories=".\zlib123;.\zziplib"
|
||||||
|
DelayLoadDLLs="wpcap.dll"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
RandomizedBaseAddress="1"
|
RandomizedBaseAddress="1"
|
||||||
DataExecutionPrevention="0"
|
DataExecutionPrevention="0"
|
||||||
|
@ -343,6 +346,7 @@
|
||||||
AdditionalDependencies="gdiplus\gdiplus.lib vfw32.lib winmm.lib comctl32.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib directx\dxguid.lib shell32.lib comdlg32.lib directx\dxerr8.lib directx\dsound.lib directx\dinput8.lib directx\ddraw.lib zlib-2008-x32.lib zziplib-2008-x32.lib shlwapi.lib"
|
AdditionalDependencies="gdiplus\gdiplus.lib vfw32.lib winmm.lib comctl32.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib directx\dxguid.lib shell32.lib comdlg32.lib directx\dxerr8.lib directx\dsound.lib directx\dinput8.lib directx\ddraw.lib zlib-2008-x32.lib zziplib-2008-x32.lib shlwapi.lib"
|
||||||
OutputFile="$(OutDir)\$(ProjectName).exe"
|
OutputFile="$(OutDir)\$(ProjectName).exe"
|
||||||
AdditionalLibraryDirectories=".\zlib123;.\zziplib"
|
AdditionalLibraryDirectories=".\zlib123;.\zziplib"
|
||||||
|
DelayLoadDLLs="wpcap.dll"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
RandomizedBaseAddress="1"
|
RandomizedBaseAddress="1"
|
||||||
DataExecutionPrevention="0"
|
DataExecutionPrevention="0"
|
||||||
|
@ -433,6 +437,7 @@
|
||||||
AdditionalDependencies="gdiplus\gdiplus.lib vfw32.lib winmm.lib comctl32.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib directx\dxguid.lib shell32.lib comdlg32.lib shlwapi.lib directx\dxerr8.lib directx\dsound.lib directx\dinput8.lib directx\ddraw.lib zlib-2008-x32.lib zziplib-2008-x32.lib shlwapi.lib"
|
AdditionalDependencies="gdiplus\gdiplus.lib vfw32.lib winmm.lib comctl32.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib directx\dxguid.lib shell32.lib comdlg32.lib shlwapi.lib directx\dxerr8.lib directx\dsound.lib directx\dinput8.lib directx\ddraw.lib zlib-2008-x32.lib zziplib-2008-x32.lib shlwapi.lib"
|
||||||
OutputFile="$(OutDir)\$(ProjectName)_sse2.exe"
|
OutputFile="$(OutDir)\$(ProjectName)_sse2.exe"
|
||||||
AdditionalLibraryDirectories=".\zlib123;.\zziplib"
|
AdditionalLibraryDirectories=".\zlib123;.\zziplib"
|
||||||
|
DelayLoadDLLs="wpcap.dll"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
RandomizedBaseAddress="1"
|
RandomizedBaseAddress="1"
|
||||||
DataExecutionPrevention="0"
|
DataExecutionPrevention="0"
|
||||||
|
|
Binary file not shown.
|
@ -19,7 +19,7 @@
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//*/
|
//*/
|
||||||
|
|
||||||
#ifndef HOTKEY_H_INCLUDED
|
#ifndef HOTKEY_H_INCLUDED
|
||||||
#define HOTKEY_H_INCLUDED
|
#define HOTKEY_H_INCLUDED
|
||||||
|
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
|
@ -27,54 +27,54 @@
|
||||||
#include <tchar.h>
|
#include <tchar.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
enum HotkeyPage {
|
enum HotkeyPage {
|
||||||
HOTKEY_PAGE_MAIN=0,
|
HOTKEY_PAGE_MAIN=0,
|
||||||
HOTKEY_PAGE_STATE,
|
HOTKEY_PAGE_STATE,
|
||||||
HOTKEY_PAGE_STATE_SLOTS,
|
HOTKEY_PAGE_STATE_SLOTS,
|
||||||
NUM_HOTKEY_PAGE,
|
NUM_HOTKEY_PAGE,
|
||||||
};
|
};
|
||||||
|
|
||||||
static LPCTSTR hotkeyPageTitle[] = {
|
|
||||||
_T("Main"),
|
|
||||||
_T("Savestates"),
|
|
||||||
_T("Savestate Slots"),
|
|
||||||
_T("NUM_HOTKEY_PAGE"),
|
|
||||||
};
|
|
||||||
|
|
||||||
|
static LPCTSTR hotkeyPageTitle[] = {
|
||||||
struct SCustomKey
|
_T("Main"),
|
||||||
{
|
_T("Savestates"),
|
||||||
typedef void (*THandler) (int param);
|
_T("Savestate Slots"),
|
||||||
WORD key;
|
_T("NUM_HOTKEY_PAGE"),
|
||||||
WORD modifiers;
|
};
|
||||||
THandler handleKeyDown;
|
|
||||||
THandler handleKeyUp;
|
|
||||||
HotkeyPage page;
|
struct SCustomKey
|
||||||
std::wstring name;
|
{
|
||||||
const char* code;
|
typedef void (*THandler) (int param);
|
||||||
int param;
|
WORD key;
|
||||||
//HotkeyTiming timing;
|
WORD modifiers;
|
||||||
};
|
THandler handleKeyDown;
|
||||||
|
THandler handleKeyUp;
|
||||||
struct SCustomKeys
|
HotkeyPage page;
|
||||||
{
|
std::wstring name;
|
||||||
SCustomKey Save[10];
|
const char* code;
|
||||||
SCustomKey Load[10];
|
int param;
|
||||||
SCustomKey Slot[10];
|
//HotkeyTiming timing;
|
||||||
SCustomKey QuickSave, QuickLoad;
|
};
|
||||||
|
|
||||||
SCustomKey Pause, FrameAdvance;
|
struct SCustomKeys
|
||||||
|
{
|
||||||
SCustomKey ToggleRasterizer;
|
SCustomKey Save[10];
|
||||||
|
SCustomKey Load[10];
|
||||||
SCustomKey PrintScreen;
|
SCustomKey Slot[10];
|
||||||
SCustomKey LastItem; // dummy, must be last
|
SCustomKey QuickSave, QuickLoad;
|
||||||
|
|
||||||
//--methods--
|
SCustomKey Pause, FrameAdvance;
|
||||||
SCustomKey &key(int i) { return ((SCustomKey*)this)[i]; }
|
|
||||||
SCustomKey const &key(int i) const { return ((SCustomKey*)this)[i]; }
|
SCustomKey ToggleRasterizer;
|
||||||
};
|
|
||||||
//SCustomKey key[];
|
SCustomKey PrintScreen;
|
||||||
|
SCustomKey LastItem; // dummy, must be last
|
||||||
|
|
||||||
|
//--methods--
|
||||||
|
SCustomKey &key(int i) { return ((SCustomKey*)this)[i]; }
|
||||||
|
SCustomKey const &key(int i) const { return ((SCustomKey*)this)[i]; }
|
||||||
|
};
|
||||||
|
//SCustomKey key[];
|
||||||
|
|
||||||
extern SCustomKeys CustomKeys;
|
extern SCustomKeys CustomKeys;
|
||||||
|
|
||||||
|
@ -89,166 +89,166 @@ void HK_StateSaveSlot(int);
|
||||||
void HK_StateLoadSlot(int);
|
void HK_StateLoadSlot(int);
|
||||||
void HK_StateSetSlot(int);
|
void HK_StateSetSlot(int);
|
||||||
void HK_Pause(int);
|
void HK_Pause(int);
|
||||||
|
|
||||||
#endif //HOTKEY_H_INCLUDED
|
#endif //HOTKEY_H_INCLUDED
|
||||||
|
|
||||||
/**********************************************************************************
|
/**********************************************************************************
|
||||||
Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.
|
Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.
|
||||||
|
|
||||||
(c) Copyright 1996 - 2002 Gary Henderson (gary.henderson@ntlworld.com),
|
(c) Copyright 1996 - 2002 Gary Henderson (gary.henderson@ntlworld.com),
|
||||||
Jerremy Koot (jkoot@snes9x.com)
|
Jerremy Koot (jkoot@snes9x.com)
|
||||||
|
|
||||||
(c) Copyright 2002 - 2004 Matthew Kendora
|
(c) Copyright 2002 - 2004 Matthew Kendora
|
||||||
|
|
||||||
(c) Copyright 2002 - 2005 Peter Bortas (peter@bortas.org)
|
(c) Copyright 2002 - 2005 Peter Bortas (peter@bortas.org)
|
||||||
|
|
||||||
(c) Copyright 2004 - 2005 Joel Yliluoma (http://iki.fi/bisqwit/)
|
(c) Copyright 2004 - 2005 Joel Yliluoma (http://iki.fi/bisqwit/)
|
||||||
|
|
||||||
(c) Copyright 2001 - 2006 John Weidman (jweidman@slip.net)
|
(c) Copyright 2001 - 2006 John Weidman (jweidman@slip.net)
|
||||||
|
|
||||||
(c) Copyright 2002 - 2006 funkyass (funkyass@spam.shaw.ca),
|
(c) Copyright 2002 - 2006 funkyass (funkyass@spam.shaw.ca),
|
||||||
Kris Bleakley (codeviolation@hotmail.com)
|
Kris Bleakley (codeviolation@hotmail.com)
|
||||||
|
|
||||||
(c) Copyright 2002 - 2007 Brad Jorsch (anomie@users.sourceforge.net),
|
(c) Copyright 2002 - 2007 Brad Jorsch (anomie@users.sourceforge.net),
|
||||||
Nach (n-a-c-h@users.sourceforge.net),
|
Nach (n-a-c-h@users.sourceforge.net),
|
||||||
zones (kasumitokoduck@yahoo.com)
|
zones (kasumitokoduck@yahoo.com)
|
||||||
|
|
||||||
(c) Copyright 2006 - 2007 nitsuja
|
(c) Copyright 2006 - 2007 nitsuja
|
||||||
|
|
||||||
|
|
||||||
BS-X C emulator code
|
BS-X C emulator code
|
||||||
(c) Copyright 2005 - 2006 Dreamer Nom,
|
(c) Copyright 2005 - 2006 Dreamer Nom,
|
||||||
zones
|
zones
|
||||||
|
|
||||||
C4 x86 assembler and some C emulation code
|
C4 x86 assembler and some C emulation code
|
||||||
(c) Copyright 2000 - 2003 _Demo_ (_demo_@zsnes.com),
|
(c) Copyright 2000 - 2003 _Demo_ (_demo_@zsnes.com),
|
||||||
Nach,
|
Nach,
|
||||||
zsKnight (zsknight@zsnes.com)
|
zsKnight (zsknight@zsnes.com)
|
||||||
|
|
||||||
C4 C++ code
|
C4 C++ code
|
||||||
(c) Copyright 2003 - 2006 Brad Jorsch,
|
(c) Copyright 2003 - 2006 Brad Jorsch,
|
||||||
Nach
|
Nach
|
||||||
|
|
||||||
DSP-1 emulator code
|
DSP-1 emulator code
|
||||||
(c) Copyright 1998 - 2006 _Demo_,
|
(c) Copyright 1998 - 2006 _Demo_,
|
||||||
Andreas Naive (andreasnaive@gmail.com)
|
Andreas Naive (andreasnaive@gmail.com)
|
||||||
Gary Henderson,
|
Gary Henderson,
|
||||||
Ivar (ivar@snes9x.com),
|
Ivar (ivar@snes9x.com),
|
||||||
John Weidman,
|
John Weidman,
|
||||||
Kris Bleakley,
|
Kris Bleakley,
|
||||||
Matthew Kendora,
|
Matthew Kendora,
|
||||||
Nach,
|
Nach,
|
||||||
neviksti (neviksti@hotmail.com)
|
neviksti (neviksti@hotmail.com)
|
||||||
|
|
||||||
DSP-2 emulator code
|
DSP-2 emulator code
|
||||||
(c) Copyright 2003 John Weidman,
|
(c) Copyright 2003 John Weidman,
|
||||||
Kris Bleakley,
|
Kris Bleakley,
|
||||||
Lord Nightmare (lord_nightmare@users.sourceforge.net),
|
Lord Nightmare (lord_nightmare@users.sourceforge.net),
|
||||||
Matthew Kendora,
|
Matthew Kendora,
|
||||||
neviksti
|
neviksti
|
||||||
|
|
||||||
|
|
||||||
DSP-3 emulator code
|
DSP-3 emulator code
|
||||||
(c) Copyright 2003 - 2006 John Weidman,
|
(c) Copyright 2003 - 2006 John Weidman,
|
||||||
Kris Bleakley,
|
Kris Bleakley,
|
||||||
Lancer,
|
Lancer,
|
||||||
z80 gaiden
|
z80 gaiden
|
||||||
|
|
||||||
DSP-4 emulator code
|
DSP-4 emulator code
|
||||||
(c) Copyright 2004 - 2006 Dreamer Nom,
|
(c) Copyright 2004 - 2006 Dreamer Nom,
|
||||||
John Weidman,
|
John Weidman,
|
||||||
Kris Bleakley,
|
Kris Bleakley,
|
||||||
Nach,
|
Nach,
|
||||||
z80 gaiden
|
z80 gaiden
|
||||||
|
|
||||||
OBC1 emulator code
|
OBC1 emulator code
|
||||||
(c) Copyright 2001 - 2004 zsKnight,
|
(c) Copyright 2001 - 2004 zsKnight,
|
||||||
pagefault (pagefault@zsnes.com),
|
pagefault (pagefault@zsnes.com),
|
||||||
Kris Bleakley,
|
Kris Bleakley,
|
||||||
Ported from x86 assembler to C by sanmaiwashi
|
Ported from x86 assembler to C by sanmaiwashi
|
||||||
|
|
||||||
SPC7110 and RTC C++ emulator code
|
SPC7110 and RTC C++ emulator code
|
||||||
(c) Copyright 2002 Matthew Kendora with research by
|
(c) Copyright 2002 Matthew Kendora with research by
|
||||||
zsKnight,
|
zsKnight,
|
||||||
John Weidman,
|
John Weidman,
|
||||||
Dark Force
|
Dark Force
|
||||||
|
|
||||||
S-DD1 C emulator code
|
S-DD1 C emulator code
|
||||||
(c) Copyright 2003 Brad Jorsch with research by
|
(c) Copyright 2003 Brad Jorsch with research by
|
||||||
Andreas Naive,
|
Andreas Naive,
|
||||||
John Weidman
|
John Weidman
|
||||||
|
|
||||||
S-RTC C emulator code
|
S-RTC C emulator code
|
||||||
(c) Copyright 2001-2006 byuu,
|
(c) Copyright 2001-2006 byuu,
|
||||||
John Weidman
|
John Weidman
|
||||||
|
|
||||||
ST010 C++ emulator code
|
ST010 C++ emulator code
|
||||||
(c) Copyright 2003 Feather,
|
(c) Copyright 2003 Feather,
|
||||||
John Weidman,
|
John Weidman,
|
||||||
Kris Bleakley,
|
Kris Bleakley,
|
||||||
Matthew Kendora
|
Matthew Kendora
|
||||||
|
|
||||||
Super FX x86 assembler emulator code
|
Super FX x86 assembler emulator code
|
||||||
(c) Copyright 1998 - 2003 _Demo_,
|
(c) Copyright 1998 - 2003 _Demo_,
|
||||||
pagefault,
|
pagefault,
|
||||||
zsKnight,
|
zsKnight,
|
||||||
|
|
||||||
Super FX C emulator code
|
Super FX C emulator code
|
||||||
(c) Copyright 1997 - 1999 Ivar,
|
(c) Copyright 1997 - 1999 Ivar,
|
||||||
Gary Henderson,
|
Gary Henderson,
|
||||||
John Weidman
|
John Weidman
|
||||||
|
|
||||||
Sound DSP emulator code is derived from SNEeSe and OpenSPC:
|
Sound DSP emulator code is derived from SNEeSe and OpenSPC:
|
||||||
(c) Copyright 1998 - 2003 Brad Martin
|
(c) Copyright 1998 - 2003 Brad Martin
|
||||||
(c) Copyright 1998 - 2006 Charles Bilyue'
|
(c) Copyright 1998 - 2006 Charles Bilyue'
|
||||||
|
|
||||||
SH assembler code partly based on x86 assembler code
|
SH assembler code partly based on x86 assembler code
|
||||||
(c) Copyright 2002 - 2004 Marcus Comstedt (marcus@mc.pp.se)
|
(c) Copyright 2002 - 2004 Marcus Comstedt (marcus@mc.pp.se)
|
||||||
|
|
||||||
2xSaI filter
|
2xSaI filter
|
||||||
(c) Copyright 1999 - 2001 Derek Liauw Kie Fa
|
(c) Copyright 1999 - 2001 Derek Liauw Kie Fa
|
||||||
|
|
||||||
HQ2x, HQ3x, HQ4x filters
|
HQ2x, HQ3x, HQ4x filters
|
||||||
(c) Copyright 2003 Maxim Stepin (maxim@hiend3d.com)
|
(c) Copyright 2003 Maxim Stepin (maxim@hiend3d.com)
|
||||||
|
|
||||||
Win32 GUI code
|
Win32 GUI code
|
||||||
(c) Copyright 2003 - 2006 blip,
|
(c) Copyright 2003 - 2006 blip,
|
||||||
funkyass,
|
funkyass,
|
||||||
Matthew Kendora,
|
Matthew Kendora,
|
||||||
Nach,
|
Nach,
|
||||||
nitsuja
|
nitsuja
|
||||||
|
|
||||||
Mac OS GUI code
|
Mac OS GUI code
|
||||||
(c) Copyright 1998 - 2001 John Stiles
|
(c) Copyright 1998 - 2001 John Stiles
|
||||||
(c) Copyright 2001 - 2007 zones
|
(c) Copyright 2001 - 2007 zones
|
||||||
|
|
||||||
|
|
||||||
Specific ports contains the works of other authors. See headers in
|
Specific ports contains the works of other authors. See headers in
|
||||||
individual files.
|
individual files.
|
||||||
|
|
||||||
|
|
||||||
Snes9x homepage: http://www.snes9x.com
|
Snes9x homepage: http://www.snes9x.com
|
||||||
|
|
||||||
Permission to use, copy, modify and/or distribute Snes9x in both binary
|
Permission to use, copy, modify and/or distribute Snes9x in both binary
|
||||||
and source form, for non-commercial purposes, is hereby granted without
|
and source form, for non-commercial purposes, is hereby granted without
|
||||||
fee, providing that this license information and copyright notice appear
|
fee, providing that this license information and copyright notice appear
|
||||||
with all copies and any derived work.
|
with all copies and any derived work.
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event shall the authors be held liable for any damages
|
warranty. In no event shall the authors be held liable for any damages
|
||||||
arising from the use of this software or it's derivatives.
|
arising from the use of this software or it's derivatives.
|
||||||
|
|
||||||
Snes9x is freeware for PERSONAL USE only. Commercial users should
|
Snes9x is freeware for PERSONAL USE only. Commercial users should
|
||||||
seek permission of the copyright holders first. Commercial use includes,
|
seek permission of the copyright holders first. Commercial use includes,
|
||||||
but is not limited to, charging money for Snes9x or software derived from
|
but is not limited to, charging money for Snes9x or software derived from
|
||||||
Snes9x, including Snes9x or derivatives in commercial game bundles, and/or
|
Snes9x, including Snes9x or derivatives in commercial game bundles, and/or
|
||||||
using Snes9x as a promotion for your commercial product.
|
using Snes9x as a promotion for your commercial product.
|
||||||
|
|
||||||
The copyright holders request that bug fixes and improvements to the code
|
The copyright holders request that bug fixes and improvements to the code
|
||||||
should be forwarded to them so everyone can benefit from the modifications
|
should be forwarded to them so everyone can benefit from the modifications
|
||||||
in future versions.
|
in future versions.
|
||||||
|
|
||||||
Super NES and Super Nintendo Entertainment System are trademarks of
|
Super NES and Super Nintendo Entertainment System are trademarks of
|
||||||
Nintendo Co., Limited and its subsidiary companies.
|
Nintendo Co., Limited and its subsidiary companies.
|
||||||
**********************************************************************************/
|
**********************************************************************************/
|
||||||
|
|
||||||
|
|
|
@ -1204,12 +1204,45 @@ static void ExitRunLoop()
|
||||||
emu_halt();
|
emu_halt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class WinDriver : public Driver
|
||||||
|
{
|
||||||
|
virtual BOOL WIFI_Host_InitSystem() {
|
||||||
|
#ifdef EXPERIMENTAL_WIFI
|
||||||
|
//require winsock initialization
|
||||||
|
WSADATA wsaData ;
|
||||||
|
WORD version = MAKEWORD(1,1) ;
|
||||||
|
if (WSAStartup(version,&wsaData))
|
||||||
|
{
|
||||||
|
printf("Failed initializing WSAStartup - softAP support disabled\n");
|
||||||
|
return FALSE ;
|
||||||
|
}
|
||||||
|
//require winpcap.dll
|
||||||
|
HMODULE temp = LoadLibrary("winpcap.dll");
|
||||||
|
if(temp == NULL) {
|
||||||
|
printf("Failed initializing winpcap.dll - softAP support disabled\n");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
FreeLibrary(temp);
|
||||||
|
return TRUE;
|
||||||
|
#else
|
||||||
|
return FALSE ;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
virtual void WIFI_Host_ShutdownSystem() {
|
||||||
|
#ifdef EXPERIMENTAL_WIFI
|
||||||
|
WSACleanup() ;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
int WINAPI WinMain (HINSTANCE hThisInstance,
|
int WINAPI WinMain (HINSTANCE hThisInstance,
|
||||||
HINSTANCE hPrevInstance,
|
HINSTANCE hPrevInstance,
|
||||||
LPSTR lpszArgument,
|
LPSTR lpszArgument,
|
||||||
int nFunsterStil)
|
int nFunsterStil)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
driver = new WinDriver();
|
||||||
|
|
||||||
ULONG_PTR GdiplusToken;
|
ULONG_PTR GdiplusToken;
|
||||||
GdiplusStartupInput GdiplusSI;
|
GdiplusStartupInput GdiplusSI;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue