- convert the display library option string (options separated with commas) to an
array of strings in vga init - added sdl specific option "fullscreen" (startup in fullscreen mode)
This commit is contained in:
parent
2a4acc61c5
commit
7f9edd09c8
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: sdl.cc,v 1.45 2004-02-15 17:12:55 vruppert Exp $
|
||||
// $Id: sdl.cc,v 1.46 2004-02-24 19:21:44 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -245,9 +245,8 @@ void bx_sdl_gui_c::specific_init(
|
||||
atexit(SDL_Quit);
|
||||
|
||||
sdl_screen = NULL;
|
||||
dimension_update(640,480);
|
||||
|
||||
sdl_fullscreen_toggle = 0;
|
||||
dimension_update(640,480);
|
||||
|
||||
SDL_EnableKeyRepeat(250,50);
|
||||
SDL_WM_SetCaption(
|
||||
@ -269,6 +268,18 @@ void bx_sdl_gui_c::specific_init(
|
||||
if(bx_options.keyboard.OuseMapping->get()) {
|
||||
bx_keymap.loadKeymap(convertStringToSDLKey);
|
||||
}
|
||||
|
||||
// parse sdl specific options
|
||||
if (argc > 1) {
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (!strcmp(argv[i], "fullscreen")) {
|
||||
sdl_fullscreen_toggle = 1;
|
||||
switch_to_fullscreen();
|
||||
} else {
|
||||
BX_PANIC(("Unknown sdl option '%s'", argv[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sdl_set_status(int element, bx_bool active)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: win32.cc,v 1.79 2004-02-23 16:33:52 vruppert Exp $
|
||||
// $Id: win32.cc,v 1.80 2004-02-24 19:21:47 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -573,10 +573,9 @@ void terminateEmul(int reason) {
|
||||
|
||||
void bx_win32_gui_c::specific_init(int argc, char **argv, unsigned
|
||||
tilewidth, unsigned tileheight,
|
||||
unsigned headerbar_y) {
|
||||
char *ptr;
|
||||
char string[512];
|
||||
int i, string_i;
|
||||
unsigned headerbar_y)
|
||||
{
|
||||
int i;
|
||||
|
||||
put("WGUI");
|
||||
static RGBQUAD black_quad={ 0, 0, 0, 0};
|
||||
@ -657,20 +656,13 @@ void bx_win32_gui_c::specific_init(int argc, char **argv, unsigned
|
||||
}
|
||||
|
||||
// parse win32 specific options
|
||||
if (argc == 2) {
|
||||
ptr = strtok(argv[1], ",");
|
||||
while (ptr) {
|
||||
string_i = 0;
|
||||
for (i=0; i<strlen(ptr); i++) {
|
||||
if (!isspace(ptr[i])) string[string_i++] = ptr[i];
|
||||
}
|
||||
string[string_i] = '\0';
|
||||
if (!strcmp(string, "legacyF12")) {
|
||||
if (argc > 1) {
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (!strcmp(argv[i], "legacyF12")) {
|
||||
legacyF12 = TRUE;
|
||||
} else {
|
||||
BX_PANIC(("Unknown win32 option '%s'", string));
|
||||
BX_PANIC(("Unknown win32 option '%s'", argv[i]));
|
||||
}
|
||||
ptr = strtok(NULL, ",");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: vga.cc,v 1.97 2004-02-22 18:51:38 vruppert Exp $
|
||||
// $Id: vga.cc,v 1.98 2004-02-24 19:21:48 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -121,13 +121,15 @@ bx_vga_c::~bx_vga_c(void)
|
||||
void
|
||||
bx_vga_c::init(void)
|
||||
{
|
||||
unsigned i;
|
||||
unsigned i,string_i;
|
||||
unsigned x,y;
|
||||
#if BX_SUPPORT_VBE
|
||||
Bit16u max_xres, max_yres, max_bpp;
|
||||
#endif
|
||||
int argc;
|
||||
char *argv[2];
|
||||
char *argv[16];
|
||||
char *ptr;
|
||||
char string[512];
|
||||
|
||||
unsigned addr;
|
||||
for (addr=0x03B4; addr<=0x03B5; addr++) {
|
||||
@ -241,14 +243,37 @@ bx_vga_c::init(void)
|
||||
for (x=0; x<640/X_TILESIZE; x++)
|
||||
SET_TILE_UPDATED (x, y, 0);
|
||||
|
||||
{
|
||||
memset(argv, 0, sizeof(argv));
|
||||
argc = 1;
|
||||
argv[0] = "bochs";
|
||||
if (strlen(bx_options.Odisplaylib_options->getptr())) {
|
||||
argc = 2;
|
||||
argv[1] = bx_options.Odisplaylib_options->getptr();
|
||||
ptr = strtok(bx_options.Odisplaylib_options->getptr(), ",");
|
||||
while (ptr) {
|
||||
string_i = 0;
|
||||
for (i=0; i<strlen(ptr); i++) {
|
||||
if (!isspace(ptr[i])) string[string_i++] = ptr[i];
|
||||
}
|
||||
string[string_i] = '\0';
|
||||
if (argv[argc] != NULL) {
|
||||
free(argv[argc]);
|
||||
argv[argc] = NULL;
|
||||
}
|
||||
if (argc < 16) {
|
||||
argv[argc++] = strdup(string);
|
||||
} else {
|
||||
BX_PANIC (("too many parameters, max is 16\n"));
|
||||
}
|
||||
ptr = strtok(NULL, ",");
|
||||
}
|
||||
}
|
||||
bx_gui->init(argc, argv, BX_VGA_THIS s.x_tilesize, BX_VGA_THIS s.y_tilesize);
|
||||
for (i = 1; i < 16; i++)
|
||||
{
|
||||
if ( argv[i] != NULL )
|
||||
{
|
||||
free(argv[i]);
|
||||
argv[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
BX_INFO(("interval=%u", bx_options.Ovga_update_interval->get ()));
|
||||
|
Loading…
Reference in New Issue
Block a user