Пример #1
0
void TMemo::go_to(int idx1, int idx2, int nscroll)
{
	if (idx2==-1) idx2 = idx1;
	set_focus();
	set_selection(idx1,idx2);
    scroll_caret();
	scroll_line(nscroll); //*SJD* Should have an estimate of the page size!!
}
Пример #2
0
static void
w32con_delete_glyphs (int n)
{
  /* delete chars means scroll chars from cursor_coords.X + n to
     cursor_coords.X, anything beyond the edge of the screen should
     come out empty...  */

  scroll_line (n, LEFT);
}
Пример #3
0
void teleprinter_device::write_char(UINT8 data) {
	m_buffer[(TELEPRINTER_HEIGHT-1)*TELEPRINTER_WIDTH+m_x_pos] = data;
	m_x_pos++;
	if (m_x_pos >= TELEPRINTER_WIDTH)
	{
		m_x_pos = 0;
		scroll_line();
	}
}
Пример #4
0
void teleprinter_device::write_char(uint8_t data) {
	m_buffer[(m_height-1)*m_width+m_x_pos] = data;
	m_x_pos++;
	if (m_x_pos >= m_width)
	{
		m_x_pos = 0;
		scroll_line();
	}
}
Пример #5
0
void generic_terminal_device::term_write(uint8_t data)
{
	if (data > 0x1f)
	{
		// printable char
		if (data != 0x7f) write_char(data);
	}
	else
	{
		const uint16_t options = m_io_term_conf->read();
		switch(data)
		{
		case 0x07: // bell
			m_beeper->set_state(1);
			m_bell_timer->reset(attotime::from_msec(250));
			break;

		case 0x08: // backspace
			if (m_x_pos) m_x_pos--;
			break;

		case 0x09: // horizontal tab
			m_x_pos = (std::min<uint8_t>)((m_x_pos & 0xf8) + 8, TERMINAL_WIDTH - 1);
			break;

		case 0x0d: // carriage return
			m_x_pos = 0;
			if (!(options & 0x080)) break;

		case 0x0a: // linefeed
			m_y_pos++;
			if (m_y_pos >= TERMINAL_HEIGHT)
			{
				scroll_line();
				m_y_pos = TERMINAL_HEIGHT - 1;
			}
			if (options & 0x040) m_x_pos = 0;
			break;

		case 0x0b: // vertical tab
			if (m_y_pos) m_y_pos--;
			break;

		case 0x0c: // form feed
			clear();
			break;

		case 0x1e: // record separator
			m_x_pos = 0;
			m_y_pos = 0;
			break;
		}
	}
}
Пример #6
0
void scroll_screen(char c){
	uint8_t offset;
	for (offset=0;offset<8;offset++) {
		scroll_line(c,offset);
		if (!(offset%2)) {
			while (lcd_is_busy());
			lcd_dma_start();
		}
//		delay_ms(150);
	}
}
Пример #7
0
void generic_terminal_device::write_char(uint8_t data)
{
	m_buffer[m_y_pos*TERMINAL_WIDTH+m_x_pos] = data;
	m_x_pos++;
	if (m_x_pos >= TERMINAL_WIDTH)
	{
		m_x_pos = 0;
		m_y_pos++;
		if (m_y_pos >= TERMINAL_HEIGHT)
		{
			scroll_line();
			m_y_pos = TERMINAL_HEIGHT-1;
		}
	}
}
Пример #8
0
void generic_terminal_device::write_char(uint8_t data)
{
	m_buffer[m_y_pos*m_width+m_x_pos] = data;
	m_x_pos++;
	if (m_x_pos >= m_width)
	{
		m_x_pos = 0;
		m_y_pos++;
		if (m_y_pos >= m_height)
		{
			scroll_line();
			m_y_pos = m_height-1;
		}
	}
}
Пример #9
0
void teleprinter_device::term_write(UINT8 data)
{
	switch(data) {
		case 10: m_x_pos = 0;
				scroll_line();
				break;
		case 13: m_x_pos = 0; break;
		case  9: m_x_pos = (m_x_pos & 0xf8) + 8;
				if (m_x_pos >= TELEPRINTER_WIDTH)
					m_x_pos = TELEPRINTER_WIDTH-1;

				break;
		case 16: break;
		default: write_char(data); break;
	}
}
Пример #10
0
void teleprinter_device::term_write(uint8_t data)
{
	switch(data) {
		case 10: m_x_pos = 0;
				scroll_line();
				break;
		case 13: m_x_pos = 0; break;
		case  9: m_x_pos = (m_x_pos & 0xf8) + 8;
				if (m_x_pos >= m_width)
					m_x_pos = m_width-1;

				break;
		case 16: break;
		default: write_char(data); break;
	}
}
Пример #11
0
static void write_char(char c) {
  if (col >= COLS) {
    col = 0;
    row++;
  }
  if (row >= ROWS) {
    scroll_line();
  }

  if (c == '\n') {
    col = 0;
    row++;
  } else {
    buf[row * COLS + col] = c | color << 8;
    col++;
  }
}
Пример #12
0
void generic_terminal_device::term_write(UINT8 data)
{
	if (data > 0x1f)
	{
		// printable char
		if (data!=0x7f) write_char(data);
	}
	else
	{
		switch(data)
		{
			case 0x07 : // bell
					break;

			case 0x08:  if (m_x_pos) m_x_pos--;
					break;

			case 0x09:  m_x_pos = (m_x_pos & 0xf8) + 8;
					if (m_x_pos >= TERMINAL_WIDTH)
						m_x_pos = TERMINAL_WIDTH-1;
					break;

			case 0x0a:  m_y_pos++;
					m_x_pos = 0;
					if (m_y_pos >= TERMINAL_HEIGHT)
					{
						scroll_line();
						m_y_pos = TERMINAL_HEIGHT-1;
					}
					break;

			case 0x0b:  if (m_y_pos) m_y_pos--;
					break;

			case 0x0c:  clear();
					break;

			case 0x0d:  m_x_pos = 0;
					break;

			case 0x1e:  m_x_pos = 0;
					m_y_pos = 0;
					break;
		}
	}
}
Пример #13
0
/* If start is zero insert blanks instead of a string at start ?. */
static void
w32con_insert_glyphs (register struct glyph *start, register int len)
{
  scroll_line (len, RIGHT);

  /* Move len chars to the right starting at cursor_coords, fill with blanks */
  if (start)
    {
      /* Print the first len characters of start, cursor_coords.X adjusted
	 by write_glyphs.  */

      w32con_write_glyphs (start, len);
    }
  else
    {
      w32con_clear_end_of_line (cursor_coords.X + len);
    }
}
Пример #14
0
//*****************************************************************************
//
// This function reads a line of text from the player.
//
//*****************************************************************************
int
input_line(int buflen, char *buffer, int timeout, int *read_size)
{
    int iRow, iColumn;
    long lChar;

    //
    // Loop forever.  This loop will be explicitly when appropriate.
    //
    while(1)
    {
        //
        // Read a character.
        //
        lChar = input_character(timeout);

        //
        // If the ZIP interpreter has been halted, then return immediately.
        //
        if(halt)
        {
            return('\n');
        }

        //
        // See if a backsapce or delete character was read.
        //
        if((lChar == '\b') || (lChar == 0x7f))
        {
            //
            // See if there are any characters in the buffer.
            //
            if(*read_size != 0)
            {
                //
                // Decrement the number of characters in the buffer.
                //
                (*read_size)--;

                //
                // Get the cursor position.
                //
                get_cursor_position(&iRow, &iColumn);

                //
                // Move the cursor one character to the left.
                //
                move_cursor(iRow, --iColumn);

                //
                // Display a space to erase the previous character.
                //
                display_char(' ');

                //
                // Move the cursor back to the left.
                //
                move_cursor(iRow, iColumn);
            }
        }

        //
        // See if this a carriage return or newline character.
        //
        else if((lChar == '\n') || (lChar == '\r'))
        {
            //
            // Ignore this character if the previous character was the opposite
            // of the CR/LF pair.
            //
            if(((lChar == '\n') && (g_lPrevChar != '\r')) ||
               ((lChar == '\r') && (g_lPrevChar != '\n')))
            {
                //
                // Save this character as the previous character.
                //
                g_lPrevChar = lChar;

                //
                // Scroll the screen.
                //
                scroll_line();

                //
                // Return the most recently read character.
                //
                return(lChar);
            }
        }

        //
        // See if there is space in the buffer for another character.
        //
        else if(*read_size != (buflen - 1))
        {
            //
            // Save this character in the buffer.
            //
            buffer[(*read_size)++] = lChar;

            //
            // Display this character.
            //
            display_char(lChar);
        }

        //
        // Save this character as the previous character.
        //
        g_lPrevChar = lChar;
    }
}