mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2025-12-16 19:24:40 +00:00
Update sector tag constants for Aaru compatibility
This commit is contained in:
@@ -893,7 +893,7 @@ typedef struct ImageInfo // NOLINT
|
|||||||
// NOLINTBEGIN(readability-identifier-naming)
|
// NOLINTBEGIN(readability-identifier-naming)
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
AppleSectorTag = 0, ///< Apple's GCR sector tags, 12 bytes (address prolog + checksum)
|
AppleSonyTagAaru = 0, ///< Apple's Sony sector tags, 12 bytes (address prolog + checksum)
|
||||||
CdSectorSync = 1, ///< 12-byte CD sync pattern (00 FF*10 00)
|
CdSectorSync = 1, ///< 12-byte CD sync pattern (00 FF*10 00)
|
||||||
CdSectorHeader = 2, ///< 4-byte CD header (minute, second, frame, mode)
|
CdSectorHeader = 2, ///< 4-byte CD header (minute, second, frame, mode)
|
||||||
CdSectorSubHeader = 3, ///< Mode 2 Form subheader (8 bytes: copy, submode, channel)
|
CdSectorSubHeader = 3, ///< Mode 2 Form subheader (8 bytes: copy, submode, channel)
|
||||||
@@ -913,6 +913,8 @@ typedef enum
|
|||||||
DvdSectorNumber = 17, ///< DVD sector number, 3 bytes
|
DvdSectorNumber = 17, ///< DVD sector number, 3 bytes
|
||||||
DvdSectorIedAaru = 18, ///< DVD sector ID error detection, 2 bytes
|
DvdSectorIedAaru = 18, ///< DVD sector ID error detection, 2 bytes
|
||||||
DvdSectorEdcAaru = 19, ///< DVD sector EDC, 4 bytes
|
DvdSectorEdcAaru = 19, ///< DVD sector EDC, 4 bytes
|
||||||
|
AppleProfileTagAaru = 20, ///< Apple's Profile sector tags, 20 bytes
|
||||||
|
PriamDataTowerTagAaru = 21, ///< Priam DataTower sector tags, 24 bytes
|
||||||
MaxSectorTag = DvdSectorEdcAaru
|
MaxSectorTag = DvdSectorEdcAaru
|
||||||
} SectorTagType;
|
} SectorTagType;
|
||||||
|
|
||||||
|
|||||||
@@ -361,14 +361,20 @@ int32_t process_data_block(aaruformat_context *ctx, IndexEntry *entry)
|
|||||||
ctx->readableSectorTags[CdSectorEdc] = true;
|
ctx->readableSectorTags[CdSectorEdc] = true;
|
||||||
break;
|
break;
|
||||||
case CdSectorSubchannel:
|
case CdSectorSubchannel:
|
||||||
ctx->sector_subchannel = data;
|
ctx->sector_subchannel = data;
|
||||||
ctx->readableSectorTags[CdSectorSubchannelAaru] = true;
|
ctx->readableSectorTags[CdSectorSubchannelAaru] = true;
|
||||||
break;
|
break;
|
||||||
case AppleProfileTag:
|
case AppleProfileTag:
|
||||||
|
ctx->sector_subchannel = data;
|
||||||
|
ctx->readableSectorTags[AppleProfileTagAaru] = true;
|
||||||
|
break;
|
||||||
case AppleSonyTag:
|
case AppleSonyTag:
|
||||||
|
ctx->sector_subchannel = data;
|
||||||
|
ctx->readableSectorTags[PriamDataTowerTagAaru] = true;
|
||||||
|
break;
|
||||||
case PriamDataTowerTag:
|
case PriamDataTowerTag:
|
||||||
ctx->sector_subchannel = data;
|
ctx->sector_subchannel = data;
|
||||||
ctx->readableSectorTags[AppleSectorTag] = true;
|
ctx->readableSectorTags[AppleSonyTagAaru] = true;
|
||||||
break;
|
break;
|
||||||
case CompactDiscMode2Subheader:
|
case CompactDiscMode2Subheader:
|
||||||
ctx->mode2_subheaders = data;
|
ctx->mode2_subheaders = data;
|
||||||
|
|||||||
@@ -1769,7 +1769,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_read_sector_tag(const void *context, const u
|
|||||||
memcpy(buffer, ctx->sector_decrypted_title_key + corrected_sector_address * 5, 5);
|
memcpy(buffer, ctx->sector_decrypted_title_key + corrected_sector_address * 5, 5);
|
||||||
TRACE("Exiting aaruf_read_sector_tag() = AARUF_STATUS_OK");
|
TRACE("Exiting aaruf_read_sector_tag() = AARUF_STATUS_OK");
|
||||||
return AARUF_STATUS_OK;
|
return AARUF_STATUS_OK;
|
||||||
case AppleSectorTag:
|
case AppleSonyTagAaru:
|
||||||
if(ctx->image_info.MetadataMediaType != BlockMedia)
|
if(ctx->image_info.MetadataMediaType != BlockMedia)
|
||||||
{
|
{
|
||||||
FATAL("Invalid media type for tag");
|
FATAL("Invalid media type for tag");
|
||||||
@@ -1795,7 +1795,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_read_sector_tag(const void *context, const u
|
|||||||
memcpy(buffer, ctx->sector_subchannel + corrected_sector_address * 12, 12);
|
memcpy(buffer, ctx->sector_subchannel + corrected_sector_address * 12, 12);
|
||||||
TRACE("Exiting aaruf_read_sector_tag() = AARUF_STATUS_OK");
|
TRACE("Exiting aaruf_read_sector_tag() = AARUF_STATUS_OK");
|
||||||
return AARUF_STATUS_OK;
|
return AARUF_STATUS_OK;
|
||||||
case AppleProfileTag:
|
case AppleProfileTagAaru:
|
||||||
if(ctx->image_info.MetadataMediaType != BlockMedia)
|
if(ctx->image_info.MetadataMediaType != BlockMedia)
|
||||||
{
|
{
|
||||||
FATAL("Invalid media type for tag");
|
FATAL("Invalid media type for tag");
|
||||||
@@ -1821,7 +1821,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_read_sector_tag(const void *context, const u
|
|||||||
memcpy(buffer, ctx->sector_subchannel + corrected_sector_address * 20, 20);
|
memcpy(buffer, ctx->sector_subchannel + corrected_sector_address * 20, 20);
|
||||||
TRACE("Exiting aaruf_read_sector_tag() = AARUF_STATUS_OK");
|
TRACE("Exiting aaruf_read_sector_tag() = AARUF_STATUS_OK");
|
||||||
return AARUF_STATUS_OK;
|
return AARUF_STATUS_OK;
|
||||||
case PriamDataTowerTag:
|
case PriamDataTowerTagAaru:
|
||||||
if(ctx->image_info.MetadataMediaType != BlockMedia)
|
if(ctx->image_info.MetadataMediaType != BlockMedia)
|
||||||
{
|
{
|
||||||
FATAL("Invalid media type for tag");
|
FATAL("Invalid media type for tag");
|
||||||
|
|||||||
@@ -2372,7 +2372,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_write_sector_tag(void *context, const uint64
|
|||||||
memcpy(ctx->sector_decrypted_title_key + corrected_sector_address * 5, data, 5);
|
memcpy(ctx->sector_decrypted_title_key + corrected_sector_address * 5, data, 5);
|
||||||
TRACE("Exiting aaruf_write_sector_tag() = AARUF_STATUS_OK");
|
TRACE("Exiting aaruf_write_sector_tag() = AARUF_STATUS_OK");
|
||||||
return AARUF_STATUS_OK;
|
return AARUF_STATUS_OK;
|
||||||
case AppleSectorTag:
|
case AppleSonyTagAaru:
|
||||||
if(ctx->image_info.MetadataMediaType != BlockMedia)
|
if(ctx->image_info.MetadataMediaType != BlockMedia)
|
||||||
{
|
{
|
||||||
FATAL("Invalid media type for tag");
|
FATAL("Invalid media type for tag");
|
||||||
@@ -2400,7 +2400,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_write_sector_tag(void *context, const uint64
|
|||||||
memcpy(ctx->sector_subchannel + corrected_sector_address * 12, data, 12);
|
memcpy(ctx->sector_subchannel + corrected_sector_address * 12, data, 12);
|
||||||
TRACE("Exiting aaruf_write_sector_tag() = AARUF_STATUS_OK");
|
TRACE("Exiting aaruf_write_sector_tag() = AARUF_STATUS_OK");
|
||||||
return AARUF_STATUS_OK;
|
return AARUF_STATUS_OK;
|
||||||
case AppleProfileTag:
|
case AppleProfileTagAaru:
|
||||||
if(ctx->image_info.MetadataMediaType != BlockMedia)
|
if(ctx->image_info.MetadataMediaType != BlockMedia)
|
||||||
{
|
{
|
||||||
FATAL("Invalid media type for tag");
|
FATAL("Invalid media type for tag");
|
||||||
@@ -2428,7 +2428,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_write_sector_tag(void *context, const uint64
|
|||||||
memcpy(ctx->sector_subchannel + corrected_sector_address * 20, data, 20);
|
memcpy(ctx->sector_subchannel + corrected_sector_address * 20, data, 20);
|
||||||
TRACE("Exiting aaruf_write_sector_tag() = AARUF_STATUS_OK");
|
TRACE("Exiting aaruf_write_sector_tag() = AARUF_STATUS_OK");
|
||||||
return AARUF_STATUS_OK;
|
return AARUF_STATUS_OK;
|
||||||
case PriamDataTowerTag:
|
case PriamDataTowerTagAaru:
|
||||||
if(ctx->image_info.MetadataMediaType != BlockMedia)
|
if(ctx->image_info.MetadataMediaType != BlockMedia)
|
||||||
{
|
{
|
||||||
FATAL("Invalid media type for tag");
|
FATAL("Invalid media type for tag");
|
||||||
|
|||||||
Reference in New Issue
Block a user