This commit is contained in:
OBattler
2025-08-26 18:00:34 +02:00
35 changed files with 620 additions and 82 deletions

View File

@@ -231,6 +231,9 @@ int is_pcjr = 0; /* The current
int portable_mode = 0; /* We are running in portable mode
(global dirs = exe path) */
int monitor_edid = 0; /* (C) Which EDID to use. 0=default, 1=custom. */
char monitor_edid_path[1024] = { 0 }; /* (C) Path to custom EDID */
// Accelerator key array
struct accelKey acc_keys[NUM_ACCELS];

View File

@@ -501,6 +501,11 @@ load_video(void)
p = "none";
gfxcard[i] = video_get_video_from_internal_name(p);
}
monitor_edid = ini_section_get_int(cat, "monitor_edid", 0);
monitor_edid_path[0] = 0;
strncpy(monitor_edid_path, ini_section_get_string(cat, "monitor_edid_path", (char*)""), sizeof(monitor_edid_path));
}
/* Load "Input Devices" section. */
@@ -2487,6 +2492,15 @@ save_video(void)
ini_section_set_string(cat, "gfxcard",
video_get_internal_name(gfxcard[0]));
if (monitor_edid)
ini_section_set_int(cat, "monitor_edid", monitor_edid);
else
ini_section_delete_var(cat, "monitor_edid");
if (monitor_edid_path[0])
ini_section_set_string(cat, "monitor_edid_path", monitor_edid_path);
else
ini_section_delete_var(cat, "monitor_edid_path");
if (vid_cga_comp_brightness)
ini_section_set_int(cat, "vid_cga_comp_brightness", vid_cga_comp_brightness);

View File

@@ -201,6 +201,9 @@ extern int start_vmm; /* the current execution will start the manag
extern int portable_mode; /* we are running in portable mode
(global dirs = exe path) */
extern int monitor_edid; /* (C) Which EDID to use. 0=default, 1=custom. */
extern char monitor_edid_path[1024]; /* (C) Path to custom EDID */
#ifndef USE_NEW_DYNAREC
extern FILE *stdlog; /* file to log output to */
#endif

View File

@@ -52,7 +52,8 @@ enum {
STRING_GHOSTPCL_ERROR_TITLE, /* "Unable to initialize GhostPCL" */
STRING_GHOSTPCL_ERROR_DESC, /* "gpcl6dll32.dll/gpcl6dll64.dll/libgpcl6 is required..." */
STRING_ESCP_ERROR_TITLE, /* "Unable to find Dot-Matrix fonts" */
STRING_ESCP_ERROR_DESC /* "TrueType fonts in the \"roms/printer/fonts\" directory..." */
STRING_ESCP_ERROR_DESC, /* "TrueType fonts in the \"roms/printer/fonts\" directory..." */
STRING_EDID_TOO_LARGE, /* "EDID file \"%ls\" is too large (%lld bytes)." */
};
/* The Win32 API uses _wcsicmp. */

View File

@@ -22,5 +22,6 @@
extern void *ddc_init(void *i2c);
extern void ddc_close(void *eeprom);
extern void *ddc_create_default_edid(ssize_t* size_out);
#endif /*EMU_VID_DDC_H*/

View File

@@ -2954,3 +2954,15 @@ msgstr ""
msgid "CGA composite settings"
msgstr ""
msgid "Monitor EDID"
msgstr ""
msgid "Export..."
msgstr ""
msgid "Export EDID"
msgid ""
msgid "EDID file \"%ls\" is too large."
msgstr ""

View File

@@ -2954,3 +2954,15 @@ msgstr "Nastavení kompozitního výstupu &CGA..."
msgid "CGA composite settings"
msgstr "Nastavení kompozitního výstupu CGA"
msgid "Monitor EDID"
msgstr "EDID monitoru"
msgid "Export..."
msgstr "Exportovat..."
msgid "Export EDID"
msgstr "Exportovat EDID"
msgid "EDID file \"%ls\" is too large."
msgstr "Soubor EDID \"%ls\" je příliš velký."

