Update sector tag constants for Aaru compatibility

This commit is contained in:
2025-10-18 16:14:49 +01:00
parent ebd345ce82
commit 112f8ab320
4 changed files with 18 additions and 10 deletions

View File

@@ -361,14 +361,20 @@ int32_t process_data_block(aaruformat_context *ctx, IndexEntry *entry)
ctx->readableSectorTags[CdSectorEdc] = true;
break;
case CdSectorSubchannel:
ctx->sector_subchannel = data;
ctx->sector_subchannel = data;
ctx->readableSectorTags[CdSectorSubchannelAaru] = true;
break;
case AppleProfileTag:
ctx->sector_subchannel = data;
ctx->readableSectorTags[AppleProfileTagAaru] = true;
break;
case AppleSonyTag:
ctx->sector_subchannel = data;
ctx->readableSectorTags[PriamDataTowerTagAaru] = true;
break;
case PriamDataTowerTag:
ctx->sector_subchannel = data;
ctx->readableSectorTags[AppleSectorTag] = true;
ctx->sector_subchannel = data;
ctx->readableSectorTags[AppleSonyTagAaru] = true;
break;
case CompactDiscMode2Subheader:
ctx->mode2_subheaders = data;

View File

@@ -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);
TRACE("Exiting aaruf_read_sector_tag() = AARUF_STATUS_OK");
return AARUF_STATUS_OK;
case AppleSectorTag:
case AppleSonyTagAaru:
if(ctx->image_info.MetadataMediaType != BlockMedia)
{
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);
TRACE("Exiting aaruf_read_sector_tag() = AARUF_STATUS_OK");
return AARUF_STATUS_OK;
case AppleProfileTag:
case AppleProfileTagAaru:
if(ctx->image_info.MetadataMediaType != BlockMedia)
{
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);
TRACE("Exiting aaruf_read_sector_tag() = AARUF_STATUS_OK");
return AARUF_STATUS_OK;
case PriamDataTowerTag:
case PriamDataTowerTagAaru:
if(ctx->image_info.MetadataMediaType != BlockMedia)
{
FATAL("Invalid media type for tag");

View File

@@ -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);
TRACE("Exiting aaruf_write_sector_tag() = AARUF_STATUS_OK");
return AARUF_STATUS_OK;
case AppleSectorTag:
case AppleSonyTagAaru:
if(ctx->image_info.MetadataMediaType != BlockMedia)
{
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);
TRACE("Exiting aaruf_write_sector_tag() = AARUF_STATUS_OK");
return AARUF_STATUS_OK;
case AppleProfileTag:
case AppleProfileTagAaru:
if(ctx->image_info.MetadataMediaType != BlockMedia)
{
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);
TRACE("Exiting aaruf_write_sector_tag() = AARUF_STATUS_OK");
return AARUF_STATUS_OK;
case PriamDataTowerTag:
case PriamDataTowerTagAaru:
if(ctx->image_info.MetadataMediaType != BlockMedia)
{
FATAL("Invalid media type for tag");