Merged revisions 1847 to 1854 and 1856 to 1858 leaving

out 1855. Just need someone to confirm it's ok to merge
it :)
This commit is contained in:
yabause 2009-04-08 21:59:35 +00:00
parent 29f0fab650
commit 9636e8a844
14 changed files with 131 additions and 76 deletions

View File

@ -4205,7 +4205,7 @@ void FASTCALL MMU_write8(u32 proc, u32 adr, u8 val)
} }
void mmu_select_savetype(int type, int *bmemtype, u32 *bmemsize) { void mmu_select_savetype(int type, int *bmemtype, u32 *bmemsize) {
if (type<0 || type > 5) return; if (type<0 || type > 6) return;
*bmemtype=save_types[type][0]; *bmemtype=save_types[type][0];
*bmemsize=save_types[type][1]; *bmemsize=save_types[type][1];
mc_realloc(&MMU.bupmem, *bmemtype, *bmemsize); mc_realloc(&MMU.bupmem, *bmemtype, *bmemsize);

View File

@ -702,8 +702,6 @@ static void OGLRender()
xglDepthMask(GL_TRUE); xglDepthMask(GL_TRUE);
glViewport(gfx3d.viewport.x,gfx3d.viewport.y,gfx3d.viewport.width,gfx3d.viewport.height);
float clearColor[4] = { float clearColor[4] = {
((float)(gfx3d.clearColor&0x1F))/31.0f, ((float)(gfx3d.clearColor&0x1F))/31.0f,
((float)((gfx3d.clearColor>>5)&0x1F))/31.0f, ((float)((gfx3d.clearColor>>5)&0x1F))/31.0f,
@ -723,7 +721,7 @@ static void OGLRender()
//TODO - properly doublebuffer the display lists //TODO - properly doublebuffer the display lists
{ {
u32 lastTextureFormat = 0, lastTexturePalette = 0, lastPolyAttr = 0; u32 lastTextureFormat = 0, lastTexturePalette = 0, lastPolyAttr = 0, lastViewport = 0xFFFFFFFF;
// int lastProjIndex = -1; // int lastProjIndex = -1;
for(int i=0;i<gfx3d.polylist->count;i++) { for(int i=0;i<gfx3d.polylist->count;i++) {
@ -775,6 +773,15 @@ static void OGLRender()
glVertex4fv(vert->coord); glVertex4fv(vert->coord);
} }
glEnd();*/ glEnd();*/
if(lastViewport != poly->viewport)
{
VIEWPORT viewport;
viewport.decode(poly->viewport);
glViewport(viewport.x,viewport.y,viewport.width,viewport.height);
lastViewport = poly->viewport;
}
glBegin(GL_TRIANGLES); glBegin(GL_TRIANGLES);
for(int j = 1; j < (type-1); j++) for(int j = 1; j < (type-1); j++)

View File

@ -195,6 +195,8 @@ void * ZIPROMReaderInit(const char * filename)
{ {
char tmp1[1024]; char tmp1[1024];
char tmp2[1024]; char tmp2[1024];
memset(tmp1,0,sizeof(tmp1));
memset(tmp2,0,sizeof(tmp2));
strncpy(tmp1, filename, strlen(filename) - 4); strncpy(tmp1, filename, strlen(filename) - 4);
sprintf(tmp2, "%s/%s", tmp1, dirent->d_name); sprintf(tmp2, "%s/%s", tmp1, dirent->d_name);
return zzip_fopen(tmp2, "rb"); return zzip_fopen(tmp2, "rb");

View File

@ -3,7 +3,7 @@
yopyop156.ifrance.com yopyop156.ifrance.com
Copyright (C) 2006 Mic Copyright (C) 2006 Mic
Copyright (C) 2009 CrazyMax Copyright (C) 2009 CrazyMax
Copyright (C) 2009 DeSmuME team Copyright (C) 2009 DeSmuME team
This file is part of DeSmuME This file is part of DeSmuME

View File

@ -137,6 +137,7 @@ static CACHE_ALIGN float trans[4] = {0.0, 0.0, 0.0, 0.0};
static int transind = 0; static int transind = 0;
static CACHE_ALIGN float scale[4] = {0.0, 0.0, 0.0, 0.0}; static CACHE_ALIGN float scale[4] = {0.0, 0.0, 0.0, 0.0};
static int scaleind = 0; static int scaleind = 0;
static u32 viewport;
//various other registers //various other registers
static float _t=0, _s=0; static float _t=0, _s=0;
@ -295,17 +296,22 @@ void gfx3d_reset()
_s=0; _s=0;
last_t = 0; last_t = 0;
last_s = 0; last_s = 0;
viewport = 0xBFFF0000;
GFX_FIFOclear(); GFX_FIFOclear();
} }
void gfx3d_glViewPort(u32 v) void gfx3d_glViewPort(u32 v)
{ {
//zero: NHerve messed with this in mod2 and mod3, but im still not sure its perfect. need to research this. viewport = v;
gfx3d.viewport.x = (v&0xFF); }
gfx3d.viewport.y = (v&0xFF);
gfx3d.viewport.width = (((v>>16)&0xFF)+1)-(v&0xFF); void VIEWPORT::decode(u32 v)
gfx3d.viewport.height = ((v>>24)+1)-((v>>8)&0xFF); {
x = (v&0xFF);
y = std::min(191,(int)(((v>>8)&0xFF)));
width = (((v>>16)&0xFF)+1)-(v&0xFF);
height = ((v>>24)+1)-((v>>8)&0xFF);
} }
@ -731,6 +737,7 @@ static void SetVertex()
poly.polyAttr = polyAttr; poly.polyAttr = polyAttr;
poly.texParam = textureFormat; poly.texParam = textureFormat;
poly.texPalette = texturePalette; poly.texPalette = texturePalette;
poly.viewport = viewport;
polylist->count++; polylist->count++;
} }
} }
@ -2205,10 +2212,7 @@ SFORMAT SF_GFX3D[]={
{ "GSWB", 4, 1, &gfx3d.wbuffer}, { "GSWB", 4, 1, &gfx3d.wbuffer},
{ "GSSM", 4, 1, &gfx3d.sortmode}, { "GSSM", 4, 1, &gfx3d.sortmode},
{ "GSAR", 1, 1, &gfx3d.alphaTestRef}, { "GSAR", 1, 1, &gfx3d.alphaTestRef},
{ "GSVX", 4, 1, &gfx3d.viewport.x}, { "GSVP", 4, 1, &viewport},
{ "GSVY", 4, 1, &gfx3d.viewport.y},
{ "GSVW", 4, 1, &gfx3d.viewport.width},
{ "GSVH", 4, 1, &gfx3d.viewport.height},
{ "GSCC", 4, 1, &gfx3d.clearColor}, { "GSCC", 4, 1, &gfx3d.clearColor},
{ "GSCD", 4, 1, &gfx3d.clearDepth}, { "GSCD", 4, 1, &gfx3d.clearDepth},
{ "GSFC", 4, 4, gfx3d.fogColor}, { "GSFC", 4, 4, gfx3d.fogColor},

View File

@ -64,6 +64,7 @@ struct POLY {
u32 polyAttr, texParam, texPalette; //the hardware rendering params u32 polyAttr, texParam, texPalette; //the hardware rendering params
// int projIndex; //the index into the projlist that this poly uses // int projIndex; //the index into the projlist that this poly uses
u32 pad; u32 pad;
u32 viewport;
bool isTranslucent() bool isTranslucent()
{ {
@ -118,6 +119,12 @@ struct VERTLIST {
int count; int count;
}; };
struct VIEWPORT {
int x, y, width, height;
void decode(u32 v);
};
//used to communicate state to the renderer //used to communicate state to the renderer
struct GFX3D struct GFX3D
{ {
@ -153,13 +160,6 @@ struct GFX3D
u8 alphaTestRef; u8 alphaTestRef;
struct VIEWPORT {
VIEWPORT()
: x(0), y(0), width(256), height(256)
{}
int x, y, width, height;
} viewport;
u32 clearDepth; u32 clearDepth;
u32 clearColor; u32 clearColor;
float fogColor[4]; float fogColor[4];

View File

@ -1003,7 +1003,7 @@ static gboolean Stylus_Release(GtkWidget *w, GdkEventButton *e, gpointer data)
return TRUE; return TRUE;
} }
void loadgame(int num){ static void loadgame(int num){
if (desmume_running()) if (desmume_running())
{ {
Pause(); Pause();
@ -1014,7 +1014,7 @@ void loadgame(int num){
loadstate_slot(num); loadstate_slot(num);
} }
void savegame(int num){ static void savegame(int num){
if (desmume_running()) if (desmume_running())
{ {
Pause(); Pause();

View File

@ -760,12 +760,21 @@ static void drawscanline(edge_fx_fl *pLeft, edge_fx_fl *pRight)
//CONSIDER: in case some other math is wrong (shouldve been clipped OK), we might go out of bounds here. //CONSIDER: in case some other math is wrong (shouldve been clipped OK), we might go out of bounds here.
//better check the Y value. //better check the Y value.
//but, we think the math is always right if(pLeft->Y<0 || pLeft->Y>191) {
printf("rasterizer rendering at y=%d! oops!\n",pLeft->Y);
return;
}
int x = XStart;
while(width-- > 0) while(width-- > 0)
{ {
if(x<0 || x>255) {
printf("rasterizer rendering at x=%d! oops!\n",x);
}
pixel(adr,color[0],color[1],color[2],u,v,1.0f/invw,z); pixel(adr,color[0],color[1],color[2],u,v,1.0f/invw,z);
adr++; adr++;
x++;
invw += dinvw_dx; invw += dinvw_dx;
u += du_dx; u += du_dx;
@ -1173,6 +1182,8 @@ static void SoftRastRender()
clipPoly(&gfx3d.polylist->list[gfx3d.indexlist[i]]); clipPoly(&gfx3d.polylist->list[gfx3d.indexlist[i]]);
} }
//printf("%d %d %d %d\n",gfx3d.viewport.x,gfx3d.viewport.y,gfx3d.viewport.width,gfx3d.viewport.height);
//viewport transforms //viewport transforms
for(int i=0;i<clippedPolyCounter;i++) for(int i=0;i<clippedPolyCounter;i++)
{ {
@ -1199,10 +1210,15 @@ static void SoftRastRender()
vert.fcolor[2] /= vert.coord[3]; vert.fcolor[2] /= vert.coord[3];
//viewport transformation //viewport transformation
vert.coord[0] *= gfx3d.viewport.width; VIEWPORT viewport;
vert.coord[0] += gfx3d.viewport.x; viewport.decode(poly.poly->viewport);
vert.coord[1] *= gfx3d.viewport.height; vert.coord[0] *= viewport.width;
vert.coord[1] += gfx3d.viewport.y; vert.coord[0] += viewport.x;
vert.coord[1] *= viewport.height;
vert.coord[1] += viewport.y;
if(vert.coord[1]>192||vert.color[1]<0) {
int zzz=9;
}
vert.coord[1] = 192 - vert.coord[1]; vert.coord[1] = 192 - vert.coord[1];
} }
} }

View File

@ -1149,27 +1149,27 @@ int WIFI_SoftAP_Init(wifimac_t *wifi)
SoftAP_CRC32Table[i] = reflect(SoftAP_CRC32Table[i], 32); SoftAP_CRC32Table[i] = reflect(SoftAP_CRC32Table[i], 32);
} }
if(pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf) == -1) if(PCAP::pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf) == -1)
{ {
printf("SoftAP: PCAP error with pcap_findalldevs_ex(): %s\n", errbuf); printf("SoftAP: PCAP error with pcap_findalldevs_ex(): %s\n", errbuf);
return 0; return 0;
} }
wifi->SoftAP.bridge = pcap_open(WIFI_index_device(alldevs,CommonSettings.wifiBridgeAdapterNum)->name, PACKET_SIZE, 0, 1, NULL, errbuf); wifi->SoftAP.bridge = PCAP::pcap_open(WIFI_index_device(alldevs,CommonSettings.wifiBridgeAdapterNum)->name, PACKET_SIZE, 0, 1, NULL, errbuf);
if(wifi->SoftAP.bridge == NULL) if(wifi->SoftAP.bridge == NULL)
{ {
printf("SoftAP: PCAP error with pcap_open(): %s\n", errbuf); printf("SoftAP: PCAP error with pcap_open(): %s\n", errbuf);
return 0; return 0;
} }
pcap_freealldevs(alldevs); PCAP::pcap_freealldevs(alldevs);
return 1; return 1;
} }
void WIFI_SoftAP_Shutdown(wifimac_t *wifi) void WIFI_SoftAP_Shutdown(wifimac_t *wifi)
{ {
pcap_close(wifi->SoftAP.bridge); PCAP::pcap_close(wifi->SoftAP.bridge);
} }
void WIFI_SoftAP_RecvPacketFromDS(wifimac_t *wifi, u8 *packet, int len) void WIFI_SoftAP_RecvPacketFromDS(wifimac_t *wifi, u8 *packet, int len)
@ -1327,7 +1327,7 @@ void WIFI_SoftAP_RecvPacketFromDS(wifimac_t *wifi, u8 *packet, int len)
/* Checksum */ /* Checksum */
/* TODO ? */ /* TODO ? */
pcap_sendpacket(wifi->SoftAP.bridge, ethernetframe, eflen); PCAP::pcap_sendpacket(wifi->SoftAP.bridge, ethernetframe, eflen);
delete ethernetframe; delete ethernetframe;
} }

View File

@ -31,6 +31,7 @@
#include <winsock2.h> #include <winsock2.h>
#define socket_t SOCKET #define socket_t SOCKET
#define sockaddr_t SOCKADDR #define sockaddr_t SOCKADDR
#include "windriver.h"
#else #else
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
@ -51,8 +52,6 @@
#define PACKET_SIZE 65535 #define PACKET_SIZE 65535
#define _INC_STDIO #define _INC_STDIO
#include <pcap.h>
#include <remote-ext.h> //uh?
#define REG_WIFI_ID 0x000 #define REG_WIFI_ID 0x000
#define REG_WIFI_MODE 0x004 #define REG_WIFI_MODE 0x004

View File

@ -140,8 +140,8 @@
OmitFramePointers="true" OmitFramePointers="true"
EnableFiberSafeOptimizations="true" EnableFiberSafeOptimizations="true"
WholeProgramOptimization="true" WholeProgramOptimization="true"
AdditionalIncludeDirectories=".;..;.\zlib123;.\zziplib;" AdditionalIncludeDirectories=".;..;.\zlib123;.\zziplib;.\winpcap"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;HAVE_LIBZ;HAVE_LIBZZIP;BETA_VERSION;SPU_INTERPOLATE;NOMINMAX;NDEBUG" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;HAVE_LIBZ;HAVE_LIBZZIP;BETA_VERSION;SPU_INTERPOLATE;NOMINMAX;NDEBUG;EXPERIMENTAL_WIFI"
StringPooling="true" StringPooling="true"
ExceptionHandling="1" ExceptionHandling="1"
BufferSecurityCheck="false" BufferSecurityCheck="false"
@ -163,7 +163,7 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="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="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).exe" OutputFile="$(OutDir)\$(ProjectName).exe"
AdditionalLibraryDirectories=".\zlib123;.\zziplib" AdditionalLibraryDirectories=".\zlib123;.\zziplib"
DelayLoadDLLs="wpcap.dll" DelayLoadDLLs="wpcap.dll"
@ -231,7 +231,7 @@
EnableFiberSafeOptimizations="true" EnableFiberSafeOptimizations="true"
WholeProgramOptimization="true" WholeProgramOptimization="true"
AdditionalIncludeDirectories=".;..;.\zlib123;.\zziplib;.\winpcap" AdditionalIncludeDirectories=".;..;.\zlib123;.\zziplib;.\winpcap"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;HAVE_LIBZ;HAVE_LIBZZIP;SSE2;BETA_VERSION;SPU_INTERPOLATE;NOMINMAX;NDEBUG" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;HAVE_LIBZ;HAVE_LIBZZIP;SSE2;BETA_VERSION;SPU_INTERPOLATE;NOMINMAX;NDEBUG;EXPERIMENTAL_WIFI"
StringPooling="true" StringPooling="true"
ExceptionHandling="1" ExceptionHandling="1"
StructMemberAlignment="0" StructMemberAlignment="0"
@ -317,8 +317,8 @@
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".;..;.\zlib123;.\zziplib;" AdditionalIncludeDirectories=".;..;.\zlib123;.\zziplib;.\winpcap"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;HAVE_LIBZ;HAVE_LIBZZIP;SPU_INTERPOLATE;NOMINMAX;NDEBUG;RELEASE" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;HAVE_LIBZ;HAVE_LIBZZIP;SPU_INTERPOLATE;NOMINMAX;NDEBUG;RELEASE;EXPERIMENTAL_WIFI"
/> />
<Tool <Tool
Name="VCManagedResourceCompilerTool" Name="VCManagedResourceCompilerTool"
@ -331,7 +331,8 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="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="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"
AdditionalLibraryDirectories=".\zlib123;.\zziplib"
DelayLoadDLLs="wpcap.dll" DelayLoadDLLs="wpcap.dll"
/> />
<Tool <Tool
@ -394,8 +395,8 @@
OmitFramePointers="true" OmitFramePointers="true"
EnableFiberSafeOptimizations="true" EnableFiberSafeOptimizations="true"
WholeProgramOptimization="true" WholeProgramOptimization="true"
AdditionalIncludeDirectories=".;..;.\zlib123;.\zziplib;" AdditionalIncludeDirectories=".;..;.\zlib123;.\zziplib;.\winpcap"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;HAVE_LIBZ;HAVE_LIBZZIP;SSE2;SPU_INTERPOLATE;NOMINMAX;NDEBUG;RELEASE" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;HAVE_LIBZ;HAVE_LIBZZIP;SSE2;SPU_INTERPOLATE;NOMINMAX;NDEBUG;RELEASE;EXPERIMENTAL_WIFI"
StringPooling="true" StringPooling="true"
ExceptionHandling="1" ExceptionHandling="1"
StructMemberAlignment="0" StructMemberAlignment="0"
@ -420,7 +421,7 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="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="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" DelayLoadDLLs="wpcap.dll"
@ -790,33 +791,27 @@
RelativePath="..\matrix_sse2-x64.asm" RelativePath="..\matrix_sse2-x64.asm"
> >
<FileConfiguration <FileConfiguration
Name="Debug|Win32" Name="Interim|Win32"
ExcludedFromBuild="true" ExcludedFromBuild="true"
> >
<Tool <Tool
Name="MASM" Name="MASM"
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration
Name="Interim|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling..."
CommandLine="ml64 /nologo /c /Zi /Fo&quot;$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="$(IntDir)\$(InputName).obj"
/>
</FileConfiguration>
<FileConfiguration <FileConfiguration
Name="Interim SSE2|Win32" Name="Interim SSE2|Win32"
ExcludedFromBuild="true" ExcludedFromBuild="true"
> >
<Tool <Tool
Name="VCCustomBuildTool" Name="MASM"
Description="Assembling..." />
CommandLine="ml64 /nologo /c /Zi /Fo&quot;$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;" </FileConfiguration>
Outputs="$(IntDir)\$(InputName).obj" <FileConfiguration
Name="Release (public)|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="MASM"
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration <FileConfiguration
@ -824,10 +819,7 @@
ExcludedFromBuild="true" ExcludedFromBuild="true"
> >
<Tool <Tool
Name="VCCustomBuildTool" Name="MASM"
Description="Assembling..."
CommandLine="ml64 /nologo /c /Zi /Fo&quot;$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="$(IntDir)\$(InputName).obj"
/> />
</FileConfiguration> </FileConfiguration>
</File> </File>
@ -850,6 +842,14 @@
Name="MASM" Name="MASM"
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration
Name="Release (public)|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="MASM"
/>
</FileConfiguration>
</File> </File>
</Filter> </Filter>
<Filter <Filter

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="shift_jis"?> <?xml version="1.0" encoding="shift_jis"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="9,00" Version="9.00"
Name="DeSmuME_VS2008" Name="DeSmuME_VS2008"
ProjectGUID="{9F5F72A1-D3A5-4918-B460-E076B16D10A9}" ProjectGUID="{9F5F72A1-D3A5-4918-B460-E076B16D10A9}"
RootNamespace="DeSmuME" RootNamespace="DeSmuME"
@ -140,7 +140,7 @@
EnableFiberSafeOptimizations="true" EnableFiberSafeOptimizations="true"
WholeProgramOptimization="true" WholeProgramOptimization="true"
AdditionalIncludeDirectories=".;..;.\zlib123;.\zziplib;.\winpcap" AdditionalIncludeDirectories=".;..;.\zlib123;.\zziplib;.\winpcap"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;HAVE_LIBZ;HAVE_LIBZZIP;SSE2;BETA_VERSION;SPU_INTERPOLATE;NOMINMAX" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;HAVE_LIBZ;HAVE_LIBZZIP;SSE2;BETA_VERSION;SPU_INTERPOLATE;NOMINMAX;EXPERIMENTAL_WIFI"
StringPooling="true" StringPooling="true"
ExceptionHandling="1" ExceptionHandling="1"
StructMemberAlignment="0" StructMemberAlignment="0"
@ -231,7 +231,7 @@
EnableFiberSafeOptimizations="true" EnableFiberSafeOptimizations="true"
WholeProgramOptimization="true" WholeProgramOptimization="true"
AdditionalIncludeDirectories=".;..;.\zlib123;.\zziplib;.\winpcap" AdditionalIncludeDirectories=".;..;.\zlib123;.\zziplib;.\winpcap"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;HAVE_LIBZ;HAVE_LIBZZIP;BETA_VERSION;SPU_INTERPOLATE;NOMINMAX" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;HAVE_LIBZ;HAVE_LIBZZIP;BETA_VERSION;SPU_INTERPOLATE;NOMINMAX;EXPERIMENTAL_WIFI"
StringPooling="true" StringPooling="true"
ExceptionHandling="1" ExceptionHandling="1"
BufferSecurityCheck="false" BufferSecurityCheck="false"
@ -321,7 +321,7 @@
EnableFiberSafeOptimizations="true" EnableFiberSafeOptimizations="true"
WholeProgramOptimization="true" WholeProgramOptimization="true"
AdditionalIncludeDirectories=".;..;.\zlib123;.\zziplib;.\winpcap" AdditionalIncludeDirectories=".;..;.\zlib123;.\zziplib;.\winpcap"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;HAVE_LIBZ;HAVE_LIBZZIP;SPU_INTERPOLATE;NOMINMAX;RELEASE" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;HAVE_LIBZ;HAVE_LIBZZIP;SPU_INTERPOLATE;NOMINMAX;RELEASE;EXPERIMENTAL_WIFI"
StringPooling="true" StringPooling="true"
ExceptionHandling="1" ExceptionHandling="1"
BufferSecurityCheck="false" BufferSecurityCheck="false"
@ -411,7 +411,7 @@
EnableFiberSafeOptimizations="true" EnableFiberSafeOptimizations="true"
WholeProgramOptimization="true" WholeProgramOptimization="true"
AdditionalIncludeDirectories=".;..;.\zlib123;.\zziplib;.\winpcap" AdditionalIncludeDirectories=".;..;.\zlib123;.\zziplib;.\winpcap"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;HAVE_LIBZ;HAVE_LIBZZIP;SSE2;SPU_INTERPOLATE;NOMINMAX;RELEASE" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;HAVE_LIBZ;HAVE_LIBZZIP;SSE2;SPU_INTERPOLATE;NOMINMAX;RELEASE;EXPERIMENTAL_WIFI"
StringPooling="true" StringPooling="true"
ExceptionHandling="1" ExceptionHandling="1"
StructMemberAlignment="0" StructMemberAlignment="0"

