mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-01-18 06:31:57 +00:00
VideoReinitialize(): remove default arg & refactor out common code (PR #911)
This commit is contained in:
parent
6cffb30330
commit
816e22524f
@ -312,15 +312,8 @@ void CPageConfig::DlgOK(HWND hWnd)
|
|||||||
|
|
||||||
if (bVideoReinit)
|
if (bVideoReinit)
|
||||||
{
|
{
|
||||||
GetVideo().Config_Save_Video();
|
|
||||||
|
|
||||||
win32Frame.FrameRefreshStatus(DRAW_TITLE);
|
win32Frame.FrameRefreshStatus(DRAW_TITLE);
|
||||||
|
win32Frame.ApplyVideoModeChange();
|
||||||
GetVideo().VideoReinitialize();
|
|
||||||
if ((g_nAppMode != MODE_LOGO) && (g_nAppMode != MODE_DEBUG))
|
|
||||||
{
|
|
||||||
win32Frame.VideoRedrawScreen();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -2117,7 +2117,7 @@ void NTSC_VideoInit( uint8_t* pFramebuffer ) // wsVideoInit
|
|||||||
g_pFuncUpdateTextScreen = updateScreenText40;
|
g_pFuncUpdateTextScreen = updateScreenText40;
|
||||||
g_pFuncUpdateGraphicsScreen = updateScreenText40;
|
g_pFuncUpdateGraphicsScreen = updateScreenText40;
|
||||||
|
|
||||||
GetVideo().VideoReinitialize(); // Setup g_pFunc_ntsc*Pixel()
|
GetVideo().VideoReinitialize(true); // Setup g_pFunc_ntsc*Pixel()
|
||||||
|
|
||||||
bgra_t baseColors[kNumBaseColors];
|
bgra_t baseColors[kNumBaseColors];
|
||||||
GenerateBaseColors(&baseColors);
|
GenerateBaseColors(&baseColors);
|
||||||
|
@ -287,7 +287,7 @@ static void ParseUnitApple2(YamlLoadHelper& yamlLoadHelper, UINT version)
|
|||||||
MemLoadSnapshot(yamlLoadHelper, version);
|
MemLoadSnapshot(yamlLoadHelper, version);
|
||||||
|
|
||||||
// g_Apple2Type may've changed: so redraw frame (title, buttons, leds, etc)
|
// g_Apple2Type may've changed: so redraw frame (title, buttons, leds, etc)
|
||||||
GetVideo().VideoReinitialize(); // g_CharsetType changed
|
GetVideo().VideoReinitialize(true); // g_CharsetType changed
|
||||||
GetFrame().FrameUpdateApple2Type(); // Calls VideoRedrawScreen() before the aux mem has been loaded (so if DHGR is enabled, then aux mem will be zeros at this stage)
|
GetFrame().FrameUpdateApple2Type(); // Calls VideoRedrawScreen() before the aux mem has been loaded (so if DHGR is enabled, then aux mem will be zeros at this stage)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ UINT Video::GetFrameBufferHeight(void)
|
|||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
void Video::VideoReinitialize(bool bInitVideoScannerAddress /*= true*/)
|
void Video::VideoReinitialize(bool bInitVideoScannerAddress)
|
||||||
{
|
{
|
||||||
NTSC_VideoReinitialize( g_dwCyclesThisFrame, bInitVideoScannerAddress );
|
NTSC_VideoReinitialize( g_dwCyclesThisFrame, bInitVideoScannerAddress );
|
||||||
NTSC_VideoInitAppleType();
|
NTSC_VideoInitAppleType();
|
||||||
|
@ -211,7 +211,7 @@ public:
|
|||||||
COLORREF GetMonochromeRGB(void) { return g_nMonochromeRGB; }
|
COLORREF GetMonochromeRGB(void) { return g_nMonochromeRGB; }
|
||||||
void SetMonochromeRGB(COLORREF colorRef) { g_nMonochromeRGB = colorRef; }
|
void SetMonochromeRGB(COLORREF colorRef) { g_nMonochromeRGB = colorRef; }
|
||||||
|
|
||||||
void VideoReinitialize(bool bInitVideoScannerAddress = true);
|
void VideoReinitialize(bool bInitVideoScannerAddress);
|
||||||
void VideoResetState(void);
|
void VideoResetState(void);
|
||||||
void VideoRefreshBuffer(uint32_t uRedrawWholeScreenVideoMode, bool bRedrawWholeScreen);
|
void VideoRefreshBuffer(uint32_t uRedrawWholeScreenVideoMode, bool bRedrawWholeScreen);
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "Memory.h"
|
#include "Memory.h"
|
||||||
#include "CardManager.h"
|
#include "CardManager.h"
|
||||||
|
#include "Debugger/Debug.h"
|
||||||
#include "../resource/resource.h"
|
#include "../resource/resource.h"
|
||||||
|
|
||||||
// Win32Frame methods are implemented in AppleWin, WinFrame and WinVideo.
|
// Win32Frame methods are implemented in AppleWin, WinFrame and WinVideo.
|
||||||
@ -306,12 +307,7 @@ void Win32Frame::ChooseMonochromeColor(void)
|
|||||||
if (ChooseColor(&cc))
|
if (ChooseColor(&cc))
|
||||||
{
|
{
|
||||||
video.SetMonochromeRGB(cc.rgbResult);
|
video.SetMonochromeRGB(cc.rgbResult);
|
||||||
video.VideoReinitialize();
|
ApplyVideoModeChange();
|
||||||
if ((g_nAppMode != MODE_LOGO) && (g_nAppMode != MODE_DEBUG))
|
|
||||||
{
|
|
||||||
VideoRedrawScreen();
|
|
||||||
}
|
|
||||||
video.Config_Save_Video();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -514,6 +510,29 @@ void Win32Frame::DDUninit(void)
|
|||||||
|
|
||||||
#undef SAFE_RELEASE
|
#undef SAFE_RELEASE
|
||||||
|
|
||||||
|
void Win32Frame::ApplyVideoModeChange(void)
|
||||||
|
{
|
||||||
|
Video& video = GetVideo();
|
||||||
|
video.Config_Save_Video();
|
||||||
|
video.VideoReinitialize(false);
|
||||||
|
|
||||||
|
if (g_nAppMode != MODE_LOGO)
|
||||||
|
{
|
||||||
|
if (g_nAppMode == MODE_DEBUG)
|
||||||
|
{
|
||||||
|
UINT debugVideoMode;
|
||||||
|
if (DebugGetVideoMode(&debugVideoMode))
|
||||||
|
VideoRefreshScreen(debugVideoMode, true);
|
||||||
|
else
|
||||||
|
VideoPresentScreen();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
VideoPresentScreen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Win32Frame& Win32Frame::GetWin32Frame()
|
Win32Frame& Win32Frame::GetWin32Frame()
|
||||||
{
|
{
|
||||||
FrameBase& frameBase = GetFrame();
|
FrameBase& frameBase = GetFrame();
|
||||||
|
@ -44,6 +44,7 @@ public:
|
|||||||
void ChooseMonochromeColor(void);
|
void ChooseMonochromeColor(void);
|
||||||
UINT Get3DBorderWidth(void);
|
UINT Get3DBorderWidth(void);
|
||||||
UINT Get3DBorderHeight(void);
|
UINT Get3DBorderHeight(void);
|
||||||
|
void ApplyVideoModeChange(void);
|
||||||
LRESULT WndProc(HWND window, UINT message, WPARAM wparam, LPARAM lparam);
|
LRESULT WndProc(HWND window, UINT message, WPARAM wparam, LPARAM lparam);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -1113,7 +1113,7 @@ LRESULT Win32Frame::WndProc(
|
|||||||
}
|
}
|
||||||
|
|
||||||
case WM_DISPLAYCHANGE:
|
case WM_DISPLAYCHANGE:
|
||||||
GetVideo().VideoReinitialize();
|
GetVideo().VideoReinitialize(false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_DROPFILES:
|
case WM_DROPFILES:
|
||||||
@ -1223,26 +1223,7 @@ LRESULT Win32Frame::WndProc(
|
|||||||
|
|
||||||
// TODO: Clean up code:FrameRefreshStatus(DRAW_TITLE) DrawStatusArea((HDC)0,DRAW_TITLE)
|
// TODO: Clean up code:FrameRefreshStatus(DRAW_TITLE) DrawStatusArea((HDC)0,DRAW_TITLE)
|
||||||
DrawStatusArea( (HDC)0, DRAW_TITLE );
|
DrawStatusArea( (HDC)0, DRAW_TITLE );
|
||||||
|
ApplyVideoModeChange();
|
||||||
GetVideo().VideoReinitialize(false);
|
|
||||||
|
|
||||||
if (g_nAppMode != MODE_LOGO)
|
|
||||||
{
|
|
||||||
if (g_nAppMode == MODE_DEBUG)
|
|
||||||
{
|
|
||||||
UINT debugVideoMode;
|
|
||||||
if ( DebugGetVideoMode(&debugVideoMode) )
|
|
||||||
VideoRefreshScreen(debugVideoMode, true);
|
|
||||||
else
|
|
||||||
VideoPresentScreen();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
VideoPresentScreen();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
GetVideo().Config_Save_Video();
|
|
||||||
}
|
}
|
||||||
else if (wparam == VK_F10)
|
else if (wparam == VK_F10)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user