Previous 199869 Revisions Next

r31854 Monday 1st September, 2014 at 08:52:08 UTC by Miodrag Milanović
(OSD BRANCH) Sync with osd code from main branch (nw)
[/branches/osd/src/osd/sdl]drawogl.c sdldir.c sdlfile.c sdlmain.c sdlos_macosx.c sdlos_os2.c sdlos_win32.c sdlptty_win32.c sdlsocket.c
[/branches/osd/src/osd/sdl/man]castool.1 chdman.1 imgtool.1 jedutil.1 ldresample.1 ldverify.1 mame.6 mess.6 romcmp.1 testkeys.1

branches/osd/src/osd/sdl/sdlsocket.c
r31853r31854
22//
33//  sdlsocket.c - SDL socket (inet) access functions
44//
5//  Copyright (c) 1996-2013, Nicola Salmoria and the MAME Team.
5//  Copyright (c) 1996-2014, Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//  SDLMAME by Olivier Galibert and R. Belmont
99//
1010//============================================================
1111
12#ifdef SDLMAME_WIN32
13#include "../windows/winsocket.c"
14#else
15
1216#include <stdio.h>
1317#include <stdlib.h>
1418#include <unistd.h>
1519#include <fcntl.h>
16#ifndef SDLMAME_WIN32
1720#include <sys/select.h>
1821#include <netinet/in.h>
1922#include <netinet/tcp.h>
2023#include <sys/socket.h>
2124#include <sys/types.h>
2225#include <netdb.h>
23#endif
2426#include <errno.h>
2527
2628#define NO_MEM_TRACKING
r31853r31854
3638*/
3739bool sdl_check_socket_path(const char *path)
3840{
39#ifndef SDLMAME_WIN32
4041   if (strlen(sdlfile_socket_identifier) > 0 &&
4142      strncmp(path, sdlfile_socket_identifier, strlen(sdlfile_socket_identifier)) == 0 &&
4243      strchr(path, ':') != NULL) return true;
43#endif
4444   return false;
4545}
4646
4747file_error sdl_open_socket(const char *path, UINT32 openflags, osd_file **file, UINT64 *filesize)
4848{
49#ifndef SDLMAME_WIN32
5049   char hostname[256];
5150   struct hostent *localhost;
5251   struct sockaddr_in sai;
r31853r31854
103102
104103   *filesize = 0;
105104   (*file)->handle = -1;
106#endif
107105   return FILERR_NONE;
108106}
109107
110108file_error sdl_read_socket(osd_file *file, void *buffer, UINT64 offset, UINT32 count, UINT32 *actual)
111109{
112#if (!defined(SDLMAME_WIN32)) && (!defined(SDLMAME_EMSCRIPTEN))
110#if (!defined(SDLMAME_EMSCRIPTEN))
113111   ssize_t result;
114112   char line[80];
115113   struct timeval timeout;
r31853r31854
172170
173171file_error sdl_write_socket(osd_file *file, const void *buffer, UINT64 offset, UINT32 count, UINT32 *actual)
174172{
175#ifndef SDLMAME_WIN32
176173   ssize_t result;
177174
178175   result = write(file->socket, buffer, count);
r31853r31854
186183   {
187184      *actual = result;
188185   }
189#endif
190186   return FILERR_NONE;
191187}
192188
193189file_error sdl_close_socket(osd_file *file)
194190{
195#ifndef SDLMAME_WIN32
196191   close(file->socket);
197192   osd_free(file);
198#endif
199193   return FILERR_NONE;
200194}
195#endif
No newline at end of file
branches/osd/src/osd/sdl/drawogl.c
r31853r31854
187187   UINT32              mpass_texture_scrn[2];  // Multipass OpenGL texture "name"/ID for the shader
188188   UINT32              mpass_fbo_scrn[2];      // framebuffer object for this texture, multipass
189189
190   int                 lut_table_width;        // LUT table width
191   int                 lut_table_height;       // LUT table height
192
193190   UINT32              pbo;                    // pixel buffer object for this texture (DYNAMIC only!)
194191   UINT32              *data;                  // pixels for the texture
195192   int                 data_own;               // do we own / allocated it ?
r31853r31854
18951892{
18961893   sdl_info *sdl = (sdl_info *) window->dxdata;
18971894   int uniform_location;
1898   int lut_table_width_pow2=0;
1899   int lut_table_height_pow2=0;
19001895   int i;
19011896   int surf_w_pow2  = get_valid_pow2_value (window->blitwidth, texture->texpow2);
19021897   int surf_h_pow2  = get_valid_pow2_value (window->blitheight, texture->texpow2);
19031898
19041899   assert ( texture->type==TEXTURE_TYPE_SHADER );
19051900
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
19491901   GL_CHECK_ERROR_QUIET();
19501902
19511903   if( sdl->glsl_program_num > 1 )
branches/osd/src/osd/sdl/sdlos_os2.c
r31853r31854
141141{
142142   if (ticks_per_second == 0)
143143   {
144      return 1;   // this isn't correct, but it prevents the crash
144      // if we haven't computed the value yet, there's no time like the present
145      init_cycle_counter();
145146   }
146147   return ticks_per_second;
147148}
branches/osd/src/osd/sdl/man/chdman.1
r31853r31854
66.\" Ashley T. Howes <debiandev@ashleyhowes.com>, February 2005
77.\" updated by Cesare Falco <c.falco@ubuntu.com>, February 2007
88.\"
9.TH CHDMAN 1 2013-09-23 0.150 "MAME Compressed Hunks of Data (CHD) manager"
9.TH CHDMAN 1 2014-07-31 0.154 "MAME Compressed Hunks of Data (CHD) manager"
1010.\"
1111.\" NAME chapter
1212.SH NAME
branches/osd/src/osd/sdl/man/imgtool.1
r31853r31854
66.\" Cesare Falco <c.falco@ubuntu.com>, February 2011
77.\"
88.\"
9.TH IMGTOOL 1 2013-09-23 0.150 "MESS media image manipulation tool"
9.TH IMGTOOL 1 2014-07-31 0.154 "MESS media image manipulation tool"
1010.\"
1111.\"
1212.\" NAME chapter
branches/osd/src/osd/sdl/man/testkeys.1
r31853r31854
55.\" Man page created from source and usage information
66.\" Cesare Falco <c.falco@ubuntu.com>, February 2007
77.\"
8.TH TESTKEYS 1 2013-09-23 0.150 "MAME SDL keycode scanner"
8.TH TESTKEYS 1 2014-07-31 0.154 "MAME SDL keycode scanner"
99.\"
1010.\" NAME chapter
1111.SH NAME
branches/osd/src/osd/sdl/man/mess.6
r31853r31854
1616.\" http://www.mess.org/
1717.\"
1818.\"
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)"
2020.\"
2121.\"
2222.\" NAME chapter
r31853r31854
2727.\" SYNOPSIS chapter
2828.SH SYNOPSIS
2929.B mess
30.I system
31.RI [ "media software" ]
3032.RI [ options ]
31.I system
3233.\"
3334.\"
3435.\" DESCRIPTION chapter
r31853r31854
3940to run on modern PCs.
4041.\"
4142.\"
43.\" SOFTWARE chapter
44.SH SOFTWARE
45A \fIsoftware\fR entry may be specified to attach an image file to the
46emulated system. In such a case, the appropriate \fImedia\fR switch
47is also required:
48.TP
49.B \-cart, \-cart1
50Cartrigde, used mainly by game consoles
51.TP
52.B \-cass
53Cassette (tape), widely used by old home computers
54.TP
55.B \-flop, -flop1
56Floppy disk
57.TP
58.B \-cdrom
59CD-Rom
60.\"
61.\"
4262.\" OPTIONS chapter
4363.SH OPTIONS
4464.\"
r31853r31854
283303directory 'nvram' in the same directory as the MESS executable). If this
284304directory does not exist, it will be automatically created.
285305.TP
286.B \-memcard_directory \fIpathname
287Specifies a single directory where memory card files are stored. Memory
288card files store the contents of removable memory cards for systems which
289used this type of hardware. This data is read and written under control
290of the user via the 'Memory Card' menu in the user interface. The
291default is 'memcard' (that is, a directory 'memcard' in the same
292directory as the MESS executable). If this directory does not exist,
293it will be automatically created.
294.TP
295306.B \-input_directory \fIpathname
296307Specifies a single directory where input recording files are stored.
297308Input recordings are created via the \-record option and played back via
r31853r31854
10171028.B \-debugscript \fIfilename
10181029Specifies a file that contains a list of debugger commands to execute
10191030immediately upon startup. The default is NULL (no commands).
1020.TP
1021.B \-debug_internal, \-di
1022Use the internal debugger for debugging.
10231031.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
10241032.\" SDL specific
10251033.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
r31853r31854
10911099.B \-http_path \fIpath
10921100Path to web files. Default is /usr/share/games/mess/web.
10931101.TP
1102.B \-console
1103Enable emulator LUA console.
1104.TP
10941105.B \-newui, \-nu
10951106Use the new MESS UI.
10961107.TP
r31853r31854
11011112.\"
11021113.\" SEE ALSO chapter
11031114.SH SEE ALSO
1104castool(1), chdman(1), imgtool(1), testkeys(1)
1115castool(1), chdman(1), floptool(1), imgtool(1), testkeys(1)
11051116.\"
11061117.\"
11071118.\" LEGAL NOTICE chapter
branches/osd/src/osd/sdl/man/romcmp.1
r31853r31854
99.\" References
1010.\" http://www.mame.net/mamefaq.html
1111.\"
12.TH ROMCMP 1 2013-09-23 0.150 "MAME romset checking tool"
12.TH ROMCMP 1 2014-07-31 0.154 "MAME romset checking tool"
1313.\"
1414.\" NAME chapter
1515.SH NAME
branches/osd/src/osd/sdl/man/jedutil.1
r31853r31854
88.\" References
99.\" http://aarongiles.com/?p=159
1010.\"
11.TH JEDUTIL 1 2013-09-23 0.150 "MAME JEDEC file utilities"
11.TH JEDUTIL 1 2014-07-31 0.154 "MAME JEDEC file utilities"
1212.\"
1313.\" NAME chapter
1414.SH NAME
branches/osd/src/osd/sdl/man/castool.1
r31853r31854
66.\" Cesare Falco <c.falco@ubuntu.com>, February 2011
77.\"
88.\"
9.TH CASTOOL 1 2013-09-23 0.150 "MESS Generic cassette manipulation tool"
9.TH CASTOOL 1 2014-07-31 0.154 "MESS Generic cassette manipulation tool"
1010.\"
1111.\"
1212.\" NAME chapter
branches/osd/src/osd/sdl/man/ldverify.1
r31853r31854
55.\" Man page created from source and usage information by
66.\" Cesare Falco <c.falco@ubuntu.com>, August 2008
77.\"
8.TH LDVERIFY 1 2013-09-23 0.150 "MAME laserdisc data checker"
8.TH LDVERIFY 1 2014-07-31 0.154 "MAME laserdisc data checker"
99.\"
1010.\" NAME chapter
1111.SH NAME
branches/osd/src/osd/sdl/man/mame.6
r31853r31854
1313.\" and updated by Andrew Burton <burtona@gol.com>, July 2003
1414.\"
1515.\"
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"
1717.\"
1818.\"
1919.\" NAME chapter
r31853r31854
292292"nvram" in the same directory as the MAME executable). If this directory
293293does not exist, it will be automatically created.
294294.TP
295.B \-memcard_directory \fIpathname
296Specifies a single directory where memory card files are stored. Memory
297card files store the contents of removable memory cards for games which
298used this type of hardware. This data is read and written under control
299of the user via the "Memory Card" menu in the user interface. The
300default is 'memcard' (that is, a directory "memcard" in the same
301directory as the MAME executable). If this directory does not exist,
302it will be automatically created.
303.TP
304295.B \-input_directory \fIpathname
305296Specifies a single directory where input recording files are stored.
306297Input recordings are created via the \-record option and played back via
r31853r31854
606597.B \-pause_brightness \fIvalue
607598This controls the brightness level when MAME is paused. The default
608599value is 0.65.
600.TP
601.B \-minimum_width \fIvalue
602Minimum screen width. The default value is 320.
603.TP
604.B \-minimum_height \fIvalue
605Minimum screen eigth. The default value is 240.
609606.\"
610607.\" *******************************************************
611608.SS Vector rendering options
r31853r31854
10351032.B \-debugscript \fIfilename
10361033Specifies a file that contains a list of debugger commands to execute
10371034immediately upon startup. The default is NULL (no commands).
1038.TP
1039.B \-debug_internal, \-di
1040Use the internal debugger for debugging.
10411035.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
10421036.\" SDL specific
10431037.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
r31853r31854
10811075Size of RAM (if supported by driver).
10821076.TP
10831077.B \-confirm_quit
1084Display confirm quit screen on exit.
1078Display confirm quit screen on exit. Default is true.
10851079.TP
10861080.B \-ui_mouse
10871081Display UI mouse cursor.
r31853r31854
11081102.TP
11091103.B \-http_path \fIpath
11101104Path to web files. Default is /usr/share/games/mess/web.
1105.TP
1106.B \-console
1107Enable emulator LUA console.
11111108.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
11121109.\" SDL specific
11131110.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
branches/osd/src/osd/sdl/man/ldresample.1
r31853r31854
33.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
44.\" other parameters are allowed: see man(7), man(1)
55.\"
6.TH LDRESAMPLE 1 2013-09-23 0.150 "MAME laserdisc audio manipulation tool"
6.TH LDRESAMPLE 1 2014-07-31 0.154 "MAME laserdisc audio manipulation tool"
77.\"
88.\" Please adjust this date whenever revising the manpage.
99.\"
branches/osd/src/osd/sdl/sdlos_macosx.c
r31853r31854
107107{
108108   if (ticks_per_second == 0)
109109   {
110      return 1;   // this isn't correct, but it prevents the crash
110      // if we haven't computed the value yet, there's no time like the present
111      init_cycle_counter();
111112   }
112113   return ticks_per_second;
113114}
branches/osd/src/osd/sdl/sdldir.c
r31853r31854
22//
33//  sdldir.c - SDL core directory access functions
44//
5//  Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team.
5//  Copyright (c) 1996-2014, Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//  SDLMAME by Olivier Galibert and R. Belmont
99//
1010//============================================================
1111
12#ifdef SDLMAME_WIN32
13#include "../windows/windir.c"
14#else
15
1216#ifndef _LARGEFILE64_SOURCE
1317#define _LARGEFILE64_SOURCE
1418#endif
r31853r31854
230234   osd_free(dir->path);
231235   osd_free(dir);
232236}
237
238#endif
branches/osd/src/osd/sdl/sdlos_win32.c
r31853r31854
127127{
128128   if (ticks_per_second == 0)
129129   {
130      return 1;   // this isn't correct, but it prevents the crash
130      // if we haven't computed the value yet, there's no time like the present
131      init_cycle_counter();
131132   }
132133   return ticks_per_second;
133134}
branches/osd/src/osd/sdl/sdlptty_win32.c
r31853r31854
11//============================================================
22//
33//  sdlptty_win32 - SDL psuedo tty access functions
4//  (Win32 has no pttys - maybe named pipes?)
4//  (passthrough to Windows OSD version)
55//
6//  Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team.
6//  Copyright (c) 1996-2014, Nicola Salmoria and the MAME Team.
77//  Visit http://mamedev.org for licensing and usage restrictions.
88//
99//  SDLMAME by Olivier Galibert and R. Belmont
1010//
1111//============================================================
1212
13#include "sdlfile.h"
13#include "../windows/winptty.c"
1414
15const char *sdlfile_ptty_identifier  = "";
16
17file_error sdl_open_ptty(const char *path, UINT32 openflags, osd_file **file, UINT64 *filesize)
18{
19   return FILERR_ACCESS_DENIED;
20}
21
22file_error sdl_read_ptty(osd_file *file, void *buffer, UINT64 offset, UINT32 count, UINT32 *actual)
23{
24   return FILERR_ACCESS_DENIED;
25}
26
27file_error sdl_write_ptty(osd_file *file, const void *buffer, UINT64 offset, UINT32 count, UINT32 *actual)
28{
29   return FILERR_ACCESS_DENIED;
30}
31
32file_error sdl_close_ptty(osd_file *file)
33{
34   return FILERR_ACCESS_DENIED;
35}
branches/osd/src/osd/sdl/sdlfile.c
r31853r31854
11//============================================================
22//
3//  fileio.c - SDL file access functions
3//  sdlfile.c - SDL file access functions
44//
5//  Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team.
5//  Copyright (c) 1996-2014, Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//  SDLMAME by Olivier Galibert and R. Belmont
99//
1010//============================================================
1111
12#ifdef SDLMAME_WIN32
13#include "../windows/winfile.c"
14#include "../windows/winutil.c"
15#else
16
1217#ifndef _LARGEFILE64_SOURCE
1318#define _LARGEFILE64_SOURCE
1419#endif
r31853r31854
1621#ifdef SDLMAME_LINUX
1722#define __USE_LARGEFILE64
1823#endif
24
25#ifdef SDLMAME_WIN32
26#define _FILE_OFFSET_BITS 64
27#endif
28
1929#ifndef SDLMAME_BSD
2030#ifdef _XOPEN_SOURCE
2131#undef _XOPEN_SOURCE
r31853r31854
254264
255265   *filesize = (UINT64)st.st_size;
256266
257
258267error:
259268   // cleanup
260269   if (filerr != FILERR_NONE && *file != NULL)
r31853r31854
500509
501510   return result;
502511}
512#endif
No newline at end of file
branches/osd/src/osd/sdl/sdlmain.c
r31853r31854
680680   /* now setup watchdog */
681681
682682   int watchdog_timeout = options.watchdog();
683   int str = options.seconds_to_run();
684683
685   /* only enable watchdog if seconds_to_run is enabled *and* relatively short (time taken from ui.c) */
686   if ((watchdog_timeout != 0) && (str > 0) && (str < 60*5 ))
684   if (watchdog_timeout != 0)
687685   {
688686      m_watchdog = auto_alloc(machine, watchdog);
689687      m_watchdog->setTimeout(watchdog_timeout);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team