Skip to content

Commit

Permalink
makegdimg: Handle subchannel data on swapped audio tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
zeldin committed Jul 11, 2020
1 parent 5ad74ea commit 7edb33d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/source/track.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ static const struct {

static bool track_validate_size(enum track_type type, uint32_t secsize)
{
if (type == TRACK_RAW_2352 && secsize >= 2352)
if ((type == TRACK_RAW_2352 || type == TRACK_SWAP_2352) && secsize >= 2352)
/* Allow extra (subchannel) data */
return true;

Expand All @@ -381,7 +381,7 @@ static bool track_read_sector(struct track *t, uint8_t *sector, FILE *f,
{
if (f == NULL)
memset(sector, 0, 2352);
if (t->type == TRACK_RAW_2352) {
if (t->type == TRACK_RAW_2352 || t->type == TRACK_SWAP_2352) {
if (f != NULL) {
size_t r = fread(sector, 1, 2352, f);
if (r != 2352) {
Expand All @@ -394,6 +394,8 @@ static bool track_read_sector(struct track *t, uint8_t *sector, FILE *f,
return false;
}
}
if (formats[t->type].convert_func)
formats[t->type].convert_func(sector, adr);
}
} else {
if (f != NULL) {
Expand Down

0 comments on commit 7edb33d

Please sign in to comment.