2006-02-25 20:50:29 +00:00
|
|
|
#pragma once
|
|
|
|
|
2006-07-02 22:58:12 +00:00
|
|
|
// Types ____________________________________________________________
|
2011-01-08 02:58:20 +00:00
|
|
|
|
|
|
|
// NOTE: KEEP IN SYNC: VideoType_e g_aVideoChoices g_apVideoModeDesc
|
2011-02-15 17:16:36 +00:00
|
|
|
// NOTE: Used/Serialized by: g_eVideoType
|
2011-01-08 02:58:20 +00:00
|
|
|
enum VideoType_e
|
|
|
|
{
|
2011-02-15 17:16:36 +00:00
|
|
|
VT_MONO_HALFPIXEL_REAL // uses custom monochrome
|
2011-01-08 02:58:20 +00:00
|
|
|
, VT_COLOR_STANDARD
|
2011-02-19 22:14:08 +00:00
|
|
|
, VT_COLOR_TEXT_OPTIMIZED
|
|
|
|
, VT_COLOR_TVEMU
|
2011-02-15 17:16:36 +00:00
|
|
|
, VT_MONO_AMBER // now half pixel
|
|
|
|
, VT_MONO_GREEN // now half pixel
|
|
|
|
, VT_MONO_WHITE // now half pixel
|
2011-01-08 02:58:20 +00:00
|
|
|
, NUM_VIDEO_MODES
|
|
|
|
};
|
|
|
|
|
|
|
|
extern TCHAR g_aVideoChoices[];
|
|
|
|
extern char *g_apVideoModeDesc[ NUM_VIDEO_MODES ];
|
2006-02-25 20:50:29 +00:00
|
|
|
|
2006-07-02 09:56:50 +00:00
|
|
|
enum AppleFont_e
|
|
|
|
{
|
2006-07-03 15:27:19 +00:00
|
|
|
// 40-Column mode is 1x Zoom (default)
|
|
|
|
// 80-Column mode is ~0.75x Zoom (7 x 16)
|
|
|
|
// Tiny mode is 0.5 zoom (7x8) for debugger
|
2006-07-02 09:56:50 +00:00
|
|
|
APPLE_FONT_WIDTH = 14, // in pixels
|
|
|
|
APPLE_FONT_HEIGHT = 16, // in pixels
|
|
|
|
|
2006-07-03 15:27:19 +00:00
|
|
|
// Each cell has a reserved aligned pixel area (grid spacing)
|
2006-07-02 09:56:50 +00:00
|
|
|
APPLE_FONT_CELL_WIDTH = 16,
|
|
|
|
APPLE_FONT_CELL_HEIGHT = 16,
|
|
|
|
|
|
|
|
// The bitmap contains 3 regions
|
|
|
|
// Each region is 256x256 pixels = 16x16 chars
|
|
|
|
APPLE_FONT_X_REGIONSIZE = 256, // in pixelx
|
|
|
|
APPLE_FONT_Y_REGIONSIZE = 256, // in pixels
|
|
|
|
|
|
|
|
// Starting Y offsets (pixels) for the regions
|
|
|
|
APPLE_FONT_Y_APPLE_2PLUS = 0, // ][+
|
|
|
|
APPLE_FONT_Y_APPLE_80COL = 256, // //e (inc. Mouse Text)
|
|
|
|
APPLE_FONT_Y_APPLE_40COL = 512, // ][
|
|
|
|
};
|
|
|
|
|
2006-07-02 22:58:12 +00:00
|
|
|
// Globals __________________________________________________________
|
|
|
|
|
|
|
|
extern HBITMAP g_hLogoBitmap;
|
|
|
|
|
2009-02-14 03:49:22 +00:00
|
|
|
extern COLORREF monochrome; // saved
|
2009-02-16 19:27:07 +00:00
|
|
|
extern DWORD g_eVideoType; // saved
|
2009-02-14 03:49:22 +00:00
|
|
|
extern DWORD g_uHalfScanLines; // saved
|
2009-02-16 19:27:07 +00:00
|
|
|
extern LPBYTE g_pFramebufferbits;
|
2006-07-02 22:58:12 +00:00
|
|
|
|
2011-01-07 09:23:16 +00:00
|
|
|
typedef bool (*VideoUpdateFuncPtr_t)(int,int,int,int,int);
|
|
|
|
|
2006-07-02 22:58:12 +00:00
|
|
|
// Prototypes _______________________________________________________
|
|
|
|
|
2006-02-25 20:50:29 +00:00
|
|
|
void CreateColorMixMap();
|
|
|
|
|
|
|
|
BOOL VideoApparentlyDirty ();
|
|
|
|
void VideoBenchmark ();
|
|
|
|
void VideoChooseColor ();
|
|
|
|
void VideoDestroy ();
|
2012-12-29 14:53:52 +00:00
|
|
|
void VideoDrawLogoBitmap(HDC hDstDC, int xoff, int yoff, int srcw, int srch, int scale);
|
2006-02-25 20:50:29 +00:00
|
|
|
void VideoDisplayLogo ();
|
|
|
|
void VideoInitialize ();
|
|
|
|
void VideoRealizePalette (HDC);
|
2014-06-26 21:44:02 +00:00
|
|
|
VideoUpdateFuncPtr_t VideoRedrawScreen (UINT);
|
2011-01-07 09:23:16 +00:00
|
|
|
VideoUpdateFuncPtr_t VideoRedrawScreen ();
|
|
|
|
VideoUpdateFuncPtr_t VideoRefreshScreen ();
|
2006-02-25 20:50:29 +00:00
|
|
|
void VideoReinitialize ();
|
|
|
|
void VideoResetState ();
|
2007-08-06 21:38:35 +00:00
|
|
|
WORD VideoGetScannerAddress(bool* pbVblBar_OUT, const DWORD uExecutedCycles);
|
|
|
|
bool VideoGetVbl(DWORD uExecutedCycles);
|
Simplified and moved main-loop video update logic into Video.cpp.
Removed complex case below for:
. VideoHasRefreshed(), 'anyupdates'
. VideoCheckPage()
Detailed notes below.
---
Video updates in ContinueExecution() loop:
'anyupdates' gets set if there were any page-flip(s) in last ~17030 cycles:
anyupdates |= VideoHasRefreshed();
ie. VideoRefreshScreen() was called outside of this loop.
If there's been a call to VideoRefreshScreen() outside of this loop,
and then the video framebuffer gets written to, ie. VideoApparentlyDirty() returns TRUE,
then don't call VideoRefreshScreen() from this loop for 3 frames.
(If a VideoRefreshScreen() is called outside of this loop then restart the 3 frame count.)
So..
if the game is flipping, the VideoApparentlyDirty() will return FALSE (since game writes to other framebuffer).
if the game is not flipping, then VideoHasRefreshed() will return FALSE (since no flips occur).
Therefore this complex case above probably only arises at a boundary eg. when the game is transitioning between these 2 modes,
and so if the emulator does the very occasional screen update in this main loop, it is of no consequence.
(I guess this extra logic was to throttle video updates on very old slow machines)
---
VideoCheckPage(BOOL bForce) was called twice in main-loop:
UnexpectedPage if g_bVideoDisplayPage2 != SW_PAGE2
Once each time through the loop (ie. every 1ms), with bForce=0
if UnexpectedPage && >500ms since last flip then VideoRefreshScreen()
Once each video frame (ie. ~17030 cycles) when not flipping, with bForce=1
if UnexpectedPage then VideoRefreshScreen()
Basically this was all about supporting FullSpeed mode, and limiting the calls to VideoRefreshScreen().
2014-09-13 21:22:27 +00:00
|
|
|
void VideoEndOfVideoFrame(void);
|
|
|
|
|
|
|
|
bool VideoGetSW80COL(void);
|
|
|
|
bool VideoGetSWDHIRES(void);
|
|
|
|
bool VideoGetSWHIRES(void);
|
|
|
|
bool VideoGetSW80STORE(void);
|
|
|
|
bool VideoGetSWMIXED(void);
|
|
|
|
bool VideoGetSWPAGE2(void);
|
|
|
|
bool VideoGetSWTEXT(void);
|
|
|
|
bool VideoGetSWAltCharSet(void);
|
2006-02-25 20:50:29 +00:00
|
|
|
|
Simplified and moved main-loop video update logic into Video.cpp.
Removed complex case below for:
. VideoHasRefreshed(), 'anyupdates'
. VideoCheckPage()
Detailed notes below.
---
Video updates in ContinueExecution() loop:
'anyupdates' gets set if there were any page-flip(s) in last ~17030 cycles:
anyupdates |= VideoHasRefreshed();
ie. VideoRefreshScreen() was called outside of this loop.
If there's been a call to VideoRefreshScreen() outside of this loop,
and then the video framebuffer gets written to, ie. VideoApparentlyDirty() returns TRUE,
then don't call VideoRefreshScreen() from this loop for 3 frames.
(If a VideoRefreshScreen() is called outside of this loop then restart the 3 frame count.)
So..
if the game is flipping, the VideoApparentlyDirty() will return FALSE (since game writes to other framebuffer).
if the game is not flipping, then VideoHasRefreshed() will return FALSE (since no flips occur).
Therefore this complex case above probably only arises at a boundary eg. when the game is transitioning between these 2 modes,
and so if the emulator does the very occasional screen update in this main loop, it is of no consequence.
(I guess this extra logic was to throttle video updates on very old slow machines)
---
VideoCheckPage(BOOL bForce) was called twice in main-loop:
UnexpectedPage if g_bVideoDisplayPage2 != SW_PAGE2
Once each time through the loop (ie. every 1ms), with bForce=0
if UnexpectedPage && >500ms since last flip then VideoRefreshScreen()
Once each video frame (ie. ~17030 cycles) when not flipping, with bForce=1
if UnexpectedPage then VideoRefreshScreen()
Basically this was all about supporting FullSpeed mode, and limiting the calls to VideoRefreshScreen().
2014-09-13 21:22:27 +00:00
|
|
|
void VideoSetForceFullRedraw(void);
|
2008-08-25 05:25:27 +00:00
|
|
|
|
Simplified and moved main-loop video update logic into Video.cpp.
Removed complex case below for:
. VideoHasRefreshed(), 'anyupdates'
. VideoCheckPage()
Detailed notes below.
---
Video updates in ContinueExecution() loop:
'anyupdates' gets set if there were any page-flip(s) in last ~17030 cycles:
anyupdates |= VideoHasRefreshed();
ie. VideoRefreshScreen() was called outside of this loop.
If there's been a call to VideoRefreshScreen() outside of this loop,
and then the video framebuffer gets written to, ie. VideoApparentlyDirty() returns TRUE,
then don't call VideoRefreshScreen() from this loop for 3 frames.
(If a VideoRefreshScreen() is called outside of this loop then restart the 3 frame count.)
So..
if the game is flipping, the VideoApparentlyDirty() will return FALSE (since game writes to other framebuffer).
if the game is not flipping, then VideoHasRefreshed() will return FALSE (since no flips occur).
Therefore this complex case above probably only arises at a boundary eg. when the game is transitioning between these 2 modes,
and so if the emulator does the very occasional screen update in this main loop, it is of no consequence.
(I guess this extra logic was to throttle video updates on very old slow machines)
---
VideoCheckPage(BOOL bForce) was called twice in main-loop:
UnexpectedPage if g_bVideoDisplayPage2 != SW_PAGE2
Once each time through the loop (ie. every 1ms), with bForce=0
if UnexpectedPage && >500ms since last flip then VideoRefreshScreen()
Once each video frame (ie. ~17030 cycles) when not flipping, with bForce=1
if UnexpectedPage then VideoRefreshScreen()
Basically this was all about supporting FullSpeed mode, and limiting the calls to VideoRefreshScreen().
2014-09-13 21:22:27 +00:00
|
|
|
DWORD VideoGetSnapshot(SS_IO_Video* pSS);
|
|
|
|
DWORD VideoSetSnapshot(SS_IO_Video* pSS);
|
2008-08-25 05:25:27 +00:00
|
|
|
|
|
|
|
void _Video_Dirty();
|
|
|
|
void _Video_RedrawScreen( VideoUpdateFuncPtr_t update, bool bMixed = false );
|
|
|
|
void _Video_SetupBanks( bool bBank2 );
|
|
|
|
bool Update40ColCell (int x, int y, int xpixel, int ypixel, int offset);
|
|
|
|
bool Update80ColCell (int x, int y, int xpixel, int ypixel, int offset);
|
|
|
|
bool UpdateLoResCell (int x, int y, int xpixel, int ypixel, int offset);
|
|
|
|
bool UpdateDLoResCell (int x, int y, int xpixel, int ypixel, int offset);
|
|
|
|
bool UpdateHiResCell (int x, int y, int xpixel, int ypixel, int offset);
|
|
|
|
bool UpdateDHiResCell (int x, int y, int xpixel, int ypixel, int offset);
|
|
|
|
|
2008-08-25 01:10:37 +00:00
|
|
|
extern bool g_bDisplayPrintScreenFileName;
|
2013-12-23 03:20:54 +00:00
|
|
|
extern bool g_bShowPrintScreenWarningDialog;
|
|
|
|
|
2008-08-31 04:31:35 +00:00
|
|
|
void Video_ResetScreenshotCounter( char *pDiskImageFileName );
|
|
|
|
enum VideoScreenShot_e
|
|
|
|
{
|
|
|
|
SCREENSHOT_560x384 = 0,
|
|
|
|
SCREENSHOT_280x192
|
|
|
|
};
|
|
|
|
void Video_TakeScreenShot( int iScreenShotType );
|
2008-07-14 16:02:44 +00:00
|
|
|
|
2011-01-09 04:42:46 +00:00
|
|
|
// Win32/MSVC: __stdcall
|
|
|
|
BYTE VideoCheckMode (WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG uExecutedCycles);
|
|
|
|
BYTE VideoCheckVbl (WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG uExecutedCycles);
|
|
|
|
BYTE VideoSetMode (WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG uExecutedCycles);
|
2012-03-27 21:20:36 +00:00
|
|
|
|
|
|
|
void Config_Load_Video(void);
|
|
|
|
void Config_Save_Video(void);
|