From a5734cac1020628da5edec7dcd27d47450e19eeb Mon Sep 17 00:00:00 2001 From: Andrea Odetti Date: Sun, 29 Nov 2020 16:37:45 +0000 Subject: [PATCH] Use GetAppleWindowTitle() from AW. Signed-off-by: Andrea Odetti --- source/frontends/ncurses/main.cpp | 2 +- source/frontends/qapple/qapple.cpp | 10 +++++----- source/frontends/sa2/emulator.cpp | 5 +++-- source/frontends/sa2/main.cpp | 3 ++- source/linux/data.cpp | 28 ---------------------------- source/linux/data.h | 1 - 6 files changed, 11 insertions(+), 38 deletions(-) diff --git a/source/frontends/ncurses/main.cpp b/source/frontends/ncurses/main.cpp index c2241f5e..2e3562ff 100644 --- a/source/frontends/ncurses/main.cpp +++ b/source/frontends/ncurses/main.cpp @@ -146,7 +146,7 @@ namespace Paddle::setSquaring(options.squaring); InitializeRegistry(options); - + g_nAppMode = MODE_RUNNING; g_nMemoryClearType = options.memclear; LogFileOutput("Initialisation\n"); diff --git a/source/frontends/qapple/qapple.cpp b/source/frontends/qapple/qapple.cpp index f0535dbb..1223380e 100644 --- a/source/frontends/qapple/qapple.cpp +++ b/source/frontends/qapple/qapple.cpp @@ -59,7 +59,7 @@ namespace #ifdef RIFF_MB RiffInitWriteFile("/tmp/Mockingboard.wav", 44100, 2); #endif - + g_nAppMode = MODE_RUNNING; g_fh = fopen("/tmp/applewin.txt", "w"); setbuf(g_fh, nullptr); @@ -85,7 +85,7 @@ namespace CheckCpu(); - SetWindowTitle(); + GetAppleWindowTitle(); window->setWindowTitle(QString::fromStdString(g_pAppTitle)); FrameRefreshStatus(DRAW_LEDS | DRAW_BUTTON_DRIVES, true); @@ -472,7 +472,7 @@ void QApple::on_actionOptions_triggered() void QApple::reloadOptions() { - SetWindowTitle(); + GetAppleWindowTitle(); myEmulatorWindow->setWindowTitle(QString::fromStdString(g_pAppTitle)); Paddle::instance() = GamepadPaddle::fromName(myOptions.gamepadName); @@ -500,7 +500,7 @@ void QApple::on_actionLoad_state_triggered() SetCurrentImageDir(path.toStdString().c_str()); Snapshot_LoadState(); - SetWindowTitle(); + GetAppleWindowTitle(); myEmulatorWindow->setWindowTitle(QString::fromStdString(g_pAppTitle)); QString message = QString("State file: %1").arg(file.filePath()); mySaveStateLabel->setText(message); @@ -590,7 +590,7 @@ void QApple::on_actionNext_video_mode_triggered() if (g_eVideoType >= NUM_VIDEO_MODES) g_eVideoType = 0; - SetWindowTitle(); + GetAppleWindowTitle(); myEmulatorWindow->setWindowTitle(QString::fromStdString(g_pAppTitle)); Config_Save_Video(); diff --git a/source/frontends/sa2/emulator.cpp b/source/frontends/sa2/emulator.cpp index a5d2ec2a..d24c4a98 100644 --- a/source/frontends/sa2/emulator.cpp +++ b/source/frontends/sa2/emulator.cpp @@ -20,6 +20,7 @@ #include "NTSC.h" #include "Mockingboard.h" #include "Speaker.h" +#include "Utilities.h" namespace { @@ -30,7 +31,7 @@ namespace if (g_eVideoType >= NUM_VIDEO_MODES) g_eVideoType = 0; - SetWindowTitle(); + GetAppleWindowTitle(); SDL_SetWindowTitle(win.get(), g_pAppTitle.c_str()); Config_Save_Video(); @@ -45,7 +46,7 @@ namespace SetVideoStyle(videoStyle); - SetWindowTitle(); + GetAppleWindowTitle(); SDL_SetWindowTitle(win.get(), g_pAppTitle.c_str()); Config_Save_Video(); diff --git a/source/frontends/sa2/main.cpp b/source/frontends/sa2/main.cpp index 40191fd8..7f073817 100644 --- a/source/frontends/sa2/main.cpp +++ b/source/frontends/sa2/main.cpp @@ -49,6 +49,7 @@ namespace { void initialiseEmulator() { + g_nAppMode = MODE_RUNNING; LogFileOutput("Initialisation\n"); ImageInitialize(); @@ -59,7 +60,7 @@ namespace { LoadConfiguration(); CheckCpu(); - SetWindowTitle(); + GetAppleWindowTitle(); FrameRefreshStatus(DRAW_LEDS | DRAW_BUTTON_DRIVES, true); DSInit(); diff --git a/source/linux/data.cpp b/source/linux/data.cpp index a4d5a7d2..e5a02c11 100644 --- a/source/linux/data.cpp +++ b/source/linux/data.cpp @@ -4,34 +4,6 @@ #include "Log.h" #include "CPU.h" #include "Core.h" -#include "Video.h" - - -void SetWindowTitle() -{ - 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; - } - - g_pAppTitle += " - "; - - if( IsVideoStyle(VS_HALF_SCANLINES) ) - { - g_pAppTitle += " 50% "; - } - g_pAppTitle += VideoGetAppWindowTitle(); -} void CheckCpu() { diff --git a/source/linux/data.h b/source/linux/data.h index ecfb5373..28584c6b 100644 --- a/source/linux/data.h +++ b/source/linux/data.h @@ -1,6 +1,5 @@ #pragma once void CheckCpu(); -void SetWindowTitle(); extern int g_nAltCharSetOffset; // alternate character set