~korth/gens-gs-ii.git
8 years ago[gens-qt4] GeneralConfigWindow::keyPressEvent(): Reimplemented dialog keypresses... gens-qt4-GeneralConfigWindow-v5
David Korth [Mon, 7 Feb 2011 10:29:33 +0000 (05:29 -0500)] 
[gens-qt4] GeneralConfigWindow::keyPressEvent(): Reimplemented dialog keypresses for !GCW_APPLY_IMMED.

This allows use of Enter and Escape to accept and cancel changes, respectively.

QMainWindow doesn't have that by default because it's not intended to
be used as a dialog, but we need to use QMainWindow in order to get
the unified titlebar/toolbar on Mac OS X. I basically reimplemented
QDialog::keyPressEvent() in GeneralConfigWindow's keyPressEvent()
handler.

TODO:

- Handle Cmd-Period on Mac?

- Cmd-W triggers the "Close ROM" action. It should close the window.

8 years ago[gens-qt4] GeneralConfigWindow.cpp: Added support for saving settings immediately.
David Korth [Mon, 7 Feb 2011 10:10:01 +0000 (05:10 -0500)] 
[gens-qt4] GeneralConfigWindow.cpp: Added support for saving settings immediately.

This is mainly for Mac OS X, which doesn't show OK/Cancel/Apply buttons
on preferences windows. Instead, it applies settings immediately.

The settingChanged() slot is gone. It has been replaced with widget-specific
slots in GeneralConfigWindow_slots.cpp. These slots simply enable the "Apply"
button on most systems, but on Mac OS X, they save the relevant setting.

TODO: Do this on GNOME, since GNOME uses the same design.

ui/GeneralConfigWindow.ui: Re-added the signals from the sliders in the
"Graphics" tab to the labels that display the current slider values.

8 years ago[WTF] [gens-qt4] GensWindow.cpp: Work around a bug in Mac OS X 10.5 (gcc-4.0.1).
David Korth [Mon, 7 Feb 2011 08:53:37 +0000 (03:53 -0500)] 
[WTF] [gens-qt4] GensWindow.cpp: Work around a bug in Mac OS X 10.5 (gcc-4.0.1).

It seems that calling m_emuManager directly from GensActions via friend classes,
or using inline functions in GensWindow.hpp, results in memory corruption.
Specifically, the m_emuManager pointer is misread as e.g. 0x101b4 when it
should be 0x1b43210. It looks like it's off by two bytes when reading the
address from the GensWindow instance.

TODO: Have GensActions emit signals, and link the signals to
EmuManager slots.

8 years ago[gens-qt4] GensWindow.cpp: Allocate m_emuManager on the heap instead of on the stack.
David Korth [Mon, 7 Feb 2011 08:26:01 +0000 (03:26 -0500)] 
[gens-qt4] GensWindow.cpp: Allocate m_emuManager on the heap instead of on the stack.

I'm trying to trace some wacky memory corruption in EmuManager,
and it's probably a better idea to allocate the EmuManager
instance on the heap anyway.

GensActions.cpp: Updated for the m_emuManager change.

8 years ago[libgens] DcRar_Unix::CheckExtPrg(): pclose() should be used to close a popen()'d...
David Korth [Mon, 7 Feb 2011 07:23:54 +0000 (02:23 -0500)] 
[libgens] DcRar_Unix::CheckExtPrg(): pclose() should be used to close a popen()'d file, not fclose().

This error was found by cppcheck-1.46.1.

8 years ago[gens-qt4] GeneralConfigWindow::setupUi_mac(): Remove the toolbar show/hide button...
David Korth [Mon, 7 Feb 2011 06:36:48 +0000 (01:36 -0500)] 
[gens-qt4] GeneralConfigWindow::setupUi_mac(): Remove the toolbar show/hide button from the titlebar.

TODO: Implement a Cocoa version. Currently, this only works if Qt is linked
with Carbon, since it uses the Carbon ChangeWindowAttributes() function.

8 years ago[gens-qt4] GeneralConfigWindow_mac.cpp: Use a unified Mac toolbar instead of tabs.
David Korth [Mon, 7 Feb 2011 06:11:32 +0000 (01:11 -0500)] 
[gens-qt4] GeneralConfigWindow_mac.cpp: Use a unified Mac toolbar instead of tabs.

As of Qt 4.3, QMainWindow supports unified Mac toolbars, but QDialog
does not. Hence, I had to convert GeneralConfigWindow to inherit from
QMainWindow. It wasn't too difficult, especially since I managed to
figure out how to disable the Zoom properly, and the size grip seems
to have vanished because I made the window fixed-size.

ui/resources/oxygen-32x32/: Added icons for the toolbar buttons.

TODO:

