Merge branch 'qt' of https://github.com/jgilje/86Box into qt
This commit is contained in:
@@ -15,6 +15,7 @@ extern "C" {
|
||||
}
|
||||
|
||||
#include "qt_filefield.hpp"
|
||||
#include "qt_models_common.hpp"
|
||||
|
||||
DeviceConfig::DeviceConfig(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
@@ -28,12 +29,12 @@ DeviceConfig::~DeviceConfig()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void DeviceConfig::ConfigureDevice(const _device_* device) {
|
||||
void DeviceConfig::ConfigureDevice(const _device_* device, int instance) {
|
||||
DeviceConfig dc;
|
||||
dc.setWindowTitle(QString("%1 Device Configuration").arg(device->name));
|
||||
|
||||
device_context_t device_context;
|
||||
device_set_context(&device_context, device, 0);
|
||||
device_set_context(&device_context, device, instance);
|
||||
|
||||
const auto* config = device->config;
|
||||
while (config->type != -1) {
|
||||
@@ -47,9 +48,47 @@ void DeviceConfig::ConfigureDevice(const _device_* device) {
|
||||
dc.ui->formLayout->addRow(config->description, cbox);
|
||||
break;
|
||||
}
|
||||
case CONFIG_SELECTION:
|
||||
case CONFIG_MIDI:
|
||||
{
|
||||
auto* cbox = new QComboBox();
|
||||
cbox->setObjectName(config->name);
|
||||
auto* model = cbox->model();
|
||||
int currentIndex = -1;
|
||||
int selected = config_get_int(device_context.name, const_cast<char*>(config->name), config->default_int);
|
||||
for (int i = 0; i < plat_midi_get_num_devs(); i++) {
|
||||
char midiName[512] = { 0 };
|
||||
plat_midi_get_dev_name(i, midiName);
|
||||
|
||||
Models::AddEntry(model, midiName, i);
|
||||
if (selected == i) {
|
||||
currentIndex = i;
|
||||
}
|
||||
}
|
||||
dc.ui->formLayout->addRow(config->description, cbox);
|
||||
cbox->setCurrentIndex(currentIndex);
|
||||
break;
|
||||
}
|
||||
case CONFIG_MIDI_IN:
|
||||
{
|
||||
auto* cbox = new QComboBox();
|
||||
cbox->setObjectName(config->name);
|
||||
auto* model = cbox->model();
|
||||
int currentIndex = -1;
|
||||
int selected = config_get_int(device_context.name, const_cast<char*>(config->name), config->default_int);
|
||||
for (int i = 0; i < plat_midi_in_get_num_devs(); i++) {
|
||||
char midiName[512] = { 0 };
|
||||
plat_midi_in_get_dev_name(i, midiName);
|
||||
|
||||
Models::AddEntry(model, midiName, i);
|
||||
if (selected == i) {
|
||||
currentIndex = i;
|
||||
}
|
||||
}
|
||||
dc.ui->formLayout->addRow(config->description, cbox);
|
||||
cbox->setCurrentIndex(currentIndex);
|
||||
break;
|
||||
}
|
||||
case CONFIG_SELECTION:
|
||||
case CONFIG_HEX16:
|
||||
case CONFIG_HEX20:
|
||||
{
|
||||
@@ -57,50 +96,23 @@ void DeviceConfig::ConfigureDevice(const _device_* device) {
|
||||
cbox->setObjectName(config->name);
|
||||
auto* model = cbox->model();
|
||||
int currentIndex = -1;
|
||||
int selected = config_get_int(device_context.name, const_cast<char*>(config->name), config->default_int);
|
||||
int selected;
|
||||
switch (config->type) {
|
||||
case CONFIG_SELECTION:
|
||||
selected = config_get_int(device_context.name, const_cast<char*>(config->name), config->default_int);
|
||||
break;
|
||||
case CONFIG_HEX16:
|
||||
selected = config_get_hex16(device_context.name, const_cast<char*>(config->name), config->default_int);
|
||||
break;
|
||||
case CONFIG_HEX20:
|
||||
selected = config_get_hex20(device_context.name, const_cast<char*>(config->name), config->default_int);
|
||||
break;
|
||||
}
|
||||
|
||||
if (config->type == CONFIG_MIDI) {
|
||||
for (int i = 0; i < plat_midi_get_num_devs(); i++) {
|
||||
char midiName[512] = { 0 };
|
||||
plat_midi_get_dev_name(i, midiName);
|
||||
|
||||
int rows = model->rowCount();
|
||||
model->insertRow(rows);
|
||||
auto idx = model->index(rows, 0);
|
||||
|
||||
model->setData(idx, midiName, Qt::DisplayRole);
|
||||
model->setData(idx, i, Qt::UserRole);
|
||||
if (selected == i) {
|
||||
currentIndex = idx.row();
|
||||
}
|
||||
}
|
||||
} else if (config->type == CONFIG_MIDI_IN) {
|
||||
for (int i = 0; i < plat_midi_in_get_num_devs(); i++) {
|
||||
char midiName[512] = { 0 };
|
||||
plat_midi_in_get_dev_name(i, midiName);
|
||||
|
||||
int rows = model->rowCount();
|
||||
model->insertRow(rows);
|
||||
auto idx = model->index(rows, 0);
|
||||
|
||||
model->setData(idx, midiName, Qt::DisplayRole);
|
||||
model->setData(idx, i, Qt::UserRole);
|
||||
if (selected == i) {
|
||||
currentIndex = idx.row();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (auto* sel = config->selection; (sel->description != nullptr) && (strlen(sel->description) > 0); ++sel) {
|
||||
int rows = model->rowCount();
|
||||
model->insertRow(rows);
|
||||
auto idx = model->index(rows, 0);
|
||||
|
||||
model->setData(idx, sel->description, Qt::DisplayRole);
|
||||
model->setData(idx, sel->value, Qt::UserRole);
|
||||
|
||||
if (selected == sel->value) {
|
||||
currentIndex = idx.row();
|
||||
}
|
||||
for (auto* sel = config->selection; (sel->description != nullptr) && (strlen(sel->description) > 0); ++sel) {
|
||||
int row = Models::AddEntry(model, sel->description, sel->value);
|
||||
if (selected == sel->value) {
|
||||
currentIndex = row;
|
||||
}
|
||||
}
|
||||
dc.ui->formLayout->addRow(config->description, cbox);
|
||||
@@ -145,16 +157,26 @@ void DeviceConfig::ConfigureDevice(const _device_* device) {
|
||||
config_set_int(device_context.name, const_cast<char*>(config->name), cbox->isChecked() ? 1 : 0);
|
||||
break;
|
||||
}
|
||||
case CONFIG_SELECTION:
|
||||
case CONFIG_MIDI:
|
||||
case CONFIG_MIDI_IN:
|
||||
case CONFIG_HEX16:
|
||||
case CONFIG_HEX20:
|
||||
case CONFIG_SELECTION:
|
||||
{
|
||||
auto* cbox = dc.findChild<QComboBox*>(config->name);
|
||||
config_set_int(device_context.name, const_cast<char*>(config->name), cbox->currentData().toInt());
|
||||
break;
|
||||
}
|
||||
case CONFIG_HEX16:
|
||||
{
|
||||
auto* cbox = dc.findChild<QComboBox*>(config->name);
|
||||
config_set_hex16(device_context.name, const_cast<char*>(config->name), cbox->currentData().toInt());
|
||||
break;
|
||||
}
|
||||
case CONFIG_HEX20:
|
||||
{
|
||||
auto* cbox = dc.findChild<QComboBox*>(config->name);
|
||||
config_set_hex20(device_context.name, const_cast<char*>(config->name), cbox->currentData().toInt());
|
||||
break;
|
||||
}
|
||||
case CONFIG_FNAME:
|
||||
{
|
||||
auto* fbox = dc.findChild<FileField*>(config->name);
|
||||
|
||||
@@ -19,7 +19,7 @@ public:
|
||||
explicit DeviceConfig(QWidget *parent = nullptr);
|
||||
~DeviceConfig();
|
||||
|
||||
static void ConfigureDevice(const _device_* device);
|
||||
static void ConfigureDevice(const _device_* device, int instance = 0);
|
||||
static QString DeviceName(const _device_* device, const char* internalName, int bus);
|
||||
private:
|
||||
Ui::DeviceConfig *ui;
|
||||
|
||||
@@ -371,12 +371,12 @@ void HarddiskDialog::onCreateNewFile() {
|
||||
uint64_t restBlock = size & 0xfffff;
|
||||
|
||||
if (restBlock) {
|
||||
stream << QByteArray::fromRawData(buf.data(), restBlock);
|
||||
stream.writeRawData(buf.data(), restBlock);
|
||||
}
|
||||
|
||||
if (mibBlocks) {
|
||||
for (uint64_t i = 0; i < mibBlocks; ++i) {
|
||||
stream << buf;
|
||||
stream.writeRawData(buf.data(), buf.size());
|
||||
emit fileProgress(static_cast<int>((i * 100) / mibBlocks));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#include "qt_hardwarerenderer.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include <86box/86box.h>
|
||||
}
|
||||
|
||||
void HardwareRenderer::resizeGL(int w, int h)
|
||||
{
|
||||
glViewport(0, 0, w, h);
|
||||
@@ -13,6 +17,7 @@ void HardwareRenderer::initializeGL()
|
||||
void HardwareRenderer::paintGL()
|
||||
{
|
||||
QPainter painter(this);
|
||||
painter.setRenderHint(QPainter::SmoothPixmapTransform, video_filter_method > 0 ? true : false);
|
||||
painter.drawImage(QRect(0, 0, width(), height()), image, QRect(sx, sy, sw, sh));
|
||||
// "release" image, reducing it's refcount, so renderstack::blit()
|
||||
// won't have to reallocate
|
||||
|
||||
@@ -95,6 +95,14 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
main_window = new MainWindow();
|
||||
main_window->show();
|
||||
main_window->setFocus();
|
||||
app.installEventFilter(main_window);
|
||||
auto widgetList = app.allWidgets();
|
||||
for (auto curWidget : widgetList)
|
||||
{
|
||||
curWidget->setFocusPolicy(Qt::NoFocus);
|
||||
}
|
||||
main_window->setFocusPolicy(Qt::StrongFocus);
|
||||
|
||||
pc_init(argc, argv);
|
||||
if (! pc_init_modules()) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "qt_mainwindow.hpp"
|
||||
#include "ui_qt_mainwindow.h"
|
||||
#include <qguiapplication.h>
|
||||
|
||||
extern "C" {
|
||||
#include <86box/86box.h>
|
||||
@@ -12,14 +11,16 @@ extern "C" {
|
||||
#include "qt_sdl.h"
|
||||
};
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include <QWindow>
|
||||
#include <QDebug>
|
||||
#include <QTimer>
|
||||
#include <QThread>
|
||||
#include <QKeyEvent>
|
||||
#include <QMessageBox>
|
||||
#include <QFocusEvent>
|
||||
|
||||
#include <array>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "qt_settings.hpp"
|
||||
#include "qt_machinestatus.hpp"
|
||||
@@ -28,6 +29,8 @@ extern "C" {
|
||||
#ifdef __unix__
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/keysym.h>
|
||||
#undef KeyPress
|
||||
#undef KeyRelease
|
||||
#endif
|
||||
|
||||
extern void qt_mouse_capture(int);
|
||||
@@ -75,8 +78,10 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
});
|
||||
|
||||
connect(this, &MainWindow::resizeContents, this, [this](int w, int h) {
|
||||
ui->stackedWidget->resize(w, h);
|
||||
resize(w, h + menuBar()->height() + statusBar()->height());
|
||||
if (!QApplication::platformName().contains("eglfs")) {
|
||||
ui->stackedWidget->resize(w, h);
|
||||
resize(w, h + menuBar()->height() + statusBar()->height());
|
||||
}
|
||||
});
|
||||
|
||||
connect(ui->menubar, &QMenuBar::triggered, this, [] {
|
||||
@@ -94,6 +99,16 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
ui->actionKeyboard_requires_capture->setChecked(kbd_req_capture);
|
||||
ui->actionRight_CTRL_is_left_ALT->setChecked(rctrl_is_lalt);
|
||||
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
ui->gles->setFocusPolicy(Qt::NoFocus);
|
||||
ui->sw->setFocusPolicy(Qt::NoFocus);
|
||||
ui->ogl->setFocusPolicy(Qt::NoFocus);
|
||||
ui->stackedWidget->setFocusPolicy(Qt::NoFocus);
|
||||
ui->centralwidget->setFocusPolicy(Qt::NoFocus);
|
||||
menuBar()->setFocusPolicy(Qt::NoFocus);
|
||||
menuWidget()->setFocusPolicy(Qt::NoFocus);
|
||||
statusBar()->setFocusPolicy(Qt::NoFocus);
|
||||
|
||||
video_setblit(qt_blit);
|
||||
}
|
||||
|
||||
@@ -617,6 +632,26 @@ std::array<uint32_t, 256> darwin_to_xt
|
||||
0,
|
||||
};
|
||||
|
||||
static std::unordered_map<uint32_t, uint16_t> evdev_to_xt =
|
||||
{
|
||||
{96, 0x11C},
|
||||
{97, 0x11D},
|
||||
{98, 0x135},
|
||||
{99, 0x71},
|
||||
{100, 0x138},
|
||||
{101, 0x1C},
|
||||
{102, 0x147},
|
||||
{103, 0x148},
|
||||
{104, 0x149},
|
||||
{105, 0x14B},
|
||||
{106, 0x14D},
|
||||
{107, 0x14F},
|
||||
{108, 0x150},
|
||||
{109, 0x151},
|
||||
{110, 0x152},
|
||||
{111, 0x153}
|
||||
};
|
||||
|
||||
static std::array<uint32_t, 256>& selected_keycode = x11_to_xt_base;
|
||||
|
||||
uint16_t x11_keycode_to_keysym(uint32_t keycode)
|
||||
@@ -631,6 +666,12 @@ uint16_t x11_keycode_to_keysym(uint32_t keycode)
|
||||
{
|
||||
selected_keycode = x11_to_xt_2;
|
||||
}
|
||||
else if (QApplication::platformName().contains("eglfs"))
|
||||
{
|
||||
keycode -= 8;
|
||||
if (keycode <= 88) return keycode;
|
||||
else return evdev_to_xt[keycode];
|
||||
}
|
||||
else if (!x11display)
|
||||
{
|
||||
x11display = XOpenDisplay(nullptr);
|
||||
@@ -685,6 +726,23 @@ void MainWindow::getTitle(wchar_t *title)
|
||||
}
|
||||
}
|
||||
|
||||
bool MainWindow::eventFilter(QObject* receiver, QEvent* event)
|
||||
{
|
||||
if (this->keyboardGrabber() == this) {
|
||||
if (event->type() == QEvent::KeyPress) {
|
||||
event->accept();
|
||||
this->keyPressEvent((QKeyEvent*)event);
|
||||
return true;
|
||||
}
|
||||
if (event->type() == QEvent::KeyRelease) {
|
||||
event->accept();
|
||||
this->keyReleaseEvent((QKeyEvent*)event);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return QMainWindow::eventFilter(receiver, event);
|
||||
}
|
||||
|
||||
void MainWindow::refreshMediaMenu() {
|
||||
mm->refresh(ui->menuMedia);
|
||||
}
|
||||
@@ -717,6 +775,7 @@ void MainWindow::keyPressEvent(QKeyEvent* event)
|
||||
if (keyboard_ismsexit()) {
|
||||
plat_mouse_capture(0);
|
||||
}
|
||||
event->accept();
|
||||
}
|
||||
|
||||
void MainWindow::blitToWidget(int x, int y, int w, int h)
|
||||
@@ -744,3 +803,13 @@ void MainWindow::on_actionHardware_Renderer_OpenGL_triggered() {
|
||||
void MainWindow::on_actionHardware_Renderer_OpenGL_ES_triggered() {
|
||||
ui->stackedWidget->setCurrentIndex(2);
|
||||
}
|
||||
|
||||
void MainWindow::focusInEvent(QFocusEvent* event)
|
||||
{
|
||||
this->grabKeyboard();
|
||||
}
|
||||
|
||||
void MainWindow::focusOutEvent(QFocusEvent* event)
|
||||
{
|
||||
this->releaseKeyboard();
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <QMainWindow>
|
||||
#include <QLabel>
|
||||
#include <QEvent>
|
||||
#include <QFocusEvent>
|
||||
|
||||
#include <memory>
|
||||
|
||||
@@ -63,6 +64,9 @@ private slots:
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent* event) override;
|
||||
void keyReleaseEvent(QKeyEvent* event) override;
|
||||
void focusInEvent(QFocusEvent* event) override;
|
||||
void focusOutEvent(QFocusEvent* event) override;
|
||||
bool eventFilter(QObject* receiver, QEvent* event) override;
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
|
||||
@@ -41,11 +41,16 @@ void MediaMenu::refresh(QMenu *parentMenu) {
|
||||
cassetteMenu->addAction("Existing Image", [this]() { cassetteSelectImage(false); });
|
||||
cassetteMenu->addAction("Existing Image (Write Protected)", [this]() { cassetteSelectImage(true); });
|
||||
cassetteMenu->addSeparator();
|
||||
cassetteMenu->addAction("Record")->setCheckable(true);
|
||||
cassetteMenu->addAction("Play")->setCheckable(true);
|
||||
cassetteMenu->addAction("Rewing");
|
||||
cassetteMenu->addAction("Fast Forward");
|
||||
cassetteRecordPos = cassetteMenu->children().count();
|
||||
cassetteMenu->addAction("Record", [this] { pc_cas_set_mode(cassette, 1); cassetteUpdateMenu(); })->setCheckable(true);
|
||||
cassettePlayPos = cassetteMenu->children().count();
|
||||
cassetteMenu->addAction("Play", [this] { pc_cas_set_mode(cassette, 0); cassetteUpdateMenu(); })->setCheckable(true);
|
||||
cassetteRewindPos = cassetteMenu->children().count();
|
||||
cassetteMenu->addAction("Rewind", [] { pc_cas_rewind(cassette); });
|
||||
cassetteFastFwdPos = cassetteMenu->children().count();
|
||||
cassetteMenu->addAction("Fast Forward", [] { pc_cas_append(cassette); });
|
||||
cassetteMenu->addSeparator();
|
||||
cassetteEjectPos = cassetteMenu->children().count();
|
||||
cassetteMenu->addAction("Eject", [this]() { cassetteEject(); });
|
||||
cassetteUpdateMenu();
|
||||
}
|
||||
@@ -56,6 +61,7 @@ void MediaMenu::refresh(QMenu *parentMenu) {
|
||||
auto* menu = parentMenu->addMenu("");
|
||||
menu->addAction("Image", [this, i]() { cartridgeSelectImage(i); });
|
||||
menu->addSeparator();
|
||||
cartridgeEjectPos = menu->children().count();
|
||||
menu->addAction("Eject", [this, i]() { cartridgeEject(i); });
|
||||
cartridgeMenus.append(menu);
|
||||
cartridgeUpdateMenu(i);
|
||||
@@ -70,8 +76,10 @@ void MediaMenu::refresh(QMenu *parentMenu) {
|
||||
menu->addAction("Existing Image", [this, i]() { floppySelectImage(i, false); });
|
||||
menu->addAction("Existing Image (Write Protected)", [this, i]() { floppySelectImage(i, true); });
|
||||
menu->addSeparator();
|
||||
floppyExportPos = menu->children().count();
|
||||
menu->addAction("Export to 86F", [this, i]() { floppyExportTo86f(i); });
|
||||
menu->addSeparator();
|
||||
floppyEjectPos = menu->children().count();
|
||||
menu->addAction("Eject", [this, i]() { floppyEject(i); });
|
||||
floppyMenus.append(menu);
|
||||
floppyUpdateMenu(i);
|
||||
@@ -169,6 +177,24 @@ void MediaMenu::cassetteEject() {
|
||||
|
||||
void MediaMenu::cassetteUpdateMenu() {
|
||||
QString name = cassette_fname;
|
||||
QString mode = cassette_mode;
|
||||
auto childs = cassetteMenu->children();
|
||||
auto* recordMenu = dynamic_cast<QAction*>(childs[cassetteRecordPos]);
|
||||
auto* playMenu = dynamic_cast<QAction*>(childs[cassettePlayPos]);
|
||||
auto* rewindMenu = dynamic_cast<QAction*>(childs[cassetteRewindPos]);
|
||||
auto* fastFwdMenu = dynamic_cast<QAction*>(childs[cassetteFastFwdPos]);
|
||||
auto* ejectMenu = dynamic_cast<QAction*>(childs[cassetteEjectPos]);
|
||||
|
||||
recordMenu->setEnabled(!name.isEmpty());
|
||||
playMenu->setEnabled(!name.isEmpty());
|
||||
rewindMenu->setEnabled(!name.isEmpty());
|
||||
fastFwdMenu->setEnabled(!name.isEmpty());
|
||||
ejectMenu->setEnabled(!name.isEmpty());
|
||||
|
||||
bool isSaving = mode == QStringLiteral("save");
|
||||
recordMenu->setChecked(isSaving);
|
||||
playMenu->setChecked(! isSaving);
|
||||
|
||||
cassetteMenu->setTitle(QString("Cassette: %1").arg(name.isEmpty() ? "(empty)" : name));
|
||||
}
|
||||
|
||||
@@ -197,7 +223,11 @@ void MediaMenu::cartridgeEject(int i) {
|
||||
|
||||
void MediaMenu::cartridgeUpdateMenu(int i) {
|
||||
QString name = cart_fns[i];
|
||||
cartridgeMenus[i]->setTitle(QString("Cartridge %1: %2").arg(QString::number(i+1), name.isEmpty() ? "(empty)" : name));
|
||||
auto* menu = cartridgeMenus[i];
|
||||
auto childs = menu->children();
|
||||
auto* ejectMenu = dynamic_cast<QAction*>(childs[cartridgeEjectPos]);
|
||||
ejectMenu->setEnabled(!name.isEmpty());
|
||||
menu->setTitle(QString("Cartridge %1: %2").arg(QString::number(i+1), name.isEmpty() ? "(empty)" : name));
|
||||
}
|
||||
|
||||
void MediaMenu::floppyNewImage(int i) {
|
||||
@@ -250,6 +280,15 @@ void MediaMenu::floppyExportTo86f(int i) {
|
||||
|
||||
void MediaMenu::floppyUpdateMenu(int i) {
|
||||
QString name = floppyfns[i];
|
||||
|
||||
auto* menu = floppyMenus[i];
|
||||
auto childs = menu->children();
|
||||
|
||||
auto* ejectMenu = dynamic_cast<QAction*>(childs[floppyEjectPos]);
|
||||
auto* exportMenu = dynamic_cast<QAction*>(childs[floppyExportPos]);
|
||||
ejectMenu->setEnabled(!name.isEmpty());
|
||||
exportMenu->setEnabled(!name.isEmpty());
|
||||
|
||||
int type = fdd_get_type(i);
|
||||
floppyMenus[i]->setTitle(QString("Floppy %1 (%2): %3").arg(QString::number(i+1), fdd_getname(type), name.isEmpty() ? "(empty)" : name));
|
||||
}
|
||||
|
||||
@@ -63,6 +63,17 @@ private:
|
||||
QList<QMenu*> zipMenus;
|
||||
QList<QMenu*> moMenus;
|
||||
|
||||
int cassetteRecordPos;
|
||||
int cassettePlayPos;
|
||||
int cassetteRewindPos;
|
||||
int cassetteFastFwdPos;
|
||||
int cassetteEjectPos;
|
||||
|
||||
int cartridgeEjectPos;
|
||||
|
||||
int floppyExportPos;
|
||||
int floppyEjectPos;
|
||||
|
||||
int cdromMutePos;
|
||||
int cdromEmptyPos;
|
||||
int cdromReloadPos;
|
||||
|
||||
@@ -271,6 +271,7 @@ bool NewFloppyDialog::create86f(const QString& filename, const disk_size_t& disk
|
||||
return false;
|
||||
}
|
||||
QDataStream stream(&file);
|
||||
stream.setByteOrder(QDataStream::LittleEndian);
|
||||
|
||||
stream << magic;
|
||||
stream << version;
|
||||
@@ -314,6 +315,7 @@ bool NewFloppyDialog::createSectorImage(const QString &filename, const disk_size
|
||||
return false;
|
||||
}
|
||||
QDataStream stream(&file);
|
||||
stream.setByteOrder(QDataStream::LittleEndian);
|
||||
|
||||
sector_bytes = (128 << disk_size.sector_len);
|
||||
total_sectors = disk_size.sides * disk_size.tracks * disk_size.sectors;
|
||||
@@ -411,6 +413,7 @@ bool NewFloppyDialog::createZipSectorImage(const QString &filename, const disk_s
|
||||
return false;
|
||||
}
|
||||
QDataStream stream(&file);
|
||||
stream.setByteOrder(QDataStream::LittleEndian);
|
||||
|
||||
sector_bytes = (128 << disk_size.sector_len);
|
||||
total_sectors = disk_size.sides * disk_size.tracks * disk_size.sectors;
|
||||
@@ -599,6 +602,7 @@ bool NewFloppyDialog::createMoSectorImage(const QString& filename, int8_t disk_s
|
||||
return false;
|
||||
}
|
||||
QDataStream stream(&file);
|
||||
stream.setByteOrder(QDataStream::LittleEndian);
|
||||
|
||||
sector_bytes = dp->bytes_per_sector;
|
||||
total_sectors = dp->sectors;
|
||||
|
||||
@@ -62,7 +62,7 @@ void RendererStack::mousePoll()
|
||||
mousedata.deltax = mousedata.deltay = mousedata.deltaz = 0;
|
||||
mouse_buttons = mousedata.mousebuttons;
|
||||
#ifdef WAYLAND
|
||||
if (wayland)
|
||||
if (QApplication::platformName().contains("wayland"))
|
||||
wl_mouse_poll();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -96,7 +96,7 @@ void SettingsOtherPeripherals::on_comboBoxCard1_currentIndexChanged(int index) {
|
||||
}
|
||||
|
||||
void SettingsOtherPeripherals::on_pushButtonConfigureCard1_clicked() {
|
||||
DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard1->currentData().toInt()));
|
||||
DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard1->currentData().toInt()), 1);
|
||||
}
|
||||
|
||||
void SettingsOtherPeripherals::on_comboBoxCard2_currentIndexChanged(int index) {
|
||||
@@ -107,7 +107,7 @@ void SettingsOtherPeripherals::on_comboBoxCard2_currentIndexChanged(int index) {
|
||||
}
|
||||
|
||||
void SettingsOtherPeripherals::on_pushButtonConfigureCard2_clicked() {
|
||||
DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard2->currentData().toInt()));
|
||||
DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard2->currentData().toInt()), 2);
|
||||
}
|
||||
|
||||
void SettingsOtherPeripherals::on_comboBoxCard3_currentIndexChanged(int index) {
|
||||
@@ -118,7 +118,7 @@ void SettingsOtherPeripherals::on_comboBoxCard3_currentIndexChanged(int index) {
|
||||
}
|
||||
|
||||
void SettingsOtherPeripherals::on_pushButtonConfigureCard3_clicked() {
|
||||
DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard3->currentData().toInt()));
|
||||
DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard3->currentData().toInt()), 3);
|
||||
}
|
||||
|
||||
void SettingsOtherPeripherals::on_comboBoxCard4_currentIndexChanged(int index) {
|
||||
@@ -129,5 +129,5 @@ void SettingsOtherPeripherals::on_comboBoxCard4_currentIndexChanged(int index) {
|
||||
}
|
||||
|
||||
void SettingsOtherPeripherals::on_pushButtonConfigureCard4_clicked() {
|
||||
DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard4->currentData().toInt()));
|
||||
DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard4->currentData().toInt()), 4);
|
||||
}
|
||||
|
||||
@@ -18,32 +18,14 @@ public:
|
||||
void save();
|
||||
private slots:
|
||||
void on_pushButtonConfigureCard4_clicked();
|
||||
|
||||
private slots:
|
||||
void on_comboBoxCard4_currentIndexChanged(int index);
|
||||
|
||||
private slots:
|
||||
void on_pushButtonConfigureCard3_clicked();
|
||||
|
||||
private slots:
|
||||
void on_comboBoxCard3_currentIndexChanged(int index);
|
||||
|
||||
private slots:
|
||||
void on_pushButtonConfigureCard2_clicked();
|
||||
|
||||
private slots:
|
||||
void on_comboBoxCard2_currentIndexChanged(int index);
|
||||
|
||||
private slots:
|
||||
void on_pushButtonConfigureCard1_clicked();
|
||||
|
||||
private slots:
|
||||
void on_comboBoxCard1_currentIndexChanged(int index);
|
||||
|
||||
private slots:
|
||||
void on_pushButtonConfigureRTC_clicked();
|
||||
|
||||
private slots:
|
||||
void on_comboBoxRTC_currentIndexChanged(int index);
|
||||
|
||||
private:
|
||||
|
||||
@@ -87,7 +87,7 @@ void SettingsSound::onCurrentMachineChanged(int machineId) {
|
||||
|
||||
if (midi_device_available(c)) {
|
||||
int row = Models::AddEntry(model, name, c);
|
||||
if (c == midi_input_device_current) {
|
||||
if (c == midi_device_current) {
|
||||
selectedRow = row - removeRows;
|
||||
}
|
||||
}
|
||||
@@ -110,7 +110,7 @@ void SettingsSound::onCurrentMachineChanged(int machineId) {
|
||||
|
||||
if (midi_in_device_available(c)) {
|
||||
int row = Models::AddEntry(model, name, c);
|
||||
if (c == midi_device_current) {
|
||||
if (c == midi_input_device_current) {
|
||||
selectedRow = row - removeRows;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,17 +217,17 @@ void SettingsStorageControllers::on_comboBoxSCSI4_currentIndexChanged(int index)
|
||||
|
||||
|
||||
void SettingsStorageControllers::on_pushButtonSCSI1_clicked() {
|
||||
DeviceConfig::ConfigureDevice(scsi_card_getdevice(ui->comboBoxSCSI1->currentData().toInt()));
|
||||
DeviceConfig::ConfigureDevice(scsi_card_getdevice(ui->comboBoxSCSI1->currentData().toInt()), 1);
|
||||
}
|
||||
|
||||
void SettingsStorageControllers::on_pushButtonSCSI2_clicked() {
|
||||
DeviceConfig::ConfigureDevice(scsi_card_getdevice(ui->comboBoxSCSI2->currentData().toInt()));
|
||||
DeviceConfig::ConfigureDevice(scsi_card_getdevice(ui->comboBoxSCSI2->currentData().toInt()), 2);
|
||||
}
|
||||
|
||||
void SettingsStorageControllers::on_pushButtonSCSI3_clicked() {
|
||||
DeviceConfig::ConfigureDevice(scsi_card_getdevice(ui->comboBoxSCSI3->currentData().toInt()));
|
||||
DeviceConfig::ConfigureDevice(scsi_card_getdevice(ui->comboBoxSCSI3->currentData().toInt()), 3);
|
||||
}
|
||||
|
||||
void SettingsStorageControllers::on_pushButtonSCSI4_clicked() {
|
||||
DeviceConfig::ConfigureDevice(scsi_card_getdevice(ui->comboBoxSCSI4->currentData().toInt()));
|
||||
DeviceConfig::ConfigureDevice(scsi_card_getdevice(ui->comboBoxSCSI4->currentData().toInt()), 4);
|
||||
}
|
||||
|
||||
@@ -22,50 +22,20 @@ public slots:
|
||||
|
||||
private slots:
|
||||
void on_pushButtonSCSI4_clicked();
|
||||
|
||||
private slots:
|
||||
void on_pushButtonSCSI3_clicked();
|
||||
|
||||
private slots:
|
||||
void on_pushButtonSCSI2_clicked();
|
||||
|
||||
private slots:
|
||||
void on_pushButtonSCSI1_clicked();
|
||||
|
||||
private slots:
|
||||
void on_comboBoxSCSI4_currentIndexChanged(int index);
|
||||
|
||||
private slots:
|
||||
void on_comboBoxSCSI3_currentIndexChanged(int index);
|
||||
|
||||
private slots:
|
||||
void on_comboBoxSCSI2_currentIndexChanged(int index);
|
||||
|
||||
private slots:
|
||||
void on_comboBoxSCSI1_currentIndexChanged(int index);
|
||||
|
||||
private slots:
|
||||
void on_pushButtonQuaternaryIDE_clicked();
|
||||
|
||||
private slots:
|
||||
void on_pushButtonTertiaryIDE_clicked();
|
||||
|
||||
private slots:
|
||||
void on_pushButtonFD_clicked();
|
||||
|
||||
private slots:
|
||||
void on_pushButtonHD_clicked();
|
||||
|
||||
private slots:
|
||||
void on_checkBoxQuaternaryIDE_stateChanged(int arg1);
|
||||
|
||||
private slots:
|
||||
void on_checkBoxTertiaryIDE_stateChanged(int arg1);
|
||||
|
||||
private slots:
|
||||
void on_comboBoxFD_currentIndexChanged(int index);
|
||||
|
||||
private slots:
|
||||
void on_comboBoxHD_currentIndexChanged(int index);
|
||||
|
||||
private:
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#include "qt_softwarerenderer.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include <86box/86box.h>
|
||||
}
|
||||
#include <QPainter>
|
||||
|
||||
SoftwareRenderer::SoftwareRenderer(QWidget *parent) : QWidget(parent) {}
|
||||
@@ -8,6 +11,7 @@ void SoftwareRenderer::paintEvent(QPaintEvent *event) {
|
||||
(void) event;
|
||||
|
||||
QPainter painter(this);
|
||||
painter.setRenderHint(QPainter::SmoothPixmapTransform, video_filter_method > 0 ? true : false);
|
||||
painter.drawImage(QRect(0, 0, width(), height()), image, QRect(sx, sy, sw, sh));
|
||||
image = QImage();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user