~korth/gens-gs-ii.git
8 years ago[gens-qt4] VBackend::setFastBlur(): Print the "Fast Blur enabled/disabled" message... gens-qt4-GensConfig-v1
David Korth [Wed, 9 Feb 2011 05:31:19 +0000 (00:31 -0500)] 
[gens-qt4] VBackend::setFastBlur(): Print the "Fast Blur enabled/disabled" message to the OSD.

This message was lost with the conversion to the use of GensConfig
signals to update the Fast Blur state.

This message was originally printed in GensWindow::toggleFastBlur().

8 years ago[gens-qt4] Added an option for enabling/disabling bilinear filtering.
David Korth [Wed, 9 Feb 2011 05:29:30 +0000 (00:29 -0500)] 
[gens-qt4] Added an option for enabling/disabling bilinear filtering.

GensConfig.cpp: Added the bilinearFilter property to [Graphics].

GeneralConfigWindow.cpp: Added chkBilinearFilter save/load support.

GeneralConfigWindow_slots.cpp: Added a slot for chkBilinearFilter's toggled() signal.

ui/GeneralConfigWindow.ui: Added chkBilinearFilter.

VBackend/: Added bilinear filtering support to VBackend and GensQGLWidget.

8 years ago[gens-qt4] GensConfig.hpp: Fixed inverted prev/next save slot logic.
David Korth [Wed, 9 Feb 2011 05:22:52 +0000 (00:22 -0500)] 
[gens-qt4] GensConfig.hpp: Fixed inverted prev/next save slot logic.

setSaveSlot_Prev() was setting the next save slot, and
setSaveSlot_Next() was setting the previous save slot.

8 years ago[gens-qt4] VBackend.cpp: Implemented aspect ratio constraint configuration support.
David Korth [Tue, 8 Feb 2011 20:10:07 +0000 (15:10 -0500)] 
[gens-qt4] VBackend.cpp: Implemented aspect ratio constraint configuration support.

GensQGLWidget.cpp: Implemented aspect ratio constraint configuration support.

8 years ago[gens-qt4] GensWindow::~GensWindow(): Save the configuration file.
David Korth [Tue, 8 Feb 2011 19:33:45 +0000 (14:33 -0500)] 
[gens-qt4] GensWindow::~GensWindow(): Save the configuration file.

TODO: Figure out a better place to put this.

TODO: Config autosave.

8 years ago[gens-qt4] GensConfig.cpp: Implemented loading and saving.
David Korth [Tue, 8 Feb 2011 19:32:59 +0000 (14:32 -0500)] 
[gens-qt4] GensConfig.cpp: Implemented loading and saving.

QSettings() is used to load and save the configuration file.
The configuration file is stored in INI format on all platforms.

QColors are converted to strings using QColor::name() before saving.

Application version information is currently stored in [General].
It seems that QSettings always moves [General] to the top of the file,
so we can't simply save it in [Application]. If we did, it'd save to
the top of the file the first time, but then [General] would be moved
up later.

TODO: Move General settings to a different group, or keep them
in [General]?

8 years ago[gens-qt4] Separated manual pause from auto pause.
David Korth [Tue, 8 Feb 2011 17:08:36 +0000 (12:08 -0500)] 
[gens-qt4] Separated manual pause from auto pause.

gqt4_datatypes.h: New paused_t struct used for pause states.
It's a bitfield indicating manual pause and auto pause.

GensQGLWidget.cpp: Don't tint the window if paused via auto pause
but not via manual pause.

GensWindow::autoPause_changed_slot(): Undo auto pause if the
Auto Pause setting is disabled.

Everything else: Updated to work correctly with both auto pause
and manual pause, and to handle transitions for both of them.

8 years ago[gens-qt4] GeneralConfigWindow::setupUi_mac(): Remove the toolbar show/hide button...
David Korth [Tue, 8 Feb 2011 10:01:12 +0000 (05:01 -0500)] 
[gens-qt4] GeneralConfigWindow::setupUi_mac(): Remove the toolbar show/hide button from the titlebar. (Qt/Cocoa)

Of course, since Cocoa is Objective-C based, I had to rename
GeneralConfigWindow_mac.cpp to GeneralConfigWindow_mac.mm.

This is now the first Objective-C++ file in Gens/GS II.