View File

@@ -2954,3 +2954,15 @@ msgstr "Optionen des &CGA-Composite-Modus..."
msgid "CGA composite settings"
msgstr "Optionen des CGA-Composite-Modus"
msgid "Monitor EDID"
msgstr "EDID des Monitors"
msgid "Export..."
msgstr "Exportieren..."
msgid "Export EDID"
msgstr "EDID exportieren"
msgid "EDID file \"%ls\" is too large."
msgstr "Die EDID-Datei \"%ls\" ist zu groß."

View File

@@ -2954,3 +2954,15 @@ msgstr "Configuración del modo compuesto &CGA..."
msgid "CGA composite settings"
msgstr "Configuración del modo compuesto CGA"
msgid "Monitor EDID"
msgstr "EDID du moniteur"
msgid "Export..."
msgstr "Exporter..."
msgid "Export EDID"
msgstr "EDID exportieren"
msgid "EDID file \"%ls\" is too large."
msgstr "El archivo EDID \"%ls\" es demasiado grande."

View File

@@ -2954,3 +2954,6 @@ msgstr "&CGA:n komposiittiasetukset..."
msgid "CGA composite settings"
msgstr "CGA:n komposiittiasetukset"
msgid "EDID file \"%ls\" is too large."
msgstr "EDID-tiedosto \"%ls\" on liian suuri."

View File

@@ -2954,3 +2954,6 @@ msgstr "Réglages du mode composite &CGA..."
msgid "CGA composite settings"
msgstr "Réglages du mode composite CGA"
msgid "EDID file \"%ls\" is too large."
msgstr "Le fichier EDID \"%ls\" est trop volumineux."

View File

@@ -2954,3 +2954,15 @@ msgstr "Opcije kompozitnog načina &CGA..."
msgid "CGA composite settings"
msgstr "Opcije kompozitnog načina CGA"
msgid "Monitor EDID"
msgstr "EDID monitora"
msgid "Export..."
msgstr "Izvoz..."
msgid "Export EDID"
msgstr "Izvoz EDID-a"
msgid "EDID file \"%ls\" is too large."
msgstr "EDID datoteka \"%ls\" je prevelika."

View File

@@ -2954,3 +2954,15 @@ msgstr "Impostazioni video composito &CGA..."
msgid "CGA composite settings"
msgstr "Impostazioni video composito CGA"
msgid "Monitor EDID"
msgstr "EDID del monitor"
msgid "Export..."
msgstr "Esporta..."
msgid "Export EDID"
msgstr "Esporta EDID"
msgid "EDID file \"%ls\" is too large."
msgstr "Il file EDID \"%ls\" è troppo grande."

View File

@@ -2954,3 +2954,15 @@ msgstr "CGA複合モードの設定...(&C)"
msgid "CGA composite settings"
msgstr "CGA複合モードの設定"
msgid "Monitor EDID"
msgstr "モニターのEDID"
msgid "Export..."
msgstr "エクスポート..."
msgid "Export EDID"
msgstr "EDIDのエクスポート"
msgid "EDID file \"%ls\" is too large."
msgstr "EDIDファイル \"%ls\" が大きすぎます。"

View File

@@ -2954,3 +2954,15 @@ msgstr "CGA 복합 모드의 설정...(&C)"
msgid "CGA composite settings"
msgstr "CGA 복합 모드의 설정"
msgid "Monitor EDID"
msgstr "모니터의 EDID"
msgid "Export..."
msgstr "수출..."
msgid "Export EDID"
msgstr "EDID 내보내기"
msgid "EDID file \"%ls\" is too large."
msgstr "EDID 파일 \"%ls\"가 너무 큽니다."

View File

@@ -2954,3 +2954,15 @@ msgstr "&CGA-komposittinnstillinger..."
msgid "CGA composite settings"
msgstr "CGA-komposittinnstillinger"
msgid "Monitor EDID"
msgstr "EDID for skjerm"
msgid "Export..."
msgstr "Eksporter..."
msgid "Export EDID"
msgstr "Eksporter EDID"
msgid "EDID file \"%ls\" is too large."
msgstr "EDID-filen \"%ls\" er for stor."

