Commit Graph

2787 Commits

Author SHA1 Message Date
couriersud
f873cbcbad netlist: another batch of explicit handler refactoring. 2020-07-12 16:44:13 +02:00
couriersud
985c0225d1 netlist: next batch of explicit handlers. 2020-07-12 16:44:12 +02:00
couriersud
0fd8742bbb netlist: emit a warning every 100 invocations of nr resolution. 2020-07-12 12:24:54 +02:00
couriersud
2683665665 netlist: first batch of explicit handlers.
* 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.
2020-07-12 12:12:27 +02:00
couriersud
a5fc819f50 netlist: fix power pin names for CMOS devices.
* 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.
2020-07-12 12:12:26 +02:00
Aaron Giles
b4555c13a0 netlist: fix 74121 clocking logic. 2020-07-11 23:04:52 +02:00
couriersud
ad4a446d5f netlist: use threads on netlist logs.
* This significantly increases the performance of output/terminal logs.
* Adds a psemaphore class to pmulti_threading.h.
2020-07-11 23:03:12 +02:00
couriersud
b13aced50a netlist: improve dealing with non-convergence situations.
* 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.
2020-07-11 23:03:11 +02:00
MetalliC
fb7f6b7841 spectrum: implemented Speccy-DOS and FloppyOne DOS interfaces, add "IC-DOS" Beta Plus clone 2020-07-11 17:34:41 +03:00
Aaron Giles
647d4f431f netlist: Forgot this as part of the 74113 change. 2020-07-11 08:06:45 +02:00
Aaron Giles
a6239d582b netlist: Add 74113 device. 2020-07-10 20:04:17 +02:00
couriersud
5eef12fe18 netlist: add 74121 device and refactor 74123 code.
* added 74121 device
* migrate dip devices to netlist devices
* refactor code to be based on device description structs
2020-07-10 20:04:16 +02:00
couriersud
d3422e1c94 netlist: unit test macros now have a "P" prefix.
* will allow to use both googletest and Catch frameworks.
* on unexpected std::exception include what() in error message.
2020-07-10 20:04:15 +02:00
couriersud
4a3bc13554 netlist: fix signedness warnings in ptime.h 2020-07-10 20:04:15 +02:00
couriersud
03900b67de netlist: remove some warning suppression from makefile. 2020-07-10 20:04:14 +02:00
couriersud
8d9fde525d netlist: pfunction supports unary minus and removed duplicate code. 2020-07-10 20:04:13 +02:00
couriersud
c4b9b2a3ac netlist: update documenation on noise sources. 2020-07-05 21:50:54 +02:00
couriersud
d71717e75b netlist: pfunction now supports unary minus operators. 2020-07-05 21:50:53 +02:00
couriersud
e339a280f4 netlist: remove soft reset support.
* 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.
2020-07-05 15:49:59 +02:00
couriersud
9e86f5e866 netlist: Add basic unit testing support.
* 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.
2020-07-05 11:48:07 +02:00
68bit
e2b6f6edb0 mdos dsk: fix the cells size and gaps, make clear its Motorola MDOS 2020-07-04 21:42:16 +10:00
couriersud
207fd27e8c netlist: Fix polarity of 74LS125 tristate input. 2020-07-04 10:22:01 +02:00
couriersud
bdc1bb4778 netlist: fix pfunction if
The if postfix evaluation corrupted the stack.
2020-07-04 09:28:49 +02:00
couriersud
edab7d1a40 netlist: add progress indicator to nltool.
When running a netlist "--progress" may be used to display a progress
indicator.
2020-07-04 09:24:30 +02:00
couriersud
f6e9386745 netlist: add more constructors and () operator to pfunction. 2020-07-03 20:36:59 +02:00
Aaron Giles
0718a20df2 netlist: Align design VARCLOCK to AFUNC. 2020-07-03 20:36:59 +02:00
Aaron Giles
fa54fa1b65 netlist: Add a parameter to varclock. 2020-07-03 20:36:58 +02:00
Aaron Giles
0eccd6adc7 netlist: Add log() to pfunction. 2020-07-03 20:36:57 +02:00
couriersud
fb90cac2f2 netlist: Add comparison operators to 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
2020-07-02 21:29:25 +02:00
ajrhacker
50887a1b08
Merge pull request #6896 from 68bit/os9-8inch-16sectors
os9 dsk: add 8 inch, 16 sector, single density formats
2020-07-02 13:55:53 -04:00
ajrhacker
10208ebd88
Merge pull request #6897 from 68bit/motorola-mdos-dsk
MDOS disk format support
2020-07-02 13:55:06 -04:00
68bit
58a414675a wd177x dsk: be permissive of some missing sectors in later tracks
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.
2020-07-03 00:26:32 +10:00
68bit
d5187fe74c MDOS disk format support
Motorola DOS, used on the EXORciser etc.
2020-07-03 00:16:35 +10:00
68bit
3dfce5b66a os9 dsk: add 8 inch, 16 sector, single density formats
These formats were by OS9 L1 on the Motorola EXORciser.
2020-07-03 00:05:00 +10:00
couriersud
319be2dfd2 netlist: code maintenance and bug fixes.
* 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
2020-07-01 20:59:04 +02:00
Aaron Giles
afb3a9b6cb Fix crash on Windows when freeing netlist objects. 2020-06-29 17:03:57 -07:00
couriersud
1408aab30c netlist: add hints for outputs not connected. [Couriersud, Aaron Giles]
* 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.
2020-06-28 16:55:34 +02:00
couriersud
e6d7db27cf netlist: Fix parameter value resolution on rom devices.
* also simplifiy a return.
* document parameter value resolution.
2020-06-28 14:21:36 +02:00
couriersud
d7cbe855aa netlist: fix 74377 pin assignment 2020-06-28 13:14:44 +02:00
couriersud
ab31af569f netlist: include file refactoring.
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.
2020-06-28 13:14:43 +02:00
couriersud
3fcdfa0a9b netlist: code maintenance
* decrease use of reinterpret_cast.
* change some defaults for better ttl game optimization.
* various code cleanup.
2020-06-28 13:14:42 +02:00
MetalliC
fc7f76dc12 this format was redundant (nw) 2020-06-22 12:43:34 +03:00
Vas Crabb
01661be41c srcclean and cleanup (nw) 2020-06-21 14:59:50 +10:00
MetalliC
5c3f020bf8 spectrum.cpp: add Didaktik D40/D80 disk interface 2020-06-21 01:51:11 +03:00
hap
63a7bbb5f2 recording: fix frame sync regression (nw) 2020-06-19 11:54:40 +02:00
AJR
a58685ec6d Fix nltool build on CWG 1579-noncompliant compilers (nw) 2020-06-18 16:47:33 -04:00
lfantoniosi
16be7cb5b7 Add ImageDisk IMD save support
Allow to save IMD floppy image disk. Tested on Zorba and Kaypro II
2020-06-13 20:16:36 -07:00
couriersud
fe3bd223d8 netlist: Fix copy elusion bug on OSX and clang < 8 [AJR, Couriersud]
Solution discussed with AJR in chat.
2020-06-14 00:04:34 +02:00
couriersud
23c0490019 netlist: fix some clang-tidy warnings. (nw) 2020-06-13 23:54:14 +02:00
AJR
0572ca886e nl_setup.cpp: Fix for some compilers not being CWG 1579 compliant (nw) 2020-06-13 17:27:49 -04:00
couriersud
e949e9c29d netlist: Performance improvement and refactoring. [Couriersud]
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.
2020-06-13 15:49:35 +02:00
couriersud
75681d760c netlist: Make fostrm actually write to file. (nw)
Also fix typos and a tidy warning.
2020-06-13 15:48:54 +02:00
couriersud
a48f64e018 netlist: Improve static solver performance by 5%. [Couriersud]
Use a more condensed matrix format for go, gt and Id matrices.
In addition, optimize the static compilation code.
2020-06-13 15:48:14 +02:00
AJR
8384a50597 Fix clang error: unknown warning group '-Wpmf-conversions', ignored [-Werror,-Wunknown-pragmas] (nw) 2020-06-08 12:13:39 -04:00
couriersud
6f24deceec netlist: fix mingw7.2 compile. (nw) 2020-06-08 12:52:57 +02:00
couriersud
773a23f503 netlist: prepare path to non-virtual update functions. (nw) 2020-06-08 03:12:03 +02:00
couriersud
ec0f62d789 netlist: further optimize ppmf.h [Couriersud]
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
2020-06-08 03:11:41 +02:00
couriersud
d041e74e2c netlist: allow selection of base arena for pmempool_arena. (nw) 2020-06-08 03:10:58 +02:00
couriersud
1c635c1bfd netlist: Fix MSVC build. [Couriersud]
MSVC has an issue with SFINAE and overloading resolution.
A discussion can be found here:

https://stackoverflow.com/questions/31062892/overloading-on-static-in-conjunction-with-sfinae

