Support for 2448-byte sectors

Pier Solar and the Great Architects CDI uses an unknown type 4 sector of
2448 bytes. This hack allows the CDI to be read. Not sure about the
correctness.
This commit is contained in:
Flyinghead 2018-07-12 11:10:11 +02:00
parent 87f8c5194f
commit e18eaf666d
2 changed files with 13 additions and 3 deletions

View File

@ -85,7 +85,9 @@ void CDI_read_track (FILE *fsource, image_s *image, track_s *track)
case 0 : track->sector_size = 2048; break;
case 1 : track->sector_size = 2336; break;
case 2 : track->sector_size = 2352; break;
default: printf("Unsupported sector size");
case 4 : track->sector_size = 2448; break;
default: printf("Unsupported sector size. value %ld\n", track->sector_size_value);
break;
}
if (track->mode > 2) printf( "Unsupported format: Track mode not supported");

View File

@ -72,6 +72,7 @@ enum SectorFormat
SECFMT_2048_MODE1, //2048 user byte, form1 sector
SECFMT_2048_MODE2_FORM1, //2048 user bytes, form2m1 sector
SECFMT_2336_MODE2, //2336 user bytes,
SECFMT_2448_MODE2, //2048 user bytes, ? SYNC (12) | HEAD (4) | sub-head (8) | data (2048) | edc (4) | ecc (276) + subcodes (96) ?
};
enum SubcodeFormat
@ -168,7 +169,7 @@ struct Disc
void ReadSectors(u32 FAD,u32 count,u8* dst,u32 fmt)
{
u8 temp[2352];
u8 temp[2448];
SectorFormat secfmt;
SubcodeFormat subfmt;
@ -192,9 +193,14 @@ struct Disc
printf("GDR:fmt=2352;secfmt=2048\n");
memcpy(dst,temp,2048);
}
else if (fmt==2048 && secfmt==SECFMT_2448_MODE2)
{
// Pier Solar and the Great Architects
ConvertSector(temp, dst, 2448, fmt, FAD);
}
else
{
printf("ERROR: UNABLE TO CONVERT SECTOR. THIS IS FATAL.");
printf("ERROR: UNABLE TO CONVERT SECTOR. THIS IS FATAL. Format: %d Sector format: %d\n", fmt, secfmt);
//verify(false);
}
}
@ -286,6 +292,8 @@ struct RawTrackFile : TrackFile
*sector_type=SECFMT_2048_MODE2_FORM1;
else if (fmt==2336)
*sector_type=SECFMT_2336_MODE2;
else if (fmt==2448)
*sector_type=SECFMT_2448_MODE2;
else
{
verify(false);