View File

@@ -2954,3 +2954,15 @@ msgstr "Instellingen van de &CGA-compositemodus..."
msgid "CGA composite settings"
msgstr "Instellingen van de CGA-compositemodus"
msgid "Monitor EDID"
msgstr "EDID-monitor"
msgid "Export..."
msgstr "Exporteren..."
msgid "Export EDID"
msgstr "EDID exporteren"
msgid "EDID file \"%ls\" is too large."
msgstr "Het EDID-bestand \"%ls\" is te groot."

View File

@@ -2954,3 +2954,15 @@ msgstr "Ustawienia trybu kompozytowego &CGA..."
msgid "CGA composite settings"
msgstr "Ustawienia trybu kompozytowego CGA"
msgid "Monitor EDID"
msgstr "EDID monitora"
msgid "Export..."
msgstr "Eksportuj..."
msgid "Export EDID"
msgstr "Eksportuj EDID"
msgid "EDID file \"%ls\" is too large."
msgstr "Plik EDID \"%ls\" jest zbyt duży."

View File

@@ -2954,3 +2954,15 @@ msgstr "Configurações do modo composto &CGA..."
msgid "CGA composite settings"
msgstr "Configurações do modo composto CGA"
msgid "Monitor EDID"
msgstr "EDID do monitor"
msgid "Export..."
msgstr "Exportar..."
msgid "Export EDID"
msgstr "Exportar EDID"
msgid "EDID file \"%ls\" is too large."
msgstr "O arquivo EDID \"%ls\" é muito grande."

View File

@@ -2954,3 +2954,15 @@ msgstr "Definições do modo compósito &CGA..."
msgid "CGA composite settings"
msgstr "Definições do modo compósito CGA"
msgid "Monitor EDID"
msgstr "EDID do monitor"
msgid "Export..."
msgstr "Exportar..."
msgid "Export EDID"
msgstr "Exportar EDID"
msgid "EDID file \"%ls\" is too large."
msgstr "O ficheiro EDID \"%ls\" é demasiado grande."

View File

@@ -2954,3 +2954,15 @@ msgstr "Настройки композитного видео &CGA..."
msgid "CGA composite settings"
msgstr "Настройки композитного видео CGA"
msgid "Monitor EDID"
msgstr "EDID монитора"
msgid "Export..."
msgstr "Экспорт..."
msgid "Export EDID"
msgstr "Экспорт EDID"
msgid "EDID file \"%ls\" is too large."
msgstr "Файл EDID \"%ls\" слишком велик."

View File

@@ -2954,3 +2954,15 @@ msgstr "Nastavenia kompozitného režimu &CGA..."
msgid "CGA composite settings"
msgstr "Nastavenia kompozitného režimu CGA"
msgid "Monitor EDID"
msgstr "EDID monitora"
msgid "Export..."
msgstr "Exportovať..."
msgid "Export EDID"
msgstr "Exportovať EDID"
msgid "EDID file \"%ls\" is too large."
msgstr "Súbor EDID \"%ls\" je príliš veľký."

View File

@@ -2954,3 +2954,15 @@ msgstr "Nastavitve kompozitnega načina &CGA..."
msgid "CGA composite settings"
msgstr "Nastavitve kompozitnega načina CGA"
msgid "Monitor EDID"
msgstr "EDID monitorja"
msgid "Export..."
msgstr "Izvoz..."
msgid "Export EDID"
msgstr "Izvoz EDID"
msgid "EDID file \"%ls\" is too large."
msgstr "Datoteka EDID \"%ls\" je prevelika."

View File

@@ -2954,3 +2954,15 @@ msgstr "Inställningar för &CGA-kompositläget..."
msgid "CGA composite settings"
msgstr "Inställningar för CGA-kompositläget"
msgid "Monitor EDID"
msgstr "EDID för bildskärm"
msgid "Export..."
msgstr "Exportera..."
msgid "Export EDID"
msgstr "Exportera EDID"
msgid "EDID file \"%ls\" is too large."
msgstr "EDID-filen \"%ls\" är för stor."

