void Atari_Initialise(int *argc, char *argv[])
{
#ifdef SOUND
	Sound_Initialise(argc, argv);
#endif

	if (gron(argc, argv))
	{
		perror("Graphics initialization failed");
		exit(1);
	}
	if(initinput())
	{
		perror("Input initialization failed");
		exit(1);
	}

	/* backlight */
	REG_bat = REG_ac = REG_disp = 2 * 60 * 60 * 1000; /* 2hrs should do it */
	backlight_xchg();
	SystemParametersInfo(SPI_GETBATTERYIDLETIMEOUT, 0, (void *) &bat_timeout, 0);
	SystemParametersInfo(SPI_SETBATTERYIDLETIMEOUT, 60 * 60 * 2, NULL, SPIF_SENDCHANGE);

	clearkb();
}
Esempio n. 2
0
void initespec(){

	VTBuffer[0] = (uint32 *)malloc(MDFNGameInfo->pitch * 256);
	VTBuffer[1] = (uint32 *)malloc(MDFNGameInfo->pitch * 256);
	VTLineWidths[0] = (MDFN_Rect *)calloc(256, sizeof(MDFN_Rect));
	VTLineWidths[1] = (MDFN_Rect *)calloc(256, sizeof(MDFN_Rect));
	initvideo();
	initinput();

}
Esempio n. 3
0
void initespec(){
	VTBuffer[0] = new MDFN_Surface(NULL, MDFNGameInfo->pitch / sizeof(uint32), MDFNGameInfo->fb_height, MDFNGameInfo->pitch / sizeof(uint32), MDFN_COLORSPACE_RGB, 0, 8, 16, 24);
	VTBuffer[1] = new MDFN_Surface(NULL, MDFNGameInfo->pitch / sizeof(uint32), MDFNGameInfo->fb_height, MDFNGameInfo->pitch / sizeof(uint32), MDFN_COLORSPACE_RGB, 0, 8, 16, 24);
	VTLineWidths[0] = (MDFN_Rect *)calloc(MDFNGameInfo->fb_height, sizeof(MDFN_Rect));
	VTLineWidths[1] = (MDFN_Rect *)calloc(MDFNGameInfo->fb_height, sizeof(MDFN_Rect));
//NEWTODO
	/*
	VTBuffer[0] = (uint32 *)malloc(MDFNGameInfo->pitch * 256);
	VTBuffer[1] = (uint32 *)malloc(MDFNGameInfo->pitch * 256);
	VTLineWidths[0] = (MDFN_Rect *)calloc(256, sizeof(MDFN_Rect));
	VTLineWidths[1] = (MDFN_Rect *)calloc(256, sizeof(MDFN_Rect));
	*/
	initvideo();
	initinput();

}
void
mapAll(void)
{
    initinput();
    W_MapWindow(mapw);
    W_MapWindow(tstatw);
    W_MapWindow(warnw);
    W_MapWindow(messagew);
    W_MapWindow(w);
    W_MapWindow(baseWin);

    /*
       since we aren't mapping windows that have root as parent in
       x11window.c (since that messes up the TransientFor feature) we have to
       map them here. (If already mapped, W_MapWindow returns)
    */

    if (checkMapped("planet"))
	W_MapWindow(planetw);
    if (checkMapped("planet2"))
	W_MapWindow(planetw2);
    if (checkMapped("rank"))
	W_MapWindow(rankw);
    if (checkMapped("help"))
	W_MapWindow(helpWin);
    if (checkMapped("Motd"))
	W_MapWindow(motdWin);
    if (checkMapped("review_all"))
	W_MapWindow(messWin[WALL].window);
    if (checkMapped("review_team"))
	W_MapWindow(messWin[WTEAM].window);
    if (checkMapped("review_your"))
	W_MapWindow(messWin[WINDIV].window);
    if (checkMapped("review_kill"))
	W_MapWindow(messWin[WKILL].window);
    if (checkMapped("review_phaser"))
	W_MapWindow(messWin[WPHASER].window);
    if (booleanDefault("player.mapped", 1))
	W_MapWindow(playerw);
    if (booleanDefault("review.mapped", 1))
	W_MapWindow(messWin[WREVIEW].window);
    if (checkMapped("UDP"))
	udpwindow();

}
Esempio n. 5
0
extern int main(int argc, char *argv[], char *envp[]) {
	char *dashsee[2], *dollarzero, *null[1];
	int c;
	initprint();
	dashsee[0] = dashsee[1] = NULL;
	dollarzero = argv[0];
	rc_pid = getpid();
	dashell = (*argv[0] == '-'); /* Unix tradition */
	while ((c = rc_getopt(argc, argv, "c:deiIlnopsvx")) != -1)
		switch (c) {
		case 'c':
			dashsee[0] = rc_optarg;
			goto quitopts;
		case 'd':
			dashdee = TRUE;
			break;
		case 'e':
			dashee = TRUE;
			break;
		case 'I':
			dashEYE = TRUE;
			interactive = FALSE;
			break;
		case 'i':
			dasheye = interactive = TRUE;
			break;
		case 'l':
			dashell = TRUE;
			break;
		case 'n':
			dashen = TRUE;
			break;
		case 'o':
			dashoh = TRUE;
			break;
		case 'p':
			dashpee = TRUE;
			break;
		case 's':
			dashess = TRUE;
			break;
		case 'v':
			dashvee = TRUE;
			break;
		case 'x':
			dashex = TRUE;
			break;
		case '?':
			exit(1);
		}
quitopts:
	argv += rc_optind;
	/* use isatty() iff neither -i nor -I is set, and iff the input is not from a script or -c flags */
	if (!dasheye && !dashEYE && dashsee[0] == NULL && (dashess || *argv == NULL))
		interactive = isatty(0);
	if (!dashoh) {
		checkfd(0, rFrom);
		checkfd(1, rCreate);
		checkfd(2, rCreate);
	}
	initsignal();
	inithash();
	initparse();
	assigndefault("ifs", " ", "\t", "\n", (void *)0);
#ifdef DEFAULTPATH
	assigndefault("path", DEFAULTPATH, (void *)0);
#endif
	assigndefault("pid", nprint("%d", rc_pid), (void *)0);
	assigndefault("prompt", "; ", "", (void *)0);
	assigndefault("version", VERSION, "$Release: @(#)" PACKAGE " " VERSION " " RELDATE " $", (void *)0);
	initenv(envp);
	initinput();
	null[0] = NULL;
	starassign(dollarzero, null, FALSE); /* assign $0 to $* */
	inithandler();

	if (dashell) {
		char *rcrc;
		int fd;

		rcrc = concat(varlookup("home"), word("/.rcrc", NULL))->w;
		fd = rc_open(rcrc, rFrom);
		if (fd == -1) {
			if (errno != ENOENT)
				uerror(rcrc);
		} else {
			bool push_interactive;

			pushfd(fd);
			push_interactive = interactive;
			interactive = FALSE;
			doit(TRUE);
			interactive = push_interactive;
			close(fd);
		}
	}

	if (dashsee[0] != NULL || dashess) {	/* input from  -c or -s? */
		if (*argv != NULL)
			starassign(dollarzero, argv, FALSE);
		if (dashess)
			pushfd(0);
		else
			pushstring(dashsee, TRUE);
	} else if (*argv != NULL) {	/* else from a file? */
		b_dot(--argv);
		rc_exit(getstatus());
	} else {			/* else stdin */
		pushfd(0);
	}
	dasheye = FALSE;
	doit(TRUE);
	rc_exit(getstatus());
	return 0; /* Never really reached. */
}