AppleWin 1.22.0:
. [Feature #003272 and #005335] Support 2x windowed mode: - Toggle between 1x and 2x by using Resize button (or F6). - Full screen now enabled by CTRL+Resize button (or CTRL+F6). * Based on Sheldon's patch with extensions for Registry persistence, mouse-hover tips & debugger view support. . [Bug #018455] Improved rendering speed of debugger view. * Now all debugger objects are drawn to a memDC, then StretchBlt'd to the frameDC at the end of the frame update.
This commit is contained in:
parent
fa0110000b
commit
1e5c1257d2
13 changed files with 366 additions and 195 deletions
|
@ -19,11 +19,22 @@ Restrictions/bugs:
|
|||
|
||||
Next release:
|
||||
-------------
|
||||
TBC
|
||||
|
||||
1.22.0 - 1 Jan 2013
|
||||
--------------------
|
||||
Changes:
|
||||
. [Feature #005557] Support DOSMaster image created by Apple Oasis.
|
||||
. [Feature #003272 and #005335] Support 2x windowed mode:
|
||||
- Toggle between 1x and 2x by using Resize button (or F6).
|
||||
- Full screen now enabled by CTRL+Resize button (or CTRL+F6).
|
||||
|
||||
Fixes:
|
||||
. [Feature #004346] Don't show mousetext for original Apple //e.
|
||||
. Fixed HDD firmware to allow epyx_californiagames_iicplus.2mg to boot.
|
||||
Changes:
|
||||
. [Feature #005557] Support DOSMaster image created by Apple Oasis.
|
||||
. HDD firmware: Added support for SmartPort entrypoint.
|
||||
- "Prince of Persia (Original 3.5 floppy for IIc+).2mg" now boots
|
||||
. [Bug #018455] Improved rendering speed of debugger view.
|
||||
|
||||
|
||||
1.21.1 - 12 Aug 2012
|
||||
|
|
|
@ -253,8 +253,8 @@ DISK_ICON ICON "DISK.ICO"
|
|||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,21,1,0
|
||||
PRODUCTVERSION 1,21,1,0
|
||||
FILEVERSION 1,22,0,0
|
||||
PRODUCTVERSION 1,22,0,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
|
@ -272,12 +272,12 @@ BEGIN
|
|||
VALUE "Comments", "http://applewin.berlios.de"
|
||||
VALUE "CompanyName", "AppleWin"
|
||||
VALUE "FileDescription", "Apple //e Emulator for Windows"
|
||||
VALUE "FileVersion", "1, 21, 1, 0"
|
||||
VALUE "FileVersion", "1, 22, 0, 0"
|
||||
VALUE "InternalName", "APPLEWIN"
|
||||
VALUE "LegalCopyright", " 1994-2012 Michael O'Brien, Oliver Schmidt, Tom Charlesworth, Michael Pohoreski, Nick Westgate, Linards Ticmanis"
|
||||
VALUE "LegalCopyright", " 1994-2013 Michael O'Brien, Oliver Schmidt, Tom Charlesworth, Michael Pohoreski, Nick Westgate, Linards Ticmanis"
|
||||
VALUE "OriginalFilename", "APPLEWIN.EXE"
|
||||
VALUE "ProductName", "Apple //e Emulator"
|
||||
VALUE "ProductVersion", "1, 21, 1, 0"
|
||||
VALUE "ProductVersion", "1, 22, 0, 0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
|
|
@ -568,6 +568,9 @@ void LoadConfiguration()
|
|||
char szUthernetInt[MAX_PATH] = {0};
|
||||
RegLoadString(TEXT(REG_CONFIG),TEXT("Uthernet Interface"),1,szUthernetInt,MAX_PATH);
|
||||
update_tfe_interface(szUthernetInt,NULL);
|
||||
|
||||
if (REGLOAD(TEXT(REGVALUE_WINDOW_SCALE), &dwTmp))
|
||||
SetViewportScale(dwTmp);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -970,8 +973,7 @@ int APIENTRY WinMain (HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
|
|||
|
||||
if(bSetFullScreen)
|
||||
{
|
||||
PostMessage(g_hFrameWindow, WM_KEYDOWN, VK_F1+BTN_FULLSCR, 0);
|
||||
PostMessage(g_hFrameWindow, WM_KEYUP, VK_F1+BTN_FULLSCR, 0);
|
||||
PostMessage(g_hFrameWindow, WM_USER_FULLSCREEN, 0, 0);
|
||||
bSetFullScreen = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -100,6 +100,7 @@ enum AppMode_e
|
|||
#define REGVALUE_ENHANCE_DISK_SPEED "Enhance Disk Speed"
|
||||
#define REGVALUE_CUSTOM_SPEED "Custom Speed"
|
||||
#define REGVALUE_EMULATION_SPEED "Emulation Speed"
|
||||
#define REGVALUE_WINDOW_SCALE "Window Scale"
|
||||
#define REGVALUE_SLOT1 "Slot 1"
|
||||
#define REGVALUE_SLOT2 "Slot 2"
|
||||
#define REGVALUE_SLOT3 "Slot 3"
|
||||
|
@ -128,6 +129,7 @@ enum AppMode_e
|
|||
#define VK_SNAPSHOT_280 WM_USER+6
|
||||
#define WM_USER_TCP_SERIAL WM_USER+7
|
||||
#define WM_USER_BOOT WM_USER+8
|
||||
#define WM_USER_FULLSCREEN WM_USER+9
|
||||
|
||||
typedef BYTE (__stdcall *iofunction)(WORD nPC, WORD nAddr, BYTE nWriteFlag, BYTE nWriteValue, ULONG nCyclesLeft);
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
//#pragma warning(disable: 4786)
|
||||
|
||||
#include "StdAfx.h"
|
||||
#include "debugger_display.h" // dup from stdafx.h, but CPP analysis isn't picking up APPLE_FONT_NEW
|
||||
|
||||
// #define DEBUG_COMMAND_HELP 1
|
||||
// #define DEBUG_ASM_HASH 1
|
||||
|
@ -7120,8 +7121,9 @@ bool ProfileSave()
|
|||
//===========================================================================
|
||||
void DebugBegin ()
|
||||
{
|
||||
// This is called every time the emulator is reset.
|
||||
// And everytime the debugger is entered.
|
||||
// This is called every time the debugger is entered.
|
||||
|
||||
GetDebuggerMemDC();
|
||||
|
||||
g_nAppMode = MODE_DEBUG;
|
||||
FrameRefreshStatus(DRAW_TITLE);
|
||||
|
@ -7255,15 +7257,11 @@ void DebugDestroy ()
|
|||
}
|
||||
// TODO: DataDisassembly_Clear()
|
||||
|
||||
SelectObject( g_hFrameDC, GetStockObject(NULL_BRUSH) );
|
||||
|
||||
DeleteObject( g_hConsoleBrushFG );
|
||||
DeleteObject( g_hConsoleBrushBG );
|
||||
|
||||
DeleteDC( g_hConsoleFontDC );
|
||||
DeleteObject( g_hConsoleFontBitmap );
|
||||
|
||||
// ReleaseDC( g_hFrameWindow, g_hFrameDC );
|
||||
}
|
||||
|
||||
|
||||
|
@ -7287,6 +7285,8 @@ void DebugEnd ()
|
|||
g_vMemorySearchResults.erase( g_vMemorySearchResults.begin(), g_vMemorySearchResults.end() );
|
||||
|
||||
g_nAppMode = MODE_RUNNING;
|
||||
|
||||
ReleaseDebuggerMemDC();
|
||||
}
|
||||
|
||||
|
||||
|
@ -7400,19 +7400,18 @@ void DebugInitialize ()
|
|||
DWORD nError = 0;
|
||||
#endif
|
||||
|
||||
// g_hDstDC = g_hFrameDC; //GetDC( g_hFrameWindow );
|
||||
#if _DEBUG
|
||||
nError = GetLastError();
|
||||
#endif
|
||||
|
||||
// Must select a bitmap into the temp DC !
|
||||
HDC hTmpDC = CreateCompatibleDC( g_hFrameDC );
|
||||
HDC hTmpDC = CreateCompatibleDC( FrameGetDC() );
|
||||
|
||||
#if _DEBUG
|
||||
nError = GetLastError();
|
||||
#endif
|
||||
|
||||
g_hConsoleFontDC = CreateCompatibleDC( g_hFrameDC );
|
||||
g_hConsoleFontDC = CreateCompatibleDC( FrameGetDC() );
|
||||
#if _DEBUG
|
||||
nError = GetLastError();
|
||||
#endif
|
||||
|
@ -7468,8 +7467,6 @@ void DebugInitialize ()
|
|||
DeleteObject( hTmpDC );
|
||||
#endif
|
||||
|
||||
// DeleteDC( g_hFrameDC ); g_hDstDC = NULL;
|
||||
|
||||
ZeroMemory( g_aConsoleDisplay, sizeof( g_aConsoleDisplay ) ); // CONSOLE_WIDTH * CONSOLE_HEIGHT );
|
||||
ConsoleInputReset();
|
||||
|
||||
|
@ -7686,9 +7683,8 @@ void DebuggerInputConsoleChar( TCHAR ch )
|
|||
|
||||
DebuggerCursorNext();
|
||||
|
||||
FrameGetDC();
|
||||
DrawConsoleInput();
|
||||
FrameReleaseDC();
|
||||
StretchBltMemToFrameDC();
|
||||
}
|
||||
else
|
||||
if (ch == 0x16) // HACK: Ctrl-V. WTF!?
|
||||
|
@ -8244,10 +8240,9 @@ void DebuggerCursorUpdate()
|
|||
nBeg = nNow;
|
||||
|
||||
DebuggerCursorNext();
|
||||
|
||||
FrameGetDC();
|
||||
|
||||
DrawConsoleCursor();
|
||||
FrameReleaseDC();
|
||||
StretchBltMemToFrameDC();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -8275,16 +8270,15 @@ void DebuggerCursorNext()
|
|||
|
||||
|
||||
//===========================================================================
|
||||
void DebuggerMouseClick( int x, int y )
|
||||
void DebuggerMouseClick( int x, int y )
|
||||
{
|
||||
if (g_nAppMode != MODE_DEBUG)
|
||||
return;
|
||||
|
||||
int nFontWidth = g_aFontConfig[ FONT_DISASM_DEFAULT ]._nFontWidthAvg;
|
||||
int nFontHeight = g_aFontConfig[ FONT_DISASM_DEFAULT ]._nLineHeight ;
|
||||
int nFontWidth = g_aFontConfig[ FONT_DISASM_DEFAULT ]._nFontWidthAvg * GetViewportScale();
|
||||
int nFontHeight = g_aFontConfig[ FONT_DISASM_DEFAULT ]._nLineHeight * GetViewportScale();
|
||||
|
||||
// do picking
|
||||
FrameGetDC();
|
||||
|
||||
int cx = (x - VIEWPORTX) / nFontWidth;
|
||||
int cy = (y - VIEWPORTY) / nFontHeight;
|
||||
|
@ -8357,6 +8351,4 @@ void DebuggerMouseClick( int x, int y )
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
FrameReleaseDC();
|
||||
}
|
||||
|
|
|
@ -168,7 +168,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
{TEXT("?") , CmdHelpList , CMD_HELP_LIST , "List all available commands" },
|
||||
{TEXT("HELP") , CmdHelpSpecific , CMD_HELP_SPECIFIC , "Help on specific command" },
|
||||
{TEXT("VERSION") , CmdVersion , CMD_VERSION , "Displays version of emulator/debugger" },
|
||||
{TEXT("MOTD") , CmdMOTD , CMD_MOTD },
|
||||
{TEXT("MOTD") , CmdMOTD , CMD_MOTD }, // MOTD: Message Of The Day
|
||||
// Memory
|
||||
{TEXT("MC") , CmdMemoryCompare , CMD_MEMORY_COMPARE },
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
*/
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "debugger_display.h" // dup from stdafx.h, but CPP analysis isn't picking up USE_APPLE_FONT
|
||||
|
||||
// NEW UI debugging - force display ALL meta-info (regs, stack, bp, watches, zp) for debugging purposes
|
||||
#define DEBUG_FORCE_DISPLAY 0
|
||||
|
@ -66,7 +66,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
// HACK
|
||||
|
||||
// Display - Win32
|
||||
// HDC g_hDstDC = NULL; // App Window
|
||||
static HDC g_hDebuggerMemDC = NULL;
|
||||
static HBITMAP g_hDebuggerMemBM = NULL;
|
||||
|
||||
HDC g_hConsoleFontDC = NULL;
|
||||
HBRUSH g_hConsoleFontBrush = NULL;
|
||||
|
@ -148,7 +149,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
const int DISPLAY_WATCHES_COLUMN = INFO_COL_2;
|
||||
const int DISPLAY_MINIMEM_COLUMN = INFO_COL_2;
|
||||
#else
|
||||
const int DISPLAY_CPU_INFO_LEFT_COLUMN = SCREENSPLIT1
|
||||
const int DISPLAY_CPU_INFO_LEFT_COLUMN = SCREENSPLIT1 // TC: SCREENSPLIT1 is not defined anywhere in the .sln!
|
||||
|
||||
const int DISPLAY_REGS_COLUMN = DISPLAY_CPU_INFO_LEFT_COLUMN;
|
||||
const int DISPLAY_FLAG_COLUMN = DISPLAY_CPU_INFO_LEFT_COLUMN;
|
||||
|
@ -513,6 +514,49 @@ const DWORD aROP4[ 256 ] =
|
|||
static iRop4 = 0;
|
||||
#endif
|
||||
|
||||
//===========================================================================
|
||||
|
||||
HDC GetDebuggerMemDC(void)
|
||||
{
|
||||
if (!g_hDebuggerMemDC)
|
||||
{
|
||||
HDC hFrameDC = FrameGetDC();
|
||||
g_hDebuggerMemDC = CreateCompatibleDC(hFrameDC);
|
||||
g_hDebuggerMemBM = CreateCompatibleBitmap(hFrameDC, FRAMEBUFFER_W, FRAMEBUFFER_H);
|
||||
SelectObject(g_hDebuggerMemDC, g_hDebuggerMemBM);
|
||||
}
|
||||
|
||||
return g_hDebuggerMemDC;
|
||||
}
|
||||
|
||||
void ReleaseDebuggerMemDC(void)
|
||||
{
|
||||
if (g_hDebuggerMemDC)
|
||||
{
|
||||
DeleteObject(g_hDebuggerMemBM);
|
||||
g_hDebuggerMemBM = NULL;
|
||||
DeleteDC(g_hDebuggerMemDC);
|
||||
g_hDebuggerMemDC = NULL;
|
||||
FrameReleaseDC();
|
||||
}
|
||||
}
|
||||
|
||||
void StretchBltMemToFrameDC(void)
|
||||
{
|
||||
int nViewportCX, nViewportCY;
|
||||
GetViewportCXCY(nViewportCX, nViewportCY);
|
||||
|
||||
BOOL bRes = StretchBlt(
|
||||
FrameGetDC(), // HDC hdcDest,
|
||||
0, 0, // int nXOriginDest, int nYOriginDest,
|
||||
nViewportCX, nViewportCY, // int nWidthDest, int nHeightDest,
|
||||
GetDebuggerMemDC(), // HDC hdcSrc,
|
||||
0, 0, // int nXOriginSrc, int nYOriginSrc,
|
||||
FRAMEBUFFER_W, FRAMEBUFFER_H, // int nWidthSrc, int nHeightSrc,
|
||||
SRCCOPY // DWORD dwRop
|
||||
);
|
||||
}
|
||||
|
||||
// Font: Apple Text
|
||||
//===========================================================================
|
||||
void DebuggerSetColorFG( COLORREF nRGB )
|
||||
|
@ -520,14 +564,14 @@ void DebuggerSetColorFG( COLORREF nRGB )
|
|||
#if USE_APPLE_FONT
|
||||
if (g_hConsoleBrushFG)
|
||||
{
|
||||
SelectObject( g_hFrameDC, GetStockObject(NULL_BRUSH) );
|
||||
SelectObject( GetDebuggerMemDC(), GetStockObject(NULL_BRUSH) );
|
||||
DeleteObject( g_hConsoleBrushFG );
|
||||
g_hConsoleBrushFG = NULL;
|
||||
}
|
||||
|
||||
g_hConsoleBrushFG = CreateSolidBrush( nRGB );
|
||||
#else
|
||||
SetTextColor( g_hFrameDC, nRGB );
|
||||
SetTextColor( GetDebuggerMemDC(), nRGB );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -537,7 +581,7 @@ void DebuggerSetColorBG( COLORREF nRGB, bool bTransparent )
|
|||
#if USE_APPLE_FONT
|
||||
if (g_hConsoleBrushBG)
|
||||
{
|
||||
SelectObject( g_hFrameDC, GetStockObject(NULL_BRUSH) );
|
||||
SelectObject( GetDebuggerMemDC(), GetStockObject(NULL_BRUSH) );
|
||||
DeleteObject( g_hConsoleBrushBG );
|
||||
g_hConsoleBrushBG = NULL;
|
||||
}
|
||||
|
@ -547,7 +591,7 @@ void DebuggerSetColorBG( COLORREF nRGB, bool bTransparent )
|
|||
g_hConsoleBrushBG = CreateSolidBrush( nRGB );
|
||||
}
|
||||
#else
|
||||
SetBkColor( g_hFrameDC, nRGB );
|
||||
SetBkColor( GetDebuggerMemDC(), nRGB );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -555,7 +599,7 @@ void DebuggerSetColorBG( COLORREF nRGB, bool bTransparent )
|
|||
//===========================================================================
|
||||
void PrintGlyph( const int x, const int y, const char glyph )
|
||||
{
|
||||
HDC g_hDstDC = FrameGetDC();
|
||||
HDC hDstDC = GetDebuggerMemDC();
|
||||
|
||||
int xDst = x;
|
||||
int yDst = y;
|
||||
|
@ -568,11 +612,11 @@ void PrintGlyph( const int x, const int y, const char glyph )
|
|||
// Background color
|
||||
if (g_hConsoleBrushBG)
|
||||
{
|
||||
SelectObject( g_hDstDC, g_hConsoleBrushBG );
|
||||
SelectObject( hDstDC, g_hConsoleBrushBG );
|
||||
|
||||
// Draw Background (solid pattern)
|
||||
BitBlt(
|
||||
g_hFrameDC, // hdcDest
|
||||
hDstDC, // hdcDest
|
||||
xDst, yDst, // nXDest, nYDest
|
||||
CONSOLE_FONT_WIDTH, CONSOLE_FONT_HEIGHT, // nWidth, nHeight
|
||||
g_hConsoleFontDC, // hdcSrc
|
||||
|
@ -582,7 +626,7 @@ void PrintGlyph( const int x, const int y, const char glyph )
|
|||
}
|
||||
#endif
|
||||
|
||||
// SelectObject( g_hDstDC, GetStockBrush( WHITE_BRUSH ) );
|
||||
// SelectObject( hDstDC, GetStockBrush( WHITE_BRUSH ) );
|
||||
|
||||
// http://kkow.net/etep/docs/rop.html
|
||||
// P 1 1 1 1 0 0 0 0 (Pen/Pattern)
|
||||
|
@ -596,9 +640,9 @@ void PrintGlyph( const int x, const int y, const char glyph )
|
|||
// White = Opaque (DC Text color)
|
||||
|
||||
#if DEBUG_FONT_ROP
|
||||
SelectObject( g_hDstDC, g_hConsoleBrushFG );
|
||||
SelectObject( hDstDC, g_hConsoleBrushFG );
|
||||
BitBlt(
|
||||
g_hFrameDC,
|
||||
hDstDC,
|
||||
xDst, yDst,
|
||||
DEBUG_FONT_WIDTH, DEBUG_FONT_HEIGHT,
|
||||
g_hDebugFontDC,
|
||||
|
@ -609,7 +653,7 @@ void PrintGlyph( const int x, const int y, const char glyph )
|
|||
// Use inverted source as mask (AND)
|
||||
// D & ~S -> DSna
|
||||
BitBlt(
|
||||
g_hFrameDC,
|
||||
hDstDC,
|
||||
xDst, yDst,
|
||||
CONSOLE_FONT_WIDTH, CONSOLE_FONT_HEIGHT,
|
||||
g_hConsoleFontDC,
|
||||
|
@ -617,12 +661,12 @@ void PrintGlyph( const int x, const int y, const char glyph )
|
|||
DSna
|
||||
);
|
||||
|
||||
SelectObject( g_hDstDC, g_hConsoleBrushFG );
|
||||
SelectObject( hDstDC, g_hConsoleBrushFG );
|
||||
|
||||
// Use Source as mask to make color Pattern mask (AND), then apply to dest (OR)
|
||||
// D | (P & S) -> DPSao
|
||||
BitBlt(
|
||||
g_hFrameDC,
|
||||
hDstDC,
|
||||
xDst, yDst,
|
||||
CONSOLE_FONT_WIDTH, CONSOLE_FONT_HEIGHT,
|
||||
g_hConsoleFontDC,
|
||||
|
@ -631,7 +675,7 @@ void PrintGlyph( const int x, const int y, const char glyph )
|
|||
);
|
||||
#endif
|
||||
|
||||
SelectObject( g_hFrameDC, GetStockObject(NULL_BRUSH) );
|
||||
SelectObject( hDstDC, GetStockObject(NULL_BRUSH) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -724,7 +768,7 @@ int PrintText ( const char * pText, RECT & rRect )
|
|||
int nLen = strlen( pText );
|
||||
|
||||
#if !DEBUG_FONT_NO_BACKGROUND_TEXT
|
||||
FillRect( g_hFrameDC, &rRect, g_hConsoleBrushBG );
|
||||
FillRect( GetDebuggerMemDC(), &rRect, g_hConsoleBrushBG );
|
||||
#endif
|
||||
|
||||
DebuggerPrint( rRect.left, rRect.top, pText );
|
||||
|
@ -735,7 +779,7 @@ int PrintText ( const char * pText, RECT & rRect )
|
|||
void PrintTextColor ( const conchar_t *pText, RECT & rRect )
|
||||
{
|
||||
#if !DEBUG_FONT_NO_BACKGROUND_TEXT
|
||||
FillRect( g_hFrameDC, &rRect, g_hConsoleBrushBG );
|
||||
FillRect( GetDebuggerMemDC(), &rRect, g_hConsoleBrushBG );
|
||||
#endif
|
||||
|
||||
DebuggerPrintColor( rRect.left, rRect.top, pText );
|
||||
|
@ -1769,8 +1813,8 @@ WORD DrawDisassemblyLine ( int iLine, const WORD nBaseAddress )
|
|||
const int DISASM_SYMBOL_LEN = 9;
|
||||
#endif
|
||||
|
||||
HDC dc = g_hFrameDC;
|
||||
if (dc)
|
||||
HDC dc = GetDebuggerMemDC();
|
||||
if (dc) // TC: Why would this be NULL?
|
||||
{
|
||||
int nFontHeight = g_aFontConfig[ FONT_DISASM_DEFAULT ]._nLineHeight; // _nFontHeight; // g_nFontHeight
|
||||
|
||||
|
@ -2116,7 +2160,7 @@ WORD DrawDisassemblyLine ( int iLine, const WORD nBaseAddress )
|
|||
|
||||
#if !USE_APPLE_FONT
|
||||
if (g_iConfigDisasmBranchType == DISASM_BRANCH_FANCY)
|
||||
SelectObject( g_hFrameDC, g_aFontConfig[ FONT_DISASM_BRANCH ]._hFont ); // g_hFontWebDings
|
||||
SelectObject( GetDebuggerMemDC(), g_aFontConfig[ FONT_DISASM_BRANCH ]._hFont ); // g_hFontWebDings
|
||||
#endif
|
||||
|
||||
// PrintTextColor( sBranch, linerect );
|
||||
|
@ -2157,7 +2201,7 @@ void DrawFlags ( int line, WORD nRegFlags, LPTSTR pFlagNames_)
|
|||
nSpacerWidth++;
|
||||
#endif
|
||||
|
||||
if (g_hFrameDC)
|
||||
if (GetDebuggerMemDC()) // TC: Why would this be NULL?
|
||||
{
|
||||
rect.top = line * g_nFontHeight;
|
||||
rect.bottom = rect.top + g_nFontHeight;
|
||||
|
@ -2192,7 +2236,7 @@ void DrawFlags ( int line, WORD nRegFlags, LPTSTR pFlagNames_)
|
|||
iFlag = (_6502_NUM_FLAGS - nFlag - 1);
|
||||
|
||||
bool bSet = (nRegFlags & 1);
|
||||
if (g_hFrameDC)
|
||||
if (GetDebuggerMemDC()) // TC: Why would this be NULL?
|
||||
{
|
||||
sText[0] = g_aBreakpointSource[ BP_SRC_FLAG_C + iFlag ][0];
|
||||
if (bSet)
|
||||
|
@ -2239,7 +2283,7 @@ void DrawFlags ( int line, WORD nRegFlags, LPTSTR pFlagNames_)
|
|||
if (pFlagNames_)
|
||||
strcpy(pFlagNames_,sFlagNames);
|
||||
/*
|
||||
if (g_hFrameDC)
|
||||
if (GetDebuggerMemDC()) // TC: Why would this be NULL?
|
||||
{
|
||||
rect.top += g_nFontHeight;
|
||||
rect.bottom += g_nFontHeight;
|
||||
|
@ -3085,7 +3129,7 @@ void DrawSubWindow_Console (Update_t bUpdate)
|
|||
return;
|
||||
|
||||
#if !USE_APPLE_FONT
|
||||
SelectObject( g_hFrameDC, g_aFontConfig[ FONT_CONSOLE ]._hFont );
|
||||
SelectObject( GetDebuggerMemDC(), g_aFontConfig[ FONT_CONSOLE ]._hFont );
|
||||
#endif
|
||||
|
||||
if ((bUpdate & UPDATE_CONSOLE_DISPLAY)
|
||||
|
@ -3116,7 +3160,7 @@ void DrawSubWindow_Console (Update_t bUpdate)
|
|||
|
||||
// if (bUpdate & UPDATE_CONSOLE_INPUT)
|
||||
{
|
||||
// DrawConsoleInput(); // g_hFrameDC );
|
||||
// DrawConsoleInput();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3449,7 +3493,7 @@ void DrawWindow_Console( Update_t bUpdate )
|
|||
// If the full screen console is only showing partial lines
|
||||
// don't erase the background
|
||||
|
||||
// FillRect( g_hFrameDC, &rect, g_hConsoleBrushBG );
|
||||
// FillRect( GetDebuggerMemDC(), &rect, g_hConsoleBrushBG );
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -3494,13 +3538,13 @@ void DrawWindowBackground_Main( int g_iWindowThis )
|
|||
rect.top = 0;
|
||||
rect.right = DISPLAY_DISASM_RIGHT;
|
||||
int nTop = GetConsoleTopPixels( g_nConsoleDisplayLines - 1 );
|
||||
rect.bottom = nTop; // DISPLAY_HEIGHT
|
||||
rect.bottom = nTop;
|
||||
|
||||
// TODO/FIXME: COLOR_BG_CODE -> g_iWindowThis, once all tab backgrounds are listed first in g_aColors !
|
||||
DebuggerSetColorBG( DebuggerGetColor( BG_DISASM_1 )); // COLOR_BG_CODE
|
||||
|
||||
#if !DEBUG_FONT_NO_BACKGROUND_FILL_MAIN
|
||||
FillRect( g_hFrameDC, &rect, g_hConsoleBrushBG );
|
||||
FillRect( GetDebuggerMemDC(), &rect, g_hConsoleBrushBG );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -3512,16 +3556,15 @@ void DrawWindowBackground_Info( int g_iWindowThis )
|
|||
rect.left = DISPLAY_DISASM_RIGHT;
|
||||
rect.right = DISPLAY_WIDTH;
|
||||
int nTop = GetConsoleTopPixels( g_nConsoleDisplayLines - 1 );
|
||||
rect.bottom = nTop; // DISPLAY_HEIGHT
|
||||
rect.bottom = nTop;
|
||||
|
||||
DebuggerSetColorBG( DebuggerGetColor( BG_INFO )); // COLOR_BG_DATA
|
||||
|
||||
#if !DEBUG_FONT_NO_BACKGROUND_FILL_INFO
|
||||
FillRect( g_hFrameDC, &rect, g_hConsoleBrushBG );
|
||||
FillRect( GetDebuggerMemDC(), &rect, g_hConsoleBrushBG );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
//===========================================================================
|
||||
void UpdateDisplay (Update_t bUpdate)
|
||||
{
|
||||
|
@ -3535,8 +3578,6 @@ void UpdateDisplay (Update_t bUpdate)
|
|||
}
|
||||
spDrawMutex = true;
|
||||
|
||||
FrameGetDC();
|
||||
|
||||
// Hack: Full screen console scrolled, "erase" left over console lines
|
||||
if (g_iWindowThis == WINDOW_CONSOLE)
|
||||
bUpdate |= UPDATE_BACKGROUND;
|
||||
|
@ -3544,16 +3585,14 @@ void UpdateDisplay (Update_t bUpdate)
|
|||
if (bUpdate & UPDATE_BACKGROUND)
|
||||
{
|
||||
#if USE_APPLE_FONT
|
||||
//VideoDrawLogoBitmap( g_hFrameDC ); // TC: Remove purple-flash after every single-step
|
||||
|
||||
SetBkMode( g_hFrameDC, OPAQUE);
|
||||
SetBkColor(g_hFrameDC, RGB(0,0,0));
|
||||
SetBkMode( GetDebuggerMemDC(), OPAQUE);
|
||||
SetBkColor(GetDebuggerMemDC(), RGB(0,0,0));
|
||||
#else
|
||||
SelectObject( g_hFrameDC, g_aFontConfig[ FONT_INFO ]._hFont ); // g_hFontDebugger
|
||||
SelectObject( GetDebuggerMemDC(), g_aFontConfig[ FONT_INFO ]._hFont ); // g_hFontDebugger
|
||||
#endif
|
||||
}
|
||||
|
||||
SetTextAlign( g_hFrameDC, TA_TOP | TA_LEFT);
|
||||
SetTextAlign( GetDebuggerMemDC(), TA_TOP | TA_LEFT);
|
||||
|
||||
if ((bUpdate & UPDATE_BREAKPOINTS)
|
||||
// || (bUpdate & UPDATE_DISASM)
|
||||
|
@ -3613,14 +3652,11 @@ void UpdateDisplay (Update_t bUpdate)
|
|||
if ((bUpdate & UPDATE_CONSOLE_DISPLAY) || (bUpdate & UPDATE_CONSOLE_INPUT))
|
||||
DrawSubWindow_Console( bUpdate );
|
||||
|
||||
FrameReleaseDC();
|
||||
StretchBltMemToFrameDC();
|
||||
|
||||
spDrawMutex = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//===========================================================================
|
||||
void DrawWindowBottom ( Update_t bUpdate, int iWindow )
|
||||
{
|
||||
|
@ -3653,7 +3689,7 @@ void DrawSubWindow_Code ( int iWindow )
|
|||
// DisasmCalcTopFromCurAddress();
|
||||
// DisasmCalcBotFromTopAddress();
|
||||
#if !USE_APPLE_FONT
|
||||
SelectObject( g_hFrameDC, g_aFontConfig[ FONT_DISASM_DEFAULT ]._hFont );
|
||||
SelectObject( GetDebuggerMemDC(), g_aFontConfig[ FONT_DISASM_DEFAULT ]._hFont );
|
||||
#endif
|
||||
|
||||
WORD nAddress = g_nDisasmTopAddress; // g_nDisasmCurAddress;
|
||||
|
@ -3663,6 +3699,6 @@ void DrawSubWindow_Code ( int iWindow )
|
|||
}
|
||||
|
||||
#if !USE_APPLE_FONT
|
||||
SelectObject( g_hFrameDC, g_aFontConfig[ FONT_INFO ]._hFont );
|
||||
SelectObject( GetDebuggerMemDC(), g_aFontConfig[ FONT_INFO ]._hFont );
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#ifndef DEBUGGER_DISPLAY_H
|
||||
#define DEBUGGER_DISPLAY_H
|
||||
#pragma once
|
||||
|
||||
// use the new Debugger Font (Apple Font)
|
||||
#define USE_APPLE_FONT 1
|
||||
|
@ -38,7 +37,6 @@
|
|||
#endif
|
||||
};
|
||||
|
||||
// extern HDC g_hDstDC ;
|
||||
extern HBRUSH g_hConsoleBrushFG;
|
||||
extern HBRUSH g_hConsoleBrushBG;
|
||||
|
||||
|
@ -93,4 +91,8 @@
|
|||
|
||||
void Debug_UpdatePalette( BYTE *pPalDst );
|
||||
|
||||
#endif
|
||||
//
|
||||
|
||||
extern HDC GetDebuggerMemDC(void);
|
||||
extern void ReleaseDebuggerMemDC(void);
|
||||
extern void StretchBltMemToFrameDC(void);
|
||||
|
|
|
@ -423,7 +423,7 @@ bool Colorize( char * pDst, const char * pSrc )
|
|||
}
|
||||
|
||||
//===========================================================================
|
||||
Update_t CmdMOTD( int nArgs )
|
||||
Update_t CmdMOTD( int nArgs ) // Message Of The Day
|
||||
{
|
||||
char sText[ CONSOLE_WIDTH*2 ];
|
||||
char sTemp[ CONSOLE_WIDTH*2 ];
|
||||
|
|
|
@ -43,18 +43,20 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
#define MAGICX 5 // 3D border between Apple window & Emulator's RHS buttons
|
||||
#define MAGICY 5 // 3D border between Apple window & Title bar
|
||||
|
||||
#define VIEWPORTCX FRAMEBUFFER_W
|
||||
#define VIEWPORTCY FRAMEBUFFER_H
|
||||
static int g_nViewportCX = FRAMEBUFFER_W;
|
||||
static int g_nViewportCY = FRAMEBUFFER_H;
|
||||
static int g_nViewportScale = 1;
|
||||
static int g_nOldViewportScale = 1;
|
||||
|
||||
#define BUTTONX (VIEWPORTCX + VIEWPORTX*2)
|
||||
#define BUTTONX (g_nViewportCX + VIEWPORTX*2)
|
||||
#define BUTTONY 0
|
||||
#define BUTTONCX 45
|
||||
#define BUTTONCY 45
|
||||
// NB. FSxxx = FullScreen xxx
|
||||
#define FSVIEWPORTX (640-BUTTONCX-MAGICX-VIEWPORTCX)
|
||||
#define FSVIEWPORTY ((480-VIEWPORTCY)/2)
|
||||
#define FSVIEWPORTX (640-BUTTONCX-MAGICX-g_nViewportCX)
|
||||
#define FSVIEWPORTY ((480-g_nViewportCY)/2)
|
||||
#define FSBUTTONX (640-BUTTONCX)
|
||||
#define FSBUTTONY (((480-VIEWPORTCY)/2)-1)
|
||||
#define FSBUTTONY (((480-g_nViewportCY)/2)-1)
|
||||
#define BUTTONS 8
|
||||
|
||||
static HBITMAP g_hCapsLockBitmap[2];
|
||||
|
@ -92,7 +94,7 @@ static int buttonover = -1;
|
|||
static int buttonx = BUTTONX;
|
||||
static int buttony = BUTTONY;
|
||||
static HRGN clipregion = (HRGN)0;
|
||||
HDC g_hFrameDC = (HDC)0;
|
||||
static HDC g_hFrameDC = (HDC)0;
|
||||
static RECT framerect = {0,0,0,0};
|
||||
|
||||
HWND g_hFrameWindow = (HWND)0;
|
||||
|
@ -135,6 +137,10 @@ bool g_bFreshReset = false;
|
|||
static void FrameSetCursorPosByMousePos(int x, int y, int dx, int dy, bool bLeavingAppleScreen);
|
||||
static void DrawCrosshairsMouse();
|
||||
static void UpdateMouseInAppleViewport(int iOutOfBoundsX, int iOutOfBoundsY, int x=0, int y=0);
|
||||
static void ScreenWindowResize(const bool bCtrlKey);
|
||||
static void DoFrameResizeWindow(int nNewScale);
|
||||
static void FrameResizeWindow(void);
|
||||
|
||||
|
||||
TCHAR g_pAppleWindowTitle[ 128 ] = "";
|
||||
|
||||
|
@ -288,7 +294,7 @@ switch (g_Apple2Type)
|
|||
// g_hDiskFullScreenLED[ DISK_STATUS_READ ] = (HBITMAP)LOADBUTTONBITMAP(TEXT("DISK_FULLSCREEN_R")); // Full Screen Read Only
|
||||
// g_hDiskFullScreenLED[ DISK_STATUS_WRITE] = (HBITMAP)LOADBUTTONBITMAP(TEXT("DISK_FULLSCREEN_W")); // Full Screen Write
|
||||
// g_hDiskFullScreenLED[ DISK_STATUS_PROT ] = (HBITMAP)LOADBUTTONBITMAP(TEXT("DISK_FULLSCREEN_P")); // Full Screen Write Protected
|
||||
|
||||
|
||||
btnfacebrush = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
|
||||
btnfacepen = CreatePen(PS_SOLID,1,GetSysColor(COLOR_BTNFACE));
|
||||
btnhighlightpen = CreatePen(PS_SOLID,1,GetSysColor(COLOR_BTNHIGHLIGHT));
|
||||
|
@ -403,10 +409,10 @@ static void DrawCrosshairs (int x, int y) {
|
|||
while (loop--) {
|
||||
RECT rect = {0,0,5,5};
|
||||
switch (loop) {
|
||||
case 0: OffsetRect(&rect,lastx-2,FSVIEWPORTY-5); break;
|
||||
case 1: OffsetRect(&rect,lastx-2,FSVIEWPORTY+VIEWPORTCY); break;
|
||||
case 2: OffsetRect(&rect,FSVIEWPORTX-5, lasty-2); break;
|
||||
case 3: OffsetRect(&rect,FSVIEWPORTX+VIEWPORTCX,lasty-2); break;
|
||||
case 0: OffsetRect(&rect,lastx-2,FSVIEWPORTY-5); break;
|
||||
case 1: OffsetRect(&rect,lastx-2,FSVIEWPORTY+g_nViewportCY); break;
|
||||
case 2: OffsetRect(&rect,FSVIEWPORTX-5,lasty-2); break;
|
||||
case 3: OffsetRect(&rect,FSVIEWPORTX+g_nViewportCX,lasty-2); break;
|
||||
}
|
||||
FillRect(dc,&rect,(HBRUSH)GetStockObject(BLACK_BRUSH));
|
||||
}
|
||||
|
@ -427,10 +433,10 @@ static void DrawCrosshairs (int x, int y) {
|
|||
VIEWPORTX-loop-1,lasty+3);
|
||||
if ((loop == 1) || (loop == 2))
|
||||
SelectObject(dc,btnhighlightpen);
|
||||
LINE(lastx-2,VIEWPORTY+VIEWPORTCY+loop,
|
||||
lastx+3,VIEWPORTY+VIEWPORTCY+loop);
|
||||
LINE(VIEWPORTX+VIEWPORTCX+loop,lasty-2,
|
||||
VIEWPORTX+VIEWPORTCX+loop,lasty+3);
|
||||
LINE(lastx-2,VIEWPORTY+g_nViewportCY+loop,
|
||||
lastx+3,VIEWPORTY+g_nViewportCY+loop);
|
||||
LINE(VIEWPORTX+g_nViewportCX+loop,lasty-2,
|
||||
VIEWPORTX+g_nViewportCX+loop,lasty+3);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -444,12 +450,12 @@ static void DrawCrosshairs (int x, int y) {
|
|||
SelectObject(dc,GetStockObject(BLACK_PEN));
|
||||
LINE(x+loop-2,viewporty-5,
|
||||
x+loop-2,viewporty);
|
||||
LINE(x+loop-2,viewporty+VIEWPORTCY+4,
|
||||
x+loop-2,viewporty+VIEWPORTCY-1);
|
||||
LINE(x+loop-2,viewporty+g_nViewportCY+4,
|
||||
x+loop-2,viewporty+g_nViewportCY-1);
|
||||
LINE(viewportx-5, y+loop-2,
|
||||
viewportx, y+loop-2);
|
||||
LINE(viewportx+VIEWPORTCX+4,y+loop-2,
|
||||
viewportx+VIEWPORTCX-1,y+loop-2);
|
||||
LINE(viewportx+g_nViewportCX+4,y+loop-2,
|
||||
viewportx+g_nViewportCX-1,y+loop-2);
|
||||
}
|
||||
}
|
||||
#undef LINE
|
||||
|
@ -474,19 +480,19 @@ static void DrawFrameWindow ()
|
|||
// DRAW THE 3D BORDER AROUND THE EMULATED SCREEN
|
||||
Draw3dRect(dc,
|
||||
VIEWPORTX-2,VIEWPORTY-2,
|
||||
VIEWPORTX+VIEWPORTCX+2,VIEWPORTY+VIEWPORTCY+2,
|
||||
VIEWPORTX+g_nViewportCX+2,VIEWPORTY+g_nViewportCY+2,
|
||||
0);
|
||||
Draw3dRect(dc,
|
||||
VIEWPORTX-3,VIEWPORTY-3,
|
||||
VIEWPORTX+VIEWPORTCX+3,VIEWPORTY+VIEWPORTCY+3,
|
||||
VIEWPORTX+g_nViewportCX+3,VIEWPORTY+g_nViewportCY+3,
|
||||
0);
|
||||
SelectObject(dc,btnfacepen);
|
||||
Rectangle(dc,
|
||||
VIEWPORTX-4,VIEWPORTY-4,
|
||||
VIEWPORTX+VIEWPORTCX+4,VIEWPORTY+VIEWPORTCY+4);
|
||||
VIEWPORTX+g_nViewportCX+4,VIEWPORTY+g_nViewportCY+4);
|
||||
Rectangle(dc,
|
||||
VIEWPORTX-5,VIEWPORTY-5,
|
||||
VIEWPORTX+VIEWPORTCX+5,VIEWPORTY+VIEWPORTCY+5);
|
||||
VIEWPORTX+g_nViewportCX+5,VIEWPORTY+g_nViewportCY+5);
|
||||
|
||||
// DRAW THE TOOLBAR BUTTONS
|
||||
int iButton = BUTTONS;
|
||||
|
@ -494,6 +500,15 @@ static void DrawFrameWindow ()
|
|||
{
|
||||
DrawButton(dc,iButton);
|
||||
}
|
||||
|
||||
if (g_nViewportScale == 2)
|
||||
{
|
||||
int x = buttonx + 1;
|
||||
int y = buttony + BUTTONS*BUTTONCY + 36; // 36 = height of StatusArea
|
||||
RECT rect = {x, y, x+45, y+BUTTONS*BUTTONCY+22};
|
||||
HBRUSH hbr = (HBRUSH) GetStockObject(WHITE_BRUSH);
|
||||
int res = FillRect(dc, &rect, hbr);
|
||||
}
|
||||
}
|
||||
|
||||
// DRAW THE STATUS AREA
|
||||
|
@ -1114,7 +1129,7 @@ LRESULT CALLBACK FrameWndProc (
|
|||
else if (g_bUsingCursor && !sg_Mouse.IsActive())
|
||||
{
|
||||
DrawCrosshairs(x,y);
|
||||
JoySetPosition(x-viewportx-2, VIEWPORTCX-4, y-viewporty-2, VIEWPORTCY-4);
|
||||
JoySetPosition(x-viewportx-2, g_nViewportCX-4, y-viewporty-2, g_nViewportCY-4);
|
||||
}
|
||||
else if (sg_Mouse.IsActiveAndEnabled() && (g_nAppMode == MODE_RUNNING))
|
||||
{
|
||||
|
@ -1123,8 +1138,8 @@ LRESULT CALLBACK FrameWndProc (
|
|||
|
||||
// Outside Apple viewport
|
||||
|
||||
const int iAppleScreenMaxX = VIEWPORTCX-1;
|
||||
const int iAppleScreenMaxY = VIEWPORTCY-1;
|
||||
const int iAppleScreenMaxX = g_nViewportCX-1;
|
||||
const int iAppleScreenMaxY = g_nViewportCY-1;
|
||||
const int iBoundMinX = viewportx;
|
||||
const int iBoundMaxX = iAppleScreenMaxX;
|
||||
const int iBoundMinY = viewporty;
|
||||
|
@ -1403,6 +1418,13 @@ LRESULT CALLBACK FrameWndProc (
|
|||
break;
|
||||
}
|
||||
|
||||
// Message posted by: Cmd-line boot
|
||||
case WM_USER_FULLSCREEN:
|
||||
{
|
||||
ScreenWindowResize(true);
|
||||
break;
|
||||
}
|
||||
|
||||
} // switch(message)
|
||||
|
||||
return DefWindowProc(window,message,wparam,lparam);
|
||||
|
@ -1411,6 +1433,27 @@ LRESULT CALLBACK FrameWndProc (
|
|||
|
||||
|
||||
//===========================================================================
|
||||
|
||||
static void ScreenWindowResize(const bool bCtrlKey)
|
||||
{
|
||||
if (g_bIsFullScreen) // if full screen: then switch back to normal (regardless of CTRL)
|
||||
{
|
||||
SetNormalMode();
|
||||
DoFrameResizeWindow(g_nOldViewportScale);
|
||||
}
|
||||
else if (bCtrlKey) // if normal screen && CTRL: then switch to full screen
|
||||
{
|
||||
g_nOldViewportScale = g_nViewportScale;
|
||||
DoFrameResizeWindow(1); // reset to 1x
|
||||
SetFullScreenMode();
|
||||
}
|
||||
else
|
||||
{
|
||||
DoFrameResizeWindow( (g_nViewportScale == 1) ? 2 : 1 ); // Toggle between 1x and 2x
|
||||
REGSAVE(TEXT(REGVALUE_WINDOW_SCALE), g_nViewportScale);
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessButtonClick (int button)
|
||||
{
|
||||
SoundCore_SetFade(FADE_OUT);
|
||||
|
@ -1477,10 +1520,8 @@ void ProcessButtonClick (int button)
|
|||
break;
|
||||
|
||||
case BTN_FULLSCR:
|
||||
if (g_bIsFullScreen)
|
||||
SetNormalMode();
|
||||
else
|
||||
SetFullScreenMode();
|
||||
KeybUpdateCtrlShiftStatus();
|
||||
ScreenWindowResize(g_bCtrlKey);
|
||||
break;
|
||||
|
||||
case BTN_DEBUG:
|
||||
|
@ -1790,8 +1831,8 @@ void SetUsingCursor (BOOL bNewValue)
|
|||
SetCapture(g_hFrameWindow);
|
||||
RECT rect = { viewportx+2, // left
|
||||
viewporty+2, // top
|
||||
viewportx+VIEWPORTCX-1, // right
|
||||
viewporty+VIEWPORTCY-1}; // bottom
|
||||
viewportx+g_nViewportCX-1, // right
|
||||
viewporty+g_nViewportCY-1}; // bottom
|
||||
ClientToScreen(g_hFrameWindow,(LPPOINT)&rect.left);
|
||||
ClientToScreen(g_hFrameWindow,(LPPOINT)&rect.right);
|
||||
ClipCursor(&rect);
|
||||
|
@ -1810,29 +1851,106 @@ void SetUsingCursor (BOOL bNewValue)
|
|||
}
|
||||
}
|
||||
|
||||
int GetViewportScale(void)
|
||||
{
|
||||
return g_nViewportScale;
|
||||
}
|
||||
|
||||
void SetViewportScale(int nNewScale)
|
||||
{
|
||||
g_nViewportScale = nNewScale;
|
||||
g_nViewportCX = g_nViewportScale * FRAMEBUFFER_W;
|
||||
g_nViewportCY = g_nViewportScale * FRAMEBUFFER_H;
|
||||
}
|
||||
|
||||
static void DoFrameResizeWindow(int nNewScale)
|
||||
{
|
||||
SetViewportScale(nNewScale);
|
||||
FrameResizeWindow();
|
||||
}
|
||||
|
||||
static void SetupTooltipControls(void)
|
||||
{
|
||||
TOOLINFO toolinfo;
|
||||
toolinfo.cbSize = sizeof(toolinfo);
|
||||
toolinfo.uFlags = TTF_CENTERTIP;
|
||||
toolinfo.hwnd = g_hFrameWindow;
|
||||
toolinfo.hinst = g_hInstance;
|
||||
toolinfo.lpszText = LPSTR_TEXTCALLBACK;
|
||||
toolinfo.rect.left = BUTTONX;
|
||||
toolinfo.rect.right = toolinfo.rect.left+BUTTONCX+1;
|
||||
toolinfo.uId = 0;
|
||||
toolinfo.rect.top = BUTTONY+BTN_DRIVE1*BUTTONCY+1;
|
||||
toolinfo.rect.bottom = toolinfo.rect.top+BUTTONCY;
|
||||
SendMessage(tooltipwindow, TTM_ADDTOOL, 0, (LPARAM)&toolinfo);
|
||||
toolinfo.uId = 1;
|
||||
toolinfo.rect.top = BUTTONY+BTN_DRIVE2*BUTTONCY+1;
|
||||
toolinfo.rect.bottom = toolinfo.rect.top+BUTTONCY;
|
||||
SendMessage(tooltipwindow, TTM_ADDTOOL, 0, (LPARAM)&toolinfo);
|
||||
}
|
||||
|
||||
//
|
||||
// ----- ALL GLOBALLY ACCESSIBLE FUNCTIONS ARE BELOW THIS LINE -----
|
||||
//
|
||||
|
||||
//===========================================================================
|
||||
void FrameCreateWindow ()
|
||||
|
||||
void GetWidthHeight(int& nWidth, int& nHeight)
|
||||
{
|
||||
const int nWidth = VIEWPORTCX + VIEWPORTX*2
|
||||
+ BUTTONCX
|
||||
+ GetSystemMetrics(SM_CXBORDER)*2
|
||||
+ MAGICX;
|
||||
const int nHeight = VIEWPORTCY + VIEWPORTY*2
|
||||
+ GetSystemMetrics(SM_CYBORDER)
|
||||
+ GetSystemMetrics(SM_CYCAPTION)
|
||||
+ MAGICY;
|
||||
nWidth = g_nViewportCX + VIEWPORTX*2
|
||||
+ BUTTONCX
|
||||
+ GetSystemMetrics(SM_CXBORDER)*2
|
||||
+ MAGICX;
|
||||
nHeight = g_nViewportCY + VIEWPORTY*2
|
||||
+ GetSystemMetrics(SM_CYBORDER)
|
||||
+ GetSystemMetrics(SM_CYCAPTION)
|
||||
+ MAGICY;
|
||||
}
|
||||
|
||||
void FrameResizeWindow(void)
|
||||
{
|
||||
int nWidth, nHeight;
|
||||
GetWidthHeight(nWidth, nHeight);
|
||||
|
||||
GetWindowRect(g_hFrameWindow, &framerect);
|
||||
int nXPos = framerect.left;
|
||||
int nYPos = framerect.top;
|
||||
|
||||
//
|
||||
|
||||
buttonx = (g_nViewportCX + VIEWPORTX*2);
|
||||
buttony = 0;
|
||||
|
||||
RECT irect;
|
||||
irect.left = irect.top = 0;
|
||||
irect.right = nWidth;
|
||||
irect.bottom = nHeight;
|
||||
InvalidateRect(g_hFrameWindow, &irect, true);
|
||||
MoveWindow(g_hFrameWindow, nXPos, nYPos, nWidth, nHeight, false);
|
||||
UpdateWindow(g_hFrameWindow);
|
||||
|
||||
TOOLINFO toolinfo = {0};
|
||||
toolinfo.cbSize = sizeof(toolinfo);
|
||||
toolinfo.hwnd = g_hFrameWindow;
|
||||
toolinfo.uId = 0;
|
||||
SendMessage(tooltipwindow, TTM_DELTOOL, 0, (LPARAM)&toolinfo);
|
||||
toolinfo.uId = 1;
|
||||
SendMessage(tooltipwindow, TTM_DELTOOL, 0, (LPARAM)&toolinfo);
|
||||
|
||||
SetupTooltipControls();
|
||||
}
|
||||
|
||||
void FrameCreateWindow(void)
|
||||
{
|
||||
int nWidth, nHeight;
|
||||
GetWidthHeight(nWidth, nHeight);
|
||||
|
||||
// Restore Window X Position
|
||||
|
||||
int nXPos = -1;
|
||||
{
|
||||
int nXScreen = GetSystemMetrics(SM_CXSCREEN) - nWidth;
|
||||
|
||||
if (RegLoadValue(TEXT(REG_PREFS), TEXT("Window X-Position"), 1, (DWORD*)&nXPos))
|
||||
if (RegLoadValue(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_WINDOW_X_POS), 1, (DWORD*)&nXPos))
|
||||
{
|
||||
if ((nXPos > nXScreen) && !g_bMultiMon)
|
||||
nXPos = -1; // Not fully visible, so default to centre position
|
||||
|
@ -1843,12 +1961,11 @@ void FrameCreateWindow ()
|
|||
}
|
||||
|
||||
// Restore Window Y Position
|
||||
|
||||
int nYPos = -1;
|
||||
{
|
||||
int nYScreen = GetSystemMetrics(SM_CYSCREEN) - nHeight;
|
||||
|
||||
if (RegLoadValue(TEXT(REG_PREFS), TEXT("Window Y-Position"), 1, (DWORD*)&nYPos))
|
||||
if (RegLoadValue(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_WINDOW_Y_POS), 1, (DWORD*)&nYPos))
|
||||
{
|
||||
if ((nYPos > nYScreen) && !g_bMultiMon)
|
||||
nYPos = -1; // Not fully visible, so default to centre position
|
||||
|
@ -1859,6 +1976,10 @@ void FrameCreateWindow ()
|
|||
}
|
||||
|
||||
//
|
||||
|
||||
buttonx = (g_nViewportCX + VIEWPORTX*2);
|
||||
buttony = 0;
|
||||
|
||||
GetAppleWindowTitle();
|
||||
|
||||
g_hFrameWindow = CreateWindow(
|
||||
|
@ -1879,22 +2000,7 @@ void FrameCreateWindow ()
|
|||
(HMENU)0,
|
||||
g_hInstance,NULL );
|
||||
|
||||
TOOLINFO toolinfo;
|
||||
toolinfo.cbSize = sizeof(toolinfo);
|
||||
toolinfo.uFlags = TTF_CENTERTIP;
|
||||
toolinfo.hwnd = g_hFrameWindow;
|
||||
toolinfo.hinst = g_hInstance;
|
||||
toolinfo.lpszText = LPSTR_TEXTCALLBACK;
|
||||
toolinfo.rect.left = BUTTONX;
|
||||
toolinfo.rect.right = toolinfo.rect.left+BUTTONCX+1;
|
||||
toolinfo.uId = 0;
|
||||
toolinfo.rect.top = BUTTONY+BTN_DRIVE1*BUTTONCY+1;
|
||||
toolinfo.rect.bottom = toolinfo.rect.top+BUTTONCY;
|
||||
SendMessage(tooltipwindow,TTM_ADDTOOL,0,(LPARAM)&toolinfo);
|
||||
toolinfo.uId = 1;
|
||||
toolinfo.rect.top = BUTTONY+BTN_DRIVE2*BUTTONCY+1;
|
||||
toolinfo.rect.bottom = toolinfo.rect.top+BUTTONCY;
|
||||
SendMessage(tooltipwindow,TTM_ADDTOOL,0,(LPARAM)&toolinfo);
|
||||
SetupTooltipControls();
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -1915,8 +2021,8 @@ HDC FrameGetVideoDC (LPBYTE *pAddr_, LONG *pPitch_)
|
|||
{
|
||||
RECT rect = { FSVIEWPORTX,
|
||||
FSVIEWPORTY,
|
||||
FSVIEWPORTX+VIEWPORTCX,
|
||||
FSVIEWPORTY+VIEWPORTCY};
|
||||
FSVIEWPORTX+g_nViewportCX,
|
||||
FSVIEWPORTY+g_nViewportCY};
|
||||
DDSURFACEDESC surfacedesc;
|
||||
surfacedesc.dwSize = sizeof(surfacedesc);
|
||||
// TC: Use DDLOCK_WAIT - see Bug #13425
|
||||
|
@ -1931,7 +2037,7 @@ HDC FrameGetVideoDC (LPBYTE *pAddr_, LONG *pPitch_)
|
|||
// g_pDDPrimarySurface->SetPalette(g_pDDPal); // this sets the palette for the primary surface
|
||||
// }
|
||||
}
|
||||
*pAddr_ = (LPBYTE)surfacedesc.lpSurface+(VIEWPORTCY-1)*surfacedesc.lPitch;
|
||||
*pAddr_ = (LPBYTE)surfacedesc.lpSurface+(g_nViewportCY-1)*surfacedesc.lPitch;
|
||||
*pPitch_ = -surfacedesc.lPitch;
|
||||
|
||||
return (HDC)0;
|
||||
|
@ -1987,8 +2093,8 @@ void FrameReleaseVideoDC ()
|
|||
RECT rect = {
|
||||
FSVIEWPORTX,
|
||||
FSVIEWPORTY,
|
||||
FSVIEWPORTX+VIEWPORTCX,
|
||||
FSVIEWPORTY+VIEWPORTCY
|
||||
FSVIEWPORTX+g_nViewportCX,
|
||||
FSVIEWPORTY+g_nViewportCY
|
||||
};
|
||||
g_pDDPrimarySurface->Unlock(&rect);
|
||||
|
||||
|
@ -2024,8 +2130,8 @@ void FrameSetCursorPosByMousePos()
|
|||
float fScaleX = (float)(iX-iMinX) / ((float)(iMaxX-iMinX));
|
||||
float fScaleY = (float)(iY-iMinY) / ((float)(iMaxY-iMinY));
|
||||
|
||||
int iWindowX = (int)(fScaleX * (float)VIEWPORTCX);
|
||||
int iWindowY = (int)(fScaleY * (float)VIEWPORTCY);
|
||||
int iWindowX = (int)(fScaleX * (float)g_nViewportCX);
|
||||
int iWindowY = (int)(fScaleY * (float)g_nViewportCY);
|
||||
|
||||
POINT Point = {viewportx+2, viewporty+2}; // top-left
|
||||
ClientToScreen(g_hFrameWindow, &Point);
|
||||
|
@ -2069,8 +2175,8 @@ static void FrameSetCursorPosByMousePos(int x, int y, int dx, int dy, bool bLeav
|
|||
float fScaleX = (float)(iX-iMinX) / ((float)(iMaxX-iMinX));
|
||||
float fScaleY = (float)(iY-iMinY) / ((float)(iMaxY-iMinY));
|
||||
|
||||
int iWindowX = (int)(fScaleX * (float)VIEWPORTCX) + dx;
|
||||
int iWindowY = (int)(fScaleY * (float)VIEWPORTCY) + dy;
|
||||
int iWindowX = (int)(fScaleX * (float)g_nViewportCX) + dx;
|
||||
int iWindowY = (int)(fScaleY * (float)g_nViewportCY) + dy;
|
||||
|
||||
POINT Point = {viewportx+2, viewporty+2}; // top-left
|
||||
ClientToScreen(g_hFrameWindow, &Point);
|
||||
|
@ -2083,10 +2189,10 @@ static void FrameSetCursorPosByMousePos(int x, int y, int dx, int dy, bool bLeav
|
|||
x -= (viewportx+2-MAGICX); if (x < 0) x = 0;
|
||||
y -= (viewporty+2-MAGICY); if (y < 0) y = 0;
|
||||
|
||||
_ASSERT(x <= VIEWPORTCX);
|
||||
_ASSERT(y <= VIEWPORTCY);
|
||||
float fScaleX = (float)x / (float)VIEWPORTCX;
|
||||
float fScaleY = (float)y / (float)VIEWPORTCY;
|
||||
_ASSERT(x <= g_nViewportCX);
|
||||
_ASSERT(y <= g_nViewportCY);
|
||||
float fScaleX = (float)x / (float)g_nViewportCX;
|
||||
float fScaleY = (float)y / (float)g_nViewportCY;
|
||||
|
||||
int iAppleX = iMinX + (int)(fScaleX * (float)(iMaxX-iMinX));
|
||||
int iAppleY = iMinY + (int)(fScaleY * (float)(iMaxY-iMinY));
|
||||
|
@ -2111,8 +2217,8 @@ static void DrawCrosshairsMouse()
|
|||
float fScaleX = (float)(iX-iMinX) / ((float)(iMaxX-iMinX));
|
||||
float fScaleY = (float)(iY-iMinY) / ((float)(iMaxY-iMinY));
|
||||
|
||||
int iWindowX = (int)(fScaleX * (float)VIEWPORTCX);
|
||||
int iWindowY = (int)(fScaleY * (float)VIEWPORTCY);
|
||||
int iWindowX = (int)(fScaleX * (float)g_nViewportCX);
|
||||
int iWindowY = (int)(fScaleY * (float)g_nViewportCY);
|
||||
|
||||
DrawCrosshairs(iWindowX,iWindowY);
|
||||
}
|
||||
|
@ -2170,3 +2276,9 @@ static void UpdateMouseInAppleViewport(int iOutOfBoundsX, int iOutOfBoundsY, int
|
|||
DrawCrosshairsMouse();
|
||||
}
|
||||
}
|
||||
|
||||
void GetViewportCXCY(int& nViewportCX, int& nViewportCY)
|
||||
{
|
||||
nViewportCX = g_nViewportCX;
|
||||
nViewportCY = g_nViewportCY;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
// Win32
|
||||
extern HWND g_hFrameWindow;
|
||||
extern HDC g_hFrameDC;
|
||||
extern BOOL g_bIsFullScreen;
|
||||
extern BOOL g_bMultiMon;
|
||||
|
||||
|
@ -35,7 +34,7 @@
|
|||
// Prototypes
|
||||
void CtrlReset();
|
||||
|
||||
void FrameCreateWindow ();
|
||||
void FrameCreateWindow(void);
|
||||
HDC FrameGetDC ();
|
||||
HDC FrameGetVideoDC (LPBYTE *,LONG *);
|
||||
void FrameRefreshStatus (int);
|
||||
|
@ -43,6 +42,9 @@
|
|||
void FrameReleaseDC ();
|
||||
void FrameReleaseVideoDC ();
|
||||
void FrameSetCursorPosByMousePos();
|
||||
int GetViewportScale(void);
|
||||
void SetViewportScale(int nNewScale);
|
||||
void GetViewportCXCY(int& nViewportCX, int& nViewportCY);
|
||||
|
||||
LRESULT CALLBACK FrameWndProc (
|
||||
HWND window,
|
||||
|
|
|
@ -3181,39 +3181,59 @@ void VideoDestroy () {
|
|||
}
|
||||
|
||||
//===========================================================================
|
||||
void VideoDrawLogoBitmap ( HDC hDstDC )
|
||||
|
||||
void VideoDrawLogoBitmap(HDC hDstDC, int xoff, int yoff, int srcw, int srch, int scale)
|
||||
{
|
||||
HDC hSrcDC = CreateCompatibleDC( hDstDC );
|
||||
SelectObject( hSrcDC, g_hLogoBitmap );
|
||||
BitBlt(
|
||||
StretchBlt(
|
||||
hDstDC, // hdcDest
|
||||
0, 0, // nXDest, nYDest
|
||||
FRAMEBUFFER_W, FRAMEBUFFER_H, // nWidth, nHeight
|
||||
xoff, yoff, // nXDest, nYDest
|
||||
scale * srcw, scale * srch, // nWidth, nHeight
|
||||
hSrcDC, // hdcSrc
|
||||
0, 0, // nXSrc, nYSrc
|
||||
srcw, srch,
|
||||
SRCCOPY // dwRop
|
||||
);
|
||||
|
||||
DeleteObject( hSrcDC );
|
||||
hSrcDC = NULL;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
void VideoDisplayLogo ()
|
||||
{
|
||||
int xoff = 0, yoff = 0, scale = 0;
|
||||
HDC hFrameDC = FrameGetDC();
|
||||
|
||||
// DRAW THE LOGO
|
||||
HBRUSH brush = CreateSolidBrush(PALETTERGB(0x70,0x30,0xE0));
|
||||
|
||||
SelectObject(hFrameDC, brush);
|
||||
SelectObject(hFrameDC, GetStockObject(NULL_PEN));
|
||||
|
||||
int nViewportCX, nViewportCY;
|
||||
GetViewportCXCY(nViewportCX, nViewportCY);
|
||||
Rectangle(hFrameDC, 0, 0, nViewportCX+1, nViewportCY+1);
|
||||
|
||||
if (g_hLogoBitmap)
|
||||
{
|
||||
VideoDrawLogoBitmap( hFrameDC );
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectObject(hFrameDC,brush);
|
||||
SelectObject(hFrameDC,GetStockObject(NULL_PEN));
|
||||
Rectangle(hFrameDC,0,0,FRAMEBUFFER_W+1,FRAMEBUFFER_H+1);
|
||||
BITMAP bm;
|
||||
if (GetObject(g_hLogoBitmap, sizeof(bm), &bm))
|
||||
{
|
||||
scale = nViewportCX / bm.bmWidth;
|
||||
if (nViewportCY / bm.bmHeight < scale)
|
||||
scale = nViewportCY / bm.bmHeight;
|
||||
|
||||
if (scale > 0)
|
||||
{
|
||||
if (nViewportCX > bm.bmWidth)
|
||||
xoff = (nViewportCX - (scale * bm.bmWidth)) / 2;
|
||||
if (nViewportCY > bm.bmHeight)
|
||||
yoff = (nViewportCY - (scale * bm.bmHeight)) / 2;
|
||||
|
||||
VideoDrawLogoBitmap( hFrameDC, xoff, yoff, bm.bmWidth, bm.bmHeight, scale );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DRAW THE VERSION NUMBER
|
||||
|
@ -3225,22 +3245,14 @@ void VideoDisplayLogo ()
|
|||
SetTextAlign(hFrameDC,TA_RIGHT | TA_TOP);
|
||||
SetBkMode(hFrameDC,TRANSPARENT);
|
||||
|
||||
//#define VERSION_TXT "Version "
|
||||
// Daily WTF candidate -- malloc every _frame_ ?!?!
|
||||
// char* szVersion = new char[strlen(VERSION_TXT) + strlen(VERSIONSTRING) + 1];
|
||||
// strcpy(&szVersion[0], VERSION_TXT);
|
||||
// strcpy(&szVersion[strlen(VERSION_TXT)], VERSIONSTRING);
|
||||
// szVersion[strlen(szVersion)] = 0x00;
|
||||
|
||||
char szVersion[ 64 ] = "";
|
||||
|
||||
sprintf( szVersion, "Version %s", VERSIONSTRING );
|
||||
|
||||
#define DRAWVERSION(x,y,c) \
|
||||
SetTextColor(hFrameDC,c); \
|
||||
TextOut(hFrameDC, \
|
||||
540+x,358+y, \
|
||||
szVersion, \
|
||||
#define DRAWVERSION(x,y,c) \
|
||||
SetTextColor(hFrameDC,c); \
|
||||
TextOut(hFrameDC, \
|
||||
scale*540+x+xoff,scale*358+y+yoff, \
|
||||
szVersion, \
|
||||
strlen(szVersion));
|
||||
|
||||
if (GetDeviceCaps(hFrameDC,PLANES) * GetDeviceCaps(hFrameDC,BITSPIXEL) <= 4) {
|
||||
|
@ -3255,13 +3267,11 @@ void VideoDisplayLogo ()
|
|||
|
||||
#if _DEBUG
|
||||
sprintf( szVersion, "DEBUG" );
|
||||
DRAWVERSION( 2, -358,RGB(0x00,0x00,0x00));
|
||||
DRAWVERSION( 1, -357,RGB(0x00,0x00,0x00));
|
||||
DRAWVERSION( 0, -356,RGB(0xFF,0x00,0xFF));
|
||||
DRAWVERSION( 2, -358*scale,RGB(0x00,0x00,0x00));
|
||||
DRAWVERSION( 1, -357*scale,RGB(0x00,0x00,0x00));
|
||||
DRAWVERSION( 0, -356*scale,RGB(0xFF,0x00,0xFF));
|
||||
#endif
|
||||
|
||||
// Daily WTF candidate -- malloc every _frame_ ?!?!
|
||||
// delete [] szVersion;
|
||||
#undef DRAWVERSION
|
||||
|
||||
FrameReleaseDC();
|
||||
|
@ -3446,7 +3456,9 @@ void _Video_RedrawScreen( VideoUpdateFuncPtr_t pfUpdate, bool bMixed )
|
|||
// . Oliver Schmidt gets a flickering mouse cursor with this code
|
||||
if (hFrameDC && anydirty)
|
||||
{
|
||||
BitBlt(hFrameDC,0,0,FRAMEBUFFER_W,FRAMEBUFFER_H,g_hDeviceDC,0,0,SRCCOPY);
|
||||
int nViewportCX, nViewportCY;
|
||||
GetViewportCXCY(nViewportCX, nViewportCY);
|
||||
StretchBlt(hFrameDC, 0 ,0, nViewportCX, nViewportCY, g_hDeviceDC, 0, 0, FRAMEBUFFER_W, FRAMEBUFFER_H, SRCCOPY);
|
||||
GdiFlush();
|
||||
}
|
||||
#else
|
||||
|
|
|
@ -92,7 +92,7 @@ void VideoBenchmark ();
|
|||
void VideoCheckPage (BOOL);
|
||||
void VideoChooseColor ();
|
||||
void VideoDestroy ();
|
||||
void VideoDrawLogoBitmap( HDC hDstDC );
|
||||
void VideoDrawLogoBitmap(HDC hDstDC, int xoff, int yoff, int srcw, int srch, int scale);
|
||||
void VideoDisplayLogo ();
|
||||
BOOL VideoHasRefreshed ();
|
||||
void VideoInitialize ();
|
||||
|
|
Loading…
Add table
Reference in a new issue