Implemented the Pro Audio Spectrum Plus serial mixer, Pro Audio Spectrum 16 parallel mixer, Pro Audio Spectrum Plus/16 SCSI, ESS ES688, all three ESS PnP AudioDrives, made the wavetables use a separate 44.1 kHz source, and made the Sound Blaster 16 PNP use a proper PNP ROM dump.

This commit is contained in:
OBattler
2024-05-03 17:02:13 +02:00
parent 656591d385
commit 2acb11d37c
47 changed files with 4000 additions and 1343 deletions

View File

@@ -91,6 +91,7 @@ extern int qt_nvr_save(void);
#endif
#include <array>
#include <memory>
#include <unordered_map>
#include "qt_settings.hpp"
@@ -289,14 +290,15 @@ MainWindow::MainWindow(QWidget *parent)
resizableonce = true;
}
if (!QApplication::platformName().contains("eglfs") && vid_resize != 1) {
w = (w / (!dpi_scale ? util::screenOfWidget(this)->devicePixelRatio() : 1.));
w = static_cast<int>(w / (!dpi_scale ? util::screenOfWidget(this)->devicePixelRatio() : 1.));
int modifiedHeight = (h / (!dpi_scale ? util::screenOfWidget(this)->devicePixelRatio() : 1.))
const int modifiedHeight =
static_cast<int>(h / (!dpi_scale ? util::screenOfWidget(this)->devicePixelRatio() : 1.))
+ menuBar()->height()
+ (statusBar()->height() * !hide_status_bar)
+ (ui->toolBar->height() * !hide_tool_bar);
ui->stackedWidget->resize(w, (h / (!dpi_scale ? util::screenOfWidget(this)->devicePixelRatio() : 1.)));
ui->stackedWidget->resize(w, static_cast<int>(h / (!dpi_scale ? util::screenOfWidget(this)->devicePixelRatio() : 1.)));
setFixedSize(w, modifiedHeight);
}
});
@@ -306,9 +308,9 @@ MainWindow::MainWindow(QWidget *parent)
#ifdef QT_RESIZE_DEBUG
qDebug() << "Resize";
#endif
w = (w / (!dpi_scale ? util::screenOfWidget(renderers[monitor_index].get())->devicePixelRatio() : 1.));
w = static_cast<int>(w / (!dpi_scale ? util::screenOfWidget(renderers[monitor_index].get())->devicePixelRatio() : 1.));
int modifiedHeight = (h / (!dpi_scale ? util::screenOfWidget(renderers[monitor_index].get())->devicePixelRatio() : 1.));
int modifiedHeight = static_cast<int>(h / (!dpi_scale ? util::screenOfWidget(renderers[monitor_index].get())->devicePixelRatio() : 1.));
renderers[monitor_index]->setFixedSize(w, modifiedHeight);
}
@@ -394,9 +396,7 @@ MainWindow::MainWindow(QWidget *parent)
ui->actionVulkan->setVisible(false);
}
QActionGroup *actGroup = nullptr;
actGroup = new QActionGroup(this);
auto actGroup = new QActionGroup(this);
actGroup->addAction(ui->actionSoftware_Renderer);
actGroup->addAction(ui->actionHardware_Renderer_OpenGL);
actGroup->addAction(ui->actionHardware_Renderer_OpenGL_ES);
@@ -418,6 +418,8 @@ MainWindow::MainWindow(QWidget *parent)
#endif
RendererStack::Renderer newVidApi = RendererStack::Renderer::Software;
switch (vid_api) {
default:
break;
case 0:
newVidApi = RendererStack::Renderer::Software;
break;
@@ -457,7 +459,7 @@ MainWindow::MainWindow(QWidget *parent)
});
/* Trigger initial renderer switch */
for (auto action : actGroup->actions())
for (const auto action : actGroup->actions())
if (action->property("vid_api").toInt() == vid_api) {
action->setChecked(true);
emit actGroup->triggered(action);
@@ -465,6 +467,8 @@ MainWindow::MainWindow(QWidget *parent)
}
switch (scale) {
default:
break;
case 0:
ui->action0_5x->setChecked(true);
break;
@@ -508,6 +512,8 @@ MainWindow::MainWindow(QWidget *parent)
actGroup->addAction(ui->action7x);
actGroup->addAction(ui->action8x);
switch (video_filter_method) {
default:
break;
case 0:
ui->actionNearest->setChecked(true);
break;
@@ -519,6 +525,8 @@ MainWindow::MainWindow(QWidget *parent)
actGroup->addAction(ui->actionNearest);
actGroup->addAction(ui->actionLinear);
switch (video_fullscreen_scale) {
default:
break;
case FULLSCR_SCALE_FULL:
ui->actionFullScreen_stretch->setChecked(true);
break;
@@ -542,6 +550,8 @@ MainWindow::MainWindow(QWidget *parent)
actGroup->addAction(ui->actionFullScreen_int);
actGroup->addAction(ui->actionFullScreen_int43);
switch (video_grayscale) {
default:
break;
case 0:
ui->actionRGB_Color->setChecked(true);
break;
@@ -565,6 +575,8 @@ MainWindow::MainWindow(QWidget *parent)
actGroup->addAction(ui->actionWhite_monitor);
actGroup->addAction(ui->actionRGB_Color);
switch (video_graytype) {
default:
break;
case 0:
ui->actionBT601_NTSC_PAL->setChecked(true);
break;
@@ -722,7 +734,7 @@ MainWindow::closeEvent(QCloseEvent *event)
if (confirm_exit && confirm_exit_cmdl && cpu_thread_run) {
QMessageBox questionbox(QMessageBox::Icon::Question, "86Box", tr("Are you sure you want to exit 86Box?"), QMessageBox::Yes | QMessageBox::No, this);
QCheckBox *chkbox = new QCheckBox(tr("Don't show this message again"));
auto chkbox = new QCheckBox(tr("Don't show this message again"));
questionbox.setCheckBox(chkbox);
chkbox->setChecked(!confirm_exit);
@@ -771,7 +783,7 @@ void
MainWindow::initRendererMonitorSlot(int monitor_index)
{
auto &secondaryRenderer = this->renderers[monitor_index];
secondaryRenderer.reset(new RendererStack(nullptr, monitor_index));
secondaryRenderer = std::make_unique<RendererStack>(nullptr, monitor_index);
if (secondaryRenderer) {
connect(secondaryRenderer.get(), &RendererStack::rendererChanged, this, [this, monitor_index] {
this->renderers[monitor_index]->show();
@@ -779,9 +791,8 @@ MainWindow::initRendererMonitorSlot(int monitor_index)
secondaryRenderer->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
secondaryRenderer->setWindowTitle(QObject::tr("86Box Monitor #") + QString::number(monitor_index + 1));
if (vid_resize == 2) {
if (vid_resize == 2)
secondaryRenderer->setFixedSize(fixed_size_x, fixed_size_y);
}
secondaryRenderer->setWindowIcon(this->windowIcon());
if (show_second_monitors) {
secondaryRenderer->show();
@@ -791,9 +802,8 @@ MainWindow::initRendererMonitorSlot(int monitor_index)
monitor_settings[monitor_index].mon_window_w > 2048 ? 2048 : monitor_settings[monitor_index].mon_window_w,
monitor_settings[monitor_index].mon_window_h > 2048 ? 2048 : monitor_settings[monitor_index].mon_window_h);
}
if (monitor_settings[monitor_index].mon_window_maximized) {
if (monitor_settings[monitor_index].mon_window_maximized)
secondaryRenderer->showMaximized();
}
secondaryRenderer->switchRenderer((RendererStack::Renderer) vid_api);
secondaryRenderer->setMouseTracking(true);
@@ -877,7 +887,7 @@ MainWindow::on_actionHard_Reset_triggered()
QMessageBox questionbox(QMessageBox::Icon::Question, "86Box", tr("Are you sure you want to hard reset the emulated machine?"), QMessageBox::NoButton, this);
questionbox.addButton(tr("Reset"), QMessageBox::AcceptRole);
questionbox.addButton(tr("Don't reset"), QMessageBox::RejectRole);
QCheckBox *chkbox = new QCheckBox(tr("Don't show this message again"));
const auto chkbox = new QCheckBox(tr("Don't show this message again"));
questionbox.setCheckBox(chkbox);
chkbox->setChecked(!confirm_reset);
@@ -921,7 +931,7 @@ MainWindow::on_actionExit_triggered()
void
MainWindow::on_actionSettings_triggered()
{
int currentPause = dopause;
const int currentPause = dopause;
plat_pause(1);
Settings settings(this);
settings.setModal(true);
@@ -932,6 +942,8 @@ MainWindow::on_actionSettings_triggered()
settings.exec();
switch (settings.result()) {
default:
break;
case QDialog::Accepted:
pc_reset_hard_close();
settings.save();
@@ -968,6 +980,9 @@ MainWindow::processKeyboardInput(bool down, uint32_t keycode)
/* Apply special cases. */
switch (keycode) {
default:
break;
case 0x54: /* Alt + Print Screen (special case, i.e. evdev SELECTIVE_SCREENSHOT) */
/* Send Alt as well. */
if (down) {
@@ -1333,18 +1348,18 @@ MainWindow::checkFullscreenHotkey()
{
if (!fs_off_signal && video_fullscreen && keyboard_isfsexit()) {
/* Signal "exit fullscreen mode". */
fs_off_signal = 1;
fs_off_signal = true;
} else if (fs_off_signal && video_fullscreen && keyboard_isfsexit_up()) {
ui->actionFullscreen->trigger();
fs_off_signal = 0;
fs_off_signal = false;
}
if (!fs_on_signal && !video_fullscreen && keyboard_isfsenter()) {
/* Signal "enter fullscreen mode". */
fs_on_signal = 1;
fs_on_signal = true;
} else if (fs_on_signal && !video_fullscreen && keyboard_isfsenter_up()) {
ui->actionFullscreen->trigger();
fs_on_signal = 0;
fs_on_signal = false;
}
}
@@ -1699,7 +1714,7 @@ MainWindow::on_actionAbout_86Box_triggered()
msgBox.setInformativeText(tr("An emulator of old computers\n\nAuthors: Miran Grča (OBattler), RichardG867, Jasmine Iwanek, TC1995, coldbrewed, Teemu Korhonen (Manaatti), Joakim L. Gilje, Adrien Moulin (elyosh), Daniel Balsom (gloriouscow), Cacodemon345, Fred N. van Kempen (waltje), Tiseno100, reenigne, and others.\n\nWith previous core contributions from Sarah Walker, leilei, JohnElliott, greatpsycho, and others.\n\nReleased under the GNU General Public License version 2 or later. See LICENSE for more information."));
msgBox.setWindowTitle("About 86Box");
msgBox.addButton("OK", QMessageBox::ButtonRole::AcceptRole);
auto webSiteButton = msgBox.addButton(EMU_SITE, QMessageBox::ButtonRole::HelpRole);
const auto webSiteButton = msgBox.addButton(EMU_SITE, QMessageBox::ButtonRole::HelpRole);
webSiteButton->connect(webSiteButton, &QPushButton::released, []() {
QDesktopServices::openUrl(QUrl("https://" EMU_SITE));
});
@@ -1847,8 +1862,8 @@ void
MainWindow::on_actionTake_screenshot_triggered()
{
startblit();
for (int i = 0; i < MONITORS_NUM; i++)
monitors[i].mon_screenshots++;
for (auto & monitor : monitors)
++monitor.mon_screenshots;
endblit();
device_force_redraw();
}
@@ -1869,8 +1884,10 @@ MainWindow::setSendKeyboardInput(bool enabled)
void
MainWindow::updateUiPauseState()
{
auto pause_icon = dopause ? QIcon(":/menuicons/qt/icons/run.ico") : QIcon(":/menuicons/qt/icons/pause.ico");
auto tooltip_text = dopause ? QString(tr("Resume execution")) : QString(tr("Pause execution"));
const auto pause_icon = dopause ? QIcon(":/menuicons/qt/icons/run.ico") :
QIcon(":/menuicons/qt/icons/pause.ico");
const auto tooltip_text = dopause ? QString(tr("Resume execution")) :
QString(tr("Pause execution"));
ui->actionPause->setIcon(pause_icon);
ui->actionPause->setToolTip(tooltip_text);
}
@@ -1932,9 +1949,7 @@ MainWindow::changeEvent(QEvent *event)
void
MainWindow::on_actionRenderer_options_triggered()
{
auto dlg = ui->stackedWidget->getOptions(this);
if (dlg) {
if (const auto dlg = ui->stackedWidget->getOptions(this)) {
if (dlg->exec() == QDialog::Accepted) {
for (int i = 1; i < MONITORS_NUM; i++) {
if (renderers[i] && renderers[i]->hasOptions())
@@ -1947,20 +1962,18 @@ MainWindow::on_actionRenderer_options_triggered()
void
MainWindow::on_actionMCA_devices_triggered()
{
auto dlg = new MCADeviceList(this);
if (dlg)
if (const auto dlg = new MCADeviceList(this))
dlg->exec();
}
void
MainWindow::on_actionShow_non_primary_monitors_triggered()
{
show_second_monitors = (int) ui->actionShow_non_primary_monitors->isChecked();
show_second_monitors = static_cast<int>(ui->actionShow_non_primary_monitors->isChecked());
if (show_second_monitors) {
for (int monitor_index = 1; monitor_index < MONITORS_NUM; monitor_index++) {
auto &secondaryRenderer = renderers[monitor_index];
const auto &secondaryRenderer = renderers[monitor_index];
if (!renderers[monitor_index])
continue;
secondaryRenderer->show();
@@ -1970,8 +1983,8 @@ MainWindow::on_actionShow_non_primary_monitors_triggered()
monitor_settings[monitor_index].mon_window_w > 2048 ? 2048 : monitor_settings[monitor_index].mon_window_w,
monitor_settings[monitor_index].mon_window_h > 2048 ? 2048 : monitor_settings[monitor_index].mon_window_h);
}
secondaryRenderer->switchRenderer((RendererStack::Renderer) vid_api);
ui->stackedWidget->switchRenderer((RendererStack::Renderer) vid_api);
secondaryRenderer->switchRenderer(static_cast<RendererStack::Renderer>(vid_api));
ui->stackedWidget->switchRenderer(static_cast<RendererStack::Renderer>(vid_api));
}
} else {
for (int monitor_index = 1; monitor_index < MONITORS_NUM; monitor_index++) {
@@ -1992,7 +2005,7 @@ MainWindow::on_actionShow_non_primary_monitors_triggered()
void
MainWindow::on_actionOpen_screenshots_folder_triggered()
{
QDir(QString(usr_path) + QString("/screenshots/")).mkpath(".");
static_cast<void>(QDir(QString(usr_path) + QString("/screenshots/")).mkpath("."));
QDesktopServices::openUrl(QUrl(QString("file:///") + usr_path + QString("/screenshots/")));
}
@@ -2001,7 +2014,7 @@ MainWindow::on_actionApply_fullscreen_stretch_mode_when_maximized_triggered(bool
{
video_fullscreen_scale_maximized = checked;
auto widget = ui->stackedWidget->currentWidget();
const auto widget = ui->stackedWidget->currentWidget();
ui->stackedWidget->onResize(widget->width(), widget->height());
for (int i = 1; i < MONITORS_NUM; i++) {