diff --git a/getset.h b/getset.h index 6d2b6459..62240efb 100644 --- a/getset.h +++ b/getset.h @@ -266,6 +266,7 @@ inline uint8 S9xGetByte (uint32 Address) inline uint16 S9xGetWord (uint32 Address, enum s9xwrap_t w = WRAP_NONE) { + uint16 ret; uint32 mask = MEMMAP_MASK & (w == WRAP_PAGE ? 0xff : (w == WRAP_BANK ? 0xffff : 0xffffff)); if ((Address & mask) == mask) { @@ -309,7 +310,8 @@ inline uint16 S9xGetWord (uint32 Address, enum s9xwrap_t w = WRAP_NONE) switch ((pint) GetAddress) { case CMemory::MAP_CPU: - return (S9xGetCPU(Address & 0xffff) | (S9xGetCPU((Address + 1) & 0xffff) << 8)); + ret = S9xGetCPU(Address & 0xffff); + return (ret | (S9xGetCPU((Address + 1) & 0xffff) << 8)); case CMemory::MAP_PPU: if (CPU.InDMAorHDMA) @@ -317,8 +319,9 @@ inline uint16 S9xGetWord (uint32 Address, enum s9xwrap_t w = WRAP_NONE) OpenBus = S9xGetByte(Address); return (OpenBus | (S9xGetByte(Address + 1) << 8)); } - - return (S9xGetPPU(Address & 0xffff) | (S9xGetPPU((Address + 1) & 0xffff) << 8)); + + ret = S9xGetPPU(Address & 0xffff); + return (ret | (S9xGetPPU((Address + 1) & 0xffff) << 8)); case CMemory::MAP_LOROM_SRAM: case CMemory::MAP_SA1RAM: @@ -347,28 +350,36 @@ inline uint16 S9xGetWord (uint32 Address, enum s9xwrap_t w = WRAP_NONE) return (READ_WORD(Memory.BWRAM + ((Address & 0x7fff) - 0x6000))); case CMemory::MAP_DSP: - return (S9xGetDSP(Address & 0xffff) | (S9xGetDSP((Address + 1) & 0xffff) << 8)); + ret = S9xGetDSP(Address & 0xffff); + return (ret | (S9xGetDSP((Address + 1) & 0xffff) << 8)); case CMemory::MAP_SPC7110_ROM: - return (S9xGetSPC7110Byte(Address) | (S9xGetSPC7110Byte(Address + 1) << 8)); + ret = S9xGetSPC7110Byte(Address); + return (ret | (S9xGetSPC7110Byte(Address + 1) << 8)); case CMemory::MAP_SPC7110_DRAM: - return (S9xGetSPC7110(0x4800) | (S9xGetSPC7110(0x4800) << 8)); + ret = S9xGetSPC7110(0x4800); + return (ret | (S9xGetSPC7110(0x4800) << 8)); case CMemory::MAP_C4: - return (S9xGetC4(Address & 0xffff) | (S9xGetC4((Address + 1) & 0xffff) << 8)); + ret = S9xGetC4(Address & 0xffff); + return (ret | (S9xGetC4((Address + 1) & 0xffff) << 8)); case CMemory::MAP_OBC_RAM: - return (S9xGetOBC1(Address & 0xffff) | (S9xGetOBC1((Address + 1) & 0xffff) << 8)); + ret = S9xGetOBC1(Address & 0xffff); + return (ret | (S9xGetOBC1((Address + 1) & 0xffff) << 8)); case CMemory::MAP_SETA_DSP: - return (S9xGetSetaDSP(Address) | (S9xGetSetaDSP(Address + 1) << 8)); + ret = S9xGetSetaDSP(Address); + return (ret | (S9xGetSetaDSP(Address + 1) << 8)); case CMemory::MAP_SETA_RISC: - return (S9xGetST018(Address) | (S9xGetST018(Address + 1) << 8)); + ret = S9xGetST018(Address); + return (ret | (S9xGetST018(Address + 1) << 8)); case CMemory::MAP_BSX: - return (S9xGetBSX(Address) | (S9xGetBSX(Address + 1) << 8)); + ret = S9xGetBSX(Address); + return (ret | (S9xGetBSX(Address + 1) << 8)); case CMemory::MAP_NONE: default: diff --git a/port.h b/port.h index f6911329..823ef746 100644 --- a/port.h +++ b/port.h @@ -300,6 +300,8 @@ void _makepath (char *, const char *, const char *, const char *, const char *); #define strncasecmp strnicmp void WinDisplayStringFromBottom(const char *string, int linesFromBottom, int pixelsFromLeft, bool allowWrap); #define S9xDisplayString WinDisplayStringFromBottom +void SetInfoDlgColor(unsigned char, unsigned char, unsigned char); +#define SET_UI_COLOR(r,g,b) SetInfoDlgColor(r,g,b) #endif #ifdef __DJGPP diff --git a/win32/CDirect3D.cpp b/win32/CDirect3D.cpp index 546880e3..ae763b23 100644 --- a/win32/CDirect3D.cpp +++ b/win32/CDirect3D.cpp @@ -191,8 +191,6 @@ #include "../filter/hq2x.h" #include "../filter/2xsai.h" -#define RenderMethod ((Src.Height > SNES_HEIGHT_EXTENDED || Src.Width == 512) ? RenderMethodHiRes : RenderMethod) - #ifndef max #define max(a, b) (((a) > (b)) ? (a) : (b)) #endif @@ -345,7 +343,7 @@ void CDirect3D::Render(SSurface Src) ResetDevice(); return; default: - DXTRACE_ERR( TEXT("Internal driver error"), hr); + DXTRACE_ERR_MSGBOX( TEXT("Internal driver error"), hr); return; } } @@ -362,8 +360,8 @@ void CDirect3D::Render(SSurface Src) RenderMethod (Src, Dst, &dstRect); if(!Settings.AutoDisplayMessages) { - WinSetCustomDisplaySurface((void *)Dst.Surface, Dst.Pitch/2, dstRect.right-dstRect.left, dstRect.bottom-dstRect.top, GetFilterScale(GUI.Scale)); - S9xDisplayMessages ((uint16*)Dst.Surface, Dst.Pitch/2, dstRect.right-dstRect.left, dstRect.bottom-dstRect.top, GetFilterScale(GUI.Scale)); + WinSetCustomDisplaySurface((void *)Dst.Surface, Dst.Pitch/2, dstRect.right-dstRect.left, dstRect.bottom-dstRect.top, GetFilterScale(CurrentScale)); + S9xDisplayMessages ((uint16*)Dst.Surface, Dst.Pitch/2, dstRect.right-dstRect.left, dstRect.bottom-dstRect.top, GetFilterScale(CurrentScale)); } drawSurface->UnlockRect(0); diff --git a/win32/CDirectDraw.cpp b/win32/CDirectDraw.cpp index 271499ea..bde11f77 100644 --- a/win32/CDirectDraw.cpp +++ b/win32/CDirectDraw.cpp @@ -561,11 +561,11 @@ void CDirectDraw::Render(SSurface Src) if (!GUI.DepthConverted) { SSurface tmp; - static BYTE buf [256 * 239 * 4*3*3]; + static BYTE buf[SNES_WIDTH * sizeof(uint16) * SNES_HEIGHT_EXTENDED * sizeof(uint16) *4*4]; tmp.Surface = buf; - if(GUI.Scale == FILTER_NONE) { + if(CurrentScale == FILTER_NONE) { tmp.Pitch = Src.Pitch; tmp.Width = Src.Width; tmp.Height = Src.Height; @@ -583,8 +583,8 @@ void CDirectDraw::Render(SSurface Src) } if(!Settings.AutoDisplayMessages) { - WinSetCustomDisplaySurface((void *)Dst.Surface, (Dst.Pitch*8/GUI.ScreenDepth), srcRect.right-srcRect.left, srcRect.bottom-srcRect.top, GetFilterScale(GUI.Scale)); - S9xDisplayMessages ((uint16*)Dst.Surface, Dst.Pitch/2, srcRect.right-srcRect.left, srcRect.bottom-srcRect.top, GetFilterScale(GUI.Scale)); + WinSetCustomDisplaySurface((void *)Dst.Surface, (Dst.Pitch*8/GUI.ScreenDepth), srcRect.right-srcRect.left, srcRect.bottom-srcRect.top, GetFilterScale(CurrentScale)); + S9xDisplayMessages ((uint16*)Dst.Surface, Dst.Pitch/2, srcRect.right-srcRect.left, srcRect.bottom-srcRect.top, GetFilterScale(CurrentScale)); } RECT lastRect = SizeHistory [GUI.FlipCounter % GUI.NumFlipFrames]; diff --git a/win32/CDirectSound.cpp b/win32/CDirectSound.cpp index c0f1e547..8cccc6e0 100644 --- a/win32/CDirectSound.cpp +++ b/win32/CDirectSound.cpp @@ -202,7 +202,6 @@ CDirectSound::CDirectSound() bufferSize = 0; blockSamples = 0; hTimer = NULL; - hTimerQueue = NULL; } CDirectSound::~CDirectSound() @@ -268,12 +267,6 @@ opened DirectSound in exclusive mode."), } } - hTimerQueue = CreateTimerQueue(); - if(!hTimerQueue) { - DeInitDirectSound(); - return false; - } - return (initDone); } @@ -292,10 +285,6 @@ void CDirectSound::DeInitDirectSound() lpDS->Release (); lpDS = NULL; } - if(hTimerQueue) { - DeleteTimerQueueEx(hTimer,NULL); - hTimerQueue = NULL; - } } /* CDirectSound::InitSoundBuffer @@ -371,8 +360,7 @@ deinitializes the DirectSound/temp buffers and stops the mixing timer void CDirectSound::DeInitSoundBuffer() { if(hTimer) { - if(!DeleteTimerQueueTimer(hTimerQueue,hTimer,INVALID_HANDLE_VALUE)) - DeleteTimerQueueTimer(hTimerQueue,hTimer,INVALID_HANDLE_VALUE); + timeKillEvent(hTimer); hTimer = NULL; } if( lpDSB != NULL) @@ -428,8 +416,8 @@ bool CDirectSound::SetupSound() last_block = blockCount - 1; - - if(!CreateTimerQueueTimer(&hTimer,hTimerQueue,SoundTimerCallback,(void *)this,blockTime/2,blockTime/2,WT_EXECUTEINIOTHREAD)) { + hTimer = timeSetEvent (blockTime/2, blockTime/2, SoundTimerCallback, (DWORD_PTR)this, TIME_PERIODIC); + if(!hTimer) { DeInitSoundBuffer(); return false; } @@ -460,6 +448,8 @@ void CDirectSound::MixSound() HRESULT hResult; DWORD curr_block; + if(!initDone) + return; lpDSB->GetCurrentPosition (&play_pos, NULL); @@ -509,8 +499,9 @@ void CDirectSound::MixSound() /* CDirectSound::SoundTimerCallback Timer callback that tries to mix a new block. Called twice each block. */ -VOID CALLBACK CDirectSound::SoundTimerCallback(PVOID lpParameter,BOOLEAN TimerOrWaitFired) { - CDirectSound *S9xDirectSound = (CDirectSound *)lpParameter; + +VOID CALLBACK CDirectSound::SoundTimerCallback(UINT uTimerID, UINT uMsg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2) { + CDirectSound *S9xDirectSound = (CDirectSound *)dwUser; S9xDirectSound->MixSound(); } diff --git a/win32/CDirectSound.h b/win32/CDirectSound.h index 0ad11f2d..e5f89f01 100644 --- a/win32/CDirectSound.h +++ b/win32/CDirectSound.h @@ -206,10 +206,7 @@ private: DWORD last_block; // the last block that was mixed bool initDone; // has init been called successfully? - HANDLE hTimerQueue; // handle to the mixing thread - HANDLE hTimer; - - volatile bool threadExit; // mixing thread exit signal + DWORD hTimer; // mixing timer bool InitDirectSound (); void DeInitDirectSound(); @@ -217,7 +214,7 @@ private: bool InitSoundBuffer(); void DeInitSoundBuffer(); - static VOID CALLBACK CDirectSound::SoundTimerCallback(PVOID lpParameter,BOOLEAN TimerOrWaitFired); + static VOID CALLBACK SoundTimerCallback(UINT uTimerID, UINT uMsg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2); void ProcessSound(); void MixSound(); diff --git a/win32/render.cpp b/win32/render.cpp index e3afe9fa..2a0d36ed 100644 --- a/win32/render.cpp +++ b/win32/render.cpp @@ -373,6 +373,7 @@ inline static bool GetFilter32BitSupport(RenderFilter filterID) case FILTER_SCANLINES: case FILTER_TVMODE3X: case FILTER_DOTMATRIX3X: + case FILTER_SIMPLE4X: return true; default: diff --git a/win32/rsrc/resource.h b/win32/rsrc/resource.h index f237fc14..101cddae 100644 --- a/win32/rsrc/resource.h +++ b/win32/rsrc/resource.h @@ -145,6 +145,7 @@ #define IDC_CLEAR_CHEATS 1126 #define IDC_JPTOGGLE 1126 #define IDC_LOCALVIDMEM 1126 +#define IDC_VSYNC 1126 #define IDC_CHEAT_DESCRIPTION 1127 #define IDC_KEYBOARD 1127 #define IDC_ALLOWLEFTRIGHT 1127 diff --git a/win32/rsrc/snes9x.rc b/win32/rsrc/snes9x.rc index 06da198e..89f46604 100644 --- a/win32/rsrc/snes9x.rc +++ b/win32/rsrc/snes9x.rc @@ -199,7 +199,7 @@ BEGIN COMBOBOX IDC_FILTERBOX2,217,33,122,90,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "Resolution",IDC_CURRMODE,187,71,41,8 COMBOBOX IDC_RESOLUTION,234,69,105,95,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Enable Triple Buffering",IDC_DBLBUFFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,85,87,10 + CONTROL "Enable Triple Buffering",IDC_DBLBUFFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,86,87,10 CONTROL "Transparency Effects",IDC_TRANS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,113,153,10 CONTROL "Hi Resolution Support",IDC_HIRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,124,85,10 CONTROL "Extend Height of SNES Image",IDC_HEIGHT_EXTEND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,135,111,10 @@ -214,6 +214,7 @@ BEGIN LTEXT "Max skipped frames:",IDC_STATIC,62,126,67,8 LTEXT "Amount skipped:",IDC_STATIC,62,144,67,8 LTEXT "Output Method",IDC_STATIC,10,19,51,11 + CONTROL "VSync",IDC_VSYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,300,86,37,10 END IDD_CHEATER DIALOGEX 0, 0, 262, 218 diff --git a/win32/snes9xw.vcproj b/win32/snes9xw.vcproj index bfe0383a..7c628d78 100644 --- a/win32/snes9xw.vcproj +++ b/win32/snes9xw.vcproj @@ -147,10 +147,13 @@ SNES_HEIGHT_EXTENDED || Src.Width == 512) ? RenderMethodHiRes : RenderMethod) - // only necessary for avi recording // TODO: check if this can be removed bool8 S9xContinueUpdate(int Width, int Height) @@ -687,6 +685,8 @@ void ConvertDepth (SSurface *src, SSurface *dst, RECT *srect) void WinDisplayStringFromBottom (const char *string, int linesFromBottom, int pixelsFromLeft, bool allowWrap) { + if(Settings.StopEmulation) + return; if(Settings.AutoDisplayMessages) { WinSetCustomDisplaySurface((void *)GFX.Screen, GFX.RealPPL, IPPU.RenderedScreenWidth, IPPU.RenderedScreenHeight, 1); WinDisplayStringInBuffer(string, linesFromBottom, pixelsFromLeft, allowWrap); diff --git a/win32/win32_display.h b/win32/win32_display.h index fa1ce4ec..166f3f10 100644 --- a/win32/win32_display.h +++ b/win32/win32_display.h @@ -182,6 +182,10 @@ #include "render.h" #include +#define IsHiRes(x) ((x.Height > SNES_HEIGHT_EXTENDED || x.Width == 512)) +#define RenderMethod (IsHiRes(Src) ? RenderMethodHiRes : RenderMethod) +#define CurrentScale (IsHiRes(Src) ? GUI.ScaleHiRes : GUI.Scale) + void WinRefreshDisplay(void); void S9xSetWinPixelFormat (); void SwitchToGDI(); diff --git a/win32/wlanguage.h b/win32/wlanguage.h index 4aacca6d..bc56c800 100644 --- a/win32/wlanguage.h +++ b/win32/wlanguage.h @@ -325,7 +325,7 @@ #define GAMEDEVICE_NUMPADPREFIX "Numpad-%c" #define GAMEDEVICE_VK_TAB "Tab" #define GAMEDEVICE_VK_BACK "Backspace" -#define GAMEDEVICE_VK_CLEAR "Delete" +#define GAMEDEVICE_VK_CLEAR "Clear" #define GAMEDEVICE_VK_RETURN "Enter" #define GAMEDEVICE_VK_LSHIFT "LShift" #define GAMEDEVICE_VK_RSHIFT "RShift" diff --git a/win32/wsnes9x.cpp b/win32/wsnes9x.cpp index cf7f7688..a4d6d98f 100644 --- a/win32/wsnes9x.cpp +++ b/win32/wsnes9x.cpp @@ -1707,8 +1707,6 @@ LRESULT CALLBACK WinProc( //end turbo case ID_OPTIONS_DISPLAY: { - int old_scale = GUI.NextScale; - RestoreGUIDisplay (); if(GUI.FullScreen) @@ -1717,11 +1715,6 @@ LRESULT CALLBACK WinProc( SwitchToGDI(); - if (GUI.NextScale != old_scale) - { - UpdateScale((RenderFilter &)old_scale, GUI.NextScale); - } - GUI.ScaleHiRes = GUI.NextScaleHiRes; RestoreSNESDisplay (); S9xGraphicsDeinit(); @@ -2324,7 +2317,7 @@ LRESULT CALLBACK WinProc( case WM_EXITMENULOOP: UpdateWindow(GUI.hWnd); - //UpdateBackBuffer(); + DrawMenuBar(GUI.hWnd); S9xClearPause (PAUSE_MENU); break; @@ -2333,7 +2326,7 @@ LRESULT CALLBACK WinProc( CheckMenuStates (); SwitchToGDI(); - DrawMenuBar( GUI.hWnd); + DrawMenuBar(GUI.hWnd); break; case WM_CLOSE: { @@ -2351,14 +2344,8 @@ LRESULT CALLBACK WinProc( return (0); case WM_PAINT: { - PAINTSTRUCT paint; - - BeginPaint (GUI.hWnd, &paint); - // refresh screen WinRefreshDisplay(); - - EndPaint (GUI.hWnd, &paint); break; } case WM_SYSCOMMAND: @@ -3446,7 +3433,7 @@ int WINAPI WinMain( DispatchMessage (&msg); } - S9xSetSoundMute(Settings.ForcedPause || (Settings.Paused && (!Settings.FrameAdvance || GUI.FAMute))); + S9xSetSoundMute(GUI.Mute || Settings.ForcedPause || (Settings.Paused && (!Settings.FrameAdvance || GUI.FAMute))); } #ifdef NETPLAY_SUPPORT @@ -3765,6 +3752,7 @@ static void CheckMenuStates () SetMenuItemInfo (GUI.hMenu, ID_FILE_RESET, FALSE, &mii); SetMenuItemInfo (GUI.hMenu, ID_CHEAT_ENTER, FALSE, &mii); SetMenuItemInfo (GUI.hMenu, ID_CHEAT_SEARCH_MODAL, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, IDM_ROM_INFO, FALSE, &mii); if (GUI.FullScreen) mii.fState |= MFS_DISABLED; @@ -4834,25 +4822,19 @@ int CALLBACK DlgInfoProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) default:strcat(romtext, "Unknown region 15");break; } SendDlgItemMessage(hDlg, IDC_ROM_DATA, WM_SETTEXT, 0, (LPARAM)romtext); - return true; break; } case WM_CTLCOLORSTATIC: - if(GUI.InfoColor!=WIN32_WHITE) + if(GetDlgCtrlID((HWND)lParam)==IDC_ROM_DATA && GUI.InfoColor!=WIN32_WHITE) { SetTextColor((HDC)wParam, GUI.InfoColor); SetBkColor((HDC)wParam, RGB(0,0,0)); + return (BOOL)GetStockObject( BLACK_BRUSH ); } - return true;break; - case WM_PAINT: - { - PAINTSTRUCT ps; - BeginPaint (hDlg, &ps); - - EndPaint (hDlg, &ps); - } - return true; + break; + case WM_PAINT: + break; case WM_COMMAND: { @@ -4863,11 +4845,13 @@ int CALLBACK DlgInfoProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) EndDialog(hDlg, 0); return true; break; - default: return false; break; + default: break; } } - default:return false; + default: + break; } + return DefWindowProc (hDlg, msg, wParam, lParam); } int CALLBACK DlgAboutProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) @@ -6939,6 +6923,8 @@ int CALLBACK DlgFunky(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) if(GUI.DoubleBuffered) SendDlgItemMessage(hDlg, IDC_DBLBUFFER, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + if(GUI.Vsync) + SendDlgItemMessage(hDlg, IDC_VSYNC, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); SendDlgItemMessage(hDlg,IDC_FRAMERATESKIPSLIDER,TBM_SETRANGE,(WPARAM)true,(LPARAM)MAKELONG(0,9)); if(Settings.SkipFrames!=AUTO_FRAMERATE) SendDlgItemMessage(hDlg,IDC_FRAMERATESKIPSLIDER,TBM_SETPOS,(WPARAM)true,(LPARAM)Settings.SkipFrames); @@ -7020,7 +7006,7 @@ int CALLBACK DlgFunky(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) } } - SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_SETCURSEL,(WPARAM)GUI.NextScale,0); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_SETCURSEL,(WPARAM)GUI.Scale,0); UpdateModeComboBox(GetDlgItem(hDlg,IDC_RESOLUTION)); @@ -7248,6 +7234,9 @@ updateFilterBox2: GUI.HeightExtend = IsDlgButtonChecked(hDlg, IDC_HEIGHT_EXTEND)!=0; Settings.AutoDisplayMessages = IsDlgButtonChecked(hDlg, IDC_MESSAGES_IN_IMAGE); GUI.DoubleBuffered = (bool)(IsDlgButtonChecked(hDlg, IDC_DBLBUFFER)==BST_CHECKED); + GUI.Vsync = (bool)(IsDlgButtonChecked(hDlg, IDC_VSYNC + + )==BST_CHECKED); if(IsDlgButtonChecked(hDlg, IDC_AUTOFRAME)) { Settings.SkipFrames=AUTO_FRAMERATE; @@ -7278,15 +7267,11 @@ updateFilterBox2: WinSaveConfigFile(); - if(!GUI.FullScreen || (GUI.FullscreenMode.width >= 512 && GUI.FullscreenMode.height >= 478)) - GUI.NextScale = (RenderFilter)SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_GETCURSEL,0,0); - else - GUI.NextScale = FILTER_NONE; + if(GUI.FullScreen && (GUI.FullscreenMode.width < 512 || GUI.FullscreenMode.height < 478)) + GUI.Scale = FILTER_NONE; - if(!GUI.FullScreen || (GUI.FullscreenMode.width >= 512 && GUI.FullscreenMode.height >= 478)) - GUI.NextScaleHiRes = GUI.ScaleHiRes; - else - GUI.NextScaleHiRes = FILTER_SIMPLE1X; + if(GUI.FullScreen && (GUI.FullscreenMode.width < 512 || GUI.FullscreenMode.height < 478)) + GUI.ScaleHiRes = FILTER_SIMPLE1X; EndDialog(hDlg,0); WinDisplayApplyChanges(); @@ -7313,8 +7298,8 @@ updateFilterBox2: { //UpdateScale(GUI.Scale, prevScale); - GUI.Scale = GUI.NextScale = (RenderFilter)prevScale; - GUI.ScaleHiRes = GUI.NextScaleHiRes = (RenderFilter)prevScaleHiRes; + GUI.Scale = (RenderFilter)prevScale; + GUI.ScaleHiRes = (RenderFilter)prevScaleHiRes; GFX.RealPPL = prevPPL; GUI.Stretch = prevStretch; Settings.AutoDisplayMessages = prevAutoDisplayMessages; diff --git a/win32/wsnes9x.h b/win32/wsnes9x.h index 6696f5b0..ef7a4756 100644 --- a/win32/wsnes9x.h +++ b/win32/wsnes9x.h @@ -294,9 +294,7 @@ struct sGUI { int RefreshRate;*/ dMode FullscreenMode; RenderFilter Scale; - RenderFilter NextScale; RenderFilter ScaleHiRes; - RenderFilter NextScaleHiRes; bool DoubleBuffered; bool FullScreen; bool Stretch; @@ -559,8 +557,6 @@ enum #define WIN32_WHITE RGB(255,255,255) -#define SET_UI_COLOR(r,g,b) SetInfoDlgColor(r,g,b) - /*****************************************************************************/ void S9xSetWinPixelFormat ();