8 years ago[gens-qt4] GeneralConfigWindow: Fixed unified titlebar/toolbar support with Qt/Cocoa.
David Korth [Tue, 8 Feb 2011 09:46:25 +0000 (04:46 -0500)] 
[gens-qt4] GeneralConfigWindow: Fixed unified titlebar/toolbar support with Qt/Cocoa.

Setting Qt::CustomizeWindowHint and disabling the maximize (zoom) button
breaks unified titlebar/toolbar on Qt/Cocoa, since Cocoa forces the
zoom button on if it thinks the window is resizable. (Carbon doesn't.)

Added a sizeHint() override, which returns the window's baseSize().

setupUi_mac(): Set the main window layout to fixed. This is needed in
order to disable the zoom button on Qt/Cocoa (and it works on Qt/Carbon).
Set a fixed size for the stacked widget (the same as the tab widget
as calculated by Qt Designer) in order to make sure it doesn't show
up with the wrong size.

ui/GeneralConfigWindow.ui: Set baseSize and unifiedTitleAndToolBarOnMac properties.
(unifiedTitleAndToolBarOnMac has no effect on non-Mac platforms.)

CMakeLists.txt: Since unifiedTitleAndToolBarOnMac is now set in the
UI file, we need at least Qt-4.3.0 on Mac OS X. We should probably
also set a minimum of 4.3.0 on other platforms, since the property's
set on all platforms (but has no effect on anything but Mac OS X).

8 years ago[WTF] [gens-qt4] GensWindow::qAppFocusChanged(): Check this->isAncestorOf(now), not...
David Korth [Tue, 8 Feb 2011 08:13:07 +0000 (03:13 -0500)] 
[WTF] [gens-qt4] GensWindow::qAppFocusChanged(): Check this->isAncestorOf(now), not this->isAncestorOf(NULL).

I was testing to see whether QWidget::isAncestorOf() would work with a
NULL pointer or not, and it did work (returning false). Problem is,
I forgot to undo that change before committing. Oops. :(

8 years ago[gens-qt4] GensWindow::qAppFocusChanged(): Use QWidget::isAncestorOf() instead of...
David Korth [Tue, 8 Feb 2011 08:06:51 +0000 (03:06 -0500)] 
[gens-qt4] GensWindow::qAppFocusChanged(): Use QWidget::isAncestorOf() instead of hard-coding only a few widgets.

Less code, more functionality. isAncestorOf() checks if the specified widget
is either a child of GensWindow or is GensWindow itself.

8 years ago[gens-qt4] GensWindow.cpp: Added a slot for setting Auto Pause if the setting is...
David Korth [Tue, 8 Feb 2011 07:59:00 +0000 (02:59 -0500)] 
[gens-qt4] GensWindow.cpp: Added a slot for setting Auto Pause if the setting is enabled.

EmuManager: Changed RQT_PAUSE_TOGGLE to RQT_PAUSE_EMULATION.
Unpausing is handled in pauseRequest(), not the emulation queue.
Toggling the pause status in doPauseRequest() results in emulation
pausing and then quickly unpausing if "Auto Pause" is enabled in
the General Configuration window and then Apply is clicked, since
two slots are triggered:

- autoPause_changed_slot()
- qAppFocusChanged().

TODO: Handle auto pause separately from manual pause.

8 years ago[gens-qt4] GensWindow.cpp: Implemented Auto Pause.
David Korth [Tue, 8 Feb 2011 07:47:54 +0000 (02:47 -0500)] 
[gens-qt4] GensWindow.cpp: Implemented Auto Pause.

If Auto Pause is enabled in the configuration, then whenever focus
changes in the application, GensWindow will send a Pause Request
to m_emuManager to either pause emulation (if it loses focus) or
to unpause emulation (if it gains focus).

TODO:

- Add reference counting for pause (to prevent conflicts with
  manual pause and Auto Pause).

- Disable the Pause Tint for Auto Pause.

8 years ago[gens-qt4] EmuManager::pauseRequest(bool): Added an overload for pauseRequest().
David Korth [Tue, 8 Feb 2011 07:45:02 +0000 (02:45 -0500)] 
[gens-qt4] EmuManager::pauseRequest(bool): Added an overload for pauseRequest().

This allows the paused state to be set specifically to paused or
unpaused instead of simply toggling it.

pauseRequest(bool) will be used to implement Auto Pause.

8 years ago[gens-qt4] GensConfig::GensConfig(): Auto Fix Checksum should default to true.
David Korth [Tue, 8 Feb 2011 07:23:22 +0000 (02:23 -0500)] 
[gens-qt4] GensConfig::GensConfig(): Auto Fix Checksum should default to true.

I changed it to default to false while testing emitAll(), but accidentally
committed said change in commit 7becac8100c436b3bd65c4a3a6465827fde8b8c0.

8 years ago[gens-qt4] VBackend/VBackend.cpp: Added functionality to lock the OSD.
David Korth [Tue, 8 Feb 2011 05:54:46 +0000 (00:54 -0500)] 
[gens-qt4] VBackend/VBackend.cpp: Added functionality to lock the OSD.

This will be used when loading configuration settings to prevent
stray messages from appearing on the OSD.

osd_vprintf() and osd_show_preview() will ignore any requests if
the OSD is locked.

recSetStatus() and recSetDuration() are not affected, since they're
not used by any configuration functions. (They will be used for
indicating in-progress recordings and/or playback later.)

8 years ago[gens-qt4] GensConfig::setSaveSlot(): Allow setting the same save slot.
David Korth [Tue, 8 Feb 2011 05:50:35 +0000 (00:50 -0500)] 
[gens-qt4] GensConfig::setSaveSlot(): Allow setting the same save slot.

This is needed in order to view the preview of the currently selected
save slot. (Press the number of the slot to view the preview.)

Without this, if the current save slot were selected again in order
to view the preview, nothing would happen.

8 years ago[gens-qt4] GensConfig::emitAll(): New function to emit all configuration changes.
David Korth [Tue, 8 Feb 2011 05:40:52 +0000 (00:40 -0500)] 
[gens-qt4] GensConfig::emitAll(): New function to emit all configuration changes.

This function will be used at startup in order to load all of the
settings into the emulator.

GensWindow::GensWindow(): Call gqt4_config->emitAll() to load all
of the settings into the emulator.

8 years ago[gens-qt4] CtrlConfigWindow.cpp: Removed some GensKeySequenceWidget testing code.
David Korth [Tue, 8 Feb 2011 05:40:01 +0000 (00:40 -0500)] 
[gens-qt4] CtrlConfigWindow.cpp: Removed some GensKeySequenceWidget testing code.

This was added for testing GensKeySequenceWidget and wasn't
supposed to be committed, but I accidentally committed it in
commit b0be06e95174e8a698c78041480c8082cd1aaada.

8 years ago[gens-qt4] EmuManager::autoFixChecksum_changed_slot(): Apply change immediately if...
David Korth [Tue, 8 Feb 2011 05:37:59 +0000 (00:37 -0500)] 
[gens-qt4] EmuManager::autoFixChecksum_changed_slot(): Apply change immediately if (!m_rom || m_paused).

Changing Auto Fix Checksum doesn't require a ROM to be loaded.

8 years agoMoved the fixChecksum() / restoreChecksum() calls to EmuContext and EmuMD.
David Korth [Tue, 8 Feb 2011 05:29:09 +0000 (00:29 -0500)] 
Moved the fixChecksum() / restoreChecksum() calls to EmuContext and EmuMD.

EmuContext now has a global setting for AutoFixChecksum, which is
set by EmuManager whenever it's changed in GensConfig.

8 years ago[gens-qt4] EmuManager: Autofix the ROM checksum based on user settings on load and...
David Korth [Tue, 8 Feb 2011 05:15:23 +0000 (00:15 -0500)] 
[gens-qt4] EmuManager: Autofix the ROM checksum based on user settings on load and reset.

TODO: Move the autofix calls to LibGens.

8 years ago[libgens] EmuContext.cpp: Added functions to fix and restore the ROM checksum.
David Korth [Tue, 8 Feb 2011 05:14:04 +0000 (00:14 -0500)] 
[libgens] EmuContext.cpp: Added functions to fix and restore the ROM checksum.

fixChecksum() calculates the ROM checksum and replaces the ROM header's
value with the correct checksum.

restoreChecksum() restores the saved ROM checksum from ROM load to
the ROM header.

8 years ago[libgens] Rom::checksum(): Added an accessor for the ROM header checksum.
David Korth [Tue, 8 Feb 2011 05:13:34 +0000 (00:13 -0500)] 
[libgens] Rom::checksum(): Added an accessor for the ROM header checksum.

8 years ago[gens-qt4] CMakeLists.txt: Reworked Qt component detection.
David Korth [Tue, 8 Feb 2011 04:42:08 +0000 (23:42 -0500)] 
[gens-qt4] CMakeLists.txt: Reworked Qt component detection.

- Mark all components as optional, and then fail later if a required
  component isn't found.

- Always search for QtDBus, since calling FIND_PACKAGE(Qt4) multiple
  times isn't guaranteed to work.

- Forcefully disable QtDBus on Mac OS X. It was getting enabled for
  some reason, resulting in FindCdromUDisks being compiled on Mac OS X
  when it's completely useless on that platform.

8 years ago[gens-qt4] Moved Win32 resources from ui/ to ui/resources/win32/.
David Korth [Mon, 7 Feb 2011 19:56:04 +0000 (14:56 -0500)] 
[gens-qt4] Moved Win32 resources from ui/ to ui/resources/win32/.

Mac resources are stored in ui/resources/mac/, so Win32 resources
should be in ui/resources/win32/.

(The Win32 icons were already in ui/resources/win32/, but the manifest
and resource script were not.)

8 years agoCMakeLists.txt: Added Mac OS X bundle support.
David Korth [Mon, 7 Feb 2011 19:31:00 +0000 (14:31 -0500)] 
CMakeLists.txt: Added Mac OS X bundle support.

Gens/GS II is now compiled as a bundle on Mac OS X.

ui/resources/mac/Info-CMake.plist: Info.plist template for CMake.
This sets the bundle name to "Gens/GS II" and provides other information,
such as the icon name.

ui/resources/mac/gensgs.icns: Gens/GS II icon, in Mac OS X format.
This only contains the 16x16 and 32x32 icons, since ICNS doesn't
support 48x48 (or even 64x64!).

TODO: Get 64x64 and 128x128 icons. (Maybe 256x256 and 512x512 too?)

8 years ago[gens-qt4] widgets/GensKeySequenceWidget.cpp: Removed the commented-out moc #include...
David Korth [Mon, 7 Feb 2011 18:04:28 +0000 (13:04 -0500)] 
[gens-qt4] widgets/GensKeySequenceWidget.cpp: Removed the commented-out moc #include at the bottom of the file.

We can't #include the moc because we're not using KDE's automoc4.

8 years ago[gens-qt4] widgets/GensKeySequenceWidget.cpp: Cancel recording if the GensKeySequence...
David Korth [Mon, 7 Feb 2011 18:03:39 +0000 (13:03 -0500)] 
[gens-qt4] widgets/GensKeySequenceWidget.cpp: Cancel recording if the GensKeySequenceButton loses focus.

KKeySequenceButton is missing this feature, and it's really useful.
I should probably submit a patch upstream.

8 years ago[gens-qt4] widgets/GensKeySequenceWidget.cpp: Initial key sequence widget.
David Korth [Mon, 7 Feb 2011 17:58:45 +0000 (12:58 -0500)] 
[gens-qt4] widgets/GensKeySequenceWidget.cpp: Initial key sequence widget.

Based on KKeySequenceWidget from kdelibs-4.6.0, with unnecessary
functionality removed (e.g. multi-key shortcuts).

TODO: Fix unsupported shifted keys, e.g. Shift-1.

TODO: Show error messages when appropriate.

8 years ago[gens-qt4] Mac OS X: Remove window icons from all windows.
David Korth [Mon, 7 Feb 2011 12:01:22 +0000 (07:01 -0500)] 
[gens-qt4] Mac OS X: Remove window icons from all windows.

Window icons are treated as "proxy icons", and only make sense if
a document is open.

TODO: Add an icon to the Gens window if a ROM is loaded?

8 years ago[gens-qt4] GeneralConfigWindow_mac.cpp: Mac-specific changes suggested by SuitCase.
David Korth [Mon, 7 Feb 2011 11:58:18 +0000 (06:58 -0500)] 
[gens-qt4] GeneralConfigWindow_mac.cpp: Mac-specific changes suggested by SuitCase.

- Left-align the toolbar icons.

- Remove the window icon. This is a "proxy icon" on Mac OS X, and only
  makes sense if the window has a document open.

8 years agoTAGS.txt: New tag: gens-qt4-GeneralConfigWindow-v5
David Korth [Mon, 7 Feb 2011 10:31:14 +0000 (05:31 -0500)] 
TAGS.txt: New tag: gens-qt4-GeneralConfigWindow-v5

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