The previous code compiled with gcc and clang on all platforms and
compilers apart from MSVC. Replaced with double template specialization.
2020-06-08 03:10:27 +02:00
couriersud
bed452a874 netlist: arena code maintenance. (nw) 2020-06-08 03:10:13 +02:00
couriersud
3c6b49898b netlist: ppmf simplification. (nw) 2020-06-08 03:08:31 +02:00
couriersud
f9fa6b1c81 netlist: code maintenance. (nw)
- 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
2020-06-08 02:52:39 +02:00
couriersud
ea0f297c85 netlist: remove more macro usage, fix win float exceptions. (nw) 2020-06-06 20:43:13 +02:00
couriersud
8a1ece4a3b netlist: Reduce macro usage and make use of pstring utf8. (nw) 2020-06-06 20:43:12 +02:00
couriersud
e3901f419c netlist: code maintenance. (nw)
Fix visibility of classes in nlid_system.h.
Fix tidy warning for penum.
2020-06-06 20:43:11 +02:00
couriersud
3f9bb5d1ea netlist: Enable utf7 filenames on windows. (nw) 2020-06-06 20:43:10 +02:00
couriersud
251b11266d netlist: fix dpatrol. (nw) 2020-06-01 20:10:58 +02:00
couriersud
37258b7439 netlist: clang-tidy, header order fixes. (nw) 2020-06-01 19:59:54 +02:00
couriersud
ef11941a92 netlist: move multiparameter streaming into nl_interface.h (nw) 2020-06-01 19:59:54 +02:00
couriersud
9cd005b574 netlist: drop c++11 support. (nw)
This wasn't working since the last factory changes. Removed it.
Basically replace C14CONSTEXPR with constexpr.
2020-06-01 19:59:53 +02:00
couriersud
3fd176a7a6 netlist: device factory enhancements. (nw)
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
2020-06-01 19:59:52 +02:00
couriersud
efa12efc37 netlist: debugger - use callbacks to access terminals. (nw) 2020-06-01 19:59:52 +02:00
couriersud
215aa82cec netlist: Change use of NETLIB_DELEGATE macro. (nw)
The macro now has only one parameter, the local name of the delegate.
2020-06-01 19:59:51 +02:00
couriersud
c00dc87830 netlist: refactored ppmf.h [Couriersud]
Make more use of c++.
Prepare coexistence of different delegate types.
Untangle code.
Reduced macro usage.
2020-06-01 19:59:50 +02:00
MetalliC
eda94384f6 forgot this one (nw) 2020-05-31 10:27:33 +03:00
Colin Douglas Howell
1984fb5f94
mw8080bw: 280zzzap netlist audio (#6760)
* 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.
2020-05-30 08:36:17 -04:00
MetalliC
186b50e8df dsk_dsk.cpp: be nice and allow to use DS images with SS drives (nw) 2020-05-26 14:51:34 +03:00
MetalliC
0fe92226a8 ZX-Spectrum Beta-disc FDCs: modernize/fix FDD motor control 2020-05-26 14:50:34 +03:00
couriersud
10e4f10d41 netlist: split plists.h and fix nvcc compile for 10.2 (nw)
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.
2020-05-25 23:57:49 +02:00
couriersud
54293ab546 netlist: small memory system cleanup. (nw) 2020-05-25 23:57:49 +02:00
couriersud
e97a8709a8 netlist: code maintenance. (nw) 2020-05-25 23:57:48 +02:00
couriersud
8120e2fe0d netlist: move netlist parsing where it belongs. (nw) 2020-05-25 23:57:47 +02:00
couriersud
c432b50bda netlist: move configuration entries into netlist namespace. (nw) 2020-05-25 23:57:47 +02:00
couriersud
97244a743a netlist: improve performance. [Couriersud]
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.
2020-05-24 10:48:06 +02:00
couriersud
de615ac138 netlist: move penum into own header file. (nw) 2020-05-24 10:48:06 +02:00
couriersud
fff7f6ef55 netlist: Better integretation of INT128. (nw)
Also some minor optimisations bringing pong and breakout to previous
performance.
2020-05-24 10:48:05 +02:00
couriersud
80aeecc227 netlist: fix a memory issue. (nw)
+ cosmetic changes in nl_base.cpp and build/makefile
2020-05-24 10:48:04 +02:00
couriersud
f88a576c54 netlist: various clang-tidy-11 fixes. (nw) 2020-05-24 10:48:03 +02:00
couriersud
6141fa4a9c netlist: Fix performance issues and VC2019. [Couriersud]
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.
2020-05-22 01:15:18 +02:00
couriersud
5a43cc6432 netlist: consolidate 9316-type counters. [Couriersud]
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.
2020-05-22 01:15:18 +02:00
couriersud
dae6a396c9 netlist: fix performance decrease. (nw) 2020-05-22 01:15:17 +02:00
couriersud
e9a364dcc9 netlist: Add tristate support for rom devices. [Couriersud]
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.
2020-05-20 07:59:46 +02:00
couriersud
11af744ef3 netlist: improve syntax of generic device descriptors. (nw) 2020-05-20 07:59:00 +02:00
couriersud
40628bc269 netlist: simplify factory call structure. (nw)
This change will make it a lot easier to add enhanced functionality to
the factory infrastructure.
Using integral constants also improves linking stability.
2020-05-20 07:58:57 +02:00
AJR
383297b101 nlm_ttl74xx.cpp: Fix clang build [-Werror,-Wunused-function] (nw) 2020-05-18 14:09:42 -04:00
Aaron Giles
d1db16413c Add 7421 device. 2020-05-18 08:50:15 -07:00
Aaron Giles
c630deef6d Added missing definition. 2020-05-18 08:46:33 -07:00
Aaron Giles
fbe6b0fc0d 74S127 outputs are numbered starting at 0. 2020-05-18 08:46:14 -07:00
couriersud
a94de94c73 netlist: improve typesafety for source locations. (nw)
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.
2020-05-17 19:52:24 +02:00
couriersud
22fb995337 netlist: Add working 74125 and 74126 implementations. [Couriersud]
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.
2020-05-17 19:52:09 +02:00
couriersud
7d4bb358c8 netlist: Fix cd4013 implementation and include it in compile. (nw) 2020-05-17 02:08:51 +02:00
couriersud
7035821f87 netlist: rewrite rom devices from scratch. [Couriersud]
Thanks to Aaron Giles who made me think about a different approach.

This is a rewrite from scratch for rom devices. It uses a generic
template to implement rom devices which is used together with a
description struct to define a rom device. This leads to highly
efficient code since all information is available at compile time.

This is also a step forward to support tristate outputs. All rom devices
covered by this approach have tristate or open collector outputs and
thus all code changes to support tristate outputs can now be made
consistently in one file.
2020-05-17 01:34:16 +02:00
Frank Palazzolo
12ec6362bb netlist: Added devices CD4013, CD4069, CD4070 2020-05-15 16:14:05 -04:00
Aaron Giles
4dd350a000 netlist: Fix typo in netlist macros. (nw) 2020-05-15 13:19:44 +02:00
Aaron Giles
333329e54c netlist: Re-do the 74377/8/9 as macros. [Aaron Giles] 2020-05-15 13:11:03 +02:00
Aaron Giles
5739043ced netlist: Add 74377/74378/74379 devices to netlist. [Aaron Giles] 2020-05-15 13:10:15 +02:00
Aaron Giles
cfc3a76d04 netlist: Add support for empty #defines to preprocessor. [Aaron Giles]
Also add detection and reporting of re-definitions.
2020-05-15 13:10:12 +02:00
couriersud
88edd7c665 netlist: code cleanup and development stage tristate [Couriersud]
Code cleanup to better separate the following stages:

- parsing
- setup
- run

In addition preliminary native tristate support was added. Not yet
production ready, please don't use it.
2020-05-15 13:09:22 +02:00
couriersud
6f7f30b8a5 netlist: commit missing file (nw) 2020-05-12 19:40:11 +02:00
couriersud
faac9a2d2c netlist: Extended functionality and code cleanup. [Couriersud]
- working macro level parameters
- simplified code significantly
- fixed a number of hidden issue
- dead code removal

It is now possible to define netlist level parameters using:

static NETLIST_START(chip)
DEFPARAM(parameter, 123)
RES(R1, $(@.parameter))
....
NETLIST_END()

NETLIST_START(main)

chip(X1)
PARAM(X1.parameter, 1000)
...
NETLIST_END()

This will pass on 1000 to R1 as a parameter.

"@." will resolve to the current namespace. In this case it is X1, thus
"X1.parameter. This is during parsing. During evalution, i.e. device
creation, $(X1.parameter) is evaluated to 1000.

This also means, that global parameters are possible and accessible ...

DEFPARAM(P, 234)
...
RES(R1, $(P))

or going forward

RES(R1, 1000)
CAP(C1, 1.0 / $(R1.R))

This opens up the path to more possibilities ...

static NETLIST_START(DM9456_DIP)
DEFPARAM(MODEL, "74XX")
DM9456_GATE(X1)
DM9456_GATE(X2)
PARAM(X1.MODEL, $(@.MODEL))
PARAM(X2.MODEL, $(@.MODEL))
...
NETLIST_END()

NETLIST_START(main)

DM9456_DIP(X1)
PARAM(X1.MODEL, "LS74XX")
...
NETLIST_END()

The code also has been prepared to allow something along the lines of

LIBENTRY_MODEL(DM74LS00_DIP, DM7400_DIP, "LS74XX")

to define a LS version on top of an DM7400_DIP bare TTL implementation.
This however will need more efforts to existing devices to honour some
timing adjustment in the model definition. It will already honour
different output specifications between LS series and bare TTL if
connected to analog components.
2020-05-12 18:52:44 +02:00
couriersud
7dfb68be9d netlist: fix output stage on NE566. (nw) 2020-05-10 22:32:36 +02:00
Aaron Giles
bf43fff5d6 netlist: Added undef support to the preprocessor. [Aaron Giles] 2020-05-10 20:47:54 +02:00
couriersud
c4381db330 netlist: more family/model alignment. (nw)
Also remove dead code and dead comments.
2020-05-10 20:42:17 +02:00
couriersud
227ab3025e netlist: logic devices now support model parameter. [Couriersud]
This a big forward to allow reuse of code. Still a longer way to go
but the foundation there.

Also brings quite a number of simplifications and dead code removal.
2020-05-10 20:38:48 +02:00
couriersud
57122c7b4c netlist: provide more information for warning ... [Couriersud]
on connecting two terminals already on the same net.
2020-05-10 11:34:11 +02:00
couriersud
82a2535d38 netlist: remove family_setter and other maintenance. (nw)
- removed family_setter
- naming alignment, family becomes model.
- architecture cleanups.)
- reviewed reset logic.
- pass truthtable family as string to factory.

This is another set of changes on the path to align logic families and
models. As a side effect, the object model now makes a clear
distinction between analog models and logic models.

The number of macros in nl_base.h has decreased significantly due to
these changes.
2020-05-09 21:49:36 +02:00
couriersud
c619d86d5b netlist: Fix VCCS definition. (nw) 2020-05-08 12:07:48 +02:00
couriersud
e235420392 netlist: bug fixes and maintenace. (nw)
- nlwav: remove m_channels completely
- nltool: add more comments to static_solvers.cpp
- clang make: add -Wunused-private-field

Also updated static_solvers.cpp.
2020-05-08 08:56:50 +02:00
couriersud
c37c2b7e21 netlist: reduce usage of NETLIB_CONSTRUCTOR_DERIVED. (nw)
Reduce the usage of NETLIB_CONSTRUCTOR_DERIVED to implement
dip package objects. This aligns the programmatic approach
with the approach used in the macro folder, i.e. using netlists.

Untangle model definition and interpretation as well.

This changes are a first step in aligning models and families and thus
simplify the source further.
2020-05-08 08:45:08 +02:00
couriersud
970ca550f2 netlist: fix dependency building for nvcc build. (nw) 2020-05-08 08:45:07 +02:00
couriersud
3a4e3f2f3e netlist: move nld_power_pins to nl_base.h (nw)
This removes a large number of dependencies on nlid_system.h.
2020-05-08 08:45:07 +02:00
Klaus Kämpf
89c84a4944 fix HFE disk write
this fixes https://mametesters.org/view.php?id=7526
2020-05-07 22:29:56 +02:00
AJR
ff07f986fa Fix clang nltool build [-Werror,-Wunused-private-field] (nw) 2020-05-07 11:14:07 -04:00
couriersud
53ac38cf35 netlist: add elif processing to preprocessor. [Couriersud] 2020-05-06 22:43:32 +02:00
couriersud
12a3abdb28 netlist: nlwav - new functionality. [Couriersud]
nlwav now supports 16 and 32 bit integer format (wav16s, wav32s)
as well as 32 bit float format (wav32f).
The "wav" format is no longer supported.
Added support for high and low pass filtering the wav output.
Dynamic volume adjustment (use "-a 0")
--hpboost can suppress spikes at the beginning of the file (<10ms)

The addition of the float format simplifies debugging significantly
since it covers the whole dynamic format.

