Ejemplo n.º 1
0
static void config_input(void)
{
int choice;
char dev_type;
char buf[PATH_SIZE];
USHORT idis[9];
UBYTE modes[IDR_MAX_OPTIONS];
char sbuf[80];

	clear_mem(idis,sizeof(idis));
	idis[vconfg.dev_type] = QCF_ASTERISK;
	if(!resource_exists(summa_idriver_name))
		idis[1] |= QCF_DISABLED;

	choice = soft_qchoice(idis, "input_device" );
	switch (choice)
	{
		default:
			return;
		case 0:
			dev_type = 0;
			strcpy(buf, mouse_idriver_name);
			break;
		case 1:
			dev_type = 1;
			strcpy(buf, summa_idriver_name);
			break;
		case 2:
			if(vconfg.dev_type == 2)
				strcpy(buf,vconfg.idr_name);
			else
				buf[0] = 0;
			if(!req_resource_name(buf,"*.idr", 
								 stack_string("idr_scroll", sbuf)))
			{
				return;
			}
			dev_type = 2;
			break;
		case 3:
			if (!get_serial_port())
				return;
			goto REWRITE;
	}

	memcpy(modes,vconfg.idr_modes,sizeof(modes));
	if(config_idriver(buf, modes, 
					   txtcmp(vconfg.idr_name,buf) == 0,
					   (SHORT)vconfg.comm_port) < Success)
	{
		return;
	}
	vconfg.dev_type = dev_type;
	memcpy(vconfg.idr_modes,modes,sizeof(modes));
	strcpy(vconfg.idr_name, buf);
REWRITE:
	rewrite_config();
	cleanup_idriver();
	init_input();
}
Ejemplo n.º 2
0
// Initializes and "pings" the LDP/VLDP and returns true if the player is online and detected
// or false if the LDP could not be initialized
bool ldp::pre_init()
{

	bool result = true;	// assume everything works until we find out otherwise
	bool temp = true;	// needed to make && work the way we want below

	// If we are controlling a real LDP,
	// or if we are controlling a combo and DVD initialized properly,
	// then initialize the serial port here
	if (need_serial)
	{
		printline("NOTE : You are attempting to use DAPHNE with a real laserdisc player!");
		printline("If you don't have DAPHNE plugged into a real laserdisc player,");
		printline("you should be using VLDP instead.");
		serial_initialized = serial_init(get_serial_port(), get_baud_rate());
		temp = serial_initialized;
	}
	
	player_initialized = init_player();
	result = temp && player_initialized;
	m_start_time = GET_TICKS();
	m_uElapsedMsSincePlay = 0;
	m_uBlockedMsSincePlay = 0;
	m_uElapsedMsSinceStart = 0;
	m_uMsVblankBoundary = 0;
	m_bPreInitCalled = true;
	m_bWaitingForVblankToPlay = false;
	m_iSkipOffsetSincePlay = 0;
	m_uMsFrameBoundary = 0;
	m_uVblankCount = 0;
	m_uVblankMiniCount = 0;
	m_uFramesToSkipPerFrame = 0;
	m_uFramesToStallPerFrame = 0;
	m_uStallFrames = 0;
	m_bVerbose = true;

	return(result);

}