Ejemplo n.º 1
0
/*
 * Initializes the keyboard driver.
 */
PUBLIC void keyboard_init(void)
{
	set_hwint(INT_KEYBOARD, &do_keyboard_hit);
	
    while (inputb(0x64) & 1)
		inputb(0x60);
}
Ejemplo n.º 2
0
void read_input_rs() {
  int i = 0;
  int byte = 0;
  while (i < 1024) {
    byte = inputb();
    if (byte == '\n') {
      break;
    }
    input[i] = byte;
    i += 1;
  }
  if (i >= 1024) {
    error(TOO_MANY_INPUT);
  }
}
Ejemplo n.º 3
0
			static void mergeFiles(
				std::string const & filenamea,
				std::string const & filenameb,
				std::string const & outputfilename
				)
			{
				::libmaus2::graph::TripleEdgeInput inputa(filenamea,32*1024);
				::libmaus2::graph::TripleEdgeInput inputb(filenameb,32*1024);
				::libmaus2::graph::TripleEdgeOutputMerge output(outputfilename, 32*1024);

				::libmaus2::graph::TripleEdge triplea;
				::libmaus2::graph::TripleEdge tripleb;
				bool oka = inputa.getNextTriple(triplea);
				bool okb = inputb.getNextTriple(tripleb);

				while ( oka && okb )
				{
					if ( triplea < tripleb )
					{
						output.write(triplea);
						oka = inputa.getNextTriple(triplea);
					}
					else
					{
						output.write(tripleb);
						okb = inputb.getNextTriple(tripleb);
					}
				}

				while ( oka )
				{
					output.write(triplea);
					oka = inputa.getNextTriple(triplea);
				}

				while ( okb )
				{
					output.write(tripleb);
					okb = inputb.getNextTriple(tripleb);
				}
			}
Ejemplo n.º 4
0
LPXLFOPER EXCEL_EXPORT
xlContainsDivByZero(
LPXLFOPER inputa)
{
EXCEL_BEGIN;

	if (XlfExcel::Instance().IsCalledByFuncWiz())
		return XlfOper(true);

XlfOper inputb(
	(inputa));
CellMatrix input(
	inputb.AsCellMatrix("input"));

bool result(
	ContainsDivByZero(
		input)
	);
return XlfOper(result);
EXCEL_END
}
Ejemplo n.º 5
0
/*
 * Parses key hit and decodes it to a scan code.
 */
PRIVATE uint8_t parse_key_hit(void)
{
	uint8_t scancode;
	uint8_t port_value;
	
    scancode = inputb(0x60);

    port_value = inputb(0x61);
    outputb(0x61, port_value | 0x80); 
    outputb(0x61, port_value & ~0x80); 
	
	/* A key was released. */
    if(scancode & 0x80)
    {
        scancode &= 0x7F; 
        
        /* Parse scan code. */
        switch (scancode)
        {
			/* Shift. */
			case KRLEFT_SHIFT:
			case KRRIGHT_SHIFT:
				mode &= ~SHIFT;
				break;
			
			/* CTRL. */
			case KRLEFT_CTRL:
				mode &= ~CTRL;
				break;
			
			/* Any other. */
			default:
				mode &= ~ANY;
				break;
		}
    }
   
   	/* A key was pressed. */ 
    else 
    {   
        /* Parse scan code. */
        switch (scancode)
        {
			/* Shift. */
			case KRLEFT_SHIFT:
			case KRRIGHT_SHIFT:
				mode |= SHIFT;
				break;
			
			/* CTRL. */
			case KRLEFT_CTRL:
				mode |= CTRL;
				break;
			
			/* Any other. */
			default:
				mode |= ANY;
				break;
		}
    }
    
    return (scancode);
}