View File

@@ -2954,3 +2954,15 @@ msgstr "&CGA kompozit modunun ayarları..."
msgid "CGA composite settings"
msgstr "CGA kompozit modunun ayarları"
msgid "Monitor EDID"
msgstr "Monitörün EDID'si"
msgid "Export..."
msgstr "Dışa aktar..."
msgid "Export EDID"
msgstr "EDID'i dışa aktar"
msgid "EDID file \"%ls\" is too large."
msgstr "EDID dosyası \"%ls\" çok büyük."

View File

@@ -2954,3 +2954,15 @@ msgstr "Налаштування композитного відео &CGA..."
msgid "CGA composite settings"
msgstr "Налаштування композитного відео CGA"
msgid "Monitor EDID"
msgstr "EDID монітора"
msgid "Export..."
msgstr "Експорт..."
msgid "Export EDID"
msgstr "Експорт EDID"
msgid "EDID file \"%ls\" is too large."
msgstr "Файл EDID \"%ls\" занадто великий."

View File

@@ -2954,3 +2954,15 @@ msgstr "Cài đặt chế độ tổng hợp &CGA..."
msgid "CGA composite settings"
msgstr "Cài đặt chế độ tổng hợp CGA"
msgid "Monitor EDID"
msgstr "EDID của màn hình"
msgid "Export..."
msgstr "Xuất khẩu..."
msgid "Export EDID"
msgstr "Xuất khẩu EDID"
msgid "EDID file \"%ls\" is too large."
msgstr "Tệp EDID \"%ls\" quá lớn."

View File

@@ -2954,3 +2954,15 @@ msgstr "CGA 复合模式设置...(&C)"
msgid "CGA composite settings"
msgstr "CGA 复合模式设置"
msgid "Monitor EDID"
msgstr "显示器的EDID"
msgid "Export..."
msgstr "导出..."
msgid "Export EDID"
msgstr "导出EDID"
msgid "EDID file \"%ls\" is too large."
msgstr "EDID文件 \"%ls\" 过大。"

View File

@@ -2954,3 +2954,15 @@ msgstr "CGA 複合模式的設定...(&C)"
msgid "CGA composite settings"
msgstr "CGA 複合模式的設定"
msgid "Monitor EDID"
msgstr "監視器的 EDID"
msgid "Export..."
msgstr "出口..."
msgid "Export EDID"
msgstr "匯出 EDID"
msgid "EDID file \"%ls\" is too large."
msgstr "EDID 檔案 \"%ls\" 太大。"

View File

@@ -649,6 +649,7 @@ ProgSettings::reloadStrings()
translatedstrings[STRING_NET_ERROR_DESC] = QCoreApplication::translate("", "The network configuration will be switched to the null driver").toStdWString();
translatedstrings[STRING_ESCP_ERROR_TITLE] = QCoreApplication::translate("", "Unable to find Dot-Matrix fonts").toStdWString();
translatedstrings[STRING_ESCP_ERROR_DESC] = QCoreApplication::translate("", "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer.").toStdWString();
translatedstrings[STRING_EDID_TOO_LARGE] = QCoreApplication::translate("", "EDID file \"%ls\" is too large.").toStdWString();
}
wchar_t *

View File

