Files
RetroArch/tasks/task_database_cue.h
T
LibretroAdmin 0b7c12251d Scanner: Wii U discs, WUX images and Wii U archives
Wii U content did not scan. It now takes the serial lookup by its
product code:

- a WUD, or a Wii U disc by another name (.iso, probed only once the
  other detectors find nothing, so other discs read nothing more), by
  the "WUP-P-XXXX" its header starts with;
- a WUX, through the new formats/wux, the same octets of the disc it
  stands for;
- a Wii U archive (.wua), by the product and company codes of its base
  title's meta/meta.xml, read through formats/zar.

formats/wux reads WUX, the Wii U image format that keeps each distinct
sector once, as the WUD it stands for. Like the other readers it does
no file I/O: it asks for each range it needs. Opening reads the
32-octet header alone; the sector index is read a window at a time,
only where a read needs it; a read's data lands in its own destination,
one request per run of sectors the file keeps in order.

formats/zar gains a directory listing, zar_dir_begin() and
zar_dir_step(), each name read whole, the listing's end ZAR_END.

A Wii U release's serial in the database is the product code and the
maker's two characters, or the code alone for a title sold as a
download; a disc does not say its maker. The code is therefore looked
up as a stem, in the Wii U database alone - glob() in a libretrodb
query now matches binary fields, as a serial is kept - and the release
picked is the one of the maker an archive names, else a download for
an archive and a disc release for a disc. The playlist names the
release found.

wux_test is new, zar_test lists directories, and the scan test gains a
Wii U lane: a WUD, a WUX, a disc named .iso, two archives whose update
is listed before the game, and another database holding the codes.
2026-11-07 13:49:21 +01:00

112 lines
4.5 KiB
C

/* RetroArch - A frontend for libretro.
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TASK_DATABASE_CUE
#define TASK_DATABASE_CUE
#include <ctype.h>
#include <streams/interface_stream.h>
#include <streams/file_stream.h>
#include <streams/chd_stream.h>
RETRO_BEGIN_DECLS
struct magic_entry
{
const char *system_name;
const char *magic;
int32_t offset;
};
int detect_ps1_game(intfstream_t *fd, char *s, size_t len,
const char *filename);
int detect_ps2_game(intfstream_t *fd, char *s, size_t len,
const char *filename);
int detect_psp_game(intfstream_t *fd, char *s, size_t len,
const char *filename);
int detect_pbp_game(intfstream_t *fd, char *s, size_t len,
const char *filename);
int detect_3ds_game(intfstream_t *fd, char *s, size_t len);
size_t detect_gc_game(intfstream_t *fd, char *s, size_t len,
const char *filename);
int detect_scd_game(intfstream_t *fd, char *s, size_t len,
const char *filename);
int detect_sat_game(intfstream_t *fd,
char *s, size_t len, const char *filename);
int detect_dc_game(intfstream_t *fd, char *s, size_t len,
const char *filename);
size_t detect_wii_game(intfstream_t *fd, char *s, size_t len,
const char *filename);
int detect_system(intfstream_t *fd, const char **system_name,
const char * filename);
int cue_find_track(const char *cue_path, bool first, uint64_t *offset,
size_t *size, char *s, size_t len);
bool cue_next_file(intfstream_t *fd, const char *cue_path,
char *s, uint64_t len);
int gdi_find_track(const char *gdi_path, bool first, char *s,
size_t len);
size_t gdi_next_file(intfstream_t *fd, const char *gdi_path, char *s,
size_t len);
int intfstream_get_serial(intfstream_t *fd, char *s, size_t len,
const char *filename);
bool intfstream_file_get_serial(const char *name,
uint64_t offset, int64_t size, char *s, size_t len, uint64_t *fsize);
int task_database_cue_get_serial(const char *name, char *s, size_t len,
uint64_t *filesize);
int task_database_gdi_get_serial(const char *name, char *s, size_t len,
uint64_t *filesize);
int task_database_pbp_get_serial(const char *name, char *s, size_t len,
uint64_t *filesize);
int task_database_3ds_get_serial(const char *name, char *s, size_t len,
uint64_t *filesize);
int task_database_ciso_get_serial(const char *name, char *s, size_t len,
uint64_t *filesize);
/* An Xbox or Xbox 360 serial for @name: with @disc that of the disc
* image's game, otherwise that of the executable or package it is.
* @regions gets the XDVDFS_REGION_* the title says it is for, or 0. */
int task_database_xbox_get_serial(const char *name, bool disc, char *s,
size_t len, uint64_t *filesize, uint8_t *regions);
/* The Xbox 360 serial of the game a ZArchive holds, @regions as above */
int task_database_zar_get_serial(const char *name, char *s, size_t len,
uint64_t *filesize, uint8_t *regions);
/* The product code of a Wii U disc, a WUD or a WUX (or a disc image
* by another name), four characters: a release's serial may add the
* maker's two */
int task_database_wiiu_get_serial(const char *name, char *s, size_t len,
uint64_t *filesize);
/* The same for the game a Wii U archive (.wua) holds, @maker getting
* the maker's two characters from its company code, or "" */
int task_database_wua_get_serial(const char *name, char *s, size_t len,
uint64_t *filesize, char *maker);
bool is_chd_file_cdi(const char *path);
/* @regions as for task_database_xbox_get_serial(), for an Xbox disc */
int task_database_chd_get_serial(const char *name, char *serial, size_t len,
uint64_t *filesize, uint8_t *regions);
enum task_database_crc_kind
{
TASK_DATABASE_CRC_FILE = 0,
TASK_DATABASE_CRC_CUE,
TASK_DATABASE_CRC_GDI,
TASK_DATABASE_CRC_CHD
};
intfstream_t *task_database_crc_open(const char *name,
enum task_database_crc_kind kind, int64_t *span, uint64_t *size);
RETRO_END_DECLS
#endif