Skip to content

Commit 76a064b

Browse files
committed
Merge branch 'TC1995' into upd7220-code
2 parents 5242b91 + 11fda1d commit 76a064b

10 files changed

Lines changed: 52 additions & 31 deletions

File tree

src/86box.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,8 +1386,6 @@ pc_init(int argc, char *argv[])
13861386
if (lang_init)
13871387
lang_id = lang_init;
13881388

1389-
gdbstub_init();
1390-
13911389
/* All good! */
13921390
return 1;
13931391
}

src/include/86box/plat_dir.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,16 @@ plat_dir_read(plat_dir_t *context)
695695
# define plat_dir_is_hidden(context) (plat_dir_get_name((context))[0] == '.')
696696
#endif
697697

698+
#ifdef __cplusplus
699+
extern "C" {
700+
#endif
701+
702+
extern const char *plat_dir_get_path(plat_dir_t *context);
703+
704+
#ifdef __cplusplus
705+
}
706+
#endif
707+
698708
#ifdef plat_dir_is_file_stat
699709
static inline struct stat *
700710
plat_dir_stat(plat_dir_t *context)

src/machine/machine.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include <86box/isamem.h>
4040
#include <86box/isarom.h>
4141
#include <86box/pci.h>
42+
#include <86box/gdbstub.h>
4243
#include <86box/plat_unused.h>
4344

4445
int bios_only = 0;
@@ -144,6 +145,15 @@ machine_init(void)
144145
machine_set_p1_default(machines[machine].kbc_p1);
145146
machine_set_ps2();
146147

148+
/* Create the GDB Stub socket before gdbstub_cpu_init looks for it.
149+
This is done outside of machine_init_ex so we only occupy the socket
150+
if we're actually starting a machine. */
151+
static int gdbstub_started = 0;
152+
if (!gdbstub_started) {
153+
gdbstub_started = 1;
154+
gdbstub_init();
155+
}
156+
147157
(void) machine_init_ex(machine);
148158
}
149159

src/osd/osd_core.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,11 @@ float osd_core_layout_scale_for_output(int output_w, int output_h)
117117
return clamp_output_scale(std::min(x_scale, y_scale));
118118
}
119119

120-
static float osd_scaled(float value)
120+
float osd_core_scaled(float value)
121121
{
122122
return (value > 0.0f) ? (value * osd_layout_scale) : value;
123123
}
124124

