I found this last week searching through the KOS mailing list archives, and I found the information extremely useful for a project I'm working on. I thought I'd copy it here so others won't have to look too hard to find it:
I can't speak for all of what is reported above, but all of what I needed for my project is dead on. By setting params[1] to 4096 and params[2] to 0x600 and calling gdc_change_data_type(params); I can access the data in tracks 2-99 on a VideoCD. In simple terms, I made a copy of the cdrom_reinit() function in kernel/arch/dreamcast/hardware/cdrom.c with these different values for params[1] and params[2] to switch the read mode if I found that I was dealing with a (S)VCD, which I learned how to do by reading the documentation and source code to the GNU VCDImager.Originally Posted by Thierry Vermeylen
In more complex terms, here's pseudocode to begin reading a VideoCD on the Dreamcast (this actually does work, and I will be releasing a player with source code in the near future):
In case anyone is interested, I know there is at least one port of SMPEG floating around out there, and with KOS 1.3.x SMPEG should compile without making very many changes at all.int disc_status, disc_type;
uint32 params[4];
char info_vcd[2048];
/* Figure out if we're dealing with a CDROM_XA */
cdrom_get_status(&disc_status, &disc_type);
/* If we have a CDROM_XA disc, see if it is a VCD */
if (disc_type==0x20)
{
cdrom_read_sectors(info_vcd, 300,1);
if (
(
info_vcd[0] == 'V' &&
info_vcd[1] == 'I' &&
info_vcd[2] == 'D' &&
info_vcd[3] == 'E' &&
info_vcd[4] == 'O' &&
info_vcd[5] == '_' &&
info_vcd[6] == 'C' &&
info_vcd[7] == 'D' ) ||
( /* for SVCD, it could also read "'SUPERVCD' or 'HQ-VCD ' (two spaces after VCD) */)
)
{
params[0] = 0;
params[1] = 4096;
params[2] = 0x600;
params[3] = 2352;
/* You'll need to copy in this function and the MAKE_SYSCALL macro from cdrom.c in KOS */
gdc_change_data_type(params);
play_VCD(); /* of course, you'll have to write this one yourself. */
}
}
Also, be aware that every time you read a sector from a VCD now, you'll get back 2352 bytes. You only want 2324. I'm pretty sure that the bytes you want to ignore are the first 24 and the last 4. What I do is read the data into a 2352-byte buffer, but give the demuxer buffer+24, and tell it that the data ends at buffer+2348.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks