Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add disk control interface API extension #10019

Merged
merged 1 commit into from Jan 17, 2020

Conversation

jdgleaver
Copy link
Contributor

Description

This PR adds a relatively small and simple API extension required to address the remaining limitations/shortcomings of the disk control interface.

At present, the disk control interface is defined by passing a retro_disk_control_callback struct to RETRO_ENVIRONMENT_SET_DISK_CONTROL_INTERFACE. This PR adds two new environment callbacks:

  • RETRO_ENVIRONMENT_GET_DISK_CONTROL_INTERFACE_VERSION: Returns the disk control interface API version. With this PR, the version number is 1. In legacy code, the version number is 0

  • RETRO_ENVIRONMENT_SET_DISK_CONTROL_EXT_INTERFACE: If the disk control interface version is >= 1, the interface may alternatively be defined by passing a retro_disk_control_ext_callback struct to RETRO_ENVIRONMENT_SET_DISK_CONTROL_EXT_INTERFACE. This provides the following additional (and optional) functions:

    • set_initial_image(unsigned index, const char *path): Note that this is not currently wired up inside RetroArch - but when it is, it will allow the frontend to select a particular disk image when loading content. This means that we will be able to automatically choose the last selected disk when running content via an M3U playlist (I will work on this next week)

    • get_image_path(unsigned index, char *path, size_t len): allows the frontend to fetch the actual file path of the specified disk

    • get_image_label(unsigned index, char *label, size_t len): Allows the frontend to fetch a core-generated 'label' to associate with each disk when displaying the Current Disk Index drop-down list

The get_image_label functionality is fully enabled, and I have implemented it in the P-UAE core as a test case. This addresses a particularly annoying issue when running 'complex' content, which may consist of multiple disks with specific identifiers. For example: a game may prompt the user for a data disk, or a level disk or somesuch; yet what is the user meant to do when all RetroArch provides is the following:

Screenshot_2020-01-17_15-50-14

With this API extension, a core can instead produce this:

Screenshot_2020-01-17_14-39-34

or this:

Screenshot_2020-01-17_14-48-39

and so on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants