Commit Graph

163 Commits

Author SHA1 Message Date
David Korth
da94256a37 [xdg] mime.no-thumbnail.types: Add Windows icon/cursor MIME types.
FIXME: KDE isn't showing the ROM Properties tab on .ico files,
but Thunar and Nautilus show it just fine...
2025-06-09 20:00:09 -04:00
David Korth
86638f478c [xdg] rom-properties.xml: Add GameCube/Wii executables (.dol).
.dol files aren't currently supported by rom-properties. shared-mime-info
is misidentifying them as image/vnd.microsoft.icon, which is clearly
wrong, so add this to fix the identification.
2025-05-17 14:36:18 -04:00
David Korth
ee72b69be2 [xdg] com.gerbilsoft.rom-properties.metainfo.xml: Add v2.4.1 and v2.5. 2025-04-20 01:12:11 -04:00
David Korth
96c801298f [libromdata] Nintendo3DS_SMDH: Add ".icn" as a valid file extension. 2025-04-19 22:56:30 -04:00
David Korth
1cd09c3039 [librptexture] Qoi: New parser for the Quite OK Image Format.
qoi.h is used for upstream, instead of writing a custom decoder.
I may write a custom decoder later to decode the Qoi data directly
into an rp_image without having an intermediate step.
2025-03-17 18:10:03 -04:00
David Korth
128c4e178a [libromdata] J2ME: Add support for .jad files.
If the file is a .zip, it will be handled as .jar. Otherwise, it will be
handled as .jad, which is just MANIFEST.MF.

Improved MANIFEST.MF parsing:
- Skip the UTF-8 BOM, if present.
- Handle multi-line entries. If a line starts with a space, then it's
  part of a multi-line entry, so add it to the previous entry.
- Ignore .jad file digest tags.
- Add some more tags.

All of the .jad files I've tested work, and with the MANIFEST.MF parsing
improvements, the following .jar files now work:

These .jar files are missing at least one of the the MicroEdition-*
tags, but do have Manifest-Version and/or MIDlet-1:

- Atomic-88641.jar
- Football_Quiz_128x128-425421.jar

These .jar files had the MicroEdition-* tags, but also have multi-line
entries, which may be why they work now with the multi-line
implementation:

- Snow_Rally_City_Stage_240x320-532400.jar
- Super-G_Stunt_240x320-532401.jar

These .jar files have a newline in one of the entries, which broke
parsing of a MicroEdition-* tag:

- Stalker_3D_240x320S40v3-80779.jar
- Wallbreaker_2_Deluxe_240x320_Nokia_N73-446777.jar

These .jar files have Unicode text in MANIFEST.MF, including a UTF-8 BOM
at the beginning, which prevented "MIDlet-1" from being read, hence no
icon showing up, but they *were* detected as J2ME applications:

- Anger_Veyron_240x320Foreign-68651.jar
- Interest_Blade_Soul_Edition_240x320Japanese-59959.jar
- Lament_Island_240x320-96946.jar
- Mad_Boxing_Beast_240x320Foreign-79836.jar
- The_Evil_One_Fighting_176x208-63758.jar
2025-02-02 15:01:38 -05:00
David Korth
26c07a7680 [xdg] rom-properties.xml: Disable the "Root" heuristic for DSi TADs for now.
Some Wii WADs I have matched this heuristic, which caused them to be
misidentified as DSi TADs by file browsers and the `mimetype` command.
2025-01-18 11:20:46 -05:00
David Korth
3ef17264af [libromdata] J2ME: Initial J2ME application package parser.
J2ME application packages are standard Java .jar files (zip archives)
with MicroEdition tags in MANIFEST.MF. These files are detected first
by checking for the zip magic number, then reading tags from the
MANIFEST.MF file.

TODO:
- More general JAR parser for APK later.
- Get the icon.
- Show metadata.
2024-11-23 13:09:33 -05:00
David Korth
096acf8037 [xdg] com.gerbilsoft.rom-properties.metainfo.xml: Add v2.3 and v2.4.
Forgot to do this before...

NOTE: v2.4.1 isn't being added here because that's a Windows-only
bugfix release. It will be added after the next Linux release.
2024-11-23 12:18:03 -05:00
David Korth
d5c448d1f5 [xdg] mime.thumbnail.types: Add CDI MIME types.
shared-mime-info uses application/x-discjuggler-cd-image,
while KDE seems to use application/x-cdi.

