Merge remote-tracking branch 'upstream/master'
# Conflicts: # source/Log.cpp # source/NTSC.h
This commit is contained in:
commit
b3abd6962e
13 changed files with 133 additions and 117 deletions
26
README.md
26
README.md
|
@ -1,12 +1,26 @@
|
||||||
AppleWin
|
AppleWin
|
||||||
========
|
========
|
||||||
|
|
||||||
Apple II emulator for Windows
|
#### Apple II emulator for Windows
|
||||||
|
|
||||||
|
AppleWin is a fully-featured emulator supporting different Apple II models and clones. A variety of peripheral cards and video display modes are supported (eg. NTSC, RGB); and there's an extensive built-in symbolic debugger.
|
||||||
|
|
||||||
|
Peripheral cards supported:
|
||||||
|
- Mockingboard, Phasor and SAM sound cards
|
||||||
|
- Disk II interface for floppy disk drives
|
||||||
|
- Hard disk controller
|
||||||
|
- Super Serial Card (SSC)
|
||||||
|
- Parallel printer card
|
||||||
|
- Mouse interface
|
||||||
|
- Apple IIe Extended 80-Column Text Card and RamWorks III (8MB)
|
||||||
|
- RGB cards: Apple's Extended 80-Column Text/AppleColor Adaptor Card, 'Le Chat Mauve' Féline and Eve.
|
||||||
|
- CP/M SoftCard
|
||||||
|
- Uthernet I (ethernet card)
|
||||||
|
|
||||||
|
|
||||||
Download latest (stable) release: [AppleWin v1.29.13.0](https://github.com/AppleWin/AppleWin/releases/download/v1.29.13.0/AppleWin1.29.13.0.zip)
|
Download latest (stable) release: [AppleWin v1.29.16.0](https://github.com/AppleWin/AppleWin/releases/download/v1.29.16.0/AppleWin1.29.16.0.zip)
|
||||||
|
|
||||||
Release Notes: [v1.29.13.0](https://github.com/AppleWin/AppleWin/releases/tag/v1.29.13.0)
|
Release Notes: [v1.29.16.0](https://github.com/AppleWin/AppleWin/releases/tag/v1.29.16.0)
|
||||||
|
|
||||||
|
|
||||||
Building
|
Building
|
||||||
|
@ -26,8 +40,10 @@ Please report [new issues](https://github.com/AppleWin/AppleWin/issues/new)
|
||||||
Previous Versions
|
Previous Versions
|
||||||
=================
|
=================
|
||||||
|
|
||||||
* [AppleWin v1.28.8.0](https://github.com/AppleWin/AppleWin/releases/tag/v1.28.8.0)
|
Last version supporting Windows 2000:
|
||||||
|
|
||||||
Last pre-NTSC change:
|
* [AppleWin v1.29.16.0](https://github.com/AppleWin/AppleWin/releases/tag/v1.29.16.0)
|
||||||
|
|
||||||
|
Last version supporting Windows 98/ME:
|
||||||
|
|
||||||
* [AppleWin v1.25.0.4](https://github.com/AppleWin/AppleWin/releases/tag/v1.25.0.4)
|
* [AppleWin v1.25.0.4](https://github.com/AppleWin/AppleWin/releases/tag/v1.25.0.4)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "StdAfx.h"
|
#include "StdAfx.h"
|
||||||
|
|
||||||
#include "FrameBase.h"
|
#include "FrameBase.h"
|
||||||
|
#include "Interface.h"
|
||||||
|
|
||||||
FrameBase::FrameBase()
|
FrameBase::FrameBase()
|
||||||
{
|
{
|
||||||
|
@ -15,3 +16,9 @@ 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);
|
||||||
|
}
|
||||||
|
|
|
@ -13,13 +13,14 @@ public:
|
||||||
BOOL g_bMultiMon;
|
BOOL g_bMultiMon;
|
||||||
bool g_bFreshReset;
|
bool g_bFreshReset;
|
||||||
|
|
||||||
|
void VideoRedrawScreen();
|
||||||
|
|
||||||
virtual void FrameDrawDiskLEDS(HDC hdc) = 0;
|
virtual void FrameDrawDiskLEDS(HDC hdc) = 0;
|
||||||
virtual void FrameDrawDiskStatus(HDC hdc) = 0;
|
virtual void FrameDrawDiskStatus(HDC hdc) = 0;
|
||||||
virtual void FrameRefreshStatus(int, bool bUpdateDiskStatus = true) = 0;
|
virtual void FrameRefreshStatus(int, bool bUpdateDiskStatus = true) = 0;
|
||||||
virtual void FrameUpdateApple2Type() = 0;
|
virtual void FrameUpdateApple2Type() = 0;
|
||||||
virtual void FrameSetCursorPosByMousePos() = 0;
|
virtual void FrameSetCursorPosByMousePos() = 0;
|
||||||
|
|
||||||
virtual void VideoRedrawScreen() = 0;
|
|
||||||
virtual void SetFullScreenShowSubunitStatus(bool bShow) = 0;
|
virtual void SetFullScreenShowSubunitStatus(bool bShow) = 0;
|
||||||
virtual bool GetBestDisplayResolutionForFullScreen(UINT& bestWidth, UINT& bestHeight, UINT userSpecifiedHeight = 0) = 0;
|
virtual bool GetBestDisplayResolutionForFullScreen(UINT& bestWidth, UINT& bestHeight, UINT userSpecifiedHeight = 0) = 0;
|
||||||
virtual int SetViewportScale(int nNewScale, bool bForce = false) = 0;
|
virtual int SetViewportScale(int nNewScale, bool bForce = false) = 0;
|
||||||
|
|
|
@ -34,10 +34,12 @@ FILE* g_fh = NULL;
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#define LOG_FILENAME "AppleWin.log"
|
#define LOG_FILENAME "AppleWin.log"
|
||||||
#else
|
#else
|
||||||
// in /tmp otherwise it creates one in the current folder which can be a bit everywhere
|
// save to /tmp as otherwise it creates a file in the current folder which can be a bit everywhere
|
||||||
|
// especially if the program is installed to /usr
|
||||||
#define LOG_FILENAME "/tmp/AppleWin.log"
|
#define LOG_FILENAME "/tmp/AppleWin.log"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void LogInit(void)
|
void LogInit(void)
|
||||||
|
|
|
@ -1,32 +1,31 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Video.h"
|
#include "Video.h" // NB. needed by GCC (for fwd enum declaration)
|
||||||
|
|
||||||
// Globals (Public)
|
// Globals (Public)
|
||||||
extern uint16_t g_nVideoClockVert;
|
extern uint16_t g_nVideoClockVert;
|
||||||
extern uint16_t g_nVideoClockHorz;
|
extern uint16_t g_nVideoClockHorz;
|
||||||
extern uint32_t g_nChromaSize;
|
extern uint32_t g_nChromaSize;
|
||||||
|
|
||||||
// Prototypes (Public) ________________________________________________
|
// Prototypes (Public) ________________________________________________
|
||||||
extern void NTSC_SetVideoMode( uint32_t uVideoModeFlags, bool bDelay=false );
|
void NTSC_SetVideoMode(uint32_t uVideoModeFlags, bool bDelay=false);
|
||||||
extern void NTSC_SetVideoStyle();
|
void NTSC_SetVideoStyle(void);
|
||||||
extern void NTSC_SetVideoTextMode( int cols );
|
void NTSC_SetVideoTextMode(int cols);
|
||||||
extern uint32_t*NTSC_VideoGetChromaTable( bool bHueTypeMonochrome, bool bMonitorTypeColorTV );
|
uint32_t* NTSC_VideoGetChromaTable(bool bHueTypeMonochrome, bool bMonitorTypeColorTV);
|
||||||
extern void NTSC_VideoClockResync( const DWORD dwCyclesThisFrame );
|
void NTSC_VideoClockResync(const DWORD dwCyclesThisFrame);
|
||||||
extern uint16_t NTSC_VideoGetScannerAddress( const ULONG uExecutedCycles );
|
uint16_t NTSC_VideoGetScannerAddress(const ULONG uExecutedCycles);
|
||||||
extern uint16_t NTSC_VideoGetScannerAddressForDebugger(void);
|
uint16_t NTSC_VideoGetScannerAddressForDebugger(void);
|
||||||
extern void NTSC_Destroy(void);
|
void NTSC_Destroy(void);
|
||||||
extern void NTSC_VideoInit( uint8_t *pFramebuffer );
|
void NTSC_VideoInit(uint8_t *pFramebuffer);
|
||||||
extern void NTSC_VideoReinitialize( DWORD cyclesThisFrame, bool bInitVideoScannerAddress );
|
void NTSC_VideoReinitialize(DWORD cyclesThisFrame, bool bInitVideoScannerAddress);
|
||||||
extern void NTSC_VideoInitAppleType();
|
void NTSC_VideoInitAppleType(void);
|
||||||
extern void NTSC_VideoInitChroma();
|
void NTSC_VideoInitChroma(void);
|
||||||
extern void NTSC_VideoUpdateCycles( UINT cycles6502 );
|
void NTSC_VideoUpdateCycles(UINT cycles6502);
|
||||||
extern void NTSC_VideoRedrawWholeScreen( void );
|
void NTSC_VideoRedrawWholeScreen(void);
|
||||||
|
|
||||||
enum VideoRefreshRate_e;
|
void NTSC_SetRefreshRate(VideoRefreshRate_e rate);
|
||||||
void NTSC_SetRefreshRate(VideoRefreshRate_e rate);
|
UINT NTSC_GetCyclesPerFrame(void);
|
||||||
UINT NTSC_GetCyclesPerFrame(void);
|
UINT NTSC_GetCyclesPerLine(void);
|
||||||
UINT NTSC_GetCyclesPerLine(void);
|
UINT NTSC_GetVideoLines(void);
|
||||||
UINT NTSC_GetVideoLines(void);
|
UINT NTSC_GetCyclesUntilVBlank(int cycles);
|
||||||
UINT NTSC_GetCyclesUntilVBlank(int cycles);
|
bool NTSC_IsVisible(void);
|
||||||
bool NTSC_IsVisible(void);
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
#define MAX_SOUND_DEVICES 10
|
#define MAX_SOUND_DEVICES 10
|
||||||
|
|
||||||
static char *sound_devices[MAX_SOUND_DEVICES];
|
static std::string sound_devices[MAX_SOUND_DEVICES];
|
||||||
static GUID sound_device_guid[MAX_SOUND_DEVICES];
|
static GUID sound_device_guid[MAX_SOUND_DEVICES];
|
||||||
static int num_sound_devices = 0;
|
static int num_sound_devices = 0;
|
||||||
|
|
||||||
|
@ -67,7 +67,9 @@ static BOOL CALLBACK DSEnumProc(LPGUID lpGUID, LPCTSTR lpszDesc, LPCTSTR lpszDrv
|
||||||
return TRUE;
|
return TRUE;
|
||||||
if(lpGUID != NULL)
|
if(lpGUID != NULL)
|
||||||
memcpy(&sound_device_guid[i], lpGUID, sizeof (GUID));
|
memcpy(&sound_device_guid[i], lpGUID, sizeof (GUID));
|
||||||
sound_devices[i] = _strdup(lpszDesc);
|
else
|
||||||
|
memset(&sound_device_guid[i], 0, sizeof(GUID));
|
||||||
|
sound_devices[i] = lpszDesc;
|
||||||
|
|
||||||
if(g_fh) fprintf(g_fh, "%d: %s - %s\n",i,lpszDesc,lpszDrvName);
|
if(g_fh) fprintf(g_fh, "%d: %s - %s\n",i,lpszDesc,lpszDrvName);
|
||||||
|
|
||||||
|
@ -491,6 +493,7 @@ bool DSInit()
|
||||||
return true; // Already initialised successfully
|
return true; // Already initialised successfully
|
||||||
}
|
}
|
||||||
|
|
||||||
|
num_sound_devices = 0;
|
||||||
HRESULT hr = DirectSoundEnumerate((LPDSENUMCALLBACK)DSEnumProc, NULL);
|
HRESULT hr = DirectSoundEnumerate((LPDSENUMCALLBACK)DSEnumProc, NULL);
|
||||||
if(FAILED(hr))
|
if(FAILED(hr))
|
||||||
{
|
{
|
||||||
|
|
|
@ -620,7 +620,7 @@ void Video::Video_SaveScreenShot(const VideoScreenShot_e ScreenShotType, const T
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
bool Video::ReadVideoRomFile(const TCHAR* pRomFile)
|
bool Video::ReadVideoRomFile(const char* pRomFile)
|
||||||
{
|
{
|
||||||
g_videoRomSize = 0;
|
g_videoRomSize = 0;
|
||||||
|
|
||||||
|
@ -830,3 +830,57 @@ const char* Video::VideoGetAppWindowTitle(void)
|
||||||
else
|
else
|
||||||
return apVideoMonitorModeDesc[ GetVideoRefreshRate() == VR_60HZ ? 0 : 1 ]; // NTSC or PAL
|
return apVideoMonitorModeDesc[ GetVideoRefreshRate() == VR_60HZ ? 0 : 1 ]; // NTSC or PAL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Video::VideoRedrawScreenDuringFullSpeed(DWORD dwCyclesThisFrame, bool bInit /*=false*/)
|
||||||
|
{
|
||||||
|
if (bInit)
|
||||||
|
{
|
||||||
|
// Just entered full-speed mode
|
||||||
|
dwFullSpeedStartTime = GetTickCount();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
DWORD dwFullSpeedDuration = GetTickCount() - dwFullSpeedStartTime;
|
||||||
|
if (dwFullSpeedDuration <= 16) // Only update after every realtime ~17ms of *continuous* full-speed
|
||||||
|
return;
|
||||||
|
|
||||||
|
dwFullSpeedStartTime += dwFullSpeedDuration;
|
||||||
|
|
||||||
|
VideoRedrawScreenAfterFullSpeed(dwCyclesThisFrame);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Video::VideoRedrawScreenAfterFullSpeed(DWORD dwCyclesThisFrame)
|
||||||
|
{
|
||||||
|
NTSC_VideoClockResync(dwCyclesThisFrame);
|
||||||
|
GetFrame().VideoRedrawScreen(); // Better (no flicker) than using: NTSC_VideoReinitialize() or VideoReinitialize()
|
||||||
|
}
|
||||||
|
|
||||||
|
void Video::Video_RedrawAndTakeScreenShot(const char* pScreenshotFilename)
|
||||||
|
{
|
||||||
|
_ASSERT(pScreenshotFilename);
|
||||||
|
if (!pScreenshotFilename)
|
||||||
|
return;
|
||||||
|
|
||||||
|
GetFrame().VideoRedrawScreen();
|
||||||
|
Video_SaveScreenShot(SCREENSHOT_560x384, pScreenshotFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Video::VideoRefreshScreen(uint32_t uRedrawWholeScreenVideoMode, bool bRedrawWholeScreen)
|
||||||
|
{
|
||||||
|
if (bRedrawWholeScreen || g_nAppMode == MODE_PAUSED)
|
||||||
|
{
|
||||||
|
// uVideoModeForWholeScreen set if:
|
||||||
|
// . MODE_DEBUG : always
|
||||||
|
// . MODE_RUNNING : called from VideoRedrawScreen(), eg. during full-speed
|
||||||
|
if (bRedrawWholeScreen)
|
||||||
|
NTSC_SetVideoMode(uRedrawWholeScreenVideoMode);
|
||||||
|
NTSC_VideoRedrawWholeScreen();
|
||||||
|
|
||||||
|
// MODE_DEBUG|PAUSED: Need to refresh a 2nd time if changing video-type, otherwise could have residue from prev image!
|
||||||
|
// . eg. Amber -> B&W TV
|
||||||
|
if (g_nAppMode == MODE_DEBUG || g_nAppMode == MODE_PAUSED)
|
||||||
|
NTSC_VideoRedrawWholeScreen();
|
||||||
|
}
|
||||||
|
|
||||||
|
VideoPresentScreen();
|
||||||
|
}
|
||||||
|
|
|
@ -210,14 +210,16 @@ public:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void VideoRedrawScreenDuringFullSpeed(DWORD dwCyclesThisFrame, bool bInit = false) = 0;
|
virtual void VideoPresentScreen(void) = 0;
|
||||||
virtual void VideoRedrawScreenAfterFullSpeed(DWORD dwCyclesThisFrame) = 0;
|
|
||||||
virtual void VideoRefreshScreen(uint32_t uRedrawWholeScreenVideoMode = 0, bool bRedrawWholeScreen = false) = 0;
|
|
||||||
virtual void Video_RedrawAndTakeScreenShot(const char* pScreenshotFilename) = 0;
|
|
||||||
virtual void ChooseMonochromeColor(void) = 0;
|
virtual void ChooseMonochromeColor(void) = 0;
|
||||||
virtual void Benchmark(void) = 0;
|
virtual void Benchmark(void) = 0;
|
||||||
virtual void DisplayLogo(void) = 0;
|
virtual void DisplayLogo(void) = 0;
|
||||||
|
|
||||||
|
void VideoRefreshScreen(uint32_t uRedrawWholeScreenVideoMode, bool bRedrawWholeScreen);
|
||||||
|
void VideoRedrawScreenDuringFullSpeed(DWORD dwCyclesThisFrame, bool bInit = false);
|
||||||
|
void VideoRedrawScreenAfterFullSpeed(DWORD dwCyclesThisFrame);
|
||||||
|
void Video_RedrawAndTakeScreenShot(const char* pScreenshotFilename);
|
||||||
|
|
||||||
uint8_t* GetFrameBuffer(void) { return g_pFramebufferbits; }
|
uint8_t* GetFrameBuffer(void) { return g_pFramebufferbits; }
|
||||||
void SetFrameBuffer(uint8_t* frameBuffer) { g_pFramebufferbits = frameBuffer; }
|
void SetFrameBuffer(uint8_t* frameBuffer) { g_pFramebufferbits = frameBuffer; }
|
||||||
|
|
||||||
|
@ -331,6 +333,8 @@ private:
|
||||||
UINT g_videoRomSize;
|
UINT g_videoRomSize;
|
||||||
bool g_videoRomRockerSwitch;
|
bool g_videoRomRockerSwitch;
|
||||||
|
|
||||||
|
DWORD dwFullSpeedStartTime;
|
||||||
|
|
||||||
static const char g_aVideoChoices[];
|
static const char g_aVideoChoices[];
|
||||||
|
|
||||||
static const char m_szModeDesc0[];
|
static const char m_szModeDesc0[];
|
||||||
|
|
|
@ -253,7 +253,7 @@ static void ContinueExecution(void)
|
||||||
if (g_bFullSpeed)
|
if (g_bFullSpeed)
|
||||||
GetVideo().VideoRedrawScreenDuringFullSpeed(g_dwCyclesThisFrame);
|
GetVideo().VideoRedrawScreenDuringFullSpeed(g_dwCyclesThisFrame);
|
||||||
else
|
else
|
||||||
GetVideo().VideoRefreshScreen(); // Just copy the output of our Apple framebuffer to the system Back Buffer
|
GetVideo().VideoPresentScreen(); // Just copy the output of our Apple framebuffer to the system Back Buffer
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef LOG_PERF_TIMINGS
|
#ifdef LOG_PERF_TIMINGS
|
||||||
|
|
|
@ -11,7 +11,6 @@ public:
|
||||||
virtual void FrameUpdateApple2Type();
|
virtual void FrameUpdateApple2Type();
|
||||||
virtual void FrameSetCursorPosByMousePos();
|
virtual void FrameSetCursorPosByMousePos();
|
||||||
|
|
||||||
virtual void VideoRedrawScreen();
|
|
||||||
virtual void SetFullScreenShowSubunitStatus(bool bShow);
|
virtual void SetFullScreenShowSubunitStatus(bool bShow);
|
||||||
virtual bool GetBestDisplayResolutionForFullScreen(UINT& bestWidth, UINT& bestHeight, UINT userSpecifiedHeight = 0);
|
virtual bool GetBestDisplayResolutionForFullScreen(UINT& bestWidth, UINT& bestHeight, UINT userSpecifiedHeight = 0);
|
||||||
virtual int SetViewportScale(int nNewScale, bool bForce = false);
|
virtual int SetViewportScale(int nNewScale, bool bForce = false);
|
||||||
|
|
|
@ -1256,11 +1256,11 @@ LRESULT CALLBACK FrameWndProc (
|
||||||
if ( DebugGetVideoMode(&debugVideoMode) )
|
if ( DebugGetVideoMode(&debugVideoMode) )
|
||||||
GetVideo().VideoRefreshScreen(debugVideoMode, true);
|
GetVideo().VideoRefreshScreen(debugVideoMode, true);
|
||||||
else
|
else
|
||||||
GetVideo().VideoRefreshScreen();
|
GetVideo().VideoPresentScreen();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GetVideo().VideoRefreshScreen();
|
GetVideo().VideoPresentScreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
#include "StdAfx.h"
|
#include "StdAfx.h"
|
||||||
|
|
||||||
#include "Windows/WinVideo.h"
|
#include "Windows/WinVideo.h"
|
||||||
#include "Windows/Win32Frame.h"
|
|
||||||
#include "Windows/WinFrame.h"
|
#include "Windows/WinFrame.h"
|
||||||
#include "Windows/AppleWin.h"
|
#include "Windows/AppleWin.h"
|
||||||
#include "Interface.h"
|
#include "Interface.h"
|
||||||
|
@ -162,7 +161,7 @@ void WinVideo::Benchmark(void)
|
||||||
memset(mem+0x400,0x14,0x400);
|
memset(mem+0x400,0x14,0x400);
|
||||||
else
|
else
|
||||||
memcpy(mem+0x400,mem+((cycle & 2) ? 0x4000 : 0x6000),0x400);
|
memcpy(mem+0x400,mem+((cycle & 2) ? 0x4000 : 0x6000),0x400);
|
||||||
VideoRefreshScreen();
|
VideoPresentScreen();
|
||||||
if (cycle++ >= 3)
|
if (cycle++ >= 3)
|
||||||
cycle = 0;
|
cycle = 0;
|
||||||
totaltextfps++;
|
totaltextfps++;
|
||||||
|
@ -184,7 +183,7 @@ void WinVideo::Benchmark(void)
|
||||||
memset(mem+0x2000,0x14,0x2000);
|
memset(mem+0x2000,0x14,0x2000);
|
||||||
else
|
else
|
||||||
memcpy(mem+0x2000,mem+((cycle & 2) ? 0x4000 : 0x6000),0x2000);
|
memcpy(mem+0x2000,mem+((cycle & 2) ? 0x4000 : 0x6000),0x2000);
|
||||||
VideoRefreshScreen();
|
VideoPresentScreen();
|
||||||
if (cycle++ >= 3)
|
if (cycle++ >= 3)
|
||||||
cycle = 0;
|
cycle = 0;
|
||||||
totalhiresfps++;
|
totalhiresfps++;
|
||||||
|
@ -421,53 +420,8 @@ void WinVideo::DisplayLogo(void)
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
void WinVideo::VideoRedrawScreenDuringFullSpeed(DWORD dwCyclesThisFrame, bool bInit /*=false*/)
|
void WinVideo::VideoPresentScreen(void)
|
||||||
{
|
{
|
||||||
static DWORD dwFullSpeedStartTime = 0;
|
|
||||||
|
|
||||||
if (bInit)
|
|
||||||
{
|
|
||||||
// Just entered full-speed mode
|
|
||||||
dwFullSpeedStartTime = GetTickCount();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
DWORD dwFullSpeedDuration = GetTickCount() - dwFullSpeedStartTime;
|
|
||||||
if (dwFullSpeedDuration <= 16) // Only update after every realtime ~17ms of *continuous* full-speed
|
|
||||||
return;
|
|
||||||
|
|
||||||
dwFullSpeedStartTime += dwFullSpeedDuration;
|
|
||||||
|
|
||||||
VideoRedrawScreenAfterFullSpeed(dwCyclesThisFrame);
|
|
||||||
}
|
|
||||||
|
|
||||||
//===========================================================================
|
|
||||||
|
|
||||||
void WinVideo::VideoRedrawScreenAfterFullSpeed(DWORD dwCyclesThisFrame)
|
|
||||||
{
|
|
||||||
NTSC_VideoClockResync(dwCyclesThisFrame);
|
|
||||||
GetFrame().VideoRedrawScreen(); // Better (no flicker) than using: NTSC_VideoReinitialize() or VideoReinitialize()
|
|
||||||
}
|
|
||||||
|
|
||||||
//===========================================================================
|
|
||||||
|
|
||||||
void WinVideo::VideoRefreshScreen(uint32_t uRedrawWholeScreenVideoMode /* =0*/, bool bRedrawWholeScreen /* =false*/)
|
|
||||||
{
|
|
||||||
if (bRedrawWholeScreen || g_nAppMode == MODE_PAUSED)
|
|
||||||
{
|
|
||||||
// uVideoModeForWholeScreen set if:
|
|
||||||
// . MODE_DEBUG : always
|
|
||||||
// . MODE_RUNNING : called from VideoRedrawScreen(), eg. during full-speed
|
|
||||||
if (bRedrawWholeScreen)
|
|
||||||
NTSC_SetVideoMode( uRedrawWholeScreenVideoMode );
|
|
||||||
NTSC_VideoRedrawWholeScreen();
|
|
||||||
|
|
||||||
// MODE_DEBUG|PAUSED: Need to refresh a 2nd time if changing video-type, otherwise could have residue from prev image!
|
|
||||||
// . eg. Amber -> B&W TV
|
|
||||||
if (g_nAppMode == MODE_DEBUG || g_nAppMode == MODE_PAUSED)
|
|
||||||
NTSC_VideoRedrawWholeScreen();
|
|
||||||
}
|
|
||||||
|
|
||||||
HDC hFrameDC = FrameGetDC();
|
HDC hFrameDC = FrameGetDC();
|
||||||
|
|
||||||
if (hFrameDC)
|
if (hFrameDC)
|
||||||
|
@ -569,23 +523,3 @@ void WinVideo::DDUninit(void)
|
||||||
#undef SAFE_RELEASE
|
#undef SAFE_RELEASE
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
void WinVideo::Video_RedrawAndTakeScreenShot(const char* pScreenshotFilename)
|
|
||||||
{
|
|
||||||
_ASSERT(pScreenshotFilename);
|
|
||||||
if (!pScreenshotFilename)
|
|
||||||
return;
|
|
||||||
|
|
||||||
GetFrame().VideoRedrawScreen();
|
|
||||||
Video_SaveScreenShot(Video::SCREENSHOT_560x384, pScreenshotFilename);
|
|
||||||
}
|
|
||||||
|
|
||||||
//===========================================================================
|
|
||||||
//===========================================================================
|
|
||||||
|
|
||||||
// NB. Win32Frame, not WinVideo
|
|
||||||
void Win32Frame::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 );
|
|
||||||
}
|
|
||||||
|
|
|
@ -19,10 +19,7 @@ public:
|
||||||
virtual void Initialize(void);
|
virtual void Initialize(void);
|
||||||
virtual void Destroy(void);
|
virtual void Destroy(void);
|
||||||
|
|
||||||
virtual void VideoRedrawScreenDuringFullSpeed(DWORD dwCyclesThisFrame, bool bInit = false);
|
virtual void VideoPresentScreen(void);
|
||||||
virtual void VideoRedrawScreenAfterFullSpeed(DWORD dwCyclesThisFrame);
|
|
||||||
virtual void VideoRefreshScreen(uint32_t uRedrawWholeScreenVideoMode = 0, bool bRedrawWholeScreen = false);
|
|
||||||
virtual void Video_RedrawAndTakeScreenShot(const char* pScreenshotFilename);
|
|
||||||
virtual void ChooseMonochromeColor(void);
|
virtual void ChooseMonochromeColor(void);
|
||||||
virtual void Benchmark(void);
|
virtual void Benchmark(void);
|
||||||
virtual void DisplayLogo(void);
|
virtual void DisplayLogo(void);
|
||||||
|
|
Loading…
Add table
Reference in a new issue