125-
static ImVec2 osd_scaled_size(float width, float height)
126-
{
127-
return ImVec2(osd_scaled(width), osd_scaled(height));
128-
}
129-
130125
static void apply_layout_scale(void)
131126
{
132127
if (!osd_style_ready || ImGui::GetCurrentContext() == nullptr)
@@ -513,7 +508,7 @@ static bool draw_menu(void)
513508
activate_menu_item(menu_sel, &close_osd);
514509

515510
ImGui::SetNextWindowPos(ImGui::GetMainViewport()->GetCenter(), ImGuiCond_Always, ImVec2(0.5f, 0.5f));
516-
ImGui::SetNextWindowSize(osd_scaled_size(320.0f, 0.0f), ImGuiCond_Always);
511+
ImGui::SetNextWindowSize(ImVec2(osd_core_scaled(320.0f), osd_core_scaled(0.0f)), ImGuiCond_Always);
517512

518513
ImGui::Begin("86Box OSD", nullptr,
519514
ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize |
@@ -590,7 +585,7 @@ static bool draw_log(void)
590585
show_main_menu();
591586

592587
ImGui::SetNextWindowPos(ImGui::GetMainViewport()->GetCenter(), ImGuiCond_Always, ImVec2(0.5f, 0.5f));
593-
ImGui::SetNextWindowSize(osd_scaled_size(560.0f, 340.0f), ImGuiCond_Always);
588+
ImGui::SetNextWindowSize(ImVec2(osd_core_scaled(560.0f), osd_core_scaled(340.0f)), ImGuiCond_Always);
594589
ImGui::Begin("Log", nullptr,
595590
ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize |
596591
ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoNav);

src/osd/osd_core.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ typedef struct osd_host_t {
1919

2020
void osd_core_set_host(const osd_host_t *host);
2121

22+
float osd_core_scaled(float value);
23+
2224
float osd_core_layout_scale_for_output(int output_w, int output_h);
2325

2426
/* Shared OSD layout scale. Frontends may supply a backend-specific hint. */

src/osd/osd_explorer.cpp

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#include "imgui.h"
1010

11+
#include "osd_core.hpp"
12+
1113
#ifdef USE_STD_FILESYSTEM
1214
#include <filesystem>
1315
namespace fs = std::filesystem;
@@ -224,7 +226,7 @@ OsdExplorer::Draw()
224226

225227
ImGui::SetNextWindowPos(ImGui::GetMainViewport()->GetCenter(), ImGuiCond_Always, ImVec2(0.5f, 0.5f));
226228

227-
ImGui::SetNextWindowSize(ImVec2(560, 380), ImGuiCond_Always);
229+
ImGui::SetNextWindowSize(ImVec2(osd_core_scaled(560.0f), osd_core_scaled(380.0f)), ImGuiCond_Always);
228230

229231
const bool enter = ImGui::IsKeyPressed(ImGuiKey_Enter, false)
230232
|| ImGui::IsKeyPressed(ImGuiKey_KeypadEnter, false);
@@ -233,19 +235,23 @@ OsdExplorer::Draw()
233235
ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize |
234236
ImGuiWindowFlags_NoMove);
235237

236-
const float label_column_width = 96.0f;
238+
ImGui::BeginTable("##inputs", 2, ImGuiTableFlags_SizingStretchSame);
239+
ImGui::TableSetupColumn("Label", ImGuiTableColumnFlags_WidthFixed);
240+
ImGui::TableSetupColumn("Input", ImGuiTableColumnFlags_WidthStretch);
237241

242+
ImGui::TableNextRow();
243+
ImGui::TableNextColumn();
238244
ImGui::AlignTextToFramePadding();
239245
ImGui::TextUnformatted("Filename");
240-
ImGui::SameLine();
241-
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + (label_column_width - ImGui::CalcTextSize("Filename").x));
246+
ImGui::TableNextColumn();
242247
ImGui::SetNextItemWidth(-FLT_MIN);
243248
if (focus_filename_input_ && focused_slot_ == FocusSlot::Filename) {
244249
ImGui::SetKeyboardFocusHere();
245250
focus_filename_input_ = false;
246251
}
247252
if (ImGui::InputText("##filename", filename_input_.data(), filename_input_.size(), ImGuiInputTextFlags_EnterReturnsTrue)) {
248253
if (TryHandleFilenameInput(&result)) {
254+
ImGui::EndTable();
249255
ImGui::End();
250256
return result;
251257
}
@@ -269,10 +275,11 @@ OsdExplorer::Draw()
269275
else
270276
snprintf(current_path_text.data(), current_path_text.size(), "%s", current_path_.string().c_str());
271277

278+
ImGui::TableNextRow();
279+
ImGui::TableNextColumn();
272280
ImGui::AlignTextToFramePadding();
273281
ImGui::TextUnformatted("Current path");
274-
ImGui::SameLine();
275-
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + (label_column_width - ImGui::CalcTextSize("Current path").x));
282+
ImGui::TableNextColumn();
276283
ImGui::SetNextItemWidth(-FLT_MIN);
277284
if (focus_current_path_input_ && focused_slot_ == FocusSlot::CurrentPath) {
278285
ImGui::SetKeyboardFocusHere();
@@ -282,6 +289,8 @@ OsdExplorer::Draw()
282289
if (!tab && ImGui::IsItemFocused())
283290
focused_slot_ = FocusSlot::CurrentPath;
284291

292+
ImGui::EndTable();
293+
285294
if (has_show_all_files_checkbox) {
286295
if (focus_show_all_files_ && focused_slot_ == FocusSlot::ShowAllFiles) {
287296
ImGui::SetKeyboardFocusHere();

src/qt/qt_downloader.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ Downloader::Downloader(const DownloadLocation downloadLocation, QObject *parent)
2727
: QObject(parent)
2828
, file(nullptr)
2929
, reply(nullptr)
30-
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
31-
, variantData(QMetaType(QMetaType::UnknownType))
32-
#else
33-
, variantData(QVariant::Invalid)
34-
#endif
3530
{
3631
char PATHBUF[256];
3732
switch (downloadLocation) {
@@ -51,10 +46,9 @@ Downloader::Downloader(const DownloadLocation downloadLocation, QObject *parent)
5146
Downloader::~Downloader() { delete file; }
5247

5348
void
54-
Downloader::download(const QUrl &url, const QString &filepath, const QVariant &varData)
49+
Downloader::download(const QUrl &url, const QString &filepath)
5550
{
5651

57-
variantData = varData;
5852
// temporary until I get the plat stuff fixed
5953
// const auto global_dir = temporaryGetGlobalDataDir();
6054
// qDebug() << "I was passed filepath " << filepath;
@@ -92,5 +86,5 @@ Downloader::onResult()
9286

9387
reply->deleteLater();
9488
qDebug() << Q_FUNC_INFO << "Downloaded complete: file written to " << file->fileName();
95-
emit downloadCompleted(file->fileName(), variantData);
89+
emit downloadCompleted(file->fileName());
9690
}

src/qt/qt_downloader.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ class Downloader final : public QObject {
3131
explicit Downloader(DownloadLocation downloadLocation = DownloadLocation::Data, QObject *parent = nullptr);
3232
~Downloader() final;
3333

34-
void download(const QUrl &url, const QString &filepath, const QVariant &varData = QVariant::Invalid);
34+
void download(const QUrl &url, const QString &filepath);
3535

3636
signals:
3737
// Signal emitted when the download is successful
38-
void downloadCompleted(QString filename, QVariant varData);
38+
void downloadCompleted(QString filename);
3939
// Signal emitted when an error occurs
4040
void errorOccurred(const QString &);
4141

@@ -46,7 +46,6 @@ private slots:
4646
QFile *file;
4747
QNetworkAccessManager nam;
4848
QNetworkReply *reply;
49-
QVariant variantData;
5049
QDir downloadDirectory;
5150
};
5251

src/qt/qt_updatecheck.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ UpdateCheck::checkForUpdates()
5454
}
5555

5656
void
57-
UpdateCheck::jenkinsDownloadComplete(const QString &filename, const QVariant &varData)
57+
UpdateCheck::jenkinsDownloadComplete(const QString &filename)
5858
{
5959
auto generalError = tr("Unable to determine release information");
6060
auto jenkinsReleaseListResult = parseJenkinsJson(filename);
@@ -97,7 +97,7 @@ UpdateCheck::generalDownloadError(const QString &error)
9797
}
9898

9999
void
100-
UpdateCheck::githubDownloadComplete(const QString &filename, const QVariant &varData)
100+
UpdateCheck::githubDownloadComplete(const QString &filename)
101101
{
102102
const auto generalError = tr("Unable to determine release information");
103103
const auto githubReleaseListResult = parseGithubJson(filename);
@@ -245,7 +245,11 @@ UpdateCheck::parseJenkinsRelease(const QJsonObject &json)
245245
// Convert the paths for each commit to a string list
246246
QStringList paths;
247247
for (const auto &each_path : itemObject["affectedPaths"].toArray().toVariantList()) {
248+
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
249+
if (each_path.typeId() == QMetaType::QString) {
250+
#else
248251
if (each_path.type() == QVariant::String) {
252+
#endif
249253
paths.append(each_path.toString());
250254
}
251255
}

src/qt/qt_updatecheck.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ class UpdateCheck final : public QObject {
9292
static std::optional<GithubReleaseInfo> parseGithubRelease(const QJsonObject &json);
9393

9494
private slots:
95-
void jenkinsDownloadComplete(const QString &filename, const QVariant &varData);
96-
void githubDownloadComplete(const QString &filename, const QVariant &varData);
95+
void jenkinsDownloadComplete(const QString &filename);
96+
void githubDownloadComplete(const QString &filename);
9797
void generalDownloadError(const QString &error);
9898
};
9999

0 commit comments

Comments
 (0)