[libromdata] Dreamcast: Add application/x-discjuggler-cd-image and
use it as the MIME type for CDI images.
2024-10-12 02:07:20 -04:00
David Korth
9812fd3b6a [xdg] mime.thumbnail.types: Add "application/x-analogue-pocket-rom" here, too.
Otherwise, these ROM images won't be thumbnailed on Linux systems.
2024-08-03 14:11:33 -04:00
David Korth
f7e12822fb [libromdata] DMG: Add "application/x-analogue-pocket-rom" MIME type.
[xdg] rom-properties.xml: Likewise.
2024-08-03 13:24:16 -04:00
David Korth
f2565965b2 [libromdata] NintendoDS_BNR: Split icon/title data parsing out of NintendoDS.
This will allow thumbnailing of standalone NDS banners.

TODO: Validate CRC16s to reduce false-positives.
2024-04-02 22:24:48 -04:00
David Korth
3f608955d7 [libromdata] New Wii opening.bnr parser WiiBNR.
This is essentially the GameCube class's wii_loadOpeningBnr() and
wii_addBannerName() functions extracted into its own class.

TODO: Update the GameCube class to make use of WiiBNR.

NintendoLanguage::getWiiLanguage(): As a special case, 'hant' should be
handled as WII_LANG_JAPANESE, since Nintendo used JPN-region Wiis in
Taiwan instead of releasing a separate TWN-region Wii.

[xdg] Add unofficial MIME type "application/x-wii-bnr".
2024-03-31 12:14:41 -04:00
David Korth
da2b29dcb2 [libromdata] EXE: Add "application/x-dosexec".
As per FreeDesktop.org's shared-mime-info.

[tracker] 14-rp-executables.rule: Add it, and also sort the MIME types
alphabetically, since apparently I forgot to do that for this file
when it was added initially.
2024-03-30 04:03:36 -04:00
David Korth
db5c50d208 [libromdata] EXE: Add MIME type "application/x-ms-ne-executable".
This was added to FreeDesktop.org's shared-mime-info for 16-bit Windows
executables in v2.4. (released 2023/11/12)

It *should* only be detecting as such for 16-bit executables, but
`mimetype` is showing this type for 32-bit and 64-bit, which is breaking
tracker (and possibly other rom-properties plugins).
2024-03-30 03:57:26 -04:00
David Korth
f28cf3838b Merge branch 'feature/Wii-WiiU-ticket-tmd-NUS'
Conflicts:
	NEWS.md
2024-03-16 21:06:47 -04:00
David Korth
183851dd52 Add extra MIME types to the TGA class and mime.no-thumbnail.types.
FIXME: Even though it's in no-thumbnail, KDE is still using rom-properties
to thumbnail TGAs on my system. (Which might be a good thing, since Qt's
TGA plugin appears to be busted...)
2024-03-16 12:10:17 -04:00
David Korth
c3141bc7f7 [gtk,kde] Handle directories by calling RomDataFactory::create() with the pathname.
[xdg] mime.thumbnail.types: Add inode/directory for WiiUPackage.

TODO: Move it to the "generic" section? Maybe if it's used by
something else later...
2024-03-12 01:43:41 -04:00
David Korth
d59f9cefc0 [libromdata] WiiTMD: New RomData parser for Wii and Wii U title metadata.
Possibly for other Nintendo systems too, e.g. DSi and 3DS.

Currently displays the following fields:
- Title ID
- Issuer
- Title version
- OS version (if non-zero) (identifies IOS and IOSU)
- Access rights (for Wii and Wii U only; but not Wii IOS)

wii_structs.h: Some updates for TMD.

wiiu_structs.h: Add CMD v1 structs.

[xdg] Add WiiTMD with "application/x-nintendo-tmd".
2024-03-11 20:01:41 -04:00
David Korth
8694c3aa46 [libromdata] WiiTicket: New RomData parser for Wii and Wii U tickets.
Possibly for other Nintendo systems too, e.g. DSi and 3DS.

Currently displays the following fields:
- Title ID
- Console ID
- Issuer (raw data, not converted to "retail" or "debug")
- Key index

Title ID is used as the metadata "title" property.

wii_structs.h: Add some more fields and RVL_Ticket_v1.

[librpbase] RomData: Add FileType::Ticket.
WiiTicket doesn't really work as any other FileType.

[kde] ExtractorPlugin: Update the assertion for RomData::FileType::Ticket.

[xdg] Add WiiTicket with "application/x-nintendo-ticket".
2024-03-11 18:58:33 -04:00
David Korth
394d71c228 [libromdata] PalmOS: Initial Palm OS application reader.
Currently reads the internal name and creator ID.

TODO:

- Read the icon. There's a lot of different formats, starting with the
  initial 1-bpp format.

- Read the application name and version resources.
2024-03-06 21:47:24 -05:00
David Korth
13a95183eb [libromdata] Intellivision: Initial Intellivision ROM image parser.
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.
2024-03-02 16:47:14 -05:00
David Korth
26e0287972 [libromdata] CBMDOS: Use application/x-cbm-* instead of application/x-*.
TODO: Maybe we should switch to application/vnd.commodore.* ?