Added nlwav to the local VS 2019 build.
2020-05-05 23:54:30 +02:00
couriersud
0044c33b61 netlist: fix validate. (nw) 2020-05-05 23:11:26 +02:00
couriersud
ece9501cc4 netlist: Fix two nlwav bugs. (nw)
First one corrupted wav files produced on windows. The second one
produced wrong sample integration results.
2020-05-05 23:09:51 +02:00
couriersud
b500f2d241 netlist: Restructered the save state system. (nw)
This change makes state saving contract based. Objects which need to
save state need to have the following template member:

		template <typename ST>
		void save_state(ST &st)
		{
			/* Example */
			st.save_item(m_p,   "m_p");
			st.save_item(m_buf, "m_buf");
		}

This member function is called when the object is passed to the
state manager save function.
2020-05-04 09:22:16 +02:00
AJR
c4081663f8 Fix OS X build (implicit inclusion differences between standard libraries strike again) (nw) 2020-05-03 13:52:55 -04:00
couriersud
fdc9787c23 netlist: simplify pfunction state handling. (nw)
Removes dependency on pstate.h.
2020-05-03 18:00:34 +02:00
couriersud
b2c40086e6 netlist: Add two noise sources. [Couriersud]
The two sources act as voltage sources, though noise may also be
injected as conductivy or current noise.

SYS_NOISE_MT_U: Mersenne Twister uniform noise
SYS_NOISE_MT_N: Mersenne Twister normal noise

nld_sys_noise is templated:

	using NETLIB_NAME(sys_noise_mt_u) =
		NETLIB_NAME(sys_noise)<plib::mt19937_64,
plib::uniform_distribution_t>;

Thus the approach is scalable. The implementation is state save aware,
and thus reproducible results are guaranteed.

An example use case is provided as well, see examples/noise.cpp.
2020-05-03 17:23:50 +02:00
couriersud
534b58eee6 netlist: Fix some tidy warnings. (nw)
moving over to clang-tidy-11 and enabling more warnings.
2020-05-03 08:58:12 +02:00
couriersud
36622eca96 netlist: Adding prandom.h (nw) 2020-05-03 08:56:22 +02:00
couriersud
e0a5fca0d5 netlist: stand-alone build fixes and improvements. (nw) 2020-05-02 23:43:42 +02:00
couriersud
f0928453f6 netlist: change license for netlists in examples to CC0. [Couriersud] 2020-05-02 19:30:21 +02:00
couriersud
fb2839ba10 netlist: Add simple ZDIODE model. [Couriersud]
The model is driven by three additional model parameters: NBV, IBV, BV.

Example code how to define a typical 7.5V Zener diode:

	ZDIODE(ZD, "D(BV=7.5 IBV=0.01 NBV=3)")

	or

	NET_MODEL("A1234 D(BV=7.5 IBV=0.01 NBV=3)")
	ZDIODE(ZD, "A1234")
2020-05-02 18:00:32 +02:00
couriersud
4dde812af8 netlist: Fix a long standing bug in proxy/family code. (nw)
This never materialized because proxies were always connected to GND
in existing netlists. Now I ran into an example were it kicked in.
2020-05-02 17:38:39 +02:00
couriersud
0336a4c86b netlist: Fix unknown parameter on ne566 and VS 2019 build. (nw) 2020-05-02 11:04:25 +02:00
couriersud
465bceddb9 netlist: Small improvement to visibility in four terms. (nw) 2020-05-01 22:49:14 +02:00
couriersud
72566426a7 netlist: Unknown parameters really should be fatal. [Couriersud]
Unknown parameters like Solver.ABCD now will cause a fatal error to
be generated.
2020-05-01 22:49:13 +02:00
couriersud
9351e7ac87 netlist: Faster LM3900 model. [Colin Howell] 2020-05-01 22:49:12 +02:00
couriersud
a97d097b3b netlist: Fixed polarity issue in CCCS device [Colin Howell, Couriersud]
Note: This affects all use cases of CCCS. I have changed all uses in
MAME.
2020-05-01 18:09:36 +02:00
couriersud
f74ad44550 netlist: more magic number removal. (nw) 2020-05-01 16:13:34 +02:00
couriersud
40f8f99f9a netlist: Removed more magic numbers from the code. (nw) 2020-05-01 15:21:01 +02:00
couriersud
644e330b71 netlist: Readding accidentially delete nld_ne555.h. (nw) 2020-05-01 15:16:02 +02:00
couriersud
bfa908aa32 netlist: Fix a bug introduced by latest nld_log change. (nw) 2020-05-01 15:13:37 +02:00
couriersud
e30ab9be9a netlist: Fix inclusion of examples in documentation. (nw) 2020-05-01 10:49:28 +02:00
couriersud
0120d1d8ff netlist: nld_log now writes out last value at end of run. (nw) 2020-05-01 10:24:20 +02:00
Aaron Giles
40a8b9df95 Remove explicit logging since it can be done on the command line via nltool. 2020-05-01 10:09:06 +02:00
Aaron Giles
2b0aaee3ed Add 74393 device and unit test. 2020-05-01 10:08:40 +02:00
couriersud
13f6e92cec netlist: Add the NE566 as a macro device. [Couriersud]
The device can be found in nlm_other.cpp.
Removed nld_ne566.*
Added SYS_SW, SYS_SW2 and SYS_COMP. These are single switch,
alternating switch and a analog comparator with digital outputs.
Renamed RES_SWITCH to SYS_SW.
Added example ne566.cpp in netlist/examples.
2020-05-01 10:04:22 +02:00
couriersud
c782a0ef33 netlist: add NE566 to netlist.lua. (nw) 2020-04-29 14:38:58 +02:00
Aaron Giles
a46108ce5a Stub implementation of 566 VCO 2020-04-29 12:24:33 +02:00
Aaron Giles
09c19bd622 Added some missing infrastructure. Now TL081 shows up in device list. 2020-04-29 12:22:34 +02:00
Aaron Giles
302223432b Some initial changes. 2020-04-29 12:21:31 +02:00
couriersud
e192f94e75 netlist: Fix some edge cases in static compile. (nw)
Comes with a new version of static_solvers.cpp
2020-04-28 22:39:19 +02:00
couriersud
026123beb2 netlist: Fix documentation build on windows in makefile. (nw)
Documentation should be created on Windows using
make mingw PARAMS=doc

Admittedly this is ugly and the makefile needs to be changed to
use something like "make HOSTOS=windows doc".
2020-04-28 21:08:07 +02:00
couriersud
3f95aebfb5 netlist: Fix "--cmd=listdevices". [Couriersud]
Broken for quite a while this is now working again.
2020-04-28 21:08:06 +02:00
couriersud
77da7b11ae netlist: more code maintenance. (nw)
Make some calls private which were public before.
Eliminate functions which would be executed only once.
Make terminal reference functions in twoterm.h return const.
Clearly identify the use cases which need a non-const ref
to terminals.
2020-04-28 21:08:06 +02:00
couriersud
14e4c4bb3f netlist: improve const-awareness and tidy changes. (nw)
Identified a number of code locations which could accept const
arguments.
2020-04-28 21:08:05 +02:00
couriersud
097c736f79 Netlist: Added 74163 to netlist. [Couriersud] 2020-04-28 21:08:04 +02:00
couriersud
da8cfd878f netlist: fix some windows build issues in build/makefile. (nw) 2020-04-28 21:08:04 +02:00
couriersud
62c3f75221 netlist: More clang-tidy fixes. (nw) 2020-04-28 21:08:03 +02:00
couriersud
14850cbb02 netlist: More clang-tidy fixes. (nw) 2020-04-28 21:08:02 +02:00
couriersud
420f4909be netlist: Fix clang-tidy warnings. (nw) 2020-04-28 21:08:02 +02:00
couriersud
0cf99a5310 netlist: rename some macros. (nw)
Rename COPYASSIGN* and friends to PCOPYASSIGN*.
2020-04-26 01:35:31 +02:00
couriersud
00bff3e703 netlist: clang tidy fixes and srcclean. (nw) 2020-04-25 18:10:18 +02:00
couriersud
d3ee7e21c6 netlist: unify solver calls. (nw)
Calls to the solver used different paths. These changes unify these
calls and provide a common call for discontinuous state changes on
analog components (change_state).
2020-04-25 18:08:04 +02:00
couriersud
f5fad035de netlist: improve readability. (nw)
The purpose here is to make clear what is actually done and to reduce
usage of calls to update.
2020-04-25 13:01:16 +02:00
couriersud
455b8fce2d netlist: document trapezoidal capacitor integration. (nw) 2020-04-23 23:03:58 +02:00
couriersud
b63cbebb17 netlist: Documentation update. (nw) 2020-04-22 21:59:18 +02:00
couriersud
00303795fd netlist: Fix a segfault happening only under for certain netlists.
This seems to be a compiler/standard library issues.
2020-04-22 15:44:08 +02:00
couriersud
3243efee70 netlist: code maintenance and edge case fixes. (nw)
"Edge cases" are compiles were the floting point type used for the core
may be different from the one used by solvers, e.g. double/float.
This does not happen in MAME, here currently this is always
double/double. Since floats are better suited for GPUs whose double
performance is limited it was time to review the code.
This commit fixes warnings about type conversions and precision loss.
In addition there is better support for INT128 and FLOAT128.

The MAT solver has seen some minor performance increases.
2020-04-20 20:52:21 +02:00
couriersud
104090ae0e netlist: rename some camel case names. (nw) 2020-04-19 19:04:33 +02:00
couriersud
20748b5093 netlist: simplify object structure a bit. (nw) 2020-04-19 17:21:02 +02:00
couriersud
0054862e3c netlist: compile time improvement and code maintenance. (nw)
Added a define NL_USE_ACADEMIC_SOLVERS and disabled it in the build.
This will not compile in solvers which are either illustrative or only
perform for large sparse matrices like GMRES.
2020-04-19 16:08:43 +02:00
couriersud
44220a8d39 netlist: code maintenance on pfunction. (nw) 2020-04-19 13:03:44 +02:00
couriersud
6d35a38bf2 netlist: clang-tidy, srcclean and pedantic warnings fixed. (nw) 2020-04-18 22:23:32 +02:00
couriersud
39d7e8063a netlist: remove code duplication. (nw) 2020-04-18 22:04:04 +02:00
couriersud
16bde11adb netlist: nltool usage and static compile changes. [Couriersud]
This commit simplifies the creation of static solvers. For this to
happen the following changes were made:

- nltool does no longer support the "-f netlist_file.cpp" option.
  All parts of netlist which used the option now expect the file
  to be specified after all other options.
  Before: nltool -t 10 -f somenetlist.cpp
  Now   : nltool -t 10 somenetlist.cpp

- The static compile command now supports an "--output" option
  to specify the file to be created and accepts multiple input
  files. To be create the static solver file for MAME use the
  script provided or:

  ./nltool --cmd static
		--output=src/lib/netlist/generated/static_solvers.cpp
		src/mame/audio/nl_*.cpp src/mame/machine/nl_*.cpp

