@@ -18,6 +18,7 @@

#include <QtWidgets/QMessageBox>
#include <QtCore/QFileInfo>
#include "dlgCmdLineHelp.hpp"
#include "info.h"
#include "settings.h"
#include "cmd_line.h"
@@ -66,6 +67,7 @@ static struct _cl_option {
{ "samplerate", req_arg, "l"},
{ "channels", req_arg, "c"},
{ "stereo-delay", req_arg, "d"},
{ "reverse-bits-dpcm", req_arg, 0 },
{ "swap-duty", req_arg, 0 },
{ "swap-emphasis", req_arg, 0 },
{ "gamegenie", req_arg, "g"},
@@ -145,7 +147,9 @@ BYTE cmd_line_parse(int argc, uTCHAR **argv) {
switch (opt) {
case 0:
// long options
if (key == "swap-duty") {
if (key == "reverse-bits-dpcm") {
set_int(cfg_from_file.reverse_bits_dpcm, SET_REVERSE_BITS_DPCM);
} else if (key == "swap-duty") {
set_int(cfg_from_file.swap_duty, SET_SWAP_DUTY);
} else if (key == "swap-emphasis") {
set_int(cfg_from_file.disable_swap_emphasis_pal, SET_SWAP_EMPHASIS_PAL);
@@ -294,124 +298,8 @@ BYTE cmd_line_check_portable(int argc, uTCHAR **argv) {
}

static void usage(QString name) {
QMessageBox *box = new QMessageBox();
uTCHAR *usage_string;
const uTCHAR *istructions = {
uL("Usage: %1 [options] file...\n\n")
uL("Options:\n")
uL("-h, --help print this help\n")
uL("-V, --version print the version\n")
uL(" --portable start in portable mode\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
#if defined (WITH_OPENGL)
uL("" uPERCENTs "\n")
#endif
};

usage_string = (uTCHAR *)malloc(1024 * 9);
usnprintf(usage_string, 1024 * 9, istructions,
main_cfg[SET_MODE].hlp,
main_cfg[SET_SCALE].hlp,
main_cfg[SET_PAR].hlp,
main_cfg[SET_PAR_SOFT_STRETCH].hlp,
main_cfg[SET_OVERSCAN_BLACK_BORDERS].hlp,
main_cfg[SET_OVERSCAN_BLACK_BORDERS_FSCR].hlp,
main_cfg[SET_OVERSCAN_DEFAULT].hlp,
main_cfg[SET_FILTER].hlp,
main_cfg[SET_NTSC_FORMAT].hlp,
main_cfg[SET_SHADER].hlp,
main_cfg[SET_PALETTE].hlp,
main_cfg[SET_SWAP_EMPHASIS_PAL].hlp,
main_cfg[SET_VSYNC].hlp,
main_cfg[SET_INTERPOLATION].hlp,
main_cfg[SET_TEXT_ON_SCREEN].hlp,
main_cfg[SET_INPUT_DISPLAY].hlp,
main_cfg[SET_DISABLE_TV_NOISE].hlp,
main_cfg[SET_DISABLE_SEPIA_PAUSE].hlp,
#if defined (WITH_OPENGL)
main_cfg[SET_DISABLE_SRGB_FBO].hlp,
#endif
main_cfg[SET_OVERSCAN_BRD_NTSC].hlp,
main_cfg[SET_OVERSCAN_BRD_PAL].hlp,
main_cfg[SET_FULLSCREEN].hlp,
main_cfg[SET_FULLSCREEN_IN_WINDOW].hlp,
main_cfg[SET_INTEGER_FULLSCREEN].hlp,
main_cfg[SET_STRETCH_FULLSCREEN].hlp,
main_cfg[SET_SCREEN_ROTATION].hlp,
main_cfg[SET_AUDIO_OUTPUT_DEVICE].hlp,
main_cfg[SET_AUDIO].hlp,
main_cfg[SET_AUDIO_BUFFER_FACTOR].hlp,
main_cfg[SET_SAMPLERATE].hlp,
main_cfg[SET_CHANNELS].hlp,
main_cfg[SET_STEREO_DELAY].hlp,
main_cfg[SET_SWAP_DUTY].hlp,
main_cfg[SET_HIDE_SPRITES].hlp,
main_cfg[SET_HIDE_BACKGROUND].hlp,
main_cfg[SET_UNLIMITED_SPRITES].hlp,
main_cfg[SET_BCK_PAUSE].hlp,
main_cfg[SET_CHEAT_MODE].hlp,
main_cfg[SET_GUI_LANGUAGE].hlp,
main_cfg[SET_REWIND_MINUTES].hlp
);

if (box->font().pointSize() > 9) {
QFont font;

font.setPointSize(9);
box->setFont(font);
}

box->setAttribute(Qt::WA_DeleteOnClose);
box->setWindowTitle(uQString(uL("" NAME)));

box->setWindowModality(Qt::WindowModal);

// monospace
box->setText("<pre>" + uQString(usage_string).arg(name) + "</pre>");

box->setStandardButtons(QMessageBox::Ok);
box->setDefaultButton(QMessageBox::Ok);
dlgCmdLineHelp *box = new dlgCmdLineHelp(0, name);

box->show();
box->exec();

free(usage_string);
}
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>dlgCmdLineHelp</class>
<widget class="QDialog" name="dlgCmdLineHelp">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>791</width>
<height>354</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<property name="windowIcon">
<iconset resource="resources.qrc">
<normaloff>:/icon/icons/application.png</normaloff>:/icon/icons/application.png</iconset>
</property>
<property name="sizeGripEnabled">
<bool>true</bool>
</property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_dlgCmdLineHelp">
<item>
<widget class="QTextEdit" name="textEdit_cmdLineHelp">
<property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::AdjustToContents</enum>
</property>
<property name="undoRedoEnabled">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="html">
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_Close">
<property name="text">
<string>Close</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icon/icons/turn_off.svg</normaloff>:/icon/icons/turn_off.svg</iconset>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="resources.qrc"/>
</resources>
<connections/>
</ui>
@@ -28,10 +28,17 @@
</property>
<item>
<layout class="QGridLayout" name="gridLayout_Audio">
<item row="1" column="1">
<widget class="QLabel" name="label_Output_Devices">
<item row="4" column="0">
<widget class="QLabel" name="icon_Channels">
<property name="text">
<string>Output Devices</string>
<string notr="true">Channels icon</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="icon_Output_Devices">
<property name="text">
<string notr="true">Output Devices icon</string>
</property>
</widget>
</item>
@@ -42,50 +49,84 @@
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QComboBox" name="comboBox_Sample_Rate">
<item row="11" column="0" colspan="3">
<widget class="QCheckBox" name="checkBox_Enable_Audio">
<property name="text">
<string>Enable Audio</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QComboBox" name="comboBox_Output_Devices">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>48000</string>
</property>
</item>
<item>
<property name="text">
<string>44100</string>
</property>
</item>
<item>
<property name="text">
<string>22050</string>
</property>
</item>
<item>
<property name="text">
<string>11025</string>
</property>
</item>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="icon_Sample_Rate">
<item row="10" column="0" colspan="3">
<widget class="QCheckBox" name="checkBox_Swap_Duty_Cycles">
<property name="text">
<string notr="true">Sample Rate icon</string>
<string>Swap Duty Cycles</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="icon_Output_Devices">
<item row="2" column="1">
<widget class="QLabel" name="label_Buffer_Size_factor">
<property name="text">
<string notr="true">Output Devices icon</string>
<string>Buffer Size factor</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_Output_Devices">
<property name="text">
<string>Output Devices</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_Channels_Delay">
<property name="text">
<string>Channels Delay</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="3">
<widget class="wdgAPUChannels" name="widget_APU_Channels" native="true"/>
</item>
<item row="0" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_Audio_settings">
<item>
<widget class="QLabel" name="label_Audio_settings">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Settings</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_Audio_settings">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="2">
<widget class="QComboBox" name="comboBox_Buffer_Size_factor">
<property name="sizePolicy">
@@ -146,41 +187,23 @@
</item>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_Sample_Rate">
<property name="text">
<string>Sample Rate</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QComboBox" name="comboBox_Output_Devices">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_Buffer_Size_factor">
<property name="text">
<string>Buffer Size factor</string>
<item row="12" column="0" colspan="3">
<spacer name="verticalSpacer_Misc">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="icon_Channels">
<property name="text">
<string notr="true">Channels icon</string>
<property name="sizeHint" stdset="0">
<size>
<width>385</width>
<height>154</height>
</size>
</property>
</widget>
</spacer>
</item>
<item row="5" column="0">
<widget class="QLabel" name="icon_Channels_Delay">
<item row="3" column="0">
<widget class="QLabel" name="icon_Sample_Rate">
<property name="text">
<string notr="true">Channels Delay icon</string>
<string notr="true">Sample Rate icon</string>
</property>
</widget>
</item>
@@ -209,60 +232,23 @@
</item>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_Channels_Delay">
<property name="text">
<string>Channels Delay</string>
</property>
</widget>
</item>
<item row="8" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_Audio_misc">
<item>
<widget class="QLabel" name="label_Audio_Misc">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Misc</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_Audio_Misc">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_Audio_settings">
<item row="6" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_APU_Channels">
<item>
<widget class="QLabel" name="label_Audio_settings">
<widget class="QLabel" name="label_APU_Channels">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Settings</string>
<string>APU Channels</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_Audio_settings">
<widget class="Line" name="line_APU_Channels">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -276,13 +262,10 @@
</item>
</layout>
</item>
<item row="7" column="0" colspan="3">
<widget class="wdgAPUChannels" name="widget_APU_Channels" native="true"/>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_Channels">
<item row="5" column="0">
<widget class="QLabel" name="icon_Channels_Delay">
<property name="text">
<string>Channels</string>
<string notr="true">Channels Delay icon</string>
</property>
</widget>
</item>
@@ -396,23 +379,67 @@
</item>
</widget>
</item>
<item row="6" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_APU_Channels">
<item row="3" column="2">
<widget class="QComboBox" name="comboBox_Sample_Rate">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<widget class="QLabel" name="label_APU_Channels">
<property name="text">
<string>48000</string>
</property>
</item>
<item>
<property name="text">
<string>44100</string>
</property>
</item>
<item>
<property name="text">
<string>22050</string>
</property>
</item>
<item>
<property name="text">
<string>11025</string>
</property>
</item>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_Sample_Rate">
<property name="text">
<string>Sample Rate</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_Channels">
<property name="text">
<string>Channels</string>
</property>
</widget>
</item>
<item row="8" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_Audio_misc">
<item>
<widget class="QLabel" name="label_Audio_Misc">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>APU Channels</string>
<string>Misc</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_APU_Channels">
<widget class="Line" name="line_Audio_Misc">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -427,32 +454,12 @@
</layout>
</item>
<item row="9" column="0" colspan="3">
<widget class="QCheckBox" name="checkBox_Swap_Duty_Cycles">
<property name="text">
<string>Swap Duty Cycles</string>
</property>
</widget>
</item>
<item row="10" column="0" colspan="3">
<widget class="QCheckBox" name="checkBox_Enable_Audio">
<widget class="QCheckBox" name="checkBox_Reverse_bits_DPCM">
<property name="text">
<string>Enable Audio</string>
<string>Reverse bits of DPCM</string>
</property>
</widget>
</item>
<item row="11" column="0" colspan="3">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>385</width>
<height>154</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
@@ -0,0 +1,149 @@
/*
* Copyright (C) 2010-2020 Fabio Cavallo (aka FHorse)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

#include "dlgCmdLineHelp.moc"
#include "info.h"
#include "settings.h"
#include "cmd_line.h"
#include "conf.h"
#include "version.h"
#include "gui.h"

dlgCmdLineHelp::dlgCmdLineHelp(QWidget *parent, QString name) : QDialog(parent) {
uTCHAR *usage_string;
const uTCHAR *istructions = {
uL("Usage: %1 [options] file...\n\n")
uL("Options:\n")
uL("-h, --help print this help\n")
uL("-V, --version print the version\n")
uL(" --portable start in portable mode\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
uL("" uPERCENTs "\n")
#if defined (WITH_OPENGL)
uL("" uPERCENTs "\n")
#endif
};

usage_string = (uTCHAR *)malloc(1024 * 9);
usnprintf(usage_string, 1024 * 9, istructions,
main_cfg[SET_MODE].hlp,
main_cfg[SET_SCALE].hlp,
main_cfg[SET_PAR].hlp,
main_cfg[SET_PAR_SOFT_STRETCH].hlp,
main_cfg[SET_OVERSCAN_BLACK_BORDERS].hlp,
main_cfg[SET_OVERSCAN_BLACK_BORDERS_FSCR].hlp,
main_cfg[SET_OVERSCAN_DEFAULT].hlp,
main_cfg[SET_FILTER].hlp,
main_cfg[SET_NTSC_FORMAT].hlp,
main_cfg[SET_SHADER].hlp,
main_cfg[SET_PALETTE].hlp,
main_cfg[SET_SWAP_EMPHASIS_PAL].hlp,
main_cfg[SET_VSYNC].hlp,
main_cfg[SET_INTERPOLATION].hlp,
main_cfg[SET_TEXT_ON_SCREEN].hlp,
main_cfg[SET_INPUT_DISPLAY].hlp,
main_cfg[SET_DISABLE_TV_NOISE].hlp,
main_cfg[SET_DISABLE_SEPIA_PAUSE].hlp,
#if defined (WITH_OPENGL)
main_cfg[SET_DISABLE_SRGB_FBO].hlp,
#endif
main_cfg[SET_OVERSCAN_BRD_NTSC].hlp,
main_cfg[SET_OVERSCAN_BRD_PAL].hlp,
main_cfg[SET_FULLSCREEN].hlp,
main_cfg[SET_FULLSCREEN_IN_WINDOW].hlp,
main_cfg[SET_INTEGER_FULLSCREEN].hlp,
main_cfg[SET_STRETCH_FULLSCREEN].hlp,
main_cfg[SET_SCREEN_ROTATION].hlp,
main_cfg[SET_AUDIO_OUTPUT_DEVICE].hlp,
main_cfg[SET_AUDIO].hlp,
main_cfg[SET_AUDIO_BUFFER_FACTOR].hlp,
main_cfg[SET_SAMPLERATE].hlp,
main_cfg[SET_CHANNELS].hlp,
main_cfg[SET_STEREO_DELAY].hlp,
main_cfg[SET_REVERSE_BITS_DPCM].hlp,
main_cfg[SET_SWAP_DUTY].hlp,
main_cfg[SET_HIDE_SPRITES].hlp,
main_cfg[SET_HIDE_BACKGROUND].hlp,
main_cfg[SET_UNLIMITED_SPRITES].hlp,
main_cfg[SET_BCK_PAUSE].hlp,
main_cfg[SET_CHEAT_MODE].hlp,
main_cfg[SET_GUI_LANGUAGE].hlp,
main_cfg[SET_REWIND_MINUTES].hlp
);

setupUi(this);

setAttribute(Qt::WA_DeleteOnClose);
setWindowTitle(uQString(uL("" NAME " ")) + tr("Command Line Help"));

if (font().pointSize() > 9) {
QFont font;

font.setPointSize(9);
setFont(font);
}

textEdit_cmdLineHelp->setHtml("<pre>" + uQString(usage_string).arg(name) + "</pre>");

connect(pushButton_Close, SIGNAL(clicked(bool)), this, SLOT(s_close_clicked(bool)));

free(usage_string);
}
dlgCmdLineHelp::~dlgCmdLineHelp() {}

void dlgCmdLineHelp::s_close_clicked(UNUSED(bool checked)) {
close();
}
@@ -0,0 +1,37 @@
/*
* Copyright (C) 2010-2020 Fabio Cavallo (aka FHorse)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

#ifndef DLGCMDLINEHELP_HPP_
#define DLGCMDLINEHELP_HPP_

#include <QtWidgets/QDialog>
#include "dlgCmdLineHelp.hh"
#include "common.h"

class dlgCmdLineHelp : public QDialog, public Ui::dlgCmdLineHelp {
Q_OBJECT

public:
dlgCmdLineHelp(QWidget *parent = 0, QString name = "");
~dlgCmdLineHelp();

private slots:
void s_close_clicked(bool checked);
};

#endif /* DLGCMDLINEHELP_HPP_ */
@@ -721,6 +721,7 @@ void objSet::to_cfg(QString group) {
int_to_val(SET_SAMPLERATE, cfg_from_file.samplerate);
int_to_val(SET_CHANNELS, cfg_from_file.channels_mode);
double_to_val(SET_STEREO_DELAY, cfg_from_file.stereo_delay);
int_to_val(SET_REVERSE_BITS_DPCM, cfg_from_file.reverse_bits_dpcm);
int_to_val(SET_SWAP_DUTY, cfg_from_file.swap_duty);
int_to_val(SET_AUDIO, cfg_from_file.apu.channel[APU_MASTER]);
}
@@ -811,6 +812,7 @@ void objSet::fr_cfg(QString group) {
cfg_from_file.samplerate = val_to_int(SET_SAMPLERATE);
cfg_from_file.channels_mode = val_to_int(SET_CHANNELS);
cfg_from_file.stereo_delay = val_to_double(SET_STEREO_DELAY, 5);
cfg_from_file.reverse_bits_dpcm = val_to_int(SET_REVERSE_BITS_DPCM);
cfg_from_file.swap_duty = val_to_int(SET_SWAP_DUTY);
cfg_from_file.apu.channel[APU_MASTER] = val_to_int(SET_AUDIO);
}
@@ -245,6 +245,9 @@ void gui_update(void) {

gui.in_update = FALSE;
}
void gui_update_dset(void) {
qt.dset->update_dialog();
}
void gui_update_gps_settings(void) {
qt.dset->change_rom();
}
@@ -107,6 +107,7 @@ EXTERNC void gui_set_video_mode(void);
EXTERNC void gui_set_window_size(void);

EXTERNC void gui_update(void);
EXTERNC void gui_update_dset(void);
EXTERNC void gui_update_gps_settings(void);

EXTERNC void gui_fullscreen(void);
@@ -85,6 +85,7 @@ enum set_element {
SET_SAMPLERATE,
SET_CHANNELS,
SET_STEREO_DELAY,
SET_REVERSE_BITS_DPCM,
SET_SWAP_DUTY,
SET_AUDIO,
SET_GUI_OPEN_PATH,
@@ -784,6 +785,12 @@ static const _settings main_cfg[] = {
uL("-d, --stereo-delay stereo effect delay : [5 - 100]"),
{0, NULL}
},
{
uL("audio"), uL("reverse bits of DPCM"), uL("no"),
uL("# possible values: yes, no"),
uL(" --reverse-bits-dpcm reverse bits of dpcm : yes, no"),
{LENGTH(opt_no_yes), opt_no_yes}
},
{
uL("audio"), uL("swap duty cycles (Famicom clone chip audio emulation)"), uL("no"),
uL("# possible values: yes, no"),
@@ -36,6 +36,7 @@ wdgSettingsAudio::wdgSettingsAudio(QWidget *parent) : QWidget(parent) {

widget_APU_Channels->line_APU_Channels->hide();

connect(checkBox_Reverse_bits_DPCM, SIGNAL(clicked(bool)), this, SLOT(s_reverse_bits_dpcm(bool)));
connect(checkBox_Swap_Duty_Cycles, SIGNAL(clicked(bool)), this, SLOT(s_swap_duty_cycles(bool)));
connect(checkBox_Enable_Audio, SIGNAL(clicked(bool)), this, SLOT(s_enable_audio(bool)));
}
@@ -92,6 +93,7 @@ void wdgSettingsAudio::update_widget(void) {

widget_APU_Channels->update_widget();

checkBox_Reverse_bits_DPCM->setChecked(cfg->reverse_bits_dpcm);
checkBox_Swap_Duty_Cycles->setChecked(cfg->swap_duty);
checkBox_Enable_Audio->setChecked(cfg->apu.channel[APU_MASTER]);
}
@@ -264,6 +266,12 @@ void wdgSettingsAudio::s_channels_delay(int index) {
emu_thread_continue();
gui_update();
}
void wdgSettingsAudio::s_reverse_bits_dpcm(UNUSED(bool checked)) {
emu_thread_pause();
cfg->reverse_bits_dpcm = !cfg->reverse_bits_dpcm;
emu_thread_continue();
update_widget();
}
void wdgSettingsAudio::s_swap_duty_cycles(UNUSED(bool checked)) {
emu_thread_pause();
cfg->swap_duty = !cfg->swap_duty;
@@ -52,6 +52,7 @@ class wdgSettingsAudio : public QWidget, public Ui::wdgSettingsAudio {
void s_sample_rate(int index);
void s_channels(int index);
void s_channels_delay(int index);
void s_reverse_bits_dpcm(bool checked);
void s_swap_duty_cycles(bool checked);
void s_enable_audio(bool checked);
};