CHD cleanups: [MetalliC]

- Double quote filenames with spaces when writing .gdi files
- Give audio files .raw extension when writing .gdi files
- cdrom_read_subcode() now returns false if the image doesn't contain subcodes
This commit is contained in:
R. Belmont 2014-04-28 01:57:31 +00:00
parent 8db4bddf33
commit bd320e789d
3 changed files with 9 additions and 4 deletions

View File

@ -477,7 +477,7 @@ UINT32 cdrom_read_subcode(cdrom_file *file, UINT32 lbasector, void *buffer, bool
}
if (file->cdtoc.tracks[tracknum].subsize == 0)
return 1;
return 0;
// read the data
chd_error err = read_partial_sector(file, buffer, lbasector, chdsector, tracknum, file->cdtoc.tracks[tracknum].datasize, file->cdtoc.tracks[tracknum].subsize);

View File

@ -8206,7 +8206,8 @@ ROM_START( initdv3e )
ROM_LOAD( "317-0384-com.pic", 0x000000, 0x004300, CRC(081ccd51) SHA1(598b3bd9e8b16f5954d15738c1ca55703609b690) )
ROM_END
ROM_START( vf4tuned ) // this GD-ROM contain two copies of the same game file
// gds-0036x GD-ROMs have two copies of identical game file, and two boot files BHX1.BIN and BHX1.1GB, so can be two PICs too
ROM_START( vf4tuned )
NAOMI2_BIOS
NAOMI_DEFAULT_EEPROM

View File

@ -1226,7 +1226,8 @@ void output_track_metadata(int mode, core_file *file, int tracknum, const cdrom_
size = 2352;
break;
}
core_fprintf(file, "%d %d %d %d %s %" I64FMT "d\n", tracknum+1, frameoffs, mode, size, filename, discoffs);
bool needquote = strchr(filename, ' ') != NULL;
core_fprintf(file, "%d %d %d %d %s%s%s %" I64FMT "d\n", tracknum+1, frameoffs, mode, size, needquote?"\"":"", filename, needquote?"\"":"", discoffs);
}
else if (mode == MODE_CUEBIN)
{
@ -2353,6 +2354,9 @@ static void do_extract_cd(parameters_t &params)
char temp[8];
sprintf(temp, "%02d", tracknum+1);
trackbin_name.cat(temp);
if (toc->tracks[tracknum].trktype == CD_TRACK_AUDIO)
trackbin_name.cat(".raw");
else
trackbin_name.cat(".bin");
if (output_bin_file)