LIBCDVD - does it work for DVD-ROM disks?

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
ole
Posts: 92
Joined: Sat May 08, 2004 11:14 pm
Location: Czech Republic

LIBCDVD - does it work for DVD-ROM disks?

Post by ole »

I've tested the libcdvd 1.15 example program. It works, but only when CD-ROM is inserted. When the DVD-ROM (original of course, for example demo disk included in ps2 mag, or game) is inserted, the directory structure is empty (black screen, or the TOC is not cleared and the old directory strucutre remains on the screen). When some CD-ROM ps1 or ps2 disk is inserted then it works correctly.
The disk was changed by regular method - eject button (not the cog swap).
I'm using independence exploit on non-moded ps2 and naplink 1.1.
Any Idea how to access DVD-ROM using libcdvd on non moded machine?

Ole
ole
Posts: 92
Joined: Sat May 08, 2004 11:14 pm
Location: Czech Republic

Solved!

Post by ole »

Found the reason of that malfunction.
TOC size and DIR size is not allways padded to 2048 bytes (sometimes is less) and it results in bad sector_size computation (CachedDirInfo.sector_num = CDVolDesc.rootToc.tocSize>>11; // gives a result 0).
This simlpification (>>11) gives incorrect sector size and is used in about 3 places in the cdvd_iop.c source code.
I changed this formula to something like that:

Code: Select all

int getSectorCount(int dirSize) {
	int result = dirSize / 2048;
	if ((dirSize % 2048 ) > 0) {
		result++;
	}
	return result;
}
and finaly LIBCDVD works just fine with the DVD-ROMs.

Ole
Post Reply