Example #1
0
static void listModes(_THIS, int actually_add)
{
#ifdef CTPCI_USE_TABLE
	int i;

	/* Read validated predefined modes */
	for (i=0; i<sizeof(mode_list)/sizeof(predefined_mode_t); i++) {
		int j;
		Uint16 deviceid = mode_list[i].modecode;

		for (j=3; j<5; j++) {
			if (Validmode(deviceid + j)) {
				xbiosmode_t modeinfo;
				
				modeinfo.number = deviceid + j;
				modeinfo.width = mode_list[i].width;
				modeinfo.height = mode_list[i].height;
				modeinfo.depth = mode_bpp[j-3];
				modeinfo.flags = 0;

				SDL_XBIOS_AddMode(this, actually_add, &modeinfo);
			}
		}
	}
#else
	/* Read custom created modes */
	enum_this = this;
	enum_actually_add = actually_add;
	VsetScreen(-1, &enumfunc, VN_MAGIC, CMD_ENUMMODES);
#endif
}
Example #2
0
static unsigned long /*cdecl*/ enumfunc(SCREENINFO *inf, unsigned long flag)
{
	xbiosmode_t modeinfo;

	modeinfo.number = inf->devID;
	modeinfo.width = inf->scrWidth;
	modeinfo.height = inf->scrHeight;
	modeinfo.depth = inf->scrPlanes;
	modeinfo.flags = 0;

	SDL_XBIOS_AddMode(enum_this, enum_actually_add, &modeinfo);

	return ENUMMODE_CONT; 
} 
Example #3
0
void SDL_XBIOS_ListSB3Modes(_THIS, int actually_add, scpn_cookie_t *cookie_scpn)
{
	scpn_screeninfo_t *scrinfo;
	xbiosmode_t modeinfo;

	scrinfo = cookie_scpn->screen_info;
	if (actually_add) {
		scrinfo->h_pos = scrinfo->v_pos = 0;
	}

	modeinfo.number = -1;
	modeinfo.width = scrinfo->virtual_width;
	modeinfo.height = scrinfo->virtual_height;
	modeinfo.depth = 1<<(SDL_XBIOS_scpn_planes_device[scrinfo->device]);
	modeinfo.flags = (modeinfo.depth == 8 ? XBIOSMODE_C2P : 0);

	SDL_XBIOS_AddMode(this, actually_add, &modeinfo);
}
Example #4
0
int SDL_XBIOS_CentscreenInit(_THIS)
{
	centscreen_mode_t	curmode, listedmode;
	unsigned long result;
	int cur_handle;	/* Current Centscreen mode handle */

	/* Reset current mode list */
	if (XBIOS_modelist) {
		SDL_free(XBIOS_modelist);
		XBIOS_nummodes = 0;
		XBIOS_modelist = NULL;
	}

	/* Add Centscreen modes */
	Vread(&curmode);
	cur_handle = curmode.handle;
	curmode.mode = curmode.physx = curmode.physy = curmode.plan =
		curmode.logx = curmode.logy = -1;

	result = Vfirst(&curmode, &listedmode);
	if (result==0) {
		while (result==0) {
			/* Don't add modes with virtual screen */
			if ((listedmode.mode & CSCREEN_VIRTUAL)==0) {
				/* Don't add modes with bpp<8 */
				if (listedmode.plan>=8) {
					SDL_XBIOS_AddMode(this, listedmode.mode, listedmode.physx,
						listedmode.physy, listedmode.plan, SDL_FALSE
					);
				}
			}
			SDL_memcpy(&curmode, &listedmode, sizeof(centscreen_mode_t));
			curmode.mode = curmode.physx = curmode.physy = curmode.plan =
				curmode.logx = curmode.logy = -1;
			result = Vnext(&curmode, &listedmode);
		}		
	} else {
		fprintf(stderr, "No suitable Centscreen modes\n");
	}

	return cur_handle;
}
Example #5
0
static void listModes(_THIS, int actually_add)
{
	long cookie_scpn;
	scpn_screeninfo_t *scrinfo;
	xbiosmode_t modeinfo;

	if (Getcookie(C_SCPN, &cookie_scpn) == C_FOUND) {
		scrinfo = ((scpn_cookie_t *) cookie_scpn)->screen_info;
		if (actually_add) {
			scrinfo->h_pos = scrinfo->v_pos = 0;
		}

		modeinfo.number = -1;
		modeinfo.width = scrinfo->virtual_width;
		modeinfo.height = scrinfo->virtual_height;
		modeinfo.depth = 1<<(SDL_XBIOS_scpn_planes_device[scrinfo->device]);
		modeinfo.flags = (modeinfo.depth == 8 ? XBIOSMODE_C2P : 0);

		SDL_XBIOS_AddMode(this, actually_add, &modeinfo);
	}
}
Example #6
0
void SDL_XBIOS_BlowupInit(_THIS, blow_cookie_t *cookie_blow)
{
	int i, num_mode, bank;
	blow_mode_t *blow_mode;

	/* Add bit 15 for old modes */
	for (i=0;i<XBIOS_nummodes;i++) {
		XBIOS_modelist[i].number |= 1<<15;
	}

	/* Add Blowup modes for 8 and 16 bpp */
	for (num_mode=3; num_mode<5; num_mode++) {
		bank = cookie_blow->num_mode[num_mode];
		blow_mode = &(cookie_blow->blowup_modes[num_mode+(bank*5)]);

		/* Check extended mode enabled */
		if (blow_mode->enabled == 0) {
			/* Check monitor needed for this mode */
			if ((blow_mode->monitor == cookie_blow->montype)
				|| ((blow_mode->monitor == MONITOR_TV)
					&& (cookie_blow->montype == MONITOR_RGB))
				|| ((blow_mode->monitor == MONITOR_RGB)
					&& (cookie_blow->montype == MONITOR_TV)))
			{
				/* we can use this extended mode */
				SDL_XBIOS_AddMode(this,
					num_mode == 3 ? BPS8 : BPS16,
					blow_mode->width + 1,
					blow_mode->height + 1,
					num_mode == 3 ? 8 : 16,
					SDL_FALSE
				);
			}
		}
	}
}