branches/osd/src/osd/sdl/sdlsocket.c
| r31853 | r31854 | |
| 2 | 2 | // |
| 3 | 3 | // sdlsocket.c - SDL socket (inet) access functions |
| 4 | 4 | // |
| 5 | | // Copyright (c) 1996-2013, Nicola Salmoria and the MAME Team. |
| 5 | // Copyright (c) 1996-2014, Nicola Salmoria and the MAME Team. |
| 6 | 6 | // Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | 7 | // |
| 8 | 8 | // SDLMAME by Olivier Galibert and R. Belmont |
| 9 | 9 | // |
| 10 | 10 | //============================================================ |
| 11 | 11 | |
| 12 | #ifdef SDLMAME_WIN32 |
| 13 | #include "../windows/winsocket.c" |
| 14 | #else |
| 15 | |
| 12 | 16 | #include <stdio.h> |
| 13 | 17 | #include <stdlib.h> |
| 14 | 18 | #include <unistd.h> |
| 15 | 19 | #include <fcntl.h> |
| 16 | | #ifndef SDLMAME_WIN32 |
| 17 | 20 | #include <sys/select.h> |
| 18 | 21 | #include <netinet/in.h> |
| 19 | 22 | #include <netinet/tcp.h> |
| 20 | 23 | #include <sys/socket.h> |
| 21 | 24 | #include <sys/types.h> |
| 22 | 25 | #include <netdb.h> |
| 23 | | #endif |
| 24 | 26 | #include <errno.h> |
| 25 | 27 | |
| 26 | 28 | #define NO_MEM_TRACKING |
| r31853 | r31854 | |
| 36 | 38 | */ |
| 37 | 39 | bool sdl_check_socket_path(const char *path) |
| 38 | 40 | { |
| 39 | | #ifndef SDLMAME_WIN32 |
| 40 | 41 | if (strlen(sdlfile_socket_identifier) > 0 && |
| 41 | 42 | strncmp(path, sdlfile_socket_identifier, strlen(sdlfile_socket_identifier)) == 0 && |
| 42 | 43 | strchr(path, ':') != NULL) return true; |
| 43 | | #endif |
| 44 | 44 | return false; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | file_error sdl_open_socket(const char *path, UINT32 openflags, osd_file **file, UINT64 *filesize) |
| 48 | 48 | { |
| 49 | | #ifndef SDLMAME_WIN32 |
| 50 | 49 | char hostname[256]; |
| 51 | 50 | struct hostent *localhost; |
| 52 | 51 | struct sockaddr_in sai; |
| r31853 | r31854 | |
| 103 | 102 | |
| 104 | 103 | *filesize = 0; |
| 105 | 104 | (*file)->handle = -1; |
| 106 | | #endif |
| 107 | 105 | return FILERR_NONE; |
| 108 | 106 | } |
| 109 | 107 | |
| 110 | 108 | file_error sdl_read_socket(osd_file *file, void *buffer, UINT64 offset, UINT32 count, UINT32 *actual) |
| 111 | 109 | { |
| 112 | | #if (!defined(SDLMAME_WIN32)) && (!defined(SDLMAME_EMSCRIPTEN)) |
| 110 | #if (!defined(SDLMAME_EMSCRIPTEN)) |
| 113 | 111 | ssize_t result; |
| 114 | 112 | char line[80]; |
| 115 | 113 | struct timeval timeout; |
| r31853 | r31854 | |
| 172 | 170 | |
| 173 | 171 | file_error sdl_write_socket(osd_file *file, const void *buffer, UINT64 offset, UINT32 count, UINT32 *actual) |
| 174 | 172 | { |
| 175 | | #ifndef SDLMAME_WIN32 |
| 176 | 173 | ssize_t result; |
| 177 | 174 | |
| 178 | 175 | result = write(file->socket, buffer, count); |
| r31853 | r31854 | |
| 186 | 183 | { |
| 187 | 184 | *actual = result; |
| 188 | 185 | } |
| 189 | | #endif |
| 190 | 186 | return FILERR_NONE; |
| 191 | 187 | } |
| 192 | 188 | |
| 193 | 189 | file_error sdl_close_socket(osd_file *file) |
| 194 | 190 | { |
| 195 | | #ifndef SDLMAME_WIN32 |
| 196 | 191 | close(file->socket); |
| 197 | 192 | osd_free(file); |
| 198 | | #endif |
| 199 | 193 | return FILERR_NONE; |
| 200 | 194 | } |
| 195 | #endif |
| | No newline at end of file |
branches/osd/src/osd/sdl/drawogl.c
| r31853 | r31854 | |
| 187 | 187 | UINT32 mpass_texture_scrn[2]; // Multipass OpenGL texture "name"/ID for the shader |
| 188 | 188 | UINT32 mpass_fbo_scrn[2]; // framebuffer object for this texture, multipass |
| 189 | 189 | |
| 190 | | int lut_table_width; // LUT table width |
| 191 | | int lut_table_height; // LUT table height |
| 192 | | |
| 193 | 190 | UINT32 pbo; // pixel buffer object for this texture (DYNAMIC only!) |
| 194 | 191 | UINT32 *data; // pixels for the texture |
| 195 | 192 | int data_own; // do we own / allocated it ? |
| r31853 | r31854 | |
| 1895 | 1892 | { |
| 1896 | 1893 | sdl_info *sdl = (sdl_info *) window->dxdata; |
| 1897 | 1894 | int uniform_location; |
| 1898 | | int lut_table_width_pow2=0; |
| 1899 | | int lut_table_height_pow2=0; |
| 1900 | 1895 | int i; |
| 1901 | 1896 | int surf_w_pow2 = get_valid_pow2_value (window->blitwidth, texture->texpow2); |
| 1902 | 1897 | int surf_h_pow2 = get_valid_pow2_value (window->blitheight, texture->texpow2); |
| 1903 | 1898 | |
| 1904 | 1899 | assert ( texture->type==TEXTURE_TYPE_SHADER ); |
| 1905 | 1900 | |
| 1906 | | texture->lut_table_height = 1; // default .. |
| 1907 | | |
| 1908 | | switch(texture->format) |
| 1909 | | { |
| 1910 | | case SDL_TEXFORMAT_RGB32_PALETTED: |
| 1911 | | case SDL_TEXFORMAT_RGB32: |
| 1912 | | texture->lut_table_width = 1 << 8; // 8 bits per component |
| 1913 | | texture->lut_table_width *= 3; // BGR .. |
| 1914 | | break; |
| 1915 | | |
| 1916 | | case SDL_TEXFORMAT_RGB15_PALETTED: |
| 1917 | | case SDL_TEXFORMAT_RGB15: |
| 1918 | | texture->lut_table_width = 1 << 5; // 5 bits per component |
| 1919 | | texture->lut_table_width *= 3; // BGR .. |
| 1920 | | break; |
| 1921 | | |
| 1922 | | case SDL_TEXFORMAT_PALETTE16: |
| 1923 | | texture->lut_table_width = (1 << 8) * 3; |
| 1924 | | break; |
| 1925 | | |
| 1926 | | default: |
| 1927 | | // should never happen |
| 1928 | | assert(0); |
| 1929 | | exit(1); |
| 1930 | | } |
| 1931 | | |
| 1932 | | texture->lut_table_height = 1; |
| 1933 | | |
| 1934 | | /** |
| 1935 | | * always use pow2 for LUT, to minimize the chance for floating point arithmetic errors |
| 1936 | | * (->buggy GLSL engine) |
| 1937 | | */ |
| 1938 | | lut_table_height_pow2 = get_valid_pow2_value (texture->lut_table_height, 1 /* texture->texpow2 */); |
| 1939 | | lut_table_width_pow2 = get_valid_pow2_value (texture->lut_table_width, 1 /* texture->texpow2 */); |
| 1940 | | |
| 1941 | | if ( lut_table_width_pow2 > sdl->texture_max_width || lut_table_height_pow2 > sdl->texture_max_height ) |
| 1942 | | { |
| 1943 | | osd_printf_error("Need lut size %dx%d, but max text size is %dx%d, bail out\n", |
| 1944 | | lut_table_width_pow2, lut_table_height_pow2, |
| 1945 | | sdl->texture_max_width, sdl->texture_max_height); |
| 1946 | | return -1; |
| 1947 | | } |
| 1948 | | |
| 1949 | 1901 | GL_CHECK_ERROR_QUIET(); |
| 1950 | 1902 | |
| 1951 | 1903 | if( sdl->glsl_program_num > 1 ) |
branches/osd/src/osd/sdl/man/mess.6
| r31853 | r31854 | |
| 16 | 16 | .\" http://www.mess.org/ |
| 17 | 17 | .\" |
| 18 | 18 | .\" |
| 19 | | .TH MESS 6 2013-09-23 0.150 "The Multiple Emulator Super System (MESS)" |
| 19 | .TH MESS 6 2014-07-31 0.154 "The Multiple Emulator Super System (MESS)" |
| 20 | 20 | .\" |
| 21 | 21 | .\" |
| 22 | 22 | .\" NAME chapter |
| r31853 | r31854 | |
| 27 | 27 | .\" SYNOPSIS chapter |
| 28 | 28 | .SH SYNOPSIS |
| 29 | 29 | .B mess |
| 30 | .I system |
| 31 | .RI [ "media software" ] |
| 30 | 32 | .RI [ options ] |
| 31 | | .I system |
| 32 | 33 | .\" |
| 33 | 34 | .\" |
| 34 | 35 | .\" DESCRIPTION chapter |
| r31853 | r31854 | |
| 39 | 40 | to run on modern PCs. |
| 40 | 41 | .\" |
| 41 | 42 | .\" |
| 43 | .\" SOFTWARE chapter |
| 44 | .SH SOFTWARE |
| 45 | A \fIsoftware\fR entry may be specified to attach an image file to the |
| 46 | emulated system. In such a case, the appropriate \fImedia\fR switch |
| 47 | is also required: |
| 48 | .TP |
| 49 | .B \-cart, \-cart1 |
| 50 | Cartrigde, used mainly by game consoles |
| 51 | .TP |
| 52 | .B \-cass |
| 53 | Cassette (tape), widely used by old home computers |
| 54 | .TP |
| 55 | .B \-flop, -flop1 |
| 56 | Floppy disk |
| 57 | .TP |
| 58 | .B \-cdrom |
| 59 | CD-Rom |
| 60 | .\" |
| 61 | .\" |
| 42 | 62 | .\" OPTIONS chapter |
| 43 | 63 | .SH OPTIONS |
| 44 | 64 | .\" |
| r31853 | r31854 | |
| 283 | 303 | directory 'nvram' in the same directory as the MESS executable). If this |
| 284 | 304 | directory does not exist, it will be automatically created. |
| 285 | 305 | .TP |
| 286 | | .B \-memcard_directory \fIpathname |
| 287 | | Specifies a single directory where memory card files are stored. Memory |
| 288 | | card files store the contents of removable memory cards for systems which |
| 289 | | used this type of hardware. This data is read and written under control |
| 290 | | of the user via the 'Memory Card' menu in the user interface. The |
| 291 | | default is 'memcard' (that is, a directory 'memcard' in the same |
| 292 | | directory as the MESS executable). If this directory does not exist, |
| 293 | | it will be automatically created. |
| 294 | | .TP |
| 295 | 306 | .B \-input_directory \fIpathname |
| 296 | 307 | Specifies a single directory where input recording files are stored. |
| 297 | 308 | Input recordings are created via the \-record option and played back via |
| r31853 | r31854 | |
| 1017 | 1028 | .B \-debugscript \fIfilename |
| 1018 | 1029 | Specifies a file that contains a list of debugger commands to execute |
| 1019 | 1030 | immediately upon startup. The default is NULL (no commands). |
| 1020 | | .TP |
| 1021 | | .B \-debug_internal, \-di |
| 1022 | | Use the internal debugger for debugging. |
| 1023 | 1031 | .\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 1024 | 1032 | .\" SDL specific |
| 1025 | 1033 | .\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| r31853 | r31854 | |
| 1091 | 1099 | .B \-http_path \fIpath |
| 1092 | 1100 | Path to web files. Default is /usr/share/games/mess/web. |
| 1093 | 1101 | .TP |
| 1102 | .B \-console |
| 1103 | Enable emulator LUA console. |
| 1104 | .TP |
| 1094 | 1105 | .B \-newui, \-nu |
| 1095 | 1106 | Use the new MESS UI. |
| 1096 | 1107 | .TP |
| r31853 | r31854 | |
| 1101 | 1112 | .\" |
| 1102 | 1113 | .\" SEE ALSO chapter |
| 1103 | 1114 | .SH SEE ALSO |
| 1104 | | castool(1), chdman(1), imgtool(1), testkeys(1) |
| 1115 | castool(1), chdman(1), floptool(1), imgtool(1), testkeys(1) |
| 1105 | 1116 | .\" |
| 1106 | 1117 | .\" |
| 1107 | 1118 | .\" LEGAL NOTICE chapter |
branches/osd/src/osd/sdl/man/mame.6
| r31853 | r31854 | |
| 13 | 13 | .\" and updated by Andrew Burton <burtona@gol.com>, July 2003 |
| 14 | 14 | .\" |
| 15 | 15 | .\" |
| 16 | | .TH MAME 6 2013-09-23 0.150 "MAME \- The Multiple Arcade Machine Emulator" |
| 16 | .TH MAME 6 2014-07-31 0.154 "MAME \- The Multiple Arcade Machine Emulator" |
| 17 | 17 | .\" |
| 18 | 18 | .\" |
| 19 | 19 | .\" NAME chapter |
| r31853 | r31854 | |
| 292 | 292 | "nvram" in the same directory as the MAME executable). If this directory |
| 293 | 293 | does not exist, it will be automatically created. |
| 294 | 294 | .TP |
| 295 | | .B \-memcard_directory \fIpathname |
| 296 | | Specifies a single directory where memory card files are stored. Memory |
| 297 | | card files store the contents of removable memory cards for games which |
| 298 | | used this type of hardware. This data is read and written under control |
| 299 | | of the user via the "Memory Card" menu in the user interface. The |
| 300 | | default is 'memcard' (that is, a directory "memcard" in the same |
| 301 | | directory as the MAME executable). If this directory does not exist, |
| 302 | | it will be automatically created. |
| 303 | | .TP |
| 304 | 295 | .B \-input_directory \fIpathname |
| 305 | 296 | Specifies a single directory where input recording files are stored. |
| 306 | 297 | Input recordings are created via the \-record option and played back via |
| r31853 | r31854 | |
| 606 | 597 | .B \-pause_brightness \fIvalue |
| 607 | 598 | This controls the brightness level when MAME is paused. The default |
| 608 | 599 | value is 0.65. |
| 600 | .TP |
| 601 | .B \-minimum_width \fIvalue |
| 602 | Minimum screen width. The default value is 320. |
| 603 | .TP |
| 604 | .B \-minimum_height \fIvalue |
| 605 | Minimum screen eigth. The default value is 240. |
| 609 | 606 | .\" |
| 610 | 607 | .\" ******************************************************* |
| 611 | 608 | .SS Vector rendering options |
| r31853 | r31854 | |
| 1035 | 1032 | .B \-debugscript \fIfilename |
| 1036 | 1033 | Specifies a file that contains a list of debugger commands to execute |
| 1037 | 1034 | immediately upon startup. The default is NULL (no commands). |
| 1038 | | .TP |
| 1039 | | .B \-debug_internal, \-di |
| 1040 | | Use the internal debugger for debugging. |
| 1041 | 1035 | .\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 1042 | 1036 | .\" SDL specific |
| 1043 | 1037 | .\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| r31853 | r31854 | |
| 1081 | 1075 | Size of RAM (if supported by driver). |
| 1082 | 1076 | .TP |
| 1083 | 1077 | .B \-confirm_quit |
| 1084 | | Display confirm quit screen on exit. |
| 1078 | Display confirm quit screen on exit. Default is true. |
| 1085 | 1079 | .TP |
| 1086 | 1080 | .B \-ui_mouse |
| 1087 | 1081 | Display UI mouse cursor. |
| r31853 | r31854 | |
| 1108 | 1102 | .TP |
| 1109 | 1103 | .B \-http_path \fIpath |
| 1110 | 1104 | Path to web files. Default is /usr/share/games/mess/web. |
| 1105 | .TP |
| 1106 | .B \-console |
| 1107 | Enable emulator LUA console. |
| 1111 | 1108 | .\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 1112 | 1109 | .\" SDL specific |
| 1113 | 1110 | .\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
branches/osd/src/osd/sdl/sdldir.c
| r31853 | r31854 | |
| 2 | 2 | // |
| 3 | 3 | // sdldir.c - SDL core directory access functions |
| 4 | 4 | // |
| 5 | | // Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team. |
| 5 | // Copyright (c) 1996-2014, Nicola Salmoria and the MAME Team. |
| 6 | 6 | // Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | 7 | // |
| 8 | 8 | // SDLMAME by Olivier Galibert and R. Belmont |
| 9 | 9 | // |
| 10 | 10 | //============================================================ |
| 11 | 11 | |
| 12 | #ifdef SDLMAME_WIN32 |
| 13 | #include "../windows/windir.c" |
| 14 | #else |
| 15 | |
| 12 | 16 | #ifndef _LARGEFILE64_SOURCE |
| 13 | 17 | #define _LARGEFILE64_SOURCE |
| 14 | 18 | #endif |
| r31853 | r31854 | |
| 230 | 234 | osd_free(dir->path); |
| 231 | 235 | osd_free(dir); |
| 232 | 236 | } |
| 237 | |
| 238 | #endif |
branches/osd/src/osd/sdl/sdlptty_win32.c
| r31853 | r31854 | |
| 1 | 1 | //============================================================ |
| 2 | 2 | // |
| 3 | 3 | // sdlptty_win32 - SDL psuedo tty access functions |
| 4 | | // (Win32 has no pttys - maybe named pipes?) |
| 4 | // (passthrough to Windows OSD version) |
| 5 | 5 | // |
| 6 | | // Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team. |
| 6 | // Copyright (c) 1996-2014, Nicola Salmoria and the MAME Team. |
| 7 | 7 | // Visit http://mamedev.org for licensing and usage restrictions. |
| 8 | 8 | // |
| 9 | 9 | // SDLMAME by Olivier Galibert and R. Belmont |
| 10 | 10 | // |
| 11 | 11 | //============================================================ |
| 12 | 12 | |
| 13 | | #include "sdlfile.h" |
| 13 | #include "../windows/winptty.c" |
| 14 | 14 | |
| 15 | | const char *sdlfile_ptty_identifier = ""; |
| 16 | | |
| 17 | | file_error sdl_open_ptty(const char *path, UINT32 openflags, osd_file **file, UINT64 *filesize) |
| 18 | | { |
| 19 | | return FILERR_ACCESS_DENIED; |
| 20 | | } |
| 21 | | |
| 22 | | file_error sdl_read_ptty(osd_file *file, void *buffer, UINT64 offset, UINT32 count, UINT32 *actual) |
| 23 | | { |
| 24 | | return FILERR_ACCESS_DENIED; |
| 25 | | } |
| 26 | | |
| 27 | | file_error sdl_write_ptty(osd_file *file, const void *buffer, UINT64 offset, UINT32 count, UINT32 *actual) |
| 28 | | { |
| 29 | | return FILERR_ACCESS_DENIED; |
| 30 | | } |
| 31 | | |
| 32 | | file_error sdl_close_ptty(osd_file *file) |
| 33 | | { |
| 34 | | return FILERR_ACCESS_DENIED; |
| 35 | | } |
branches/osd/src/osd/sdl/sdlfile.c
| r31853 | r31854 | |
| 1 | 1 | //============================================================ |
| 2 | 2 | // |
| 3 | | // fileio.c - SDL file access functions |
| 3 | // sdlfile.c - SDL file access functions |
| 4 | 4 | // |
| 5 | | // Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team. |
| 5 | // Copyright (c) 1996-2014, Nicola Salmoria and the MAME Team. |
| 6 | 6 | // Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | 7 | // |
| 8 | 8 | // SDLMAME by Olivier Galibert and R. Belmont |
| 9 | 9 | // |
| 10 | 10 | //============================================================ |
| 11 | 11 | |
| 12 | #ifdef SDLMAME_WIN32 |
| 13 | #include "../windows/winfile.c" |
| 14 | #include "../windows/winutil.c" |
| 15 | #else |
| 16 | |
| 12 | 17 | #ifndef _LARGEFILE64_SOURCE |
| 13 | 18 | #define _LARGEFILE64_SOURCE |
| 14 | 19 | #endif |
| r31853 | r31854 | |
| 16 | 21 | #ifdef SDLMAME_LINUX |
| 17 | 22 | #define __USE_LARGEFILE64 |
| 18 | 23 | #endif |
| 24 | |
| 25 | #ifdef SDLMAME_WIN32 |
| 26 | #define _FILE_OFFSET_BITS 64 |
| 27 | #endif |
| 28 | |
| 19 | 29 | #ifndef SDLMAME_BSD |
| 20 | 30 | #ifdef _XOPEN_SOURCE |
| 21 | 31 | #undef _XOPEN_SOURCE |
| r31853 | r31854 | |
| 254 | 264 | |
| 255 | 265 | *filesize = (UINT64)st.st_size; |
| 256 | 266 | |
| 257 | | |
| 258 | 267 | error: |
| 259 | 268 | // cleanup |
| 260 | 269 | if (filerr != FILERR_NONE && *file != NULL) |
| r31853 | r31854 | |
| 500 | 509 | |
| 501 | 510 | return result; |
| 502 | 511 | } |
| 512 | #endif |
| | No newline at end of file |