Class

HsCoreDescriptor

Description [src]

final class Hs.CoreDescriptor : GObject.Object
{
  /* No available fields */
}

Represents a core descriptor file.

For Highscore to register the core, it must come with a core descriptor. A core descriptor is a file in the GKeyFile format, containing information about the core.

Usage

Create a HsCoreDescriptor object, then parse it using the hs_core_descriptor_parse() method. If successful, all of the available data will be filled and can be accessed through the created object.

Format

Core descriptors must have the .highscore extension and are installed into the following directory: $LIBDIR/highscore/cores.

An example descriptor is as follows:

[Highscore]
Name=Example
Version=1.2.3
Commit=123456abc-dirty
Module=example-highscore.so
Authors=Jane Doe;
Copyright=Copyright (C) 2023 John Doe;Copyright (C) 2024 Jane Doe;
Website=https://example.org/
Donate=https://example.org/donate/
SourceCode=https://github.com/highscore-emu/example/
Issues=https://github.com/highscore-emu/example/issues/
License=GPL-2.0-or-later
# Alternatively: LicensePath=example.license
Platforms=MegaDrive;MegaCD;
StateVersion=1

[Environment]
EXAMPLE_USE_FALLBACK=1

[Firmware:FamicomDiskSystem]
japan=required
overseas=optional
europe=unused

Each descriptor must have a [Highscore] group, containing the following fields:

  • Name - human readable name of the core;
  • Version - upstream version;
  • Module - relative path to the core library file;
  • Authors - list of core authors, separated with semicolons;
  • Platforms - list of supported game platforms, separated with semicolons. See hs_platform_get_name() for the list of known platform names.

It must also have one of the following fields: License or LicensePath.

License is an SPDX identifier. Supported licenses: GPL-2.0-only, GPL-3.0-only, LGPL-3.0-only, LGPL-2.1-only, AGPL-3.0-only, GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later, LGPL-3.0-or-later, AGPL-3.0-or-later, 0BSD, BSD-2-Clause, BSD-3-Clause, MIT, Artistic-2.0, Apache-2.0, MPL-2.0.

For other licences, or multi-licensing, use LicensePath instead. Specify a path, such as example.license, and put the license contents into that file.

If License is specified, the descriptor must also have the Copyright field, containing a list of semicolon-separated copyright strings.

For LicensePath, copyright information may be omitted if the license text specifies it. Otherwise, it must be specified as well.

Optionally, it can have the following keys:

  • Website - link to the upstream website
  • Donate - link to the upstream donation page
  • SourceCode - link to the downstream source code
  • Issues - link to the downstream issue tracker
  • Commit - git commit/svn revision/etc. If left empty, treated same as omitted. Can include -dirty to indicate that it’s dirty;
  • StateVersion - indicates savestate compatibility and should be incremented whenever it breaks. If not present, the version is assumed to be 0.

The optional [Environment] group allows to define one or more environment variables, which will be set before the core is loaded.

For every defined platform, [Firmware:$PLATFORM] group can be specified. It defines which firmware is used by the core. Firmware is specified by its enum nick for the corresponding firmware enum, e.g. HsPlayStationFirmware for HS_PLATFORM_PLAYSTATION. The values can be required, optional or unused, corresponding to HsFirmwareRequirement values. If not specified, firmware is considered unused.

Ancestors

Constructors

hs_core_descriptor_new

Creates a new HsCoreDescriptor.

Instance methods

hs_core_descriptor_get_authors

Gets the list of the core authors.

hs_core_descriptor_get_commit

Gets the core commit.

hs_core_descriptor_get_copyright

Gets the list of the core copyright strings.

hs_core_descriptor_get_donate

Gets the donation page URL for core.

hs_core_descriptor_get_environment

Gets the list of the environment variables the core requires.

hs_core_descriptor_get_file

Gets the descriptor file.

hs_core_descriptor_get_firmware_requirement

Gets firmware requirement for platform and firmware_id.

hs_core_descriptor_get_id

Gets the core ID.

hs_core_descriptor_get_issues

Gets the issue tracker URL for core.

hs_core_descriptor_get_license

Gets the core licence as an SPDX identifier.

hs_core_descriptor_get_license_text

Gets the core license as custom text.

hs_core_descriptor_get_module

Gets the relative path to the core module.

hs_core_descriptor_get_name

Gets the core name.

hs_core_descriptor_get_platforms

Gets the supported platforms.

hs_core_descriptor_get_source_code

Gets the source code URL for core.

hs_core_descriptor_get_state_version

Gets the state version.

hs_core_descriptor_get_version

Gets the core version.

hs_core_descriptor_get_website

Gets the core website.

hs_core_descriptor_parse

Parses the descriptor file.

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

Hs.CoreDescriptor:authors

List of the core authors.

Hs.CoreDescriptor:commit

The core commit.

Hs.CoreDescriptor:copyright

List of the core copyright lines.

Hs.CoreDescriptor:donate

The donation page URL.

Hs.CoreDescriptor:environment

The list of the environment variables the core requires.

Hs.CoreDescriptor:file

The descriptor file.

Hs.CoreDescriptor:id

The core ID.

Hs.CoreDescriptor:issues

The issue tracker URL.

Hs.CoreDescriptor:license

The core licence as an SPDX identifier.

Hs.CoreDescriptor:license-text

The core license as custom text.

Hs.CoreDescriptor:module

Relative path to the core module.

Hs.CoreDescriptor:name

The core name.

Hs.CoreDescriptor:source-code

The source code URL.

Hs.CoreDescriptor:state-version

The state version.

Hs.CoreDescriptor:version

The core version.

Hs.CoreDescriptor:website

The website URL.

Signals

Signals inherited from GObject (1)
GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

Class structure

struct HsCoreDescriptorClass {
  GObjectClass parent_class;
  
}

No description available.

Class members
parent_class: GObjectClass

No description available.