fix new savestate bug, wifi warning, and scanlines 2x filter

This commit is contained in:
zeromus 2009-08-10 03:01:49 +00:00
parent 88f0549e85
commit a39c62b129
3 changed files with 44 additions and 9 deletions

View File

@ -2454,7 +2454,7 @@ void gfx3d_savestate(std::ostream* os)
for(int i=0;i<4;i++)
{
OSWRITE(mtxStack[i].position);
for(int j=0;j<mtxStack[i].size*16+16;j++)
for(int j=0;j<mtxStack[i].size*16;j++)
OSWRITE(mtxStack[i].matrix[j]);
}
}
@ -2493,7 +2493,7 @@ bool gfx3d_loadstate(std::istream* is, int size)
for(int i=0;i<4;i++)
{
OSREAD(mtxStack[i].position);
for(int j=0;j<mtxStack[i].size*16+16;j++)
for(int j=0;j<mtxStack[i].size*16;j++)
OSREAD(mtxStack[i].matrix[j]);
}
}

View File

@ -1362,8 +1362,6 @@ static pcap_if_t * WIFI_index_device(pcap_if_t *alldevs, int index) {
bool SoftAP_Init()
{
char errbuf[PCAP_ERRBUF_SIZE];
pcap_if_t *alldevs;
wifiMac.SoftAP.usecCounter = 0;
@ -1372,6 +1370,9 @@ bool SoftAP_Init()
wifiMac.SoftAP.curPacketSending = FALSE;
#if 0
char errbuf[PCAP_ERRBUF_SIZE];
pcap_if_t *alldevs;
if(wifi_netEnabled)
{
if(desmume_pcap_findalldevs(&alldevs, errbuf) == -1)

View File

@ -27,6 +27,7 @@ typedef u64 uint64;
extern CACHE_ALIGN u16 fadeOutColors[17][0x8000];
extern int scanline_filter_a, scanline_filter_b;
static int fac_a, fac_b;
FORCEINLINE void ScanLine16( uint16 *lpDst, uint16 *lpSrc, unsigned int Width){
while(Width--){
@ -42,6 +43,38 @@ FORCEINLINE void ScanLine16_2( uint16 *lpDst, uint16 *lpSrc, unsigned int Width)
}
}
FORCEINLINE void ScanLine32( uint32 *lpDst, uint32 *lpSrc, unsigned int Width){
while(Width--){
*lpDst++ = *lpSrc;
u8* u8dst = (u8*)lpDst;
u8* u8src = (u8*)lpSrc;
*u8dst++ = *u8src++ * fac_a / 16;
*u8dst++ = *u8src++ * fac_a / 16;
*u8dst++ = *u8src++ * fac_a / 16;
lpDst++;
lpSrc++;
}
}
FORCEINLINE void ScanLine32_2( uint32 *lpDst, uint32 *lpSrc, unsigned int Width){
while(Width--){
u8* u8dst = (u8*)lpDst;
u8* u8src = (u8*)lpSrc;
*u8dst++ = *u8src++ * fac_a / 16;
*u8dst++ = *u8src++ * fac_a / 16;
*u8dst++ = *u8src++ * fac_a / 16;
u8dst++;
u8src = (u8*)lpSrc;
*u8dst++ = *u8src++ * fac_b / 16;
*u8dst++ = *u8src++ * fac_b / 16;
*u8dst++ = *u8src++ * fac_b / 16;
u8dst++; u8src++;
lpDst+=2;
lpSrc++;
}
}
FORCEINLINE void DoubleLine32( uint32 *lpDst, uint32 *lpSrc, unsigned int Width){
while(Width--){
*lpDst++ = *lpSrc;
@ -51,19 +84,20 @@ FORCEINLINE void DoubleLine32( uint32 *lpDst, uint32 *lpSrc, unsigned int Width)
void RenderScanline( SSurface Src, SSurface Dst)
{
uint16 *lpSrc;
fac_a = (16-scanline_filter_a);
fac_b = (16-scanline_filter_b);
unsigned int H;
const uint32 srcHeight = Src.Height;
const unsigned int srcPitch = Src.Pitch >> 1;
lpSrc = reinterpret_cast<uint16 *>(Src.Surface);
u32* lpSrc = (u32*)Src.Surface;
const unsigned int dstPitch = Dst.Pitch >> 1;
uint16 *lpDst = (uint16*)Dst.Surface;
u32 *lpDst = (u32*)Dst.Surface;
for (H = 0; H < srcHeight; H++, lpSrc += srcPitch)
ScanLine16 (lpDst, lpSrc, Src.Width), lpDst += dstPitch,
ScanLine16_2 (lpDst, lpSrc, Src.Width), lpDst += dstPitch;
ScanLine32 (lpDst, lpSrc, Src.Width), lpDst += dstPitch,
ScanLine32_2 (lpDst, lpSrc, Src.Width), lpDst += dstPitch;
//memset (lpDst, 0, 512*2), lpDst += dstPitch;
}