- Remove the toolbar button in the titlebar, which is used for hiding
  the toolbar. (There's no point in doing that in a preferences window.)

- Remove the button box. On Mac OS X, changes to preferences take effect
  immediately. (This is true for GNOME too, but I'm not sure how to
  detect if we're using GNOME vs. KDE vs. some other environment.)

- Add an actual "Sega CD" icon instead of using KDE Oxygen's media-optical.

8 years ago[gens-qt4] GeneralConfigWindow.cpp: Added a space between "All Files" and "(*.*)".
David Korth [Sun, 6 Feb 2011 12:15:00 +0000 (07:15 -0500)] 
[gens-qt4] GeneralConfigWindow.cpp: Added a space between "All Files" and "(*.*)".

Same change as commit e1929a6a9e2b14a067c11e0fe51e3b0687ec8adf,
but in GeneralConfigWindow.cpp.

8 years ago[gens-qt4] GeneralConfigWindow: Various changes to improve the Mac UI.
David Korth [Sun, 6 Feb 2011 12:13:11 +0000 (07:13 -0500)] 
[gens-qt4] GeneralConfigWindow: Various changes to improve the Mac UI.

- Window is no longer resizable. (Resizability didn't really help much.)

- Zoom button is no longer displayed.

- Preparations for adding a QToolBar, which will be used instead of
  a QTabWidget on Mac OS X. I tried to convert the window to a
  QMainWindow, since Qt supports the unified titlebar/toolbar on
  Mac OS X with a QMainWindow, but there were too many problems
  with it, so I'm sticking with a QDialog for now.

- TODO: Implement the QToolBar for Mac OS X.

8 years ago[gens-qt4] EmuManager::openRom(): Added a space between "All Files" and "(*.*)".
David Korth [Sun, 6 Feb 2011 12:12:19 +0000 (07:12 -0500)] 
[gens-qt4] EmuManager::openRom(): Added a space between "All Files" and "(*.*)".

I forgot to add this space before, and never noticed it because
Qt doesn't show the file extension filters on KDE. It does show
them on Mac OS X, though.

(...and apparently it also shows them on Qt without KDE. Whoops.)

8 years agoCMakeLists.txt: CMake doesn't include CheckLibraryExists by default on Mac OS X.
David Korth [Sun, 6 Feb 2011 10:13:22 +0000 (05:13 -0500)] 
CMakeLists.txt: CMake doesn't include CheckLibraryExists by default on Mac OS X.

Hence, we need to include it ourselves.

8 years ago[gens-qt4] ui/GeneralConfigWindow.ui: Use GensColorComboBox.
David Korth [Sun, 6 Feb 2011 09:24:31 +0000 (04:24 -0500)] 
[gens-qt4] ui/GeneralConfigWindow.ui: Use GensColorComboBox.

Removed all items in cboIntroColor, since GensColorComboBox::addItem()
automatically adds the color name for Qt's standard colors.

GeneralConfigWindow::GeneralConfigWindow(): Updated the cboIntroColor
code to add colors using GensColorComboBox::addItem().

8 years ago[gens-qt4] widgets/GensColorComboBox.cpp: New GensColorComboBox widget.
David Korth [Sun, 6 Feb 2011 09:22:53 +0000 (04:22 -0500)] 
[gens-qt4] widgets/GensColorComboBox.cpp: New GensColorComboBox widget.

GensColorComboBox is essentially a QComboBox with a few extra
methods for handling color entries.

This will be used in the General Configuration Window for
selecting the Intro Effect Color.

TODO: Add an option for selecting a custom color. This is
needed for the OSD color selection.

8 years ago[gens-qt4] ui/GeneralConfigWindow.ui: s/GensLineEdit/GensQt4::GensLineEdit/g
David Korth [Sun, 6 Feb 2011 09:00:50 +0000 (04:00 -0500)] 
[gens-qt4] ui/GeneralConfigWindow.ui: s/GensLineEdit/GensQt4::GensLineEdit/g

GensLineEdit was moved to the GensQt4 namespace in the previous commit.
(commit 4e644311463d70e72b5f38c4359091895ce9f959)

8 years ago[gens-qt4] widgets/GensLineEdit.cpp: Moved GensLineEdit to the GensQt4 namespace.
David Korth [Sun, 6 Feb 2011 08:59:45 +0000 (03:59 -0500)] 
[gens-qt4] widgets/GensLineEdit.cpp: Moved GensLineEdit to the GensQt4 namespace.

8 years ago[gens-qt4] GensConfig.cpp: Added properties for intro effect color and style, and...
David Korth [Sun, 6 Feb 2011 08:51:27 +0000 (03:51 -0500)] 
[gens-qt4] GensConfig.cpp: Added properties for intro effect color and style, and color scale method.

GeneralConfigWindow.cpp: Save to / load from GensConfig for
intro effect color and style, and color scale method.

8 years ago[gens-qt4] GensActions::doAction(): Moved the IDM_NOMENU code from checkEventKey...
David Korth [Sun, 6 Feb 2011 03:48:45 +0000 (22:48 -0500)] 
[gens-qt4] GensActions::doAction(): Moved the IDM_NOMENU code from checkEventKey() to doAction().

8 years ago[gens-qt4] GensActions::doAction(): Moved GensWindow::menuTriggered() to GensActions.
David Korth [Sun, 6 Feb 2011 03:43:12 +0000 (22:43 -0500)] 
[gens-qt4] GensActions::doAction(): Moved GensWindow::menuTriggered() to GensActions.

I had to do some hackery in order to get some of the actions
to work properly, since they depend on protected variables
in the GensWindow class. Most of the hackery is for debugging
stuff anyway, e.g. the CtrlTest menu.

8 years ago[gens-qt4] GensActions::checkEventKey(): Handle modifiers in KeyHandlerQt.
David Korth [Sun, 6 Feb 2011 03:20:26 +0000 (22:20 -0500)] 
[gens-qt4] GensActions::checkEventKey(): Handle modifiers in KeyHandlerQt.

KeyHandlerQt::KeyPressEvent(): Apply modifier keys to the GensKey_t value
before passing it to ms_GensActions->checkEventKey().

8 years ago[gens-qt4] Input/EventKeys.cpp -> actions/GensActions.cpp
David Korth [Sun, 6 Feb 2011 03:15:45 +0000 (22:15 -0500)] 
[gens-qt4] Input/EventKeys.cpp -> actions/GensActions.cpp

Moved GensKeyConfig, GensMenuBar, and GensMenuBar_menus
to the actions/ subdirectory.

8 years ago[gens-qt4] GensKeyConfig: Initial key configuration support for non-menu actions.
David Korth [Sun, 6 Feb 2011 02:59:15 +0000 (21:59 -0500)] 
[gens-qt4] GensKeyConfig: Initial key configuration support for non-menu actions.

GensKeyConfig has default keys for the non-menu actions,
such as selecting save slots and hard reset.

GensMenuBar_menus.hpp: Added non-menu action definitions.

Input/EventKeys.cpp: Use gqt4_config->keyToAction() to determine
what action should be taken based on an input key sequence.

TODO: Move GensWindow::menuTriggered() to EventKeys and
rename EventKeys to GensActions, since it will handle
all sorts of actions, not just key actions.

8 years ago[libgens] GensInput/GensKey_t.h: Added modifier key definitions, GensKeyMod_t.
David Korth [Sun, 6 Feb 2011 02:57:12 +0000 (21:57 -0500)] 
[libgens] GensInput/GensKey_t.h: Added modifier key definitions, GensKeyMod_t.

Modifier keys will be OR'd with the GensKey_t value to produce
keys with modifiers, which will be used for e.g. menu actions.

Game controls should ignore the modifier key portion of GensKey_t,
which is now defined as the top 7 bits of the 16-bit keyId.

8 years ago[gens-qt4] Use GensConfig for configuring Fast Blur and Save Slots.
David Korth [Sun, 6 Feb 2011 01:46:32 +0000 (20:46 -0500)] 
[gens-qt4] Use GensConfig for configuring Fast Blur and Save Slots.

This reduces the complexity of a ton of code.

EventKeys: Put this class in namespace GensQt4.

GensConfig: Added the current save slot as a property,
along with helper functions to switch to the previous and
to the next save slot.

8 years agoTAGS.txt: New (retroactive) tag: gens-credits-v1
David Korth [Sat, 5 Feb 2011 11:49:46 +0000 (06:49 -0500)] 
TAGS.txt: New (retroactive) tag: gens-credits-v1

8 years ago[gens-qt4] GensWindow.cpp: Added drag and drop support for loading ROMs.
David Korth [Sat, 5 Feb 2011 09:33:52 +0000 (04:33 -0500)] 
[gens-qt4] GensWindow.cpp: Added drag and drop support for loading ROMs.

Only one file is accepted at a time, and files must be stored locally
for now. The filename is converted to use native separators before
passing it to m_emuManager.openRom(const QString& filename).

TODO: Add remote file support.

EmuManager::openRom(const QString& filename): Re-added the overload
that accepts a filename as a parameter. This overload is now called
by the normal openRom(QWidget *parent) function in addition to the
drag and drop functionality.

NOTE: The filename MUST have native separators!

EmuManager::openRom(QWidget *parent): Convert the filename to use
native separators before passing it to openRom(const QString& filename).

8 years ago[gens-qt4] GensQApplication::gqaInit(): Set the application icon.
David Korth [Sat, 5 Feb 2011 08:52:53 +0000 (03:52 -0500)] 
[gens-qt4] GensQApplication::gqaInit(): Set the application icon.

Setting the application icon ensures that all windows that don't specify
a custom icon will use the Gens/GS icon by default. Also, this is needed
in order to set the dock icon on Mac OS X.

GensWindow::GensWindow(): Don't set the window icon, since we're setting
the default application icon in GensQApplication.

8 years ago[gens-qt4] AboutWindow::initAboutWindowText(): Updated the Gens URL.
David Korth [Sat, 5 Feb 2011 07:27:31 +0000 (02:27 -0500)] 
[gens-qt4] AboutWindow::initAboutWindowText(): Updated the Gens URL.

http://gens.consolemul.com -> http://www.gens.me/

8 years ago[gens-qt4] AboutWindow::GetIncLibraries(): Fixed a typo in the GLEW URL.
David Korth [Sat, 5 Feb 2011 07:19:53 +0000 (02:19 -0500)] 
[gens-qt4] AboutWindow::GetIncLibraries(): Fixed a typo in the GLEW URL.

The typo was a single-quote instead of a double-quote, which prevented
the URL from being displayed due to invalid HTML.

8 years ago[gens-qt4] AboutWindow::GetIncLibraries(): New function: Get a string describing...
David Korth [Sat, 5 Feb 2011 07:11:23 +0000 (02:11 -0500)] 
[gens-qt4] AboutWindow::GetIncLibraries(): New function: Get a string describing the included libraries.

This function is used to populate the "Included Libraries" tab.

config.h.in: Added GLEW_FOUND, ZLIB_FOUND, and LZMA_FOUND macros.
These are used by the "Included Libraries" tab to determine if
the relevant libraries are built-in and hence should be displayed.

8 years agosrc/CMakeLists.txt: TODO: Set LZMA_FOUND if we're using an external LZMA.
David Korth [Sat, 5 Feb 2011 06:54:59 +0000 (01:54 -0500)] 
src/CMakeLists.txt: TODO: Set LZMA_FOUND if we're using an external LZMA.

That is, if we ever decide to add support for external LZMA.

8 years ago[gens-qt4] GeneralConfigWindow.cpp: Make sure all instances of sLineBreak have an...
David Korth [Sat, 5 Feb 2011 06:41:46 +0000 (01:41 -0500)] 
[gens-qt4] GeneralConfigWindow.cpp: Make sure all instances of sLineBreak have an actual newline character.

"<br/>" -> "<br/>\n"

8 years ago[gens-qt4] ui/AboutWindow.ui: Added the widgets for the "Included Libraries" tab.
David Korth [Sat, 5 Feb 2011 06:31:49 +0000 (01:31 -0500)] 
[gens-qt4] ui/AboutWindow.ui: Added the widgets for the "Included Libraries" tab.

AboutWindow.cpp: Create the scroll area for the "Included Libraries" tab.

TODO: Display the list of included libraries.

8 years ago[gens-qt4] AboutWindow::initAboutWindowText(): Don't add a scroll area to the copyrig...
David Korth [Sat, 5 Feb 2011 06:20:15 +0000 (01:20 -0500)] 
[gens-qt4] AboutWindow::initAboutWindowText(): Don't add a scroll area to the copyright string.

For some reason, the changes in commit 150f6fe0ee9df2471a0e249ee443fd71de42ddd5
resulted in the scroll area showing a scroll bar immediately on window
creation, even without the user resizing it.

To work around this, don't add a scroll area. This essentially restricts
the window's minimum size to the size of the copyright string, plus the
other non-resizable components.

8 years ago[gens-qt4] AboutWindow::initAboutWindowText(): Set the copyright string in code inste...
David Korth [Sat, 5 Feb 2011 06:19:40 +0000 (01:19 -0500)] 
[gens-qt4] AboutWindow::initAboutWindowText(): Set the copyright string in code instead of in the UI file.

This makes it easier to update the copyright string and to translate
various parts of it, including the website descriptions.

8 years ago[gens-qt4] AboutWindow::initAboutWindowText(): Split the window text initialization...
David Korth [Sat, 5 Feb 2011 06:12:58 +0000 (01:12 -0500)] 
[gens-qt4] AboutWindow::initAboutWindowText(): Split the window text initialization into a separate function.

The scroll areas are only initialized on startup. If initAboutWindowText()
is called a second time, the scroll areas won't be created again.

8 years agoReworked the way the ZLIB include directory is handled.
David Korth [Sat, 5 Feb 2011 05:56:51 +0000 (00:56 -0500)] 
Reworked the way the ZLIB include directory is handled.

Instead of calling INCLUDE_DIRECTORIES() globally, simply set ZLIB_INCLUDE_DIR()
and have the subprojects call INCLUDE_DIRECTORIES() themselves.

8 years agosrc/extlib/glew: Added an internal copy of glew-1.5.8.
David Korth [Sat, 5 Feb 2011 05:36:48 +0000 (00:36 -0500)] 
src/extlib/glew: Added an internal copy of glew-1.5.8.

The internal copy of glew-1.5.8 is always used on Win32,
and is used on other systems if a system GLEW isn't found.

8 years agoCMakeLists.txt: Always use the internal copy of zlib on Win32.
David Korth [Sat, 5 Feb 2011 04:56:09 +0000 (23:56 -0500)] 
CMakeLists.txt: Always use the internal copy of zlib on Win32.

zlib isn't standard on Win32, so requiring an extra DLL causes headaches
both for distribution and when compiling the Win32 build.

8 years ago[gens-qt4] GeneralConfigWindow::mcdUpdateRomFileStatus(): Added compressed ROM suppor...
David Korth [Fri, 4 Feb 2011 22:39:23 +0000 (17:39 -0500)] 
[gens-qt4] GeneralConfigWindow::mcdUpdateRomFileStatus(): Added compressed ROM support via LibGens::Rom.

Multi-file ROM archives are not currently supported, and will be
rejected immediately.

Added linebreaks before error messages that may show up before
the ROM is opened, e.g. "No ROM filename specified." or
"The specified ROM file was not found."

8 years ago[gens-qt4] EmuManager.cpp: Don't unload the current ROM immediately if a multi-file...
David Korth [Fri, 4 Feb 2011 22:15:39 +0000 (17:15 -0500)] 
[gens-qt4] EmuManager.cpp: Don't unload the current ROM immediately if a multi-file archive is selected.

Only unload the current ROM if a file is selected from the archive.

Also, fixed a minor memory leak caused by selecting "Cancel" in ZipSelectDialog.
 Use a QScopedPointer to ensure that zipsel gets deleted after it's used.

8 years ago[libgens] Data/mcd_rom_db.c: Fixed build error caused by a missing semicolon.
David Korth [Fri, 4 Feb 2011 12:26:44 +0000 (07:26 -0500)] 
[libgens] Data/mcd_rom_db.c: Fixed build error caused by a missing semicolon.

8 years ago[libgens] Data/mcd_rom_db.c: Added a few more region code strings.
David Korth [Fri, 4 Feb 2011 12:16:25 +0000 (07:16 -0500)] 
[libgens] Data/mcd_rom_db.c: Added a few more region code strings.

These strings match some new region code masks obtained by
retesting the ROMs.

See commit 3831e7c60fce383b552545af3de9ab62e2079084 for more information.

8 years ago[libgens] Data/mcd_rom_db.c: Retested all ROMs for region compatibility.
David Korth [Fri, 4 Feb 2011 12:12:39 +0000 (07:12 -0500)] 
[libgens] Data/mcd_rom_db.c: Retested all ROMs for region compatibility.

1.00l (J) and 2.00c (J) works on all regions.
1.00S (Asia) works on all regions except USA.
X'Eye 2.00 works on all regions.

Interestingly, 1.00l doesn't even have the "ERROR!" text in the ROM,
whereas the other four do. I'm guessing the region lockout wasn't
implemented until 1.00P, and they accidentally broke it in the three
other ROMs listed above.

8 years ago[gens-qt4] GeneralConfigWindow::on_txtMcdRomJPN_textChanged(): Update for Japan/Asia...
David Korth [Fri, 4 Feb 2011 11:42:08 +0000 (06:42 -0500)] 
[gens-qt4] GeneralConfigWindow::on_txtMcdRomJPN_textChanged(): Update for Japan/Asia changes.

TODO: Add a separate "Mega CD (Asia)' boot ROM?

8 years ago[libgens] Data/mcd_rom_db.c: JAPAN_NTSC -> JAPAN, JAPAN_PAL -> ASIA
David Korth [Fri, 4 Feb 2011 11:40:55 +0000 (06:40 -0500)] 
[libgens] Data/mcd_rom_db.c: JAPAN_NTSC -> JAPAN, JAPAN_PAL -> ASIA

Japan is an NTSC country, and doesn't use PAL.
East/PAL is used for various other Asian regions.

8 years ago[gens-qt4] Major header cleanup.
David Korth [Fri, 4 Feb 2011 10:00:48 +0000 (05:00 -0500)] 
[gens-qt4] Major header cleanup.

Use forward declarations instead of #include'ing Qt headers where possible.

Removed unnecessary #include's.

Reformatted inline functions that only have one line of code.

8 years agoTAGS.txt: New tag: gens-qt4-GeneralConfigWindow-v4
David Korth [Fri, 4 Feb 2011 09:19:20 +0000 (04:19 -0500)] 
TAGS.txt: New tag: gens-qt4-GeneralConfigWindow-v4

8 years ago[gens-qt4] GeneralConfigWindow::on_txtExtPrgUnRAR_textChanged(): Display the correct... gens-qt4-GeneralConfigWindow-v4
David Korth [Fri, 4 Feb 2011 09:18:07 +0000 (04:18 -0500)] 
[gens-qt4] GeneralConfigWindow::on_txtExtPrgUnRAR_textChanged(): Display the correct warning on Unix if version information isn't available.

8 years ago[gens-qt4] GeneralConfigWindow::on_txtExtPrgUnRAR_textChanged(): Display the correct...
David Korth [Fri, 4 Feb 2011 09:17:21 +0000 (04:17 -0500)] 
[gens-qt4] GeneralConfigWindow::on_txtExtPrgUnRAR_textChanged(): Display the correct warning on Unix if the selected program is neither RAR nor UnRAR.

8 years ago[gens-qt4] GeneralConfigWindow.cpp: s/_WIN32/Q_OS_WIN32/g
David Korth [Fri, 4 Feb 2011 09:16:28 +0000 (04:16 -0500)] 
[gens-qt4] GeneralConfigWindow.cpp: s/_WIN32/Q_OS_WIN32/g

8 years ago[libgens] Decompressor/DcRar_Unix.cpp::CheckExtPrg(): Return errors if the program...
David Korth [Fri, 4 Feb 2011 09:15:19 +0000 (04:15 -0500)] 
[libgens] Decompressor/DcRar_Unix.cpp::CheckExtPrg(): Return errors if the program isn't RAR or UnRAR, or if the version information isn't available.

Updated documentation for error code -7 in DcRar.hpp,
DcRar_Unix.cpp, and DcRar_Win32.cpp.

8 years ago[gens-qt4] GeneralConfigWindow.cpp: Set focus to the textbox after selecting a file...
David Korth [Fri, 4 Feb 2011 09:10:46 +0000 (04:10 -0500)] 
[gens-qt4] GeneralConfigWindow.cpp: Set focus to the textbox after selecting a file from the Open File Dialog.

8 years ago[gens-qt4] ui/GeneralConfigWindow.ui: Place the Sega CD Boot ROM and UnRAR program...
David Korth [Fri, 4 Feb 2011 09:04:53 +0000 (04:04 -0500)] 
[gens-qt4] ui/GeneralConfigWindow.ui: Place the Sega CD Boot ROM and UnRAR program textboxes using Qt Designer promotion.

The QLineEdits are promoted to GensLineEdit in Qt Designer, which eliminates
the need to manually create the GensLineEdit widgets manually. [1]

GeneralConfigWindow.cpp: Removed GensLineEdit creation code.

Placeholder text is still created manually, since the Boot ROM text
is templated and the UnRAR text is OS-specific.

The GensLineEdit icon is set manually because Qt Designer doesn't know
about the GensLineEdit-specific properties. In order to get Qt Designer
to know about these properties, I'd have to subclass QDesignerCustomWidgetInterface,
which isn't worth bothering with. [2]

[1] http://doc.qt.nokia.com/4.7/designer-using-custom-widgets.html

[2] http://doc.qt.nokia.com/4.7/designer-creating-custom-widgets.html

8 years ago[gens-qt4] widgets/GensLineEdit.cpp: Mark the GensLineEdit icon as a Q_PROPERTY().
David Korth [Fri, 4 Feb 2011 08:48:50 +0000 (03:48 -0500)] 
[gens-qt4] widgets/GensLineEdit.cpp: Mark the GensLineEdit icon as a Q_PROPERTY().

GensLineEdit now stores the icon internally, which allows the GensLineEdit
parent to retrieve the icon at any time.

Q_PROPERTY() is used to declare the icon as a property.

8 years ago[gens-qt4] GensWindow.hpp: Added "void" to the setGensTitle() declaration.
David Korth [Fri, 4 Feb 2011 08:37:06 +0000 (03:37 -0500)] 
[gens-qt4] GensWindow.hpp: Added "void" to the setGensTitle() declaration.

8 years ago[gens-qt4] GensMenuBar.cpp: Moved menu definitions to another file, GensMenuBar_menus...
David Korth [Fri, 4 Feb 2011 08:32:49 +0000 (03:32 -0500)] 
[gens-qt4] GensMenuBar.cpp: Moved menu definitions to another file, GensMenuBar_menus.cpp.

- Menu definition structs and enums are now protected instead of public.

- Menu definition data structs were moved out of GensMenuBar::GensMenuBar()
  and into GensMenuBar.cpp.

- Menu definition #defines were moved out of GensMenuBar.hpp
  and into GensMenuBar_menus.hpp.

GensWindow.cpp: #include "GensMenuBar_menus.hpp"

8 years ago[gens-qt4] AboutWindow::GetDebugInfo(): Slight reworking of the Qt version strings.
David Korth [Thu, 3 Feb 2011 22:12:29 +0000 (17:12 -0500)] 
[gens-qt4] AboutWindow::GetDebugInfo(): Slight reworking of the Qt version strings.

Use QString::arg() to append the version strings to the
"Compiled using Qt" and "Using Qt" strings.

8 years ago[gens-qt4] Use QObject::tr() instead of QCoreApplication::translate() when possible.
David Korth [Thu, 3 Feb 2011 22:08:59 +0000 (17:08 -0500)] 
[gens-qt4] Use QObject::tr() instead of QCoreApplication::translate() when possible.

QObject::tr() is easier to deal with than QCoreApplication::translate(),
and it's available within all classes that inherit from QObject.

gqt4_main.cpp still uses QCoreApplication::translate(), since it doesn't
inherit from QObject.

8 years ago[gens-qt4] GensZipDirModel::insertZEntry(): Use QList::at() instead of QList::operato...
David Korth [Thu, 3 Feb 2011 19:29:33 +0000 (14:29 -0500)] 
[gens-qt4] GensZipDirModel::insertZEntry(): Use QList::at() instead of QList::operator[]().

QList::at() never performs a deep copy, so it's more efficient
than QList::operator[]() for read-only access.

8 years ago[gens-qt4] Disable implicit QString ASCII casts.
David Korth [Thu, 3 Feb 2011 19:23:58 +0000 (14:23 -0500)] 
[gens-qt4] Disable implicit QString ASCII casts.

The preprocessor macros QT_NO_CAST_FROM_ASCII and QT_NO_CAST_TO_ASCII
are now defined in CMakeLists.txt.

This helps to find incorrect text encoding conversions, e.g. converting
from ASCII when we're supposed to be converting from UTF-8. The only
downside is it makes a lot of the code more verbose.

Updated all of gens-qt4 to compile with disabled implicit QString ASCII casts.

8 years ago[libgens] Timing::GetTimingMethodName(): Clarify that the returned string is ASCII.
David Korth [Thu, 3 Feb 2011 18:07:14 +0000 (13:07 -0500)] 
[libgens] Timing::GetTimingMethodName(): Clarify that the returned string is ASCII.

8 years ago[libgens] lg_main.cpp: Clarify that version strings are ASCII.
David Korth [Thu, 3 Feb 2011 18:06:54 +0000 (13:06 -0500)] 
[libgens] lg_main.cpp: Clarify that version strings are ASCII.

8 years ago[libgens] macros/log_msg.c: Clarify that debug channel names are ASCII and messages...
David Korth [Thu, 3 Feb 2011 17:50:35 +0000 (12:50 -0500)] 
[libgens] macros/log_msg.c: Clarify that debug channel names are ASCII and messages are UTF-8.

8 years ago[gens-qt4] CMakeLists.txt: GLEW_STATIC should be in COMPILE_DEFINITIONS, not COMPILE_...
David Korth [Thu, 3 Feb 2011 17:38:06 +0000 (12:38 -0500)] 
[gens-qt4] CMakeLists.txt: GLEW_STATIC should be in COMPILE_DEFINITIONS, not COMPILE_FLAGS.

GLEW_STATIC is a preprocessor macro, so it should be treated as such.

8 years ago[gens-qt4] CMakeLists.txt: Use fast QString concatenation.
David Korth [Thu, 3 Feb 2011 17:35:21 +0000 (12:35 -0500)] 
[gens-qt4] CMakeLists.txt: Use fast QString concatenation.

Moved the preprocessor definitions from individual source code files to
COMPILE_DEFINITIONS in CMakeLists.txt. These optimizations apply to all
source code files and don't affect the output in any way, other than
improving performance.

8 years agoRevert "[gens-qt4] Use fast QString concatenation."
David Korth [Thu, 3 Feb 2011 17:28:27 +0000 (12:28 -0500)] 
Revert "[gens-qt4] Use fast QString concatenation."

This reverts commit e81a162e8e240c541dd52cabcbfd2f518926fbd6.

The macros for fast QString concatenation should be added to the build system,
since they're used for everything and don't actually affect functionality of
the program in any way other than performance

8 years ago[gens-qt4] GensMenuBar.cpp: Use m_hashActions.value() instead of m_hashActions.find().
David Korth [Thu, 3 Feb 2011 11:21:10 +0000 (06:21 -0500)] 
[gens-qt4] GensMenuBar.cpp: Use m_hashActions.value() instead of m_hashActions.find().

QMap::value() returns the value associated with the given key without
going through an iterator, so it's more efficient.o

8 years ago[gens-qt4] GensMenuBar.cpp: Use QHash instead of QMap for the QAction* and QMenu...
David Korth [Thu, 3 Feb 2011 11:16:33 +0000 (06:16 -0500)] 
[gens-qt4] GensMenuBar.cpp: Use QHash instead of QMap for the QAction* and QMenu* containers.

QHash is more efficient than using QMap, and we don't need to
preserve the ordering of these containers.

8 years ago[gens-qt4] GensMenuBar::clearMaps(): Cleaned up this function.
David Korth [Thu, 3 Feb 2011 11:11:30 +0000 (06:11 -0500)] 
[gens-qt4] GensMenuBar::clearMaps(): Cleaned up this function.

Use foreach() for the QMaps and QList::takeFirst() for the QLists.

8 years ago[gens-qt4] FindCdromUnix.cpp, FindCdromWin32.cpp: Removed some unnecessary Qt includes.
David Korth [Thu, 3 Feb 2011 10:57:22 +0000 (05:57 -0500)] 
[gens-qt4] FindCdromUnix.cpp, FindCdromWin32.cpp: Removed some unnecessary Qt includes.

8 years ago[gens-qt4] Use fast QString concatenation.
David Korth [Thu, 3 Feb 2011 10:35:10 +0000 (05:35 -0500)] 
[gens-qt4] Use fast QString concatenation.

Qt 4.6 introduced fast QString concatenation. Three methods are
available for enabling fast QString concatenation:

1. #include <QStringBuilder>; use % instead of +.

2. #define QT_USE_FAST_CONCATENATION; use % instead of +.

3. #define QT_USE_FAST_CONCATENATION
   #define QT_USE_FAST_OPERATOR_PLUS

We're using option #3, since that results in code that also compiles
on older versions of Qt.

Reference:

http://doc.qt.nokia.com/4.7/qstring.html#more-efficient-string-construction

8 years ago[gens-qt4] CMakeLists.txt: Require Qt-4.2.0 on Win32.
David Korth [Thu, 3 Feb 2011 07:33:17 +0000 (02:33 -0500)] 
[gens-qt4] CMakeLists.txt: Require Qt-4.2.0 on Win32.

Qt-4.2 is required for QString::fromWCharArray().

Qt-4.6 is required for QPixmap::fromWinHICON(), but fallbacks
are in place to use QPixmap::fromWinHBITMAP() if an older Qt
is detected at compile time.

8 years ago[gens-qt4] GeneralConfigWindow.cpp: Save/load most of the general settings.
David Korth [Thu, 3 Feb 2011 07:27:42 +0000 (02:27 -0500)] 
[gens-qt4] GeneralConfigWindow.cpp: Save/load most of the general settings.

8 years ago[gens-qt4] GensConfig::GensConfig(): Don't use the set*() functions to initialize...
David Korth [Thu, 3 Feb 2011 07:23:48 +0000 (02:23 -0500)] 
[gens-qt4] GensConfig::GensConfig(): Don't use the set*() functions to initialize defaults.

The internal variables aren't initialized yet, so the comparisons
that determine if a signal should be emitted won't be defined.

Also, signals can't be connected before the constructor is finished
anyway, so there's no point in emitting them.

TODO: Don't use setExtPrgUnRAR().

TODO: Add a function to emit signals for all the configuration options,
e.g. a refresh() function.

8 years ago[gens-qt4] GensConfig: Added most of the General Settings.
David Korth [Thu, 3 Feb 2011 07:20:52 +0000 (02:20 -0500)] 
[gens-qt4] GensConfig: Added most of the General Settings.

TODO: Add Intro Effect settings.

8 years ago[gens-qt4] GensConfig.hpp: Marked accessor functions as const.
David Korth [Thu, 3 Feb 2011 07:07:34 +0000 (02:07 -0500)] 
[gens-qt4] GensConfig.hpp: Marked accessor functions as const.

8 years ago[gens-qt4] GensConfig.hpp: Added Q_PROPERTY macros for GensConfig's properties.
David Korth [Thu, 3 Feb 2011 07:06:21 +0000 (02:06 -0500)] 
[gens-qt4] GensConfig.hpp: Added Q_PROPERTY macros for GensConfig's properties.

8 years ago[gens-qt4] GeneralConfigWindow.cpp: Save/load most of the graphics settings.
David Korth [Thu, 3 Feb 2011 06:53:49 +0000 (01:53 -0500)] 
[gens-qt4] GeneralConfigWindow.cpp: Save/load most of the graphics settings.

8 years ago[gens-qt4] GensConfig.cpp: s/constrainAspectRatio/aspectRatioConstraint/gi
David Korth [Thu, 3 Feb 2011 06:52:53 +0000 (01:52 -0500)] 
[gens-qt4] GensConfig.cpp: s/constrainAspectRatio/aspectRatioConstraint/gi

8 years ago[gens-qt4] GensConfig.cpp: Added values for most graphics settings.
David Korth [Thu, 3 Feb 2011 06:49:08 +0000 (01:49 -0500)] 
[gens-qt4] GensConfig.cpp: Added values for most graphics settings.

TODO: Add Color Scale Method.

TODO: What about GL filtering?

8 years ago[gens-qt4] GensConfig.cpp: Moved to the GensQt4 namespace.
David Korth [Thu, 3 Feb 2011 06:44:43 +0000 (01:44 -0500)] 
[gens-qt4] GensConfig.cpp: Moved to the GensQt4 namespace.

gqt4_main.cpp: Updated to work with the GensQt4::GensConfig namespace move.

8 years ago[gens-qt4] CMakeLists.txt: Disable compression in the Qt resource file.
David Korth [Thu, 3 Feb 2011 01:13:05 +0000 (20:13 -0500)] 
[gens-qt4] CMakeLists.txt: Disable compression in the Qt resource file.

The Qt resource file contains only PNG images, which are already compressed.
Compressing the PNG images anyway saves around 32 bytes at the expense of
reducing performance, so we're better off not compressing them.

8 years ago[gens-qt4] GensQGLWidget::showOsdPreview(): Make sure m_preview_img isn't a null...
David Korth [Thu, 3 Feb 2011 01:10:38 +0000 (20:10 -0500)] 
[gens-qt4] GensQGLWidget::showOsdPreview(): Make sure m_preview_img isn't a null image.

8 years ago[gens-qt4] VBackend/VBackend.cpp: Implemented preview image duration.
David Korth [Wed, 2 Feb 2011 23:44:12 +0000 (18:44 -0500)] 
[gens-qt4] VBackend/VBackend.cpp: Implemented preview image duration.

The preview image will disappear after the duration elapses.

GensQGLWidget::showOsdPreview(): Delete the preview image if the duration elapsed.

8 years ago[gens-qt4] VBackend/GensQGLWidget.cpp: Minor cleanups.
David Korth [Wed, 2 Feb 2011 23:29:36 +0000 (18:29 -0500)] 
[gens-qt4] VBackend/GensQGLWidget.cpp: Minor cleanups.

VBackend/VBackend.hpp: Moved font width/height to static class variables.

8 years ago[gens-qt4] VBackend/VBackend.cpp: Initial OSD recording status indicator.
David Korth [Wed, 2 Feb 2011 23:10:41 +0000 (18:10 -0500)] 
[gens-qt4] VBackend/VBackend.cpp: Initial OSD recording status indicator.

The recording status indicator will indicate if e.g. WAV or VGM
is being recorded to a file.

TODO:

- Remove stopped recording indicators after a given duration.

- Implement some recording method and use the OSD recording status indicator.

8 years ago[gens-qt4] McdControlWindow.cpp: Handle the FindCdromBase::driveRemoved() signal.
David Korth [Wed, 2 Feb 2011 15:28:32 +0000 (10:28 -0500)] 
[gens-qt4] McdControlWindow.cpp: Handle the FindCdromBase::driveRemoved() signal.

Also, fixed receipt of driveUpdated() when not querying devices if
no drives are present in the dropdown. (This happens if a drive is
added after the initial querying is finished.)

8 years ago[gens-qt4] FindCdromUDisks::deviceRemoved(): Handle the DeviceRemoved() signal from...
David Korth [Wed, 2 Feb 2011 15:27:24 +0000 (10:27 -0500)] 
[gens-qt4] FindCdromUDisks::deviceRemoved(): Handle the DeviceRemoved() signal from UDisks.

NOTE: The device file cannot be retrieved, since the object is deleted.
Assume the device file is _PATH_DEV + the last component of objectPath.

TODO: Store the device filenames locally.

TODO: Use QDir::separator()?

8 years ago[gens-qt4] FindCdromBase::driveRemoved(): New signal to indicate a drive was removed.
David Korth [Wed, 2 Feb 2011 15:26:35 +0000 (10:26 -0500)] 
[gens-qt4] FindCdromBase::driveRemoved(): New signal to indicate a drive was removed.

UDisks supports reporting that a drive was removed, so we should
forward this signal to McdControlWindow to remove the drive from
the dropdown box if a drive is removed.

8 years ago[gens-qt4] ui/resources/gens/vga-charset.png: Added some VCR symbols.
David Korth [Wed, 2 Feb 2011 14:31:28 +0000 (09:31 -0500)] 
[gens-qt4] ui/resources/gens/vga-charset.png: Added some VCR symbols.

Three new symbols:
- 0x80: Record
- 0x81: Pause
- 0x82: Stop

VBackend/GensQGLWidget.cpp: Added Unicode mappings for the VCR symbols.

NOTE: Unicode doesn't have anything that matches the Pause symbol,
so I'm using a Private Use Area character for Pause. (U+F8FE)

8 years ago[gens-qt4] FindCdromUnix::query_int(): Use _PATH_DEV instead of hard-coding "/dev/".
David Korth [Wed, 2 Feb 2011 09:42:36 +0000 (04:42 -0500)] 
[gens-qt4] FindCdromUnix::query_int(): Use _PATH_DEV instead of hard-coding "/dev/".

Apple's CD-ROM IOKit sample [1] uses _PATH_DEV, so I suppose
we should use it too.

_PATH_DEV is defined in paths.h.

[1] http://developer.apple.com/library/mac/#samplecode/CDROMSample/Listings/
CDROMSample_c.html%23//apple_ref/doc/uid/DTS10000423-CDROMSample_c-DontLinkElementID_3

8 years agoTAGS.txt: New tag: gens-qt4-McdControlWindow-v2
David Korth [Wed, 2 Feb 2011 09:20:49 +0000 (04:20 -0500)] 
TAGS.txt: New tag: gens-qt4-McdControlWindow-v2

8 years ago[gens-qt4] McdControlWindow.cpp: Don't use FindCdromUnix on Mac OS X. gens-qt4-McdControlWindow-v2
David Korth [Wed, 2 Feb 2011 09:20:22 +0000 (04:20 -0500)] 
[gens-qt4] McdControlWindow.cpp: Don't use FindCdromUnix on Mac OS X.

FindCdromUnix won't work on Mac OS X, since the device names
are the same as for hard disks (/dev/disk*, /dev/rdisk*), and
device files aren't created unless a disc is present.

I'll write a Mac-specific backend using IOKit later.

8 years ago[gens-qt4] McdControlWindow::addDriveEntry(): Added an index parameter for updating...
David Korth [Wed, 2 Feb 2011 09:15:12 +0000 (04:15 -0500)] 
[gens-qt4] McdControlWindow::addDriveEntry(): Added an index parameter for updating existing items.

If index is >= 0, the item with the given index is updated.
Otherwise, a new item is added.

McdControlWindow::driveUpdated(): If we're not querying for drives,
search cboCdDrives for a matching path. If a matching path is found,
specify that index when calling addDriveEntry().

CD-ROM drives are now dynamically updated when using FindCdromUDisks.

8 years ago[gens-qt4] FindCdromUdisks::queryUDisksDevice(): TODO: Determine if UDisks is checkin...
David Korth [Wed, 2 Feb 2011 09:08:15 +0000 (04:08 -0500)] 
[gens-qt4] FindCdromUdisks::queryUDisksDevice(): TODO: Determine if UDisks is checking what type of disc is present.

UDisks sends a DeviceChanged() signal when the drive tray is closed,
and also when it has determined what type of disc is present.

Figure out how to determine which signal is which.

8 years ago[gens-qt4] cdrom/FindCdromUDisks.cpp: Added support for UDisks' DeviceChanged() signal.
David Korth [Wed, 2 Feb 2011 09:02:29 +0000 (04:02 -0500)] 
[gens-qt4] cdrom/FindCdromUDisks.cpp: Added support for UDisks' DeviceChanged() signal.

This allows us to dynamically update the CD-ROM drive dropdown box
in McdControlWindow as drive status changes.

TODO:

- Fix McdControlWindow such that it updates existing entries instead
  of adding new entries every time DeviceChanged() is triggered.

- Add a status entry for when UDisks is checking what type of disc
  is present.

8 years ago[gens-qt4] FindCdromWin32::query_int(), FindCdromUnix::query_int(): Removed the TODOs...
David Korth [Wed, 2 Feb 2011 09:00:03 +0000 (04:00 -0500)] 
[gens-qt4] FindCdromWin32::query_int(), FindCdromUnix::query_int(): Removed the TODOs about implementing the driveQueryFinished() signal.

8 years ago[gens-qt4] McdControlWindow.cpp: Display status messages in cboCdDrives.
David Korth [Wed, 2 Feb 2011 08:36:06 +0000 (03:36 -0500)] 
[gens-qt4] McdControlWindow.cpp: Display status messages in cboCdDrives.

Status messages will indicate if:

- No CD-ROM drive handler is available.

- No CD-ROM drives are found.

- The FindCdromBase subclass is currently searching for CD-ROM drives.

Additionally, the mouse cursor is set to Qt::WaitCursor while
the FindCdromBase subclass is searching for CD-ROM drives.

8 years ago[gens-qt4] FindCdromBase::driveQueryFinished(): New signal that's emitted when drive...
David Korth [Wed, 2 Feb 2011 08:18:16 +0000 (03:18 -0500)] 
[gens-qt4] FindCdromBase::driveQueryFinished(): New signal that's emitted when drive scanning is finished.

Updated FindCdromUDisks, FindCdromWin32, and FindCdromUnix to emit
driveQueryFinished() when they're finished querying drives.

8 years ago[gens-qt4] FindCdromUnix::os_GetDiscLabel(): Get disc label.
David Korth [Wed, 2 Feb 2011 07:53:26 +0000 (02:53 -0500)] 
[gens-qt4] FindCdromUnix::os_GetDiscLabel(): Get disc label.

This function uses lseek() and read(), so it should work on
all Unix platforms.

TODO: Add support for Joliet, Rock Ridge, UDF, and HFS.

FindCdromUnix:query_int(): Call os_GetDiscLabel() to get the disc label.