@@ -17,7 +17,11 @@
#include "qt_settingsdisplay.hpp"
#include "ui_qt_settingsdisplay.h"
#include "qt_util.hpp"
#include <QDebug>
#include <QFileDialog>
#include <QStringBuilder>
extern "C" {
#include <86box/86box.h>
@@ -27,6 +31,7 @@ extern "C" {
#include <86box/vid_8514a_device.h>
#include <86box/vid_xga_device.h>
#include <86box/vid_ps55da2.h>
#include <86box/vid_ddc.h>
}
#include "qt_deviceconfig.hpp"
@@ -40,6 +45,9 @@ SettingsDisplay::SettingsDisplay(QWidget *parent)
for (uint8_t i = 0; i < GFXCARD_MAX; i ++)
videoCard[i] = gfxcard[i];
ui->lineEdit->setFilter(tr("EDID") % util::DlgFilter({ "bin", "dat", "edid" }) % tr("All files") % util::DlgFilter({ "*" }, true));
onCurrentMachineChanged(machine);
}
@@ -67,6 +75,9 @@ SettingsDisplay::save()
ibm8514_standalone_enabled = ui->checkBox8514->isChecked() ? 1 : 0;
xga_standalone_enabled = ui->checkBoxXga->isChecked() ? 1 : 0;
da2_standalone_enabled = ui->checkBoxDa2->isChecked() ? 1 : 0;
monitor_edid = ui->radioButtonCustom->isChecked() ? 1 : 0;
strncpy(monitor_edid_path, ui->lineEdit->fileName().toUtf8().data(), sizeof(monitor_edid_path) - 1);
}
void
@@ -121,6 +132,11 @@ SettingsDisplay::onCurrentMachineChanged(int machineId)
for (uint8_t i = 1; i < GFXCARD_MAX; i ++)
if (gfxcard[i] == 0)
ui->pushButtonConfigureVideoSecondary->setEnabled(false);
ui->radioButtonDefault->setChecked(monitor_edid == 0);
ui->radioButtonCustom->setChecked(monitor_edid == 1);
ui->lineEdit->setFileName(monitor_edid_path);
ui->lineEdit->setEnabled(monitor_edid == 1);
}
void
@@ -305,3 +321,33 @@ SettingsDisplay::on_pushButtonConfigureVideoSecondary_clicked()
auto *device = video_card_getdevice(ui->comboBoxVideoSecondary->currentData().toInt());
DeviceConfig::ConfigureDevice(device);
}
void SettingsDisplay::on_radioButtonDefault_clicked()
{
ui->radioButtonDefault->setChecked(true);
ui->radioButtonCustom->setChecked(false);
ui->lineEdit->setEnabled(false);
}
void SettingsDisplay::on_radioButtonCustom_clicked()
{
ui->radioButtonDefault->setChecked(false);
ui->radioButtonCustom->setChecked(true);
ui->lineEdit->setEnabled(true);
}
void SettingsDisplay::on_pushButtonExportDefault_clicked()
{
auto str = QFileDialog::getSaveFileName(this, tr("Export EDID..."));
if (!str.isEmpty()) {
QFile file(str);
if (file.open(QFile::WriteOnly)) {
ssize_t size = 0;
auto bytes = ddc_create_default_edid(&size);
file.write((char*)bytes, size);
file.close();
}
}
}

View File

@@ -40,6 +40,12 @@ private slots:
void on_checkBoxDa2_stateChanged(int state);
void on_pushButtonConfigureDa2_clicked();
void on_radioButtonDefault_clicked();
void on_radioButtonCustom_clicked();
void on_pushButtonExportDefault_clicked();
private:
Ui::SettingsDisplay *ui;
int machineId = 0;

View File