- Updated documentation and examples provided by nltool --help
2020-04-18 16:38:55 +02:00
couriersud
2ce8b83fea netlist: Fix alternative LM3900 implementations. (nw) 2020-04-18 16:38:54 +02:00
couriersud
6cbd3e7764 netlist: Fix a macro expansion bug. (nw) 2020-04-18 16:38:53 +02:00
couriersud
d324eb18fe netlist: Move macros where they belong. (nw) 2020-04-18 16:38:52 +02:00
couriersud
eb7a0a545b netlist: basename function now accepts a suffix to remove. (nw) 2020-04-18 15:44:42 +02:00
couriersud
d8fbec6ab4 netlist: add parameter to split_paragraphs ... (nw)
to allow passing in a custom line end string.
2020-04-18 15:43:06 +02:00
couriersud
855c37d58a netlib: remove a fixme in pmain.cpp. (nw) 2020-04-18 15:41:40 +02:00
couriersud
1af4b9f870 netlist: Document alternative approach to CD4016. (nw)
The CD4016 is an analog switch IC. Document an experimental approach
to implement the analog switch as a 3 terminal element which is
completely being dealt with as part as the linear system.

The intention was to improve convergence when the switch is in a
feedback loop. One example are two-opamp tridiagonal wave generators.
Unfortunately the approach did not work out and in addition was
performing far worse than the net-separating original code.

Also updated comment in nld_generic_models.h.
2020-04-17 23:08:31 +02:00
couriersud
591442fb37 netlist-doc: Fix typo. (nw) 2020-04-14 15:11:15 +02:00
couriersud
dcf2109120 netlist: fix standalone build and doxygen mainpage. (nw) 2020-04-14 00:09:49 +02:00
couriersud
5b6013caea netlist: improve performance up to 65% on audio netlists. [Couriersud]
This commit introduces precompiled static solver code. Due to
additional optimizations the compiler can use because the detail
calculation steps for the solution are known e.g. the kidniki netlist
sees a 100% speed increase.

