Move VideoRedrawScreen() to Video. (PR #904)

This commit is contained in:
Andrea 2021-01-01 12:42:24 +00:00 committed by GitHub
parent c7d9a780bb
commit 9d7aa7d309
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 22 additions and 24 deletions

View File

@ -318,7 +318,7 @@ void CPageConfig::DlgOK(HWND hWnd)
GetVideo().VideoReinitialize();
if ((g_nAppMode != MODE_LOGO) && (g_nAppMode != MODE_DEBUG))
{
GetFrame().VideoRedrawScreen();
GetVideo().VideoRedrawScreen();
}
}

View File

@ -754,7 +754,7 @@ Update_t CmdBenchmarkStop (int nArgs)
DebugEnd();
GetFrame().FrameRefreshStatus(DRAW_TITLE);
GetFrame().VideoRedrawScreen();
GetVideo().VideoRedrawScreen();
DWORD currtime = GetTickCount();
while ((extbench = GetTickCount()) != currtime)
; // intentional busy-waiting
@ -7447,7 +7447,7 @@ Update_t CmdWindowViewData (int nArgs)
//===========================================================================
Update_t CmdWindowViewOutput (int nArgs)
{
GetFrame().VideoRedrawScreen();
GetVideo().VideoRedrawScreen();
DebugVideoMode::Instance().Set( GetVideo().GetVideoMode() );

View File

@ -1,7 +1,6 @@
#include "StdAfx.h"
#include "FrameBase.h"
#include "Interface.h"
FrameBase::FrameBase()
{
@ -16,9 +15,3 @@ FrameBase::~FrameBase()
{
}
void FrameBase::VideoRedrawScreen(void)
{
// NB. Can't rely on g_uVideoMode being non-zero (ie. so it can double up as a flag) since 'GR,PAGE1,non-mixed' mode == 0x00.
GetVideo().VideoRefreshScreen(GetVideo().GetVideoMode(), true);
}

View File

@ -13,8 +13,6 @@ public:
BOOL g_bMultiMon;
bool g_bFreshReset;
void VideoRedrawScreen();
virtual void FrameDrawDiskLEDS(HDC hdc) = 0;
virtual void FrameDrawDiskStatus(HDC hdc) = 0;
virtual void FrameRefreshStatus(int, bool bUpdateDiskStatus = true) = 0;

View File

@ -303,7 +303,7 @@ void KeybQueueKeypress (WPARAM key, Keystroke_e bASCII)
{
g_bTK3KModeKey = (GetKeyState(VK_SCROLL) & 1) ? true : false; // Sync with the Scroll Lock status
GetFrame().FrameRefreshStatus(DRAW_LEDS); // TODO: Implement |Mode| LED in the UI; make it appear only when in TK3000 mode
GetFrame().VideoRedrawScreen(); // TODO: Still need to implement page mode switching and 'whatnot'
GetVideo().VideoRedrawScreen(); // TODO: Still need to implement page mode switching and 'whatnot'
}
return;
}

View File

@ -97,7 +97,7 @@ static void Spkr_DSUninit();
static void DisplayBenchmarkResults ()
{
DWORD totaltime = GetTickCount()-extbench;
GetFrame().VideoRedrawScreen();
GetVideo().VideoRedrawScreen();
TCHAR buffer[64];
wsprintf(buffer,
TEXT("This benchmark took %u.%02u seconds."),

View File

@ -852,7 +852,7 @@ void Video::VideoRedrawScreenDuringFullSpeed(DWORD dwCyclesThisFrame, bool bInit
void Video::VideoRedrawScreenAfterFullSpeed(DWORD dwCyclesThisFrame)
{
NTSC_VideoClockResync(dwCyclesThisFrame);
GetFrame().VideoRedrawScreen(); // Better (no flicker) than using: NTSC_VideoReinitialize() or VideoReinitialize()
VideoRedrawScreen(); // Better (no flicker) than using: NTSC_VideoReinitialize() or VideoReinitialize()
}
void Video::Video_RedrawAndTakeScreenShot(const char* pScreenshotFilename)
@ -861,7 +861,7 @@ void Video::Video_RedrawAndTakeScreenShot(const char* pScreenshotFilename)
if (!pScreenshotFilename)
return;
GetFrame().VideoRedrawScreen();
VideoRedrawScreen();
Video_SaveScreenShot(SCREENSHOT_560x384, pScreenshotFilename);
}
@ -884,3 +884,9 @@ void Video::VideoRefreshScreen(uint32_t uRedrawWholeScreenVideoMode, bool bRedra
VideoPresentScreen();
}
void Video::VideoRedrawScreen(void)
{
// NB. Can't rely on g_uVideoMode being non-zero (ie. so it can double up as a flag) since 'GR,PAGE1,non-mixed' mode == 0x00.
VideoRefreshScreen(GetVideoMode(), true);
}

View File

@ -219,6 +219,7 @@ public:
void VideoRedrawScreenDuringFullSpeed(DWORD dwCyclesThisFrame, bool bInit = false);
void VideoRedrawScreenAfterFullSpeed(DWORD dwCyclesThisFrame);
void Video_RedrawAndTakeScreenShot(const char* pScreenshotFilename);
void VideoRedrawScreen(void);
uint8_t* GetFrameBuffer(void) { return g_pFramebufferbits; }
void SetFrameBuffer(uint8_t* frameBuffer) { g_pFramebufferbits = frameBuffer; }

View File

@ -589,7 +589,7 @@ static void DrawFrameWindow (bool bPaintingWindow/*=false*/)
else if (g_nAppMode == MODE_DEBUG)
DebugDisplay();
else
GetFrame().VideoRedrawScreen();
GetVideo().VideoRedrawScreen();
if (bPaintingWindow)
EndPaint(GetFrame().g_hFrameWindow,&ps);
@ -1322,7 +1322,7 @@ LRESULT CALLBACK FrameWndProc (
}
DrawStatusArea((HDC)0,DRAW_TITLE);
if ((g_nAppMode != MODE_LOGO) && (g_nAppMode != MODE_DEBUG))
GetFrame().VideoRedrawScreen();
GetVideo().VideoRedrawScreen();
}
else if ((wparam == VK_SCROLL) && GetPropertySheet().GetScrollLockToggle())
{
@ -2005,7 +2005,7 @@ static void ProcessButtonClick(int button, bool bFromButtonUI /*=false*/)
}
DrawStatusArea((HDC)0,DRAW_TITLE);
GetFrame().VideoRedrawScreen();
GetVideo().VideoRedrawScreen();
break;
case BTN_DRIVE1:

View File

@ -151,7 +151,7 @@ void WinVideo::Benchmark(void)
SetVideoMode(VF_TEXT);
memset(mem+0x400,0x14,0x400);
GetFrame().VideoRedrawScreen();
VideoRedrawScreen();
DWORD milliseconds = GetTickCount();
while (GetTickCount() == milliseconds) ;
milliseconds = GetTickCount();
@ -173,7 +173,7 @@ void WinVideo::Benchmark(void)
DWORD totalhiresfps = 0;
SetVideoMode(VF_HIRES);
memset(mem+0x2000,0x14,0x2000);
GetFrame().VideoRedrawScreen();
VideoRedrawScreen();
milliseconds = GetTickCount();
while (GetTickCount() == milliseconds) ;
milliseconds = GetTickCount();
@ -257,7 +257,7 @@ void WinVideo::Benchmark(void)
// THE SAME TIME
DWORD realisticfps = 0;
memset(mem+0x2000,0xAA,0x2000);
GetFrame().VideoRedrawScreen();
VideoRedrawScreen();
milliseconds = GetTickCount();
while (GetTickCount() == milliseconds) ;
milliseconds = GetTickCount();
@ -276,7 +276,7 @@ void WinVideo::Benchmark(void)
memset(mem+0x2000,0xAA,0x2000);
else
memcpy(mem+0x2000,mem+((cycle & 2) ? 0x4000 : 0x6000),0x2000);
GetFrame().VideoRedrawScreen();
VideoRedrawScreen();
if (cycle++ >= 3)
cycle = 0;
realisticfps++;
@ -320,7 +320,7 @@ void WinVideo::ChooseMonochromeColor(void)
VideoReinitialize();
if ((g_nAppMode != MODE_LOGO) && (g_nAppMode != MODE_DEBUG))
{
GetFrame().VideoRedrawScreen();
VideoRedrawScreen();
}
Config_Save_Video();
}