Skip to content

Commit

Permalink
add support for dsk and cas for real this time
Browse files Browse the repository at this point in the history
  • Loading branch information
gingerbeardman committed Jun 27, 2017
1 parent a58af0d commit a81fd69
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions libretro.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,8 @@ bool retro_load_game(const struct retro_game_info *info)
{
int i;
static char ROMName_buffer[MAXCARTS][1024];
static char DSKName_buffer[MAXDRIVES][1024];
static char CasName_buffer[1024];
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;

if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
Expand All @@ -544,11 +546,29 @@ bool retro_load_game(const struct retro_game_info *info)

if (info)
{
strcpy(ROMName_buffer[0], info->path);
ROMName[0]=ROMName_buffer[0];
char *dot = strrchr(info->path, '.');
if (dot && ( !strcmp(dot, ".rom") || !strcmp(dot, ".mx1") || !strcmp(dot, ".mx2") ))
{
strcpy(ROMName_buffer[0], info->path);
ROMName[0]=ROMName_buffer[0];
}
else if (dot && !strcmp(dot, ".dsk"))
{
strcpy(DSKName_buffer[0], info->path);
DSKName[0]=DSKName_buffer[0];
}
else if (dot && !strcmp(dot, ".cas"))
{
strcpy(CasName_buffer, info->path);
CasName=CasName_buffer;
}
}
else
{
ROMName[0]=NULL;
DSKName[0]=NULL;
CasName=NULL;
}


SETJOYTYPE(0,1);
Expand Down

0 comments on commit a81fd69

Please sign in to comment.