src/osd/sdl/video.c
| r1635 | r1636 | |
| 102 | 102 | |
| 103 | 103 | static void check_osd_inputs(void); |
| 104 | 104 | |
| 105 | | static void extract_video_config(void); |
| 106 | | static void load_effect_overlay(const char *filename); |
| 105 | static void extract_video_config(running_machine *machine); |
| 106 | static void load_effect_overlay(running_machine *machine, const char *filename); |
| 107 | 107 | static float get_aspect(const char *name, int report_error); |
| 108 | 108 | static void get_resolution(const char *name, sdl_window_config *config, int report_error); |
| 109 | 109 | |
| r1635 | r1636 | |
| 144 | 144 | int index, tc; |
| 145 | 145 | |
| 146 | 146 | // extract data from the options |
| 147 | | extract_video_config(); |
| 147 | extract_video_config(machine); |
| 148 | 148 | |
| 149 | 149 | // ensure we get called on the way out |
| 150 | 150 | add_exit_callback(machine, video_exit); |
| r1635 | r1636 | |
| 155 | 155 | // we need the beam width in a float, contrary to what the core does. |
| 156 | 156 | video_config.beamwidth = options_get_float(mame_options(), OPTION_BEAM); |
| 157 | 157 | |
| 158 | | if (Machine->drv->video_attributes & VIDEO_TYPE_VECTOR) |
| 158 | if (machine->drv->video_attributes & VIDEO_TYPE_VECTOR) |
| 159 | 159 | { |
| 160 | 160 | video_config.isvector = 1; |
| 161 | 161 | } |
| r1635 | r1636 | |
| 174 | 174 | for (index = 0; index < video_config.numscreens; index++) |
| 175 | 175 | { |
| 176 | 176 | video_config.window[index].totalColors = tc; |
| 177 | | if (sdlwindow_video_window_create(index, pick_monitor(index), &video_config.window[index])) |
| 177 | if (sdlwindow_video_window_create(machine, index, pick_monitor(index), &video_config.window[index])) |
| 178 | 178 | goto error; |
| 179 | 179 | } |
| 180 | 180 | |
| r1635 | r1636 | |
| 293 | 293 | SDL_VideoDriverName(monitor->monitor_device, sizeof(monitor->monitor_device)-1); |
| 294 | 294 | if (first_call==0) |
| 295 | 295 | { |
| 296 | | char *dimstr = getenv("SDLMAME_DESKTOPDIM"); |
| 296 | char *dimstr = getenv(SDLENV_DESKTOPDIM); |
| 297 | 297 | const SDL_VideoInfo *sdl_vi; |
| 298 | 298 | |
| 299 | 299 | sdl_vi = SDL_GetVideoInfo(); |
| r1635 | r1636 | |
| 307 | 307 | first_call=1; |
| 308 | 308 | if ((cw==0) || (ch==0)) |
| 309 | 309 | { |
| 310 | | if (dimstr) |
| 310 | if (dimstr != NULL) |
| 311 | 311 | { |
| 312 | 312 | sscanf(dimstr, "%dx%d", &cw, &ch); |
| 313 | 313 | } |
| r1635 | r1636 | |
| 602 | 602 | // extract_video_config |
| 603 | 603 | //============================================================ |
| 604 | 604 | |
| 605 | | static void extract_video_config(void) |
| 605 | static void extract_video_config(running_machine *machine) |
| 606 | 606 | { |
| 607 | 607 | const char *stemp; |
| 608 | 608 | |
| r1635 | r1636 | |
| 625 | 625 | #endif |
| 626 | 626 | stemp = options_get_string(mame_options(), SDLOPTION_EFFECT); |
| 627 | 627 | if (stemp != NULL && strcmp(stemp, "none") != 0) |
| 628 | | load_effect_overlay(stemp); |
| 628 | load_effect_overlay(machine, stemp); |
| 629 | 629 | |
| 630 | 630 | // per-window options: extract the data |
| 631 | 631 | get_resolution(SDLOPTION_RESOLUTION("0"), &video_config.window[0], TRUE); |
| r1635 | r1636 | |
| 639 | 639 | |
| 640 | 640 | // d3d options: extract the data |
| 641 | 641 | stemp = options_get_string(mame_options(), SDLOPTION_VIDEO); |
| 642 | | if (strcmp(stemp, "opengl") == 0) |
| 642 | if (strcmp(stemp, SDLOPTVAL_OPENGL) == 0) |
| 643 | 643 | video_config.mode = VIDEO_MODE_OPENGL; |
| 644 | | else if (strcmp(stemp, "opengl16") == 0) |
| 644 | else if (strcmp(stemp, SDLOPTVAL_OPENGL16) == 0) |
| 645 | 645 | { |
| 646 | 646 | video_config.mode = VIDEO_MODE_OPENGL; |
| 647 | 647 | video_config.prefer16bpp_tex = 1; |
| 648 | 648 | } |
| 649 | | else if (strcmp(stemp, "soft") == 0) |
| 649 | else if (strcmp(stemp, SDLOPTVAL_SOFT) == 0) |
| 650 | 650 | video_config.mode = VIDEO_MODE_SOFT; |
| 651 | | else if (strcmp(stemp, "none") == 0) |
| 651 | else if (strcmp(stemp, SDLOPTVAL_NONE) == 0) |
| 652 | 652 | { |
| 653 | 653 | video_config.mode = VIDEO_MODE_SOFT; |
| 654 | 654 | video_config.novideo = 1; |
| r1635 | r1636 | |
| 692 | 692 | snprintf(buffer, 18, SDLOPTION_SHADER_MAME("%d"), i); buffer[17]=0; |
| 693 | 693 | |
| 694 | 694 | stemp = options_get_string(mame_options(), buffer); |
| 695 | | if (stemp && strcmp(stemp, "none") != 0 && strlen(stemp)>0) |
| 695 | if (stemp && strcmp(stemp, SDLOPTVAL_NONE) != 0 && strlen(stemp)>0) |
| 696 | 696 | { |
| 697 | 697 | video_config.glsl_shader_mamebm[i] = (char *) malloc(strlen(stemp)+1); |
| 698 | 698 | strcpy(video_config.glsl_shader_mamebm[i], stemp); |
| r1635 | r1636 | |
| 709 | 709 | snprintf(buffer, 20, SDLOPTION_SHADER_SCREEN("%d"), i); buffer[19]=0; |
| 710 | 710 | |
| 711 | 711 | stemp = options_get_string(mame_options(), buffer); |
| 712 | | if (stemp && strcmp(stemp, "none") != 0 && strlen(stemp)>0) |
| 712 | if (stemp && strcmp(stemp, SDLOPTVAL_NONE) != 0 && strlen(stemp)>0) |
| 713 | 713 | { |
| 714 | 714 | video_config.glsl_shader_scrn[i] = (char *) malloc(strlen(stemp)+1); |
| 715 | 715 | strcpy(video_config.glsl_shader_scrn[i], stemp); |
| r1635 | r1636 | |
| 748 | 748 | video_config.glsl_vid_attributes = 0; |
| 749 | 749 | } |
| 750 | 750 | |
| 751 | | if (getenv("SDLMAME_UNSUPPORTED")) |
| 751 | if (sdl_use_unsupported()) |
| 752 | 752 | video_config.prescale_effect = options_get_int(mame_options(), SDLOPTION_PRESCALE_EFFECT); |
| 753 | 753 | else |
| 754 | 754 | video_config.prescale_effect = 0; |
| r1635 | r1636 | |
| 764 | 764 | |
| 765 | 765 | // yuv settings ... |
| 766 | 766 | stemp = options_get_string(mame_options(), SDLOPTION_YUVMODE); |
| 767 | | if (strcmp(stemp, "none") == 0) |
| 767 | if (strcmp(stemp, SDLOPTVAL_NONE) == 0) |
| 768 | 768 | video_config.yuv_mode = VIDEO_YUV_MODE_NONE; |
| 769 | | else if (strcmp(stemp, "yv12") == 0) |
| 769 | else if (strcmp(stemp, SDLOPTVAL_YV12) == 0) |
| 770 | 770 | video_config.yuv_mode = VIDEO_YUV_MODE_YV12; |
| 771 | | else if (strcmp(stemp, "yv12x2") == 0) |
| 771 | else if (strcmp(stemp, SDLOPTVAL_YV12x2) == 0) |
| 772 | 772 | video_config.yuv_mode = VIDEO_YUV_MODE_YV12X2; |
| 773 | | else if (strcmp(stemp, "yuy2") == 0) |
| 773 | else if (strcmp(stemp, SDLOPTVAL_YUY2) == 0) |
| 774 | 774 | video_config.yuv_mode = VIDEO_YUV_MODE_YUY2; |
| 775 | | else if (strcmp(stemp, "yuy2x2") == 0) |
| 775 | else if (strcmp(stemp, SDLOPTVAL_YUY2x2) == 0) |
| 776 | 776 | video_config.yuv_mode = VIDEO_YUV_MODE_YUY2X2; |
| 777 | 777 | else |
| 778 | 778 | { |
| r1635 | r1636 | |
| 791 | 791 | // load_effect_overlay |
| 792 | 792 | //============================================================ |
| 793 | 793 | |
| 794 | | static void load_effect_overlay(const char *filename) |
| 794 | static void load_effect_overlay(running_machine *machine, const char *filename) |
| 795 | 795 | { |
| 796 | 796 | char *tempstr = malloc_or_die(strlen(filename) + 5); |
| 797 | 797 | int scrnum; |
| r1635 | r1636 | |
| 815 | 815 | |
| 816 | 816 | // set the overlay on all screens |
| 817 | 817 | for (scrnum = 0; scrnum < MAX_SCREENS; scrnum++) |
| 818 | | if (Machine->drv->screen[scrnum].tag != NULL) |
| 818 | if (machine->drv->screen[scrnum].tag != NULL) |
| 819 | 819 | render_container_set_overlay(render_container_get_screen(scrnum), effect_bitmap); |
| 820 | 820 | |
| 821 | 821 | free(tempstr); |
| r1635 | r1636 | |
| 832 | 832 | const char *data = options_get_string(mame_options(), name); |
| 833 | 833 | int num = 0, den = 1; |
| 834 | 834 | |
| 835 | | if (strcmp(data, "auto") == 0) |
| 835 | if (strcmp(data, SDLOPTVAL_AUTO) == 0) |
| 836 | 836 | { |
| 837 | | if (strcmp(defdata, "auto") == 0) |
| 837 | if (strcmp(defdata,SDLOPTVAL_AUTO) == 0) |
| 838 | 838 | return 0; |
| 839 | 839 | data = defdata; |
| 840 | 840 | } |
| r1635 | r1636 | |
| 854 | 854 | const char *data = options_get_string(mame_options(), name); |
| 855 | 855 | |
| 856 | 856 | config->width = config->height = config->depth = config->refresh = 0; |
| 857 | | if (strcmp(data, "auto") == 0) |
| 857 | if (strcmp(data, SDLOPTVAL_AUTO) == 0) |
| 858 | 858 | { |
| 859 | 859 | return; |
| 860 | 860 | } |
src/osd/sdl/sdlmain.c
| r1635 | r1636 | |
| 79 | 79 | #ifdef MESS |
| 80 | 80 | { "inipath", "$HOME/.mess;.;ini", 0, "path to ini files" }, |
| 81 | 81 | #else |
| 82 | | { "inipath", "$HOME/.mame;.;ini", 0, "path to ini files" }, |
| 82 | { SDLOPTION_INIPATH, "$HOME/.mame;.;ini", 0, "path to ini files" }, |
| 83 | 83 | #endif // MESS |
| 84 | 84 | #endif // INI_PATH |
| 85 | 85 | #endif // MACOSX |
| r1635 | r1636 | |
| 87 | 87 | |
| 88 | 88 | // debugging options |
| 89 | 89 | { NULL, NULL, OPTION_HEADER, "DEBUGGING OPTIONS" }, |
| 90 | | { "oslog", "0", OPTION_BOOLEAN, "output error.log data to the system debugger" }, |
| 90 | { SDLOPTION_OSLOG, "0", OPTION_BOOLEAN, "output error.log data to the system debugger" }, |
| 91 | 91 | |
| 92 | 92 | // performance options |
| 93 | 93 | { NULL, NULL, OPTION_HEADER, "PERFORMANCE OPTIONS" }, |
| r1635 | r1636 | |
| 96 | 96 | |
| 97 | 97 | // video options |
| 98 | 98 | { NULL, NULL, OPTION_HEADER, "VIDEO OPTIONS" }, |
| 99 | | { SDLOPTION_VIDEO, "soft", 0, "video output method: soft or opengl" }, |
| 99 | { SDLOPTION_VIDEO, SDLOPTVAL_SOFT, 0, "video output method: soft or opengl" }, |
| 100 | 100 | { SDLOPTION_NUMSCREENS, "1", 0, "number of screens to create; SDLMAME only supports 1 at this time" }, |
| 101 | 101 | { SDLOPTION_WINDOW ";w", "0", OPTION_BOOLEAN, "enable window mode; otherwise, full screen mode is assumed" }, |
| 102 | 102 | { SDLOPTION_KEEPASPECT ";ka", "1", OPTION_BOOLEAN, "constrain to the proper aspect ratio" }, |
| 103 | 103 | { SDLOPTION_UNEVENSTRETCH ";ues", "1", OPTION_BOOLEAN, "allow non-integer stretch factors" }, |
| 104 | | { SDLOPTION_EFFECT, "none", 0, "name of a PNG file to use for visual effects, or 'none'" }, |
| 104 | { SDLOPTION_EFFECT, SDLOPTVAL_NONE, 0, "name of a PNG file to use for visual effects, or 'none'" }, |
| 105 | 105 | { SDLOPTION_CENTERH, "1", OPTION_BOOLEAN, "center horizontally within the view area" }, |
| 106 | 106 | { SDLOPTION_CENTERV, "1", OPTION_BOOLEAN, "center vertically within the view area" }, |
| 107 | 107 | #if (SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) >= 1210) |
| 108 | 108 | { SDLOPTION_WAITVSYNC, "0", OPTION_BOOLEAN, "enable waiting for the start of VBLANK before flipping screens; reduces tearing effects" }, |
| 109 | 109 | #endif |
| 110 | | { SDLOPTION_YUVMODE ";ym", "none", 0, "YUV mode: none, yv12, yuy2, yv12x2, yuy2x2 (-video soft only)" }, |
| 110 | { SDLOPTION_YUVMODE ";ym", SDLOPTVAL_NONE, 0, "YUV mode: none, yv12, yuy2, yv12x2, yuy2x2 (-video soft only)" }, |
| 111 | 111 | |
| 112 | 112 | // OpenGL specific options |
| 113 | 113 | { NULL, NULL, OPTION_HEADER, "OpenGL-SPECIFIC OPTIONS" }, |
| r1635 | r1636 | |
| 118 | 118 | { SDLOPTION_GL_VBO, "1", OPTION_BOOLEAN, "enable OpenGL VBO, if available (default on)" }, |
| 119 | 119 | { SDLOPTION_GL_PBO, "1", OPTION_BOOLEAN, "enable OpenGL PBO, if available (default on)" }, |
| 120 | 120 | { SDLOPTION_GL_GLSL, "0", OPTION_BOOLEAN, "enable OpenGL GLSL, if available (default off)" }, |
| 121 | | { SDLOPTION_GLSL_FILTER, "1", 0, "enable OpenGL GLSL filtering instead of FF filtering 0-plain, 1-bilinear (default)" }, |
| 122 | | { SDLOPTION_SHADER_MAME("0"), "none", 0, "custom OpenGL GLSL shader set mame bitmap 0" }, |
| 123 | | { SDLOPTION_SHADER_MAME("1"), "none", 0, "custom OpenGL GLSL shader set mame bitmap 1" }, |
| 124 | | { SDLOPTION_SHADER_MAME("2"), "none", 0, "custom OpenGL GLSL shader set mame bitmap 2" }, |
| 125 | | { SDLOPTION_SHADER_MAME("3"), "none", 0, "custom OpenGL GLSL shader set mame bitmap 3" }, |
| 126 | | { SDLOPTION_SHADER_MAME("4"), "none", 0, "custom OpenGL GLSL shader set mame bitmap 4" }, |
| 127 | | { SDLOPTION_SHADER_MAME("5"), "none", 0, "custom OpenGL GLSL shader set mame bitmap 5" }, |
| 128 | | { SDLOPTION_SHADER_MAME("6"), "none", 0, "custom OpenGL GLSL shader set mame bitmap 6" }, |
| 129 | | { SDLOPTION_SHADER_MAME("7"), "none", 0, "custom OpenGL GLSL shader set mame bitmap 7" }, |
| 130 | | { SDLOPTION_SHADER_MAME("8"), "none", 0, "custom OpenGL GLSL shader set mame bitmap 8" }, |
| 131 | | { SDLOPTION_SHADER_MAME("9"), "none", 0, "custom OpenGL GLSL shader set mame bitmap 9" }, |
| 132 | | { SDLOPTION_SHADER_SCREEN("0"), "none", 0, "custom OpenGL GLSL shader screen bitmap 0" }, |
| 133 | | { SDLOPTION_SHADER_SCREEN("1"), "none", 0, "custom OpenGL GLSL shader screen bitmap 1" }, |
| 134 | | { SDLOPTION_SHADER_SCREEN("2"), "none", 0, "custom OpenGL GLSL shader screen bitmap 2" }, |
| 135 | | { SDLOPTION_SHADER_SCREEN("3"), "none", 0, "custom OpenGL GLSL shader screen bitmap 3" }, |
| 136 | | { SDLOPTION_SHADER_SCREEN("4"), "none", 0, "custom OpenGL GLSL shader screen bitmap 4" }, |
| 137 | | { SDLOPTION_SHADER_SCREEN("5"), "none", 0, "custom OpenGL GLSL shader screen bitmap 5" }, |
| 138 | | { SDLOPTION_SHADER_SCREEN("6"), "none", 0, "custom OpenGL GLSL shader screen bitmap 6" }, |
| 139 | | { SDLOPTION_SHADER_SCREEN("7"), "none", 0, "custom OpenGL GLSL shader screen bitmap 7" }, |
| 140 | | { SDLOPTION_SHADER_SCREEN("8"), "none", 0, "custom OpenGL GLSL shader screen bitmap 8" }, |
| 141 | | { SDLOPTION_SHADER_SCREEN("9"), "none", 0, "custom OpenGL GLSL shader screen bitmap 9" }, |
| 142 | | { SDLOPTION_GL_GLSL_VID_ATTR, "1", OPTION_BOOLEAN, "enable OpenGL GLSL handling of brightness and contrast. Better RGB game performance for free. (default)" }, |
| 121 | { SDLOPTION_GLSL_FILTER, "1", 0, "enable OpenGL GLSL filtering instead of FF filtering 0-plain, 1-bilinear (default)" }, |
| 122 | { SDLOPTION_SHADER_MAME("0"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 0" }, |
| 123 | { SDLOPTION_SHADER_MAME("1"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 1" }, |
| 124 | { SDLOPTION_SHADER_MAME("2"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 2" }, |
| 125 | { SDLOPTION_SHADER_MAME("3"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 3" }, |
| 126 | { SDLOPTION_SHADER_MAME("4"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 4" }, |
| 127 | { SDLOPTION_SHADER_MAME("5"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 5" }, |
| 128 | { SDLOPTION_SHADER_MAME("6"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 6" }, |
| 129 | { SDLOPTION_SHADER_MAME("7"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 7" }, |
| 130 | { SDLOPTION_SHADER_MAME("8"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 8" }, |
| 131 | { SDLOPTION_SHADER_MAME("9"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 9" }, |
| 132 | { SDLOPTION_SHADER_SCREEN("0"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 0" }, |
| 133 | { SDLOPTION_SHADER_SCREEN("1"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 1" }, |
| 134 | { SDLOPTION_SHADER_SCREEN("2"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 2" }, |
| 135 | { SDLOPTION_SHADER_SCREEN("3"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 3" }, |
| 136 | { SDLOPTION_SHADER_SCREEN("4"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 4" }, |
| 137 | { SDLOPTION_SHADER_SCREEN("5"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 5" }, |
| 138 | { SDLOPTION_SHADER_SCREEN("6"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 6" }, |
| 139 | { SDLOPTION_SHADER_SCREEN("7"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 7" }, |
| 140 | { SDLOPTION_SHADER_SCREEN("8"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 8" }, |
| 141 | { SDLOPTION_SHADER_SCREEN("9"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 9" }, |
| 142 | { SDLOPTION_GL_GLSL_VID_ATTR, "1", OPTION_BOOLEAN, "enable OpenGL GLSL handling of brightness and contrast. Better RGB game performance for free. (default)" }, |
| 143 | 143 | |
| 144 | 144 | // per-window options |
| 145 | | { NULL, NULL, OPTION_HEADER, "PER-WINDOW VIDEO OPTIONS" }, |
| 146 | | { SDLOPTION_SCREEN(""), "auto", 0, "explicit name of the first screen; 'auto' here will try to make a best guess" }, |
| 147 | | { SDLOPTION_ASPECT("") ";screen_aspect", "auto", 0, "aspect ratio for all screens; 'auto' here will try to make a best guess" }, |
| 148 | | { SDLOPTION_RESOLUTION("") ";r", "auto", 0, "preferred resolution for all screens; format is <width>x<height>[@<refreshrate>] or 'auto'" }, |
| 149 | | { SDLOPTION_VIEW(""), "auto", 0, "preferred view for all screens" }, |
| 145 | { NULL, NULL, OPTION_HEADER, "PER-WINDOW VIDEO OPTIONS" }, |
| 146 | { SDLOPTION_SCREEN(""), SDLOPTVAL_AUTO, 0, "explicit name of the first screen; 'auto' here will try to make a best guess" }, |
| 147 | { SDLOPTION_ASPECT("") ";screen_aspect", SDLOPTVAL_AUTO, 0, "aspect ratio for all screens; 'auto' here will try to make a best guess" }, |
| 148 | { SDLOPTION_RESOLUTION("") ";r", SDLOPTVAL_AUTO, 0, "preferred resolution for all screens; format is <width>x<height>[@<refreshrate>] or 'auto'" }, |
| 149 | { SDLOPTION_VIEW(""), SDLOPTVAL_AUTO, 0, "preferred view for all screens" }, |
| 150 | 150 | |
| 151 | | { SDLOPTION_SCREEN("0"), "auto", 0, "explicit name of the first screen; 'auto' here will try to make a best guess" }, |
| 152 | | { SDLOPTION_ASPECT("0"), "auto", 0, "aspect ratio of the first screen; 'auto' here will try to make a best guess" }, |
| 153 | | { SDLOPTION_RESOLUTION("0") ";r0", "auto", 0, "preferred resolution of the first screen; format is <width>x<height>[@<refreshrate>] or 'auto'" }, |
| 154 | | { SDLOPTION_VIEW("0"), "auto", 0, "preferred view for the first screen" }, |
| 151 | { SDLOPTION_SCREEN("0"), SDLOPTVAL_AUTO, 0, "explicit name of the first screen; 'auto' here will try to make a best guess" }, |
| 152 | { SDLOPTION_ASPECT("0"), SDLOPTVAL_AUTO, 0, "aspect ratio of the first screen; 'auto' here will try to make a best guess" }, |
| 153 | { SDLOPTION_RESOLUTION("0") ";r0", SDLOPTVAL_AUTO, 0, "preferred resolution of the first screen; format is <width>x<height>[@<refreshrate>] or 'auto'" }, |
| 154 | { SDLOPTION_VIEW("0"), SDLOPTVAL_AUTO, 0, "preferred view for the first screen" }, |
| 155 | 155 | |
| 156 | | { SDLOPTION_SCREEN("1"), "auto", 0, "explicit name of the second screen; 'auto' here will try to make a best guess" }, |
| 157 | | { SDLOPTION_ASPECT("1"), "auto", 0, "aspect ratio of the second screen; 'auto' here will try to make a best guess" }, |
| 158 | | { SDLOPTION_RESOLUTION("1") ";r1", "auto", 0, "preferred resolution of the second screen; format is <width>x<height>[@<refreshrate>] or 'auto'" }, |
| 159 | | { SDLOPTION_VIEW("1"), "auto", 0, "preferred view for the second screen" }, |
| 156 | { SDLOPTION_SCREEN("1"), SDLOPTVAL_AUTO, 0, "explicit name of the second screen; 'auto' here will try to make a best guess" }, |
| 157 | { SDLOPTION_ASPECT("1"), SDLOPTVAL_AUTO, 0, "aspect ratio of the second screen; 'auto' here will try to make a best guess" }, |
| 158 | { SDLOPTION_RESOLUTION("1") ";r1", SDLOPTVAL_AUTO, 0, "preferred resolution of the second screen; format is <width>x<height>[@<refreshrate>] or 'auto'" }, |
| 159 | { SDLOPTION_VIEW("1"), SDLOPTVAL_AUTO, 0, "preferred view for the second screen" }, |
| 160 | 160 | |
| 161 | | { SDLOPTION_SCREEN("2"), "auto", 0, "explicit name of the third screen; 'auto' here will try to make a best guess" }, |
| 162 | | { SDLOPTION_ASPECT("2"), "auto", 0, "aspect ratio of the third screen; 'auto' here will try to make a best guess" }, |
| 163 | | { SDLOPTION_RESOLUTION("2") ";r2", "auto", 0, "preferred resolution of the third screen; format is <width>x<height>[@<refreshrate>] or 'auto'" }, |
| 164 | | { SDLOPTION_VIEW("2"), "auto", 0, "preferred view for the third screen" }, |
| 161 | { SDLOPTION_SCREEN("2"), SDLOPTVAL_AUTO, 0, "explicit name of the third screen; 'auto' here will try to make a best guess" }, |
| 162 | { SDLOPTION_ASPECT("2"), SDLOPTVAL_AUTO, 0, "aspect ratio of the third screen; 'auto' here will try to make a best guess" }, |
| 163 | { SDLOPTION_RESOLUTION("2") ";r2", SDLOPTVAL_AUTO, 0, "preferred resolution of the third screen; format is <width>x<height>[@<refreshrate>] or 'auto'" }, |
| 164 | { SDLOPTION_VIEW("2"), SDLOPTVAL_AUTO, 0, "preferred view for the third screen" }, |
| 165 | 165 | |
| 166 | | { SDLOPTION_SCREEN("3"), "auto", 0, "explicit name of the fourth screen; 'auto' here will try to make a best guess" }, |
| 167 | | { SDLOPTION_ASPECT("3"), "auto", 0, "aspect ratio of the fourth screen; 'auto' here will try to make a best guess" }, |
| 168 | | { SDLOPTION_RESOLUTION("3") ";r3", "auto", 0, "preferred resolution of the fourth screen; format is <width>x<height>[@<refreshrate>] or 'auto'" }, |
| 169 | | { SDLOPTION_VIEW("3"), "auto", 0, "preferred view for the fourth screen" }, |
| 166 | { SDLOPTION_SCREEN("3"), SDLOPTVAL_AUTO, 0, "explicit name of the fourth screen; 'auto' here will try to make a best guess" }, |
| 167 | { SDLOPTION_ASPECT("3"), SDLOPTVAL_AUTO, 0, "aspect ratio of the fourth screen; 'auto' here will try to make a best guess" }, |
| 168 | { SDLOPTION_RESOLUTION("3") ";r3", SDLOPTVAL_AUTO, 0, "preferred resolution of the fourth screen; format is <width>x<height>[@<refreshrate>] or 'auto'" }, |
| 169 | { SDLOPTION_VIEW("3"), SDLOPTVAL_AUTO, 0, "preferred view for the fourth screen" }, |
| 170 | 170 | |
| 171 | 171 | // full screen options |
| 172 | | { NULL, NULL, OPTION_HEADER, "FULL SCREEN OPTIONS" }, |
| 173 | | { SDLOPTION_SWITCHRES, "0", OPTION_BOOLEAN, "enable resolution switching" }, |
| 172 | { NULL, NULL, OPTION_HEADER, "FULL SCREEN OPTIONS" }, |
| 173 | { SDLOPTION_SWITCHRES, "0", OPTION_BOOLEAN, "enable resolution switching" }, |
| 174 | 174 | #ifdef SDLMAME_X11 |
| 175 | 175 | { SDLOPTION_USEALLHEADS, "0", OPTION_BOOLEAN, "split full screen image across monitors" }, |
| 176 | 176 | #endif |
| 177 | 177 | |
| 178 | 178 | // sound options |
| 179 | | { NULL, NULL, OPTION_HEADER, "SOUND OPTIONS" }, |
| 180 | | { SDLOPTION_AUDIO_LATENCY, "3", 0, "set audio latency (increase to reduce glitches, decrease for responsiveness)" }, |
| 179 | { NULL, NULL, OPTION_HEADER, "SOUND OPTIONS" }, |
| 180 | { SDLOPTION_AUDIO_LATENCY, "3", 0, "set audio latency (increase to reduce glitches, decrease for responsiveness)" }, |
| 181 | 181 | |
| 182 | 182 | // keyboard mapping |
| 183 | | { NULL, NULL, OPTION_HEADER, "SDL KEYBOARD MAPPING" }, |
| 184 | | { SDLOPTION_KEYMAP, "0", OPTION_BOOLEAN, "enable keymap" }, |
| 185 | | { SDLOPTION_KEYMAP_FILE, "keymap.dat", 0, "keymap filename" }, |
| 183 | { NULL, NULL, OPTION_HEADER, "SDL KEYBOARD MAPPING" }, |
| 184 | { SDLOPTION_KEYMAP, "0", OPTION_BOOLEAN, "enable keymap" }, |
| 185 | { SDLOPTION_KEYMAP_FILE, "keymap.dat", 0, "keymap filename" }, |
| 186 | 186 | #ifdef MESS |
| 187 | 187 | #ifdef SDLMAME_MACOSX // work around for SDL 1.2.11 on Mac - 1.2.12 should not require this |
| 188 | 188 | { SDLOPTION_UIMODEKEY, "DELETE", 0, "Key to toggle MESS keyboard mode" }, |
| r1635 | r1636 | |
| 192 | 192 | #endif // MESS |
| 193 | 193 | |
| 194 | 194 | // joystick mapping |
| 195 | | { NULL, NULL, OPTION_HEADER, "SDL JOYSTICK MAPPING" }, |
| 196 | | { SDLOPTION_JOYMAP, "0", OPTION_BOOLEAN, "enable physical to logical joystick mapping" }, |
| 197 | | { SDLOPTION_JOYMAP_FILE, "joymap.dat", 0, "joymap filename" }, |
| 198 | | { SDLOPTION_SIXAXIS, "0", OPTION_BOOLEAN, "Use special handling for PS3 Sixaxis controllers" }, |
| 195 | { NULL, NULL, OPTION_HEADER, "SDL JOYSTICK MAPPING" }, |
| 196 | { SDLOPTION_JOYMAP, "0", OPTION_BOOLEAN, "enable physical to logical joystick mapping" }, |
| 197 | { SDLOPTION_JOYMAP_FILE, "joymap.dat", 0, "joymap filename" }, |
| 198 | { SDLOPTION_SIXAXIS, "0", OPTION_BOOLEAN, "Use special handling for PS3 Sixaxis controllers" }, |
| 199 | 199 | { NULL } |
| 200 | 200 | }; |
| 201 | 201 | |
| r1635 | r1636 | |
| 303 | 303 | char buf[130]; |
| 304 | 304 | if (XMatchVisualInfo(display, DefaultScreen(display), 24, TrueColor, &vi)) { |
| 305 | 305 | snprintf(buf, sizeof(buf), "0x%lx", vi.visualid); |
| 306 | | setenv("SDL_VIDEO_X11_VISUALID", buf, 0); |
| 306 | setenv(SDLENV_IDENTIFIER, buf, 0); |
| 307 | 307 | } |
| 308 | 308 | } |
| 309 | 309 | if (display) |
| r1635 | r1636 | |
| 434 | 434 | fflush(stdout); |
| 435 | 435 | exit(-1); |
| 436 | 436 | } |
| 437 | | |
| 438 | | if (getenv("SDLMAME_UNSUPPORTED")) |
| 437 | if (sdl_use_unsupported()) |
| 439 | 438 | led_init(); |
| 440 | 439 | |
| 441 | 440 | #ifdef MESS |
| r1635 | r1636 | |
| 445 | 444 | sdlinput_init(machine); |
| 446 | 445 | sdl_init_audio(machine); |
| 447 | 446 | |
| 448 | | if (options_get_bool(mame_options(), "oslog")) |
| 447 | if (options_get_bool(mame_options(), SDLOPTION_OSLOG)) |
| 449 | 448 | add_logerror_callback(machine, output_oslog); |
| 450 | 449 | |
| 451 | 450 | #ifdef MESS |