Use GetAppleWindowTitle() from AW.

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
Andrea Odetti 2020-11-29 16:37:45 +00:00
parent 1b6127dbb6
commit a5734cac10
6 changed files with 11 additions and 38 deletions

View file

@ -146,7 +146,7 @@ namespace
Paddle::setSquaring(options.squaring);
InitializeRegistry(options);
g_nAppMode = MODE_RUNNING;
g_nMemoryClearType = options.memclear;
LogFileOutput("Initialisation\n");

View file

@ -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();

View file

@ -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();

View file

@ -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();

View file

@ -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()
{

View file

@ -1,6 +1,5 @@
#pragma once
void CheckCpu();
void SetWindowTitle();
extern int g_nAltCharSetOffset; // alternate character set