From ed178d8b1cb0f727a5147a061d3208bcd91223ec Mon Sep 17 00:00:00 2001 From: Andrea Odetti Date: Sat, 28 Nov 2020 15:49:19 +0000 Subject: [PATCH] Move GetAppleWindowTitle() to Utilities.cpp as it is generic and useful to other archs. --- source/Utilities.cpp | 46 ++++++++++++++++++++++++++++++++++ source/Utilities.h | 1 + source/Windows/WinFrame.cpp | 49 +------------------------------------ 3 files changed, 48 insertions(+), 48 deletions(-) diff --git a/source/Utilities.cpp b/source/Utilities.cpp index afef9264..a932a0af 100644 --- a/source/Utilities.cpp +++ b/source/Utilities.cpp @@ -453,3 +453,49 @@ void UnplugHardDiskControllerCard(void) if (!res || dwTmp) REGSAVE(TEXT(REGVALUE_HDD_ENABLED), 0); // Config: HDD Disabled } + +void GetAppleWindowTitle() +{ + switch (g_Apple2Type) + { + default: + case A2TYPE_APPLE2: g_pAppTitle = TITLE_APPLE_2; break; + case A2TYPE_APPLE2PLUS: g_pAppTitle = TITLE_APPLE_2_PLUS; break; + case A2TYPE_APPLE2JPLUS: g_pAppTitle = TITLE_APPLE_2_JPLUS; break; + case A2TYPE_APPLE2E: g_pAppTitle = TITLE_APPLE_2E; break; + case A2TYPE_APPLE2EENHANCED: g_pAppTitle = TITLE_APPLE_2E_ENHANCED; break; + case A2TYPE_PRAVETS82: g_pAppTitle = TITLE_PRAVETS_82; break; + case A2TYPE_PRAVETS8M: g_pAppTitle = TITLE_PRAVETS_8M; break; + case A2TYPE_PRAVETS8A: g_pAppTitle = TITLE_PRAVETS_8A; break; + case A2TYPE_TK30002E: g_pAppTitle = TITLE_TK3000_2E; break; + case A2TYPE_BASE64A: g_pAppTitle = TITLE_BASE64A; break; + } + +#if _DEBUG + g_pAppTitle += " *DEBUG* "; +#endif + + if (g_nAppMode == MODE_LOGO) + return; + + g_pAppTitle += " - "; + + if (IsVideoStyle(VS_HALF_SCANLINES)) + g_pAppTitle += " 50% "; + + g_pAppTitle += VideoGetAppWindowTitle(); + + if (GetCardMgr().GetDisk2CardMgr().IsAnyFirmware13Sector()) + g_pAppTitle += " (S6-13) "; + + if (g_hCustomRomF8 != INVALID_HANDLE_VALUE) + g_pAppTitle += TEXT(" (custom rom)"); + else if (sg_PropertySheet.GetTheFreezesF8Rom() && IS_APPLE2) + g_pAppTitle += TEXT(" (The Freeze's non-autostart F8 rom)"); + + switch (g_nAppMode) + { + case MODE_PAUSED: g_pAppTitle += std::string(TEXT(" [")) + TITLE_PAUSED + TEXT("]"); break; + case MODE_STEPPING: g_pAppTitle += std::string(TEXT(" [")) + TITLE_STEPPING + TEXT("]"); break; + } +} diff --git a/source/Utilities.h b/source/Utilities.h index afeb6559..ba617c44 100644 --- a/source/Utilities.h +++ b/source/Utilities.h @@ -10,3 +10,4 @@ bool DoHardDiskInsert(const int nDrive, LPCSTR szFileName); void InsertFloppyDisks(const UINT slot, LPSTR szImageName_drive[NUM_DRIVES], bool& bBoot); void InsertHardDisks(LPSTR szImageName_harddisk[NUM_HARDDISKS], bool& bBoot); void UnplugHardDiskControllerCard(void); +void GetAppleWindowTitle(); diff --git a/source/Windows/WinFrame.cpp b/source/Windows/WinFrame.cpp index de26836d..624137c9 100644 --- a/source/Windows/WinFrame.cpp +++ b/source/Windows/WinFrame.cpp @@ -50,6 +50,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "SoundCore.h" #include "Speaker.h" #include "Frame.h" +#include "Utilities.h" #ifdef USE_SPEECH_API #include "Speech.h" #endif @@ -215,54 +216,6 @@ UINT Get3DBorderHeight(void) return IsFullScreen() ? 0 : VIEWPORTY; } -// ========================================================================== - -static void GetAppleWindowTitle() -{ - switch (g_Apple2Type) - { - default: - case A2TYPE_APPLE2: g_pAppTitle = TITLE_APPLE_2 ; break; - case A2TYPE_APPLE2PLUS: g_pAppTitle = TITLE_APPLE_2_PLUS ; break; - case A2TYPE_APPLE2JPLUS: g_pAppTitle = TITLE_APPLE_2_JPLUS ; break; - case A2TYPE_APPLE2E: g_pAppTitle = TITLE_APPLE_2E ; break; - case A2TYPE_APPLE2EENHANCED: g_pAppTitle = TITLE_APPLE_2E_ENHANCED; break; - case A2TYPE_PRAVETS82: g_pAppTitle = TITLE_PRAVETS_82 ; break; - case A2TYPE_PRAVETS8M: g_pAppTitle = TITLE_PRAVETS_8M ; break; - case A2TYPE_PRAVETS8A: g_pAppTitle = TITLE_PRAVETS_8A ; break; - case A2TYPE_TK30002E: g_pAppTitle = TITLE_TK3000_2E ; break; - case A2TYPE_BASE64A: g_pAppTitle = TITLE_BASE64A ; break; - } - -#if _DEBUG - g_pAppTitle += " *DEBUG* "; -#endif - - if (g_nAppMode == MODE_LOGO) - return; - - g_pAppTitle += " - "; - - if( IsVideoStyle(VS_HALF_SCANLINES) ) - g_pAppTitle += " 50% "; - - g_pAppTitle += VideoGetAppWindowTitle(); - - if (GetCardMgr().GetDisk2CardMgr().IsAnyFirmware13Sector()) - g_pAppTitle += " (S6-13) "; - - if (g_hCustomRomF8 != INVALID_HANDLE_VALUE) - g_pAppTitle += TEXT(" (custom rom)"); - else if (sg_PropertySheet.GetTheFreezesF8Rom() && IS_APPLE2) - g_pAppTitle += TEXT(" (The Freeze's non-autostart F8 rom)"); - - switch (g_nAppMode) - { - case MODE_PAUSED : g_pAppTitle += std::string(TEXT(" [")) + TITLE_PAUSED + TEXT("]"); break; - case MODE_STEPPING: g_pAppTitle += std::string(TEXT(" [")) + TITLE_STEPPING + TEXT("]"); break; - } -} - //=========================================================================== static void FrameShowCursor(BOOL bShow)