framewindow -> g_hFrameWindow

This commit is contained in:
mpohoreski 2006-05-14 00:44:38 +00:00
parent fb932a8d4f
commit 8b948571e8
10 changed files with 55 additions and 55 deletions

View File

@ -619,7 +619,7 @@ int APIENTRY WinMain (HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
// Initialize COM // Initialize COM
CoInitialize( NULL ); CoInitialize( NULL );
SysClk_InitTimer(); SysClk_InitTimer();
// DSInit(); // Done when framewindow is created (WM_CREATE) // DSInit(); // Done when g_hFrameWindow is created (WM_CREATE)
// DO ONE-TIME INITIALIZATION // DO ONE-TIME INITIALIZATION
instance = passinstance; instance = passinstance;
@ -662,15 +662,15 @@ int APIENTRY WinMain (HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
if(bSetFullScreen) if(bSetFullScreen)
{ {
PostMessage(framewindow, WM_KEYDOWN, VK_F1+BTN_FULLSCR, 0); PostMessage(g_hFrameWindow, WM_KEYDOWN, VK_F1+BTN_FULLSCR, 0);
PostMessage(framewindow, WM_KEYUP, VK_F1+BTN_FULLSCR, 0); PostMessage(g_hFrameWindow, WM_KEYUP, VK_F1+BTN_FULLSCR, 0);
bSetFullScreen = false; bSetFullScreen = false;
} }
if(bBoot) if(bBoot)
{ {
PostMessage(framewindow, WM_KEYDOWN, VK_F1+BTN_RUN, 0); PostMessage(g_hFrameWindow, WM_KEYDOWN, VK_F1+BTN_RUN, 0);
PostMessage(framewindow, WM_KEYUP, VK_F1+BTN_RUN, 0); PostMessage(g_hFrameWindow, WM_KEYUP, VK_F1+BTN_RUN, 0);
bBoot = false; bBoot = false;
} }

View File

@ -69,7 +69,7 @@ static int buttony = BUTTONY;
static HRGN clipregion = (HRGN)0; static HRGN clipregion = (HRGN)0;
static HDC framedc = (HDC)0; static HDC framedc = (HDC)0;
static RECT framerect = {0,0,0,0}; static RECT framerect = {0,0,0,0};
HWND framewindow = (HWND)0; HWND g_hFrameWindow = (HWND)0;
BOOL fullscreen = 0; BOOL fullscreen = 0;
static BOOL helpquit = 0; static BOOL helpquit = 0;
static BOOL painting = 0; static BOOL painting = 0;
@ -173,7 +173,7 @@ void DrawBitmapRect (HDC dc, int x, int y, LPRECT rect, HBITMAP bitmap) {
//=========================================================================== //===========================================================================
void DrawButton (HDC passdc, int number) { void DrawButton (HDC passdc, int number) {
FrameReleaseDC(); FrameReleaseDC();
HDC dc = (passdc ? passdc : GetDC(framewindow)); HDC dc = (passdc ? passdc : GetDC(g_hFrameWindow));
int x = buttonx; int x = buttonx;
int y = buttony+number*BUTTONCY; int y = buttony+number*BUTTONCY;
if (number == buttondown) { if (number == buttondown) {
@ -205,7 +205,7 @@ void DrawButton (HDC passdc, int number) {
NULL); NULL);
} }
if (!passdc) if (!passdc)
ReleaseDC(framewindow,dc); ReleaseDC(g_hFrameWindow,dc);
} }
//=========================================================================== //===========================================================================
@ -213,7 +213,7 @@ void DrawCrosshairs (int x, int y) {
static int lastx = 0; static int lastx = 0;
static int lasty = 0; static int lasty = 0;
FrameReleaseDC(); FrameReleaseDC();
HDC dc = GetDC(framewindow); HDC dc = GetDC(g_hFrameWindow);
#define LINE(x1,y1,x2,y2) MoveToEx(dc,x1,y1,NULL); LineTo(dc,x2,y2); #define LINE(x1,y1,x2,y2) MoveToEx(dc,x1,y1,NULL); LineTo(dc,x2,y2);
// ERASE THE OLD CROSSHAIRS // ERASE THE OLD CROSSHAIRS
@ -275,15 +275,15 @@ void DrawCrosshairs (int x, int y) {
#undef LINE #undef LINE
lastx = x; lastx = x;
lasty = y; lasty = y;
ReleaseDC(framewindow,dc); ReleaseDC(g_hFrameWindow,dc);
} }
//=========================================================================== //===========================================================================
void DrawFrameWindow () { void DrawFrameWindow () {
FrameReleaseDC(); FrameReleaseDC();
PAINTSTRUCT ps; PAINTSTRUCT ps;
HDC dc = (painting ? BeginPaint(framewindow,&ps) HDC dc = (painting ? BeginPaint(g_hFrameWindow,&ps)
: GetDC(framewindow)); : GetDC(g_hFrameWindow));
VideoRealizePalette(dc); VideoRealizePalette(dc);
if (!fullscreen) { if (!fullscreen) {
@ -314,9 +314,9 @@ void DrawFrameWindow () {
// DRAW THE STATUS AREA // DRAW THE STATUS AREA
DrawStatusArea(dc,DRAW_BACKGROUND | DRAW_LEDS); DrawStatusArea(dc,DRAW_BACKGROUND | DRAW_LEDS);
if (painting) if (painting)
EndPaint(framewindow,&ps); EndPaint(g_hFrameWindow,&ps);
else else
ReleaseDC(framewindow,dc); ReleaseDC(g_hFrameWindow,dc);
// DRAW THE CONTENTS OF THE EMULATED SCREEN // DRAW THE CONTENTS OF THE EMULATED SCREEN
if (mode == MODE_LOGO) if (mode == MODE_LOGO)
@ -330,7 +330,7 @@ void DrawFrameWindow () {
//=========================================================================== //===========================================================================
void DrawStatusArea (HDC passdc, int drawflags) { void DrawStatusArea (HDC passdc, int drawflags) {
FrameReleaseDC(); FrameReleaseDC();
HDC dc = (passdc ? passdc : GetDC(framewindow)); HDC dc = (passdc ? passdc : GetDC(g_hFrameWindow));
int x = buttonx; int x = buttonx;
int y = buttony+BUTTONS*BUTTONCY+1; int y = buttony+BUTTONS*BUTTONCY+1;
int iDrive1Status = DISK_STATUS_OFF; int iDrive1Status = DISK_STATUS_OFF;
@ -389,7 +389,7 @@ void DrawStatusArea (HDC passdc, int drawflags) {
case MODE_PAUSED: _tcscat(title,TEXT(" [Paused]")); break; case MODE_PAUSED: _tcscat(title,TEXT(" [Paused]")); break;
case MODE_STEPPING: _tcscat(title,TEXT(" [Stepping]")); break; case MODE_STEPPING: _tcscat(title,TEXT(" [Stepping]")); break;
} }
SendMessage(framewindow,WM_SETTEXT,0,(LPARAM)title); SendMessage(g_hFrameWindow,WM_SETTEXT,0,(LPARAM)title);
} }
if (drawflags & DRAW_BUTTON_DRIVES) if (drawflags & DRAW_BUTTON_DRIVES)
{ {
@ -398,7 +398,7 @@ void DrawStatusArea (HDC passdc, int drawflags) {
} }
} }
if (!passdc) if (!passdc)
ReleaseDC(framewindow,dc); ReleaseDC(g_hFrameWindow,dc);
} }
//=========================================================================== //===========================================================================
@ -408,7 +408,7 @@ void EraseButton (int number) {
rect.right = rect.left+BUTTONCX; rect.right = rect.left+BUTTONCX;
rect.top = buttony+number*BUTTONCY; rect.top = buttony+number*BUTTONCY;
rect.bottom = rect.top+BUTTONCY; rect.bottom = rect.top+BUTTONCY;
InvalidateRect(framewindow,&rect,1); InvalidateRect(g_hFrameWindow,&rect,1);
} }
//=========================================================================== //===========================================================================
@ -454,7 +454,7 @@ LRESULT CALLBACK FrameWndProc (HWND window,
break; break;
case WM_CREATE: case WM_CREATE:
framewindow = window; g_hFrameWindow = window;
CreateGdiObjects(); CreateGdiObjects();
DSInit(); DSInit();
MB_Initialize(); MB_Initialize();
@ -813,7 +813,7 @@ LRESULT CALLBACK FrameWndProc (HWND window,
case WM_USER_BENCHMARK: { case WM_USER_BENCHMARK: {
if (mode != MODE_LOGO) if (mode != MODE_LOGO)
if (MessageBox(framewindow, if (MessageBox(g_hFrameWindow,
TEXT("Running the benchmarks will reset the state of ") TEXT("Running the benchmarks will reset the state of ")
TEXT("the emulated machine, causing you to lose any ") TEXT("the emulated machine, causing you to lose any ")
TEXT("unsaved work.\n\n") TEXT("unsaved work.\n\n")
@ -836,7 +836,7 @@ LRESULT CALLBACK FrameWndProc (HWND window,
// . Changed Apple computer type (][+ or //e) // . Changed Apple computer type (][+ or //e)
// . Changed disk speed (normal or enhanced) // . Changed disk speed (normal or enhanced)
if (mode != MODE_LOGO) if (mode != MODE_LOGO)
if (MessageBox(framewindow, if (MessageBox(g_hFrameWindow,
TEXT("Restarting the emulator will reset the state ") TEXT("Restarting the emulator will reset the state ")
TEXT("of the emulated machine, causing you to lose any ") TEXT("of the emulated machine, causing you to lose any ")
TEXT("unsaved work.\n\n") TEXT("unsaved work.\n\n")
@ -873,7 +873,7 @@ void ProcessButtonClick (int button) {
TCHAR filename[MAX_PATH]; TCHAR filename[MAX_PATH];
_tcscpy(filename,progdir); _tcscpy(filename,progdir);
_tcscat(filename,TEXT("APPLEWIN.CHM")); _tcscat(filename,TEXT("APPLEWIN.CHM"));
HtmlHelp(framewindow,filename,HH_DISPLAY_TOC,0); HtmlHelp(g_hFrameWindow,filename,HH_DISPLAY_TOC,0);
helpquit = 1; helpquit = 1;
} }
break; break;
@ -995,7 +995,7 @@ void RelayEvent (UINT message, WPARAM wparam, LPARAM lparam) {
if (fullscreen) if (fullscreen)
return; return;
MSG msg; MSG msg;
msg.hwnd = framewindow; msg.hwnd = g_hFrameWindow;
msg.message = message; msg.message = message;
msg.wParam = wparam; msg.wParam = wparam;
msg.lParam = lparam; msg.lParam = lparam;
@ -1026,20 +1026,20 @@ void SetFullScreenMode () {
buttony = FSBUTTONY; buttony = FSBUTTONY;
viewportx = FSVIEWPORTX; viewportx = FSVIEWPORTX;
viewporty = FSVIEWPORTY; viewporty = FSVIEWPORTY;
GetWindowRect(framewindow,&framerect); GetWindowRect(g_hFrameWindow,&framerect);
SetWindowLong(framewindow,GWL_STYLE,WS_POPUP | WS_SYSMENU | WS_VISIBLE); SetWindowLong(g_hFrameWindow,GWL_STYLE,WS_POPUP | WS_SYSMENU | WS_VISIBLE);
DDSURFACEDESC ddsd; DDSURFACEDESC ddsd;
ddsd.dwSize = sizeof(ddsd); ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS; ddsd.dwFlags = DDSD_CAPS;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
if (DirectDrawCreate(NULL,&directdraw,NULL) != DD_OK || if (DirectDrawCreate(NULL,&directdraw,NULL) != DD_OK ||
directdraw->SetCooperativeLevel(framewindow,DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN) != DD_OK || directdraw->SetCooperativeLevel(g_hFrameWindow,DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN) != DD_OK ||
directdraw->SetDisplayMode(640,480,8) != DD_OK || directdraw->SetDisplayMode(640,480,8) != DD_OK ||
directdraw->CreateSurface(&ddsd,&surface,NULL) != DD_OK) { directdraw->CreateSurface(&ddsd,&surface,NULL) != DD_OK) {
SetNormalMode(); SetNormalMode();
return; return;
} }
InvalidateRect(framewindow,NULL,1); InvalidateRect(g_hFrameWindow,NULL,1);
} }
//=========================================================================== //===========================================================================
@ -1052,10 +1052,10 @@ void SetNormalMode () {
viewporty = VIEWPORTY; viewporty = VIEWPORTY;
directdraw->RestoreDisplayMode(); directdraw->RestoreDisplayMode();
directdraw->SetCooperativeLevel(NULL,DDSCL_NORMAL); directdraw->SetCooperativeLevel(NULL,DDSCL_NORMAL);
SetWindowLong(framewindow,GWL_STYLE, SetWindowLong(g_hFrameWindow,GWL_STYLE,
WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX |
WS_VISIBLE); WS_VISIBLE);
SetWindowPos(framewindow,0,framerect.left, SetWindowPos(g_hFrameWindow,0,framerect.left,
framerect.top, framerect.top,
framerect.right - framerect.left, framerect.right - framerect.left,
framerect.bottom - framerect.top, framerect.bottom - framerect.top,
@ -1074,18 +1074,18 @@ void SetUsingCursor (BOOL newvalue) {
return; return;
usingcursor = newvalue; usingcursor = newvalue;
if (usingcursor) { if (usingcursor) {
SetCapture(framewindow); SetCapture(g_hFrameWindow);
RECT rect = {viewportx+2, RECT rect = {viewportx+2,
viewporty+2, viewporty+2,
viewportx+VIEWPORTCX-1, viewportx+VIEWPORTCX-1,
viewporty+VIEWPORTCY-1}; viewporty+VIEWPORTCY-1};
ClientToScreen(framewindow,(LPPOINT)&rect.left); ClientToScreen(g_hFrameWindow,(LPPOINT)&rect.left);
ClientToScreen(framewindow,(LPPOINT)&rect.right); ClientToScreen(g_hFrameWindow,(LPPOINT)&rect.right);
ClipCursor(&rect); ClipCursor(&rect);
ShowCursor(0); ShowCursor(0);
POINT pt; POINT pt;
GetCursorPos(&pt); GetCursorPos(&pt);
ScreenToClient(framewindow,&pt); ScreenToClient(g_hFrameWindow,&pt);
DrawCrosshairs(pt.x,pt.y); DrawCrosshairs(pt.x,pt.y);
} }
else { else {
@ -1116,7 +1116,7 @@ void FrameCreateWindow () {
int ypos; int ypos;
if (!RegLoadValue(TEXT("Preferences"),TEXT("Window Y-Position"),1,(DWORD *)&ypos)) if (!RegLoadValue(TEXT("Preferences"),TEXT("Window Y-Position"),1,(DWORD *)&ypos))
ypos = (GetSystemMetrics(SM_CYSCREEN)-height) >> 1; ypos = (GetSystemMetrics(SM_CYSCREEN)-height) >> 1;
framewindow = CreateWindow(TEXT("APPLE2FRAME"),apple2e ? TITLE g_hFrameWindow = CreateWindow(TEXT("APPLE2FRAME"),apple2e ? TITLE
: TEXT("Apple ][+ Emulator"), : TEXT("Apple ][+ Emulator"),
WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX |
WS_VISIBLE, WS_VISIBLE,
@ -1125,11 +1125,11 @@ void FrameCreateWindow () {
InitCommonControls(); InitCommonControls();
tooltipwindow = CreateWindow(TOOLTIPS_CLASS,NULL,TTS_ALWAYSTIP, tooltipwindow = CreateWindow(TOOLTIPS_CLASS,NULL,TTS_ALWAYSTIP,
CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT, CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,
framewindow,(HMENU)0,instance,NULL); g_hFrameWindow,(HMENU)0,instance,NULL);
TOOLINFO toolinfo; TOOLINFO toolinfo;
toolinfo.cbSize = sizeof(toolinfo); toolinfo.cbSize = sizeof(toolinfo);
toolinfo.uFlags = TTF_CENTERTIP; toolinfo.uFlags = TTF_CENTERTIP;
toolinfo.hwnd = framewindow; toolinfo.hwnd = g_hFrameWindow;
toolinfo.hinst = instance; toolinfo.hinst = instance;
toolinfo.lpszText = LPSTR_TEXTCALLBACK; toolinfo.lpszText = LPSTR_TEXTCALLBACK;
toolinfo.rect.left = BUTTONX; toolinfo.rect.left = BUTTONX;
@ -1147,7 +1147,7 @@ void FrameCreateWindow () {
//=========================================================================== //===========================================================================
HDC FrameGetDC () { HDC FrameGetDC () {
if (!framedc) { if (!framedc) {
framedc = GetDC(framewindow); framedc = GetDC(g_hFrameWindow);
SetViewportOrgEx(framedc,viewportx,viewporty,NULL); SetViewportOrgEx(framedc,viewportx,viewporty,NULL);
} }
return framedc; return framedc;
@ -1202,7 +1202,7 @@ void FrameRegisterClass () {
void FrameReleaseDC () { void FrameReleaseDC () {
if (framedc) { if (framedc) {
SetViewportOrgEx(framedc,0,0,NULL); SetViewportOrgEx(framedc,0,0,NULL);
ReleaseDC(framewindow,framedc); ReleaseDC(g_hFrameWindow,framedc);
framedc = (HDC)0; framedc = (HDC)0;
} }
} }

View File

@ -2,7 +2,7 @@
enum {NOT_ASCII=0, ASCII}; enum {NOT_ASCII=0, ASCII};
extern HWND framewindow; extern HWND g_hFrameWindow;
extern BOOL fullscreen; extern BOOL fullscreen;
void FrameCreateWindow (); void FrameCreateWindow ();

View File

@ -320,7 +320,7 @@ void HD_Select(int nDrive)
OPENFILENAME ofn; OPENFILENAME ofn;
ZeroMemory(&ofn,sizeof(OPENFILENAME)); ZeroMemory(&ofn,sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME); ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = framewindow; ofn.hwndOwner = g_hFrameWindow;
ofn.hInstance = instance; ofn.hInstance = instance;
ofn.lpstrFilter = TEXT("Hard Disk Images (*.hdv)\0*.hdv\0"); ofn.lpstrFilter = TEXT("Hard Disk Images (*.hdv)\0*.hdv\0");
ofn.lpstrFile = filename; ofn.lpstrFile = filename;

View File

@ -253,7 +253,7 @@ static void ClipboardInit()
if (!IsClipboardFormatAvailable(CF_TEXT)) if (!IsClipboardFormatAvailable(CF_TEXT))
return; return;
if (!OpenClipboard(framewindow)) if (!OpenClipboard(g_hFrameWindow))
return; return;
hglb = GetClipboardData(CF_TEXT); hglb = GetClipboardData(CF_TEXT);

View File

@ -244,7 +244,7 @@ static void ConfigDlg_OK(HWND window, BOOL afterclose)
// //
if (afterclose) if (afterclose)
PostMessage(framewindow,afterclose,0,0); PostMessage(g_hFrameWindow,afterclose,0,0);
} }
static void ConfigDlg_CANCEL(HWND window) static void ConfigDlg_CANCEL(HWND window)
@ -423,7 +423,7 @@ static void InputDlg_OK(HWND window, BOOL afterclose)
// //
if (afterclose) if (afterclose)
PostMessage(framewindow,afterclose,0,0); PostMessage(g_hFrameWindow,afterclose,0,0);
} }
static void InputDlg_CANCEL(HWND window) static void InputDlg_CANCEL(HWND window)
@ -558,7 +558,7 @@ static void SoundDlg_OK(HWND window, BOOL afterclose, UINT uNewSoundcardType)
// //
if (afterclose) if (afterclose)
PostMessage(framewindow,afterclose,0,0); PostMessage(g_hFrameWindow,afterclose,0,0);
} }
static void SoundDlg_CANCEL(HWND window) static void SoundDlg_CANCEL(HWND window)
@ -694,7 +694,7 @@ static void SaveStateDlg_OK(HWND window, BOOL afterclose)
// //
if (afterclose) if (afterclose)
PostMessage(framewindow,afterclose,0,0); PostMessage(g_hFrameWindow,afterclose,0,0);
} }
static void SaveStateDlg_CANCEL(HWND window) static void SaveStateDlg_CANCEL(HWND window)
@ -855,7 +855,7 @@ static void DiskDlg_OK(HWND window, BOOL afterclose)
// //
if (afterclose) if (afterclose)
PostMessage(framewindow,afterclose,0,0); PostMessage(g_hFrameWindow,afterclose,0,0);
} }
static void DiskDlg_CANCEL(HWND window) static void DiskDlg_CANCEL(HWND window)
@ -1228,7 +1228,7 @@ void PSP_Init()
PropSheetHeader.dwSize = sizeof(PROPSHEETHEADER); PropSheetHeader.dwSize = sizeof(PROPSHEETHEADER);
PropSheetHeader.dwFlags = PSH_NOAPPLYNOW | /* PSH_NOCONTEXTHELP | */ PSH_PROPSHEETPAGE; PropSheetHeader.dwFlags = PSH_NOAPPLYNOW | /* PSH_NOCONTEXTHELP | */ PSH_PROPSHEETPAGE;
PropSheetHeader.hwndParent = framewindow; PropSheetHeader.hwndParent = g_hFrameWindow;
PropSheetHeader.pszCaption = "AppleWin Configuration"; PropSheetHeader.pszCaption = "AppleWin Configuration";
PropSheetHeader.nPages = PG_NUM_SHEETS; PropSheetHeader.nPages = PG_NUM_SHEETS;
PropSheetHeader.nStartPage = g_nLastPage; PropSheetHeader.nStartPage = g_nLastPage;

View File

@ -152,7 +152,7 @@ void Snapshot_LoadState()
} }
catch(int) catch(int)
{ {
MessageBox( framewindow, MessageBox( g_hFrameWindow,
szMessage, szMessage,
TEXT("Load State"), TEXT("Load State"),
MB_ICONEXCLAMATION | MB_SETFOREGROUND); MB_ICONEXCLAMATION | MB_SETFOREGROUND);

View File

@ -495,7 +495,7 @@ bool DSInit()
return false; return false;
} }
hr = g_lpDS->SetCooperativeLevel(framewindow, DSSCL_NORMAL); hr = g_lpDS->SetCooperativeLevel(g_hFrameWindow, DSSCL_NORMAL);
if(FAILED(hr)) if(FAILED(hr))
{ {
if(g_fh) fprintf(g_fh, "SetCooperativeLevel failed (%08X)\n",hr); if(g_fh) fprintf(g_fh, "SetCooperativeLevel failed (%08X)\n",hr);

View File

@ -105,7 +105,7 @@ static void DisplayBenchmarkResults ()
TEXT("This benchmark took %u.%02u seconds."), TEXT("This benchmark took %u.%02u seconds."),
(unsigned)(totaltime / 1000), (unsigned)(totaltime / 1000),
(unsigned)((totaltime / 10) % 100)); (unsigned)((totaltime / 10) % 100));
MessageBox(framewindow, MessageBox(g_hFrameWindow,
buffer, buffer,
TEXT("Benchmark Results"), TEXT("Benchmark Results"),
MB_ICONINFORMATION | MB_SETFOREGROUND); MB_ICONINFORMATION | MB_SETFOREGROUND);

View File

@ -1385,7 +1385,7 @@ void VideoBenchmark () {
// IF THE PROGRAM COUNTER IS NOT IN THE EXPECTED RANGE AT THE END OF THE // IF THE PROGRAM COUNTER IS NOT IN THE EXPECTED RANGE AT THE END OF THE
// CPU BENCHMARK, REPORT AN ERROR AND OPTIONALLY TRACK IT DOWN // CPU BENCHMARK, REPORT AN ERROR AND OPTIONALLY TRACK IT DOWN
if ((regs.pc < 0x300) || (regs.pc > 0x400)) if ((regs.pc < 0x300) || (regs.pc > 0x400))
if (MessageBox(framewindow, if (MessageBox(g_hFrameWindow,
TEXT("The emulator has detected a problem while running ") TEXT("The emulator has detected a problem while running ")
TEXT("the CPU benchmark. Would you like to gather more ") TEXT("the CPU benchmark. Would you like to gather more ")
TEXT("information?"), TEXT("information?"),
@ -1414,13 +1414,13 @@ void VideoBenchmark () {
(unsigned)loop, (unsigned)loop,
(unsigned)lastpc, (unsigned)lastpc,
(unsigned)regs.pc); (unsigned)regs.pc);
MessageBox(framewindow, MessageBox(g_hFrameWindow,
outstr, outstr,
TEXT("Benchmarks"), TEXT("Benchmarks"),
MB_ICONINFORMATION | MB_SETFOREGROUND); MB_ICONINFORMATION | MB_SETFOREGROUND);
} }
else else
MessageBox(framewindow, MessageBox(g_hFrameWindow,
TEXT("The emulator was unable to locate the exact ") TEXT("The emulator was unable to locate the exact ")
TEXT("point of the error. This probably means that ") TEXT("point of the error. This probably means that ")
TEXT("the problem is external to the emulator, ") TEXT("the problem is external to the emulator, ")
@ -1475,7 +1475,7 @@ void VideoBenchmark () {
(unsigned)(totalmhz10 % 10), (unsigned)(totalmhz10 % 10),
(LPCTSTR)(apple2e ? TEXT("") : TEXT(" (6502)")), (LPCTSTR)(apple2e ? TEXT("") : TEXT(" (6502)")),
(unsigned)realisticfps); (unsigned)realisticfps);
MessageBox(framewindow, MessageBox(g_hFrameWindow,
outstr, outstr,
TEXT("Benchmarks"), TEXT("Benchmarks"),
MB_ICONINFORMATION | MB_SETFOREGROUND); MB_ICONINFORMATION | MB_SETFOREGROUND);
@ -1564,7 +1564,7 @@ void VideoChooseColor () {
CHOOSECOLOR cc; CHOOSECOLOR cc;
ZeroMemory(&cc,sizeof(CHOOSECOLOR)); ZeroMemory(&cc,sizeof(CHOOSECOLOR));
cc.lStructSize = sizeof(CHOOSECOLOR); cc.lStructSize = sizeof(CHOOSECOLOR);
cc.hwndOwner = framewindow; cc.hwndOwner = g_hFrameWindow;
cc.rgbResult = monochrome; cc.rgbResult = monochrome;
cc.lpCustColors = customcolors; cc.lpCustColors = customcolors;
cc.Flags = CC_RGBINIT | CC_SOLIDCOLOR; cc.Flags = CC_RGBINIT | CC_SOLIDCOLOR;