added global: g_pAppTitle

removed: define TITLE
indentation cleanup
This commit is contained in:
mpohoreski 2006-06-27 02:34:46 +00:00
parent dbbb5df19d
commit 9135e6e908
6 changed files with 160 additions and 121 deletions

View File

@ -31,6 +31,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
char VERSIONSTRING[] = "xx.yy.zz.ww";
TCHAR *g_pAppTitle = TITLE_APPLE_2_E;
bool g_bApple2e = true;
bool g_bApple2plus = true;

View File

@ -2,6 +2,8 @@
extern char VERSIONSTRING[]; // Contructed in WinMain()
extern TCHAR *g_pAppTitle;
extern bool g_bApple2e;
extern bool g_bApple2plus;

View File

@ -56,7 +56,8 @@ enum AppMode_e
#define TITLE_APPLE_2 TEXT("Apple ][ Emulator")
#define TITLE_APPLE_2_PLUS TEXT("Apple ][+ Emulator")
#define TITLE_APPLE_2_E TEXT("Apple //e Emulator")
#define TITLE TITLE_APPLE_2_E
// #define TITLE TITLE_APPLE_2_E
#define TITLE_PAUSED TEXT(" Paused ")
#define TITLE_STEPPING TEXT("Stepping")

View File

@ -371,7 +371,8 @@ int DiskInsert (int drive, LPCTSTR imagefilename, BOOL writeprotected, BOOL crea
}
//===========================================================================
BOOL DiskIsSpinning () {
BOOL DiskIsSpinning ()
{
return floppymotoron;
}
@ -380,29 +381,33 @@ void DiskNotifyInvalidImage (LPCTSTR imagefilename,int error)
{
TCHAR buffer[MAX_PATH+128];
switch (error) {
switch (error)
{
case 1:
wsprintf(buffer,
wsprintf(
buffer,
TEXT("Unable to open the file %s."),
(LPCTSTR)imagefilename);
break;
case 2:
wsprintf(buffer,
wsprintf(
buffer,
TEXT("Unable to use the file %s\nbecause the ")
TEXT("disk image format is not recognized."),
(LPCTSTR)imagefilename);
break;
default:
// IGNORE OTHER ERRORS SILENTLY
return;
}
MessageBox(g_hFrameWindow,
MessageBox(
g_hFrameWindow,
buffer,
TITLE,
g_pAppTitle,
MB_ICONEXCLAMATION | MB_SETFOREGROUND);
}

View File

@ -1159,7 +1159,8 @@ void SetUsingCursor (BOOL newvalue) {
//
//===========================================================================
void FrameCreateWindow () {
void FrameCreateWindow ()
{
int width = VIEWPORTCX + (VIEWPORTX<<1)
+ BUTTONCX
+ (GetSystemMetrics(SM_CXBORDER)<<1)
@ -1169,23 +1170,46 @@ void FrameCreateWindow () {
+ GetSystemMetrics(SM_CYCAPTION)
+ 5;
int xpos;
if (!RegLoadValue(TEXT("Preferences"),TEXT("Window X-Position"),1,(DWORD *)&xpos))
xpos = (GetSystemMetrics(SM_CXSCREEN)-width) >> 1;
int ypos;
if (!RegLoadValue(TEXT("Preferences"),TEXT("Window Y-Position"),1,(DWORD *)&ypos))
ypos = (GetSystemMetrics(SM_CYSCREEN)-height) >> 1;
g_hFrameWindow = CreateWindow(TEXT("APPLE2FRAME"),
g_bApple2e ? TITLE
: (g_bApple2plus ? TEXT("Apple ][+ Emulator")
: TEXT("Apple ][ Emulator")),
if (g_bApple2e)
{
g_pAppTitle = TITLE_APPLE_2_E;
}
else
{
if (g_bApple2plus)
g_pAppTitle = TITLE_APPLE_2_PLUS;
else
g_pAppTitle = TITLE_APPLE_2;
}
g_hFrameWindow = CreateWindow(
TEXT("APPLE2FRAME"),
// g_bApple2e
// ? TITLE_APPLE_2_E
// : (g_bApple2plus
// ? TITLE_APPLE_2_PLUS
// : TITLE_APPLE_2),
g_pAppTitle,
WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU |
WS_MINIMIZEBOX | WS_VISIBLE,
xpos,ypos,width,height,
HWND_DESKTOP,(HMENU)0,instance,NULL);
HWND_DESKTOP,(HMENU)0,instance,NULL );
InitCommonControls();
tooltipwindow = CreateWindow(TOOLTIPS_CLASS,NULL,TTS_ALWAYSTIP,
tooltipwindow = CreateWindow(
TOOLTIPS_CLASS,NULL,TTS_ALWAYSTIP,
CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,
g_hFrameWindow,(HMENU)0,instance,NULL);
g_hFrameWindow,(HMENU)0,instance,NULL );
TOOLINFO toolinfo;
toolinfo.cbSize = sizeof(toolinfo);
toolinfo.uFlags = TTF_CENTERTIP;

View File

@ -865,25 +865,28 @@ void MemInitialize () {
memimage = (LPBYTE)VirtualAlloc(NULL,
MAX(0x30000,MAXIMAGES*0x10000),
MEM_RESERVE,PAGE_NOACCESS);
if ((!memaux) || (!memdirty) || (!memimage) || (!memmain) || (!memrom)) {
MessageBox(GetDesktopWindow(),
if ((!memaux) || (!memdirty) || (!memimage) || (!memmain) || (!memrom))
{
MessageBox(
GetDesktopWindow(),
TEXT("The emulator was unable to allocate the memory it ")
TEXT("requires. Further execution is not possible."),
TITLE,
g_pAppTitle,
MB_ICONSTOP | MB_SETFOREGROUND);
ExitProcess(1);
}
{
LPVOID newloc = VirtualAlloc(memimage,0x30000,MEM_COMMIT,PAGE_READWRITE);
if (newloc != memimage)
MessageBox(GetDesktopWindow(),
MessageBox(
GetDesktopWindow(),
TEXT("The emulator has detected a bug in your operating ")
TEXT("system. While changing the attributes of a memory ")
TEXT("object, the operating system also changed its ")
TEXT("location."),
TITLE,
g_pAppTitle,
MB_ICONEXCLAMATION | MB_SETFOREGROUND);
}
#ifdef RAMWORKS
// allocate memory for RAMWorks III - up to 8MB
@ -905,17 +908,21 @@ void MemInitialize () {
if(hResInfo == NULL)
{
TCHAR sRomFileName[ 128 ];
_tcscpy( sRomFileName, g_bApple2e ? TEXT("APPLE2E.ROM")
: (g_bApple2plus ? TEXT("APPLE2PLUS.ROM")
TCHAR sRomFileName[ MAX_PATH ];
_tcscpy( sRomFileName,
g_bApple2e
? TEXT("APPLE2E.ROM")
: (g_bApple2plus
? TEXT("APPLE2PLUS.ROM")
: TEXT("APPLE2ORIG.ROM")));
TCHAR sText[ 256 ];
TCHAR sText[ MAX_PATH ];
wsprintf( sText, TEXT("Unable to open the required firmware ROM data file.\n\nFile: %s."), sRomFileName );
MessageBox(GetDesktopWindow(),
MessageBox(
GetDesktopWindow(),
sText,
TITLE,
g_pAppTitle,
MB_ICONSTOP | MB_SETFOREGROUND);
ExitProcess(1);
}
@ -929,17 +936,15 @@ void MemInitialize () {
return;
BYTE* pData = (BYTE*) LockResource(hResData); // NB. Don't need to unlock resource
if(pData == NULL)
if (pData == NULL)
return;
memcpy(memrom, pData, ROM_SIZE);
// TODO/FIXME: HACK! REMOVE A WAIT ROUTINE FROM THE DISK CONTROLLER'S FIRMWARE
{
*(memrom+0x064C) = 0xA9;
*(memrom+0x064D) = 0x00;
*(memrom+0x064E) = 0xEA;
}
HD_Load_Rom(memrom); // HDD f/w gets loaded to $C700
@ -948,7 +953,7 @@ void MemInitialize () {
//===========================================================================
// Call by:
// Called by:
// . ResetMachineState() eg. Power-cycle ('Apple-Go' button)
// . Snapshot_LoadState()
void MemReset ()