@@ -7,13 +7,13 @@
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<height>466</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout" columnstretch="2,1,1">
<layout class="QGridLayout" name="gridLayout" columnstretch="2,0,0">
<property name="leftMargin">
<number>0</number>
</property>
@@ -26,45 +26,27 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="labelVideo">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxVoodoo">
<property name="text">
<string>Video:</string>
<string>Voodoo 1 or 2 Graphics</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QComboBox" name="comboBoxVideo">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maxVisibleItems">
<number>30</number>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="pushButtonConfigureVideo">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item row="7" column="2">
<widget class="QPushButton" name="pushButtonConfigureDa2">
<property name="text">
<string>Configure</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="checkBox8514">
<property name="text">
<string>IBM 8514/A Graphics</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelVideoSecondary">
<property name="sizePolicy">
@@ -78,6 +60,83 @@
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QPushButton" name="pushButtonConfigure8514">
<property name="text">
<string>Configure</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QPushButton" name="pushButtonConfigureXga">
<property name="text">
<string>Configure</string>
</property>
</widget>
</item>
<item row="8" column="0" colspan="3">
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Monitor EDID</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QRadioButton" name="radioButtonDefault">
<property name="text">
<string>Default</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonExportDefault">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Export...</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="sizeConstraint">
<enum>QLayout::SizeConstraint::SetNoConstraint</enum>
</property>
<item>
<widget class="QRadioButton" name="radioButtonCustom">
<property name="text">
<string>Custom...</string>
</property>
</widget>
</item>
<item>
<widget class="FileField" name="lineEdit" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QComboBox" name="comboBoxVideoSecondary">
<property name="sizePolicy">
@@ -91,19 +150,18 @@
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QPushButton" name="pushButtonConfigureVideoSecondary">
<property name="text">
<string>Configure</string>
<item row="10" column="0" colspan="3">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxVoodoo">
<property name="text">
<string>Voodoo 1 or 2 Graphics</string>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</widget>
</spacer>
</item>
<item row="4" column="2">
<widget class="QPushButton" name="pushButtonConfigureVoodoo">
@@ -112,20 +170,52 @@
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="checkBox8514">
<item row="1" column="2">
<widget class="QPushButton" name="pushButtonConfigureVideo">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>IBM 8514/A Graphics</string>
<string>Configure</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QPushButton" name="pushButtonConfigure8514">
<item row="0" column="0">
<widget class="QLabel" name="labelVideo">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Video:</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QPushButton" name="pushButtonConfigureVideoSecondary">
<property name="text">
<string>Configure</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QComboBox" name="comboBoxVideo">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maxVisibleItems">
<number>30</number>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxXga">
<property name="text">
@@ -133,13 +223,6 @@
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QPushButton" name="pushButtonConfigureXga">
<property name="text">
<string>Configure</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QCheckBox" name="checkBoxDa2">
<property name="text">
@@ -147,28 +230,26 @@
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QPushButton" name="pushButtonConfigureDa2">
<property name="text">
<string>Configure</string>
<item row="9" column="0" colspan="3">
<widget class="QWidget" name="widget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="8" column="0" colspan="3">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>FileField</class>
<extends>QWidget</extends>
<header>qt_filefield.hpp</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -23,6 +23,9 @@
#include <math.h>
#include <86box/86box.h>
#include <86box/i2c.h>
#include <86box/vid_ddc.h>
#include <86box/plat.h>
#include <86box/ui.h>
#define PIXEL_MM(px) (((px) * 25.4) / 96.0)
#define STANDARD_TIMING(slot, width, aspect_ratio, refresh) \
@@ -126,8 +129,8 @@ typedef struct {
uint8_t padding[15], checksum2;
} edid_t;
void *
ddc_init(void *i2c)
void*
ddc_create_default_edid(ssize_t* size_out)
{
edid_t *edid = malloc(sizeof(edid_t));
memset(edid, 0, sizeof(edid_t));
@@ -222,7 +225,94 @@ ddc_init(void *i2c)
edid->checksum2 += edid_bytes[c];
edid->checksum2 = 256 - edid->checksum2;
return i2c_eeprom_init(i2c, 0x50, edid_bytes, sizeof(edid_t), 0);
if (size_out)
*size_out = sizeof(edid_t);
return edid;
}
void *
ddc_init(void *i2c)
{
ssize_t edid_size = 0;
uint8_t* edid_bytes = NULL;
if (monitor_edid == 1 && monitor_edid_path[0]) {
FILE* file = plat_fopen(monitor_edid_path, "rb");
if (!file)
goto default_init;
if (fseek(file, 0, SEEK_END) == -1) {
fclose(file);
goto default_init;
}
edid_size = ftell(file);
fseek(file, 0, SEEK_SET);
if (edid_size <= 0) {
fclose(file);
goto default_init;
}
if (edid_size > 256) {
wchar_t errmsg[2048] = { 0 };
wchar_t path[2048] = { 0 };
#ifdef _WIN32
mbstoc16s(path, monitor_edid_path, sizeof_w(path));
#else
mbstowcs(path, monitor_edid_path, sizeof_w(path));
#endif
swprintf(errmsg, sizeof_w(errmsg), plat_get_string(STRING_EDID_TOO_LARGE), path);
ui_msgbox_header(MBX_ERROR, L"EDID", errmsg);
fclose(file);
goto default_init;
}
edid_bytes = calloc(1, edid_size);
if (!edid_bytes) {
fclose(file);
goto default_init;
}
if (fread(edid_bytes, edid_size, 1, file) <= 0) {
free(edid_bytes);
fclose(file);
goto default_init;
}
if (edid_size < 128) {
edid_bytes = realloc(edid_bytes, 128);
edid_size = 128;
} else if (edid_size < 256) {
edid_bytes = realloc(edid_bytes, 256);
edid_size = 256;
}
{
int checksum = 0;
for (uint8_t c = 0; c < 127; c++)
checksum += edid_bytes[c];
edid_bytes[127] = 256 - checksum;
if (edid_size == 256) {
checksum = 0;
for (uint8_t c = 128; c < 255; c++) {
checksum += edid_bytes[c];
}
edid_bytes[255] = 256 - checksum;
}
}
fclose(file);
return i2c_eeprom_init(i2c, 0x50, edid_bytes, edid_size, 0);
}
default_init:
edid_size = sizeof(edid_t);
edid_bytes = ddc_create_default_edid(&edid_size);
return i2c_eeprom_init(i2c, 0x50, edid_bytes, edid_size, 0);
}
void

