Debian 8 has GTK+ 3.14.5, so this caused the build to fail.
Check for GTK+ [3.15.8, 3.21.5). If it's anywhere in that range,
use gtk_popover_set_transitions_enabled(); otherwise, don't.
On LE, we need to rotate the channels value right by 8 bits.
On BE, we need to rotate the channels value *left* by 8 bits.
Remove be32_to_cpu() and adjust the SWZ_CH_? values to use the big-endian
values (B=3,G=2,R=1,A=0) on both BE and LE.
This fixes the following (and only) test failures on RomHeaderTest
on Debian 8 on PowerPC (via qemu):
[ FAILED ] 3 tests, listed below:
[ FAILED ] DDS_Blender/ImageDecoderTest.decodeTest/DDS_Blender_tex_cmp_bc3nm_dds_gz_Image, where GetParam() = DDS_Blender/tex_cmp_bc3nm.dds.gz
[ FAILED ] DDS_Blender/ImageDecoderTest.decodeTest/DDS_Blender_tex_cmp_bc3rxgb_dds_gz_Image, where GetParam() = DDS_Blender/tex_cmp_bc3rxgb.dds.gz
[ FAILED ] KTX2/ImageDecoderTest.decodeTest/KTX2_luminance_alpha_reference_u_ktx2_gz_Image, where GetParam() = KTX2/luminance_alpha_reference_u.ktx2.gz
The byteswapping code was checking for SYS_LIL_ENDIAN, which means it
was only compiled in on little-endian systems, not big-endian systems.
The le*_to_cpu() macros are no-ops on little-endian systems, so it
didn't cause a problem on LE, but it broke on BE.
This fixes the following (and only) test failures on RomHeaderTest
on Debian 8 on PowerPC (via qemu):
[ FAILED ] 4 tests, listed below:
[ FAILED ] DreamcastSave/RomHeaderTest.Text/BIOS002_VMS, where GetParam() = BIOS002.VMS
[ FAILED ] DreamcastSave/RomHeaderTest.Text/SONIC2C_VMS, where GetParam() = SONIC2C.VMS
[ FAILED ] DreamcastSave/RomHeaderTest.JSON/BIOS002_VMS, where GetParam() = BIOS002.VMS
[ FAILED ] DreamcastSave/RomHeaderTest.JSON/SONIC2C_VMS, where GetParam() = SONIC2C.VMS
This *usually* didn't cause any problems when using Windows Explorer,
but Directory Opus appears to do its own subclassing. The end result
is Directory Opus crashes when selecting the rom-properties tab in
file properties.
NOTE: Since it's a dialog procedure, it needs to return FALSE instead of
calling DefWindowProc, and definitely not DefDlgProc.
As per MSDN: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-defdlgprocw
The **DefDlgProc** function must not be called by a dialog box procedure;
doing so results in recursive execution.
Fixes#405: Crash when used inside Directory Opus
Reported by @Kugelblitz360.
kdeinit6 doesn't exist, but we can check KDE_SESSION_VERSION instead.
This variable has been set since KDE 4.
Without this change, rp-config would always use the KF5 version on
KF6 because it couldn't find any matching kdeinit process.
TODO: Only check KDE_SESSION_VERSION instead of checking processes?
NEWS.md: Mention this.
There's a bit of weirdness with Intellivision due to its unusual word
size. The General Instrument CP1610 is a 16-bit CPU, but uses 10-bit
opcodes. Because of this, Mattel used 10-bit ROMs. Some of the fields
in the ROM header use 16-bit addresses, split up into two 10-bit words.
The ROM file uses 16-bit big-endian for words, so in order to decode
these addresses, we have to take two 16-bit big-endian values, read
the low 8 bits of each, and combine it into a 16-bit value.
NOTE: ROM images must have a .int or .itv file extension, since the
Intellivision ROM header doesn't have a magic number.
On GTK3 at least, "standard sorting" is case-insensitive. This may or
may not be changed in future versions, so implement it ourselves.
sort_funcs.c: New function sort_RFT_LISTDATA_standard().
Some SDK tools generate save files with no icon or comment. The icon
or comment addresses in this case is 0xFFFFFFFF.
Also, split the comment code into a separate function, getComment().
Based on loadFieldData()'s version, which has a union+struct to
separate the desc and file sections.
Reported by RedBees.
ARM64EC was added at the same time as general amd64 emulation in
Windows 11 build 21277 (actually 21262, a leaked build).
On Windows 10, don't register for either amd64 or arm64ec.
See #398: Installing on ARM64 shows an error that the AMD64 version
of the DLL couldn't be registered
Reported by @kristibektashi.
On Windows 10, only install for amd64 if using build 21277 or later,
since that's when amd64 emulation was added.
Fixes#398: Installing on ARM64 shows an error that the AMD64 version of
the DLL couldn't be registered
Reported by @kristibektashi.
Instead of requiring each RomData subclass (GameCube, PSP, etc.) to
explicitly handle various sparse disc formats, have RomDataFactory
check for sparse disc images itself. That way, if one is found, the
appropriate SparseDiscReader subclass can be opened and the disc read
as if it's a flat disc image.
Among other things, this adds support for ZISO and PSP CISO formats
for PS2 loaders. It also technically allows those formats to be used
for GameCube and Wii disc images, though it doesn't make much sense.
Tested by converting a GameCube disc image to multiple formats,
including GameCube CISO, GCZ, PSP CISO, JISO, ZISO, and DAX.
Fixes#397: Could you add support for PS2 ISO's compressed to zso and cso?
Reported by @60fpshacksrock.
hMyKey was never destroyed in the CTR path; only the ECB and CBC path.
Also: s/EBC/ECB/
Not too noticeable, since this would only show up if a user attempted to
view an encrypted Nintendo 3DS ROM image on Windows XP. (On Windows Vista
and later, AesCAPI_NG is used instead.)
There's no way to wait for the user to select the "ROM Properties"
section, since NautilusPropertiesModel is an abstract model, not an
actual GtkWidget.
This CPU type is used by the old MSVC for Mac.
0x01F2, the CPU type for Xbox 360, is now "PowerPC (big-endian; Xenon)".
FIXME: Subsystem version on the test DLL is "1024.32768". Byteswapping
this results in "4.128", which is still not quite right. Import and
export tables aren't showing up either, which probably means some
fields are in big-endian that are normally in little-endian.
Fixes#396: PE machine value 0x0601 == PowerPC big-endian (classic Mac)
Reported by @Wack0.
It was incorrectly using the battery-backed PRG RAM size for both
fields.
Also, show PRG RAM before CHR RAM for consistency with PRG ROM and
CHR ROM.
Found using ubsan:
src/libromdata/Console/NES.cpp:1079:24: runtime error:
shift exponent -1 is negative
This has been broken since NES 2.0 PRG RAM fields were added in
commit 6e9206b03e.
([libromdata] NES: Added NES 2.0 PRG RAM fields.)
Affects: v1.1 - v2.2.1
Re-generated the NES test files.
The table needs MD_IOSH_* values, but a few were using MD_IO_*:
- Team Player
- Light Gun
- Activator
- Tablet
- Paddle
Re-generated MD, 32X, and Pico test files.
NOTE: Some Pico games have 'V' (Paddle), which doesn't make sense because
the Pico doesn't have a detachable controller...
Found using ubsan in RomHeaderTest:
src/libromdata/Console/MegaDrive.cpp:307:15: runtime error:
shift exponent 52 is too large for 32-bit type 'unsigned int'
This fixes a regression from commit 7fe699aae4.
([libromdata] MegaDrive::parseIOSupport(): Use an index-based lookup table.)
Affects: v2.0 - v2.2.1
This should fix issues on Linux systems where Nintendo 3DS files weren't
detected by rom-properties due to Citra registering its own MIME types.
See issue #382: Errors in KDE
This particular issue was diagnosed by @dnmodder.
RpImageRole was no longer being set.
Note that Dolphin 23.04.3 has issues receiving drags when using Wayland,
but it works when using X11.
This broke in Oct 2020 when the ListData views were reworked from
QTreeWidget to QTreeView in order to implement sorting.
See these commits:
commit a97b59ab6c
([kde] Split most of the RFT_LISTDATA QListView code into a separate QAbstractListModel subclass.)
commit 4a557a8e9a
([kde] ListDataMode; Handle icons.)
Affects: v1.8 - v2.2.1
This is still needed for IDD_CONFIG_KEYMANAGER in the localized
Win32 .rc files. It is *not* needed in libromdata.
As a result, the Key Manager tab wasn't showing up in the Windows build,
since the dialog resource was missing.
TODO: Move this to cmake/win32.cmake instead?
This fixes a regression from commit 0956573212.
(Don't translate the KeyManager Import menu actions.)
Affects: 2.2.1
I'm not sure when exactly this broke (possibly when it was rewritten to
use a signal handler instead of a modal event loop), but on GTK4, the
file chooser dialog no longer appeared when attempting to import a file.
(...actually, this may have been broken on GTK4 since GTK4 support was
added in v2.1, but it worked on GTK3 without gtk_window_present()...)
RomDataView_ops.cpp: Use gtk_window_present() instead of gtk_widget_show()
for the GtkFileChooserDialog, and call it on GTK4 in addition to GTK2/GTK3.
This hasn't been tested on GTK4 yet due to GTK4 Nautilus not supporting
full property pages, but I assume GtkFileChooserDialog would not have
shown up properly there, too.
TODO: Switch to GtkFileDialog on GTK 4.10 and later.
Among other things, this fixes an issue where the displayed timestamp
was in UTC instead of the local timezone. This issue appears to have
been present since AchievementsTab was first implemented on Windows.
Not sure why I didn't notice it before...
Initial commit: 2f93817740
([win32] AchievementsTab: Initial version for Windows.)
Affects: v1.8 - v2.2.1
We no longer have an empty string at the end of cgbSpecialCases[], so we
need to use an explicit count.
Found via clang-tidy 16.0.4:
DMGSpecialCases.cpp:260:12: warning: The left operand of '!=' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
p[0] != '\0'; p += sizeof(cgbSpecialCases[0]))
~~~~ ^
DMGSpecialCases.cpp:259:2: note: Loop condition is true. Entering loop body
for (const char *p = &cgbSpecialCases[0][0];
^
DMGSpecialCases.cpp:262:7: note: Assuming the condition is false
if (!strncmp(p, id6, 6)) {
^~~~~~~~~~~~~~~~~~~
DMGSpecialCases.cpp:262:3: note: Taking false branch
if (!strncmp(p, id6, 6)) {
^
DMGSpecialCases.cpp:260:12: note: The left operand of '!=' is a garbage value
p[0] != '\0'; p += sizeof(cgbSpecialCases[0]))
~~~~ ^
Affects: v2.2.1 (maybe; I didn't see any crashes...)
This improves error messages if a file cannot be found, e.g. the
Nintendo DS blowfish key file.
This bug exists since at least commit 6991e61964.
([librpbase] Improved device file recognition.)
Affects: v1.4 - v2.2.1 (and possibly earlier versions)
This appears to have been a debugging line I forgot to remove when
splitting OptionsMenuButton out of RP_ShellPropSheetExt... two years
ago! The end result is Options menu items will always be disabled
after using them once, so the properties window will need to be closed
and reopened in order to use them again.
This fixes a regression from commit d03f577cb1.
([win32] OptionsMenuButton: Split out from RP_ShellPropSheetExt.)
Affects: v1.8 - v2.2.1
There's no point in keeping a grayed-out entry just because *some*
3DS CIAs can have embedded SRLs. Only show the entry for CIAs that
actually *do* have embedded SRLs.
If the new pointer position after reading the current attribute name
*equals* the ending position, then we're fine. It's only if the new
position is greater than the ending position that we have a problem.
Not sure how this worked before... (or maybe I just didn't notice that
only one xattr was showing up in rom-properties cache files; which one
is seemingly random...)
On Ubuntu, the non-versioned symlink is only available if the -dev
packages are installed. This means that the GTK UI frontend has
potentially been broken on non-development Ubuntu systems since
at least v1.6.
Thumbnails for images that were taller than they were wide appeared
squished with squaring enabled, even though the generated image is
correct. Not sure why this is happening...
Windows XP had issues with non-square icons, but Windows 7 seems to be
handling them without any problems.
See #385: Ratio of ps2 longbox thumbnails looks wrong?
v2.2 added JSON plugin metadata to the forwarder plugins. Unfortunately,
KFileMetaData uses a completely different format than other KDE plugins,
which broke metadata extraction.
This was broken in v2.2.
It seems this causes cover art for e.g. Wii U and PS2 to be squished.
I'm pretty sure it worked before, though...
The Win32 CreateThumbnail class now takes a parameter, doSquaring.
It's set to false by default, but RP_ExtractIcon sets it to true.
CreateThumbnail::rpImageToImgClass() will only square the image if
the doSquaring parameter was set to true in the constructor.
CreateThumbnailNoAlpha also has the parameter, though since this class
is only used by RP_ExtractImage, it will stay false.
Fixes#385: Ratio of ps2 longbox thumbnails looks wrong?
Reported by @Masamune3210.
WIA/RVZ stores an uncompressed copy of the disc header at the beginning
of the file. We were using this just fine, but this was accidentally
broken when detection for standalone Wii update partitions containing
Incrementing Values was added.
This was broken in v2.2.
This fixes a regression from commit dd414bc544.
([libromdata] GameCube: Handle standalone Wii update partitions containing Incrementing Values.)
Fixes#389: Gamecube Property sheet is blank
Reported by @Masamune3210.
For some reason, we're getting a showEvent() when the propreties dialog is
opened in addition to when the tab is selected. paintEvent() only happens
when the tab is selected, so move achievement checking there.
Note that this doesn't happen in ConfigDialog; the update checkeer in
AboutTab only triggers when the tab is selected. It's probably a minor
implementation detail in KDE's KPropertiesDialog.
I forgot to add this when initially implementing this function.
Commit 43db21debf:
([win32] OptionsTab: Add the new metered/unmetered dropdowns.)
Affects: 2.1
The date is available in __update.inf, and can help to disambiguate
update partitions that have the same system menu version but different
IOS and/or channel WADs.
Requested by @johnsanc314.
It's mostly working, except the FreeBSD version hasn't been tested yet,
and BackupRead() isn't implemented for older versions of Windows.
Conflicts:
NEWS.md
This allows for proper thumbnailing on Linux when using the default
.bin file extension.
Fixes#370: Amiibos without thumbnails (Gnome)
Reported by @Amnesia1000.
Also change the default icon from "application-x-executable" to
"application-octet-stream".
g_key_file_load_from_file() will fail if the files don't exist.
Check the GError, and if it's G_FILE_ERROR_NOENT, continue saving
anyway.
This also fixes the Apply and Reset buttons not being disabled after
applying changes, since it never got to that part due to the error.
TODO: Show error messages?
Fixes#368: rp-config does not save configuration and keys in Manjaro Gnome.
Reported by @Amnesia1000.
Need to use RENAME to rename the file, not INSTALL. Using INSTALL ends up
creating a subdirectory instead of renaming the file.
Fixes#367: "rp-config.desktop" file error
Reported by @Amnesia1000.
MSVC complains now because these classes are dllexport in order to fix
a build issue with RpPngFormatTest on Ubuntu 18.04:
src\librpfile/MemFile.hpp(150,15): warning C4251: 'LibRpFile::MemFile::m_filename':
class 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>'
needs to have dll-interface to be used by clients of class 'LibRpFile::MemFile'
src\librpfile\VectorFile.hpp(136,24): warning C4251: 'LibRpFile::VectorFile::m_vector':
class 'std::vector<uint8_t,std::allocator<uint8_t>>' needs to have dll-interface
to be used by clients of class 'LibRpFile::VectorFile'
For MemFile, use a char* instead of std::string. This has a nice side
effect of reducing memory usage a bit.
For VectorFile, allocate the vector using new. This might have slight
additional overhead, since there's another pointer dereference.
VectorFile is currently only used by gtk/DragImage.cpp, so it isn't
a significant issue.
Note that since these fields are used by inline functions, changing them
*does* break the ABI, even though none of the symbols have changed, so the
libromdata SOVERSION was bumped to 2.
For rom-properties 2.0, only the Ubuntu 18.04 and later builds had the
prior changes to export MemFile, IRpFile, and RefBase, so the Windows
version didn't have that change and thus didn't need this ABI-breaking
change.
We're reading a 2352-byte sector, so we have to compare the read size
against the sector size, not the size of d->pvd (2048).
This fixes a regression from commit 5eeeeb5bd1.
([libromdata] ISO, PlayStationDisc: Added support for 2448-byte sector file formats.)
This broke in v1.8.
Fixes#354: PS2 BIN/CUE CD Mode 2 images aren't detected
Reported by @DankRank.
TMNT Mutant Melee [GE5EA4] has CRs at the end of the filename and
description fields. I'm not sure if it's actually included as part
of the filename on the memory card, but it looks ugly here, so
remove the CR.
NOTE: rpcli was showing it as '␍', but UI frontends were sometimes
handling it as a linebreak.
TODO: Maybe make the UI frontends show it as '␍' and don't trim it?
A crash was reported when using Ghidra with rom-properties installed.
It turns out that AWT's Windows icon extraction function calls
IExtractIconW::Extract() with phiconSmall == nullptr, which *is*
valid as per MSDN documentation, but we didn't handle this properly.
Handle the case by checking for nullptr arguments, and if found, don't
attempt to write to phiconSmall (or phiconLarge). In addition, delete
the icon that would have been returned if the parameter wasn't nullptr.
Ghidra stacktrace: (Adoptium JDK 17.0.4.1) [rom-properties 1.9 release build]
Stack: [0x0000006e80600000,0x0000006e80700000], sp=0x0000006e806fe5c0, free space=1017k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [rom-properties.dll+0x7617]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 13468 sun.awt.shell.Win32ShellFolder2.extractIcon(JJIZ)J java.desktop@17.0.4.1 (0 bytes) @ 0x000001796011f86e [0x000001796011f820+0x000000000000004e]
j sun.awt.shell.Win32ShellFolder2.lambda$getIcon$0(I)Ljava/awt/Image;+148 java.desktop@17.0.4.1
j sun.awt.shell.Win32ShellFolder2$$Lambda$834+0x00000007c0c7b170.call()Ljava/lang/Object;+8 java.desktop@17.0.4.1
J 13324 c1 sun.awt.shell.Win32ShellFolderManager2$ComInvoker.invoke(Ljava/util/concurrent/Callable;)Ljava/lang/Object; java.desktop@17.0.4.1 (108 bytes) @ 0x000001795854e7fc [0x000001795854dca0+0x0000000000000b5c]
J 13368 c1 sun.awt.shell.ShellFolder.invoke(Ljava/util/concurrent/Callable;Ljava/lang/Class;)Ljava/lang/Object; java.desktop@17.0.4.1 (70 bytes) @ 0x0000017958dcb1cc [0x0000017958dcb160+0x000000000000006c]
J 13438 c1 sun.awt.shell.ShellFolder.invoke(Ljava/util/concurrent/Callable;)Ljava/lang/Object; java.desktop@17.0.4.1 (11 bytes) @ 0x000001795968bc9c [0x000001795968bc40+0x000000000000005c]
j sun.awt.shell.Win32ShellFolder2.getIcon(II)Ljava/awt/Image;+13 java.desktop@17.0.4.1
j sun.awt.shell.Win32ShellFolder2$15.call()Ljava/awt/Image;+470 java.desktop@17.0.4.1
j sun.awt.shell.Win32ShellFolder2$15.call()Ljava/lang/Object;+1 java.desktop@17.0.4.1
J 13362 c1 java.util.concurrent.FutureTask.run()V java.base@17.0.4.1 (123 bytes) @ 0x000001795990c224 [0x000001795990ba40+0x00000000000007e4]
j java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V+92 java.base@17.0.4.1
j java.util.concurrent.ThreadPoolExecutor$Worker.run()V+5 java.base@17.0.4.1
j sun.awt.shell.Win32ShellFolderManager2$ComInvoker$1.run()V+7 java.desktop@17.0.4.1
j java.lang.Thread.run()V+11 java.base@17.0.4.1
v ~StubRoutines::call_stub
siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), writing address 0x0000000000000000
Fixes#352: Ghidra crashes when rom-properties is installed on Windows
Reported by @RibShark.
fopen() will hang if it's a pipe or socket with no data available, since
fopen() doesn't pass O_NONBLOCK.
Fixes#351: Dolphin hangs when accessing a directory containing a FIFO
Reported by @IntriguingTiles.
Forza Motorsport (2005) has a few textures that have non-power-of-two
sizes. These textures use a different encoding for width/height, in
which the normal shift values are both 0. Handle this so these XPRs
can be decoded properly.
This was reported by Trash_Bandatcoot.