View File

@ -34,9 +34,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include <vector> #include <vector>
#include <sstream> #include <sstream>
#include <tchar.h> #include <tchar.h>
#ifdef EXPERIMENTAL_WIFI
#include <pcap.h>
#endif
#include "CWindow.h" #include "CWindow.h"
#include "../MMU.h" #include "../MMU.h"
#include "../armcpu.h" #include "../armcpu.h"
@ -1587,6 +1584,7 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
MainWindow->checkMenu(IDC_SAVETYPE4, MF_BYCOMMAND | MF_UNCHECKED); MainWindow->checkMenu(IDC_SAVETYPE4, MF_BYCOMMAND | MF_UNCHECKED);
MainWindow->checkMenu(IDC_SAVETYPE5, MF_BYCOMMAND | MF_UNCHECKED); MainWindow->checkMenu(IDC_SAVETYPE5, MF_BYCOMMAND | MF_UNCHECKED);
MainWindow->checkMenu(IDC_SAVETYPE6, MF_BYCOMMAND | MF_UNCHECKED); MainWindow->checkMenu(IDC_SAVETYPE6, MF_BYCOMMAND | MF_UNCHECKED);
MainWindow->checkMenu(IDC_SAVETYPE7, MF_BYCOMMAND | MF_UNCHECKED);
MainWindow->Show(SW_NORMAL); MainWindow->Show(SW_NORMAL);
run(); run();
@ -2148,9 +2146,20 @@ void RunConfig(CONFIGSCREEN which)
break; break;
case CONFIGSCREEN_EMULATION: case CONFIGSCREEN_EMULATION:
DialogBox(hAppInst, MAKEINTRESOURCE(IDD_EMULATIONSETTINGS), hwnd, (DLGPROC)EmulationSettingsDlgProc); DialogBox(hAppInst, MAKEINTRESOURCE(IDD_EMULATIONSETTINGS), hwnd, (DLGPROC)EmulationSettingsDlgProc);
break; break;
case CONFIGSCREEN_WIFI: case CONFIGSCREEN_WIFI:
DialogBox(hAppInst,MAKEINTRESOURCE(IDD_WIFISETTINGS), hwnd, (DLGPROC) WifiSettingsDlgProc); #ifdef EXPERIMENTAL_WIFI
if(wifiMac.netEnabled)
{
DialogBox(hAppInst,MAKEINTRESOURCE(IDD_WIFISETTINGS), hwnd, (DLGPROC) WifiSettingsDlgProc);
}
else
{
#endif
MessageBox(MainWindow->getHWnd(),"winpcap failed to initialize, and so wifi cannot be configured.","wifi system failure",0);
#ifdef EXPERIMENTAL_WIFI
}
#endif
break; break;
} }
@ -3287,7 +3296,7 @@ LRESULT CALLBACK WifiSettingsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
int i; int i;
HWND cur; HWND cur;
if(pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf) == -1) if(PCAP::pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf) == -1)
{ {
EndDialog(hDlg, TRUE); EndDialog(hDlg, TRUE);
return TRUE; return TRUE;

View File

@ -5,6 +5,24 @@
#include "../common.h" #include "../common.h"
#include "CWindow.h" #include "CWindow.h"
#ifdef EXPERIMENTAL_WIFI
#include <pcap.h>
#include <remote-ext.h> //uh?
//because the pcap headers are written poorly, we need to declare these as cdecl
//this may cause the code to fail to compile on non-windows platforms;
//we may have to use a macro to call these functions which chooses whether to call them
//through the namespace
namespace PCAP {
extern "C" __declspec(dllexport) int __cdecl pcap_findalldevs_ex(char *source, struct pcap_rmtauth *auth, pcap_if_t **alldevs, char *errbuf);
extern "C" __declspec(dllexport) int __cdecl pcap_sendpacket(pcap_t *, const u_char *, int);
extern "C" __declspec(dllexport) void __cdecl pcap_close(pcap_t *);
extern "C" __declspec(dllexport) pcap_t* __cdecl pcap_open(const char *source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth *auth, char *errbuf);
extern "C" __declspec(dllexport) void __cdecl pcap_freealldevs(pcap_if_t *);
}
#endif
extern WINCLASS *MainWindow; extern WINCLASS *MainWindow;
class Lock { class Lock {