Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions docs/source/commandline/commandline-all.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3022,7 +3022,7 @@ Core Sound Options
* - ``wasapi``
- Windows
- Yes
- Yes [#SoundWASAPIMonitoring]_
- Yes
- Yes
- Yes
* - ``xaudio2``
Expand Down Expand Up @@ -3065,9 +3065,6 @@ Core Sound Options

.. rubric:: Footnotes

.. [#SoundWASAPIMonitoring] MAME requires Windows 10 1703 or later to use
output monitoring with WASAPI.

.. [#SoundXAudio2OS] MAME requires Windows 8 or later to use XAudio2.

.. [#SoundWinSDL] While SDL is not a supported option on official MAME builds
Expand Down
25 changes: 4 additions & 21 deletions docs/source/initialsetup/compilingmame.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Compiling MAME
All Platforms
-------------

* To compile MAME, you need a C++17 compiler and runtime library. We
support building with GCC version 10.3 or later and clang version 11
or later. MAME should run with GNU libstdc++ version 10.3 or later or
* To compile MAME, you need a C++20 compiler and runtime library. We
support building with GCC version 11 or later and clang version 11 or
later. MAME should run with GNU libstdc++ version 11 or later or
libc++ version 11 or later. The initial release of any major version
of GCC should be avoided. For example, if you want to compile MAME
with GCC 12, you should use version 12.1 or later.
Expand Down Expand Up @@ -795,23 +795,6 @@ omitted).
Issues affecting Microsoft Visual Studio
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Microsoft introduced a new version of XAudio2 with Windows 8 that’s incompatible
with the version included with DirectX for prior Windows versions at the API
level. Newer versions of the Microsoft Windows SDK include headers and libraries
for the new version of XAudio2. By default, the target Windows version is set to
Windows Vista (6.0) when compiling MAME, which prevents the use of this version
of the XAudio2 headers and libraries. To build MAME with XAudio2 support using
the Microsoft Windows SDK, you must do one of the following:

* Add ``MODERN_WIN_API=1`` to the options passed to make when generating the
Visual Studio project files. This will set the target Windows version to
Windows 8 (6.2). The resulting binaries may not run on earlier versions of
Windows.
* Install the `DirectX SDK <https://www.microsoft.com/en-US/download/details.aspx?id=6812>`_ (already included since Windows 8.0 SDK and
automatically installed with Visual Studio 2013 and later). Configure the
**osd_windows** project to search the DirectX header/library paths before
searching the Microsoft Windows SDK paths.

The MSVC compiler produces spurious warnings about potentially uninitialised
local variables. You currently need to add ``NOWERROR=1`` to the options passed
to make when generating the Visual Studio project files. This stops warnings
Expand Down Expand Up @@ -873,7 +856,7 @@ Using a GCC/GNU libstdc++ installation in a non-standard location on Linux
GCC may be built and installed to a custom location, typically by supplying the
**--prefix=** option to the **configure** command. This may be useful if you
want to build MAME on a Linux distribution that still uses a version of GNU
libstdC++ that predates C++17 support. To use an alternate GCC installation to,
libstdc++ that predates C++20 support. To use an alternate GCC installation to
build MAME, set the C and C++ compilers to the full paths to the **gcc** and
**g++** commands, and add the library path to the run-time search path. If you
installed GCC in /opt/local/gcc72, you might use a command like this::
Expand Down
12 changes: 6 additions & 6 deletions scripts/genie.lua
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@ language "C++"

flags {
"StaticRuntime",
"Cpp17",
}

if not _OPTIONS["NOWERROR"] then
Expand Down Expand Up @@ -713,11 +712,11 @@ end

local version = str_to_version(_OPTIONS["gcc_version"])
buildoptions_cpp {
"-std=c++17",
"-std=c++20",
}

buildoptions_objcpp {
"-std=c++17",
"-std=c++20",
}
-- this speeds it up a bit by piping between the preprocessor/compiler/assembler
buildoptions {
Expand Down Expand Up @@ -1040,8 +1039,8 @@ end
}
end
else
if version < 100300 then
print("GCC version 10.3 or later needed")
if version < 110000 then
print("GCC version 11 or later needed")
os.exit(-1)
end
buildoptions_cpp {
Expand Down Expand Up @@ -1108,7 +1107,7 @@ configuration { "asmjs" }
"-s USE_SDL_TTF=2",
}
buildoptions_cpp {
"-std=c++17",
"-std=c++20",
"-s EXCEPTION_CATCHING_ALLOWED=\"['_ZN15running_machine17start_all_devicesEv','_ZN12cli_frontend7executeEiPPc','_ZN8chd_file11open_commonEb','_ZN8chd_file13read_metadataEjjRNSt3__212basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE','_ZN8chd_file13read_metadataEjjRNSt3__26vectorIhNS0_9allocatorIhEEEE','_ZNK19netlist_mame_device19base_validity_checkER16validity_checker']\"",
}
defines {
Expand Down Expand Up @@ -1295,6 +1294,7 @@ if _OPTIONS["vs"]==nil then

buildoptions_cpp {
"/Zc:__cplusplus",
"/std:c++20",
}

flags {
Expand Down
8 changes: 4 additions & 4 deletions src/emu/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class device_type_impl_base
: m_creator(&create_device<DeviceClass>)
, m_type(typeid(DeviceClass))
, m_shortname(Traits::shortname)
, m_fullname(Traits::fullname)
, m_fullname((char const *)Traits::fullname)
, m_source(Traits::source)
, m_emulation_flags(DeviceClass::emulation_flags())
, m_unemulated_features(DeviceClass::unemulated_features())
Expand All @@ -258,7 +258,7 @@ class device_type_impl_base
: m_creator(&create_driver<DriverClass>)
, m_type(typeid(DriverClass))
, m_shortname(Traits::shortname)
, m_fullname(Traits::fullname)
, m_fullname((char const *)Traits::fullname)
, m_source(Traits::source)
, m_emulation_flags(DriverClass::emulation_flags() | Flags)
, m_unemulated_features(DriverClass::unemulated_features() | Unemulated)
Expand Down Expand Up @@ -404,7 +404,7 @@ extern emu::detail::device_registrar const registered_device_types;
{ \
static inline constexpr char const *const shortname = (ShortName); \
static inline constexpr char const *const source = __FILE__; \
static constexpr char const fullname[] = (FullName); \
static constexpr std::remove_reference_t<decltype((FullName)[0])> const fullname[] = (FullName); \
}; \
constexpr decltype(Type##_device_traits::fullname) Type##_device_traits::fullname; \
} \
Expand Down Expand Up @@ -446,7 +446,7 @@ extern emu::detail::device_registrar const registered_device_types;
{ \
static inline constexpr char const *const shortname = (ShortName); \
static inline constexpr char const *const source = __FILE__; \
static constexpr char const fullname[] = (FullName); \
static constexpr std::remove_reference_t<decltype((FullName)[0])> const fullname[] = (FullName); \
}; \
constexpr decltype(Type##_device_traits::fullname) Type##_device_traits::fullname; \
} \
Expand Down
10 changes: 5 additions & 5 deletions src/emu/gamedrv.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ class game_driver
{ \
static inline constexpr char const *const shortname = #NAME; \
static inline constexpr char const *const source = __FILE__; \
static inline constexpr char const *manufacturer = (COMPANY); \
static constexpr char const fullname[] = (FULLNAME); \
static inline constexpr auto const *const manufacturer = (COMPANY); \
static constexpr std::remove_reference_t<decltype((FULLNAME)[0])> const fullname[] = (FULLNAME); \
}; \
constexpr decltype(GAME_TRAITS_NAME(NAME)::fullname) GAME_TRAITS_NAME(NAME)::fullname; \
}
Expand Down Expand Up @@ -257,7 +257,7 @@ extern game_driver const GAME_NAME(NAME) \
GAME_DRIVER_TYPE(NAME, CLASS, FLAGS), \
#PARENT, \
#YEAR, \
GAME_TRAITS_NAME(NAME)::manufacturer, \
(const char *)GAME_TRAITS_NAME(NAME)::manufacturer, \
[] (machine_config &config, device_t &owner) { downcast<CLASS &>(owner).MACHINE(config); }, \
INPUT_PORTS_NAME(INPUT), \
[] (device_t &owner) { downcast<CLASS &>(owner).INIT(); }, \
Expand Down Expand Up @@ -329,7 +329,7 @@ extern game_driver const GAME_NAME(NAME) \
GAME_DRIVER_TYPE(NAME, CLASS, FLAGS), \
#PARENT, \
#YEAR, \
GAME_TRAITS_NAME(NAME)::manufacturer, \
(const char *)GAME_TRAITS_NAME(NAME)::manufacturer, \
[] (machine_config &config, device_t &owner) { downcast<CLASS &>(owner).MACHINE(config); }, \
INPUT_PORTS_NAME(INPUT), \
[] (device_t &owner) { downcast<CLASS &>(owner).INIT(); }, \
Expand Down Expand Up @@ -395,7 +395,7 @@ extern game_driver const GAME_NAME(NAME) \
GAME_DRIVER_TYPE(NAME, CLASS, FLAGS), \
#PARENT, \
#YEAR, \
GAME_TRAITS_NAME(NAME)::manufacturer, \
(const char *)GAME_TRAITS_NAME(NAME)::manufacturer, \
[] (machine_config &config, device_t &owner) { downcast<CLASS &>(owner).MACHINE(config); }, \
INPUT_PORTS_NAME(INPUT), \
[] (device_t &owner) { downcast<CLASS &>(owner).INIT(); }, \
Expand Down
6 changes: 6 additions & 0 deletions src/emu/ioport.h
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,12 @@ class ioport_configurer
ioport_configurer& set_condition(ioport_condition::condition_t condition, const char *tag, ioport_value mask, ioport_value value);
ioport_configurer& onoff_alloc(const char *name, ioport_value defval, ioport_value mask, const char *diplocation);

// allow UTF-8 strings to be used for names transparently
ioport_configurer& field_alloc(ioport_type type, ioport_value defval, ioport_value mask, const char8_t *name) { return field_alloc(type, defval, mask, reinterpret_cast<const char *>(name)); }
ioport_configurer& field_set_name(const char8_t *name) { return field_set_name(reinterpret_cast<const char *>(name)); }
ioport_configurer& setting_alloc(ioport_value value, const char8_t *name) { return setting_alloc(value, reinterpret_cast<const char *>(name)); }
ioport_configurer& onoff_alloc(const char8_t *name, ioport_value defval, ioport_value mask, const char *diplocation) { return onoff_alloc(reinterpret_cast<const char *>(name), defval, mask, diplocation); }

private:
// internal state
device_t & m_owner;
Expand Down
20 changes: 11 additions & 9 deletions src/frontend/mame/ui/videoopt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,18 @@ void menu_video_options::populate()
item_append(menu_item_type::SEPARATOR);
}

const char *subtext = "";

// add a rotate item
switch (m_target.orientation())
{
case ROT0: subtext = "None"; break;
case ROT90: subtext = u8"CW 90°"; break;
case ROT180: subtext = u8"180°"; break;
case ROT270: subtext = u8"CCW 90°"; break;
// add a rotate item
const auto *subtext = u8"";
switch (m_target.orientation())
{
case ROT0: subtext = u8"None"; break;
case ROT90: subtext = u8"CW 90°"; break;
case ROT180: subtext = u8"180°"; break;
case ROT270: subtext = u8"CCW 90°"; break;
}
item_append(_("Rotate"), (char const *)subtext, FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW, reinterpret_cast<void *>(ITEM_ROTATE));
}
item_append(_("Rotate"), subtext, FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW, reinterpret_cast<void *>(ITEM_ROTATE));

// cropping
bool const canzoom(curview.has_art() && !curview.visible_screens().empty());
Expand All @@ -167,6 +168,7 @@ void menu_video_options::populate()
if (!m_snapshot)
{
// uneven stretch
const auto *subtext = "";
switch (m_target.scale_mode())
{
case SCALE_FRACTIONAL:
Expand Down
14 changes: 14 additions & 0 deletions src/lib/util/language.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ char const *lang_translate(char const *context, char const *message);
std::string_view lang_translate(char const *context, std::string_view message);
std::string_view lang_translate(std::string_view context, std::string_view message);

// allow UTF-8 messages to be used as keys transparently
inline char const *lang_translate(char8_t const *message)
{ return lang_translate(reinterpret_cast<char const *>(message)); }
inline std::string_view lang_translate(std::u8string_view message)
{ return lang_translate(std::string_view(reinterpret_cast<char const *>(message.data()), message.size())); }

// allow UTF-8 messages to be used as keys transparently (with context)
inline char const *lang_translate(char const *context, char8_t const *message)
{ return lang_translate(context, reinterpret_cast<char const *>(message)); }
inline std::string_view lang_translate(char const *context, std::u8string_view message)
{ return lang_translate(context, std::string_view(reinterpret_cast<char const *>(message.data()), message.size())); }
inline std::string_view lang_translate(std::string_view context, std::u8string_view message)
{ return lang_translate(context, std::string_view(reinterpret_cast<char const *>(message.data()), message.size())); }

} // namespace util

#endif // MAME_LIB_UTIL_LANGUAGE_H
Loading
Loading