diff --git a/VBA.suo b/VBA.suo index 8a28adcf..b5cff28b 100644 Binary files a/VBA.suo and b/VBA.suo differ diff --git a/VBA.vcproj b/VBA.vcproj index 4a45c764..e790f475 100644 --- a/VBA.vcproj +++ b/VBA.vcproj @@ -83,11 +83,12 @@ /> @@ -514,6 +517,7 @@ > @@ -523,6 +527,7 @@ > @@ -536,6 +541,7 @@ > @@ -545,6 +551,7 @@ > @@ -554,14 +561,79 @@ > + + + + + + + + + + + + + + + + + + + + =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){ diff --git a/src/hq3x32.cpp b/src/hq3x32.cpp index 4b05eff1..492225b1 100644 --- a/src/hq3x32.cpp +++ b/src/hq3x32.cpp @@ -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 - 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 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)); +} diff --git a/src/win32/AccelEditor.cpp b/src/win32/AccelEditor.cpp index 19076e95..0747e26e 100644 --- a/src/win32/AccelEditor.cpp +++ b/src/win32/AccelEditor.cpp @@ -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); diff --git a/src/win32/UniVideoModeDlg.cpp b/src/win32/UniVideoModeDlg.cpp index a7ba3569..9dc521d0 100644 --- a/src/win32/UniVideoModeDlg.cpp +++ b/src/win32/UniVideoModeDlg.cpp @@ -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(); } diff --git a/src/win32/VBA.cpp b/src/win32/VBA.cpp index 109e4aea..9ab16c22 100644 --- a/src/win32/VBA.cpp +++ b/src/win32/VBA.cpp @@ -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; } }