コード例 #1
0
void video_fullscreen_flip()
{
	int restore_yuv = yuv_mode;
	savedata.fullscreen ^= 1;
	if(window) video_set_mode(stored_videomodes);
	if(restore_yuv) video_setup_yuv_overlay(&stored_yuv_mode);
}
コード例 #2
0
void setVideoMode()
{
	if(isWide) // 480x272
	{
		videomodes.mode    = savedata.screen[videoMode][0];
		videomodes.filter  = savedata.screen[videoMode][1];
		videomodes.hRes    = 480;
		videomodes.vRes    = 272;
		videomodes.hScale  = (float)1.5;
		videomodes.vScale  = (float)1.13;
		videomodes.hShift  = 80;
		videomodes.vShift  = 20;
		videomodes.dOffset = 263;
		videomodes.pixel   = 4;
	}
	else // 320x240
	{
		videomodes.mode    = savedata.screen[videoMode][0];
		videomodes.filter  = savedata.screen[videoMode][1];
		videomodes.hRes    = 320;
		videomodes.vRes    = 240;
		videomodes.hScale  = 1;
		videomodes.vScale  = 1;
		videomodes.hShift  = 0;
		videomodes.vShift  = 0;
		videomodes.dOffset = 231;
		videomodes.pixel   = 4;
	}

	video_set_mode(videomodes);
}
コード例 #3
0
ファイル: video.c プロジェクト: Protovision/moonbase
static int moonbase_video_set_mode( lua_State *s )
{
	struct video_mode mode;

	luacom_read_table( s, 1, "uip",
		"format", &mode.format,
		"refreshRate", &mode.refresh_rate,
		"opaque", &mode.opaque );
	lua_getfield( s, 1, "size" );
	luacom_read_array( s, -1, "ii", 1, &mode.size.w, 2, &mode.size.h );
	video_set_mode( &mode );
	return 0;
}
コード例 #4
0
ファイル: mvs.c プロジェクト: AMSMM/NJEMU
static void neogeo_exit(void)
{
	SceUID fd;
	char path[MAX_PATH];

	video_set_mode(32);
	video_clear_screen();

	ui_popup_reset();

	video_clear_screen();
	msg_screen_init(WP_LOGO, ICON_SYSTEM, TEXT(EXIT_EMULATION2));

	msg_printf(TEXT(PLEASE_WAIT2));

#ifdef ADHOC
	if (!adhoc_enable)
#endif
	{
		sprintf(path, "%smemcard/%s.bin", launchDir, game_name);
		if ((fd = sceIoOpen(path, PSP_O_WRONLY|PSP_O_CREAT, 0777)) >= 0)
		{
			sceIoWrite(fd, neogeo_memcard, 0x800);
			sceIoClose(fd);
		}

		sprintf(path, "%snvram/%s.nv", launchDir, game_name);
		if ((fd = sceIoOpen(path, PSP_O_WRONLY|PSP_O_CREAT, 0777)) >= 0)
		{
			swab(neogeo_sram16, neogeo_sram16, 0x2000);
			sceIoWrite(fd, neogeo_sram16, 0x2000);
			sceIoClose(fd);
		}


#ifdef COMMAND_LIST
		free_commandlist();
#endif

		if (neogeo_save_sound_flag) option_sound_enable = 1;
		save_gamecfg(game_name);
	}

	msg_printf(TEXT(DONE2));

#ifdef ADHOC
	if (adhoc_enable) adhocTerm();
#endif

	show_exit_screen();
}
コード例 #5
0
ファイル: emumain.c プロジェクト: AMSMM/NJEMU
void show_fatal_error(void)
{
	if (fatal_error)
	{
		int sx, sy, ex, ey;
		int width = uifont_get_string_width(fatal_error_message);
		int update = 1;

		sx = (SCR_WIDTH - width) >> 1;
		sy = (SCR_HEIGHT - FONTSIZE) >> 1;
		ex = sx + width;
		ey = sy + (FONTSIZE - 1);

		video_set_mode(32);

		load_background(WP_LOGO);

		while (Loop != LOOP_EXIT)
		{
			if (update)
			{
				show_background();
				small_icon_shadow(6, 3, UI_COLOR(UI_PAL_TITLE), ICON_SYSTEM);
				uifont_print_shadow(32, 5, UI_COLOR(UI_PAL_TITLE), TEXT(FATAL_ERROR));
				draw_dialog(sx - FONTSIZE/2, sy - FONTSIZE/2, ex + FONTSIZE/2, ey + FONTSIZE/2);
				uifont_print_shadow_center(sy, UI_COLOR(UI_PAL_SELECT), fatal_error_message);

				update = draw_battery_status(1);
				update |= draw_volume_status(1);
				video_flip_screen(1);
			}
			else
			{
				update = draw_battery_status(0);
				update |= draw_volume_status(0);
				video_wait_vsync();
			}

			pad_update();

			if (pad_pressed(PSP_CTRL_ANY))
				break;
		}

		pad_wait_clear();

		fatal_error = 0;
	}
}
コード例 #6
0
ファイル: ncdz.c プロジェクト: 173210/mvspsp
static int neogeo_init(void)
{
	video_set_mode(16);

	memset(memory_region_cpu1, 0, 0x200000);
	memset(memory_region_cpu2, 0, 0x10000);

	neogeo_driver_init();
	neogeo_video_init();
	input_reset();

	cpu_reset_flag = 0;

	swab(startup_bin, memory_region_cpu1 + 0x10f300, 0xd00);
	m68000_write_memory_32(0x120002, 0xffffffff);
	m68000_write_memory_32(0x11c808, 0xc0c760);	// load screen setup function
	m68000_write_memory_32(0x11c80c, 0xc0c814);	// load screen progress function
	m68000_write_memory_32(0x11c810, 0xc190e2);	// load screen default anime data

	if (!neogeo_boot_bios)
	{
		neogeo_driver_reset();
		neogeo_video_reset();

		if (!cdrom_process_ipl())
		{
			if (!fatal_error)
			{
				fatalerror(TEXT(ERROR_WHILE_PROCESSING_IPL_TXT));
			}
			return 0;
		}

		if (NGH_NUMBER(0x0085))
		{
			UINT16 *mem16 = (UINT16 *)memory_region_cpu1;

			mem16[0x132020 >> 1] = 0x4ef9;
			mem16[0x132022 >> 1] = 0x00c0;
			mem16[0x132024 >> 1] = 0xdb60;

			mem16[0x132026 >> 1] = 0x4ef9;
			mem16[0x132028 >> 1] = 0x00c0;
			mem16[0x13202a >> 1] = 0xdb6a;
		}
コード例 #7
0
ファイル: mvs.c プロジェクト: AMSMM/NJEMU
static void neogeo_reset(void)
{
	video_set_mode(16);

	video_clear_screen();

	timer_reset();
	input_reset();

	neogeo_driver_reset();
	neogeo_video_reset();

	sound_reset();
	blit_clear_all_sprite();
	autoframeskip_reset();

	Loop = LOOP_EXEC;
}
コード例 #8
0
ファイル: options.c プロジェクト: laochailan/taisei
static void destroy_options_menu(MenuData *m) {
	bool change_vidmode = false;

	for(int i = 0; i < m->ecount; ++i) {
		OptionBinding *bind = bind_get(m, i);

		if(!bind) {
			continue;
		}

		if(bind->type == BT_Resolution && video_query_capability(VIDEO_CAP_CHANGE_RESOLUTION) == VIDEO_AVAILABLE) {
			if(bind->selected != -1) {
				VideoMode *mode = video.modes + bind->selected;
				config_set_int(CONFIG_VID_WIDTH, mode->width);
				config_set_int(CONFIG_VID_HEIGHT, mode->height);
				change_vidmode = true;
			}
		}

		bind_free(bind);
		free(bind);
	}

	if(change_vidmode) {
		video_set_mode(
			config_get_int(CONFIG_VID_DISPLAY),
			config_get_int(CONFIG_VID_WIDTH),
			config_get_int(CONFIG_VID_HEIGHT),
			config_get_int(CONFIG_FULLSCREEN),
			config_get_int(CONFIG_VID_RESIZABLE)
		);
	}

	if(m->context) {
		OptionsMenuContext *ctx = m->context;
		free(ctx->data);
		free(ctx);
	}
}
コード例 #9
0
ファイル: adhoc.c プロジェクト: 173210/mvspsp
int adhocInit(const char *matchingData)
{
	struct productStruct product;
	int error = 0, state = 0;
	unsigned char mac[6];
	const char *unknown = "";
	char message[256];

	video_set_mode(32);

	mode = MODE_LOBBY;
	Server = 0;
	adhoc_initialized = 0;

	g_unk1        = 0;
	g_matchEvent  = 0;
	g_matchOptLen = 0;
	matchChanged  = 0;
	memset(g_mac, 0, sizeof(g_mac));
	memset(g_mymac, 0, sizeof(g_mymac));

	sprintf((char *)product.product, PRODUCT "00%d%d%d", VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD);
	product.unknown = 0;

	ClearPspList();

	if (strlen(matchingData) == 0)
		return -1;

	strcpy(g_matchingData, matchingData);

	sprintf(message, TEXT(CONNECTING_TO_x), TEXT(LOBBY));
	adhoc_init_progress(10, message);

	if ((error = sceNetInit(0x20000, 0x20, 0x1000, 0x20, 0x1000)) == 0)
	{
		update_progress();
		if ((error = sceNetAdhocInit()) == 0)
		{
			update_progress();
			if ((error = sceNetAdhocctlInit(0x2000, 0x20, &product)) == 0)
			{
				update_progress();
				if ((error = sceNetAdhocctlConnect(unknown)) == 0)
				{
					update_progress();
					do
					{
						if ((error = sceNetAdhocctlGetState(&state)) != 0) break;
						sceKernelDelayThread(1000000/60);

					} while (state != 1);

					if (!error)
					{
						update_progress();

						sceWlanGetEtherAddr(mac);
						update_progress();

						if ((pdpId = sceNetAdhocPdpCreate(mac, PDP_PORT, PDP_BUFFER_SIZE, 0)) > 0)
						{
							update_progress();
							if ((error = sceNetAdhocMatchingInit(0x20000)) == 0)
							{
								update_progress();
								if ((matchingId = sceNetAdhocMatchingCreate(MATCHING_CREATE_PARAMS)) >= 0)
								{
									update_progress();
									if ((error = sceNetAdhocMatchingStart(MATCHING_START_PARAMS)) == 0)
									{
										update_progress();
										show_progress(TEXT(CONNECTED));
										sceKernelDelayThread(1000000);
										adhoc_initialized = 1;
										return 0;
									}
									sceNetAdhocMatchingDelete(matchingId);
								}
								error = 2;
								sceNetAdhocMatchingTerm();
							}
							sceNetAdhocPdpDelete(pdpId, 0);
						}
						error = 1;
					}
					sceNetAdhocctlDisconnect();
				}
				sceNetAdhocctlTerm();
			}
			sceNetAdhocTerm();
		}
		sceNetTerm();
	}

	switch (error)
	{
	case 1:  sprintf(message, "%s (PDP ID = %08x)", TEXT(FAILED), pdpId); break;
	case 2:  sprintf(message, "%s (Matching ID = %08x)", TEXT(FAILED), matchingId); break;
	default: sprintf(message, "%s (Error Code = %08x)", TEXT(FAILED), error); break;
	}

	show_progress(message);

	pad_wait_clear();
	pad_wait_press(PAD_WAIT_INFINITY);

	return -1;
}