Exemplo n.º 1
0
/******************************************************************************
**  Function   :  console_reset                
**                                         
**  Objective  :  Reset the system
**                                       
**  Parameters :  type        - machine type 5200, 800, XL/XE
**                system_type - PAL or NTSC
**                ram         - amount of memory to emulate
**                freq        - frequency to run Pokey Sound at
**                                     
**  return     :  NONE
**
******************************************************************************/ 
void console_reset ( e_machine_type type, int system_type, int ram, int freq) {

	console.machine_type = type;
	console.ram_size = ram;
	mem_reset ( );
	antic_init ();
	gtia_init ( system_type );
	pokey_init ( freq );
	pia_init ();
	sio_reset ();
	reset_6502 ();

	if ( system_type == PAL ) {
		console.frames_per_sec = 50;
		console.scanlines = 312;
	}
	else {
		console.frames_per_sec = 60;
		console.scanlines = 262;
	}

	console.option_key_pressed = 0;
	console.start_key_pressed = 0;

	if ( !console.basic_enable && (console.machine_type == MACHINE_TYPE_XL) )
		console.option_key_pressed = 1;

	if ( console.mapping == CART_CASSETTE ) {
		console.start_key_pressed = 2;
	}

} /* end console_reset */
Exemplo n.º 2
0
static int __init m32r_sio_console_init(void)
{
	sio_reset();
	sio_init();
	m32r_sio_init_ports();
	register_console(&m32r_sio_console);
	return 0;
}
Exemplo n.º 3
0
static int m32r_sio_startup(struct uart_port *port)
{
	struct uart_sio_port *up =
		container_of(port, struct uart_sio_port, port);
	int retval;

	sio_init();

	/*
	 * If the "interrupt" for this port doesn't correspond with any
	 * hardware interrupt, we use a timer-based system.  The original
	 * driver used to do this with IRQ0.
	 */
	if (!up->port.irq) {
		unsigned int timeout = up->port.timeout;

		timeout = timeout > 6 ? (timeout / 2 - 2) : 1;

		up->timer.data = (unsigned long)up;
		mod_timer(&up->timer, jiffies + timeout);
	} else {
		retval = serial_link_irq_chain(up);
		if (retval)
			return retval;
	}

	/*
	 * Finally, enable interrupts.  Note: Modem status interrupts
	 * are set via set_termios(), which will be occurring imminently
	 * anyway, so we don't enable them here.
	 * - M32R_SIO: 0x0c
	 * - M32R_PLDSIO: 0x04
	 */
	up->ier = UART_IER_MSI | UART_IER_RLSI | UART_IER_RDI;
	sio_out(up, SIOTRCR, up->ier);

	/*
	 * And clear the interrupt registers again for luck.
	 */
	sio_reset();

	return 0;
}