cdrom: Pass phys flag to read_partial_sector in read_subcode (#10231)

This commit is contained in:
987123879113 2022-08-16 11:35:13 +09:00 committed by GitHub
parent 9356446851
commit f1f77b1a1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -360,7 +360,7 @@ cdrom_file::~cdrom_file()
***************************************************************************/ ***************************************************************************/
/** /**
* @fn std::error_condition read_partial_sector(void *dest, uint32_t lbasector, uint32_t chdsector, uint32_t tracknum, uint32_t startoffs, uint32_t length) * @fn std::error_condition read_partial_sector(void *dest, uint32_t lbasector, uint32_t chdsector, uint32_t tracknum, uint32_t startoffs, uint32_t length, bool phys)
* *
* @brief Reads partial sector. * @brief Reads partial sector.
* *
@ -370,6 +370,7 @@ cdrom_file::~cdrom_file()
* @param tracknum The tracknum. * @param tracknum The tracknum.
* @param startoffs The startoffs. * @param startoffs The startoffs.
* @param length The length. * @param length The length.
* @param phys true to physical.
* *
* @return The partial sector. * @return The partial sector.
*/ */
@ -570,7 +571,7 @@ bool cdrom_file::read_subcode(uint32_t lbasector, void *buffer, bool phys)
return false; return false;
// read the data // read the data
std::error_condition err = read_partial_sector(buffer, lbasector, chdsector, tracknum, cdtoc.tracks[tracknum].datasize, cdtoc.tracks[tracknum].subsize); std::error_condition err = read_partial_sector(buffer, lbasector, chdsector, tracknum, cdtoc.tracks[tracknum].datasize, cdtoc.tracks[tracknum].subsize, phys);
return !err; return !err;
} }

View File

@ -249,7 +249,7 @@ private:
static void get_info_from_type_string(const char *typestring, uint32_t *trktype, uint32_t *datasize); static void get_info_from_type_string(const char *typestring, uint32_t *trktype, uint32_t *datasize);
static uint8_t ecc_source_byte(const uint8_t *sector, uint32_t offset); static uint8_t ecc_source_byte(const uint8_t *sector, uint32_t offset);
static void ecc_compute_bytes(const uint8_t *sector, const uint16_t *row, int rowlen, uint8_t &val1, uint8_t &val2); static void ecc_compute_bytes(const uint8_t *sector, const uint16_t *row, int rowlen, uint8_t &val1, uint8_t &val2);
std::error_condition read_partial_sector(void *dest, uint32_t lbasector, uint32_t chdsector, uint32_t tracknum, uint32_t startoffs, uint32_t length, bool phys=false); std::error_condition read_partial_sector(void *dest, uint32_t lbasector, uint32_t chdsector, uint32_t tracknum, uint32_t startoffs, uint32_t length, bool phys);
static std::string get_file_path(std::string &path); static std::string get_file_path(std::string &path);
static uint64_t get_file_size(std::string_view filename); static uint64_t get_file_size(std::string_view filename);