View File

@@ -1146,7 +1146,6 @@ svga_recalctimings(svga_t *svga)
if (dev->dispofftime < TIMER_USEC)
dev->dispofftime = TIMER_USEC;
svga->monitor->mon_interlace = !!dev->interlace;
ibm8514_set_poll(svga);
} else
svga_set_poll(svga);
@@ -1165,7 +1164,6 @@ svga_recalctimings(svga_t *svga)
if (xga->dispofftime < TIMER_USEC)
xga->dispofftime = TIMER_USEC;
svga->monitor->mon_interlace = !!xga->interlace;
xga_set_poll(svga);
} else
svga_set_poll(svga);
@@ -1184,7 +1182,6 @@ svga_recalctimings(svga_t *svga)
if (dev->dispofftime < TIMER_USEC)
dev->dispofftime = TIMER_USEC;
svga->monitor->mon_interlace = !!dev->interlace;
ibm8514_set_poll(svga);
} else if (xga->on) {
_dispofftime_xga = disptime_xga - _dispontime_xga;
@@ -1198,7 +1195,6 @@ svga_recalctimings(svga_t *svga)
if (xga->dispofftime < TIMER_USEC)
xga->dispofftime = TIMER_USEC;
svga->monitor->mon_interlace = !!xga->interlace;
xga_set_poll(svga);
} else
svga_set_poll(svga);
@@ -1253,8 +1249,34 @@ svga_recalctimings(svga_t *svga)
}
svga->monitor->mon_interlace = 0;
if (!svga->override && svga->interlace)
svga->monitor->mon_interlace = 1;
if (!svga->override) {
switch (set_timer) {
default:
case 0: /*VGA only*/
svga->monitor->mon_interlace = !!svga->interlace;
break;
case 1: /*Plus 8514/A*/
if (dev->on)
svga->monitor->mon_interlace = !!dev->interlace;
else
svga->monitor->mon_interlace = !!svga->interlace;
break;
case 2: /*Plus XGA*/
if (xga->on)
svga->monitor->mon_interlace = !!xga->interlace;
else
svga->monitor->mon_interlace = !!svga->interlace;
break;
case 3: /*Plus 8514/A and XGA*/
if (dev->on)
svga->monitor->mon_interlace = !!dev->interlace;
else if (xga->on)
svga->monitor->mon_interlace = !!xga->interlace;
else
svga->monitor->mon_interlace = !!svga->interlace;
break;
}
}
}
static void