mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-05 14:57:46 -04:00
cue support wip
git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@432 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
f76e88b530
commit
1ceda4176f
3 changed files with 18 additions and 13 deletions
|
@ -164,6 +164,9 @@ int emu_cdCheck(int *pregion)
|
||||||
unsigned char buf[32];
|
unsigned char buf[32];
|
||||||
pm_file *cd_f;
|
pm_file *cd_f;
|
||||||
int type = 0, region = 4; // 1: Japan, 4: US, 8: Europe
|
int type = 0, region = 4; // 1: Japan, 4: US, 8: Europe
|
||||||
|
char ext[5];
|
||||||
|
|
||||||
|
get_ext(romFileName, ext);
|
||||||
|
|
||||||
cd_f = pm_open(romFileName);
|
cd_f = pm_open(romFileName);
|
||||||
if (!cd_f) return 0; // let the upper level handle this
|
if (!cd_f) return 0; // let the upper level handle this
|
||||||
|
@ -330,7 +333,7 @@ int emu_ReloadRom(void)
|
||||||
|
|
||||||
// check for MegaCD image
|
// check for MegaCD image
|
||||||
cd_state = emu_cdCheck(&cd_region);
|
cd_state = emu_cdCheck(&cd_region);
|
||||||
if (cd_state > 0)
|
if (cd_state != CIT_NOT_CD)
|
||||||
{
|
{
|
||||||
PicoAHW |= PAHW_MCD;
|
PicoAHW |= PAHW_MCD;
|
||||||
// valid CD image, check for BIOS..
|
// valid CD image, check for BIOS..
|
||||||
|
@ -405,8 +408,8 @@ int emu_ReloadRom(void)
|
||||||
Pico.m.frame_count = 0;
|
Pico.m.frame_count = 0;
|
||||||
|
|
||||||
// insert CD if it was detected
|
// insert CD if it was detected
|
||||||
if (cd_state > 0) {
|
if (cd_state != CIT_NOT_CD) {
|
||||||
ret = Insert_CD(romFileName, cd_state == 2);
|
ret = Insert_CD(romFileName, cd_state);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
sprintf(menuErrorMsg, "Insert_CD() failed, invalid CD image?");
|
sprintf(menuErrorMsg, "Insert_CD() failed, invalid CD image?");
|
||||||
lprintf("%s\n", menuErrorMsg);
|
lprintf("%s\n", menuErrorMsg);
|
||||||
|
|
11
gp2x/menu.c
11
gp2x/menu.c
|
@ -200,7 +200,7 @@ void menu_romload_end(void)
|
||||||
static unsigned short file2color(const char *fname)
|
static unsigned short file2color(const char *fname)
|
||||||
{
|
{
|
||||||
const char *ext = fname + strlen(fname) - 3;
|
const char *ext = fname + strlen(fname) - 3;
|
||||||
static const char *rom_exts[] = { "zip", "bin", "smd", "gen", "iso", "cso" };
|
static const char *rom_exts[] = { "zip", "bin", "smd", "gen", "iso", "cso", "cue" };
|
||||||
static const char *other_exts[] = { "gmv", "pat" };
|
static const char *other_exts[] = { "gmv", "pat" };
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ static int scandir_cmp(const void *p1, const void *p2)
|
||||||
|
|
||||||
static char *filter_exts[] = {
|
static char *filter_exts[] = {
|
||||||
".mp3", ".MP3", ".srm", ".brm", "s.gz", ".mds", "bcfg", ".txt", ".htm", "html",
|
".mp3", ".MP3", ".srm", ".brm", "s.gz", ".mds", "bcfg", ".txt", ".htm", "html",
|
||||||
".jpg", ".gpe", ".cue"
|
".jpg", ".gpe"
|
||||||
};
|
};
|
||||||
|
|
||||||
static int scandir_filter(const struct dirent *ent)
|
static int scandir_filter(const struct dirent *ent)
|
||||||
|
@ -1724,10 +1724,11 @@ int menu_loop_tray(void)
|
||||||
case 0: // select image
|
case 0: // select image
|
||||||
selfname = romsel_loop(curr_path);
|
selfname = romsel_loop(curr_path);
|
||||||
if (selfname) {
|
if (selfname) {
|
||||||
int ret = -1, cd_type;
|
int ret = -1;
|
||||||
|
cd_img_type cd_type;
|
||||||
cd_type = emu_cdCheck(NULL);
|
cd_type = emu_cdCheck(NULL);
|
||||||
if (cd_type > 0)
|
if (cd_type != CIT_NOT_CD)
|
||||||
ret = Insert_CD(romFileName, cd_type == 2);
|
ret = Insert_CD(romFileName, cd_type);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
sprintf(menuErrorMsg, "Load failed, invalid CD image?");
|
sprintf(menuErrorMsg, "Load failed, invalid CD image?");
|
||||||
printf("%s\n", menuErrorMsg);
|
printf("%s\n", menuErrorMsg);
|
||||||
|
|
11
psp/menu.c
11
psp/menu.c
|
@ -185,7 +185,7 @@ struct my_dirent
|
||||||
static unsigned short file2color(const char *fname)
|
static unsigned short file2color(const char *fname)
|
||||||
{
|
{
|
||||||
const char *ext = fname + strlen(fname) - 3;
|
const char *ext = fname + strlen(fname) - 3;
|
||||||
static const char *rom_exts[] = { "zip", "bin", "smd", "gen", "iso", "cso" };
|
static const char *rom_exts[] = { "zip", "bin", "smd", "gen", "iso", "cso", "cue" };
|
||||||
static const char *other_exts[] = { "gmv", "pat" };
|
static const char *other_exts[] = { "gmv", "pat" };
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -241,7 +241,7 @@ static int scandir_cmp(const void *p1, const void *p2)
|
||||||
|
|
||||||
static char *filter_exts[] = {
|
static char *filter_exts[] = {
|
||||||
".mp3", ".srm", ".brm", "s.gz", ".mds", "bcfg", ".txt", ".htm", "html",
|
".mp3", ".srm", ".brm", "s.gz", ".mds", "bcfg", ".txt", ".htm", "html",
|
||||||
".jpg", ".cue", ".pbp"
|
".jpg", ".pbp"
|
||||||
};
|
};
|
||||||
|
|
||||||
static int scandir_filter(const struct my_dirent *ent)
|
static int scandir_filter(const struct my_dirent *ent)
|
||||||
|
@ -1810,10 +1810,11 @@ int menu_loop_tray(void)
|
||||||
case 0: // select image
|
case 0: // select image
|
||||||
selfname = romsel_loop(curr_path);
|
selfname = romsel_loop(curr_path);
|
||||||
if (selfname) {
|
if (selfname) {
|
||||||
int ret = -1, cd_type;
|
int ret = -1;
|
||||||
|
cd_img_type cd_type;
|
||||||
cd_type = emu_cdCheck(NULL);
|
cd_type = emu_cdCheck(NULL);
|
||||||
if (cd_type > 0)
|
if (cd_type != CIT_NOT_CD)
|
||||||
ret = Insert_CD(romFileName, cd_type == 2);
|
ret = Insert_CD(romFileName, cd_type);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
sprintf(menuErrorMsg, "Load failed, invalid CD image?");
|
sprintf(menuErrorMsg, "Load failed, invalid CD image?");
|
||||||
lprintf("%s\n", menuErrorMsg);
|
lprintf("%s\n", menuErrorMsg);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue