Page 1 of 1
Detecting optical media type
Posted: Sat Oct 11, 2008 8:07 pm
by AndrewAPrice
I'm curious as to how optical drives detect the type of media inserted. e.g. if I inserted a blank unformatted disc, how does my drive know if it's a 650MB cd, 700MB cd, single layer DVD+R , single layer DVD-R, etc? Is there some unwritable part of the disc where this information is stored?
I'm guessing the physical medium if different, but could I write to the disk somehow and have my drive believe a DVD+R disc is really a DVD-R disc? (although it would cause the disc to be unreadable)
The last question is how do games detect if the original disc is inserted? I always assumed games accessed the disc as a stream of bytes and that is all that is available to them. If so, how would something like
DPM work?
Re: Detecting optical media type
Posted: Sat Oct 11, 2008 8:55 pm
by Brynet-Inc
For CD's,
ATIP.
Not sure about other types of optical media, but I assume it's a similar concept..
Additional Linkage:
http://www.cdr-forum.de/download/cdr.pdf
EDIT: According to the cdrecord(1) man page from the cdrtools project: "DVD media does not have ATIP information but there is equivalent prerecorded information that is read out and printed."
So it prints out both ATIP and.. the unnamed DVD counterpart.
Re: Detecting optical media type
Posted: Sat Oct 11, 2008 9:06 pm
by Troy Martin
On the question of determining if the original disc has been inserted for a game, I'm going to take Age of Empires II as an example. The game's .exe (EMPIRES2.EXE) is a stub to check to see if there is a CD in the drive with the file EMPIRES2.ICD (or something like that) on it. If it is, the copy of EMPIRES2.ICD on the hard drive is ran as an executable, running the game.
Not sure about new games though, but I assume it's much more complex (I can't just go and rename a few files to play SimCity 4 without a CD
).
Re: Detecting optical media type
Posted: Mon Oct 13, 2008 1:28 am
by bewing
The tracks on optical discs are not multiples of 512bytes (or 2K or whatever nice power of 2 you want to contemplate).
The extra bytes on each track are called "subcodes". They can be accessed by special ATAPI read commands. A typical burning program has a default algorithm for calculating and burning the subcodes, and the burner hardware itself may also enforce the default algorithm.
Games use non-standard subcodes. They use the special read commands to make sure that the subcodes on the disk are "valid". So, to copy a game disk, you need a cloning program that reads and writes the non-standard subcodes, and you need a burner that does not try to "fix" your subcodes into the standard, generic subcode format.
Re: Detecting optical media type
Posted: Mon Oct 13, 2008 2:04 am
by AJ
Hi,
There are lots of different pieces of software out there to provide copy protection. Have a look
here for a start. I have had issues with some copy protection in the past - not being able to play the game. I think this was with the
Safedisc-protected Dungeon Keeper 2.
Cheers,
Adam