Remove usages of g_hFrameWindow and g_hInstance from core emulator files. And Resource related Win32 functions. (PR #915)
. Win32Frame: remove WM_USER_RESTART.
This commit is contained in:
parent
81279904e2
commit
cdf1cb9106
26 changed files with 158 additions and 218 deletions
|
@ -310,7 +310,7 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
|
|||
{
|
||||
std::string msg = "Failed to load video rom (not found or not exactly 2/4/8/16KiB)\n";
|
||||
LogFileOutput("%s", msg.c_str());
|
||||
MessageBox(GetFrame().g_hFrameWindow, msg.c_str(), TEXT("AppleWin Error"), MB_OK);
|
||||
GetFrame().FrameMessageBox(msg.c_str(), TEXT("AppleWin Error"), MB_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -528,7 +528,7 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
|
|||
msg += strUnsupported;
|
||||
msg += "\n";
|
||||
msg += "Continue running AppleWin?";
|
||||
int res = MessageBox(GetDesktopWindow(), // NB. g_hFrameWindow is not yet valid
|
||||
int res = GetFrame().FrameMessageBox(
|
||||
msg.c_str(),
|
||||
"AppleWin Command Line",
|
||||
MB_ICONSTOP | MB_SETFOREGROUND | MB_YESNO);
|
||||
|
|
|
@ -134,15 +134,14 @@ enum AppMode_e
|
|||
#define REGVALUE_PREF_LAST_HARDDISK_2 "Last Harddisk Image 2"
|
||||
|
||||
#define WM_USER_BENCHMARK WM_USER+1
|
||||
#define WM_USER_RESTART WM_USER+2
|
||||
#define WM_USER_SAVESTATE WM_USER+3
|
||||
#define WM_USER_LOADSTATE WM_USER+4
|
||||
#define VK_SNAPSHOT_560 WM_USER+5 // PrintScreen
|
||||
#define VK_SNAPSHOT_280 WM_USER+6 // PrintScreen+Shift
|
||||
#define WM_USER_TCP_SERIAL WM_USER+7
|
||||
#define WM_USER_BOOT WM_USER+8
|
||||
#define WM_USER_FULLSCREEN WM_USER+9
|
||||
#define VK_SNAPSHOT_TEXT WM_USER+10 // PrintScreen+Ctrl
|
||||
#define WM_USER_SAVESTATE WM_USER+2
|
||||
#define WM_USER_LOADSTATE WM_USER+3
|
||||
#define VK_SNAPSHOT_560 WM_USER+4 // PrintScreen
|
||||
#define VK_SNAPSHOT_280 WM_USER+5 // PrintScreen+Shift
|
||||
#define WM_USER_TCP_SERIAL WM_USER+6
|
||||
#define WM_USER_BOOT WM_USER+7
|
||||
#define WM_USER_FULLSCREEN WM_USER+8
|
||||
#define VK_SNAPSHOT_TEXT WM_USER+9 // PrintScreen+Ctrl
|
||||
|
||||
enum eIRQSRC {IS_6522=0, IS_SPEECH, IS_SSC, IS_MOUSE};
|
||||
|
||||
|
|
|
@ -412,7 +412,7 @@ UINT CPageDisk::RemovalConfirmation(UINT uCommand)
|
|||
|
||||
if (bMsgBox)
|
||||
{
|
||||
int nRes = MessageBox(GetFrame().g_hFrameWindow, szText, TEXT("Eject/Unplug Warning"), MB_ICONWARNING | MB_YESNO | MB_SETFOREGROUND);
|
||||
int nRes = GetFrame().FrameMessageBox(szText, TEXT("Eject/Unplug Warning"), MB_ICONWARNING | MB_YESNO | MB_SETFOREGROUND);
|
||||
if (nRes == IDNO)
|
||||
uCommand = 0;
|
||||
}
|
||||
|
|
|
@ -285,7 +285,7 @@ void CPropertySheetHelper::PostMsgAfterClose(HWND hWnd, PAGETYPE page)
|
|||
return;
|
||||
}
|
||||
|
||||
UINT uAfterClose = 0;
|
||||
bool restart = false;
|
||||
|
||||
if (m_ConfigNew.m_Apple2Type == A2TYPE_CLONE)
|
||||
{
|
||||
|
@ -310,11 +310,11 @@ void CPropertySheetHelper::PostMsgAfterClose(HWND hWnd, PAGETYPE page)
|
|||
|
||||
ApplyNewConfig();
|
||||
|
||||
uAfterClose = WM_USER_RESTART;
|
||||
restart = true;
|
||||
}
|
||||
|
||||
if (uAfterClose)
|
||||
PostMessage(GetFrame().g_hFrameWindow, uAfterClose, 0, 0);
|
||||
if (restart)
|
||||
GetFrame().Restart();
|
||||
}
|
||||
|
||||
bool CPropertySheetHelper::CheckChangesForRestart(HWND hWnd)
|
||||
|
|
|
@ -2225,7 +2225,7 @@ void _CmdColorGet( const int iScheme, const int iColor )
|
|||
{
|
||||
TCHAR sText[ CONSOLE_WIDTH ];
|
||||
wsprintf( sText, "Color: %d\nOut of range!", iColor );
|
||||
MessageBox(GetFrame().g_hFrameWindow, sText, TEXT("ERROR"), MB_OK );
|
||||
GetFrame().FrameMessageBox(sText, TEXT("ERROR"), MB_OK );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3042,7 +3042,7 @@ void DisasmCalcTopFromCurAddress( bool bUpdateTop )
|
|||
"\tLen: %04X\n"
|
||||
"\tMissed: %04X"),
|
||||
g_nDisasmCurAddress - nLen, nLen, g_nDisasmCurAddress );
|
||||
MessageBox( GetFrame().g_hFrameWindow, sText, "ERROR", MB_OK );
|
||||
GetFrame().FrameMessageBox( sText, "ERROR", MB_OK );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -471,7 +471,7 @@ int _6502_GetOpmodeOpbyte ( const int nBaseAddress, int & iOpmode_, int & nOpby
|
|||
#if _DEBUG
|
||||
if (! g_aOpcodes)
|
||||
{
|
||||
MessageBox(GetFrame().g_hFrameWindow, "Debugger not properly initialized", "ERROR", MB_OK );
|
||||
GetFrame().FrameMessageBox("Debugger not properly initialized", "ERROR", MB_OK );
|
||||
|
||||
g_aOpcodes = & g_aOpcodes65C02[ 0 ]; // Enhanced Apple //e
|
||||
g_aOpmodes[ AM_2 ].m_nBytes = 2;
|
||||
|
|
|
@ -518,7 +518,7 @@ void VerifyDebuggerCommandTable()
|
|||
if ( g_aCommands[ iCmd ].iCommand != iCmd)
|
||||
{
|
||||
sprintf( sText, "*** ERROR *** Enumerated Commands mis-matched at #%d!", iCmd );
|
||||
MessageBoxA(GetFrame().g_hFrameWindow, sText, TEXT("ERROR"), MB_OK );
|
||||
GetFrame().FrameMessageBox(sText, TEXT("ERROR"), MB_OK );
|
||||
PostQuitMessage( 1 );
|
||||
}
|
||||
}
|
||||
|
@ -527,14 +527,14 @@ void VerifyDebuggerCommandTable()
|
|||
if (strcmp( g_aCommands[ NUM_COMMANDS ].m_sName, DEBUGGER__COMMANDS_VERIFY_TXT__))
|
||||
{
|
||||
sprintf( sText, "*** ERROR *** Total Commands mis-matched!" );
|
||||
MessageBoxA(GetFrame().g_hFrameWindow, sText, TEXT("ERROR"), MB_OK );
|
||||
GetFrame().FrameMessageBox(sText, TEXT("ERROR"), MB_OK );
|
||||
PostQuitMessage( 1 );
|
||||
}
|
||||
|
||||
if (strcmp( g_aParameters[ NUM_PARAMS ].m_sName, DEBUGGER__PARAMS_VERIFY_TXT__))
|
||||
{
|
||||
sprintf( sText, "*** ERROR *** Total Parameters mis-matched!" );
|
||||
MessageBoxA(GetFrame().g_hFrameWindow, sText, TEXT("ERROR"), MB_OK );
|
||||
GetFrame().FrameMessageBox(sText, TEXT("ERROR"), MB_OK );
|
||||
PostQuitMessage( 2 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -758,7 +758,7 @@ static void PrintGlyph( const int xDst, const int yDst, const int glyph )
|
|||
{
|
||||
#if _DEBUG
|
||||
if ((xDst < 0) || (yDst < 0))
|
||||
MessageBox(GetFrame().g_hFrameWindow, "X or Y out of bounds!", "PrintGlyph()", MB_OK );
|
||||
GetFrame().FrameMessageBox("X or Y out of bounds!", "PrintGlyph()", MB_OK );
|
||||
#endif
|
||||
int col = xDst / CONSOLE_FONT_WIDTH ;
|
||||
int row = yDst / CONSOLE_FONT_HEIGHT;
|
||||
|
@ -874,7 +874,7 @@ int PrintText ( const char * pText, RECT & rRect )
|
|||
{
|
||||
#if _DEBUG
|
||||
if (! pText)
|
||||
MessageBox(GetFrame().g_hFrameWindow, "pText = NULL!", "DrawText()", MB_OK );
|
||||
GetFrame().FrameMessageBox("pText = NULL!", "DrawText()", MB_OK );
|
||||
#endif
|
||||
|
||||
int nLen = strlen( pText );
|
||||
|
@ -4120,7 +4120,7 @@ void UpdateDisplay (Update_t bUpdate)
|
|||
if (spDrawMutex)
|
||||
{
|
||||
#if DEBUG
|
||||
MessageBox( GetFrame().g_hFrameWindow, "Already drawing!", "!", MB_OK );
|
||||
GetFrame().FrameMessageBox( "Already drawing!", "!", MB_OK );
|
||||
#endif
|
||||
}
|
||||
spDrawMutex = true;
|
||||
|
|
|
@ -696,7 +696,7 @@ ImageError_e Disk2InterfaceCard::InsertDisk(const int drive, LPCTSTR pszImageFil
|
|||
{
|
||||
TCHAR szText[100+MAX_PATH];
|
||||
StringCbPrintf(szText, sizeof(szText), "Only the first file in a multi-file zip is supported\nUse disk image '%s' ?", pFloppy->m_strFilenameInZip.c_str());
|
||||
int nRes = MessageBox(GetFrame().g_hFrameWindow, szText, TEXT("Multi-Zip Warning"), MB_ICONWARNING | MB_YESNO | MB_SETFOREGROUND);
|
||||
int nRes = GetFrame().FrameMessageBox(szText, TEXT("Multi-Zip Warning"), MB_ICONWARNING | MB_YESNO | MB_SETFOREGROUND);
|
||||
if (nRes == IDNO)
|
||||
{
|
||||
EjectDisk(drive);
|
||||
|
@ -825,8 +825,7 @@ void Disk2InterfaceCard::NotifyInvalidImage(const int drive, LPCTSTR pszImageFil
|
|||
return;
|
||||
}
|
||||
|
||||
MessageBox(
|
||||
GetFrame().g_hFrameWindow,
|
||||
GetFrame().FrameMessageBox(
|
||||
szBuffer,
|
||||
g_pAppTitle.c_str(),
|
||||
MB_ICONEXCLAMATION | MB_SETFOREGROUND);
|
||||
|
@ -1563,7 +1562,7 @@ bool Disk2InterfaceCard::UserSelectNewDiskImage(const int drive, LPCSTR pszFilen
|
|||
{
|
||||
if (!IsDriveConnected(drive))
|
||||
{
|
||||
MessageBox(GetFrame().g_hFrameWindow, "Drive not connected!", "Insert disk", MB_ICONEXCLAMATION|MB_SETFOREGROUND|MB_OK);
|
||||
GetFrame().FrameMessageBox("Drive not connected!", "Insert disk", MB_ICONEXCLAMATION|MB_SETFOREGROUND|MB_OK);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1729,8 +1728,7 @@ bool Disk2InterfaceCard::DriveSwap(void)
|
|||
if (m_floppyDrive[DRIVE_1].m_spinning || m_floppyDrive[DRIVE_2].m_spinning)
|
||||
{
|
||||
// 1.26.2.4 Prompt when trying to swap disks while drive is on instead of silently failing
|
||||
int status = MessageBox(
|
||||
GetFrame().g_hFrameWindow,
|
||||
int status = GetFrame().FrameMessageBox(
|
||||
"WARNING:\n"
|
||||
"\n"
|
||||
"\tAttempting to swap a disk while a drive is on\n"
|
||||
|
@ -1777,21 +1775,9 @@ bool Disk2InterfaceCard::DriveSwap(void)
|
|||
|
||||
//===========================================================================
|
||||
|
||||
bool Disk2InterfaceCard::GetFirmware(LPCSTR lpName, BYTE* pDst)
|
||||
bool Disk2InterfaceCard::GetFirmware(WORD lpNameId, BYTE* pDst)
|
||||
{
|
||||
HRSRC hResInfo = FindResource(NULL, lpName, "FIRMWARE");
|
||||
if(hResInfo == NULL)
|
||||
return false;
|
||||
|
||||
DWORD dwResSize = SizeofResource(NULL, hResInfo);
|
||||
if(dwResSize != DISK2_FW_SIZE)
|
||||
return false;
|
||||
|
||||
HGLOBAL hResData = LoadResource(NULL, hResInfo);
|
||||
if(hResData == NULL)
|
||||
return false;
|
||||
|
||||
BYTE* pData = (BYTE*) LockResource(hResData); // NB. Don't need to unlock resource
|
||||
BYTE* pData = GetFrame().GetResource(lpNameId, "FIRMWARE", DISK2_FW_SIZE);
|
||||
if (!pData)
|
||||
return false;
|
||||
|
||||
|
@ -1817,10 +1803,10 @@ void Disk2InterfaceCard::InitFirmware(LPBYTE pCxRomPeripheral)
|
|||
// TODO: LoadRom_Disk_Floppy()
|
||||
void Disk2InterfaceCard::Initialize(LPBYTE pCxRomPeripheral, UINT uSlot)
|
||||
{
|
||||
bool res = GetFirmware(MAKEINTRESOURCE(IDR_DISK2_13SECTOR_FW), m_13SectorFirmware);
|
||||
bool res = GetFirmware(IDR_DISK2_13SECTOR_FW, m_13SectorFirmware);
|
||||
_ASSERT(res);
|
||||
|
||||
res = GetFirmware(MAKEINTRESOURCE(IDR_DISK2_16SECTOR_FW), m_16SectorFirmware);
|
||||
res = GetFirmware(IDR_DISK2_16SECTOR_FW, m_16SectorFirmware);
|
||||
_ASSERT(res);
|
||||
|
||||
// Note: We used to disable the track stepping delay in the Disk II controller firmware by
|
||||
|
|
|
@ -203,7 +203,7 @@ private:
|
|||
void SetSequencerFunction(WORD addr);
|
||||
void DumpSectorWOZ(FloppyDisk floppy);
|
||||
void DumpTrackWOZ(FloppyDisk floppy);
|
||||
bool GetFirmware(LPCSTR lpName, BYTE* pDst);
|
||||
bool GetFirmware(WORD lpNameId, BYTE* pDst);
|
||||
void InitFirmware(LPBYTE pCxRomPeripheral);
|
||||
void UpdateLatchForEmptyDrive(FloppyDrive* pDrive);
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
#include "DiskImage.h"
|
||||
#include "Log.h"
|
||||
#include "Memory.h"
|
||||
#include "Interface.h"
|
||||
|
||||
ImageInfo::ImageInfo()
|
||||
{
|
||||
|
@ -2051,7 +2052,7 @@ CImageBase* CDiskImageHelper::Detect(LPBYTE pImage, DWORD dwSize, const TCHAR* p
|
|||
if (pWozHdr->crc32 && // WOZ spec: CRC of 0 should be ignored
|
||||
pWozHdr->crc32 != crc32(0, pImage+sizeof(CWOZHelper::WOZHeader), dwSize-sizeof(CWOZHelper::WOZHeader)))
|
||||
{
|
||||
int res = MessageBox(GetDesktopWindow(), "CRC mismatch\nContinue using image?", "AppleWin: WOZ Header", MB_ICONSTOP | MB_SETFOREGROUND | MB_YESNO);
|
||||
int res = GetFrame().FrameMessageBox("CRC mismatch\nContinue using image?", "AppleWin: WOZ Header", MB_ICONSTOP | MB_SETFOREGROUND | MB_YESNO);
|
||||
if (res == IDNO)
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ void FrameBase::Video_TakeScreenShot(const Video::VideoScreenShot_e ScreenShotTy
|
|||
{
|
||||
TCHAR msg[512];
|
||||
StringCbPrintf(msg, 512, "You have more then %d screenshot filenames! They will no longer be saved.\n\nEither move some of your screenshots or increase the maximum in video.cpp\n", nMaxScreenShot);
|
||||
MessageBox(GetFrame().g_hFrameWindow, msg, "Warning", MB_OK);
|
||||
FrameMessageBox(msg, "Warning", MB_OK);
|
||||
g_nLastScreenShot = 0;
|
||||
return;
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ void FrameBase::Video_SaveScreenShot(const Video::VideoScreenShot_e ScreenShotTy
|
|||
|
||||
if (g_bDisplayPrintScreenFileName)
|
||||
{
|
||||
MessageBox(GetFrame().g_hFrameWindow, pScreenShotFileName, "Screen Captured", MB_OK);
|
||||
FrameMessageBox(pScreenShotFileName, "Screen Captured", MB_OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,21 @@ public:
|
|||
|
||||
virtual void VideoPresentScreen(void) = 0;
|
||||
|
||||
// this function has the same interface as MessageBox in windows.h
|
||||
virtual int FrameMessageBox(LPCSTR lpText, LPCSTR lpCaption, UINT uType) = 0;
|
||||
|
||||
// this function merges LoadBitmap and GetBitmapBits from windows.h
|
||||
virtual void GetBitmap(LPCSTR lpBitmapName, LONG cb, LPVOID lpvBits) = 0;
|
||||
|
||||
// FindResource, MAKEINTRESOURCE, SizeofResource, LoadResource, LockResource
|
||||
// Return pointer to resource if size is correct.
|
||||
// NULL if resource is invalid or size check fails
|
||||
// The pointer is only valid until the next call to GetResource
|
||||
// (in Windows, the pointer is valid forever, but it would be very restrictive to force this on other FrameBase implementations)
|
||||
virtual BYTE* GetResource(WORD id, LPCSTR lpType, DWORD expectedSize) = 0;
|
||||
|
||||
virtual void Restart() = 0;
|
||||
|
||||
void VideoRefreshScreen(uint32_t uRedrawWholeScreenVideoMode, bool bRedrawWholeScreen);
|
||||
void VideoRedrawScreen(void);
|
||||
void VideoRedrawScreenDuringFullSpeed(DWORD dwCyclesThisFrame, bool bInit = false);
|
||||
|
|
|
@ -362,19 +362,7 @@ void HD_Load_Rom(const LPBYTE pCxRomPeripheral, const UINT uSlot)
|
|||
if(!g_bHD_Enabled)
|
||||
return;
|
||||
|
||||
HRSRC hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_HDDRVR_FW), "FIRMWARE");
|
||||
if(hResInfo == NULL)
|
||||
return;
|
||||
|
||||
DWORD dwResSize = SizeofResource(NULL, hResInfo);
|
||||
if(dwResSize != HDDRVR_SIZE)
|
||||
return;
|
||||
|
||||
HGLOBAL hResData = LoadResource(NULL, hResInfo);
|
||||
if(hResData == NULL)
|
||||
return;
|
||||
|
||||
BYTE* pData = (BYTE*) LockResource(hResData); // NB. Don't need to unlock resource
|
||||
BYTE* pData = GetFrame().GetResource(IDR_HDDRVR_FW, "FIRMWARE", HDDRVR_SIZE);
|
||||
if(pData == NULL)
|
||||
return;
|
||||
|
||||
|
|
|
@ -1493,8 +1493,7 @@ void MemInitialize()
|
|||
|
||||
if (!memaux || !memdirty || !memimage || !memmain || !memrom || !pCxRomInternal || !pCxRomPeripheral)
|
||||
{
|
||||
MessageBox(
|
||||
GetDesktopWindow(),
|
||||
GetFrame().FrameMessageBox(
|
||||
TEXT("The emulator was unable to allocate the memory it ")
|
||||
TEXT("requires. Further execution is not possible."),
|
||||
g_pAppTitle.c_str(),
|
||||
|
@ -1535,22 +1534,28 @@ void MemInitializeROM(void)
|
|||
{
|
||||
// READ THE APPLE FIRMWARE ROMS INTO THE ROM IMAGE
|
||||
UINT ROM_SIZE = 0;
|
||||
HRSRC hResInfo = NULL;
|
||||
WORD resourceId = 0;
|
||||
switch (g_Apple2Type)
|
||||
{
|
||||
case A2TYPE_APPLE2: hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_APPLE2_ROM ), "ROM"); ROM_SIZE = Apple2RomSize ; break;
|
||||
case A2TYPE_APPLE2PLUS: hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_APPLE2_PLUS_ROM ), "ROM"); ROM_SIZE = Apple2RomSize ; break;
|
||||
case A2TYPE_APPLE2JPLUS: hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_APPLE2_JPLUS_ROM ), "ROM"); ROM_SIZE = Apple2RomSize ; break;
|
||||
case A2TYPE_APPLE2E: hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_APPLE2E_ROM ), "ROM"); ROM_SIZE = Apple2eRomSize; break;
|
||||
case A2TYPE_APPLE2EENHANCED:hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_APPLE2E_ENHANCED_ROM), "ROM"); ROM_SIZE = Apple2eRomSize; break;
|
||||
case A2TYPE_PRAVETS82: hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_PRAVETS_82_ROM ), "ROM"); ROM_SIZE = Apple2RomSize ; break;
|
||||
case A2TYPE_PRAVETS8M: hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_PRAVETS_8M_ROM ), "ROM"); ROM_SIZE = Apple2RomSize ; break;
|
||||
case A2TYPE_PRAVETS8A: hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_PRAVETS_8C_ROM ), "ROM"); ROM_SIZE = Apple2eRomSize; break;
|
||||
case A2TYPE_TK30002E: hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_TK3000_2E_ROM ), "ROM"); ROM_SIZE = Apple2eRomSize; break;
|
||||
case A2TYPE_BASE64A: hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_BASE_64A_ROM ), "ROM"); ROM_SIZE = Base64ARomSize; break;
|
||||
case A2TYPE_APPLE2: resourceId = IDR_APPLE2_ROM ; ROM_SIZE = Apple2RomSize ; break;
|
||||
case A2TYPE_APPLE2PLUS: resourceId = IDR_APPLE2_PLUS_ROM ; ROM_SIZE = Apple2RomSize ; break;
|
||||
case A2TYPE_APPLE2JPLUS: resourceId = IDR_APPLE2_JPLUS_ROM ; ROM_SIZE = Apple2RomSize ; break;
|
||||
case A2TYPE_APPLE2E: resourceId = IDR_APPLE2E_ROM ; ROM_SIZE = Apple2eRomSize; break;
|
||||
case A2TYPE_APPLE2EENHANCED:resourceId = IDR_APPLE2E_ENHANCED_ROM; ROM_SIZE = Apple2eRomSize; break;
|
||||
case A2TYPE_PRAVETS82: resourceId = IDR_PRAVETS_82_ROM ; ROM_SIZE = Apple2RomSize ; break;
|
||||
case A2TYPE_PRAVETS8M: resourceId = IDR_PRAVETS_8M_ROM ; ROM_SIZE = Apple2RomSize ; break;
|
||||
case A2TYPE_PRAVETS8A: resourceId = IDR_PRAVETS_8C_ROM ; ROM_SIZE = Apple2eRomSize; break;
|
||||
case A2TYPE_TK30002E: resourceId = IDR_TK3000_2E_ROM ; ROM_SIZE = Apple2eRomSize; break;
|
||||
case A2TYPE_BASE64A: resourceId = IDR_BASE_64A_ROM ; ROM_SIZE = Base64ARomSize; break;
|
||||
}
|
||||
|
||||
if (hResInfo == NULL)
|
||||
BYTE* pData = NULL;
|
||||
if (resourceId)
|
||||
{
|
||||
pData = GetFrame().GetResource(resourceId, "ROM", ROM_SIZE);
|
||||
}
|
||||
|
||||
if (pData == NULL)
|
||||
{
|
||||
TCHAR sRomFileName[ MAX_PATH ];
|
||||
switch (g_Apple2Type)
|
||||
|
@ -1577,8 +1582,7 @@ void MemInitializeROM(void)
|
|||
|
||||
LogFileOutput("%s\n", sText);
|
||||
|
||||
MessageBox(
|
||||
GetDesktopWindow(),
|
||||
GetFrame().FrameMessageBox(
|
||||
sText,
|
||||
g_pAppTitle.c_str(),
|
||||
MB_ICONSTOP | MB_SETFOREGROUND);
|
||||
|
@ -1586,18 +1590,6 @@ void MemInitializeROM(void)
|
|||
ExitProcess(1);
|
||||
}
|
||||
|
||||
DWORD dwResSize = SizeofResource(NULL, hResInfo);
|
||||
if(dwResSize != ROM_SIZE)
|
||||
return;
|
||||
|
||||
HGLOBAL hResData = LoadResource(NULL, hResInfo);
|
||||
if(hResData == NULL)
|
||||
return;
|
||||
|
||||
BYTE* pData = (BYTE*) LockResource(hResData); // NB. Don't need to unlock resource
|
||||
if (pData == NULL)
|
||||
return;
|
||||
|
||||
memset(pCxRomInternal,0,CxRomSize);
|
||||
memset(pCxRomPeripheral,0,CxRomSize);
|
||||
|
||||
|
@ -1617,32 +1609,18 @@ void MemInitializeCustomF8ROM(void)
|
|||
{
|
||||
const UINT F8RomSize = 0x800;
|
||||
const UINT F8RomOffset = Apple2RomSize-F8RomSize;
|
||||
FrameBase& frame = GetFrame();
|
||||
|
||||
if (IsApple2Original(GetApple2Type()) && GetCardMgr().QuerySlot(SLOT0) == CT_LanguageCard)
|
||||
{
|
||||
try
|
||||
BYTE* pData = frame.GetResource(IDR_APPLE2_PLUS_ROM, "ROM", Apple2RomSize);
|
||||
if (pData == NULL)
|
||||
{
|
||||
HRSRC hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_APPLE2_PLUS_ROM), "ROM");
|
||||
if (hResInfo == NULL)
|
||||
throw false;
|
||||
|
||||
DWORD dwResSize = SizeofResource(NULL, hResInfo);
|
||||
if(dwResSize != Apple2RomSize)
|
||||
throw false;
|
||||
|
||||
HGLOBAL hResData = LoadResource(NULL, hResInfo);
|
||||
if(hResData == NULL)
|
||||
throw false;
|
||||
|
||||
BYTE* pData = (BYTE*) LockResource(hResData); // NB. Don't need to unlock resource
|
||||
if (pData == NULL)
|
||||
throw false;
|
||||
|
||||
memcpy(memrom+F8RomOffset, pData+F8RomOffset, F8RomSize);
|
||||
frame.FrameMessageBox("Failed to read F8 (auto-start) ROM for language card in original Apple][", TEXT("AppleWin Error"), MB_OK);
|
||||
}
|
||||
catch (bool)
|
||||
else
|
||||
{
|
||||
MessageBox( GetFrame().g_hFrameWindow, "Failed to read F8 (auto-start) ROM for language card in original Apple][", TEXT("AppleWin Error"), MB_OK );
|
||||
memcpy(memrom+F8RomOffset, pData+F8RomOffset, F8RomSize);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1663,7 +1641,7 @@ void MemInitializeCustomF8ROM(void)
|
|||
|
||||
if (!bRes)
|
||||
{
|
||||
MessageBox( GetFrame().g_hFrameWindow, "Failed to read custom F8 rom", TEXT("AppleWin Error"), MB_OK );
|
||||
GetFrame().FrameMessageBox( "Failed to read custom F8 rom", TEXT("AppleWin Error"), MB_OK );
|
||||
CloseHandle(g_hCustomRomF8);
|
||||
g_hCustomRomF8 = INVALID_HANDLE_VALUE;
|
||||
// Failed, so use default rom...
|
||||
|
@ -1672,12 +1650,8 @@ void MemInitializeCustomF8ROM(void)
|
|||
|
||||
if (GetPropertySheet().GetTheFreezesF8Rom() && IS_APPLE2)
|
||||
{
|
||||
HGLOBAL hResData = NULL;
|
||||
BYTE* pData = NULL;
|
||||
|
||||
HRSRC hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_FREEZES_F8_ROM), "ROM");
|
||||
|
||||
if (hResInfo && (SizeofResource(NULL, hResInfo) == 0x800) && (hResData = LoadResource(NULL, hResInfo)) && (pData = (BYTE*) LockResource(hResData)))
|
||||
BYTE* pData = frame.GetResource(IDR_FREEZES_F8_ROM, "ROM", 0x800);
|
||||
if (pData)
|
||||
{
|
||||
memcpy(memrom+Apple2RomSize-F8RomSize, pData, F8RomSize);
|
||||
}
|
||||
|
@ -1719,7 +1693,7 @@ void MemInitializeCustomROM(void)
|
|||
|
||||
if (!bRes)
|
||||
{
|
||||
MessageBox( GetFrame().g_hFrameWindow, "Failed to read custom rom", TEXT("AppleWin Error"), MB_OK );
|
||||
GetFrame().FrameMessageBox( "Failed to read custom rom", TEXT("AppleWin Error"), MB_OK );
|
||||
CloseHandle(g_hCustomRom);
|
||||
g_hCustomRom = INVALID_HANDLE_VALUE;
|
||||
// Failed, so use default rom...
|
||||
|
|
|
@ -164,20 +164,7 @@ void CMouseInterface::InitializeROM(void)
|
|||
return;
|
||||
|
||||
const UINT FW_SIZE = 2*1024;
|
||||
|
||||
HRSRC hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_MOUSEINTERFACE_FW), "FIRMWARE");
|
||||
if(hResInfo == NULL)
|
||||
return;
|
||||
|
||||
DWORD dwResSize = SizeofResource(NULL, hResInfo);
|
||||
if(dwResSize != FW_SIZE)
|
||||
return;
|
||||
|
||||
HGLOBAL hResData = LoadResource(NULL, hResInfo);
|
||||
if(hResData == NULL)
|
||||
return;
|
||||
|
||||
BYTE* pData = (BYTE*) LockResource(hResData); // NB. Don't need to unlock resource
|
||||
BYTE* pData = GetFrame().GetResource(IDR_MOUSEINTERFACE_FW, "FIRMWARE", FW_SIZE);
|
||||
if(pData == NULL)
|
||||
return;
|
||||
|
||||
|
|
|
@ -76,8 +76,7 @@ static void get_csbits(csbits_t csbits, const char* resourceName, const UINT cy0
|
|||
const UINT bufferSize = bitmapWidthBytes*bitmapHeight;
|
||||
BYTE* pBuffer = new BYTE [bufferSize];
|
||||
|
||||
HBITMAP hCharBitmap = LoadBitmap(GetFrame().g_hInstance, resourceName);
|
||||
GetBitmapBits(hCharBitmap, bufferSize, pBuffer);
|
||||
GetFrame().GetBitmap(resourceName, bufferSize, pBuffer);
|
||||
|
||||
for (UINT cy=cy0, ch=0; cy<cy0+16; cy++)
|
||||
{
|
||||
|
@ -87,8 +86,6 @@ static void get_csbits(csbits_t csbits, const char* resourceName, const UINT cy0
|
|||
}
|
||||
}
|
||||
|
||||
DeleteObject(hCharBitmap);
|
||||
|
||||
delete [] pBuffer;
|
||||
}
|
||||
|
||||
|
@ -251,19 +248,7 @@ static void userVideoRomForIIPlus(void)
|
|||
|
||||
static void VideoRomForIIJPlus(void)
|
||||
{
|
||||
HRSRC hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_APPLE2_JPLUS_VIDEO_ROM), "ROM");
|
||||
if (hResInfo == NULL)
|
||||
return;
|
||||
|
||||
DWORD dwResSize = SizeofResource(NULL, hResInfo);
|
||||
if(dwResSize != Video::kVideoRomSize2K)
|
||||
return;
|
||||
|
||||
HGLOBAL hResData = LoadResource(NULL, hResInfo);
|
||||
if(hResData == NULL)
|
||||
return;
|
||||
|
||||
BYTE* pVideoRom = (BYTE*) LockResource(hResData); // NB. Don't need to unlock resource
|
||||
BYTE* pVideoRom = GetFrame().GetResource(IDR_APPLE2_JPLUS_VIDEO_ROM, "ROM", Video::kVideoRomSize2K);
|
||||
if (pVideoRom == NULL)
|
||||
return;
|
||||
|
||||
|
@ -273,19 +258,7 @@ static void VideoRomForIIJPlus(void)
|
|||
|
||||
static void VideoRomForBase64A(void)
|
||||
{
|
||||
HRSRC hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_BASE64A_VIDEO_ROM), "ROM");
|
||||
if (hResInfo == NULL)
|
||||
return;
|
||||
|
||||
DWORD dwResSize = SizeofResource(NULL, hResInfo);
|
||||
if (dwResSize != Video::kVideoRomSize4K)
|
||||
return;
|
||||
|
||||
HGLOBAL hResData = LoadResource(NULL, hResInfo);
|
||||
if (hResData == NULL)
|
||||
return;
|
||||
|
||||
BYTE* pVideoRom = (BYTE*)LockResource(hResData); // NB. Don't need to unlock resource
|
||||
BYTE* pVideoRom = GetFrame().GetResource(IDR_BASE64A_VIDEO_ROM, "ROM", Video::kVideoRomSize4K);
|
||||
if (pVideoRom == NULL)
|
||||
return;
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
#include "Pravets.h"
|
||||
#include "Registry.h"
|
||||
#include "YamlHelper.h"
|
||||
#include "Interface.h"
|
||||
|
||||
#include "../resource/resource.h"
|
||||
|
||||
|
@ -61,19 +62,7 @@ static BYTE __stdcall PrintTransmit(WORD, WORD, BYTE, BYTE value, ULONG);
|
|||
|
||||
VOID PrintLoadRom(LPBYTE pCxRomPeripheral, const UINT uSlot)
|
||||
{
|
||||
HRSRC hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_PRINTDRVR_FW), "FIRMWARE");
|
||||
if(hResInfo == NULL)
|
||||
return;
|
||||
|
||||
DWORD dwResSize = SizeofResource(NULL, hResInfo);
|
||||
if(dwResSize != PRINTDRVR_SIZE)
|
||||
return;
|
||||
|
||||
HGLOBAL hResData = LoadResource(NULL, hResInfo);
|
||||
if(hResData == NULL)
|
||||
return;
|
||||
|
||||
BYTE* pData = (BYTE*) LockResource(hResData); // NB. Don't need to unlock resource
|
||||
BYTE* pData = GetFrame().GetResource(IDR_PRINTDRVR_FW, "FIRMWARE", PRINTDRVR_SIZE);
|
||||
if(pData == NULL)
|
||||
return;
|
||||
|
||||
|
|
|
@ -438,6 +438,8 @@ static void Snapshot_LoadState_v2(void)
|
|||
bool restart = false; // Only need to restart if any VM state has change
|
||||
HCURSOR oldcursor = SetCursor(LoadCursor(0,IDC_WAIT));
|
||||
|
||||
FrameBase& frame = GetFrame();
|
||||
|
||||
try
|
||||
{
|
||||
if (!yamlHelper.InitParser( g_strSaveStatePathname.c_str() ))
|
||||
|
@ -507,7 +509,7 @@ static void Snapshot_LoadState_v2(void)
|
|||
}
|
||||
|
||||
MB_SetCumulativeCycles();
|
||||
GetFrame().SetLoadedSaveStateFlag(true);
|
||||
frame.SetLoadedSaveStateFlag(true);
|
||||
|
||||
// NB. The following disparity should be resolved:
|
||||
// . A change in h/w via the Configuration property sheets results in a the VM completely restarting (via WM_USER_RESTART)
|
||||
|
@ -530,13 +532,13 @@ static void Snapshot_LoadState_v2(void)
|
|||
}
|
||||
catch(std::string szMessage)
|
||||
{
|
||||
MessageBox( GetFrame().g_hFrameWindow,
|
||||
frame.FrameMessageBox(
|
||||
szMessage.c_str(),
|
||||
TEXT("Load State"),
|
||||
MB_ICONEXCLAMATION | MB_SETFOREGROUND);
|
||||
|
||||
if (restart)
|
||||
PostMessage(GetFrame().g_hFrameWindow, WM_USER_RESTART, 0, 0); // Power-cycle VM (undoing all the new state just loaded)
|
||||
frame.Restart(); // Power-cycle VM (undoing all the new state just loaded)
|
||||
}
|
||||
|
||||
SetCursor(oldcursor);
|
||||
|
@ -549,7 +551,7 @@ void Snapshot_LoadState()
|
|||
const size_t pos = g_strSaveStatePathname.size() - ext_aws.size();
|
||||
if (g_strSaveStatePathname.find(ext_aws, pos) != std::string::npos) // find ".aws" at end of pathname
|
||||
{
|
||||
MessageBox( GetFrame().g_hFrameWindow,
|
||||
GetFrame().FrameMessageBox(
|
||||
"Save-state v1 no longer supported.\n"
|
||||
"Please load using AppleWin 1.27, and re-save as a v2 state file.",
|
||||
TEXT("Load State"),
|
||||
|
@ -646,7 +648,7 @@ void Snapshot_SaveState(void)
|
|||
}
|
||||
catch(std::string szMessage)
|
||||
{
|
||||
MessageBox( GetFrame().g_hFrameWindow,
|
||||
GetFrame().FrameMessageBox(
|
||||
szMessage.c_str(),
|
||||
TEXT("Save State"),
|
||||
MB_ICONEXCLAMATION | MB_SETFOREGROUND);
|
||||
|
|
|
@ -940,19 +940,7 @@ void CSuperSerialCard::CommInitialize(LPBYTE pCxRomPeripheral, UINT uSlot)
|
|||
const UINT SSC_SLOT_FW_SIZE = 256;
|
||||
const UINT SSC_SLOT_FW_OFFSET = 7*256;
|
||||
|
||||
HRSRC hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_SSC_FW), "FIRMWARE");
|
||||
if(hResInfo == NULL)
|
||||
return;
|
||||
|
||||
DWORD dwResSize = SizeofResource(NULL, hResInfo);
|
||||
if(dwResSize != SSC_FW_SIZE)
|
||||
return;
|
||||
|
||||
HGLOBAL hResData = LoadResource(NULL, hResInfo);
|
||||
if(hResData == NULL)
|
||||
return;
|
||||
|
||||
BYTE* pData = (BYTE*) LockResource(hResData); // NB. Don't need to unlock resource
|
||||
BYTE* pData = GetFrame().GetResource(IDR_SSC_FW, "FIRMWARE", SSC_FW_SIZE);
|
||||
if(pData == NULL)
|
||||
return;
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ static void DisplayBenchmarkResults ()
|
|||
TEXT("This benchmark took %u.%02u seconds."),
|
||||
(unsigned)(totaltime / 1000),
|
||||
(unsigned)((totaltime / 10) % 100));
|
||||
MessageBox(GetFrame().g_hFrameWindow,
|
||||
GetFrame().FrameMessageBox(
|
||||
buffer,
|
||||
TEXT("Benchmark Results"),
|
||||
MB_ICONINFORMATION | MB_SETFOREGROUND);
|
||||
|
|
|
@ -117,8 +117,7 @@ void LoadConfiguration(void)
|
|||
|
||||
LogFileOutput("%s\n", sText);
|
||||
|
||||
MessageBox(
|
||||
GetDesktopWindow(), // NB. g_hFrameWindow is not yet valid
|
||||
GetFrame().FrameMessageBox(
|
||||
sText,
|
||||
"Load Configuration",
|
||||
MB_ICONSTOP | MB_SETFOREGROUND);
|
||||
|
@ -417,7 +416,7 @@ void InsertFloppyDisks(const UINT slot, LPSTR szImageName_drive[NUM_DRIVES], boo
|
|||
}
|
||||
|
||||
if (!bRes)
|
||||
MessageBox(GetFrame().g_hFrameWindow, "Failed to insert floppy disk(s) - see log file", "Warning", MB_ICONASTERISK | MB_OK);
|
||||
GetFrame().FrameMessageBox("Failed to insert floppy disk(s) - see log file", "Warning", MB_ICONASTERISK | MB_OK);
|
||||
}
|
||||
|
||||
void InsertHardDisks(LPSTR szImageName_harddisk[NUM_HARDDISKS], bool& bBoot)
|
||||
|
@ -453,7 +452,7 @@ void InsertHardDisks(LPSTR szImageName_harddisk[NUM_HARDDISKS], bool& bBoot)
|
|||
}
|
||||
|
||||
if (!bRes)
|
||||
MessageBox(GetFrame().g_hFrameWindow, "Failed to insert harddisk(s) - see log file", "Warning", MB_ICONASTERISK | MB_OK);
|
||||
GetFrame().FrameMessageBox("Failed to insert harddisk(s) - see log file", "Warning", MB_ICONASTERISK | MB_OK);
|
||||
}
|
||||
|
||||
void UnplugHardDiskControllerCard(void)
|
||||
|
|
|
@ -522,7 +522,7 @@ static bool HookFilterForKeyboard()
|
|||
std::string msg("Failed to install hook filter for system keys");
|
||||
|
||||
DWORD dwErr = GetLastError();
|
||||
MessageBox(GetDesktopWindow(), msg.c_str(), "Warning", MB_ICONASTERISK | MB_OK);
|
||||
GetFrame().FrameMessageBox(msg.c_str(), "Warning", MB_ICONASTERISK | MB_OK);
|
||||
|
||||
msg += "\n";
|
||||
LogFileOutput(msg.c_str());
|
||||
|
@ -599,7 +599,7 @@ static void UninitHookThread()
|
|||
|
||||
static void ExceptionHandler(const char* pError)
|
||||
{
|
||||
MessageBox( GetFrame().g_hFrameWindow,
|
||||
GetFrame().FrameMessageBox(
|
||||
pError,
|
||||
TEXT("Runtime Exception"),
|
||||
MB_ICONEXCLAMATION | MB_SETFOREGROUND);
|
||||
|
@ -930,7 +930,7 @@ static void RepeatInitialization(void)
|
|||
|
||||
if (!g_bSysClkOK)
|
||||
{
|
||||
MessageBox(GetFrame().g_hFrameWindow, "DirectX failed to create SystemClock instance", TEXT("AppleWin Error"), MB_OK);
|
||||
GetFrame().FrameMessageBox("DirectX failed to create SystemClock instance", TEXT("AppleWin Error"), MB_OK);
|
||||
g_cmdLine.bShutdown = true;
|
||||
}
|
||||
|
||||
|
@ -941,7 +941,7 @@ static void RepeatInitialization(void)
|
|||
: "Unsupported -rom and -f8rom being used at the same time\n";
|
||||
|
||||
LogFileOutput("%s", msg.c_str());
|
||||
MessageBox(GetFrame().g_hFrameWindow, msg.c_str(), TEXT("AppleWin Error"), MB_OK);
|
||||
GetFrame().FrameMessageBox(msg.c_str(), TEXT("AppleWin Error"), MB_OK);
|
||||
g_cmdLine.bShutdown = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -232,7 +232,7 @@ void Win32Frame::Benchmark(void)
|
|||
// 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
|
||||
if ((regs.pc < 0x300) || (regs.pc > 0x400))
|
||||
if (MessageBox(g_hFrameWindow,
|
||||
if (FrameMessageBox(
|
||||
TEXT("The emulator has detected a problem while running ")
|
||||
TEXT("the CPU benchmark. Would you like to gather more ")
|
||||
TEXT("information?"),
|
||||
|
@ -261,13 +261,13 @@ void Win32Frame::Benchmark(void)
|
|||
(unsigned)loop,
|
||||
(unsigned)lastpc,
|
||||
(unsigned)regs.pc);
|
||||
MessageBox(g_hFrameWindow,
|
||||
FrameMessageBox(
|
||||
outstr,
|
||||
TEXT("Benchmarks"),
|
||||
MB_ICONINFORMATION | MB_SETFOREGROUND);
|
||||
}
|
||||
else
|
||||
MessageBox(g_hFrameWindow,
|
||||
FrameMessageBox(
|
||||
TEXT("The emulator was unable to locate the exact ")
|
||||
TEXT("point of the error. This probably means that ")
|
||||
TEXT("the problem is external to the emulator, ")
|
||||
|
@ -321,7 +321,7 @@ void Win32Frame::Benchmark(void)
|
|||
(unsigned)(totalmhz10[0] / 10), (unsigned)(totalmhz10[0] % 10), (LPCTSTR)(IS_APPLE2 ? TEXT(" (6502)") : TEXT("")),
|
||||
(unsigned)(totalmhz10[1] / 10), (unsigned)(totalmhz10[1] % 10), (LPCTSTR)(IS_APPLE2 ? TEXT(" (6502)") : TEXT("")),
|
||||
(unsigned)realisticfps);
|
||||
MessageBox(g_hFrameWindow,
|
||||
FrameMessageBox(
|
||||
outstr,
|
||||
TEXT("Benchmarks"),
|
||||
MB_ICONINFORMATION | MB_SETFOREGROUND);
|
||||
|
@ -575,3 +575,42 @@ Win32Frame& Win32Frame::GetWin32Frame()
|
|||
Win32Frame& win32Frame = dynamic_cast<Win32Frame&>(frameBase);
|
||||
return win32Frame;
|
||||
}
|
||||
|
||||
int Win32Frame::FrameMessageBox(LPCSTR lpText, LPCSTR lpCaption, UINT uType)
|
||||
{
|
||||
const HWND handle = g_hFrameWindow ? g_hFrameWindow : GetDesktopWindow();
|
||||
return MessageBox(handle, lpText, lpCaption, uType);
|
||||
}
|
||||
|
||||
void Win32Frame::GetBitmap(LPCSTR lpBitmapName, LONG cb, LPVOID lpvBits)
|
||||
{
|
||||
HBITMAP hBitmap = LoadBitmap(g_hInstance, lpBitmapName);
|
||||
GetBitmapBits(hBitmap, cb, lpvBits);
|
||||
DeleteObject(hBitmap);
|
||||
}
|
||||
|
||||
void Win32Frame::Restart()
|
||||
{
|
||||
// Changed h/w config, eg. Apple computer type (][+ or //e), slot configuration, etc.
|
||||
g_bRestart = true;
|
||||
PostMessage(g_hFrameWindow, WM_CLOSE, 0, 0);
|
||||
}
|
||||
|
||||
BYTE* Win32Frame::GetResource(WORD id, LPCSTR lpType, DWORD dwExpectedSize)
|
||||
{
|
||||
HRSRC hResInfo = FindResource(NULL, MAKEINTRESOURCE(id), lpType);
|
||||
if (hResInfo == NULL)
|
||||
return NULL;
|
||||
|
||||
DWORD dwResSize = SizeofResource(NULL, hResInfo);
|
||||
if (dwResSize != dwExpectedSize)
|
||||
return NULL;
|
||||
|
||||
HGLOBAL hResData = LoadResource(NULL, hResInfo);
|
||||
if (hResData == NULL)
|
||||
return NULL;
|
||||
|
||||
BYTE* pResource = (BYTE*)LockResource(hResData); // NB. Don't need to unlock resource
|
||||
|
||||
return pResource;
|
||||
}
|
||||
|
|
|
@ -48,6 +48,11 @@ public:
|
|||
virtual void Destroy(void);
|
||||
virtual void VideoPresentScreen(void);
|
||||
|
||||
virtual int FrameMessageBox(LPCSTR lpText, LPCSTR lpCaption, UINT uType);
|
||||
virtual void GetBitmap(LPCSTR lpBitmapName, LONG cb, LPVOID lpvBits);
|
||||
virtual BYTE* GetResource(WORD id, LPCSTR lpType, DWORD expectedSize);
|
||||
virtual void Restart();
|
||||
|
||||
bool GetFullScreenShowSubunitStatus(void);
|
||||
int GetFullScreenOffsetX(void);
|
||||
int GetFullScreenOffsetY(void);
|
||||
|
|
|
@ -981,6 +981,7 @@ LRESULT Win32Frame::WndProc(
|
|||
DeleteGdiObjects();
|
||||
DIMouse::DirectInputUninit(window); // NB. do before window is destroyed
|
||||
PostQuitMessage(0); // Post WM_QUIT message to the thread's message queue
|
||||
g_hFrameWindow = (HWND)0;
|
||||
LogFileOutput("WM_DESTROY (done)\n");
|
||||
break;
|
||||
|
||||
|
@ -1709,12 +1710,6 @@ LRESULT Win32Frame::WndProc(
|
|||
break;
|
||||
}
|
||||
|
||||
case WM_USER_RESTART:
|
||||
// Changed h/w config, eg. Apple computer type (][+ or //e), slot configuration, etc.
|
||||
g_bRestart = true;
|
||||
PostMessage(window,WM_CLOSE,0,0);
|
||||
break;
|
||||
|
||||
case WM_USER_SAVESTATE: // Save state
|
||||
Snapshot_SaveState();
|
||||
break;
|
||||
|
@ -1823,7 +1818,7 @@ bool Win32Frame::ConfirmReboot(bool bFromButtonUI)
|
|||
if (!bFromButtonUI || !g_bConfirmReboot)
|
||||
return true;
|
||||
|
||||
int res = MessageBox(g_hFrameWindow,
|
||||
int res = FrameMessageBox(
|
||||
"Are you sure you want to reboot?\n"
|
||||
"(All data will be lost!)\n"
|
||||
"\n"
|
||||
|
@ -2055,7 +2050,7 @@ void Win32Frame::ProcessDiskPopupMenu(HWND hwnd, POINT pt, const int iDrive)
|
|||
//if(!filename1.compare("\"\"") == false) //Do not use this, for some reason it does not work!!!
|
||||
if(!filename1.compare(sFileNameEmpty) )
|
||||
{
|
||||
int MB_Result = MessageBox(g_hFrameWindow, "No disk image loaded. Do you want to run CiderPress anyway?" ,"No disk image.", MB_ICONINFORMATION|MB_YESNO);
|
||||
int MB_Result = FrameMessageBox("No disk image loaded. Do you want to run CiderPress anyway?" ,"No disk image.", MB_ICONINFORMATION|MB_YESNO);
|
||||
if (MB_Result == IDYES)
|
||||
{
|
||||
if (FileExists (PathToCiderPress ))
|
||||
|
@ -2064,7 +2059,7 @@ void Win32Frame::ProcessDiskPopupMenu(HWND hwnd, POINT pt, const int iDrive)
|
|||
}
|
||||
else
|
||||
{
|
||||
MessageBox(g_hFrameWindow, szCiderpressNotFoundText, szCiderpressNotFoundCaption, MB_ICONINFORMATION|MB_OK);
|
||||
FrameMessageBox(szCiderpressNotFoundText, szCiderpressNotFoundCaption, MB_ICONINFORMATION|MB_OK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2076,7 +2071,7 @@ void Win32Frame::ProcessDiskPopupMenu(HWND hwnd, POINT pt, const int iDrive)
|
|||
}
|
||||
else
|
||||
{
|
||||
MessageBox(g_hFrameWindow, szCiderpressNotFoundText, szCiderpressNotFoundCaption, MB_ICONINFORMATION|MB_OK);
|
||||
FrameMessageBox(szCiderpressNotFoundText, szCiderpressNotFoundCaption, MB_ICONINFORMATION|MB_OK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue