Increased the CMake version requirement to 2.8.12.
Added QT4_NO_LINK_QTMAIN and Qt5_NO_LINK_QTMAIN, even though the
KDE plugin isn't going to be built on Windows.
Added -DQT_NO_DEBUG for release builds.
Only the base RomData field accessors can be used now.
Combined the original MegaDrive code with the RomData code so it
adds the fields as it parses the header.
byteswap.h: Add casts to __swab16() and __swab32() to get rid of
some warnings caused by printf format strings.
[kde] Removed MegaDriveView.
On my ThinkPad T60p, it's defaulting to Release. On a Kubuntu 16.04 VM,
it was defaulting to "none", so it didn't add debug flags, and it didn't
add release flags, either.
TODO: Switch the default to Release later?
- RomData::addField_string_numeric(): Add a numeric field as a string,
with support for decimal, hexadecimal, and octal, and a leading
digit specifier.
- ascii_to_rp_string() Fast function that converts 7-bit ASCII to
rp_string. (Do NOT use Latin-1 or UTF-8 here!)
Updated MegaDrive to use these functions where appropriate, including
the checksum field.
data() doesn't have to ensure that the string is NULL-terminated,
and since we're using an explicit size here anyway, we don't need
to use c_str() to ensure the presence of the NULL terminator.
(...actually, do any current C++ STLs handle data() like that?)
RomPropertiesDialogPlugin currently adds two tabs:
- MegaDriveView ("ROM Properties")
- RomDataView ("RomDataView")
This is only being done for comparison purposes. Once RomDataView is
finished (and LibRomData::MegaDrive is fully updated), MegaDriveView
will be removed.
So far, all strings prior to "Checksum" show up as expected.
This class defines the types of fields and will be populated by
subclasses in order to allow a more generic UI to be written,
instead of having to write one UI per platform per ROM type.
MegaDrive currently fills in the field types and adds the string
fields, but not the numeric fields or bitfields.
TextFuncs: New functions for rp_char/rp_string:
- rp_strlen()
- rp_strdup() - returns an rp_char* duplicate.
This is similar to the Windows macro _T(), except it uses rp_char
instead of TCHAR.
MegaDrive, MegaDrivePublishers: Use _RP() to store native UTF-16
(and UTF-8) strings depending on build type. This reduces runtime
conversion overhead and simplifies the code a bit.
Split RomPropertiesDialogPluginFactory into separate files. Note that
separate files are needed for KDE4 and KDE5 due to changes in automoc.
automoc4 complains if it has an #include for .moc, whereas automoc5
doesn't recognize that K_PLUGIN_FACTORY() has a Q_OBJECT macro, so it
fails to link due to undefined references to a vtable.
cmake/options.cmake: Added BUILD_KDE4 and BUILD_KDE5 options.
Both default to ON, but if the dependencies are missing, then their
respective plugins won't be built.
KDE4_ADD_PLUGIN() builds the library in build/lib/ instead of
build/src/kde/, so objcopy couldn't find the .debug file.
Note that objcopy only embeds the filename portion, not the full path,
so this won't cause any problems when debugging.
Minor change in SplitDebugInformation to handle CMake linking the
shared library in build/lib/ instead of build/src/kde/.
Added options for SPLIT_DEBUG and INSTALL_DEBUG, though INSTALL_DEBUG
isn't currently used.
Reference: http://segaretro.org/Third-party_T-series_codes
MegaDrive: Parse the copyright line to determine the publisher.
TextFuncs: New function utf8_to_rp_string(). This is effectively a no-op
in the RP_UTF8 build, and converts UTF-8 to UTF-16 in the RP_UTF16 build.
[kde] MegaDriveView: Renamed company to publisher, and moved it to right
below the copyright label.
Qt uses UTF-16 natively, so using libromdata16 is faster and requires
fewer UTF conversions.
rpToQS(): Inline function to make it easier to convert from rp_string
to QString.
Two new types based on the build type:
- rp_char: char type
- rp_string: string type
TextFuncs: New function cp1252_sjis_to_rp_string() that attempts to
convert from Shift-JIS to rp_string. If that fails, it converts from
cp1252 instead.
Text conversion functions copied from Gens/GS II.
[kde] Link to libromdata8. (TODO: Link to libromdata16 instead.)
Some stuff was stripped out, including support for ANSI Windows.
The minimum version I'm officially going to support once I add
Windows support is XP, though 2000 might "just work".
It currently doesn't show anything yet, but it now shows up if it
detects that the ROM is a Sega Mega Drive ROM.
MegaDrive: Added the implementation for isValid() and removed the
declaration for ~MegaDrive().
The first class in libromdata, MegaDrive, parses Mega Drive ROM headers.
It's not complete yet, but it's usable.
TODO:
- Decode cp1252/shift-jis to UTF-8/UTF-16.
- Build UTF-8 (GTK+) and UTF-16 (Qt, Windows) libraries.
The initial version adds a blank "ROM Properties" tab to the
file properties dialog in KDE4.
NOTE: KDE4 on my system doesn't seem to look in /usr/local, so the
plugin must be installed in /usr in order to work.