Пример #1
0
int _start(void) {
	printf("CoDyVDfs v0.01\n");

	CdInit(1);
	DelDrv(FS_NAME);
	AddDrv(&fsdriver);

	initRpc();
	initFio();
	return(0);
}
Пример #2
0
main()
{
	int		i;
	int		hsync;
	int		ret;
	int		tmp_v;

	ResetCallback();
	// initialize CD subsystem
	CdInit();
	CdSetDebug(0);
	// initialize graphics
	ResetGraph(0);

	// initialize debug display
	FntLoad(960, 256);
	SetDumpFnt(FntOpen(64, 64, 128, 128, 0, 512));

	// initialize display double buffer
	SetDefDrawEnv(&db[0].draw, 0,   0, 320, 240);
	SetDefDrawEnv(&db[1].draw, 0, 240, 320, 240);
	SetDefDispEnv(&db[0].disp, 0, 240, 320, 240);
	SetDefDispEnv(&db[1].disp, 0,   0, 320, 240);
	db[0].draw.isbg = 1;
	setRGB0(&db[0].draw, 0, 0, 0);
	db[1].draw.isbg = 1;
	setRGB0(&db[1].draw, 0, 0, 0);

	setPolyF4(&db[0].prim);
	setRGB0(&db[0].prim, 255, 255, 0);
	setPolyF4(&db[1].prim);
	setRGB0(&db[1].prim, 255, 255, 0);

	for (i = 0; i < READ_FILES; i++) {
		set_read_file(i, filename[file_order[i]], (void *)0x80100000);
	}
	file_num = 0;

	// set CD subsystem mode
	param[0] = CdlModeSpeed;		// x2 speed
	while (CdControl(CdlSetmode, param, 0) == 0)
		;

	SetDispMask(1);		// enable display

	// main loop
	while(1) {
		cdb  = (cdb==db)? db+1: db;		// swap double buffer ID
		ClearOTag(cdb->ot, OTSIZE);	

		moving_object();

		FntPrint("CD READ TEST 2\n----------------\n");
		FntPrint("FILE: %d\n", file_num);
		FntPrint("POS: %02x:%02x:%02x\n", fp[file_num].pos.minute,
				fp[file_num].pos.second,
				fp[file_num].pos.sector);
		FntPrint("SECTORS: %d\n", read_remain_sector);
		FntPrint("READ V: %d\n", read_v);

		if ((ret = check_read_file()) == CD_READ_COMPLETE) {
			if (++file_num > READ_FILES-1) {
				file_num = 0;
				tmp_v = VSync(-1);
				read_v = tmp_v - start_v;
				start_v = tmp_v;
			}
			read_remain_sector = READ_SECTORS;	// for display
			start_read_file(file_num);
		}
		else if (ret != CD_READ_BUSY) {
				start_read_file(0);
				start_v = VSync(-1);
		}

		read_manage();

		hsync = VSync(0);
		PutDispEnv(&cdb->disp); // update display environment
		PutDrawEnv(&cdb->draw); // update drawing environment
		DrawOTag(cdb->ot);

		print_hsync(hsync);
		FntPrint("\nERROR: %d\n", errcnt);

		// flush debug strings
		FntFlush(-1);
	}
}