Exemple #1
0
int
main(int argc, char **argv)
{
	struct point	 line[2];

	if (argc == 2) {
		sscanf(argv[1],
		    " %d %d %d %d ",
		    &line[0].x,
		    &line[0].y,
		    &line[1].x,
		    &line[1].y);
	} else {
		line[0].x = line[0].y = line[1].x = line[1].y = -1;
	}

	if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) != 0)
		errx(EXIT_FAILURE, "SDL_Init: %s", SDL_GetError());
	atexit(SDL_Quit);
	atexit(cleanup);

	initvideo();
	mainloop(line);

	return EXIT_SUCCESS;
}
Exemple #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();

}
Exemple #3
0
int
main(int argc, char **argv)
{
	if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) != 0)
		errx(EXIT_FAILURE, "SDL_Init: %s", SDL_GetError());
	atexit(SDL_Quit);
	atexit(cleanup);

	initvideo();
	mainloop();

	return EXIT_SUCCESS;
}
Exemple #4
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();

}
Exemple #5
0
int
main(int argc, char **argv)
{
	if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) != 0)
		errx(EXIT_FAILURE, "SDL_Init: %s", SDL_GetError());
	atexit(SDL_Quit);
	atexit(cleanup);

	if (argc > 4) {
		int i = 1;
		sscanf(argv[i++], "%lf", &ishift);
		sscanf(argv[i++], "%lf", &jshift);
		sscanf(argv[i++], "%lf", &xrange);
		sscanf(argv[i++], "%lf", &yrange);
	}

	genpalette();
	initvideo();
	mainloop();

	return EXIT_SUCCESS;
}
Exemple #6
0
void initpc()
{
    char *p;
//        allegro_init();
    get_executable_name(pcempath,511);
    pclog("executable_name = %s\n", pcempath);
    p=get_filename(pcempath);
    *p=0;
    pclog("path = %s\n", pcempath);

    fdd_init();
    keyboard_init();
    mouse_init();
    joystick_init();
    midi_init();

    loadconfig(NULL);
    pclog("Config loaded\n");

    loadfont("mda.rom", 0, cga_fontdat, cga_fontdatm);
    loadfont("roms/pc1512/40078.ic127", 0, pc1512_fontdat, pc1512_fontdatm);
    loadfont("roms/pc200/40109.bin", 0, pc200_fontdat, pc200_fontdatm);

    codegen_init();

    cpuspeed2=(AT)?2:1;
//        cpuspeed2=cpuspeed;
    atfullspeed=0;

    device_init();

    initvideo();
    mem_init();
    loadbios();
    mem_add_bios();

    timer_reset();
    sound_reset();
    fdc_init();
// #ifdef USE_NETWORKING
    vlan_reset();	//NETWORK
    network_card_init(network_card_current);
// #endif

    loaddisc(0,discfns[0]);
    loaddisc(1,discfns[1]);

    //loadfont();
    loadnvr();
    sound_init();
    resetide();
#if __unix
    if (cdrom_drive == -1)
        cdrom_null_open(cdrom_drive);
    else
#endif
        ioctl_open(cdrom_drive);

    pit_reset();
    /*        if (romset==ROM_AMI386 || romset==ROM_AMI486) */fullspeed();
    ali1429_reset();
//        CPUID=(is486 && (cpuspeed==7 || cpuspeed>=9));
//        pclog("Init - CPUID %i %i\n",CPUID,cpuspeed);
    shadowbios=0;

#if __unix
    if (cdrom_drive == -1)
        cdrom_null_reset();
    else
#endif
        ioctl_reset();
}
Exemple #7
0
main()
{
	int	a,b,x,y;
	int	zimz;
	initvideo();
	readp(palette,-1,hzpic);
	for(y=0;y<256;y++)
	{
		readp(rowbuf,y,hzpic);
		lineblit(y+64,rowbuf);
	}
	for(y=0;y<32;y++)
	{
		readp(font[y],y+300,hzpic);
		for(a=0;a<640;a++) 	
		{
			switch(font[y][a])
			{
			case 0x40 : b=0xc0; break;
			case 0x41 : b=0x80; break;
			case 0x42 : b=0x40; break;
			default : b=0;
			} 
			font[y][a]=b;
		}
	}
	for(y=0;y<768;y+=3)
	{
		if(y<64*3) ;
		else if(y<128*3) 
		{
			palette2[y+0]=palette[0x42*3+0];
			palette2[y+1]=palette[0x42*3+1];
			palette2[y+2]=palette[0x42*3+2];
		}
		else if(y<192*3) 
		{
			palette2[y+0]=palette[0x41*3+0];
			palette2[y+1]=palette[0x41*3+1];
			palette2[y+2]=palette[0x41*3+2];
		}
		else
		{
			palette2[y+0]=palette[0x40*3+0];
			palette2[y+1]=palette[0x40*3+1];
			palette2[y+2]=palette[0x40*3+2];
		}
	}
	for(y=192;y<768;y++)
	{
		palette[y]=palette[y-192];
	}
	for(x=0;x<64;x++)
	{
		for(y=0;y<576;y++)
		{
			fade1[x][y]=(palette2[y+192]*x+palette[y+192]*(63-x))/63;
			fade2[x][y]=(palette2[y+192]*x)/63;
		}
	}

	for(x=0;x<640 && *fonaorder;)
	{
		while(x<640)
		{
			for(y=0;y<32;y++) if(font[y][x]) break;
			if(y!=32) break;
			x++;
		}
		b=x;
		while(x<640)
		{
			for(y=0;y<32;y++) if(font[y][x]) break;
			if(y==32) break;
			x++;
		}
		//printf("%c: %i %i\n",*fonaorder,b,x-b);
		fonap[*fonaorder]=b;
		fonaw[*fonaorder]=x-b;
		fonaorder++;
	}
	fonap[32]=640-20;
	fonaw[32]=16;
	setpalarea(fade2[0],64,192);

	for(;;)
	{	
		prtc(160,140,"A");
		prtc(160,180,"Future Crew");
		prtc(160,220,"production");
		dofade2(300);
		if(kbhit()) break;
	
		prtc(160,140,"First presented at");
		prtc(160,220,"Assembly NoNumbers");
		dofade2(300);
		if(kbhit()) break;
		
		dofadef();
		if(kbhit()) break;
	
		prtc(100,140,"Graphics");
		prtc(100,200,"Pixel");
		prtc(100,240,"Marvel");
		dofade(300);
		if(kbhit()) break;
	
		prtc(100,140,"Music");
		prtc(100,200,"Purple Motioon");
		prtc(100,240,"Skaven");
		dofade(300);
		if(kbhit()) break;
	
		prtc(100,140,"Code");
		prtc(100,200,"Trug");
		prtc(100,240,"Wildfire");
		prtc(100,280,"Psi");
		dofade(300);
		if(kbhit()) break;
	}
	getch();
	deinitvideo();
}
Exemple #8
0
int main(void) {

	//*uart_chan0_interruptenable |= INTERRUPTENABLE_ERBFI;

	//uint16_t* blip = _binary_blip_start;

	//for (int i = 0; i < sizeof(_binary_blip_start) / 2; i++) {
	//	*(sound_bank_0 + i) = *blip++;
	//}
	//*sound_channel_0_samplelength = sizeof(_binary_blip_start);
	//*sound_channel_master_config = 0xFFFF;
	//*sound_channel_master_volume = 0xFF99;
	//*sound_channel_0_volume = 0xFF22;
	//*sound_channel_0_config = 0xF9FF;

	FATFS fs;
	FRESULT result;
	result = pf_mount(&fs);
	util_printffresult(result);
	util_printfat(&fs);
	result = pf_open("test.txt");
	util_printffresult(result);
	char buf[64];
	uint16_t len;
	pf_read(buf, 63, &len);

	printf("read from file: %s\n", buf);

	image_loadimagefromfile(&fs, &pai, "pai.bz", true);
	image_loadimagefromfile(&fs, &ballimage, "ball.be", false);

	newball(&ball1, 0, 0, &ballimage);
	newball(&ball2, 50, 0, &ballimage);

	initvideo();

	machine_setinterruptmask(0);

	while (1) {

		if (fbready)
			continue;

		static uint16_t lastframe = 0;
		static uint16_t thisframe;

		uint16_t vidflags = video_register_flags;
		uint8_t port0 = input_port0;

		thisframe = video_register_frame;

		updateball(&ball1, thisframe, lastframe);
		updateball(&ball2, thisframe, lastframe);
		ballcollision(&ball1, &ball2);

		video_begin();
		video_clear(0xFFFF);
		video_blitimage_nocopy(pai.width, pai.height, 30, 30, pai.data);
		sprite_draw(ball1.sprite);
		sprite_draw(ball2.sprite);
		video_drawline(&vect);
		video_gputs("Hello World!", _binary_fontrom_start, 1, 1);

		lastframe = thisframe;
		video_commit();
		//video_flip();
		fbready = true;

	}

	printf("Shouldn't have got here!");

	while (1) {

	}

	return 0;

}