Fixed debug mode compiler build errors in vcproj.

AccelEditor and UniVideoModeDlg had some trivial scope problems that strangely compile in release mode but don't in debug mode.

Network code was crashing in Link.cpp.  Added check for null linkmem pointer to allow the code to run but need to investigate why linkmem is not initialized.
This commit is contained in:
DJRobX 2007-10-31 00:23:38 +00:00
parent aa6af2e669
commit bd4c955c63
7 changed files with 148 additions and 42 deletions

BIN
VBA.suo

Binary file not shown.

View File

@ -83,11 +83,12 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="nafxcwd.lib LIBCMTD.lib Vfw32.Lib OpenGL32.Lib dinput8.lib dxguid.lib ddraw.lib d3dx9.lib Dsound.lib"
AdditionalDependencies="nafxcwd.lib LIBCMTD.lib Vfw32.Lib OpenGL32.Lib dinput8.lib dxguid.lib ddraw.lib winmm.lib d3dx9.lib Dsound.lib"
OutputFile="$(ProjectDir)VisualBoyAdvance.exe"
Version=""
LinkIncremental="2"
AdditionalLibraryDirectories=""
GenerateManifest="false"
IgnoreDefaultLibraryNames="nafxcwd.lib;LIBCMTD.lib"
GenerateDebugInformation="true"
SubSystem="2"
@ -356,13 +357,14 @@
Name="VCLinkerTool"
RegisterOutput="false"
IgnoreImportLibrary="false"
AdditionalDependencies="nafxcw.lib LIBCMT.lib Vfw32.Lib OpenGL32.Lib dinput8.lib dxguid.lib ddraw.lib d3dx9.lib Dsound.lib"
AdditionalDependencies="nafxcw.lib LIBCMT.lib Vfw32.Lib OpenGL32.Lib dinput8.lib dxguid.lib ddraw.lib d3dx9.lib Dsound.lib winmm.lib"
ShowProgress="0"
OutputFile="$(ProjectDir)VisualBoyAdvance.exe"
Version=""
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""
GenerateManifest="false"
IgnoreAllDefaultLibraries="false"
IgnoreDefaultLibraryNames="nafxcw.lib;LIBCMT.lib"
GenerateDebugInformation="false"
@ -505,6 +507,7 @@
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -O1 -f win32 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
@ -514,6 +517,7 @@
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -O1 -f win32 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
@ -523,6 +527,7 @@
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -O1 -f win32 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
@ -536,6 +541,7 @@
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -O1 -f win32 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
@ -545,6 +551,7 @@
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -O1 -f win32 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
@ -554,14 +561,79 @@
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -O1 -f win32 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq4x.cpp"
RelativePath=".\src\hq4x_16.asm"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -O1 -f win32 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -O1 -f win32 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Optimized|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -O1 -f win32 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq4x_32.asm"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -O1 -f win32 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -O1 -f win32 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Optimized|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -O1 -f win32 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq_shared32.cpp"

View File

