Exemplo n.º 1
0
void specialKey(int key, int x, int y)	//special key input handling
{
	int mods;
	mods = glutGetModifiers();

	switch(key)
	{
	case GLUT_KEY_F1:
		toggleFullScreen();	//fullscreen toggle on F1
		break;
	case GLUT_KEY_F4:		//quit on Alt+F4
		if(mods == GLUT_ACTIVE_ALT)
			endprog(0);
		break;
	case GLUT_KEY_UP:
		xRot -= 5;
		break;
	case GLUT_KEY_DOWN:
		xRot += 5;
		break;
	case GLUT_KEY_LEFT:
		yRot -= 5;
		break;
	case GLUT_KEY_RIGHT:
		yRot += 5;
		break;
	case GLUT_KEY_PAGE_UP:
		zRot += 5;
		break;
	case GLUT_KEY_PAGE_DOWN:
		zRot -= 5;
		break;
	}
}
Exemplo n.º 2
0
void normalKey(unsigned char key, int x, int y)	//normal key input handling
{
	int mods;
	mods = glutGetModifiers();

	switch(key)
	{
	case 27:	//quit on Esc key
		endprog(0);
		break;
	case 13:
		if(mods == GLUT_ACTIVE_ALT)	//fullscreen toggle on Alt+Enter
			toggleFullScreen();
		break;
	case 32:
		xRot = 0;
		yRot = 0;
		zRot = 0;
		break;
	case '-':
	case '_':
		break;
	case '=':
	case '+':
		break;
	}
}
Exemplo n.º 3
0
void main(int argc, char *argv[])
{
	if(init(argc, argv))	//initialize and if successful continue
	{						//otherwise quit with errorcode 1
		printf("Initialization failed, exiting\n");
		endprog(1);
	}

	glutMainLoop();			//begin main GLUT loop
}
Exemplo n.º 4
0
void startdebugger() {
    static int firsttime = 1;

    curblank = 0x40;
    debuggeron = 1;

#ifdef __MSDOS__
    __dpmi_regs regs;
    regs.x.ax = 0x0003;
    __dpmi_int(0x10, &regs);
#endif // __MSDOS__

    if (firsttime) {
    initscr(); cbreak(); noecho();
    intrflush(stdscr, FALSE);
    keypad(stdscr, TRUE);

    /* set up colors */
    start_color();
    init_pair(cp_white,         COLOR_WHITE,   COLOR_BLACK);
    init_pair(cp_magenta,       COLOR_MAGENTA, COLOR_BLACK);
    init_pair(cp_red,           COLOR_RED,     COLOR_BLACK);
    init_pair(cp_cyan,          COLOR_CYAN,    COLOR_BLACK);
    init_pair(cp_green,         COLOR_GREEN,   COLOR_BLACK);
    init_pair(cp_yellow,        COLOR_YELLOW,  COLOR_BLACK);
    init_pair(cp_white_on_blue, COLOR_WHITE,   COLOR_BLUE);
    }

    execut = 0;

    if (firsttime) {
    startdisplay();

    debugwin = newwin(20, 77, 2, 1);

    wbkgd(debugwin, CP(cp_white_on_blue) | ' ');
    // wattrset(debugwin, CP(cp_white_on_blue));

    scrollok(debugwin, TRUE);
    idlok(debugwin, TRUE);

    firsttime = 0;
    } else {
        touchwin(stdscr);
        touchwin(debugwin);
        refresh();
        wrefresh(debugwin);
    }

    debugloop();
    cleardisplay();

    // "pushad / call LastLog / ... / popad" elided
    SaveOAMRamLog();


    if (execut == 1) {
        start65816(); return;
    }
    endprog(); return;
}