mirror of
https://github.com/holub/mame
synced 2025-10-04 16:34:53 +03:00
Move ptime struct into plib namespace and fix relative includes. (nw)
This commit is contained in:
parent
9f35dc5552
commit
672f9b092a
@ -32,6 +32,7 @@ project "netlist"
|
||||
|
||||
includedirs {
|
||||
MAME_DIR .. "src/lib",
|
||||
MAME_DIR .. "src/lib/netlist",
|
||||
}
|
||||
|
||||
files {
|
||||
@ -47,7 +48,7 @@ project "netlist"
|
||||
MAME_DIR .. "src/lib/netlist/nl_parser.h",
|
||||
MAME_DIR .. "src/lib/netlist/nl_setup.cpp",
|
||||
MAME_DIR .. "src/lib/netlist/nl_setup.h",
|
||||
MAME_DIR .. "src/lib/netlist/nl_time.h",
|
||||
MAME_DIR .. "src/lib/netlist/nl_types.h",
|
||||
MAME_DIR .. "src/lib/netlist/plib/pconfig.h",
|
||||
MAME_DIR .. "src/lib/netlist/plib/palloc.h",
|
||||
MAME_DIR .. "src/lib/netlist/plib/pchrono.cpp",
|
||||
@ -74,10 +75,9 @@ project "netlist"
|
||||
MAME_DIR .. "src/lib/netlist/plib/pstate.h",
|
||||
MAME_DIR .. "src/lib/netlist/plib/pstring.cpp",
|
||||
MAME_DIR .. "src/lib/netlist/plib/pstring.h",
|
||||
MAME_DIR .. "src/lib/netlist/plib/pstring.cpp",
|
||||
MAME_DIR .. "src/lib/netlist/plib/pstring.h",
|
||||
MAME_DIR .. "src/lib/netlist/plib/pstream.cpp",
|
||||
MAME_DIR .. "src/lib/netlist/plib/pstream.h",
|
||||
MAME_DIR .. "src/lib/netlist/plib/ptime.h",
|
||||
MAME_DIR .. "src/lib/netlist/plib/ptypes.h",
|
||||
MAME_DIR .. "src/lib/netlist/plib/putil.cpp",
|
||||
MAME_DIR .. "src/lib/netlist/plib/putil.h",
|
||||
|
@ -499,6 +499,7 @@ links {
|
||||
|
||||
includedirs {
|
||||
MAME_DIR .. "src/lib",
|
||||
MAME_DIR .. "src/lib/netlist",
|
||||
}
|
||||
|
||||
files {
|
||||
@ -543,6 +544,7 @@ links {
|
||||
|
||||
includedirs {
|
||||
MAME_DIR .. "src/lib",
|
||||
MAME_DIR .. "src/lib/netlist",
|
||||
}
|
||||
|
||||
files {
|
||||
|
@ -13,8 +13,7 @@
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "netlist/nl_time.h"
|
||||
#include "netlist/netlist_types.h"
|
||||
#include "../../lib/netlist/nl_types.h"
|
||||
|
||||
class nld_sound_out;
|
||||
class nld_sound_in;
|
||||
|
@ -9,7 +9,7 @@
|
||||
#define NLID_FOURTERM_H_
|
||||
|
||||
#include "../nl_base.h"
|
||||
#include "../plib/putil.h"
|
||||
#include "plib/putil.h"
|
||||
|
||||
namespace netlist {
|
||||
namespace analog {
|
||||
|
@ -33,7 +33,7 @@
|
||||
#ifndef NLID_TWOTERM_H_
|
||||
#define NLID_TWOTERM_H_
|
||||
|
||||
#include "../plib/pfunction.h"
|
||||
#include "plib/pfunction.h"
|
||||
#include "netlist/nl_base.h"
|
||||
#include "netlist/nl_setup.h"
|
||||
|
||||
|
@ -49,7 +49,7 @@ endif
|
||||
|
||||
# LTO = -flto=4 -fuse-linker-plugin -flto-partition=balanced -Wodr
|
||||
|
||||
CFLAGS = $(LTO) -g -O3 -std=c++11 -I../.. $(CEXTRAFLAGS)
|
||||
CFLAGS = $(LTO) -g -O3 -std=c++11 -I$(CURDIR)/.. -I$(CURDIR)/../.. $(CEXTRAFLAGS)
|
||||
LDFLAGS = $(LTO) -g -O3 -std=c++11 $(LDEXTRAFLAGS)
|
||||
LIBS = -lpthread -ldl
|
||||
|
||||
|
@ -6,8 +6,8 @@
|
||||
*/
|
||||
|
||||
#include "../nl_base.h"
|
||||
#include "../plib/pfmtlog.h"
|
||||
#include "../plib/pstream.h"
|
||||
#include "plib/pfmtlog.h"
|
||||
#include "plib/pstream.h"
|
||||
#include "nld_log.h"
|
||||
//#include "sound/wavwrite.h"
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "../analog/nlid_twoterm.h"
|
||||
#include "../nl_base.h"
|
||||
#include "../nl_setup.h"
|
||||
#include "../plib/putil.h"
|
||||
#include "plib/putil.h"
|
||||
|
||||
namespace netlist
|
||||
{
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
#include "nlid_truthtable.h"
|
||||
#include "../nl_setup.h"
|
||||
#include "../plib/palloc.h"
|
||||
#include "../plib/plists.h"
|
||||
#include "plib/palloc.h"
|
||||
#include "plib/plists.h"
|
||||
|
||||
#include <bitset>
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include "../nl_base.h"
|
||||
#include "../nl_setup.h"
|
||||
#include "../plib/putil.h"
|
||||
#include "plib/putil.h"
|
||||
|
||||
#define NETLIB_TRUTHTABLE(cname, nIN, nOUT) \
|
||||
class NETLIB_NAME(cname) : public nld_truthtable_t<nIN, nOUT> \
|
||||
|
@ -24,10 +24,10 @@
|
||||
#include "plib/pstate.h"
|
||||
#include "plib/pstream.h"
|
||||
|
||||
#include "netlist_types.h"
|
||||
#include "nl_types.h"
|
||||
#include "nl_errstr.h"
|
||||
#include "nl_lists.h"
|
||||
#include "nl_time.h"
|
||||
#include "plib/ptime.h"
|
||||
|
||||
//============================================================
|
||||
// MACROS / New Syntax
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "netlist_types.h"
|
||||
#include "nl_types.h"
|
||||
#include "plib/palloc.h"
|
||||
#include "plib/ptypes.h"
|
||||
|
||||
|
@ -10,7 +10,6 @@
|
||||
#ifndef NLLISTS_H_
|
||||
#define NLLISTS_H_
|
||||
|
||||
#include "netlist_types.h"
|
||||
#include "nl_config.h"
|
||||
#include "plib/pchrono.h"
|
||||
#include "plib/plists.h"
|
||||
@ -21,6 +20,7 @@
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include <utility>
|
||||
#include "nl_types.h"
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
// timed queue
|
||||
|
@ -18,9 +18,9 @@
|
||||
#include "plib/pstring.h"
|
||||
#include "plib/putil.h"
|
||||
|
||||
#include "netlist_types.h"
|
||||
#include "nl_config.h"
|
||||
#include "nl_factory.h"
|
||||
#include "nl_types.h"
|
||||
|
||||
//============================================================
|
||||
// MACROS / inline netlist definitions
|
||||
|
@ -2,22 +2,23 @@
|
||||
// copyright-holders:Couriersud
|
||||
/*!
|
||||
*
|
||||
* \file netlist_types.h
|
||||
* \file nl_types.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef NETLIST_TYPES_H_
|
||||
#define NETLIST_TYPES_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <unordered_map>
|
||||
#ifndef NL_TYPES_H_
|
||||
#define NL_TYPES_H_
|
||||
|
||||
#include "nl_config.h"
|
||||
#include "plib/ptime.h"
|
||||
#include "plib/pchrono.h"
|
||||
#include "plib/pfmtlog.h"
|
||||
#include "plib/pmempool.h"
|
||||
#include "plib/pstring.h"
|
||||
#include "plib/pstate.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace netlist
|
||||
{
|
||||
@ -109,6 +110,31 @@ namespace netlist
|
||||
using model_map_t = std::unordered_map<pstring, pstring>;
|
||||
|
||||
} // namespace detail
|
||||
|
||||
#if (PHAS_INT128)
|
||||
using netlist_time = ptime<INT128, NETLIST_INTERNAL_RES>;
|
||||
#else
|
||||
using netlist_time = plib::ptime<std::int64_t, NETLIST_INTERNAL_RES>;
|
||||
static_assert(noexcept(netlist_time::from_nsec(1)) == true, "Not evaluated as constexpr");
|
||||
#endif
|
||||
|
||||
//============================================================
|
||||
// MACROS
|
||||
//============================================================
|
||||
|
||||
template <typename T> inline constexpr netlist_time NLTIME_FROM_NS(T &&t) noexcept { return netlist_time::from_nsec(t); }
|
||||
template <typename T> inline constexpr netlist_time NLTIME_FROM_US(T &&t) noexcept { return netlist_time::from_usec(t); }
|
||||
template <typename T> inline constexpr netlist_time NLTIME_FROM_MS(T &&t) noexcept { return netlist_time::from_msec(t); }
|
||||
|
||||
} // namespace netlist
|
||||
|
||||
#endif /* NETLIST_TYPES_H_ */
|
||||
namespace plib {
|
||||
|
||||
template<>
|
||||
inline void state_manager_t::save_item(const void *owner, netlist::netlist_time &nlt, const pstring &stname)
|
||||
{
|
||||
save_state_ptr(owner, stname, datatype_t(sizeof(netlist::netlist_time::internal_type), true, false), 1, nlt.get_internaltype_ptr());
|
||||
}
|
||||
} // namespace plib
|
||||
|
||||
#endif /* NL_TYPES_H_ */
|
@ -1,15 +1,14 @@
|
||||
// license:GPL-2.0+
|
||||
// copyright-holders:Couriersud
|
||||
/*
|
||||
* nltime.h
|
||||
* ptime.h
|
||||
*/
|
||||
|
||||
#ifndef NLTIME_H_
|
||||
#define NLTIME_H_
|
||||
#ifndef PTIME_H_
|
||||
#define PTIME_H_
|
||||
|
||||
#include "nl_config.h"
|
||||
#include "plib/pstate.h"
|
||||
#include "plib/ptypes.h"
|
||||
#include "pconfig.h"
|
||||
#include "ptypes.h"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
@ -17,7 +16,7 @@
|
||||
// netlist_time
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
namespace netlist
|
||||
namespace plib
|
||||
{
|
||||
|
||||
template <typename TYPE, TYPE RES>
|
||||
@ -130,30 +129,8 @@ namespace netlist
|
||||
internal_type m_time;
|
||||
};
|
||||
|
||||
#if (PHAS_INT128)
|
||||
using netlist_time = ptime<INT128, NETLIST_INTERNAL_RES>;
|
||||
#else
|
||||
using netlist_time = ptime<std::int64_t, NETLIST_INTERNAL_RES>;
|
||||
static_assert(noexcept(netlist_time::from_nsec(1)) == true, "Not evaluated as constexpr");
|
||||
#endif
|
||||
|
||||
//============================================================
|
||||
// MACROS
|
||||
//============================================================
|
||||
|
||||
template <typename T> inline constexpr netlist_time NLTIME_FROM_NS(T &&t) noexcept { return netlist_time::from_nsec(t); }
|
||||
template <typename T> inline constexpr netlist_time NLTIME_FROM_US(T &&t) noexcept { return netlist_time::from_usec(t); }
|
||||
template <typename T> inline constexpr netlist_time NLTIME_FROM_MS(T &&t) noexcept { return netlist_time::from_msec(t); }
|
||||
|
||||
} // namespace netlist
|
||||
|
||||
namespace plib {
|
||||
|
||||
template<>
|
||||
inline void state_manager_t::save_item(const void *owner, netlist::netlist_time &nlt, const pstring &stname)
|
||||
{
|
||||
save_state_ptr(owner, stname, datatype_t(sizeof(netlist::netlist_time::internal_type), true, false), 1, nlt.get_internaltype_ptr());
|
||||
}
|
||||
} // namespace plib
|
||||
|
||||
#endif /* NLTIME_H_ */
|
||||
|
||||
#endif /* PTIME_H_ */
|
@ -1,11 +1,11 @@
|
||||
// license:GPL-2.0+
|
||||
// copyright-holders:Couriersud
|
||||
#include "../plib/pstring.h"
|
||||
#include "plib/pstring.h"
|
||||
#include "../nl_setup.h"
|
||||
#include "../plib/plists.h"
|
||||
#include "../plib/pmain.h"
|
||||
#include "../plib/ppmf.h"
|
||||
#include "../plib/pstream.h"
|
||||
#include "plib/plists.h"
|
||||
#include "plib/pmain.h"
|
||||
#include "plib/ppmf.h"
|
||||
#include "plib/pstream.h"
|
||||
#include <cstring>
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "nld_matrix_solver.h"
|
||||
#include "../plib/putil.h"
|
||||
#include "plib/putil.h"
|
||||
|
||||
#include <cmath> // <<= needed by windows build
|
||||
|
||||
|
@ -10,8 +10,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <netlist/plib/mat_cr.h>
|
||||
#include <netlist/plib/vector_ops.h>
|
||||
#include "plib/mat_cr.h"
|
||||
#include "plib/vector_ops.h"
|
||||
|
||||
#include "nld_matrix_solver.h"
|
||||
#include "nld_solver.h"
|
||||
|
@ -10,15 +10,16 @@
|
||||
#ifndef NLD_MS_GCR_H_
|
||||
#define NLD_MS_GCR_H_
|
||||
|
||||
#include <algorithm>
|
||||
#include <netlist/plib/mat_cr.h>
|
||||
#include "plib/mat_cr.h"
|
||||
|
||||
#include "../plib/pdynlib.h"
|
||||
#include "../plib/pstream.h"
|
||||
#include "../plib/vector_ops.h"
|
||||
#include "plib/pdynlib.h"
|
||||
#include "plib/pstream.h"
|
||||
#include "plib/vector_ops.h"
|
||||
#include "nld_ms_direct.h"
|
||||
#include "nld_solver.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace netlist
|
||||
{
|
||||
namespace devices
|
||||
|
@ -8,10 +8,10 @@
|
||||
#ifndef NLD_MS_GMRES_H_
|
||||
#define NLD_MS_GMRES_H_
|
||||
|
||||
#include "../plib/gmres.h"
|
||||
#include "../plib/mat_cr.h"
|
||||
#include "../plib/parray.h"
|
||||
#include "../plib/vector_ops.h"
|
||||
#include "plib/gmres.h"
|
||||
#include "plib/mat_cr.h"
|
||||
#include "plib/parray.h"
|
||||
#include "plib/vector_ops.h"
|
||||
#include "nld_ms_direct.h"
|
||||
#include "nld_solver.h"
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "../plib/vector_ops.h"
|
||||
#include "plib/vector_ops.h"
|
||||
#include "nld_matrix_solver.h"
|
||||
#include "nld_solver.h"
|
||||
|
||||
|
@ -42,7 +42,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "../plib/vector_ops.h"
|
||||
#include "plib/vector_ops.h"
|
||||
#include "nld_matrix_solver.h"
|
||||
#include "nld_solver.h"
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "../nl_lists.h"
|
||||
|
||||
#include "../plib/pomp.h"
|
||||
#include "plib/pomp.h"
|
||||
|
||||
#include "../nl_factory.h"
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#define NLD_SOLVER_H_
|
||||
|
||||
#include "../nl_base.h"
|
||||
#include "../plib/pstream.h"
|
||||
#include "plib/pstream.h"
|
||||
#include "nld_matrix_solver.h"
|
||||
|
||||
#include <map>
|
||||
|
@ -5,8 +5,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../plib/palloc.h"
|
||||
#include "../plib/putil.h"
|
||||
#include "plib/palloc.h"
|
||||
#include "plib/putil.h"
|
||||
#include "nl_convert.h"
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
@ -10,10 +10,10 @@
|
||||
#ifndef NL_CONVERT_H_
|
||||
#define NL_CONVERT_H_
|
||||
|
||||
#include "../plib/plists.h"
|
||||
#include "../plib/pparser.h"
|
||||
#include "../plib/pstring.h"
|
||||
#include "../plib/ptypes.h"
|
||||
#include "plib/plists.h"
|
||||
#include "plib/pparser.h"
|
||||
#include "plib/pstring.h"
|
||||
#include "plib/ptypes.h"
|
||||
#include <memory>
|
||||
|
||||
/*-------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user