Certain things are not considered "creative works" under copyright law,
making them ineligible for copyright protection. This includes pinouts
(facts), descriptions of circuits (utilitarian), integrated circuit
lithography masks (utilitarian, but there's a separate field of IP law
protecting them), and character shapes (utilitarian).
However, many of these descriptions are substantial enough to be treated
creative works. A number of them include suggested applications. There
are situations where reproducing the descriptions may be permitted, for
example:
* The publisher may permit reproducing the entire datasheet for
reference.
* In some jurisdictions, fair use doctrine may allow the description to
be quoted in its entirety in a larger creative work (e.g. in a
research paper, patent application, or an original description of a
circuit utilising the device).
* Some jurisdictions allow reproduction of no more than 50% of a
creative work for inclusion in teaching materials.
I am not confident that these soure code comments qualify as a situation
where the long-form descriptions can be copied verbatim lawfully,
especially without reproducing copyright notices for them. If you want
long form plain language descriptions in the comments, you need to write
them yourself. That way, you will be the copyright holder of the
creative work, and you can make it availble under a permissive or
"copyleft" license.
* also made nld_devinc.h srcclean friendly.
* nld_devinc.h and lib_entries.hxx are currently not used. You can try
the automated build by changing NL_AUTO_DEVICES in setup.h to 1.
* removed include directory src/lib/netlist from various genie files to
avoid potential issues.
* Code using netlist should use #include "netlist/*".
* Updated includes.
* Fixed standalone makefile depend target to properly deal with relative
paths.
* On windows a simple make is now enough to build.
* Devices, macro and tests folders now included with wildcard.
* No more makefile changes if a device is added.
* Moved nld_devinc.h to generated folder
* Added to python scripts to create nld_devinc.h and lib_entries.hxx
* TEST MODE: these two files are created automatically but are not used
currently. Once I get feedback that the python scripts work in different
environments I will remove header files from devices and macro and start
using these files in production.
* Exposing sub-device members is not best practice.
* The need for sub-devices is a clear indication that a netlist language
implementation would be a better solution.
Sound and other improvements to Sega G-80 games: [Aaron Giles, couriersud]
* Added netlist-based sound to Eliminator, Zektor, Space Fury, and Astro Blaster.
* Split the Sega Universal Sound Board and Speech Boards into their own separate files.
* Improved Universal Sound Board implementation for better accuracy in Star Trek and Tac/Scan.
* Wrote netlist-based backend for Universal Sound Board; currently disabled due to limitations in the system.
* Wrote netlist-based backend for Speech Board; currently disabled pending future sound system changes.
* Implemented wait states and the vector DRAW flag to help improve timing.
SP0250 Improvements: [Aaron Giles]
* Matched clock divider to real chip measurements.
* Fixed behavior when not fed enough data; addresses "gapping" in speech in Sega games.
* Implemented accurate LFR noise generator according to real chip measurements.
* Added pulse-width modulation DAC output mode for future consumption by netlist.
Netlist additions: [Aaron Giles]
* Added compile-time option to record nltool-compatible CSV files.
* Improved CD4020 implementation.
* Fixed CD4053 behavior.
* Added 74139 device.
* Added TL082 device.
8253 PIT changes: [Aaron Giles]
* Added explicit synchronization to all writes.
* Cleaned up some timing calculations to avoid double<->attotime conversions.
* moved dead code into examples/lostfound.cpp
* This work didn't improve performance but still may serve as examples
for complex truth table implementations.
* sspeedr: new netlist audio implementation
Netlist-based audio implementation for sspeedr (Super Speed Race, 1979)
derived from Midway audio schematics, and based on that used for
280zzzap (280-ZZZAP) and lagunar (Laguna Racer) in the mw8080bw driver.
The Super Speed Race audio circuits are clearly derived from those games;
the biggest difference is the use of a linear feedback shift register
for noise generation.
* Updated netlist static solvers with recent netlist changes.
* Each parameter to set now has a dedicated buffered_param_setter
device.
* This allows different sample times per device
* Updated netlist.cpp for new approach
* buffered_param_setter is a template. The template parameter is a class
which is expected to support the [] operator. The value passed to []
operator is the requested sample number.
Added Laguna Racer to the 280-ZZZAP netlist audio driver, with
conditional changes to the netlist for the circuitry differences
between the two games.
Adjust some netlist components that apparently changed from the
280-ZZZAP schematic to production machines.
Removed the driver's private MC3340 netlist, using the equivalent
one in the netlist library instead.
* Separated tokenizing and reading of tokens.
* This enables caching of parsing results on the token level.
* Implemented caching of token stream.
* Overall this significantly improves parsing performance (~10x)
* Next step towards a bare-bone nltool which does not depend on macro
devices.
* Header files will disappear and only nld_devinc.h which is can be
created by nltool will stay.
* These commits ensure that the documentation is preserved when the
header files are deleted at some point in the future
* Updated 7450, 7473/7473A, 7474, 7475/7477 devices to use DIP macros
instead of C++ DIPs.
* Reworked 7475/7477 more in the style of 7474, leveraging system signal
activation and edge detection.
* Move DIPs for 82S16, 82S115, and 2102A devices into nlm_proms
* Moved 7448 DIP to a macro. Replaced 7442 with truthtable and macro.
* Moved 74LS629 DIP into macro.
* Expand truthtable to handle 10 outputs.
Add legacy floppy image support which is currently required for the
mc6843 FDC emulator and used by the EXORset which run XDOS a variant
of MDOS.
Add support for 5.25 inch XDOS floppy drive formats as used by the
EXORset.
Make some of the identity tests more permissive to work with observer
disks. The date day and month are reversed on some disks, and the boot
rib cluster is lower.
* Example: PARAM(Solver.Solver_0.METHOD, "GMRES")
* Will use the GMRES solver instead of the default MAT_CR solver.
* Same applies to all Solver parameters.
* Please use with care. If you change your netlist (e.g. using
frontiers) the allocation of nets to solvers and the number of solvers
may change. Thus this type of tweaking should only be used after the
netlist completely works.
* The GMRES solver for larger matrices (>>100) can outperform Gaussian
elimination. Including it so it gets wider attention.
* As far as I know netlist is the only SPICE-like circuit simulation
providing a GMRES solver.
* All solver scheduling is now handled by nld_solver.
* Previously, for dynamic timestepping the sub solvers would be
responsible for their scheduling themselves.
- This prevented any attemps to use parallel execution of solvers.
* Now the route is free towards experiments to use parallel execution of
solvers.
* Uses ptimed_queue_linear in solver scheduling
* Improved netlist queue implementation (template now)
* Added const delegates.
* Added subsolver stats
* Removed dead code.
mw8080bw: improvements to 280zzzap netlist audio
* Noise-based sound effects corrected. The original strength of the
zener noise voltage was about three orders of magnitude too low
for the current being passed through a zener of this type. This
prevented the noise generator from working as designed and made
the noise far too weak for the noise-based sound effects to work
properly. Those effects now sound much closer to the real hardware.
* Implemented faster high-level emulation version of noise generator.
(Credit to couriersud for suggesting this.) The corrected noise
voltage made the component-level emulation of the noise generator
much too demanding on the minimum timestep needed to produce
accurate results without unrealistic voltage spikes, and so will
not run accurately at reasonable emulation speeds. But by replacing
it with a simple but effective AFUNC()-based comparator, we get a
functionally similar noise signal generator that produces
effectively identical output while still being able to run with
48 kHz static timestepping. So we get both decent emulation speed
and correct-sounding noise effects.
* Added output voltage clipping on post-crash sound to remove
voltage spikes, resulting in a smoother, more accurate sound.
(Credit to Aaron Giles for suggesting this clipping method.)
* Changed output to be taken from second LM3900 output opamp
(inverted signal) for smoother waveform and better tone quality.
* Added master volume potentiometer which can be user-set, set to
midpoint by default. Adjusted output scaling and offset to match.
* Various explanatory comments expanded or corrected.
* Added netlist simulations for the following games: Space War, Barrier, Star Hawk, Speed Freak, Star Castle, War of the Worlds, Sundance, Tail Gunner, Rip Off, Armor Attack, Warrior, Solar Quest, Boxing Bugs. Removed previous samples-based sound. [Aaron Giles, Couriersud]
* Added built-in minimal artwork for Warrior. [Aaron Giles]
* Changed speaker maximum sample tracking to be based on new compile-time define SPEAKER_TRACK_MAX_SAMPLE instead of MAME_DEBUG. [Aaron Giles]
* Modernized 74164 and 74393 netlist TTL devices. [Aaron Giles]
* Removed update and NETLIB_UPDATE completely.
* Startup initialization order may change.
* This may cause regression tests to trigger. This is expected. Logic
TTL devices do not have a defined power-up state. That's why reset
circuits exist which create a reset signal *after* all power supply
lines are stable.
Model for transistors adjusted, replacing default NPN transistor
model with a high-gain NPN transistor type that more closely
resembles those used by the real Gun Fight sound circuits. This
has a quite obvious effect on the shot sounds, and it seems the
circuits were designed for this effect.
Made all volume potentiometers user-adjustable; previously fixed
at 50%.
Replaced abstract model of noise generator with component-level
one, including a model of the generator's zener diode. Zener
noise is provided by an associated Gaussian white noise source
running off a 48 kHz clock. Both the zener diode and Gaussian
white noise source are component models recently added to the
netlist library.
Supply voltage to amplifying transistors tweaked downward from
16.5 volts to 16 volts, determined by properly analyzing power
supply circuit and confirmed with a documented reference.
Much more commentary describing the sound circuits' function and
modeling issues.
If TRIG and TRESH are connected overshoot compensation will be enabled.
The approach is raw but delivers results (at 5 to 10 steps per
discharge/charge) within a couple of percent. Please take into account
that any datasheet formulas are idealistic. Neither capacitor, resistor,
internal resistor tolerances are taken into account. Nor are ambient
temperature and chip temperature.
* Currently devices use the "update" function if no handler is given for
an input.
* For this to work the update function has to be virtual. This will
cause issues on shared execution schemes like CPU/GPU using nvcc.
* This is the first batch of changes to ensure that handler resolution
is static.
* For truthtable cmos devices the power pin names will now be set
according to the logic family.
* Fix some issues for CD4538
* Change "already connected" warning to info level. Some ICs (CD4538)
connect pins internally to GND and the schematics again externally. This
will cause this info to be printed. The warning now is a lot more
verbose.
* No changes for well-behaved netlists.
* Netlists reporting "newton loops exceeded" messages should now report
a lot less of these messages.
* In case newton-raphson does not converge, netlist will reset the state
back to the beginning of the timestep. It will than use a number of very
small timesteps to hopefully deal with the non-convergence due to a too
big timesteps. Afterwards solving continues using dynamic timestepping
until the time-slice is complete.
* This is a lot better than the previous approach.
* This is meant as a performance optimization helper. Ideally, your
netlists never produce "newton loops exceeded" messages.
* Any events for connected analog and digital inputs will happen after
the timeslice is complete. Thus this approach - as the previous one -
are not suited for high-frequency (such as video outputs) situations. In
these case, only dynamic timestepping or reducing the fixed timestep are
a suitable solution.
* Electronic circuits and base components like resistors or capacitors
do not have a reset line. You can use them to create reset circuits.
There is thus no point to support soft reset, the equivalent to pressing
the reset button.
* Fixed some bugs around reset and start up logic.
* This also fixes the "scramble F3" crash.
* Add google test syntax compatible unit testing support. This is a very
limited subset of the google test framework and not intended ever to be
a replacement. Adding a dependency to google test for the functionality
required was considered to be an overkill.
* nltool -c tests runs unit tests if linked in. This is *not* the case
for the version of nltool compiled with TOOLS=1.
* Added unit tests for plib::pfunction.
Comparison operators evaluate either into 0.0 or 1.0. Thus they can be
used like "(a==1)*(b==2)" which will only result in 1.0 if a equal 1 and
b equal 1. From the yet to be released test code:
* PFUNCEXPECT("1==1", 1.0)
* PFUNCEXPECT("1 *0 == 2-1-1", 1.0)
* PFUNCEXPECT("0!=1", 1.0)
* PFUNCEXPECT("0<1", 1.0)
* PFUNCEXPECT("1>0", 1.0)
* PFUNCEXPECT("0<=1", 1.0)
* PFUNCEXPECT("1>=0", 1.0)
* PFUNCEXPECT("1<=1", 1.0)
* PFUNCEXPECT("1>=1", 1.0)
* PFUNCEXPECT("if(1>0, 2, 0)", 2.0)
* PFUNCEXPECT("if(0>1, 2, 3)", 3.0)
* PFUNCEXPECT("if(sin(1)>0, 2, 3)", 3.0) // fail
A single missing sector was causing it to give up on an images,
as incompatible. Being a little more permissive here helps working
with some old recovered disk images with some lost sectors.
* palloc.h/pmatrix2d.h: Fix static_assert warnings at the origin.
* Rework hints to broaden their use and fix NC hint.
* 74377: use NC hint
* plists.h: Fix debugging in MSVC
* Include cleanup: Move everything not needed by netlists from
nl_setup.h into core/setup.h
* Fix some clang tidy warnings
* srcclean
* Logic and analogue outputs can now be flagged as "NC" (not connected).
* Example: "HINT(IC13.4, NC)".
* This will suppress info messages to be logged.
* The HINT must apply to an existing terminal. HINTs for non-existing
terminals are treated as fatal errors.
* Terminals and logic inputs not connected are still treated as
warnings. These need though and a proper fix.
The purpose of this ongoing exercise is to remove unnecessary
dependencies in header files. netlist implementations should only have
access to what they need. The same applies to device implementations.
Core stuff will be moved to the core subdirectory going forward.
Kidniki now achieves up to 910% when run with static solvers and with
nltool. That is significant better than the 860% we have seen
previously.
This increase is driven by using a global memory pool in the solver
code.
In addition the following refactoring and code maintenance work is
included. Please excuse the large commit, some of this took interfered
with other work and the detail development steps were ugly.
- gsl support: This commit adds pgsl.h which implements a very limited
number of the functionality of the gsl header described in the c++ core
guidelines.
- clang-tidy fixes
- A significant refactoring of palloc.h. Aligned hints were removed,
they added complexity without a significant performance gain. Vector
operations should better be done on special spans/views.
The code has been tested on linux with g++-7, g++-9, clang-11.
On Windows mingw-10 and VS2019, OSX clang-11.
Move towards a pure c++ constexpr solution to derive the optimal
pointer to member function solution.
All the macro madness is centralized to a compile_info struct with
static members.
For the time being the evaluation result is compared against the
previous approach. Going forward this will be dropped as well as the
support for MINGW with GCC <= 4.6
- more c++14, use enable_if_t instead of enable_if
- cleaned up the use of memory allocation arenas
- reduce MACRO usage, use std::conditional where possible
Factory elements can now pass additional parameters to device
constructors. This makes the design of interface objects like analog
callbacks easier.
The change also allowed to remove some "deep" calls into the core from
the MAME interface in netlist.h
* mw8080bw: update 280zzzap audio API in preparation for netlist audio
This is only API changes, following the pattern used by cuavas within the
past year to update other games in mw8080bw.
* mw8080bw: new netlist audio implementation for 280zzzap
New netlist-based audio implementation for 280zzzap (280-ZZZAP, 1976),
derived from Midway game logic board schematic. The sound generally
matches that heard in videos of the machine, though the real machine
seems to have more bass and less treble. This may be a cabinet effect
or something else, such as a difference in component values.
Due to the number of complex components being emulated and the nature
of the circuits, this netlist adds a lot of overhead, but it's still
fast enough to run at greater than real speed on modern hardware.
With minor changes, this implementation should also support lagunar
(Laguna Racer, 1977); with somewhat more substantial changes, it
would also support sspeedr (Super Speed Race, 1979). Both of these
games use sound circuits based on those for 280-ZZZAP.
plists.h was splitted into plists.h, pmulti_threading.h and
ptimed_queue.h. In addition removed plists.h from a number of files it
wasn't used in.
Certain minor adjustment needed to be made for cuda toolkit 10.1 and
10.2.
pongf now peaks at 589% compared to 570% before.
Amongst a number of improvements in nl_base.h, the 7493 was touched.
Also has some code cleanup and hopefully faster compilation due to
extern template declarations.
For reasons unknown to me compile optimizations do not behave for
template code. If the implementation is in separate compile units, the
code compiles and performs.
This needs more attention since for certain compilers there is a
considerable performance degregation. It looks like this is only
triggered if too many variants are declared in one cpp file and the
compiler stops inlining.
Rom and prom devices now properly support tristate outputs. Native OC
output still on the todo list.
In addition this commit fixes a number of bugs around dealing with macro
level parameters and improves documentation by adding a parameter table.
Also srcclean.
This change will make it a lot easier to add enhanced functionality to
the factory infrastructure.
Using integral constants also improves linking stability.
During object creation netlist tracks the source files which provide
object creation. This is later used e.g. by nltool to create
documentation from source.
These tristate buffers natively support tristate outputs. For use cases
with fixed enable inputs the devices support a parameter
FORCE_TRISTATE_LOGIC which if being set to 1 makes the device behave
like a logic output.
Added additional syntax and consistency checks for tristate outputs.
Updated the example and added dip implementations including
documentation.