Beispiel #1
0
static void iso_readsector(uint8_t *b, int sector)
{
    if (!cdrom_drive) return;
    ioctl_open(0);
    fseek(iso_image,sector*2048,SEEK_SET);
    fread(b,2048,1,iso_image);
    iso_close();
}
Beispiel #2
0
void main() {
	fs_iso9660_init();
	
	/*
	{
	uint32	fd, size, t;
	char	buf[667];

	printf("Opening file /escape.txt\n");
	fd = iso_open("/escape.txt", O_RDONLY);
	if (fd == 0) {
		printf("Couldn't open file\n");
		return;
	}
	size = iso_total(fd);
	printf("fd is %d, size is %08lx\n", fd, size);
	
	while (size > 0) {
		int r;
		r = iso_read(fd, buf, 666);
		if (r < 0) {
			printf("Read error\n");
			return;
		}
		buf[r] = 0;
		printf("%s", buf);
		if (strstr(buf, "Let the party")) {
			t = 0;
		}
		size -= r;
	}
	printf("\nFile read is done\n");
	iso_close(fd); */

	{
		uint32		fd, t;
		dirent_t	*de;
		
		printf("Opening /demos");
		fd = iso_open("/music/mc2/entries/rookie", O_RDONLY | O_DIR);
		if (fd == 0) {
			printf("Couldn't open file\n");
			return;
		}
		
		printf("Scanning dir:\n");
		while ( (de = iso_readdir(fd)) ) {
			printf("%s\t%d\n", de->name, de->size);
			if (!strcmp(de->name, "R_WAR.ZIP")) {
				t = 0;
			}
		}
		
		iso_close(fd);
	}
}
Beispiel #3
0
static void iso_readsector_raw(uint8_t *b, int sector)
{
    uint32_t temp;
    if (!cdrom_drive) return;
    ioctl_open(0);
    fseek(iso_image, sector*2048, SEEK_SET);
    fread(b+16, 2048, 1, iso_image);
    iso_close();

    /* sync bytes */
    b[0] = 0;
    memset(b + 1, 0xff, 10);
    b[11] = 0;
    b += 12;
    lba_to_msf(b, sector*2048);
    b[3] = 1; /* mode 1 data */
    b += 4;
    b += 2048;
    memset(b, 0, 288);
}