mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-01-20 19:30:21 +00:00
Frame.cpp: move header constants into Frame.cpp and expose with accessor functions
This commit is contained in:
parent
03b4e889e5
commit
018e338612
@ -60,7 +60,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
static UINT16 g_AppleWinVersion[4] = {0};
|
||||
char VERSIONSTRING[16] = "xx.yy.zz.ww";
|
||||
|
||||
TCHAR *g_pAppTitle = TITLE_APPLE_2E_ENHANCED;
|
||||
TCHAR *g_pAppTitle = NULL;
|
||||
|
||||
eApple2Type g_Apple2Type = A2TYPE_APPLE2EENHANCED;
|
||||
|
||||
|
@ -9687,9 +9687,18 @@ void DebuggerMouseClick( int x, int y )
|
||||
|
||||
// do picking
|
||||
|
||||
int cx = (x - VIEWPORTX) / nFontWidth;
|
||||
int cy = (y - VIEWPORTY) / nFontHeight;
|
||||
|
||||
const int nOffsetX = IsFullScreen() ? GetFullScreenOffsetX() : Get3DBorderWidth();
|
||||
const int nOffsetY = IsFullScreen() ? GetFullScreenOffsetY() : Get3DBorderHeight();
|
||||
|
||||
const int nOffsetInScreenX = x - nOffsetX;
|
||||
const int nOffsetInScreenY = y - nOffsetY;
|
||||
|
||||
if (nOffsetInScreenX < 0 || nOffsetInScreenY < 0)
|
||||
return;
|
||||
|
||||
int cx = nOffsetInScreenX / nFontWidth;
|
||||
int cy = nOffsetInScreenY / nFontHeight;
|
||||
|
||||
#if _DEBUG
|
||||
char sText[ CONSOLE_WIDTH ];
|
||||
sprintf( sText, "x:%d y:%d cx:%d cy:%d", x, y, cx, cy );
|
||||
|
@ -539,7 +539,7 @@ HDC GetDebuggerMemDC(void)
|
||||
{
|
||||
HDC hFrameDC = FrameGetDC();
|
||||
g_hDebuggerMemDC = CreateCompatibleDC(hFrameDC);
|
||||
g_hDebuggerMemBM = CreateCompatibleBitmap(hFrameDC, FRAMEBUFFER_W, FRAMEBUFFER_H);
|
||||
g_hDebuggerMemBM = CreateCompatibleBitmap(hFrameDC, GetFrameBufferWidth(), GetFrameBufferHeight());
|
||||
SelectObject(g_hDebuggerMemDC, g_hDebuggerMemBM);
|
||||
}
|
||||
|
||||
@ -563,8 +563,8 @@ void StretchBltMemToFrameDC(void)
|
||||
int nViewportCX, nViewportCY;
|
||||
GetViewportCXCY(nViewportCX, nViewportCY);
|
||||
|
||||
int xdest = GetFullScreenOffsetX();
|
||||
int ydest = GetFullScreenOffsetY();
|
||||
int xdest = IsFullScreen() ? GetFullScreenOffsetX() : 0;
|
||||
int ydest = IsFullScreen() ? GetFullScreenOffsetY() : 0;
|
||||
int wdest = nViewportCX;
|
||||
int hdest = nViewportCY;
|
||||
|
||||
@ -574,7 +574,7 @@ void StretchBltMemToFrameDC(void)
|
||||
wdest, hdest, // int nWidthDest, int nHeightDest,
|
||||
GetDebuggerMemDC(), // HDC hdcSrc,
|
||||
0, 0, // int nXOriginSrc, int nYOriginSrc,
|
||||
FRAMEBUFFER_BORDERLESS_W, FRAMEBUFFER_BORDERLESS_H, // int nWidthSrc, int nHeightSrc,
|
||||
GetFrameBufferBorderlessWidth(), GetFrameBufferBorderlessHeight(), // int nWidthSrc, int nHeightSrc,
|
||||
SRCCOPY // DWORD dwRop
|
||||
);
|
||||
}
|
||||
|
110
source/Frame.cpp
110
source/Frame.cpp
@ -56,17 +56,19 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "Configuration\PropertySheet.h"
|
||||
#include "Debugger\Debug.h"
|
||||
|
||||
#define DIRECTX_PAGE_FLIP 1
|
||||
|
||||
//#define ENABLE_MENU 0
|
||||
|
||||
// Magic numbers (used by FrameCreateWindow to calc width/height):
|
||||
#define MAGICX 5 // 3D border between Apple window & Emulator's RHS buttons
|
||||
#define MAGICY 5 // 3D border between Apple window & Title bar
|
||||
|
||||
// 3D border around the 560x384 Apple II display
|
||||
#define VIEWPORTX 5
|
||||
#define VIEWPORTY 5
|
||||
|
||||
static const int kDEFAULT_VIEWPORT_SCALE = 2;
|
||||
int g_nViewportCX = FRAMEBUFFER_BORDERLESS_W * kDEFAULT_VIEWPORT_SCALE;
|
||||
int g_nViewportCY = FRAMEBUFFER_BORDERLESS_H * kDEFAULT_VIEWPORT_SCALE;
|
||||
int g_nViewportCX = GetFrameBufferBorderlessWidth() * kDEFAULT_VIEWPORT_SCALE;
|
||||
int g_nViewportCY = GetFrameBufferBorderlessHeight() * kDEFAULT_VIEWPORT_SCALE;
|
||||
static int g_nViewportScale = kDEFAULT_VIEWPORT_SCALE; // saved REGSAVE
|
||||
static int g_nMaxViewportScale = kDEFAULT_VIEWPORT_SCALE; // Max scale in Windowed mode with borders, buttons etc (full-screen may be +1)
|
||||
|
||||
@ -75,10 +77,10 @@ static int g_nMaxViewportScale = kDEFAULT_VIEWPORT_SCALE; // Max scale in Window
|
||||
#define BUTTONCX 45
|
||||
#define BUTTONCY 45
|
||||
// NB. FSxxx = FullScreen xxx
|
||||
#define FSVIEWPORTX (640-BUTTONCX-MAGICX-g_nViewportCX)
|
||||
#define FSVIEWPORTY ((480-g_nViewportCY)/2)
|
||||
#define FSBUTTONX (640-BUTTONCX)
|
||||
#define FSBUTTONY (((480-g_nViewportCY)/2)-1)
|
||||
//#define FSVIEWPORTX (640-BUTTONCX-MAGICX-g_nViewportCX)
|
||||
//#define FSVIEWPORTY ((480-g_nViewportCY)/2)
|
||||
//#define FSBUTTONX (640-BUTTONCX)
|
||||
//#define FSBUTTONY (((480-g_nViewportCY)/2)-1)
|
||||
#define BUTTONS 8
|
||||
|
||||
static HBITMAP g_hCapsLockBitmap[2];
|
||||
@ -130,7 +132,7 @@ static HDC g_hFrameDC = (HDC)0;
|
||||
static RECT framerect = {0,0,0,0};
|
||||
|
||||
HWND g_hFrameWindow = (HWND)0;
|
||||
static BOOL g_bIsFullScreen = 0;
|
||||
static bool g_bIsFullScreen = false;
|
||||
BOOL g_bConfirmReboot = 1; // saved PageConfig REGSAVE
|
||||
BOOL g_bMultiMon = 0; // OFF = load window position & clamp initial frame to screen, ON = use window position as is
|
||||
|
||||
@ -142,15 +144,18 @@ static BOOL g_bUsingCursor = 0; // 1=AppleWin is using (hiding) the mouse-cu
|
||||
static int viewportx = VIEWPORTX; // Default to Normal (non-FullScreen) mode
|
||||
static int viewporty = VIEWPORTY; // Default to Normal (non-FullScreen) mode
|
||||
|
||||
#if 0 // TC: Redundant
|
||||
// Direct Draw -- For Full Screen
|
||||
// LPDIRECTDRAW g_pDD = (LPDIRECTDRAW)0;
|
||||
LPDIRECTDRAWSURFACE g_pDDPrimarySurface = (LPDIRECTDRAWSURFACE)0;
|
||||
// LPDIRECTDRAWSURFACE g_pDDPrimarySurface = (LPDIRECTDRAWSURFACE)0;
|
||||
#define DIRECTX_PAGE_FLIP 1
|
||||
#if DIRECTX_PAGE_FLIP
|
||||
LPDIRECTDRAWSURFACE g_pDDBackSurface = (LPDIRECTDRAWSURFACE)0;
|
||||
// LPDIRECTDRAWSURFACE g_pDDBackSurface = (LPDIRECTDRAWSURFACE)0;
|
||||
#endif
|
||||
HDC g_hDDdc = 0;
|
||||
// HDC g_hDDdc = 0;
|
||||
// int g_nDDFullScreenW = 640;
|
||||
// int g_nDDFullScreenH = 480;
|
||||
#endif
|
||||
|
||||
static bool g_bShowingCursor = true;
|
||||
static bool g_bLastCursorInAppleViewport = false;
|
||||
@ -189,12 +194,72 @@ static int g_win_fullscreen_offsety = 0;
|
||||
static void FrameResizeWindow(int nNewScale);
|
||||
|
||||
|
||||
TCHAR g_pAppleWindowTitle[ 128 ] = "";
|
||||
// ==========================================================================
|
||||
|
||||
// Updates g_pAppTitle
|
||||
// ====================================================================
|
||||
// Display construction:
|
||||
// . Apple II video gets rendered to the framebuffer (maybe with some preliminary/final NTSC data in the border areas)
|
||||
// . The *borderless* framebuffer is stretchblt() copied to the frame DC, in VideoRefreshScreen()
|
||||
// . Draw cross-hairs (if using mouse as either a mouse or joystick) to frame DC
|
||||
// . In Windowed mode:
|
||||
// - Draw 3D border, 8x buttons, status area (disk LEDs, caps) to frame DC
|
||||
// . In Fullscreen mode:
|
||||
// - Optional: Draw status area to frame DC
|
||||
//
|
||||
|
||||
#define FRAMEBUFFER_BORDERLESS_W 560 // 560 = Double Hi-Res
|
||||
#define FRAMEBUFFER_BORDERLESS_H 384 // 384 = Double Scan Line
|
||||
|
||||
// NB. This border area is not visible (... and this border area is unrelated to the 3D border below)
|
||||
#define BORDER_W 20
|
||||
#define BORDER_H 18
|
||||
|
||||
UINT GetFrameBufferBorderlessWidth(void)
|
||||
{
|
||||
return FRAMEBUFFER_BORDERLESS_W;
|
||||
}
|
||||
|
||||
UINT GetFrameBufferBorderlessHeight(void)
|
||||
{
|
||||
return FRAMEBUFFER_BORDERLESS_H;
|
||||
}
|
||||
|
||||
UINT GetFrameBufferBorderWidth(void)
|
||||
{
|
||||
return BORDER_W;
|
||||
}
|
||||
|
||||
UINT GetFrameBufferBorderHeight(void)
|
||||
{
|
||||
return BORDER_H;
|
||||
}
|
||||
|
||||
UINT GetFrameBufferWidth(void)
|
||||
{
|
||||
return GetFrameBufferBorderlessWidth() + 2*GetFrameBufferBorderWidth();
|
||||
}
|
||||
|
||||
UINT GetFrameBufferHeight(void)
|
||||
{
|
||||
return GetFrameBufferBorderlessHeight() + 2*GetFrameBufferBorderHeight();
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
UINT Get3DBorderWidth(void)
|
||||
{
|
||||
return IsFullScreen() ? 0 : VIEWPORTX;
|
||||
}
|
||||
|
||||
UINT Get3DBorderHeight(void)
|
||||
{
|
||||
return IsFullScreen() ? 0 : VIEWPORTY;
|
||||
}
|
||||
|
||||
// ==========================================================================
|
||||
static void GetAppleWindowTitle()
|
||||
{
|
||||
static TCHAR g_pAppleWindowTitle[ 128 ] = "";
|
||||
|
||||
g_pAppTitle = g_pAppleWindowTitle;
|
||||
|
||||
switch (g_Apple2Type)
|
||||
@ -236,8 +301,6 @@ static void GetAppleWindowTitle()
|
||||
case MODE_PAUSED : _tcscat(g_pAppleWindowTitle,TEXT(" [")); _tcscat(g_pAppleWindowTitle,TITLE_PAUSED ); _tcscat(g_pAppleWindowTitle,TEXT("]")); break;
|
||||
case MODE_STEPPING: _tcscat(g_pAppleWindowTitle,TEXT(" [")); _tcscat(g_pAppleWindowTitle,TITLE_STEPPING); _tcscat(g_pAppleWindowTitle,TEXT("]")); break;
|
||||
}
|
||||
|
||||
g_pAppTitle = g_pAppleWindowTitle;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
@ -636,7 +699,7 @@ static bool g_bFullScreen_ShowSubunitStatus = true;
|
||||
|
||||
bool IsFullScreen(void)
|
||||
{
|
||||
return g_bIsFullScreen ? true : false;
|
||||
return g_bIsFullScreen;
|
||||
}
|
||||
|
||||
bool GetFullScreenShowSubunitStatus(void)
|
||||
@ -2197,8 +2260,8 @@ void SetFullScreenMode ()
|
||||
|
||||
buttonx = GetFullScreenOffsetX() + g_nViewportCX + VIEWPORTX*2;
|
||||
buttony = GetFullScreenOffsetY();
|
||||
viewportx = VIEWPORTX;
|
||||
viewporty = g_bIsFullScreen ? 0 : VIEWPORTY; // GH#464
|
||||
viewportx = VIEWPORTX; // TC-TODO: Should be zero too? (Since there's no 3D border in full-screen)
|
||||
viewporty = 0; // GH#464
|
||||
#endif
|
||||
|
||||
// GetWindowRect(g_hFrameWindow,&framerect);
|
||||
@ -2236,7 +2299,6 @@ void SetFullScreenMode ()
|
||||
//===========================================================================
|
||||
void SetNormalMode ()
|
||||
{
|
||||
// g_bIsFullScreen = false;
|
||||
buttonover = -1;
|
||||
buttonx = BUTTONX;
|
||||
buttony = BUTTONY;
|
||||
@ -2513,6 +2575,7 @@ HDC FrameGetVideoDC (LPBYTE *pAddr_, LONG *pPitch_)
|
||||
{
|
||||
HDC hDC = 0;
|
||||
|
||||
#if 0 // TC: just wrapping existing "if (false)" code in "#if 0" to make it clear that it's dead code
|
||||
// ASSERT( pAddr_ );
|
||||
// ASSERT( pPitch_ );
|
||||
if (false) // TODO: ...
|
||||
@ -2544,9 +2607,10 @@ HDC FrameGetVideoDC (LPBYTE *pAddr_, LONG *pPitch_)
|
||||
hDC = 0;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
*pAddr_ = g_pFramebufferbits;
|
||||
*pPitch_ = FRAMEBUFFER_W;
|
||||
*pPitch_ = GetFrameBufferWidth();
|
||||
hDC = FrameGetDC();
|
||||
}
|
||||
|
||||
@ -2592,6 +2656,7 @@ void FrameReleaseDC () {
|
||||
//===========================================================================
|
||||
void FrameReleaseVideoDC ()
|
||||
{
|
||||
#if 0 // TC: just wrapping existing "if (false)" code in "#if 0" to make it clear that it's dead code
|
||||
if (false) // TODO: ...
|
||||
//if (g_bIsFullScreen && g_bAppActive && !g_bPaintingWindow)
|
||||
{
|
||||
@ -2616,6 +2681,7 @@ void FrameReleaseVideoDC ()
|
||||
g_pDDPrimarySurface->ReleaseDC( g_hDDdc ); // NTSC Full Screen
|
||||
g_hDDdc = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -6,29 +6,6 @@
|
||||
// Keyboard -- keystroke type
|
||||
enum {NOT_ASCII=0, ASCII};
|
||||
|
||||
// 3D Border
|
||||
#define VIEWPORTX 5
|
||||
#define VIEWPORTY 5
|
||||
|
||||
// 560 = Double Hi-Res
|
||||
// 384 = Double Scan Line
|
||||
#define FRAMEBUFFER_BORDERLESS_W 560
|
||||
#define FRAMEBUFFER_BORDERLESS_H 384
|
||||
// NTSC_BEGIN
|
||||
#if 0
|
||||
// TC: No good as NTSC render code writes to border area:
|
||||
// . NTSC.cpp: updateVideoScannerHorzEOL(): "NOTE: This writes out-of-bounds for a 560x384 framebuffer"
|
||||
#define BORDER_W 0
|
||||
#define BORDER_H 0
|
||||
#define FRAMEBUFFER_W FRAMEBUFFER_BORDERLESS_W
|
||||
#define FRAMEBUFFER_H FRAMEBUFFER_BORDERLESS_H
|
||||
#else
|
||||
#define BORDER_W 20
|
||||
#define BORDER_H 18
|
||||
#define FRAMEBUFFER_W (FRAMEBUFFER_BORDERLESS_W + BORDER_W*2)
|
||||
#define FRAMEBUFFER_H (FRAMEBUFFER_BORDERLESS_H + BORDER_H*2)
|
||||
#endif
|
||||
// NTSC_END
|
||||
|
||||
// Win32
|
||||
extern HWND g_hFrameWindow;
|
||||
@ -77,3 +54,12 @@
|
||||
|
||||
int GetFullScreenOffsetX(void);
|
||||
int GetFullScreenOffsetY(void);
|
||||
|
||||
UINT GetFrameBufferBorderlessWidth(void);
|
||||
UINT GetFrameBufferBorderlessHeight(void);
|
||||
UINT GetFrameBufferBorderWidth(void);
|
||||
UINT GetFrameBufferBorderHeight(void);
|
||||
UINT GetFrameBufferWidth(void);
|
||||
UINT GetFrameBufferHeight(void);
|
||||
UINT Get3DBorderWidth(void);
|
||||
UINT Get3DBorderHeight(void);
|
||||
|
@ -134,6 +134,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
static bgra_t *g_pVideoAddress = 0;
|
||||
static bgra_t *g_pScanLines[VIDEO_SCANNER_Y_DISPLAY*2]; // To maintain the 280x192 aspect ratio for 560px width, we double every scan line -> 560x384
|
||||
|
||||
static const UINT g_kFrameBufferWidth = GetFrameBufferWidth();
|
||||
|
||||
static unsigned (*g_pHorzClockOffset)[VIDEO_SCANNER_MAX_HORZ] = 0;
|
||||
|
||||
typedef void (*UpdateScreenFunc_t)(long);
|
||||
@ -486,19 +488,19 @@ inline uint32_t getScanlineColor( const uint16_t signal, const bgra_t *pTable )
|
||||
//===========================================================================
|
||||
inline uint32_t* getScanlineNext1Address()
|
||||
{
|
||||
return (uint32_t*) (g_pVideoAddress - 1*FRAMEBUFFER_W);
|
||||
return (uint32_t*) (g_pVideoAddress - 1*g_kFrameBufferWidth);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
inline uint32_t* getScanlinePrev1Address()
|
||||
{
|
||||
return (uint32_t*) (g_pVideoAddress + 1*FRAMEBUFFER_W);
|
||||
return (uint32_t*) (g_pVideoAddress + 1*g_kFrameBufferWidth);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
inline uint32_t* getScanlinePrev2Address()
|
||||
{
|
||||
return (uint32_t*) (g_pVideoAddress + 2*FRAMEBUFFER_W);
|
||||
return (uint32_t*) (g_pVideoAddress + 2*g_kFrameBufferWidth);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
@ -1616,7 +1618,7 @@ void NTSC_VideoInit( uint8_t* pFramebuffer ) // wsVideoInit
|
||||
updateMonochromeTables( 0xFF, 0xFF, 0xFF );
|
||||
|
||||
for (int y = 0; y < (VIDEO_SCANNER_Y_DISPLAY*2); y++)
|
||||
g_pScanLines[y] = (bgra_t*)(g_pFramebufferbits + sizeof(bgra_t) * FRAMEBUFFER_W * ((FRAMEBUFFER_H - 1) - y - BORDER_H) + (sizeof(bgra_t) * BORDER_W));
|
||||
g_pScanLines[y] = (bgra_t*)(g_pFramebufferbits + sizeof(bgra_t) * GetFrameBufferWidth() * ((GetFrameBufferHeight() - 1) - y - GetFrameBufferBorderHeight()) + (sizeof(bgra_t) * GetFrameBufferBorderWidth()));
|
||||
|
||||
g_pVideoAddress = g_pScanLines[0];
|
||||
|
||||
|
@ -148,8 +148,8 @@ void VideoInitialize ()
|
||||
|
||||
ZeroMemory(g_pFramebufferinfo,sizeof(BITMAPINFOHEADER)+256*sizeof(RGBQUAD));
|
||||
g_pFramebufferinfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
||||
g_pFramebufferinfo->bmiHeader.biWidth = FRAMEBUFFER_W;
|
||||
g_pFramebufferinfo->bmiHeader.biHeight = FRAMEBUFFER_H;
|
||||
g_pFramebufferinfo->bmiHeader.biWidth = GetFrameBufferWidth();
|
||||
g_pFramebufferinfo->bmiHeader.biHeight = GetFrameBufferHeight();
|
||||
g_pFramebufferinfo->bmiHeader.biPlanes = 1;
|
||||
g_pFramebufferinfo->bmiHeader.biBitCount = 32;
|
||||
g_pFramebufferinfo->bmiHeader.biCompression = BI_RGB;
|
||||
@ -674,12 +674,12 @@ void VideoRefreshScreen ( uint32_t uRedrawWholeScreenVideoMode /* =0*/, bool bRe
|
||||
if (hFrameDC)
|
||||
{
|
||||
{
|
||||
int xSrc = BORDER_W;
|
||||
int ySrc = BORDER_H;
|
||||
int xSrc = GetFrameBufferBorderWidth();
|
||||
int ySrc = GetFrameBufferBorderHeight();
|
||||
VideoFrameBufferAdjust(xSrc, ySrc); // TC: Hacky-fix for GH#341
|
||||
|
||||
int xdest = GetFullScreenOffsetX();
|
||||
int ydest = GetFullScreenOffsetY();
|
||||
int xdest = IsFullScreen() ? GetFullScreenOffsetX() : 0;
|
||||
int ydest = IsFullScreen() ? GetFullScreenOffsetY() : 0;
|
||||
int wdest = g_nViewportCX;
|
||||
int hdest = g_nViewportCY;
|
||||
|
||||
@ -690,7 +690,7 @@ void VideoRefreshScreen ( uint32_t uRedrawWholeScreenVideoMode /* =0*/, bool bRe
|
||||
wdest, hdest,
|
||||
g_hDeviceDC,
|
||||
xSrc, ySrc,
|
||||
FRAMEBUFFER_BORDERLESS_W, FRAMEBUFFER_BORDERLESS_H,
|
||||
GetFrameBufferBorderlessWidth(), GetFrameBufferBorderlessHeight(),
|
||||
SRCCOPY);
|
||||
}
|
||||
}
|
||||
@ -1122,8 +1122,8 @@ static void Video_MakeScreenShot(FILE *pFile, const VideoScreenShot_e ScreenShot
|
||||
|
||||
Video_SetBitmapHeader(
|
||||
pBmp,
|
||||
ScreenShotType == SCREENSHOT_280x192 ? FRAMEBUFFER_BORDERLESS_W/2 : FRAMEBUFFER_BORDERLESS_W,
|
||||
ScreenShotType == SCREENSHOT_280x192 ? FRAMEBUFFER_BORDERLESS_H/2 : FRAMEBUFFER_BORDERLESS_H,
|
||||
ScreenShotType == SCREENSHOT_280x192 ? GetFrameBufferBorderlessWidth()/2 : GetFrameBufferBorderlessWidth(),
|
||||
ScreenShotType == SCREENSHOT_280x192 ? GetFrameBufferBorderlessHeight()/2 : GetFrameBufferBorderlessHeight(),
|
||||
32
|
||||
);
|
||||
|
||||
@ -1153,17 +1153,17 @@ static void Video_MakeScreenShot(FILE *pFile, const VideoScreenShot_e ScreenShot
|
||||
// @reference: "Storing an Image" http://msdn.microsoft.com/en-us/library/ms532340(VS.85).aspx
|
||||
pSrc = (uint32_t*) g_pFramebufferbits;
|
||||
|
||||
int xSrc = BORDER_W;
|
||||
int ySrc = BORDER_H;
|
||||
int xSrc = GetFrameBufferBorderWidth();
|
||||
int ySrc = GetFrameBufferBorderHeight();
|
||||
VideoFrameBufferAdjust(xSrc, ySrc, true); // TC: Hacky-fix for GH#341 & GH#356
|
||||
// Lines stored in reverse, so invert the y-adjust value
|
||||
|
||||
pSrc += xSrc; // Skip left border
|
||||
pSrc += ySrc * FRAMEBUFFER_W; // Skip top border
|
||||
pSrc += xSrc; // Skip left border
|
||||
pSrc += ySrc * GetFrameBufferWidth(); // Skip top border
|
||||
|
||||
if( ScreenShotType == SCREENSHOT_280x192 )
|
||||
{
|
||||
pSrc += FRAMEBUFFER_W; // Start on odd scanline (otherwise for 50% scanline mode get an all black image!)
|
||||
pSrc += GetFrameBufferWidth(); // Start on odd scanline (otherwise for 50% scanline mode get an all black image!)
|
||||
|
||||
uint32_t aScanLine[ 280 ];
|
||||
uint32_t *pDst;
|
||||
@ -1171,25 +1171,25 @@ static void Video_MakeScreenShot(FILE *pFile, const VideoScreenShot_e ScreenShot
|
||||
// 50% Half Scan Line clears every odd scanline.
|
||||
// SHIFT+PrintScreen saves only the even rows.
|
||||
// NOTE: Keep in sync with _Video_RedrawScreen() & Video_MakeScreenShot()
|
||||
for( int y = 0; y < FRAMEBUFFER_BORDERLESS_H/2; y++ )
|
||||
for( UINT y = 0; y < GetFrameBufferBorderlessHeight()/2; y++ )
|
||||
{
|
||||
pDst = aScanLine;
|
||||
for( int x = 0; x < FRAMEBUFFER_BORDERLESS_W/2; x++ )
|
||||
for( UINT x = 0; x < GetFrameBufferBorderlessWidth()/2; x++ )
|
||||
{
|
||||
*pDst++ = pSrc[1]; // correction for left edge loss of scaled scanline [Bill Buckel, B#18928]
|
||||
pSrc += 2; // skip odd pixels
|
||||
}
|
||||
fwrite( aScanLine, sizeof(uint32_t), FRAMEBUFFER_BORDERLESS_W/2, pFile );
|
||||
pSrc += FRAMEBUFFER_W; // scan lines doubled - skip odd ones
|
||||
pSrc += BORDER_W*2; // Skip right border & next line's left border
|
||||
fwrite( aScanLine, sizeof(uint32_t), GetFrameBufferBorderlessWidth()/2, pFile );
|
||||
pSrc += GetFrameBufferWidth(); // scan lines doubled - skip odd ones
|
||||
pSrc += GetFrameBufferBorderWidth()*2; // Skip right border & next line's left border
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for( int y = 0; y < FRAMEBUFFER_BORDERLESS_H; y++ )
|
||||
for( UINT y = 0; y < GetFrameBufferBorderlessHeight(); y++ )
|
||||
{
|
||||
fwrite( pSrc, sizeof(uint32_t), FRAMEBUFFER_BORDERLESS_W, pFile );
|
||||
pSrc += FRAMEBUFFER_W;
|
||||
fwrite( pSrc, sizeof(uint32_t), GetFrameBufferBorderlessWidth(), pFile );
|
||||
pSrc += GetFrameBufferWidth();
|
||||
}
|
||||
}
|
||||
#endif // SCREENSHOT_BMP
|
||||
@ -1268,7 +1268,7 @@ static void videoCreateDIBSection()
|
||||
|
||||
// CREATE THE OFFSET TABLE FOR EACH SCAN LINE IN THE FRAME BUFFER
|
||||
// DRAW THE SOURCE IMAGE INTO THE SOURCE BIT BUFFER
|
||||
ZeroMemory( g_pFramebufferbits, FRAMEBUFFER_W*FRAMEBUFFER_H*4 );
|
||||
ZeroMemory( g_pFramebufferbits, GetFrameBufferWidth()*GetFrameBufferHeight()*sizeof(bgra_t) );
|
||||
|
||||
NTSC_VideoInit( g_pFramebufferbits );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user