diff options
-rw-r--r-- | .appveyor.yml | 18 | ||||
-rw-r--r-- | .travis.yml | 8 | ||||
-rw-r--r-- | scripts/src/cpu.lua | 12 | ||||
-rw-r--r-- | scripts/src/netlist.lua | 2 | ||||
-rw-r--r-- | scripts/target/mame/ci.lua | 190 | ||||
-rw-r--r-- | src/devices/cpu/drcuml.cpp | 2 | ||||
-rw-r--r-- | src/lib/netlist/build/makefile | 3 | ||||
-rw-r--r-- | src/lib/netlist/core/setup.h | 19 | ||||
-rw-r--r-- | src/lib/netlist/core/state_var.h | 7 | ||||
-rw-r--r-- | src/lib/netlist/devices/net_lib.h | 5 | ||||
-rw-r--r-- | src/lib/netlist/devices/nld_schmitt.cpp | 1 | ||||
-rw-r--r-- | src/lib/netlist/devices/nld_tms4800.cpp | 1 | ||||
-rw-r--r-- | src/lib/netlist/devices/nlid_system.h | 67 | ||||
-rw-r--r-- | src/lib/netlist/macro/nlm_base_lib.cpp | 20 | ||||
-rw-r--r-- | src/lib/netlist/nl_base.cpp | 18 | ||||
-rw-r--r-- | src/lib/netlist/nl_base.h | 256 | ||||
-rw-r--r-- | src/lib/netlist/nl_errstr.h | 1 | ||||
-rw-r--r-- | src/lib/netlist/nl_parser.cpp | 40 | ||||
-rw-r--r-- | src/lib/netlist/nl_parser.h | 8 | ||||
-rw-r--r-- | src/lib/netlist/nl_setup.cpp | 40 | ||||
-rw-r--r-- | src/lib/netlist/nl_setup.h | 4 | ||||
-rw-r--r-- | src/mame/ci.lst | 41 | ||||
-rw-r--r-- | src/mame/drivers/cischeat.cpp | 18 | ||||
-rw-r--r-- | src/mame/drivers/progolf.cpp | 9 | ||||
-rw-r--r-- | src/mame/drivers/shine.cpp | 7 |
25 files changed, 426 insertions, 371 deletions
diff --git a/.appveyor.yml b/.appveyor.yml index 92a3789b711..c65cf92b580 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -23,8 +23,8 @@ install: - set MSYSTEM=MINGW64 build_script: - - bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && export MINGW64=/mingw64 && make SUBTARGET=tiny PTR64=1 TOOLS=1 OPTIMIZE=0 vs2019 -j3" - - msbuild "build\projects\windows\mametiny\vs2019\mametiny.sln" /m /p:ContinueOnError=false /p:StopOnFirstFailure=true /property:Configuration=Debug /property:Platform=x64 /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" + - bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && export MINGW64=/mingw64 && make SUBTARGET=ci PTR64=1 TOOLS=1 OPTIMIZE=0 vs2019 -j3" + - msbuild "build\projects\windows\mameci\vs2019\mameci.sln" /m /p:ContinueOnError=false /p:StopOnFirstFailure=true /property:Configuration=Debug /property:Platform=x64 /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" for: - matrix: @@ -43,16 +43,16 @@ for: - taskkill /f /fi "MODULES eq msys-2.0.dll" - bash -lc "pacman -Syu --noconfirm" build_script: - - bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && export MINGW64=/mingw64 && make SUBTARGET=tiny PTR64=1 TOOLS=1 OPTIMIZE=3 IGNORE_GIT=1 -j3" + - bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && export MINGW64=/mingw64 && make SUBTARGET=ci PTR64=1 TOOLS=1 OPTIMIZE=3 IGNORE_GIT=1 -j3" test_script: - - \projects\mame\mametiny64.exe -validate + - \projects\mame\mameci64.exe -validate after_test: - - 7z a mametiny64-appveyor-%APPVEYOR_REPO_BRANCH%-%APPVEYOR_REPO_COMMIT%-%APPVEYOR_BUILD_NUMBER%.7z %APPVEYOR_BUILD_FOLDER%\*.exe %APPVEYOR_BUILD_FOLDER%\artwork %APPVEYOR_BUILD_FOLDER%\bgfx %APPVEYOR_BUILD_FOLDER%\ctrlr %APPVEYOR_BUILD_FOLDER%\docs %APPVEYOR_BUILD_FOLDER%\hash %APPVEYOR_BUILD_FOLDER%\hlsl %APPVEYOR_BUILD_FOLDER%\ini %APPVEYOR_BUILD_FOLDER%\language %APPVEYOR_BUILD_FOLDER%\nl_examples %APPVEYOR_BUILD_FOLDER%\plugins %APPVEYOR_BUILD_FOLDER%\roms %APPVEYOR_BUILD_FOLDER%\samples - - appveyor PushArtifact mametiny64-appveyor-%APPVEYOR_REPO_BRANCH%-%APPVEYOR_REPO_COMMIT%-%APPVEYOR_BUILD_NUMBER%.7z + - 7z a mameci64-appveyor-%APPVEYOR_REPO_BRANCH%-%APPVEYOR_REPO_COMMIT%-%APPVEYOR_BUILD_NUMBER%.7z %APPVEYOR_BUILD_FOLDER%\*.exe %APPVEYOR_BUILD_FOLDER%\artwork %APPVEYOR_BUILD_FOLDER%\bgfx %APPVEYOR_BUILD_FOLDER%\ctrlr %APPVEYOR_BUILD_FOLDER%\docs %APPVEYOR_BUILD_FOLDER%\hash %APPVEYOR_BUILD_FOLDER%\hlsl %APPVEYOR_BUILD_FOLDER%\ini %APPVEYOR_BUILD_FOLDER%\language %APPVEYOR_BUILD_FOLDER%\nl_examples %APPVEYOR_BUILD_FOLDER%\plugins %APPVEYOR_BUILD_FOLDER%\roms %APPVEYOR_BUILD_FOLDER%\samples + - appveyor PushArtifact mameci64-appveyor-%APPVEYOR_REPO_BRANCH%-%APPVEYOR_REPO_COMMIT%-%APPVEYOR_BUILD_NUMBER%.7z test_script: - - \projects\mame\mametiny64d.exe -validate + - \projects\mame\mameci64d.exe -validate after_test: - - 7z a mametiny64d-appveyor-%APPVEYOR_REPO_BRANCH%-%APPVEYOR_REPO_COMMIT%-%APPVEYOR_BUILD_NUMBER%.7z %APPVEYOR_BUILD_FOLDER%\*.exe %APPVEYOR_BUILD_FOLDER%\artwork %APPVEYOR_BUILD_FOLDER%\bgfx %APPVEYOR_BUILD_FOLDER%\ctrlr %APPVEYOR_BUILD_FOLDER%\docs %APPVEYOR_BUILD_FOLDER%\hash %APPVEYOR_BUILD_FOLDER%\hlsl %APPVEYOR_BUILD_FOLDER%\ini %APPVEYOR_BUILD_FOLDER%\language %APPVEYOR_BUILD_FOLDER%\nl_examples %APPVEYOR_BUILD_FOLDER%\plugins %APPVEYOR_BUILD_FOLDER%\roms %APPVEYOR_BUILD_FOLDER%\samples - - appveyor PushArtifact mametiny64d-appveyor-%APPVEYOR_REPO_BRANCH%-%APPVEYOR_REPO_COMMIT%-%APPVEYOR_BUILD_NUMBER%.7z + - 7z a mameci64d-appveyor-%APPVEYOR_REPO_BRANCH%-%APPVEYOR_REPO_COMMIT%-%APPVEYOR_BUILD_NUMBER%.7z %APPVEYOR_BUILD_FOLDER%\*.exe %APPVEYOR_BUILD_FOLDER%\artwork %APPVEYOR_BUILD_FOLDER%\bgfx %APPVEYOR_BUILD_FOLDER%\ctrlr %APPVEYOR_BUILD_FOLDER%\docs %APPVEYOR_BUILD_FOLDER%\hash %APPVEYOR_BUILD_FOLDER%\hlsl %APPVEYOR_BUILD_FOLDER%\ini %APPVEYOR_BUILD_FOLDER%\language %APPVEYOR_BUILD_FOLDER%\nl_examples %APPVEYOR_BUILD_FOLDER%\plugins %APPVEYOR_BUILD_FOLDER%\roms %APPVEYOR_BUILD_FOLDER%\samples + - appveyor PushArtifact mameci64d-appveyor-%APPVEYOR_REPO_BRANCH%-%APPVEYOR_REPO_COMMIT%-%APPVEYOR_BUILD_NUMBER%.7z diff --git a/.travis.yml b/.travis.yml index ab9ac82767f..c948f4a6c0f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,19 +24,19 @@ jobs: - os: osx osx_image: xcode11.6 compiler: clang - env: SUBTARGET=tiny MAME=mametiny64 + env: SUBTARGET=ci MAME=mameci64 - os: linux arch: amd64 compiler: gcc - env: SUBTARGET=tiny MAME=mametiny64 + env: SUBTARGET=ci MAME=mameci64 - os: linux arch: arm64 compiler: gcc - env: SUBTARGET=tiny MAME=mametiny + env: SUBTARGET=ci MAME=mameci - os: linux arch: s390x compiler: gcc - env: SUBTARGET=tiny MAME=mametiny64 + env: SUBTARGET=ci MAME=mameci64 script: - if [ $TRAVIS_OS_NAME == 'linux' ]; then if [ $CC == 'clang' ]; then diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua index 64814fd67d7..f8c16807c87 100644 --- a/scripts/src/cpu.lua +++ b/scripts/src/cpu.lua @@ -39,12 +39,16 @@ if (CPU_INCLUDE_DRC) then MAME_DIR .. "src/devices/cpu/uml.h", MAME_DIR .. "src/devices/cpu/x86log.cpp", MAME_DIR .. "src/devices/cpu/x86log.h", - MAME_DIR .. "src/devices/cpu/drcbex86.cpp", - MAME_DIR .. "src/devices/cpu/drcbex86.h", - MAME_DIR .. "src/devices/cpu/drcbex64.cpp", - MAME_DIR .. "src/devices/cpu/drcbex64.h", MAME_DIR .. "src/devices/cpu/drcumlsh.h", } + if not _OPTIONS["FORCE_DRC_C_BACKEND"] then + files { + MAME_DIR .. "src/devices/cpu/drcbex64.cpp", + MAME_DIR .. "src/devices/cpu/drcbex64.h", + MAME_DIR .. "src/devices/cpu/drcbex86.cpp", + MAME_DIR .. "src/devices/cpu/drcbex86.h", + } + end end -------------------------------------------------- diff --git a/scripts/src/netlist.lua b/scripts/src/netlist.lua index 20c83daf992..b19928aa464 100644 --- a/scripts/src/netlist.lua +++ b/scripts/src/netlist.lua @@ -54,6 +54,8 @@ project "netlist" MAME_DIR .. "src/lib/netlist/core/base_objects.h", MAME_DIR .. "src/lib/netlist/core/core_device.h", MAME_DIR .. "src/lib/netlist/core/device.h", + MAME_DIR .. "src/lib/netlist/core/device_macros.h", + MAME_DIR .. "src/lib/netlist/core/devices.h", MAME_DIR .. "src/lib/netlist/core/exec.h", MAME_DIR .. "src/lib/netlist/core/logic_family.h", MAME_DIR .. "src/lib/netlist/core/logic.h", diff --git a/scripts/target/mame/ci.lua b/scripts/target/mame/ci.lua new file mode 100644 index 00000000000..4be647c805f --- /dev/null +++ b/scripts/target/mame/ci.lua @@ -0,0 +1,190 @@ +-- license:BSD-3-Clause +-- copyright-holders:MAMEdev Team + +--------------------------------------------------------------------------- +-- +-- ci.lua +-- +-- Small driver-specific example makefile for use in CI +-- Use make SUBTARGET=ci to build +-- +--------------------------------------------------------------------------- + + +-------------------------------------------------- +-- Specify all the CPU cores necessary for the +-- drivers referenced in ci.lst. +-------------------------------------------------- + +CPUS["Z80"] = true +CPUS["M6502"] = true +CPUS["MCS48"] = true +CPUS["MCS51"] = true +CPUS["M6800"] = true +CPUS["M6805"] = true +CPUS["M6809"] = true +CPUS["M680X0"] = true +CPUS["TMS9900"] = true +CPUS["COP400"] = true +CPUS["MIPS3"] = true +CPUS["ADSP21XX"] = true +CPUS["FR"] = true + +-------------------------------------------------- +-- Specify all the sound cores necessary for the +-- drivers referenced in ci.lst. +-------------------------------------------------- + +SOUNDS["SAMPLES"] = true +SOUNDS["DAC"] = true +SOUNDS["DISCRETE"] = true +SOUNDS["AY8910"] = true +SOUNDS["YM2151"] = true +SOUNDS["ASTROCADE"] = true +SOUNDS["TMS5220"] = true +SOUNDS["OKIM6295"] = true +SOUNDS["HC55516"] = true +SOUNDS["YM3812"] = true +SOUNDS["CEM3394"] = true +SOUNDS["VOTRAX"] = true +SOUNDS["VOLT_REG"] = true +SOUNDS["DMADAC"] = true +SOUNDS["CDDA"] = true + +-------------------------------------------------- +-- specify available video cores +-------------------------------------------------- + +VIDEOS["PS2GIF"] = true +VIDEOS["PS2GS"] = true + +-------------------------------------------------- +-- specify available machine cores +-------------------------------------------------- + +MACHINES["6821PIA"] = true +MACHINES["ADC0808"] = true +MACHINES["TTL74148"] = true +MACHINES["TTL74153"] = true +MACHINES["TTL74157"] = true +MACHINES["TTL7474"] = true +MACHINES["TTL74259"] = true +MACHINES["RIOT6532"] = true +MACHINES["PIT8253"] = true +MACHINES["Z80CTC"] = true +MACHINES["Z80PIO"] = true +MACHINES["68681"] = true +MACHINES["BANKDEV"] = true +MACHINES["GEN_LATCH"] = true +MACHINES["INPUT_MERGER"] = true +MACHINES["OUTPUT_LATCH"] = true +MACHINES["TICKET"] = true +MACHINES["WATCHDOG"] = true +MACHINES["Z80DAISY"] = true +MACHINES["NETLIST"] = true +MACHINES["IDECTRL"] = true +MACHINES["PS2INTC"] = true + +-------------------------------------------------- +-- specify available bus cores +-------------------------------------------------- + +BUSES["CENTRONICS"] = true +BUSES["ATA"] = true + +-------------------------------------------------- +-- This is the list of files that are necessary +-- for building all of the drivers referenced +-- in ci.lst +-------------------------------------------------- + +function createProjects_mame_ci(_target, _subtarget) + project ("mame_ci") + targetsubdir(_target .."_" .. _subtarget) + kind (LIBTYPE) + uuid (os.uuid("drv-mame-ci")) + addprojectflags() + precompiledheaders_novs() + + includedirs { + MAME_DIR .. "src/osd", + MAME_DIR .. "src/emu", + MAME_DIR .. "src/devices", + MAME_DIR .. "src/mame", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "3rdparty", + GEN_DIR .. "mame/layout", + } + +files{ + MAME_DIR .. "src/mame/audio/nl_carpolo.h", + MAME_DIR .. "src/mame/audio/nl_carpolo.cpp", + MAME_DIR .. "src/mame/drivers/carpolo.cpp", + MAME_DIR .. "src/mame/includes/carpolo.h", + MAME_DIR .. "src/mame/machine/carpolo.cpp", + MAME_DIR .. "src/mame/video/carpolo.cpp", + MAME_DIR .. "src/mame/drivers/circus.cpp", + MAME_DIR .. "src/mame/includes/circus.h", + MAME_DIR .. "src/mame/audio/circus.cpp", + MAME_DIR .. "src/mame/video/circus.cpp", + MAME_DIR .. "src/mame/drivers/exidy.cpp", + MAME_DIR .. "src/mame/includes/exidy.h", + MAME_DIR .. "src/mame/audio/exidy.cpp", + MAME_DIR .. "src/mame/audio/exidy.h", + MAME_DIR .. "src/mame/video/exidy.cpp", + MAME_DIR .. "src/mame/audio/exidy440.cpp", + MAME_DIR .. "src/mame/audio/exidy440.h", + MAME_DIR .. "src/mame/drivers/starfire.cpp", + MAME_DIR .. "src/mame/audio/nl_fireone.h", + MAME_DIR .. "src/mame/audio/nl_fireone.cpp", + MAME_DIR .. "src/mame/audio/nl_starfire.h", + MAME_DIR .. "src/mame/audio/nl_starfire.cpp", + MAME_DIR .. "src/mame/includes/starfire.h", + MAME_DIR .. "src/mame/video/starfire.cpp", + MAME_DIR .. "src/mame/drivers/vertigo.cpp", + MAME_DIR .. "src/mame/includes/vertigo.h", + MAME_DIR .. "src/mame/machine/vertigo.cpp", + MAME_DIR .. "src/mame/video/vertigo.cpp", + MAME_DIR .. "src/mame/drivers/victory.cpp", + MAME_DIR .. "src/mame/includes/victory.h", + MAME_DIR .. "src/mame/video/victory.cpp", + MAME_DIR .. "src/mame/audio/targ.cpp", + MAME_DIR .. "src/mame/drivers/astrocde.cpp", + MAME_DIR .. "src/mame/includes/astrocde.h", + MAME_DIR .. "src/mame/video/astrocde.cpp", + MAME_DIR .. "src/mame/drivers/gridlee.cpp", + MAME_DIR .. "src/mame/includes/gridlee.h", + MAME_DIR .. "src/mame/audio/gridlee.cpp", + MAME_DIR .. "src/mame/video/gridlee.cpp", + MAME_DIR .. "src/mame/drivers/williams.cpp", + MAME_DIR .. "src/mame/includes/williams.h", + MAME_DIR .. "src/mame/machine/williams.cpp", + MAME_DIR .. "src/mame/audio/williams.cpp", + MAME_DIR .. "src/mame/audio/williams.h", + MAME_DIR .. "src/mame/video/williams.cpp", + MAME_DIR .. "src/mame/drivers/gaelco.cpp", + MAME_DIR .. "src/mame/includes/gaelco.h", + MAME_DIR .. "src/mame/video/gaelco.cpp", + MAME_DIR .. "src/mame/machine/gaelcrpt.cpp", + MAME_DIR .. "src/mame/drivers/wrally.cpp", + MAME_DIR .. "src/mame/includes/wrally.h", + MAME_DIR .. "src/mame/machine/wrally.cpp", + MAME_DIR .. "src/mame/video/wrally.cpp", + MAME_DIR .. "src/mame/video/gaelco_wrally_sprites.cpp", + MAME_DIR .. "src/mame/video/gaelco_wrally_sprites.h", + MAME_DIR .. "src/mame/machine/gaelco_ds5002fp.cpp", + MAME_DIR .. "src/mame/machine/gaelco_ds5002fp.h", + MAME_DIR .. "src/mame/drivers/looping.cpp", + MAME_DIR .. "src/mame/drivers/supertnk.cpp", + MAME_DIR .. "src/mame/drivers/kinst.cpp", + MAME_DIR .. "src/mame/audio/dcs.cpp", + MAME_DIR .. "src/mame/audio/dcs.h", +} +end + +function linkProjects_mame_ci(_target, _subtarget) + links { + "mame_ci", + } +end diff --git a/src/devices/cpu/drcuml.cpp b/src/devices/cpu/drcuml.cpp index 0a1dcae9d02..e935913aceb 100644 --- a/src/devices/cpu/drcuml.cpp +++ b/src/devices/cpu/drcuml.cpp @@ -36,8 +36,10 @@ #include "emuopts.h" #include "drcbec.h" +#ifdef NATIVE_DRC #include "drcbex86.h" #include "drcbex64.h" +#endif #include <fstream> diff --git a/src/lib/netlist/build/makefile b/src/lib/netlist/build/makefile index 07c1e8d89f9..2c4dff9bae7 100644 --- a/src/lib/netlist/build/makefile +++ b/src/lib/netlist/build/makefile @@ -308,7 +308,8 @@ clang: -Wmissing-variable-declarations -Wno-float-equal -Wconversion \ -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wformat-nonliteral \ -Wno-exit-time-destructors -Winconsistent-missing-destructor-override \ - -Wno-return-std-move-in-c++11 -Wno-unreachable-code" + -Wno-return-std-move-in-c++11 -Wno-unreachable-code \ + -Wno-missing-prototypes" clang-libc: #clang-11 currently broken diff --git a/src/lib/netlist/core/setup.h b/src/lib/netlist/core/setup.h index 5048c2ae765..20fc9cb3678 100644 --- a/src/lib/netlist/core/setup.h +++ b/src/lib/netlist/core/setup.h @@ -333,6 +333,25 @@ namespace netlist pstring m_setup_func_name; }; + class source_token_t : public source_netlist_t + { + public: + source_token_t(const pstring &name, const parser_t::token_store &store) + : m_store(store) + , m_name(name) + { + } + + bool parse(nlparse_t &setup, const pstring &name) override; + + protected: + stream_ptr stream(const pstring &name) override; + + private: + parser_t::token_store m_store; + pstring m_name; + }; + } // namespace netlist diff --git a/src/lib/netlist/core/state_var.h b/src/lib/netlist/core/state_var.h index 922789f584e..55db73c1ac2 100644 --- a/src/lib/netlist/core/state_var.h +++ b/src/lib/netlist/core/state_var.h @@ -169,5 +169,12 @@ namespace netlist } // namespace netlist +namespace plib +{ + template<typename X> + struct ptype_traits<netlist::state_var<X>> : ptype_traits<X> + { + }; +} // namespace plib #endif // NL_CORE_STATE_VAR_H_ diff --git a/src/lib/netlist/devices/net_lib.h b/src/lib/netlist/devices/net_lib.h index a5779cf162e..a891b8f1b0b 100644 --- a/src/lib/netlist/devices/net_lib.h +++ b/src/lib/netlist/devices/net_lib.h @@ -29,11 +29,6 @@ #endif NETLIST_EXTERNAL(base_lib) -NETLIST_EXTERNAL(cd4xxx_lib) -NETLIST_EXTERNAL(opamp_lib) -NETLIST_EXTERNAL(otheric_lib) -NETLIST_EXTERNAL(ttl74xx_lib) -NETLIST_EXTERNAL(roms_lib) #if NL_AUTO_DEVICES #include "nld_devinc.h" diff --git a/src/lib/netlist/devices/nld_schmitt.cpp b/src/lib/netlist/devices/nld_schmitt.cpp index 5225bdcc139..f78b8f0cf65 100644 --- a/src/lib/netlist/devices/nld_schmitt.cpp +++ b/src/lib/netlist/devices/nld_schmitt.cpp @@ -8,7 +8,6 @@ #include "nld_schmitt.h" #include "netlist/analog/nlid_twoterm.h" -#include "netlist/devices/nlid_system.h" #include "netlist/nl_base.h" #include "netlist/nl_errstr.h" #include "netlist/solver/nld_solver.h" diff --git a/src/lib/netlist/devices/nld_tms4800.cpp b/src/lib/netlist/devices/nld_tms4800.cpp index d55827c2416..0c37821b37f 100644 --- a/src/lib/netlist/devices/nld_tms4800.cpp +++ b/src/lib/netlist/devices/nld_tms4800.cpp @@ -26,7 +26,6 @@ */ #include "nld_tms4800.h" -#include "netlist/devices/nlid_system.h" #include "netlist/nl_base.h" namespace netlist diff --git a/src/lib/netlist/devices/nlid_system.h b/src/lib/netlist/devices/nlid_system.h index a8ba6937164..26c58055b63 100644 --- a/src/lib/netlist/devices/nlid_system.h +++ b/src/lib/netlist/devices/nlid_system.h @@ -21,29 +21,6 @@ namespace netlist namespace devices { // ----------------------------------------------------------------------------- - // netlistparams - // ----------------------------------------------------------------------------- - - NETLIB_OBJECT(netlistparams) - { - NETLIB_CONSTRUCTOR(netlistparams) - , m_use_deactivate(*this, "USE_DEACTIVATE", false) - , m_startup_strategy(*this, "STARTUP_STRATEGY", 0) - , m_mos_capmodel(*this, "DEFAULT_MOS_CAPMODEL", 2) - , m_max_link_loops(*this, "MAX_LINK_RESOLVE_LOOPS", 100) - { - } - //NETLIB_RESETI() {} - //NETLIB_UPDATE_PARAMI() { } - public: - param_logic_t m_use_deactivate; - param_num_t<unsigned> m_startup_strategy; - param_num_t<unsigned> m_mos_capmodel; - //! How many times do we try to resolve links (connections) - param_num_t<unsigned> m_max_link_loops; - }; - - // ----------------------------------------------------------------------------- // clock // ----------------------------------------------------------------------------- @@ -300,50 +277,6 @@ namespace devices param_fp_t m_IN; }; - // ----------------------------------------------------------------------------- - // nld_gnd - // ----------------------------------------------------------------------------- - - NETLIB_OBJECT(gnd) - { - NETLIB_CONSTRUCTOR(gnd) - , m_Q(*this, "Q") - { - } - - NETLIB_UPDATE_PARAMI() - { - m_Q.push(nlconst::zero()); - } - - //NETLIB_RESETI() {} - protected: - analog_output_t m_Q; - }; - - // ----------------------------------------------------------------------------- - // nld_nc_pin - // ----------------------------------------------------------------------------- - - NETLIB_OBJECT(nc_pin) - { - public: - NETLIB_CONSTRUCTOR(nc_pin) - , m_I(*this, "I", NETLIB_DELEGATE(noop)) - { - } - - protected: - //NETLIB_RESETI() {} - - private: - NETLIB_HANDLERI(noop) - { - } - - analog_input_t m_I; - - }; // ----------------------------------------------------------------------------- // nld_frontier diff --git a/src/lib/netlist/macro/nlm_base_lib.cpp b/src/lib/netlist/macro/nlm_base_lib.cpp index 04676fc5338..51969930564 100644 --- a/src/lib/netlist/macro/nlm_base_lib.cpp +++ b/src/lib/netlist/macro/nlm_base_lib.cpp @@ -3,6 +3,16 @@ #include "netlist/devices/net_lib.h" /* ---------------------------------------------------------------------------- + * External declarations + * ---------------------------------------------------------------------------*/ + +NETLIST_EXTERNAL(cd4xxx_lib) +NETLIST_EXTERNAL(opamp_lib) +NETLIST_EXTERNAL(otheric_lib) +NETLIST_EXTERNAL(ttl74xx_lib) +NETLIST_EXTERNAL(roms_lib) + +/* ---------------------------------------------------------------------------- * Diode Models * ---------------------------------------------------------------------------*/ @@ -107,11 +117,11 @@ NETLIST_START(base_lib) LOCAL_SOURCE(mosfet_models) LOCAL_SOURCE(family_models) - LOCAL_SOURCE(ttl74xx_lib) - LOCAL_SOURCE(cd4xxx_lib) - LOCAL_SOURCE(opamp_lib) - LOCAL_SOURCE(otheric_lib) - LOCAL_SOURCE(roms_lib) + EXTERNAL_SOURCE(ttl74xx_lib) + EXTERNAL_SOURCE(cd4xxx_lib) + EXTERNAL_SOURCE(opamp_lib) + EXTERNAL_SOURCE(otheric_lib) + EXTERNAL_SOURCE(roms_lib) INCLUDE(diode_models) INCLUDE(bjt_models) diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp index 532a3f98f47..ef98d4434de 100644 --- a/src/lib/netlist/nl_base.cpp +++ b/src/lib/netlist/nl_base.cpp @@ -13,7 +13,6 @@ #include "core/setup.h" #include "devices/nlid_proxy.h" -#include "devices/nlid_system.h" // netlist_params #include "nl_base.h" #include "nl_errstr.h" @@ -144,17 +143,18 @@ namespace netlist NETLIST_NAME(base_lib)(m_setup->parser()); #else // FIXME: This is very slow - need optimized parsing scanning -#if 0 - m_setup->parser().register_source<source_pattern_t>("src/lib/netlist/macro/nlm_{}.cpp"); +#if 1 + m_setup->parser().register_source<source_pattern_t>("src/lib/netlist/macro/nlm_{1}.cpp"); + m_setup->parser().include("base_lib"); #else pstring dir = "src/lib/netlist/macro/"; //m_setup->parser().register_source<source_pattern_t>("src/lib/netlist/macro/nlm_{}.cpp"); - m_setup->parser().register_source<source_file_t>(dir + "nlm_base.cpp"); - m_setup->parser().register_source<source_file_t>(dir + "nlm_opamp.cpp"); - m_setup->parser().register_source<source_file_t>(dir + "nlm_roms.cpp"); - m_setup->parser().register_source<source_file_t>(dir + "nlm_cd4xxx.cpp"); - m_setup->parser().register_source<source_file_t>(dir + "nlm_other.cpp"); - m_setup->parser().register_source<source_file_t>(dir + "nlm_ttl74xx.cpp"); + m_setup->parser().register_source<source_file_t>(dir + "nlm_base_lib.cpp"); + m_setup->parser().register_source<source_file_t>(dir + "nlm_opamp_lib.cpp"); + m_setup->parser().register_source<source_file_t>(dir + "nlm_roms_lib.cpp"); + m_setup->parser().register_source<source_file_t>(dir + "nlm_cd4xxx_lib.cpp"); + m_setup->parser().register_source<source_file_t>(dir + "nlm_otheric_lib.cpp"); + m_setup->parser().register_source<source_file_t>(dir + "nlm_ttl74xx_lib.cpp"); m_setup->parser().include("base_lib"); #endif #endif diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h index 32cc1f0eacc..1eebae7b75a 100644 --- a/src/lib/netlist/nl_base.h +++ b/src/lib/netlist/nl_base.h @@ -23,167 +23,8 @@ #include "core/param.h" #include "core/state_var.h" #include "core/exec.h" - -//============================================================ -// MACROS / New Syntax -//============================================================ - -/// \brief Construct a netlist device name -/// -#define NETLIB_NAME(chip) nld_ ## chip - -/// \brief Start a netlist device class. -/// -/// Used to start defining a netlist device class. -/// The simplest device without inputs or outputs would look like this: -/// -/// NETLIB_OBJECT(some_object) -/// { -/// public: -/// NETLIB_CONSTRUCTOR(some_object) { } -/// }; -/// -/// Also refer to #NETLIB_CONSTRUCTOR. -#define NETLIB_OBJECT(name) \ -class NETLIB_NAME(name) : public delegator_t<device_t> - -/// \brief Start a derived netlist device class. -/// -/// Used to define a derived device class based on plcass. -/// The simplest device without inputs or outputs would look like this: -/// -/// NETLIB_OBJECT_DERIVED(some_object, parent_object) -/// { -/// public: -/// NETLIB_CONSTRUCTOR(some_object) { } -/// }; -/// -/// Also refer to #NETLIB_CONSTRUCTOR. -#define NETLIB_OBJECT_DERIVED(name, pclass) \ -class NETLIB_NAME(name) : public delegator_t<NETLIB_NAME(pclass)> - - - -// Only used for analog objects like diodes and resistors - -#define NETLIB_BASE_OBJECT(name) \ -class NETLIB_NAME(name) : public delegator_t<base_device_t> - -#define NETLIB_CONSTRUCTOR_PASS(cname, ...) \ - using this_type = NETLIB_NAME(cname); \ - public: template <class CLASS> NETLIB_NAME(cname)(CLASS &owner, const pstring &name) \ - : base_type(owner, name, __VA_ARGS__) - -/// \brief Used to define the constructor of a netlist device. -/// -/// Use this to define the constructor of a netlist device. Please refer to -/// #NETLIB_OBJECT for an example. -#define NETLIB_CONSTRUCTOR(cname) \ - using this_type = NETLIB_NAME(cname); \ - public: template <class CLASS> NETLIB_NAME(cname)(CLASS &owner, const pstring &name)\ - : base_type(owner, name) - -/// \brief Used to define the constructor of a netlist device and define a default model. -/// -/// -/// NETLIB_CONSTRUCTOR_MODEL(some_object, "TTL") -/// { -/// public: -/// NETLIB_CONSTRUCTOR(some_object) { } -/// }; -/// -#define NETLIB_CONSTRUCTOR_MODEL(cname, cmodel) \ - using this_type = NETLIB_NAME(cname); \ - public: template <class CLASS> NETLIB_NAME(cname)(CLASS &owner, const pstring &name) \ - : base_type(owner, name, cmodel) - -/// \brief Define an extended constructor and add further parameters to it. -/// The macro allows to add further parameters to a device constructor. This is -/// normally used for sub-devices and system devices only. -#define NETLIB_CONSTRUCTOR_EX(cname, ...) \ - using this_type = NETLIB_NAME(cname); \ - public: template <class CLASS> NETLIB_NAME(cname)(CLASS &owner, const pstring &name, __VA_ARGS__) \ - : base_type(owner, name) - -/// \brief Used to define the destructor of a netlist device. -/// The use of a destructor for netlist device should normally not be necessary. -#define NETLIB_DESTRUCTOR(name) public: virtual ~NETLIB_NAME(name)() noexcept override - -/// \brief Add this to a device definition to mark the device as dynamic. -/// -/// If NETLIB_IS_DYNAMIC(true) is added to the device definition the device -/// is treated as an analog dynamic device, i.e. \ref NETLIB_UPDATE_TERMINALSI -/// is called on a each step of the Newton-Raphson step -/// of solving the linear equations. -/// -/// You may also use e.g. NETLIB_IS_DYNAMIC(m_func() != "") to only make the -/// device a dynamic device if parameter m_func is set. -/// -/// \param expr boolean expression -/// -#define NETLIB_IS_DYNAMIC(expr) \ - public: virtual bool is_dynamic() const noexcept override { return expr; } - -/// \brief Add this to a device definition to mark the device as a time-stepping device. -/// -/// You have to implement NETLIB_TIMESTEP in this case as well. Currently, only -/// the capacitor and inductor devices uses this. -/// -/// You may also use e.g. NETLIB_IS_TIMESTEP(m_func() != "") to only make the -/// device a dynamic device if parameter m_func is set. This is used by the -/// Voltage Source element. -/// -/// Example: -/// -/// \code -/// NETLIB_TIMESTEP_IS_TIMESTEP() -/// NETLIB_TIMESTEPI() -/// { -/// // Gpar should support convergence -/// const nl_fptype G = m_C.Value() / step + m_GParallel; -/// const nl_fptype I = -G/// deltaV(); -/// set(G, 0.0, I); -/// } -/// \endcode - -#define NETLIB_IS_TIMESTEP(expr) \ - public: virtual bool is_timestep() const noexcept override { return expr; } - -/// \brief Used to implement the time stepping code. -/// -/// Please see \ref NETLIB_IS_TIMESTEP for an example. - -#define NETLIB_TIMESTEPI() \ - public: virtual void timestep(timestep_type ts_type, nl_fptype step) noexcept override - -/// \brief Used to implement the body of the time stepping code. -/// -/// Used when the implementation is outside the class definition -/// -/// Please see \ref NETLIB_IS_TIMESTEP for an example. -/// -/// \param cname Name of object as given to \ref NETLIB_OBJECT -/// -#define NETLIB_TIMESTEP(cname) \ - void NETLIB_NAME(cname) :: timestep(timestep_type ts_type, nl_fptype step) noexcept - -#define NETLIB_DELEGATE(name) nldelegate(&this_type :: name, this) - -#define NETLIB_UPDATE_TERMINALSI() virtual void update_terminals() noexcept override -#define NETLIB_HANDLERI(name) void name() noexcept -#define NETLIB_UPDATE_PARAMI() virtual void update_param() noexcept override -#define NETLIB_RESETI() virtual void reset() override - -#define NETLIB_SUB(chip) nld_ ## chip -#define NETLIB_SUB_UPTR(ns, chip) device_arena::unique_ptr< ns :: nld_ ## chip > - -#define NETLIB_HANDLER(chip, name) void NETLIB_NAME(chip) :: name() noexcept - -#define NETLIB_RESET(chip) void NETLIB_NAME(chip) :: reset(void) - -#define NETLIB_UPDATE_PARAM(chip) void NETLIB_NAME(chip) :: update_param() noexcept - -#define NETLIB_UPDATE_TERMINALS(chip) void NETLIB_NAME(chip) :: update_terminals() noexcept +#include "core/device_macros.h" +#include "core/devices.h" //============================================================ // Namespace starts @@ -192,89 +33,6 @@ class NETLIB_NAME(name) : public delegator_t<base_device_t> namespace netlist { - namespace devices - { - // ----------------------------------------------------------------------------- - // mainclock - // ----------------------------------------------------------------------------- - - NETLIB_OBJECT(mainclock) - { - NETLIB_CONSTRUCTOR(mainclock) - , m_Q(*this, "Q") - , m_freq(*this, "FREQ", nlconst::magic(7159000.0 * 5)) - { - m_inc = netlist_time::from_fp(plib::reciprocal(m_freq()*nlconst::two())); - } - - NETLIB_RESETI(); - - NETLIB_UPDATE_PARAMI() - { - m_inc = netlist_time::from_fp(plib::reciprocal(m_freq()*nlconst::two())); - } - - public: - logic_output_t m_Q; // NOLINT: needed in core - netlist_time m_inc; // NOLINT: needed in core - private: - param_fp_t m_freq; - }; - } // namespace devices - - - // ----------------------------------------------------------------------------- - // power pins - not a device, but a helper - // ----------------------------------------------------------------------------- - - /// \brief Power pins class. - /// - /// Power Pins are passive inputs. Delegate noop will silently ignore any - /// updates. - - class nld_power_pins - { - public: - using this_type = nld_power_pins; - - explicit nld_power_pins(device_t &owner) - : m_VCC(owner, owner.logic_family()->vcc_pin(), NETLIB_DELEGATE(noop)) - , m_GND(owner, owner.logic_family()->gnd_pin(), NETLIB_DELEGATE(noop)) - { - } - - // Some devices like the 74LS629 have two pairs of supply pins. - explicit nld_power_pins(device_t &owner, - const pstring &vcc, const pstring &gnd) - : m_VCC(owner, vcc, NETLIB_DELEGATE(noop)) - , m_GND(owner, gnd, NETLIB_DELEGATE(noop)) - { - } - - const analog_input_t &VCC() const noexcept - { - return m_VCC; - } - const analog_input_t &GND() const noexcept - { - return m_GND; - } - - private: - void noop() { } - analog_input_t m_VCC; - analog_input_t m_GND; - }; - - namespace devices - { - inline NETLIB_RESET(mainclock) - { - m_Q.net().set_next_scheduled_time(exec().time()); - } - } // namespace devices - - extern template struct state_var<std::uint8_t>; extern template struct state_var<std::uint16_t>; extern template struct state_var<std::uint32_t>; @@ -322,14 +80,4 @@ namespace netlist } // namespace netlist -namespace plib -{ - template<typename X> - struct ptype_traits<netlist::state_var<X>> : ptype_traits<X> - { - }; -} // namespace plib - - - #endif // NLBASE_H_ diff --git a/src/lib/netlist/nl_errstr.h b/src/lib/netlist/nl_errstr.h index 67510fbf453..c0097cadb15 100644 --- a/src/lib/netlist/nl_errstr.h +++ b/src/lib/netlist/nl_errstr.h @@ -43,6 +43,7 @@ namespace netlist PERRMSGV(MF_UNEXPECTED_NETLIST_END, 0, "Unexpected NETLIST_END") PERRMSGV(MF_UNEXPECTED_END_OF_FILE, 0, "Unexpected end of file, missing NETLIST_END") PERRMSGV(MF_UNEXPECTED_NETLIST_START, 0, "Unexpected NETLIST_START") + PERRMSGV(MF_UNEXPECTED_NETLIST_EXTERNAL, 0, "Unexpected NETLIST_EXTERNAL within a netlist") PERRMSGV(MF_EXPECTED_NETLIST_START_1, 1, "Expected NETLIST_START but got {1}") PERRMSGV(MF_EXPECTED_IDENTIFIER_GOT_1, 1, "Expected an identifier, but got {1}") PERRMSGV(MF_EXPECTED_COMMA_OR_RP_1, 1, "Expected comma or right parenthesis but found <{1}>") diff --git a/src/lib/netlist/nl_parser.cpp b/src/lib/netlist/nl_parser.cpp index 8edecb84a3a..f86b3d129eb 100644 --- a/src/lib/netlist/nl_parser.cpp +++ b/src/lib/netlist/nl_parser.cpp @@ -47,6 +47,8 @@ parser_t::parser_t(nlparse_t &setup) m_tok_SUBMODEL = m_tokenizer.register_token("SUBMODEL"); m_tok_NETLIST_START = m_tokenizer.register_token("NETLIST_START"); m_tok_NETLIST_END = m_tokenizer.register_token("NETLIST_END"); + m_tok_NETLIST_EXTERNAL = m_tokenizer.register_token("NETLIST_EXTERNAL"); + m_tok_EXTERNAL_SOURCE = m_tokenizer.register_token("EXTERNAL_SOURCE"); m_tok_TRUTHTABLE_START = m_tokenizer.register_token("TRUTHTABLE_START"); m_tok_TRUTHTABLE_END = m_tokenizer.register_token("TRUTHTABLE_END"); m_tok_TT_HEAD = m_tokenizer.register_token("TT_HEAD"); @@ -75,7 +77,7 @@ void parser_t::parse_tokens(plib::psource_t::stream_ptr &&strm, token_store &tok m_tokenizer.append_to_store(&u8reader, tokstor); } -bool parser_t::parse(token_store &tokstor, const pstring &nlname) +bool parser_t::parse(const token_store &tokstor, const pstring &nlname) { set_token_source(&tokstor); @@ -134,6 +136,14 @@ bool parser_t::parse(token_store &tokstor, const pstring &nlname) m_cur_local->push_back(token_t(m_tok_paren_right)); in_nl = true; } + else if (token.is(m_tok_NETLIST_EXTERNAL)) + { + if (in_nl) + error (MF_UNEXPECTED_NETLIST_EXTERNAL()); + require_token(m_tok_paren_left); + token_t name = get_token(); + require_token(m_tok_paren_right); + } else if (!in_nl) { if (!token.is(m_tok_static)) @@ -179,13 +189,17 @@ void parser_t::parse_netlist(const pstring &nlname) net_include(); else if (token.is(m_tok_LOCAL_SOURCE)) net_local_source(); + else if (token.is(m_tok_EXTERNAL_SOURCE)) + net_external_source(); else if (token.is(m_tok_TRUTHTABLE_START)) net_truthtable_start(nlname); else if (token.is(m_tok_LOCAL_LIB_ENTRY)) { require_token(m_tok_paren_left); + pstring name(get_identifier()); + register_local_as_source(name); // FIXME: Need to pass in parameter definition FIXME: get line number right - m_setup.register_lib_entry(get_identifier(), "", plib::source_location("parser: " + nlname, 1)); + m_setup.register_lib_entry(name, "", plib::source_location("parser: " + nlname, 1)); require_token(m_tok_paren_right); } else if (token.is(m_tok_NET_REGISTER_DEV)) @@ -321,6 +335,28 @@ void parser_t::net_local_source() pstring name(get_identifier()); require_token(m_tok_paren_right); + register_local_as_source(name); +} + +void parser_t::register_local_as_source(const pstring &name) +{ + auto p = m_local.find(name); + if (p != m_local.end()) + { + printf("found %s\n", name.c_str()); + m_setup.register_source<source_token_t>(name, p->second); + } + else + printf("argh %s\n", name.c_str()); +} + +void parser_t::net_external_source() +{ + // This directive is only for hardcoded netlists. Ignore it here. + require_token(m_tok_paren_left); + pstring name(get_identifier()); + require_token(m_tok_paren_right); + } void parser_t::net_alias() diff --git a/src/lib/netlist/nl_parser.h b/src/lib/netlist/nl_parser.h index c552663af6a..5e00c7c8470 100644 --- a/src/lib/netlist/nl_parser.h +++ b/src/lib/netlist/nl_parser.h @@ -26,7 +26,7 @@ namespace netlist parser_t(nlparse_t &setup); bool parse(plib::psource_t::stream_ptr &&strm, const pstring &nlname); - bool parse(token_store &tokstor, const pstring &nlname); + bool parse(const token_store &tokstor, const pstring &nlname); void parse_tokens(plib::psource_t::stream_ptr &&strm, token_store &tokstor); protected: @@ -44,12 +44,16 @@ namespace netlist void net_submodel(); void net_include(); void net_local_source(); + void net_external_source(); void net_register_dev(); void net_truthtable_start(const pstring &nlname); void verror(const pstring &msg) override; private: + void register_local_as_source(const pstring &name); + pstring stringify_expression(token_t &tok); + token_id_t m_tok_paren_left; token_id_t m_tok_paren_right; token_id_t m_tok_comma; @@ -65,8 +69,10 @@ namespace netlist token_id_t m_tok_NET_REGISTER_DEV; token_id_t m_tok_NETLIST_START; token_id_t m_tok_NETLIST_END; + token_id_t m_tok_NETLIST_EXTERNAL; token_id_t m_tok_SUBMODEL; token_id_t m_tok_INCLUDE; + token_id_t m_tok_EXTERNAL_SOURCE; token_id_t m_tok_LOCAL_SOURCE; token_id_t m_tok_LOCAL_LIB_ENTRY; token_id_t m_tok_TRUTHTABLE_START; diff --git a/src/lib/netlist/nl_setup.cpp b/src/lib/netlist/nl_setup.cpp index aed7a509d5e..3abc9b1bc75 100644 --- a/src/lib/netlist/nl_setup.cpp +++ b/src/lib/netlist/nl_setup.cpp @@ -5,7 +5,6 @@ #include "analog/nld_twoterm.h" #include "core/setup.h" #include "devices/nlid_proxy.h" -#include "devices/nlid_system.h" #include "devices/nlid_truthtable.h" #include "nl_base.h" #include "nl_factory.h" @@ -13,6 +12,7 @@ #include "nl_setup.h" #include "plib/penum.h" #include "plib/putil.h" +#include "plib/pstonum.h" #include "solver/nld_solver.h" @@ -352,8 +352,15 @@ namespace netlist return false; } + bool nlparse_t::parse_tokens(const parser_t::token_store &tokens, const pstring &name) + { + parser_t parser(*this); + return parser.parse(tokens, name); + } + bool nlparse_t::parse_stream(plib::psource_t::stream_ptr &&istrm, const pstring &name) { +#if 0 auto key = istrm.filename(); if (m_source_cache.find(key) != m_source_cache.end()) @@ -374,6 +381,18 @@ namespace netlist parser.parse_tokens(plib::psource_t::stream_ptr(std::move(abc), key), st); return parser.parse(st, name); } +#else + plib::ppreprocessor y(m_includes, &m_defines); + y.process(std::move(istrm), istrm.filename()); + + auto abc = std::make_unique<std::stringstream>(); + plib::copystream(*abc, y); + + parser_t::token_store st; + parser_t parser(*this); + parser.parse_tokens(plib::psource_t::stream_ptr(std::move(abc), istrm.filename()), st); + return parser.parse(st, name); +#endif } void nlparse_t::add_define(const pstring &defstr) @@ -1712,8 +1731,10 @@ source_file_t::stream_ptr source_pattern_t::stream(const pstring &name) { pstring filename = plib::pfmt(m_pattern)(name); auto f = std::make_unique<plib::ifstream>(plib::filesystem::u8path(filename)); + printf("checking <%s> %s\n", name.c_str(), filename.c_str()); if (f->is_open()) { + printf("found\n"); return stream_ptr(std::move(f), filename); } else @@ -1738,5 +1759,22 @@ source_proc_t::stream_ptr source_proc_t::stream(const pstring &name) return stream_ptr(); } +bool source_token_t::parse(nlparse_t &setup, const pstring &name) +{ + if (name == m_name) + { + auto ret = setup.parse_tokens(m_store, name); + return ret; + } + + return false; +} + +source_proc_t::stream_ptr source_token_t::stream(const pstring &name) +{ + plib::unused_var(name); + return stream_ptr(); +} + } // namespace netlist diff --git a/src/lib/netlist/nl_setup.h b/src/lib/netlist/nl_setup.h index 31fad70a746..964cb0d19d2 100644 --- a/src/lib/netlist/nl_setup.h +++ b/src/lib/netlist/nl_setup.h @@ -83,6 +83,9 @@ void NETLIST_NAME(name)(netlist::nlparse_t &setup) \ #define LOCAL_SOURCE(name) \ setup.register_source_proc(# name, &NETLIST_NAME(name)); +#define EXTERNAL_SOURCE(name) \ + setup.register_source_proc(# name, &NETLIST_NAME(name)); + // FIXME: Need to pass in parameter definition #define LOCAL_LIB_ENTRY_1(name) \ LOCAL_SOURCE(name) \ @@ -230,6 +233,7 @@ namespace netlist // FIXME: used by source_t - need a different approach at some time bool parse_stream(plib::psource_t::stream_ptr &&istrm, const pstring &name); + bool parse_tokens(const parser_t::token_store &tokens, const pstring &name); template <typename S, typename... Args> void add_include(Args&&... args) diff --git a/src/mame/ci.lst b/src/mame/ci.lst new file mode 100644 index 00000000000..b6bf8c4f9e0 --- /dev/null +++ b/src/mame/ci.lst @@ -0,0 +1,41 @@ +// license:BSD-3-Clause +// copyright-holders:Aaron Giles +/****************************************************************************** + + ci.lst + + List of all enabled drivers in the system. This file is parsed by + makelist.exe, sorted, and output as C code describing the drivers. + +******************************************************************************/ + +robby // (c) 1981 Bally Midway +gridlee // [1983 Videa] prototype - no copyright notice +alienar // (c) 1985 Duncan Brown + +carpolo // (c) 1977 Exidy +sidetrac // (c) 1979 Exidy +targ // (c) 1980 Exidy +spectar // (c) 1980 Exidy +teetert // (c) 1982 Exidy +hardhat // (c) 1982 +fax // (c) 1983 +fax2 // (c) 1983 +circus // (c) 1977 Exidy +robotbwl // (c) 197? Exidy +crash // (c) 1979 Exidy +ripcord // (c) 1979 Exidy +starfire // (c) 1979 Exidy +starfirea // (c) 1979 Exidy +fireone // (c) 1979 Exidy +starfir2 // (c) 1979 Exidy +victory // (c) 1982 +victorba // (c) 1982 +topgunnr // (c) 1986 + +looping // (c) 1982 Video Games GMBH +supertnk // (c) 1981 VIDEO GAMES GmbH, W.-GERMANY + +wrally // (c) 1993 - Ref 930705 + +kinst // (c) 1994 Rare diff --git a/src/mame/drivers/cischeat.cpp b/src/mame/drivers/cischeat.cpp index a2abe98a73b..aa276fa8806 100644 --- a/src/mame/drivers/cischeat.cpp +++ b/src/mame/drivers/cischeat.cpp @@ -626,6 +626,24 @@ void cischeat_state::scudhamm_map(address_map &map) /************************************************************************** Arm Champs II + +The Arm Champs II start-up arm movement and info +--------------------------------------------------------------------- +At power-on, the arm moves left, then right then to center and stops. +The center position is 0000. +Note when the arm is at 0000 (center) the center limit switch is not +on. It comes on when the arm is moved just off center (+-0002 or greater +away from center) and stays on as long as the arm is not on +0001-0000-FFFF (both left and right side). When the arm hits the +left/right limit, both center and that left or right limit switch is on. + +Full movement to left limit switch is 0000-0040 (0x41h) and full right +limit switch movement is 0000-FFC2 (0x3eh). Obviously the pot and arm +are not 100% accurate and there's a small amount of slop between the +arm shaft / motor mechanism and the pot. +The limit switches are triggered just before the full movement. +For the purpose of MAME emulation it can be rounded off so both sides +move +- 0x40h. **************************************************************************/ uint16_t armchamp2_state::motor_status_r() diff --git a/src/mame/drivers/progolf.cpp b/src/mame/drivers/progolf.cpp index 6c4ed583be6..7ef19a14771 100644 --- a/src/mame/drivers/progolf.cpp +++ b/src/mame/drivers/progolf.cpp @@ -48,7 +48,8 @@ DE-0087A-0 (bottom side) Notes: 6502 Clock - 441.458333kHz [10.595/24] AY3-8910 Clock - 1.324375MHz [10.595/8] (both) - MK4118 - MOSTEK MK4118 1kx8 SRAM + MK4118 - MOSTEK MK4118 1kx8 SRAM (also seen 6116 and M58725 on other + PCBs which are both 2kx8 SRAM) DSW1/2 - 8-position DIP Switch TA75558 - Toshiba TA75558 Dual Operational Amplifier C1181H - NEC uPC1181H Power AMP @@ -572,11 +573,11 @@ ROM_START( progolfa ) ROM_LOAD( "g2-m.a6", 0xd000, 0x1000, CRC(fafec36e) SHA1(70880d6f9b11505d466f36c12a43361ee2639fed) ) ROM_LOAD( "g1-m.a8", 0xe000, 0x1000, CRC(749032eb) SHA1(daa356b2c70bcd8cdd0c4df4268b6158bc8aae8e) ) ROM_LOAD( "g0-m.a9", 0xf000, 0x1000, CRC(a03c533f) SHA1(2e0006be40e32b64b1490bd339d9fc9302eee7c4) ) - // the following single byte patch gets the ball position to be correct like in the parent. TODO: verify g3-m.a4 dump + // the following single byte patch gets the ball position to be correct like in the parent. g3-m.a4 dump has been verified on multiple PCBs // ROM_FILL( 0xc14b, 0x01, 0xf0) // from: EB 07 sbc #$07 to: F0 07 beq $c154 ROM_REGION( 0x10000, "audiocpu", 0 ) - ROM_LOAD( "g5-m.b1", 0xf000, 0x1000, CRC(0c6fadf5) SHA1(9af2c2152b339cadab7aff0b0164d4431d2558bd) ) + ROM_LOAD( "g6-m.b1", 0xf000, 0x1000, CRC(0c6fadf5) SHA1(9af2c2152b339cadab7aff0b0164d4431d2558bd) ) ROM_REGION( 0x3000, "gfx1", 0 ) ROM_LOAD( "g7-m.a8", 0x0000, 0x1000, CRC(16b42975) SHA1(29268a8a660781ff0de77b3b1bfc16edff7be134) ) @@ -592,5 +593,5 @@ ROM_END // this uses DECO222 style encryption GAME( 1981, progolf, 0, progolf, progolf, progolf_state, empty_init, ROT270, "Data East Corporation", "18 Holes Pro Golf (set 1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -// this uses DECO CPU-6 as custom module CPU (the same as Zoar, are we sure? our Zoar has different encryption, CPU-7 style) +// this uses DECO CPU-6 as custom module CPU GAME( 1981, progolfa, progolf, progolfa, progolf, progolf_state, empty_init, ROT270, "Data East Corporation", "18 Holes Pro Golf (set 2)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/shine.cpp b/src/mame/drivers/shine.cpp index 44a4d5a1076..ca3ec3e52a6 100644 --- a/src/mame/drivers/shine.cpp +++ b/src/mame/drivers/shine.cpp @@ -40,7 +40,7 @@ public: , m_speaker(*this, "speaker") , m_cass(*this, "cassette") , m_irqs(*this, "irqs") - , m_y(*this, "Y%u", 0) + , m_y(*this, "Y%u", 0U) , m_video_ram(*this, "video_ram") { } @@ -70,7 +70,7 @@ private: required_shared_ptr<uint8_t> m_video_ram; /* keyboard state */ - int m_keylatch; + u8 m_keylatch; }; @@ -258,6 +258,7 @@ void shine_state::shine(machine_config &config) m_via[0]->readpa_handler().set(FUNC(shine_state::via0_pa_r)); m_via[0]->writepb_handler().set(FUNC(shine_state::via0_pb_w)); m_via[0]->irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<0>)); + m_via[0]->cb2_handler().set([this] (bool state) { m_speaker->level_w(state); }); VIA6522(config, m_via[1], 1000000); m_via[1]->irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<1>)); @@ -286,4 +287,4 @@ ROM_END /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ -COMP( 1983, shine, 0, 0, shine, shine, shine_state, empty_init, "Lorenzon Elettronica", "Shine/1", MACHINE_NOT_WORKING ) +COMP( 1983, shine, 0, 0, shine, shine, shine_state, empty_init, "Lorenzon Elettronica", "Shine/1", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) |