In all environments (windows/*nix/osx) the source for the static
solver code can be created using
	bash src/lib/netlist/nl_create_mame_solvers.sh

This will create src/lib/netlist/generated/static_solvers.cpp which is
compiled into the mame binary.
The script is just a temporary workaround. The intention is that nltool
whill be able to create this file with one call.

There are other improvements in this commit speeding up the processing
of timestep and dynamic calculations.
2020-04-13 21:32:00 +02:00
Vas Crabb
5fba95ff40 formats: permission from Nigel Barnes to relicense Acorn and AFS disk handlers as BSD-3-Clause (nw) 2020-04-13 21:13:18 +10:00
Vas Crabb
de72f97b90 (nw) formats: reduce dependencies on libemu
The only link dependency left is emu_fatalerror.  The format handlers
really shouldn't be throwing fatal errors at all - they should just
fail to load an image they can't handle.  Maybe the interface should
be enhanced to allow better propagation of errors up from the format
handlers so they can be displayed in a UI rather than just logged.

The only other two dependencies are on logmacro.h (pure macros) and
the PAIR type from emucore.h (possibly worth moving to util).
2020-04-13 19:14:36 +10:00
Ivan Vangelista
404e7321a6 formats/apridisk.cpp: fixed compile
../../../../../src/lib/formats/apridisk.cpp: In member function 'virtual bool apridisk_format::load(io_generic*, uint32_t, floppy_image*)':
../../../../../src/lib/formats/apridisk.cpp:99:7: error: 'fatalerror' was not declared in this scope; did you mean 'strerror'?
2020-04-13 07:56:21 +02:00
Vas Crabb
d10ba2b97a With permission from Dirk Best, apply 3-clause BSD license to common devices and image handling (nw)
Note that this does not apply to machine drivers or device implementations for a single machine family (e.g. Amiga chips or VTech expansion bus)
2020-04-13 15:01:40 +10:00
Vas Crabb
2add7c158c split was using sha1.h directly - fix that (nw) 2020-04-13 06:48:15 +10:00
Vas Crabb
af82c0eca8 util: re-implement SHA-1 and get rid of the two third-party implementations (nw) 2020-04-13 06:16:03 +10:00
couriersud
2453c5b077 netlist: minor code maintenance. (nw) 2020-04-11 14:43:26 +02:00
couriersud
e655aacb4e netlist: performance improvement. (nw) 2020-04-10 20:50:30 +02:00
couriersud
4af78838ad netlist: Reduce memory allocation calls in non-core code. (nw) 2020-04-10 15:01:05 +02:00
Oliver Stöneberg
e9f6bd8d01
Revert "fixed some modernize-use-equals-default clang-tidy warnings (… (#6360)
* Revert "fixed some modernize-use-equals-default clang-tidy warnings (nw)"

This reverts commit 54486ab9

* fixed merge error
2020-04-08 11:10:21 -04:00
Vas Crabb
8a4e16d968 centralise instantiation of more of the util::strformat engine 2020-04-08 22:00:14 +10:00
Robbbert
b5e08ae5e8 H8: added support for H8T tapes. 2020-04-06 01:37:05 +10:00
couriersud
5075448278 netlist: Fix some clang-tidy-10 warnings. (nw) 2020-04-05 16:28:01 +02:00
Vas Crabb
92d6e163a8 srcclean (nw) 2020-03-22 14:33:57 +11:00
couriersud
e160240f6a netlist: Document alternative opamp output stage. (nw) 2020-03-21 15:42:45 +01:00
couriersud
840a9c640f netlist: Change MB3614 outout impedance. (nw) 2020-03-21 15:42:44 +01:00
couriersud
8a87993201 netlist: document linearized diode model above max. dissip. [Couriersud]
Document linearized diode model in the range exceeding maximum
dissipation. The intention is to have a faster convergence but this yet
not really is observable.
2020-03-21 15:42:43 +01:00
Vas Crabb
9c600695f0 (nw) Cleanup on the way:
* Add doxygen comments for bit manipulation functions
* Add an overload of BIT that works like the AArch64 UBFX instruction
* Kill off some of the silly concatenating overloads for emu_file::open
* Make searchpath acually useful for devices

This is a checkpoint - I'm planning to improve ROM loading behaviour at
least a little.
2020-03-10 18:21:10 +11:00
couriersud
354c9c363b williams.cpp: Improve williams2 color display. [Couriersud]
Change color levels for williams2 hardware to better color display.
Output levels are computed in netlist. These levels are aligned to
LTspice modelling I did.
Also improved the modelling to do what the actual hardware for mysticm
did: Color decoding depends on W13..W11. These are actually flip screen
versions of V13..V11. Fixed treatment on Bit0 although not used by the
game code.
Added R,G,B gain and offset sliders for the williams2 hardware. MAME
only supports one setting for all channels. This is not good enough
to come close to video recordings found on youtube.

Minor changes to nltool to better measure time taken to run a
simulation.
2020-03-05 22:22:58 +01:00
R. Belmont
3d5a9dbc4f
Merge pull request #6385 from shattered/_ad71766bb26
ibmxdf_dsk: IBM Extended Density Format support (nw)
2020-03-02 14:57:30 -05:00
couriersud
ddf0865642 netlist: Fix inductor. (nw)
Fix inductor calculation. Updated turkey shoot example to skip start-up
swinging of L1/C60 LC circuit. Recording now starts at 1ms.
2020-03-02 18:45:45 +01:00
Sergey Svishchev
c155d424ac ibmxdf_dsk: IBM Extended Disk Format support (nw) 2020-03-02 20:21:04 +03:00
couriersud
cf2d6a8393 Use netlist to calculate RGB values for Turkey Shoot. [Couriersud]
This example shows how the netlist tools can be used to derive
RGB tables from a schematic. All steps are given in
serc/lib/netlist/examples/turkey_shoot.cpp
2020-03-02 18:17:52 +01:00
couriersud
fde057ba00 nlwav: add sampled output format. [Couriersud]
Using this output format nlwav will pick point samples at regular
intervals from log files. This can be used to e.g. calculate
RGB output levels with netlist.
2020-03-02 18:15:22 +01:00
couriersud
eac1218d59 netlist: use initializer_list. (nw)
- Use initializer_list in object_array_t.
- Added constructor which accepts a format string for object names.
- Started work on logic_input8 which provides 8 logic outputs.
2020-03-02 14:23:32 +01:00
Vas Crabb
f7dbca3527 srcclean and manual adjustments (nw) 2020-02-23 13:20:34 +11:00
couriersud
8b3a65302b netlist: updated VS files for standalone build. (nw) 2020-02-17 22:45:11 +01:00
couriersud
9214347334 netlist: fix log file option in nltool. (nw) 2020-02-17 22:43:49 +01:00
couriersud
10ee674282 netlist: change output impedance to more realistic values. (nw) 2020-02-17 22:11:35 +01:00
couriersud
fbd9055a90 Turn off alignas to please -Wattributes on arm. (nw) 2020-02-17 22:08:56 +01:00
couriersud
9ea6b12ccb netlist: added min and max to pfunction. (nw) 2020-02-16 19:17:32 +01:00
couriersud
acaea048e1 netlist: Add support for pots to spice conversion. [Couriersud] 2020-02-16 19:16:20 +01:00
couriersud
a2dd2a1c76 Document current state of congo bongo development. (nw) 2020-02-16 19:13:49 +01:00
couriersud
9142c69f03 Fix issue #6293. (nw) 2020-02-11 22:18:03 +01:00
ajrhacker
abc5492c17 Merge pull request #6280 from 68bit/flex-dsk-identify-needed
flex_dsk: include an identify() method.
2020-02-08 23:24:53 -05:00
Vas Crabb
fead8792cc util/strformat.h: future-proof for C++20 (GitHub #6275)
(nw) I've triple-checked the code and it looks sane, but I'm still a bit nervous about changing
such a fundamental part of MAME.  If integer formatting appears to have changed after this, let
me know ASAP.  Also removed a workaround for older versions of GNU libstdc++ with incomplete
C++14 support.
2020-02-09 13:44:35 +11:00
68bit
17f30b20f2 flex_dsk: include an identify() method.
It is necessary to return a higher score on success, higher than
returned by the default method, in order for a general 'identify' to
succeed over competitive matches.
2020-02-09 11:45:52 +11:00
68bit
a87c3b6f7a wd177x_dsk: generalize to allow custom track format variations
Add a get_track_format() method that can be overridden to supply format
variations for any track and head. The code is generalised to account for such
variations. The default method returns the passed format, so this change is
neutral for existing formats.

Simplify the FLEX DSK format code. There are now simply format variation
descriptions for the second track that have the sector ID continuing in
sequence from the first track, rather than specialized code.

Extend the FLEX format to support variations in the sectors ID of the first
two sectors. The FLEX 6800 boot sectors have IDs based at zero rather than
one. Extend the FLEX format to support variations for which the first track,
on both sides, is single density on an otherwise double density disk which was
historically a common format.

Extend the OS9 disk format to support variations for which the first track, on
only the first side, is single density on an otherwise double density
disk. OS9 for the SWTPC and Gimix typically used such formats.

Extend the OS9 disk format to support variations with a base sector ID of zero
in contrast to the existing COCO OS9 format which uses a based sector ID of
one. The OS9 format identification code is extended to rely on the optional
information stored in the OS9 LSN0 header to identify COCO format disks, and
all COCO format disks appear to have this optional information in a regular
enough format.
2020-02-08 00:12:05 +11:00
R. Belmont
3f972f86c7
Merge pull request #6245 from shattered/_27394e2f097
aim_dsk: use splice position recorded in the image, if available (nw)
2020-02-05 13:42:04 -05:00
couriersud
e204d878f8 netlist: Fix VC compile. (nw) 2020-02-04 23:24:46 +01:00
couriersud
636315be5f netlist: code maintenance. (nw)
Remove dead code, fix lint warnings, make spice netlist conversion more
flexible, implement changes to controlled sources.
2020-02-03 20:21:40 +01:00
couriersud
7480c9fe09 netlist: align nltool -c convert with mame/discrete/README.md (nw) 2020-02-02 19:30:25 +01:00
couriersud
4c7e687f5e netlist: spice-to-netlis conversion sync with mame/discrete. (nw)
This is work in progress. The aim is to remove all hacks in netlist
conversion going forward.
2020-02-02 02:23:16 +01:00
Vas Crabb
753dd79442 Merge branch 'release0218' into mainline-master 2020-02-02 04:19:17 +11:00
Vas Crabb
9e0b03710d more debug logging left on, few small cleanups (nw) 2020-02-02 01:43:27 +11:00
Sergey Svishchev
c12f5eecda aim_dsk: use splice position recorded in the image, if available (nw) 2020-01-31 22:53:34 +03:00
couriersud
7f419fa1b3 netlist: Document Congo Bongo progress and fix devices. 2020-01-31 20:25:15 +01:00
couriersud
84e3eb1deb netlist: Code symplification and bugfixes. (nw)
- Fixes performance regression and net_splitter struct.
- Fixes nltool time measurements
- pstream simplification
2020-01-31 20:23:40 +01:00
couriersud
72f86082aa netlist: clang lint fixes. (nw) 2020-01-31 20:20:53 +01:00
Vas Crabb
bddfe1030c
Revert "Alfaskop improvements" 2020-01-31 20:05:02 +11:00
Joakim Larsson Edström
7d5c59f6e5
Merge pull request #6068 from JoakimLarsson/alfaskop_pla
Alfaskop improvements
2020-01-31 09:50:18 +01:00
Vas Crabb
3536bbdd71 there are reasons for things being the way they were (nw) 2020-01-31 14:53:46 +11:00
Oliver Stöneberg
dfaf9dd5bc
fixed some modernize-use-auto clang-tidy warnings (nw) (#6238) 2020-01-30 21:46:27 -05:00
Oliver Stöneberg
4a10205777
fixed some modernize-use-equals-default clang-tidy warnings (nw) (#6237) 2020-01-30 21:45:34 -05:00
Oliver Stöneberg
059243f68e
fixed some clang-tidy warnings (nw) (#6236)
* fixed some modernize-redundant-void-arg clang-tidy warnings (nw)

* fixed some modernize-use-bool-literals clang-tidy warnings (nw)

* fixed some modernize-use-emplace clang-tidy warnings (nw)

* fixed some performance-move-const-arg clang-tidy warnings (nw)

* fixed some readability-redundant-control-flow clang-tidy warnings (nw)

* fixed some readability-redundant-string-cstr clang-tidy warnings (nw)

* fixed some performance-unnecessary-value-param clang-tidy warnings (nw)
2020-01-30 20:01:48 -05:00
couriersud
0ff9acb5f5 ptime: change operators to align with c++ textbooks. (nw) 2020-01-29 19:02:16 +01:00
couriersud
fceee50c8b netlist: Parameters evaluated when netlist is created. [Couriersud]
Parameters are now passed to the netlist core as strings. During netlist
creation they are evaluated as functions. This opens the path to
parameters on subdevice level.

Examples:

PARAM(device.XY, (1+2*0.005))
RES(R1, 2.05*RES_K(1)+1)

In addition the commit contains dead code removal.
2020-01-29 19:00:10 +01:00
couriersud
d7fd89afe1 netlist: fix parameter update recalculation. (nw) 2020-01-29 18:53:06 +01:00
couriersud
2742727a0b netlist: Fix crash in infix function evaluation. (nw) 2020-01-29 18:51:26 +01:00
couriersud
2b7c6af9ef netlist: make gain parameter mandatory for controoled sources. (nw) 2020-01-29 18:50:27 +01:00
couriersud
f7d8a10da5 netlist: Code maintenance. (nw)
- Fixed some clang lint warnings
- Removed dead code
- Experimental parser code to allow calculations in parameter value.
  This already works for compiled netlists. These changes are
  currently disabled. Updated pong netlist (and CRC/SHA) to work
  with this new code.
2020-01-27 21:47:41 +01:00
couriersud
f6a04074f6 netlist: Fix/extend SPICE format conversion. [Couriersud]
"./nltool -c convert -f UA741.mod" now runs without errors. UA741.mod is
the official TI SPICE subckt for the 741 opamp.

This commit fixes a number of issues and adds linear POLY support for
E/F SPICE models.
2020-01-26 21:28:48 +01:00
couriersud
fa27a02b0d netlist: add current controlled voltage source (CCVS). [Couriersud] 2020-01-26 21:25:33 +01:00
couriersud
d980e7d6ab netlist: Fix issue in inactive code-path. (nw) 2020-01-26 21:23:20 +01:00
couriersud
636894b02f netlist: MAJOR bug fix. Expect other bugs to surface. [Couriersud]
This commit fixes an issue with parsing netlists. To cut a long story
short: The separation of nets into independant groups of nets failed
under some circumstances for four terminal devices (controlled
voltage/current devices). Everything worked as long as an external
feedback loop existed. Without external feedback loop, the separation
would either fail or create "false" separated nets.
This fix also highlighted an issue with cmos switches (4066/4016).

There is a slight chance that other bugs may surface due to this change.
2020-01-26 21:22:13 +01:00
couriersud
6874b1f7ac netlist: clang lint readability fixes. (nw) 2020-01-25 21:13:21 +01:00
couriersud
9431ee68e7 netlist: clang lint fixes, srcclean and nlwav fix. (nw) 2020-01-25 21:12:01 +01:00
couriersud
42d351a4eb netlist: New devices and some fixes. [Couriersud]
- add CD4006 and CD4070 devices
- add TL084 opamp model
- Clock now supports proxies, i.e. can be connected to
  analog devices.
- Fixed netlists using CLOCK
- added some comments
- removed a forgotten header file.
2020-01-25 15:26:59 +01:00
R. Belmont
1a5b900759
Merge pull request #6195 from firewave/includes
use C++ library includes (nw)
2020-01-22 22:04:35 -05:00
R. Belmont
db157a165b
Merge pull request #6187 from 68bit/apple2-floppy-options-track-count
apply2 floppy format: bake in the track count
2020-01-22 22:04:18 -05:00
Oliver Stöneberg
7c3aea8928 fixed some clang-tidy warnings (nw) (#6197)
* fixed some bugprone-throw-keyword-missing clang-tidy warnings (nw)

* fixed some modernize-use-nullptr clang-tidy warnings (nw)

* fixed some readability-delete-null-pointer clang-tidy warnings (nw)

* fixed some performance-faster-string-find clang-tidy warnings (nw)

* fixed some performance-for-range-copy clang-tidy warnings (nw)

* fixed some readability-redundant-string-cstr clang-tidy warnings (nw)
2020-01-22 22:03:35 -05:00
firewave
399515c7a7 use C++ library includes (nw) 2020-01-22 13:31:52 +01:00
couriersud
9e272e4b55 netlist: code maintenance. (nw)
- remove pthrow trampline as proposed by Vas.
- identify throwing code by adding noexcept(false)
- move "connected term" information to setup code.
- srcclean
2020-01-20 21:15:22 +01:00
68bit
7fc7f5850e apply2 floppy format: bake in the track count
The APPLE2_TRACK_COUNT macro was not being expanded here, at least on gcc8.
This resulted in the string "APPLE2_TRACK_COUNT" being within the specification
and that in turn broke option_resolution::lookup_in_specification leading to
an assertion fail with the debug checks enabled. So bake in the numeric
constant to at least get things working again.
2020-01-20 13:32:17 +11:00
couriersud
0f69abe4dc netlist: clang tidy fixes. (nw) 2020-01-19 20:56:53 +01:00
couriersud
b4e8244827 netlist: Fix 741 opamp representation. (nw) 2020-01-19 20:54:19 +01:00
AJR
35f45085fe Eliminate simple_list_wrapper and replace its only use (nw)
The replacement of append with emplace_front alters the sequence, but that should cause no difference in behavior here.
2020-01-18 23:08:04 -05:00
couriersud
f6a7a6fe88 netlist: Code maintenance. (nw)
Checked and fixed conditional compile paths.
Simplified memory allocation.
Generalized signal handling.
2020-01-18 16:39:49 +01:00
couriersud
eb92f5900c netlist: 7493, minor edit. (nw) 2020-01-16 22:43:59 +01:00
couriersud
09f03c4b05 netlist: Fix building with 128bit integers. (nw) 2020-01-16 22:43:23 +01:00
couriersud
83713b0b5d netlist: Increase resolution to 100 pico seconds. [Couriersud]
Increase the time resolution from 1 nano second to 100 pico seconds.
Make sure that icount and netlist internal time are better synched by
tracking the remainder of the division.
Fixed the netlist sound device. There is a one sample overflow every 13
seconds at 48000 Hz due to integer truncation which is now ignored.
Added more doxygen documentation.
2020-01-15 21:41:57 +01:00
couriersud
d070d8ebe6 netlist: move some functions to pmath. (nw) 2020-01-15 21:13:38 +01:00
couriersud
e13f1516fc netlist: Make sure diodes step enough ... [Couriersud]
Long story: The diode model uses log-stepping as proposed in "Circuit
Simulation" (Farid N. Najm) page 183. If the previous voltage was
sufficiently negative the new voltage after a log step could not have
increased enough to alter matrix and rhs vector.
This bug surfaced in stuntcyc video signal mixing which uses a diode for
the composite signal.
2020-01-15 21:09:04 +01:00
couriersud
08d576e181 Fix clang build. (nw) 2020-01-12 17:48:54 +01:00
couriersud
9d7cbcaa40 netlist: Code maintenance. (nw)
Introduce an additional absolute time type netlist_time_ext to identify
whether absolute or relative time is used in the netlist code.
Extend ptime code to allow operations between ptime derived types with
different internal types.

In addition rewrote main queue serve loops. Adds a very small
performance increase.
2020-01-12 17:16:25 +01:00
couriersud
e4b4899682 netlist: dead code removal. (nw) 2020-01-11 22:53:19 +01:00
couriersud
7b695dac59 netlist: fix github issue #6106. [Couriersud, Firewave]
Workaround for a bug in msvc. __VA_ARGS__ are expanded to a single token
in msvc, all other compilers expand to a list of tokens.
2020-01-08 21:32:34 +01:00
fulivi
0d16f8cc53 imds2: implemented save in IMG disk format (#6140)
* imds2: implemented save in IMG disk format

* imds2: try to fix CI failure again, this time by removing LOGs
2020-01-07 11:15:41 -05:00
Nigel Barnes
ec751fc8c6 acorn_dsk: Added support for HADFS floppy images. 2020-01-07 12:39:15 +00:00
fulivi
2ec25ca6d5 Emulation of isbc202 floppy disk controller (#6119)
* imds2: isbc202 floppy disk controller added

* imds2: attempt to fix problems with CI checks
2020-01-04 16:11:48 -05:00
Stiletto
88909dc0d0
Happy New Year 2020 (nw) (#6128)
Happy New Year 2020 (nw) (#6128)
2020-01-04 01:13:50 -05:00
couriersud
018830967a netlist: Force invalidation of save states. [Couriersud]
Added netlist version information. This is used to enforce the
invalidation of save states when the major/minor netlist version
changes.

This catches edge cases for which neither the size or names of saved
items changes during releases.
2019-12-30 16:50:32 +01:00
Joakim Larsson Edstrom
e8e5664d6f alfaskop41xx.cpp, jedparse.h, mc6844.cpp : addressed PR feedback 2019-12-27 00:32:57 +01:00
Vas Crabb
826db8a22b srcclean (nw) 2019-12-21 15:15:32 +11:00
Vas Crabb
825cd42639 add missing return statement for LRU cache assignment operator (nw) 2019-12-20 13:24:09 +11:00
Vas Crabb
6ce8e37748 coretmpl.h: different approach to member initialisation - hopefully work around issue with move constructor; also stop using names that start with underscore followed by capital letter as they're reserved (nw) 2019-12-20 13:21:45 +11:00
Joakim Larsson Edstrom
88b532d28a pla.cpp, jedparse, jedutil: Added recognition and some support for alternative PLA binary format DataIO 2019-12-18 12:45:01 +01:00
couriersud
6c181d7adb netlist: Change visibility to private for some members. [Couriersud]
Interesting observation to note: since MAME 208 bench 30 results for
pongf increased from 450% to 580%.
2019-11-26 00:47:05 +01:00
couriersud
c50bf9a698 netlist: move nl_examples to src/lib/netlist/examples. (nw)
One folder less in the top-level.
2019-11-25 22:28:41 +01:00
AJR
bb54cd8d23 Fix clang error: cannot initialize a parameter of type 'void *' with an lvalue of type 'volatile unsigned char *' (nw) 2019-11-24 12:04:30 -05:00
Vas Crabb
8c4f10d3aa apparently 3AM is not the time to code (nw) 2019-11-25 03:29:33 +11:00
Vas Crabb
9525108f78 helps to git add before git commit (nw) 2019-11-25 03:24:12 +11:00
Vas Crabb
d2f3d02908 pre-fill things allocated with operator new with 0xcd in debug builds (value can be changed by setting global g_mame_new_prefill_byte with a debugger) - this is gonna hurt performance, but it will help catch issues exposed when we remove pre-clearing before constructing devices 2019-11-25 03:20:08 +11:00
Vas Crabb
e64edf6c71 srcclean and indentation cleanup (nw) 2019-11-24 13:52:11 +11:00
couriersud
35f1086ba2 netlist: clang lint fixes and standalone build fix. (nw) 2019-11-24 03:47:36 +01:00
mooglyguy
4fe4965d4f -netlist: Add new devices to net_lib.cpp, nw 2019-11-23 17:38:40 +01:00
MooglyGuy
71ac1a1f1b -netlist: Fixed typo on 7442 diagram, nw 2019-11-23 15:01:20 +01:00
MooglyGuy
6d9e191488 -netlist: Added 7442 4-Line BCD to 10-Line Decimal Decoder. [Ryan Holtz] 2019-11-23 13:52:24 +01:00
MooglyGuy
881040610e -netlist: Fix typo, nw 2019-11-23 13:31:53 +01:00
MooglyGuy
2aa304ebc7 -netlist: Added 7492 Divide-by-12 Counter. [Ryan Holtz] 2019-11-23 12:43:30 +01:00
arbee
5c45fa678f apple2: fix recognition of .NIB images on the old diskii controller (MT #7496) [R. Belmont] 2019-11-22 20:45:08 -05:00
Vas Crabb
e09f2e49a6 util/options.cpp: fix locale issues and a const correctness issue 2019-11-23 11:30:07 +11:00
Tom
b400364824 new working ZX Spectrum slot devices: DISCiPLE and +D disk interfaces (#5931)
* plusd working (rom patch)

* plusd done

* added disciple, not working

* disciple working

* wd_fdc fix

* final tidy-up

* ready for pr

* Pernod70 changes

* cuavas changes #1

* combine devices + files

* sort out side_effects
2019-11-22 02:52:10 +11:00
Vas Crabb
88ce545cdd misc cleanup:
* Got rid of some more simple_list in core debugger code
* Fixed a buffer overrun in wavwrite (buffer half requried size)
* Slightly reduced dependencies and overhead in wavwrite
* Made new disassembly windows in Qt debugger default to current CPU
2019-11-18 05:08:36 +11:00
couriersud
67dc264e22 netlist: more code maintenance. (nw)
- refactor error messages.
- Fix some drivers to cope with outputted added my the mame driver
  for video and sound.
- Fix validation.
2019-11-16 16:09:04 +01:00
couriersud
bcfa9eae6f netlist: maintenance and bug fixes, remove DUMMY_INPUT. [Couriersud]
- Removed DUMMY_INPUT. NC (not connected) pins should now use NC_PIN.
  If a NC_PIN is actually connected, an error will be logged and
  validation will fail.
- Enabled "extended" validation. This will catch now if power terminals
  are not connected.
- Added const and noexcept where appropriate.
- Removed dead code.
- Fixed the 7414 Schmitt-Trigger device to use nld_power_pins
2019-11-15 22:16:37 +01:00
couriersud
dc4fa04201 netlist: Proxy and power terminal hack removal. [Couriersud]
- Devices ttlhigh and ttlhow are no longer automatically created.
- All logic input devices (e.g. TTL_INPUT, LOGIC_INPUT) now need to have
  their power terminals (VCC, GND) connected. This opens the route
  for more appropriate proxy devices but comes at a cost. If the
  connections are omitted your circuit will not work as expected.
  Example:
      LOGIC_INPUT(I_SD0, 1, "AY8910PORT")
      NET_C(VCC, I_SD0.VCC)
      NET_C(GND, I_SD0.GND)
- Updated all netlists.
- Removed proxy information from terminal objects. This was replaced by
  a lookup hash whose life-span does not exceed netlest setup.

These changes enable the removal of a number of hacks from the
source going forward.
2019-11-14 22:59:07 +01:00
couriersud
43637964a2 netlist: bug fix, code maintenance and performance improvement. (nw)
- fixed a code in the netlist creation which caused multiple proxies
  to be created for output->terminal connections. A nice side effect of
  this fix is a performance increase ~9% for kidniki and ~4% for pong.
  Speaking about pong ... maximum is 490%. Dice is running at
  280 FPS/60 FPS = 466%, however without any analog emulation.
- Replaced NL_NOEXCEPT with noexcept. assert is now exception-free.
- cppcheck and lint fixes.
2019-11-13 19:29:51 +01:00
couriersud
f4cf0cc86a netlist: code maintenance. (nw)
- move memory pool to netlist_state_t removing one static allocation.
- add memory allocation stats to verbose output
- nl_assert no longer throws, first step to remove NL_EXCEPT macro.
2019-11-13 07:41:20 +01:00
couriersud
63561e2c2c netlist: maintenance. (nw)
- Fix automatic header generation
- clang lint fixes.
- srcclean
- remove dead code
2019-11-11 15:04:21 +01:00
couriersud
b8c43342d5 netlist: first steps on the way to calculated parameters. [Couriersud]
This commit is a first step towards using formulas in parameters, i.e.

MAINCLOCK(clock, 20 * 30)

The intention is to improve readability and scalability.
Since device registration already provides all necessary information
about parameters, the code to create an include file for all
devices has been improved. Long term, this will remove the need for
device specific header files.

In addition going forward devices will accept either no connections or
all specified connections, i.e.

TTL_7400_NAND(name, chip1.2, chip2.3)

or

TTL_7400_NAND(name)
NET_C(...)
NET_C(...)

This will allow to remove all duplicate definitions which are currently
necessary, i.e. TTL_7400_NAND/TTL_7400_GATE
2019-11-10 19:54:26 +01:00
couriersud
f60ed79ed6 netlist: code maintenance. (nw)
- more doxygen \file annotations
- moved MAINCLOCK back to nl_base.h
- remove some const from simple function parameters
2019-11-10 01:18:57 +01:00
couriersud
88f702b416 netlist: code maintenance and bug fixes. (nw)
- comment style migration continues.
- Fixed a two bugs in the truthtable ignore inputs code
- refactored the truthtable code a bit for better readability.
- updated netlist specific gitignore.
2019-11-08 23:52:14 +01:00
couriersud
bbbd1c0e8e netlist: maintenance. (nw)
- switch to VS 2019 community and fix standalone build.
- more migration to C++ comment style.
- add some more doxygen markup.
2019-11-08 12:56:05 +01:00
couriersud
ae2cad64f4 netlist: code and documentation maintenance fixes. [Couriersud]
-	"nltool -c docheader" now scans sources and creates
    usage focussed doxy documentation for devices. Very early
    stage, but works. For an example, please see ne555 source.
-	Started migrating to pure C++, i.e. "//" comments.
-   Various documentation fixes.
-   Added cppcheck configuration to netlist/build
-   Some smaller code changes.
2019-11-07 20:25:51 +01:00
couriersud
a970ef42f1 netlist: Minor optimizations. (nw) 2019-11-05 17:17:32 +01:00
couriersud
22e07506cc netlist: more consistent exception handling. (nw)
Still not optimal, but better than what we had previously. No exception
logging comes closer.
2019-11-05 00:08:52 +01:00
couriersud
2cf61b2e4c netlist: code maintenance. (nw)
- more const
- explicitly raise exceptions instead of leaving this to log.fatal()
- correct a number of cppcheck findings.
- dead code removal
- clang lint corrections, e.g. include order
2019-11-04 22:04:11 +01:00
Vas Crabb
4ac111da3c misc cleanup (nw) 2019-11-05 01:04:31 +11:00
npwoods
66f7e4fe0c Fix invalid std::vector<> lookup in aviio.cpp
This fixes a case where:
* m_soundbuf_samples == processedsamples
* processedsamples > 0
* processedsamples * stream->channels() == m_soundbuf.size()

In this scenario, the std::memmove() would do nothing (moving zero
bytes), but the operator[] on the second parameter to std::memmove()
overflows the array.  This can be benign in optimized builds (because
the third parameter to std::memmove() is 0), but on debugging builds
this can cause an assert.
2019-11-04 13:32:22 +11:00
couriersud
e896b3914e netlist: code maintenance. (nw)
- leave a note that cstdlib is needed for getenv.
- Remove commented out includes
- make sure all headers are self - contained, i.e. compile
2019-11-04 00:32:47 +01:00
AJR
db15a9f46e Fix clang error: no member named 'getenv' in namespace 'std' (nw)
Library differences are the culprit once again.
2019-11-03 17:32:50 -05:00
couriersud
60379b658a netlist: code maintenance. (nw)
- Separate code out into pmath.h and pstonum.h.
- Fix VC build error
- optimize pfmtlog.h a bit
2019-11-03 23:19:52 +01:00
couriersud
5383dd355c netlist: remove pragma once. (nw)
Only used inconsistently in the code. May as well go.
2019-11-03 15:26:37 +01:00
couriersud
34ccb11c53 netlist: Completed __float128 support. [Couriersud]
Both compiling the core and the shaders with __float128 now work.
The support was added to be ready to deal with academic edge cases.

Performance drops to 10% of double - thus disabled by default.
2019-11-03 15:25:01 +01:00
couriersud
cabfd7188a netlist: fix regression, preliminary __float128 support. (nw)
__float128 is a gnu extension delivering true 128 bit floating point
support. Currently not supported by clang. In addition, the quadmath
library needs to be linked. For the time being therefore disabled.
2019-11-03 01:33:48 +01:00
couriersud
db0dbeaea5 netlist: improve readability. (nw)
Renamed cast member of the constants struct to magic to clearly identify
magic numbers.

Introduced nlconst struct inheriting from plib::constants<nl_fptype> to
make code better understandable.
2019-11-02 23:39:24 +01:00
couriersud
77ea61bac7 netlist: add RELTOL/VNTOL solver parameters. Type safety. [Couriersud]
The newly added RELTOL and VNTOL parameters implement Newton convergence
checks comparable following other SPICE implementations.
The ACCURACY solver parameter now is only used for convergence checks in
iterative solvers.

In addition, type safety was significantly improved and a lot of "magic"
numbers are identifiable now.
2019-11-02 22:25:11 +01:00
couriersud
6573037934 netlist: Support for float, double and long double solvers. [Couriersud]
- Added new solver parameter FPTYPE. This determines in which floating
  point domain the linear system is solved. May be one of "FLOAT",
  "DOUBLE" or "LONGDOUBLE"
- Added option "--fperr" to nltool. This enables floating point
  exceptions. This helps debugging the code under gdb.

The purpose of this going forward is to have more choice in
optimization. Non-dynamic systems should be just fine in the float
domain. Dynamic systems (i.e. diodes, bjts, mosfets) should in general
work with double. Certain edge cases may require long double resolution.
2019-11-02 12:25:50 +01:00
couriersud
5f1427ab0f netlist: code maintenance and bugfixes. (nw)
- fixed a bug in the parray constructor
- replaced NL_NOEXCEPT with noexcept where appropriate
2019-11-01 18:49:22 +01:00
couriersud
a9d7e55ac2 netlist: convert constexpr constants into constexpr inline funcs. (nw) 2019-11-01 01:50:33 +01:00
couriersud
47d938b149 netlist: further solver refactoring. (nw) 2019-11-01 01:21:43 +01:00
AJR
e37b9b7b88 It's C++14 where constexpr variables still aren't inlined, making ridiculous workarounds like this necessary to fix builds (nw) 2019-10-31 19:46:14 -04:00
couriersud
9fe2af2be1 netlist: fix clang warnings & srcclean. (nw) 2019-10-31 22:07:50 +01:00
couriersud
c6b281685d netlist: Compile with float/double floating point. [Couriersud]
Added ability to compile using float instead of double. Specifically the
the solver as well as the infrastructure now can have their own floating
point type. Currently this is only an academic exercise since
numerically demanding circuits like kidniki only work with double/double
support. Using float here is pushing numerical stability over the
limits.

The long term design goal is too have the matrix type (double/float)
being a parameter.
2019-10-31 21:53:50 +01:00
couriersud
6c075e602c netlist: maintenance and simplifcation. (nw)
- solver: align matrix population along the various solvers
- solver: delete dead code
- renamed nl_double to nl_fptype and use nl_fptype where previously
  double has been used.
- renamed param_double_t to param_fp_t
2019-10-31 18:39:09 +01:00
couriersud
65fb297023 netlist: move solver stuff into separate namespace. (nw)
- new namespace "solver"
- minor ptime modifications
2019-10-31 01:15:43 +01:00
couriersud
7c6fdaf499 netlist solvers: fix some bad design. (nw) 2019-10-30 20:42:49 +01:00
couriersud
beab34006a netlist: code maintenance. (nw)
Simplification, remove some trampolines.
2019-10-30 19:10:40 +01:00
couriersud
470c416cc3 netlist: Hopefully fix MSVC compile. (nw) 2019-10-30 11:35:03 +01:00
couriersud
cebd828fcd netlist: improve localized storage. (nw) 2019-10-29 22:05:45 +01:00
couriersud
cac86fb1b4 netlist: code maintenance. (nw)
- Removed code no longer used
- Add noexcept where appropriate
- split pparser.[c|h] into ppreprocessor and ptokenizer
- smaller optimizations, e.g. use of std::size_t
- fix lint warnings
2019-10-29 19:55:53 +01:00
couriersud
97129cece5 netlist: Preprocessor enhancements. [Couriersud]
The builtin preprocessor now behaves closer to cpp:

- supports macro parameters, i.e. define x(a) a
- supports stringification, i.e. define x(a) #a
- supports concatenation, i.e. define x(a) a ## _ext

In addition, error reporting now provides a source context including the
include history.
2019-10-28 13:44:26 +01:00
Vas Crabb
f81fbdb8d4 Make devdelegate more like devcb for configuration. This is a
fundamental change to show device delegates are configured.

Device delegates are now aware of the current device during
configuration and will resolve string tags relative to it.  This means
that device delegates need a device to be supplied on construction so
they can find the machine configuration object.  There's a
one-dimensional array helper to make it easier to construct arrays of
device delegates with the same owner.  (I didn't make an n-dimensional
one because I didn't hit a use case, but it would be a simple addition.)

There's no more bind_relative_to member - just call resolve() like you
would for a devcb.  There's also no need to cast nullptr when creating a
late bind device delegate.  The flip side is that for an overloaded or
non-capturing lambda you'll need to cast to the desired type.

There is one less conditional branch in the hot path for calls for
delegates bound to a function pointer of member function pointer.  This
comes at the cost of one additional unconditional branch in the hot
path for calls to delegates bound to functoids (lambdas, functions that
don't take an object reference, other callable objects).  This applies
to all delegates, not just device delegates.

Address spaces will now print an error message if a late bind error is
encountered while installing a handler.  This will give the range and
address range, hopefully making it easier to guess which memory map is
faulty.

For the simple case of allowing a device_delegate member to be
configured, use a member like this:

    template <typename... T> void set_foo(T &&...args) { m_foo_cb.set(std::forward<T>(args)...); }

For a case where different delegates need to be used depending on the
function signature, see src/emu/screen.h (the screen update function
setters).

Device delegates now take a target specification and function pointer.
The target may be:
* Target omitted, implying the current device being configured.  This
  can only be used during configuration.  It will work as long as the
  current device is not removed/replaced.
* A tag string relative to the current device being configured.  This
  can only be used during configuration.  It will not be callable until
  .resolve() is called.  It will work as long as the current device is
  not removed/replaced.
* A device finder (required_device/optional_device).  The delegate will
  late bind to the current target of the device finder.  It will not
  be callable until .resolve() is called.  It will work properly if the
  target device is replaced, as long as the device finder's base object
  isn't removed/replaced.
* A reference to an object.  It will be callable immediately.  It will
  work as long as the target object is not removed/replaced.

The target types and restrictions are pretty similar to what you already
have on object finders and devcb, so it shouldn't cause any surprises.
Note that dereferencing a device finder will changes the effect.  To
illustrate this:

    ...
    required_device<some_device> m_dev;
    ...
    m_dev(*this, "dev")
    ...
    // will late bind to "dev" relative to *this
    // will work if "dev" hasn't been created yet or is replaced later
    // won't work if *this is removed/replaced
    // won't be callable until resolve() is called
    cb1.set(m_dev, FUNC(some_device::w));
    ...
    // will bind to current target of m_dev
    // will not work if m_dev is not resolved
    // will not work if "dev" is replaced later
    // will be callable immediately
    cb2.set(*m_dev, FUNC(some_device::w));
    ...

The order of the target and name has been reversed for functoids
(lambdas and other callable objects).  This allows the NAME macro to
be used on lambdas and functoids.  For example:

    foo.set_something(NAME([this] (u8 data) { m_something = data; }));

I realise the diagnostic messages get ugly if you use NAME on a large
lambda.  You can still give a literal name, you just have to place it
after the lambda rather than before.  This is uglier, but it's
intentional.  I'm trying to drive developers away from a certain style.
While it's nice that you can put half the driver code in the memory map,
it detracts from readability.  It's hard to visualise the memory range
mappings if the memory map functions are punctuated by large lambdas.
There's also slightly higher overhead for calling a delegate bound to a
functoid.

If the code is prettier for trivial lambdas but uglier for non-trivial
lambdas in address maps, it will hopefully steer people away from
putting non-trivial lambdas in memory maps.

There were some devices that were converted from using plain delegates
without adding bind_relative_to calls.  I fixed some of them (e.g.
LaserDisc) but I probably missed some.  These will likely crash on
unresolved delegate calls.

There are some devices that reset delegates at configuration complete or
start time, preventing them from being set up during configuration (e.g.
src/devices/video/ppu2c0x.cpp and src/devices/machine/68307.cpp).  This
goes against the design principles of how device delegates should be
used, but I didn't change them because I don't trust myself to find all
the places they're used.

I've definitely broken some stuff with this (I know about asterix), so
report issues and bear with me until I get it all fixed.
2019-10-26 12:47:04 +11:00
Vas Crabb
32868b8e2a srcclean (nw) 2019-10-26 10:40:50 +11:00
Vas Crabb
7c8607e42c (nw) at least try to be const-correct 2019-10-24 01:13:54 +11:00
Zoë Blade
5854f09b4d Fix spelling, tidy whitespace 2019-10-21 19:40:49 +11:00
couriersud
b09fa00cca Netlist: code maintenance and improvements. [Couriersud]
- Added support for line markers to the preprocessor and parser.
- Added support for include processing to the preprocessor.
- Moved sources base type to plib to be used for preprocessor includes.
  This enables to include e.g. from rom memory regions.
- Renamed some defines
2019-10-18 17:57:55 +02:00
couriersud
db318046c4 Netlist: code maintenance and bug fixes. (nw)
- solver now uses dynamic allocation on systems larger than 512x512
- fixed osx build
- moved nl_lists.h classes to plists.h
- fixed netlist makefile clint section
- readability and typos
2019-10-17 10:21:00 +02:00
couriersud
55f1dfafc2 Netlist: pongf update and code maintenance. [Couriersud]
After the recent string of updates pongf performance increased again.
Also includes code maintenance and some fixes for the aligned memory
operations.
2019-10-16 13:57:54 +02:00
Robbbert
68db9fd99a (nw) fixed compile error on gcc 5.3 . Apologies in advance if it breaks other compilers/versions. 2019-10-16 16:10:42 +11:00
couriersud
e5cceda218 Netlist: code maintenance and bug fixes. [Couriersud]
- optimized the core queue dispatching logic. Minor performance
increase.
- fixed a number of bugs in parray. Now parray<double, 0> will be purely
dynamic allocation with the number of elements passed in the
constructor.
- Added noexpr where appropriate.
- Simplified the queue

Checked with gcc-7 (ubuntu), gcc-9, clang-10, macosx clang 10, mingw
cross compile on linux.
2019-10-15 23:36:48 +02:00
couriersud
6daeb4b4d1 netlist: Use unique_ptr where possible. (nw)
Also improve code readability.
2019-10-15 11:30:05 +02:00
couriersud
a89b7d194d netlist: mame netlist reorganization. [Couriersud]
- moved netlists out of driver code into audio/ or machine/ as
nl_xxx.cpp files.
- identified and documented extended validation
- updated arcade, mess and nl targets
2019-10-13 16:45:30 +02:00
couriersud
777f93b083 netlist: fix issues with 1x1 matrix. [Tafoid]
- fixes gamemachine.cpp, breakout.cpp
2019-10-12 21:57:26 +02:00
couriersud
8f83e4392f netlist: code maintenance (nw)
- clang lint and pedantic fixes
- mat_cr.h: separate solving linear systems from underlying matrix
2019-10-12 19:36:50 +02:00
couriersud
161cc143a5 netlist: code maintenance. (nw)
- some readability improvements
- some simplifications
- kidniki uses frontiers again (speed improvement)
2019-10-11 18:36:40 +02:00
couriersud
17ae349ce6 netlist: fix error on compilers having issues with std::pair. (nw) 2019-10-08 00:32:25 +02:00
couriersud
545f8069ef netlist: maintenance and lint fixes. (nw) 2019-10-06 23:50:13 +02:00
couriersud
de6b84a533 netlist: More unique_ptr use. GMRES update, new preconditioner (nw) 2019-10-06 15:58:23 +02:00
couriersud
2de7ed7ddc netlist: more code cleanup. (nw)
- avoid duplication in solver parameter code
- matrix sort type is now a parameter
2019-10-05 01:26:54 +02:00
hap
3bd43b4f49 aviio: increase max size (nw) 2019-10-05 00:15:19 +02:00
couriersud
43cac214a4 netlist: code maintenance (nw)
- Fix SUBMODEL
- move to strongly typed matrix sort constant
- extend maximum matrix size to 512x512
- optionally do parallel processing based on total operations
- templatize GMRES solver loops
2019-10-04 22:34:46 +02:00
Vas Crabb
d8998f5d9b (nw) fix std::array initialisation with GCC5 in nlwav.cpp, stop suppressing -Wterminate now that asserts are really asserts 2019-10-05 00:37:55 +10:00
hap
73e0eb6b4e aviio: dont crash on buffer overflow (nw) 2019-10-04 12:19:01 +02:00
couriersud
9672337a76 netlist: code simplification. (nw) 2019-10-03 15:57:44 +02:00
couriersud
9cefd516a0 netlist: choose the right ostream type. (nw) 2019-09-30 21:13:21 +02:00
couriersud
cc8114f394 netlist: less cpp - more headers (nw)
- move more code in headers - delete some cpp files.
2019-09-29 00:31:30 +02:00
couriersud
545ebe832d netlist: more lint corrections. (nw)
- fixed lint corrections
- added NOLINT where needed
2019-09-28 21:45:59 +02:00
couriersud
1077396473 netlist: Fix more lint warnings/hints (nw) 2019-09-28 12:51:42 +02:00
couriersud
ce612896a8 netlist: Fix a number of minor issues. (nw)
- lint warnings
- remove const on return types
2019-09-27 22:30:33 +02:00
Vas Crabb
9a12ab37af Make osd_printf_* use util/strformat semantics.
(nw) This has been a long time coming but it's here at last.  It should
be easier now that logerror, popmessage and osd_printf_* behave like
string_format and stream_format.  Remember the differences from printf:
* Any object with a stream out operator works with %s
* %d, %i, %o, %x, %X, etc. work out the size by magic
* No sign extending promotion to int for short/char
* No widening/narrowing conversions for characters/strings
* Same rules on all platforms, insulated from C runtime library
* No format warnings from compiler
* Assert in debug builds if number of arguments doesn't match format

(nw) Also removed a pile of redundant c_str and string_format, and some
workarounds for not being able to portably format 64-bit integers or
long long.
2019-09-26 20:53:06 +10:00
Vas Crabb
95ed7c5b5a Merge tag 'mame0214'
MAME 0.214
2019-09-25 20:26:50 +10:00
couriersud
441fb63087 netlist: switch to c++ streams. (nw)
Removed the home-brew implementation pstreams and replaced those with
c++ streams.
2019-09-25 01:10:39 +02:00
npwoods
531633d519 Fixed a compilation bug under clang-cl (#5677)
* Fixed a compiltion bug under clang-cl

Oddly, this problem does not seem to manifest under clang on
gcc.godbolt.org.  I suspect that this might be related to the fact that
sizeof(std::size_t) != sizeof(long) on Windows.

* Couriersud feedback
2019-09-23 20:34:31 -04:00
mooglyguy
1a5bf558cc -avivideo.cpp: Added an image device to provide looping uncompressed AVI frames as input. [Ryan Holtz]
-vino.cpp: Adapted to support both avivideo_image_device and picture_image_device. [Ryan Holtz]
2019-09-23 17:44:05 +02:00
couriersud
8781f5bcc0
Hotfix for nltool.cpp (nw)
Comment out development code.
2019-09-22 19:14:44 +02:00
Vas Crabb
3fefe924a2 fix up srcclean (nw) 2019-09-22 15:11:45 +10:00
Vas Crabb
5036387ab4 srcclean (nw) 2019-09-22 13:34:40 +10:00
couriersud
8734df72ea netlist code maintenance (nw)
- prepare move to c++ streams and later std::string
- fix more lint and clang pedantic warnings/errors
- fix some bugs
2019-09-21 22:15:34 +02:00
arbee
6154ea4c8b ap2_dsk: recognize ProDOS 2.5 boot block (nw) 2019-09-20 07:50:36 -04:00
couriersud
500ca5b8fc netlist code maintenance. (nw)
- remove a lot of c library use and instead use c++
- improved pstring compatibility to std::string
- prepare removal of pstream
2019-09-17 21:05:01 +02:00
AJR
7481f6871a Make bitmap8_t, bitmap16_t, bitmap32_t and bitmap64_t specializations of one class template (nw) 2019-09-16 22:21:29 -04:00
couriersud
29575e4704 Fix SUBTARGET nl and move netlist makefile to gcc-9. (nw) 2019-09-10 21:40:24 +02:00
couriersud
7dea07a3ba netlist: Fix exception on MacOSX [Couriersud]
Some unknown system library seems to force the use of the global locale
on OSX. This is not the case for other *nix or Windows builds. This
commit fixes this by forcing the C locale in pfmt.
2019-09-10 21:37:36 +02:00
fulivi
d4e2fbd306 HP9845: TACO driver re-written (#5601)
* hp9825: fixed a bug in 9825t

* hp9845: TACO driver re-written from scratch, DC100 tape separated into
a new device, various adaptations

* hp9845: "new TACO" renamed to just "TACO"
2019-09-09 16:05:41 -04:00
Vas Crabb
fde41f3fad render.cpp: print a warning and continue on encountering malformed XML in a layout file (nw) 2019-09-08 22:13:02 +10:00
arbee
0dba761f54 apple2: fix regression using 35-track disks with the legacy floppy (nw) 2019-08-25 20:41:32 -04:00
68bit
249f9a78d0 flex_dsk: fix the logging of the disk name extension
It had been printing the disk name again.
2019-08-26 10:14:29 +10:00
Vas Crabb
7031c31c00 srcclean (nw)
I'm assuming atronic.cpp was supposed to be Windows-1252 with Euro currency symbol encoding.  Everyone please use UTF-8 for source files.
2019-08-25 13:39:06 +10:00
smf-
2ff56cd342 fix incorrect format string to allow compilation (nw) 2019-08-15 11:41:01 +01:00
ajrhacker
ad4f17e0eb
Merge pull request #5471 from 68bit/floppy-flex-format-rewrite
flex floppy dsk: rewrite to be based on the wd177x dsk format
2019-08-13 07:01:56 -04:00
68bit
1016319747 flex floppy dsk: rewrite to be based on the wd177x dsk format
This now works with both single density and double density floppy disks, and
dynamically identifies boot sector IDs required for 6800 booting, and supports
writing back to the 'dsk' image files.
2019-08-13 14:38:59 +10:00
68bit
10f480911d swtpc09: add a UniFLEX specific floppy format.
The UniFLEX disk format is not compatible with the Flex format. Significantly it
does not use a mix of single density for booting on some double density disks
which makes it simpler - hardware required a new boot ROM to run UniFLEX.
Further, the UniFLEX sector size is 512 bytes versus 256 for Flex, and the
UniFLEX 'SIR' info sector record is completely different to the info on Flex
disk, and the file system format is also not at all compatible.

Thus the UniFlex format can rely largely on the WD17xx format, with an
overload to handle the sector numbering on the second side continuing from the
first side (one feature in common with the Flex format). This gives a quick
'save' capability and shares code.

Support for 8" disks is included as this was the initial distribution format
and the only one found so far.
2019-08-13 13:42:13 +10:00
arbee
cea22e64e7 ap2_dsk: recognize ProDOS 2.5 boot block (nw) 2019-08-08 20:25:37 -04:00
Justin Kerk
490709a6c1 Fix build in newer Emscripten versions (nw) 2019-08-08 14:23:12 +00:00
Christian Groessler
22f96480b1 add write support for Olivetti M20 floppy images
m20_dsk.cpp: add write support
floptool.cpp: add m20 format support
2019-08-06 00:14:51 +02:00
Dirk Best
b12e24a388 juku: Floppy now (partially) works
The CPU tries to read data in a tight loop, so there must be
some way for it to be halted until data is ready. The current
solution works good enough to boot CP/M.

Also:

- Change FDC to KR1818VG93
- Change disk format from 3.5" to 5.25"
- Add single sided disk format
- Add softlist
2019-08-05 17:25:51 +02:00
AJR
8013c43adf Use canonical spelling of "canonical" (nw) 2019-08-02 12:12:04 -04:00
Dirk Best
8632105397 juku: Floppy support WIP, enable BASIC 2019-08-02 16:15:04 +02:00