Commit Graph

65 Commits

Author SHA1 Message Date
cracyc
a99407afb5 Discord plugin try 2 (#3640)
* plugins/discord: discord presence plugin [Carl]

* plugins/discord: use domain sockets and pipes [Carl]

* winptty: fix connecting to existing socket (nw)
plugins/discord: show pause state (nw)

* plugins/discord: fix pause behavior (nw)
2018-06-08 19:25:39 -04:00
npwoods
3d553eda60 Attempted to sanitize/rationalize how we access UTF-8 command line arguments (#2532)
Specifically, this creates a call osd_get_command_line() that returns UTF-8 command line arguments as std::vector<std::string>.  On non-Windows platforms, this does nothing more than build the vector.  On Windows, this invokes GetCommandLineW() and CommandLineToArgvW().  This also attempts to unwind usage of wmain()/_tmain() on Windows, which is not standard.

Related to this, this fixes a bug in Imgtool; specifically, non-7 bit ASCII was not being handled correctly in Windows.

This is really an admission that the way that Windows handles Unicode and command line arguments sucks, and it is my belief that having a wmain() or _tmain() declaration specific for Windows is a worse solution.  C'est la vie.

I'm very open to the idea that src/osd/osdcore.[cpp|h] is not the best place to do this.  Let me know if I should move it.
2017-09-18 20:28:53 -04:00
Miodrag Milanovic
7c765ea147 No need for osd_malloc, osd_malloc_array and osd_free (nw)
MALLOC_DEBUG not applicable anymore since we use new to allocate in 99.9% of cases
2016-11-11 16:12:01 +01:00
Miodrag Milanovic
a3d7454412 final cleanup of TRUE/FALSE, left only in windows section where it represent BOOL (nw) 2016-10-22 19:07:11 +02:00
Miodrag Milanovic
ddb290d5f6 NOTICE (TYPE NAME CONSOLIDATION)
Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8
also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
2016-10-22 13:13:17 +02:00
Miodrag Milanovic
23ad94073f use standard types uintptr_t, char16_t and char32_t instead of FPTR, utf16_char, unicode_char (nw) 2016-10-22 11:31:49 +02:00
Miodrag Milanovic
4887ce1844 Cleanups and version bump 2016-07-27 09:26:22 +02:00
Nathan Woods
2ea76d70ea Create osd_is_valid_filename_char() and osd_is_valid_filepath_char() functions to check to see if a character is legal, and moved retired is_valid_filename_char() in filecreate.cpp. POSIX versions not implemented yet. 2016-07-05 22:19:49 -04:00
Miodrag Milanovic
63f9a01f8c Cleanup and version bump 2016-06-29 08:34:30 +02:00
Vas Crabb
e363c5e154 Revert "This worked by pure luck (nw)"
This reverts commit b3491464e4.
2016-06-25 09:56:05 +10:00
Miodrag Milanovic
b3491464e4 This worked by pure luck (nw) 2016-06-24 21:25:02 +02:00
Vas Crabb
5cee9e9bc4 POSIX implementation for new directory read features, cleanup of Windows implementation, return directory handle as smart pointer, fix full build [Vas Crabb] 2016-06-25 03:35:23 +10:00
Nathan Woods
4ddfc6a6e4 Changed osd_stat() to return std::unique_ptr<osd::directory::entry> 2016-06-24 07:39:37 -04:00
Nathan Woods
cd8b414e6b C++-ified osd_directory (now osd::directory), and added last_modified to osd::directory::entry 2016-06-24 07:13:18 -04:00
Miodrag Milanovic
89c5e1f681 Various cleanups suggested by static analyzer (nw) 2016-04-24 12:58:31 +02:00
Miodrag Milanovic
5e80a732aa move clipboard handling on proper place (nw) 2016-04-03 17:55:10 +02:00
Vas Crabb
42fbb9c396 Make osd_file a polymorphic class that's held with smart pointers
Make avi_file a class that's held with smart pointers, encapsulate various AVI I/O structures
Make zip_file and _7z_file classes rather than having free functions everywhere
Hide zip/7z class implementation behind an interface, no longer need to call close() to send back to the cache
Don't dump as much crap in global namespace
Add solaris PTY implementation
Improve variable expansion for SDL OSD - supports ~/$FOO/${BAR} syntax
Rearrange stuff so the same things are in file module for all OSDs
Move file stuff into its own module

7z/zip open and destruct are still not thread-safe due to lack of interlocks around cache access
Directory functions still need to be moved to file module
SDL OSD may not initialise WinSock on Windows
2016-03-14 18:55:00 +11:00
Vas Crabb
ba960afb5f Add function for flushing file buffers 2016-03-01 07:38:14 +11:00
Miodrag Milanovic
4727b0d97f OS/2 can not support SDL2 which is needed for MAME to run (nw) 2016-02-26 13:20:43 +01:00
Miodrag Milanovic
42622cfe8e replace osd_lock with std::mutex [Miodrag Milanovic] 2016-01-30 20:43:50 +01:00
Jeffrey Clark
81a7c7b20c common osd path environment var expansion 2016-01-06 02:34:33 -06:00
Miodrag Milanovic
379581fb36 macro removal INLINE -> static inline (nw) 2015-12-12 08:58:57 +01:00
Miodrag Milanovic
91605d3f4d clang-modernize part 1 (nw) 2015-12-03 18:17:25 +01:00
fulivi
f8cb153519 pty: first step of pseudo terminal implementation
Conflicts:
	scripts/src/bus.lua
2015-10-13 12:00:52 +02:00
Vas Crabb
945ff007a6 Fix creation of paths 2015-03-31 01:51:01 +11:00
couriersud
98a6781c27 First step to move osd_printf_* into osd again. Callbacks are now
implemented using an interface and use a push/pop approach where the pop
can happen out of order of pushes. [Couriersud]
2015-03-04 01:39:52 +01:00
couriersud
8c3b8d43c7 Converted midi into a module. (nw) 2015-01-31 02:39:40 +01:00
couriersud
fed05b1e86 Promote osd_getenv from osdlib.h to osdcore.h. Change return type to
"const char*". Fixes netlist compile.
2015-01-27 01:43:04 +01:00
Miodrag Milanovic
8aeab92955 Added include of stdarg to support some platforms (nw) 2015-01-11 17:08:03 +01:00
couriersud
d7b9f653e3 Moved osd midi stuff to osd/modules/midi. Needed to touch a couple of
other files so that mame compiles and links. Tested SDL build
(linux/windows).
2015-01-09 23:21:19 +01:00
Miodrag Milanovic
63469469ba Added -listnetwork option to list available network adapters 2014-10-23 09:26:29 +02:00
Miodrag Milanovic
f8f3d68187 -Made osd_interface base class for OSD and moved initialization for each subsystem in it as virtual calls. (nw)
-Moved midi handling in base class
-Cleaned running_machine of information of next machine
-All is cleaned after exiting of running_machine so debugger window is removed as well till next machine is started
-Made osdmini to compile
2014-04-25 07:31:27 +00:00
Miodrag Milanovic
67663501d7 Moved eminline and related files into /src/osd since it's system related (nw)
Moved delegates into /src/lib/util to enable usage of delegates in other project parts

Moved mame_printf_* calls into /src/osd/osdcore.c and renamed them to osd_printf_* 

Changed mess.mak to display compilation of ymmu100.ppm nicely
2014-04-16 08:04:20 +00:00
Miodrag Milanovic
fec65e0b57 Cleanups and version bump 2014-04-07 06:04:18 +00:00
Oliver Stöneberg
75f2734a41 some comments (nw) 2014-03-24 22:27:38 +00:00
Olivier Galibert
72c4cc20f8 Add an osd_truncate call to truncate files [O. Galibert] 2014-03-11 09:19:17 +00:00
Aaron Giles
5d0ce54f9e Bulk convert files that already had standard BSD license in my name
to new license tagged form.
2013-10-16 08:14:49 +00:00
R. Belmont
520a27efd5 First pass on MIDI out support [R. Belmont] 2013-01-14 03:10:52 +00:00
R. Belmont
f6c44c6e9b MIDI core updates: [R. Belmont]
- Add MIDI in and out ports as image device types
- Add OSD calls to check for and read MIDI input
- Add MIDI in image device which reads input and converts it to a serial bitstream

nw section:
Note that the MIDI In device uses the new image device override to prevent the core from attempting to fopen() the "file" name and instead it handles open/close itself in call_load/call_unload.  This allows greater flexibilty than the hack used for sockets/ptys/named pipes where the OSD file layer has to know about them.
2013-01-13 03:48:10 +00:00
Miodrag Milanovic
0e19f641d3 Cleanups and version bump 2013-01-11 07:32:46 +00:00
R. Belmont
ad80ff6c3f portmidi: Initial commit. [R. Belmont]
(nw: this isn't enabled to compile yet, this is just to make it easier to run the final tests on my Mac and my Windows laptop)
2013-01-01 16:11:32 +00:00
Nathan Woods
c8b9a2095e Profiler rewrite; simplified, streamlined and less overhead. 2012-12-09 23:11:14 +00:00
Aaron Giles
1a30184903 Final round of struct/union/enum normalization. 2012-09-16 05:24:30 +00:00
Aaron Giles
ab97dc30ef First pass at modernizing struct definitions. 2012-09-15 21:47:30 +00:00
Ryan Holtz
b63233e7a6 Call off the dogs, the OSD routing for OSD-side sliders has been fixed. nwn 2011-05-23 05:03:16 +00:00
Ryan Holtz
01f16cb0f8 HLSL Updates: [Ryan Holtz, Bat Country Entertainment]
- Created a new OSD function, osd_get_slider_list, which allows OS-specific slider controls.
- Plumbed new OSD-specific slider controls for HLSL parameters on Direct3D 9 targets. And there was much rejoicing.
2011-05-22 23:59:27 +00:00
Angelo Salese
486fbfa555 Cleanups again 2011-04-18 00:06:50 +00:00
Aaron Giles
00d745ca77 (Big tangle of changes that all happened as I was looking into the ROM
loader rewrite, which is still in progress....)

Replaced mamedriv.c with a new driver list mechanism that is generated
by the build tools. The emulator core now expects the presence of a
file called src/$(TARGET)/$(SUBTARGET).lst which is just a raw list of
driver names, one per line. C and C++ comments are still permitted.
This file is parsed by a new build tool makelist which extracts the
driver names, sorts them, and generates a file called drivlist.c, which
is consumed by the core. [Aaron Giles]

Added new osdcore function osd_malloc_array() which is identical to
osd_malloc() but obviously hints that the underlying allocation is for
an array. Updated all callers to use the appropriate form. Modified the
Windows allocator to only use guard pages for array-style allocations,
allowing us to enable them once again in debug builds. [Aaron Giles]

Created new static class driver_list to wrap accesses to the list of
available drivers. Improved speed of driver lookups by relying on the
presorting done by makelist. [Aaron Giles]

Created helper class driver_enumerator as a helper for iterating through 
the list of drivers. This class supports basic filtering and iteration,
and also serves as a temporary cache of machine_configs. [Aaron Giles]

Created cli_frontend object to wrap all the CLI handling code in
clifront.c. Updated/simplified all the code to take advantage of the
driver_enumerator. [Aaron Giles]

Created media_auditor object to wrap all the auditing functions in
audit.c. Updated all users to the new interface. Note that the new
auditing mechanism is slightly out of sync with the romload code in
terms of finding ROMs owned by devices, so it may mis-report some
issues until the new ROM loading code is in. [Aaron Giles]

Added concept of a per-device searchpath. For most devices, their 
searchpath is just the short name of the device. For driver_devices, the
searchpath is driver[;parent[;bios]]. This searchpath will eventually be
used by the rom loader to find ROMs. For now it is used by the media
auditor only. [Aaron Giles]

Created info_xml_creator object to wrap all the info generation functions
in info.c. Converted the file to C++ and cleaned up the input processing
code. [Aaron Giles]

(not for whatsnew ... Known issues: auditing of CHDs appears busted, and 
debug builds report unfreed memory if you use the built-in game picker)
2011-04-13 20:31:00 +00:00
Aaron Giles
1b54456be5 mame_file is now emu_file and is a class. It is required
to pass a core_options object to the constructor, along with
a search path. This required pushing either a running_machine
or a core_options through some code that wasn't previously
ready to handle it. emu_files can be reused over multiple 
open/close sessions, and a lot of core code cleaned up
nicely as things were converted to them.

Also created a file_enumerator class for iterating over files
in a searchpath. This replaces the old mame_openpath functions.

Changed machine->options() to return a reference.

Removed public nvram_open() and fixed jchan/kaneko16 to
stop directly saving NVRAM.

Removed most of the mame_options() calls; this will soon go 
away entirely, so don't add any more.

Added core_options to device_validity_check() so they can be
used to validate things.
2011-02-12 03:47:37 +00:00
Miodrag Milanovic
848bf53c3d - moved opresolv and zippath into /lib/util from MESS [Miodrag Milanovic]
- removed ifdef MESS from osd part since calls are needed by zippath
2010-06-16 18:04:30 +00:00