[xdg] rom-properties.xml: Remove a duplicate D71 definition.
Added aliases for the old MIME types, plus:
- application/x-c64-datadisk (D64)
- application/x-c64-rawdisk (G64)
2024-02-28 18:34:30 -05:00
David Korth
1438bd3fe0 [libromdata] Initial ColecoVision parser.
ColecoVision ROMs have a short magic number, either AA 55 or 55 AA,
so the file extension is used for detection.

For ROMs that have AA 55, the ColecoVision logo is displayed on startup,
and the game name is displayed. The game name is stored at 0x0024,
and is formatted using three lines. The first two lines are displayed
in reverse order, and the last line is a 4-digit year.

TODO:
- Improve formatting.
- Add more fields.
2024-02-27 18:54:51 -05:00
David Korth
02bf99a970 [libromdata] DpfReader: Initial reader class for GameCube DPF and Wii RPF files.
These are sparse disc images created by the official SDKs.

Note that unlike the other sparse disc image formats we support,
DPF and RPF both have byte granularity instead of block granularity.
Therefore, we're not using SparseDiscReader as a base class.

RomDataFactory: Use IDiscReader instead of SparseDiscReader as the base
class in order to be able to use DpfReader.

Added DPF and RPF MIME types and file extensions for the GameCube class.
Also added the MIME types to the xdg/ directory.

FIXME: memset() in read() is causing an Internal Compiler Error when
compiling with gcc-13.2.0. Using a (slower) `for` loop instead.

TODO:
- RPF images don't start at virt=0, phys=0. Need to add a fake block for
  phys=0 and adjust all the virtual offsets.
- Pre-adjust all phys offsets by adding the data start offset? Doing this
  might just waste cycles if we don't read that much data from the disc.
2024-02-26 18:20:08 -05:00
David Korth
8369bd825b [libromdata] CBMDOS: Add support for .g71 format.
Basically the same as .g64, but supports up to 168 half-tracks.
(84 full tracks; double the amount of .g64.)

Tested using VICE 3.8.
2024-02-25 11:46:34 -05:00
David Korth
ca80b42585 [libromdata] CBMDOS: Add support for Commodore 2040 (DOS 1.x) disk images.
The main difference compared to DOS 2.x is the second zone has 20
sectors per track instead of 19. This proved to be unreliable in
practice, which is why it was reduced to 19 in DOS 2.x.
2024-02-24 03:29:49 -05:00
David Korth
f248d670cd [libromdata] CBMDOS: Initial support for G64 disk images.
Currently using a rather quickly thrown together GCR parser.

Since the G64 format stores an entire track without provisions for
random sector access without parsing the entire track, our code
decodes an entire track at once and caches it.

TODO:
- Use the track count and track length from the GCR-1541 header.
- Parse GCR tracks on the bit level instead of the byte level.
- Better error handling.
2024-02-24 01:46:40 -05:00
David Korth
78074ceeb4 [libromdata] CBMDOS: Add support for C1581 .d81 images.
80 tracks, 40 sectors. No variable zones here.

Note that it's not actually 40 physical sectors; the actual disk uses
10 512-byte sectors, for 20 sectors per track; and both sides of the
disk are counted as a single trac.k
2024-02-23 19:20:35 -05:00
David Korth
54f358db1e [libromdata] CBMDOS: Add support for D80 and D82 images.
C8050 and C8250 are quad-density drives.
C8050 is single-sided; C8250 is double-sided.

Compared to C1541, the header sector is different (and doesn't have
the BAM), but the directory entries are the same. To compensate for
this, the header parser has been reworked to get the offsets from
the header sector based on disk type.
2024-02-23 00:42:16 -05:00
David Korth
7a85332f85 [libromdata] CBMDOS: Initial (untested!) support for C1571 .d71 images.
Basically the same as C1541, but with 70 tracks (and different offsets
compared to 40-track C1541 images) and a double-sided flag. There's also
some BAM changes, but those aren't important here.

A pointer to the track_offsets array is now stored in the private class.

TODO:
- Add support for G64/G71 images. These images have their own track
  offset table instead of fixed addresses, so we'll need to convert
  the fixed addresses for D64/D71 to a similar format.
- Add support for D81 images. D81 uses a physical format similar to
  PC 3.5" floppy disks, but a logical format closer to C1541/C1571.
- Other CBM disk formats, e.g. D80/D82.
2024-02-23 00:04:36 -05:00
David Korth
3e92c8a3e0 [xdg] rom-properties.xml: Also accept *.d41 for C1541 disk images. 2024-02-22 23:54:59 -05:00
David Korth
4bca277e79 [xdg] Add the application/x-d64 MIME type.
Needed for .d64 to be associated properly in KDE Dolphin and other
Linux file browsers.

