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

Basic disk control and M3U support #211

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dszakallas
Copy link

This PR upgrades libretro header to a newer version that has extended disk tray interface and implements the disk tray control callbacks required for swapping disks.

Eject does nothing, insert saves the nvram, resets the emulation, loads the image and finally the nvram.

The purpose of this PR is to provide convenience functionality of swapping disks from inside retroarch, and m3u support, not faithful emulation of disk control of the hardware.

@dszakallas
Copy link
Author

#14 #209

@trapexit
Copy link
Collaborator

Will take a look. Thanks.

Copy link
Collaborator

@trapexit trapexit Mar 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a fan of the change in style in a feature change.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you mean the brace style, and the return value and static qualifier being on a separate line?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you check again please?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you just squash all the commits you've made?

libretro.c Outdated
static struct retro_disk_control_callback retro_disk_control_cb;
static struct retro_disk_control_ext_callback retro_disk_control_ext_cb;

static bool read_m3u(const char *file)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There isn't a generic m3u reader that could be used? Is this code picked up from another core?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find one.

libretro.c Outdated
{
char line[PATH_MAX];
char name[PATH_MAX];
FILE *f = fopen(file, "r");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libretro.c Outdated
// disk swapping
#define M3U_MAX_FILE 4

static char disk_paths[M3U_MAX_FILE][PATH_MAX_LENGTH];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CD stuff needs to be moved over but the g_CAPS syntax is generally used for globals.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you just squash all the commits you've made?

@dszakallas dszakallas force-pushed the naive-disk-control branch 3 times, most recently from e1ae1e1 to ca9473d Compare May 1, 2024 11:57
}

bool
retro_load_game(const struct retro_game_info *info_)
{
int rv;

game_info_path_save(info_);
extract_basename(g_GAME_NAME, info_->path, sizeof(g_GAME_NAME));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name here is misleading? It's the path. Also... can't info be NULL? Opera allows starting without a game.

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.

2 participants