mirror of
https://github.com/libretro/beetle-psx-libretro.git
synced 2024-11-27 10:50:29 +00:00
Fix disk append/replace.
This commit is contained in:
parent
3a42eeeafb
commit
30babf07cc
@ -163,6 +163,8 @@ static void check_system_specs(void)
|
||||
}
|
||||
|
||||
#if defined(WANT_PSX_EMU)
|
||||
|
||||
// Ugly poking. There's no public interface for this.
|
||||
#include "mednafen/psx/psx.h"
|
||||
namespace MDFN_IEN_PSX
|
||||
{
|
||||
@ -170,6 +172,8 @@ namespace MDFN_IEN_PSX
|
||||
extern std::vector<CDIF*> *cdifs;
|
||||
}
|
||||
|
||||
// Poke into psx.cpp
|
||||
unsigned CalcDiscSCEx();
|
||||
using MDFN_IEN_PSX::CD_SelectedDisc;
|
||||
using MDFN_IEN_PSX::cdifs;
|
||||
|
||||
@ -229,6 +233,9 @@ static bool disk_replace_image_index(unsigned index, const struct retro_game_inf
|
||||
cdifs->erase(cdifs->begin() + index);
|
||||
if (index < CD_SelectedDisc)
|
||||
CD_SelectedDisc--;
|
||||
|
||||
// Poke into psx.cpp
|
||||
CalcDiscSCEx();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -237,6 +244,7 @@ static bool disk_replace_image_index(unsigned index, const struct retro_game_inf
|
||||
CDIF *iface = CDIF_Open(info->path, false);
|
||||
delete cdifs->at(index);
|
||||
cdifs->at(index) = iface;
|
||||
CalcDiscSCEx();
|
||||
return true;
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
|
@ -994,7 +994,7 @@ static const char *CalcDiscSCEx_BySYSTEMCNF(CDIF *c, unsigned *rr)
|
||||
return(ret);
|
||||
}
|
||||
|
||||
static unsigned CalcDiscSCEx(void)
|
||||
unsigned CalcDiscSCEx()
|
||||
{
|
||||
const char *prev_valid_id = NULL;
|
||||
unsigned ret_region = MDFN_GetSettingI("psx.region_default");
|
||||
|
Loading…
Reference in New Issue
Block a user