FIXME: KDE Breeze doesn't have an icon for application/x-raw-disk-image .
2024-02-22 23:03:41 -05:00
David Korth
f804321750 [libromdata] ISO: Add new MIME type "application/vnd.efi.iso".
This was added in shared-mime-info 2.3.

[xdg] mime.thumbnail.types: Add this MIME type.
- ...and remove a duplicate "files." in the header.

mime.no-thumbnail.types: Remove the generic CD-ROM MIME types
that are also in mime.thumbnail.types.
2023-11-09 19:56:16 -05:00
David Korth
74063d78a1 [libromdata] EXE: Wikipedia says IANA has "application/vnd.microsoft.portable-executable" for EFI executables. 2023-08-26 22:09:01 -04:00
David Korth
d8dd8cf6be [xdg] rom-properties.xml: Add some MIME types from mGBA.
- application/x-gameboy-advance-rom
- application/x-agb-rom
2023-08-20 14:03:40 -04:00
David Korth
a03642a274 [xdg] rom-properties.xml: Add more acronym definitions. 2023-08-20 13:49:33 -04:00
David Korth
ed6606c48c [xdg] rom-properties.xml: Split Godot STEX into .stex (v3) and .ctex (v4) types.
These should be considered two separate types instead of a single type.
2023-08-20 13:45:39 -04:00
David Korth
8aa26e93f4 [xdg] rom-properties.xml: Add acronyms from Citra's MIME types XML file.
[libromdata] Nintendo3DS: "installable archive" -> "importable archive"
2023-08-20 13:31:38 -04:00
David Korth
afa734421c [libromdata] Nintendo3DS: Add unofficial MIME types used by Citra.
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.
2023-08-20 13:28:02 -04:00
David Korth
219113e0af [xdg] metainfo: Add recommends/supports for Internet access.
Internet access is recommended in order to make use of RPDB, but
rom-properties does work without constant Internet access. If an
RPDB image is cached locally, then it will be used without accessing
the RPDB server. Filetypes that have internal images that don't need
RPDB will also work without any issues.
2023-08-02 00:57:43 -04:00
David Korth
e3b163fdb6 [xdg] metainfo: Add <translation>; remove <content_rating>.
We don't have any content ratings. Keeping a blank <content_rating> tag
is useless, so just get rid of it.
2023-08-02 00:52:00 -04:00
David Korth
81cf4893f5 [xdg] metainfo: Not part of KDE.
Probably a copy/paste error from a KDE metainfo file.
2023-08-02 00:49:03 -04:00
David Korth
b7a3c5e3ef [xdg] metainfo: Add versions 2.0, 2.1, 2.2, and 2.2.1. 2023-08-02 00:47:51 -04:00
David Korth
26f9ea758b [xdg] mime.no-thumbnail.types: Add application/x-ms-wim. 2023-08-01 19:37:27 -04:00
David Korth
268a05b5e1 [xdg] rp-config.desktop: Only show in the "Settings" category, not "System".
rp-config is a settings program, not a system program.
2023-07-18 18:53:28 -04:00
David Korth
c2bf7cf9dc [librptexture] GodotSTEX: Update v4 support.
Since I first implemented support for GodotSTEX v4, two major breaking
changes were introduced to the format:

1. PVRTC pixel formats were removed. The formats following PVRTC were
renumbered, which breaks compatibility. Godot 4 hasn't been released
yet, so this isn't a "breaking" change per se, but it breaks handling
of STEX v4 ETCn textures in rom-properties.

2. ETC no longer has swapped RB channels.

Other changes in the format:
- Godot now supports ASTC. (4x4 and 8x8, and HDR versions)
  I added in the ASTC format IDs and it appears to "just work".
- The main file extension is now .ctex for "compressed texture".

TODO: Add more test images.
2023-02-11 11:29:56 -05:00
David Korth
49aea33f67 [xdg] Add detection for 2352-byte disc images. (BIN/CUE)
KDE doesn't detect these normally.

[libromdata] PlayStationDisc: Add the new MIME type,
application/x-raw-cd-image.

Not adding to MegaDrive or SegaSaturn because the MIME type
definitions handle the 2352-byte boot sector for these systems.
2022-12-27 19:29:07 -05:00
David Korth
cccfed6ec0 [libromdata] WiiWAD: Add application/x-doom-wad for compatibility.
Some systems assume all .wad files are Doom WADs, which breaks support
for Wii WAD files. Let's pretend we handle Doom WADs to fix this.
2022-12-26 00:22:22 -05:00