@ -245,8 +245,8 @@ void LinkUpdate(int ticks){
}
return;
}
if(linkid&&!transfer&&linktime>=linkmem->lastlinktime&&linkmem->numtransfers){
// ** CRASH ** linkmem is NULL, todo investigate why, added null check
if(linkid&&!transfer&&linkmem&&linktime>=linkmem->lastlinktime&&linkmem->numtransfers){
linkmem->linkdata[linkid] = READ16LE(&ioMem[0x12a]);
if(linkmem->numtransfers==1){

View File

@ -25,6 +25,9 @@ extern "C"
{
void hq3x_16(unsigned char*, unsigned char*, DWORD, DWORD, DWORD, DWORD);
void hq3x_32(unsigned char*, unsigned char*, DWORD, DWORD, DWORD, DWORD);
void hq4x_16(unsigned char*, unsigned char*, DWORD, DWORD, DWORD, DWORD);
void hq4x_32(unsigned char*, unsigned char*, DWORD, DWORD, DWORD, DWORD);
unsigned int LUT16to32[65536];
unsigned int RGBtoYUV[65536];
}
@ -64,8 +67,6 @@ int InitLUTs(void)
int hq3xinited=0;
#include <stdio.h>
void hq3x32(unsigned char * pIn, unsigned int srcPitch,
unsigned char *,
unsigned char * pOut, unsigned int dstPitch,
@ -80,7 +81,6 @@ void hq3x32(unsigned char * pIn, unsigned int srcPitch,
}
hq3x_32( pIn, pOut, Xres, Yres, dstPitch, srcPitch - (Xres *2) );
}
#include <stdio.h>
void hq3x16(unsigned char * pIn, unsigned int srcPitch,
unsigned char *,
@ -94,3 +94,32 @@ void hq3x16(unsigned char * pIn, unsigned int srcPitch,
}
hq3x_16( pIn, pOut, Xres, Yres, dstPitch, srcPitch - (Xres *2));
}
void hq4x16(unsigned char * pIn, unsigned int srcPitch,
unsigned char *,
unsigned char * pOut, unsigned int dstPitch,
int Xres, int Yres)
{
if (!hq3xinited)
{
InitLUTs();
hq3xinited=1;
}
hq4x_16( pIn, pOut, Xres, Yres, dstPitch, srcPitch - (Xres *2));
}
void hq4x32(unsigned char * pIn, unsigned int srcPitch,
unsigned char *,
unsigned char * pOut, unsigned int dstPitch,
int Xres, int Yres)
{
// NOTICE! This driver wants 16 bit, not 32 bit input!
if (!hq3xinited)
{
InitLUTs();
hq3xinited=1;
}
hq4x_32( pIn, pOut, Xres, Yres, dstPitch, srcPitch - (Xres *2));
}

View File

@ -180,12 +180,13 @@ void AccelEditor::OnAssign()
WORD wKey;
bool bCtrl, bAlt, bShift;
int index;
if (!m_key.GetAccelKey(wKey, bCtrl, bAlt, bShift))
return; // no valid key, abort
int count = m_commands.GetCount();
for (int index = 0; index < count; index++) {
for (index = 0; index < count; index++) {
wIDCommand = LOWORD(m_commands.GetItemData(index));
mgr.m_mapAccelTable.Lookup(wIDCommand, pCmdAccel);

View File

@ -18,8 +18,8 @@ UniVideoModeDlg::UniVideoModeDlg(CWnd* pParent /*=NULL*/, int *width, int *heigh
SelectedHeight = height;
SelectedBPP = BPP;
SelectedFreq = freq;
SelectedAdapter = adapt;
pD3D = NULL;
SelectedAdapter = adapt;
pD3D = NULL;
d3dDLL = NULL;
nAdapters = 1;
}
@ -89,7 +89,8 @@ BOOL UniVideoModeDlg::OnInitDialog()
dm.dmSize = sizeof(DEVMODE);
dm.dmDriverExtra = 0;
DWORD maxMode;
for (DWORD i=0; 0 != EnumDisplaySettings(dd.DeviceName, i, &dm); i++) {}
DWORD i;
for (i=0; 0 != EnumDisplaySettings(dd.DeviceName, i, &dm); i++) {}
maxMode = i-1;
listmodes->InitStorage(i, 25);
if (WidthList!=0) delete [] WidthList;
@ -122,19 +123,19 @@ BOOL UniVideoModeDlg::OnInitDialog()
case DIRECT_DRAW:
apiname->SetWindowText("DirectDraw 7");
break;
case DIRECT_3D:
case DIRECT_3D:
apiname->SetWindowText("Direct3D 9");
// Load DirectX DLL
d3dDLL = LoadLibrary("D3D9.DLL");
LPDIRECT3D9 (WINAPI *D3DCreate)(UINT);
D3DCreate = (LPDIRECT3D9 (WINAPI *)(UINT))
GetProcAddress(d3dDLL, "Direct3DCreate9");
// Load DirectX DLL
d3dDLL = LoadLibrary("D3D9.DLL");
LPDIRECT3D9 (WINAPI *D3DCreate)(UINT);
D3DCreate = (LPDIRECT3D9 (WINAPI *)(UINT))
GetProcAddress(d3dDLL, "Direct3DCreate9");
pD3D = D3DCreate(D3D_SDK_VERSION);
nAdapters = pD3D->GetAdapterCount();
D3DADAPTER_IDENTIFIER9 id;
pD3D->GetAdapterIdentifier(iDisplayDevice, 0, &id);
pD3D->GetAdapterIdentifier(iDisplayDevice, 0, &id);
devicename->SetWindowText(id.Description);
D3DDISPLAYMODE d3ddm;
@ -186,15 +187,15 @@ BOOL UniVideoModeDlg::OnInitDialog()
BPPList[i+nModes16] = b;
FreqList[i+nModes16] = f;
}
// Clean up
pD3D->Release();
pD3D = NULL;
if(d3dDLL != NULL)
{
FreeLibrary(d3dDLL);
d3dDLL = NULL;
}
// Clean up
pD3D->Release();
pD3D = NULL;
if(d3dDLL != NULL)
{
FreeLibrary(d3dDLL);
d3dDLL = NULL;
}
break;
@ -244,9 +245,9 @@ void UniVideoModeDlg::OnStnClickedDisplaydevice()
case DIRECT_DRAW:
break;
break;
case DIRECT_3D:
iDisplayDevice++;
if (iDisplayDevice == nAdapters) iDisplayDevice = 0;
@ -262,17 +263,17 @@ void UniVideoModeDlg::OnStnClickedDisplaydevice()
}
void UniVideoModeDlg::OnBnClickedButtonMaxscale()
{
MaxScale dlg;
theApp.winCheckFullscreen();
{
MaxScale dlg;
theApp.winCheckFullscreen();
dlg.DoModal();
}
void UniVideoModeDlg::OnBnClickedCheckStretchtofit()
{
theApp.fullScreenStretch = !theApp.fullScreenStretch;
theApp.updateWindowSize(theApp.videoOption);
if(theApp.display)
theApp.fullScreenStretch = !theApp.fullScreenStretch;
theApp.updateWindowSize(theApp.videoOption);
if(theApp.display)
theApp.display->clear();
this->SetFocus();
}

View File

@ -85,6 +85,8 @@ extern void Simple4x32(u8*,u32,u8*,u8*,u32,int,int);
extern void hq3x32(u8*,u32,u8*,u8*,u32,int,int);
extern void hq3x16(u8*,u32,u8*,u8*,u32,int,int);
extern void hq4x32(u8*,u32,u8*,u8*,u32,int,int);
extern void hq4x16(u8*,u32,u8*,u8*,u32,int,int);
extern void SmartIB(u8*,u32,int,int);
extern void SmartIB32(u8*,u32,int,int);
@ -699,7 +701,7 @@ void VBA::updateFilter()
filterMagnification = 3;
break;
case FILTER_HQ4X:
//filterFunction = lq2x;
filterFunction = hq4x16;
filterMagnification = 4;
break;
}
@ -776,8 +778,9 @@ void VBA::updateFilter()
b16to32Video=true;
break;
case FILTER_HQ4X:
//filterFunction = lq2x;
filterFunction = hq4x32;
filterMagnification = 4;
b16to32Video=true;
break;
}
}