Beispiel #1
0
/*
 * Make sure the screen is displayed.
 */
static void
make_display(void)
{
	/*
	 * If nothing is displayed yet, display starting from initial_scrpos.
	 */
	if (empty_screen()) {
		if (initial_scrpos.pos == -1)
			/*
			 * {{ Maybe this should be:
			 *    jump_loc(ch_zero(), jump_sline);
			 *    but this behavior seems rather unexpected
			 *    on the first screen. }}
			 */
			jump_loc(ch_zero(), 1);
		else
			jump_loc(initial_scrpos.pos, initial_scrpos.ln);
	} else if (screen_trashed) {
		int save_top_scroll = top_scroll;
		int save_ignore_eoi = ignore_eoi;
		top_scroll = 1;
		ignore_eoi = 0;
		if (screen_trashed == 2) {
			/*
			 * Special case used by ignore_eoi: re-open the input
			 * file and jump to the end of the file.
			 */
			reopen_curr_ifile();
			jump_forw();
		}
		repaint();
		top_scroll = save_top_scroll;
		ignore_eoi = save_ignore_eoi;
	}
}
Beispiel #2
0
/*
 * Get command character.
 * The character normally comes from the keyboard,
 * but may come from ungotten characters
 * (characters previously given to ungetcc or ungetsc).
 */
int
getcc(void)
{
	if (unget_end) {
		/*
		 * We have just run out of ungotten chars.
		 */
		unget_end = 0;
		if (len_cmdbuf() == 0 || !empty_screen())
			return (getchr());
		/*
		 * Command is incomplete, so try to complete it.
		 */
		switch (mca) {
		case A_DIGIT:
			/*
			 * We have a number but no command.  Treat as #g.
			 */
			return ('g');

		case A_F_SEARCH:
		case A_B_SEARCH:
			/*
			 * We have "/string" but no newline.  Add the \n.
			 */
			return ('\n');

		default:
			/*
			 * Some other incomplete command.  Let user complete it.
			 */
			return (getchr());
		}
	}

	if (ungot == NULL) {
		/*
		 * Normal case: no ungotten chars, so get one from the user.
		 */
		return (getchr());
	}

	/*
	 * Return the next ungotten char.
	 */
	{
		struct ungot *ug = ungot;
		int c = ug->ug_char;
		ungot = ug->ug_next;
		free(ug);
		unget_end = (ungot == NULL);
		return (c);
	}
}
Beispiel #3
0
void disable_APA() {
	
	UINT8 i, blank = 0;
	empty_screen();	
	for (i=0x00;i!=0xFF;++i) {
		
		remove_VBL(i);
		remove_LCD(i);
		
	}
	LCDC_REG = 0x18C0;
	mode(0xE00);
	
}