Allow one to enable/disable unit tester exit
Memo to self: Hardware renderers often exit in a silent segfault. Look into this at some point.
This commit is contained in:
@@ -114,10 +114,18 @@ static const struct unittester_state unittester_defaults = {
|
|||||||
.cmd_id = UT_CMD_NOOP,
|
.cmd_id = UT_CMD_NOOP,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const device_config_t unittester_config[] = {
|
||||||
|
{ .name = "exit_enabled",
|
||||||
|
.description = "Enable 0x04 \"Exit 86Box\" command",
|
||||||
|
.type = CONFIG_BINARY,
|
||||||
|
.default_int = 1,
|
||||||
|
.default_string = "" },
|
||||||
|
{ .type = CONFIG_END }
|
||||||
|
};
|
||||||
|
|
||||||
/* Kept separate, as we will be reusing this object */
|
/* Kept separate, as we will be reusing this object */
|
||||||
static bitmap_t *unittester_screen_buffer = NULL;
|
static bitmap_t *unittester_screen_buffer = NULL;
|
||||||
|
|
||||||
/* FIXME: This needs a config option! --GM */
|
|
||||||
static bool unittester_exit_enabled = true;
|
static bool unittester_exit_enabled = true;
|
||||||
|
|
||||||
#ifdef ENABLE_UNITTESTER_LOG
|
#ifdef ENABLE_UNITTESTER_LOG
|
||||||
@@ -572,10 +580,13 @@ unittester_trigger_write(UNUSED(uint16_t port), uint8_t val, UNUSED(void *priv))
|
|||||||
static void *
|
static void *
|
||||||
unittester_init(UNUSED(const device_t *info))
|
unittester_init(UNUSED(const device_t *info))
|
||||||
{
|
{
|
||||||
|
unittester = (struct unittester_state) unittester_defaults;
|
||||||
|
|
||||||
|
unittester_exit_enabled = !!device_get_config_int("exit_enabled");
|
||||||
|
|
||||||
if (unittester_screen_buffer == NULL)
|
if (unittester_screen_buffer == NULL)
|
||||||
unittester_screen_buffer = create_bitmap(2048, 2048);
|
unittester_screen_buffer = create_bitmap(2048, 2048);
|
||||||
|
|
||||||
unittester = (struct unittester_state) unittester_defaults;
|
|
||||||
io_sethandler(unittester.trigger_port, 1, NULL, NULL, NULL, unittester_trigger_write, NULL, NULL, NULL);
|
io_sethandler(unittester.trigger_port, 1, NULL, NULL, NULL, unittester_trigger_write, NULL, NULL, NULL);
|
||||||
|
|
||||||
unittester_log("[UT] 86Box Unit Tester initialised\n");
|
unittester_log("[UT] 86Box Unit Tester initialised\n");
|
||||||
@@ -611,5 +622,5 @@ const device_t unittester_device = {
|
|||||||
{ .available = NULL },
|
{ .available = NULL },
|
||||||
.speed_changed = NULL,
|
.speed_changed = NULL,
|
||||||
.force_redraw = NULL,
|
.force_redraw = NULL,
|
||||||
.config = NULL
|
.config = unittester_config,
|
||||||
};
|
};
|
||||||
|
@@ -23,6 +23,7 @@ extern "C" {
|
|||||||
#include <86box/machine.h>
|
#include <86box/machine.h>
|
||||||
#include <86box/isamem.h>
|
#include <86box/isamem.h>
|
||||||
#include <86box/isartc.h>
|
#include <86box/isartc.h>
|
||||||
|
#include <86box/unittester.h>
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "qt_deviceconfig.hpp"
|
#include "qt_deviceconfig.hpp"
|
||||||
@@ -199,3 +200,9 @@ SettingsOtherPeripherals::on_pushButtonConfigureCard4_clicked()
|
|||||||
{
|
{
|
||||||
DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard4->currentData().toInt()), 4, qobject_cast<Settings *>(Settings::settings));
|
DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard4->currentData().toInt()), 4, qobject_cast<Settings *>(Settings::settings));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SettingsOtherPeripherals::on_pushButtonConfigureUT_clicked()
|
||||||
|
{
|
||||||
|
DeviceConfig::ConfigureDevice(&unittester_device);
|
||||||
|
}
|
||||||
|
@@ -30,6 +30,7 @@ private slots:
|
|||||||
void on_comboBoxCard1_currentIndexChanged(int index);
|
void on_comboBoxCard1_currentIndexChanged(int index);
|
||||||
void on_pushButtonConfigureRTC_clicked();
|
void on_pushButtonConfigureRTC_clicked();
|
||||||
void on_comboBoxRTC_currentIndexChanged(int index);
|
void on_comboBoxRTC_currentIndexChanged(int index);
|
||||||
|
void on_pushButtonConfigureUT_clicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::SettingsOtherPeripherals *ui;
|
Ui::SettingsOtherPeripherals *ui;
|
||||||
|
@@ -190,10 +190,27 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="checkBoxUnitTester">
|
<widget class="QCheckBox" name="checkBoxUnitTester">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>86Box unit tester</string>
|
<string>86Box Unit Tester</string>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButtonConfigureUT">
|
||||||
|
<property name="text">
|
||||||
|
<string>Configure</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Reference in New Issue
Block a user