Commit Graph

13294 Commits

Author SHA1 Message Date
Sven Schnelle
3e04e969af topcat: remove MCFG, implement irq, fix some minor issues (nw) 2018-10-10 19:19:16 +02:00
Sven Schnelle
7b48d52e94 rtc: add leap year support (nw)
msm53821:

- add standard register support
- use std::array
- fix several counter to behave like a real MSM53821
2018-10-10 14:21:30 +02:00
hap
db00f29891 video.h: get rid of LCD_FRAMES_PER_SECOND (nw) 2018-10-10 09:42:52 +02:00
R. Belmont
7b42e2f799
Merge pull request #4030 from tlindner/fix_connonical_options
Fix canonical command line option.
2018-10-07 11:38:09 -04:00
hap
4d2407128c speaker: added rear_center (nw) 2018-10-05 13:28:31 +02:00
hap
62b6a49768 namcos22: redo video params (nw) 2018-10-05 13:08:48 +02:00
mooglyguy
f5dfaff417 debugcpu: Fixed watchpoints for CPUs with a negative address shift. [Ryan Holtz] 2018-09-30 19:46:17 +02:00
AJR
63483b060e New machines marked as NOT_WORKING
----------------------------------
Falco 5220 [Al Kossow]
2018-09-27 11:16:01 -04:00
tim lindner
127bce35cf Fix connonical command line option. 2018-09-25 22:33:06 -07:00
AJR
f65e1c2a32 hazl1420: Add interrupts and hook up DIP switches through I/O expanders (nw) 2018-09-24 15:39:44 -04:00
AJR
70697c12a8 Fix debugger memory view editing for address-shifted spaces 2018-09-24 15:14:16 -04:00
AJR
dd0b82a670 Fix debugger memory view editing for address-shifted spaces 2018-09-24 14:39:20 -04:00
Vas Crabb
250c06a4d7 srcclean (nw) 2018-09-23 12:22:35 +10:00
David Haywood
ccded2bf8b Namco System 21 and other related refactors (#4013)
* namco checkpoint (including cam900 submission)

* move code into device (nw)

* start splitting DSP support code into devices (nw)

* fix crash (nw)

* prepare for further splitting (nw)

* move code for C67 based DSP PCB into it's own device (nw)

* survive F3 resets without crashing or breaking the 3D (nw)

* less magic numbers (nw)

* optional -> required
don't use fake bootstrap on older type, suspend CPU instead

* restore CPU yield hack for solvalou (nw)

* (nw)

* give galaxian3 some DSPs (nw)

* address hap's concern with a different workaround since MAME is awkward (nw)

* split namco21 driver into 3 drivers as the different configurations really are entirely different boardsets with similar components, not a real 'system'
emulated entire PCB set for driveyes ( http://www.tvspels-nostalgi.com/Bilder/PCB/Namco/driverseye_cage_inside.jpg ) although how the PCBs communicate is not yet known (C139 maybe, which might also be an MCU)

* remove empty file (nw)

* actually thinking about it, this is cleaner (nw)

* mark cybsledj as World instead, there's nothing about this set other than the CY1 code to indicate that it's a Japanese set, and I don't think the Namco codes represent region, just release order.

* newline (nw)

* newline (nw)
2018-09-21 15:01:12 -04:00
AJR
fb0d3803aa esprit.cpp: Updates (nw)
- Derive clocks from actual XTALs
- Raw screen parameters
- Character width is 9, not 8
- Separate configurations (different enough now)
- Remove MCFG configuration macros
- Add and map various devices, particularly for esprit3
- Note undumped (though probably unused) R6531 mask ROM
2018-09-21 11:44:19 -04:00
Vas Crabb
2993e850bb (nw) fix lots of inadverently mutable static pointers 2018-09-20 11:42:37 +10:00
Vas Crabb
7014716003 (nw) hey GLIBC maintainers - how about you use reserved _NAMES like you're supposed to for your macros, and stop #defining random words? it makes writing portable code hard. 2018-09-20 00:02:31 +10:00
Vas Crabb
b5758f5273 Re-write serial mouse support:
* Separate Microsoft 2-button mouse and Logitech 3-button Microsoft-compatible mouse
* Add Microsoft wheel mouse
* Make Mouse Systems mouse behave more realistically
* Add Mouse Systems "rotatable" mouse
* Simplify code and eliminate timers

(nw) X/Y translation and buttons works for all devices.  The wheel on
the wheel mouse seems to be transmitting the right data, and CuteMouse
detects the wheel as being present, but no software seems to support it
properly.  Software supporting the Mouse Systems "rotatable" mouse is
very rare - typically people just set the DIP switches on their M-1 for
"non-rotatable" mode.  A standard mouse driver will see the "rotatable"
mouse moving two mickeys for each count, and move eratically on
rotation.  The "rotable" mouse is poorly tested due to lack of software.

(nw) MAME doesn't have a proper input type for a mouse wheel, and it
doesn't seem to be possible to map the host mouse wheel to an axis when
configuring inputs.  The default mapping ends up assigining the wheel or
rotation to one of the translation axes, which is very unhelpful.
2018-09-19 20:00:56 +10:00
Vas Crabb
96c1be1325 Generate layouts for dual-screen machines rather than loading
dualhsxs.lay - this ensures aspect ratio is correct for non-4:3 screens.

(nw) Also restore internal layouts for multi-screen Game & Watch
systems.
2018-09-18 23:36:00 +10:00
AJR
c33edfd060 ampex210p: Add XTAL values, video RAM, etc. (nw) 2018-09-17 04:06:17 -04:00
AJR
79e605fde6 imds2: Clock corrections and cleanups (nw) 2018-09-13 03:23:41 -04:00
AJR
c19998753b octopus: Configurable clock for the SCN2674 (nw) 2018-09-11 20:57:38 -04:00
Patrick Mackinlay
8919ce5645 interpro: notworking -> networking (#3815)
* interpro: notworking -> networking

These changes combine to make InterPro networking work on Windows with the TAP-Windows6 driver.
* osdnet: add a receive delay (1 frame) after transmit to avoid a time-travel problem
* taptun: pad short Ethernet frames and append FCS (Windows-only until Linux taptun behaviour is verified)
* clipper: fix bugs in carry flag handling, prefer sign bit for tests
* i82586: fix transmit bug, handle reset

* networking: delayed transmit/receive

A second attempt to fix networking on InterPro systems, by introducing somewhat realistic delays into network transmit and receive paths. This version works by adding functions to device_network_interface which enable a device to be informed when the transmit or receive completes. The delay is only crudely approximated based on the specified bandwidth and the number of bytes being transmitted, but it should be good enough in practice. Existing drivers should not be impacted by these changes; overriding the new functions (and no longer overriding recv_cb) is necessary to obtain the new behaviour.

Changes from the previous commit:
* i82586: improve interrupt handling, implement delayed transmit/receive behaviour
* dinetwork: add transmit/receive delay timers, handlers and logic
* osdnet: remove receive delay, add the ability to start the receive timer
2018-09-04 19:26:58 +10:00
smf-
c133d80173 memory: Fix unmapped values with subunits [smf] 2018-08-31 17:48:44 +01:00
Vas Crabb
6cdb89bf44 Merge tag 'mame0201'
MAME 0.201

Conflicts:
	src/emu/render.h
	src/mame/drivers/mastboyo.cpp
	src/mame/drivers/opwolf.cpp
	src/osd/modules/render/drawbgfx.h
2018-08-30 04:03:59 +10:00
Olivier Galibert
badc06d1f5 Fix main fallout (nw) 2018-08-26 23:03:06 +02:00
Vas Crabb
c87777a015 fixup (nw) 2018-08-27 01:30:08 +10:00
mooglyguy
141e1d0a64 Remove debug prints, nw 2018-08-26 16:46:30 +02:00
mooglyguy
8105b73548 -bgfx: Improved rendering with artwork by 5-10x or more. [Ryan Holtz] 2018-08-27 00:32:15 +10:00
mooglyguy
cd3cbf5603 -bgfx: Improved rendering with artwork by 5-10x or more. [Ryan Holtz] 2018-08-26 16:26:52 +02:00
smf-
d629034f52 added devcb workround to allow mitsumi keyboard to build with visual studio (nw) 2018-08-26 23:23:25 +10:00
Olivier Galibert
dd64cdceee emumem: Fix ioports/membanks in internal maps [O. Galibert]
PS: That may break things, we'll see.
2018-08-26 10:36:30 +02:00
smf-
03adeab064 added devcb workround to allow mitsumi keyboard to build with visual studio (nw) 2018-08-26 08:53:19 +01:00
Vas Crabb
e1ffc337ff srcclean and manual fixup (nw) 2018-08-26 13:50:14 +10:00
AJR
ac355d1559 Apply logical address mask properly in debug disassembly view
Associated core changes (nw)
- Move definition of address_space_config from dimemory.cpp to emumem.cpp (declaration was already in emumem.h)
- Add getters for more members of address_space_config with future privatization in mind (nw)
2018-08-24 22:20:54 -04:00
mooglyguy
f10c6be54f ds1315, ds1386, ds2404, ds75160a, ds75161a, eeprom, eepromser, eeprompar: Removed MCFG, nw 2018-08-23 18:34:21 +02:00
AJR
56ee4e784c screen.h: Fix have_screen_update(), which was broken and returned false under any valid configuration, and rename the function has_screen_update(). This fixes regressions in granny and other drivers using custom update functions with CDP1861, CDP1864 and TMS992x VDPs.
tms9928a: Eliminate the clock validity check, which has fulfilled its purpose (nw)
2018-08-22 18:23:12 -04:00
smf-
2ed5eafa69 Optimise start up by delaying the state save sort and check for duplicates until all the devices have been started. This has the most visible effect on vgmplay because it registers over thirty thousand state save entries. [smf] 2018-08-22 17:21:03 +01:00
AJR
154276d260 New machines marked as NOT_WORKING
----------------------------------
WY-100 [Al Kossow]
Z-29 [Al Kossow]
2018-08-21 23:00:49 -04:00
AJR
b3e306b985 divideo: Fetch screen to be potentially configured during device_config_complete (nw)
- Allow device finder to be used as an argument for set_screen (nw)

screen: Calculate physical aspect ratio whenever required, not in device_config_complete, since the renderer caches the result anyway (nw)

cdp1861, cdp1864: Eliminate the "magic reference" constructors, doing their work in device_config_complete instead (nw)
2018-08-21 09:04:09 -04:00
AJR
67cc4b9c44 Fix scrolling glitch in memory view when address expression is applied 2018-08-12 16:35:51 -04:00
AJR
708d928214 Don't apply logical address masks to physical addresses in debug memory accesses (nw) 2018-08-12 10:02:23 -04:00
AJR
a459faa90f Emulate V33/V53 expanded addressing mode, including BRKXA and RETXA instructions
Mask address expressions correctly in debug memory view when using physical addresses beyond logical limits
2018-08-12 02:11:58 -04:00
AJR
a632b01217 xtal.cpp: Definition to be used later (nw) 2018-08-11 19:51:14 -04:00
AJR
7e592bc3de Revert "Send LF with CR when using natuaral keyboard on systems with a line feed key"
This reverts commit 409c0663bc.
2018-08-11 11:20:58 -04:00
AJR
9949ec3747 rt1715: Clock correction (nw) 2018-08-11 01:48:54 -04:00
AJR
f5321e1b23 Misc. fixes for recent commits (nw) 2018-08-10 13:44:24 -04:00
AJR
409c0663bc Send LF with CR when using natuaral keyboard on systems with a line feed key 2018-08-10 11:48:56 -04:00
Olivier Galibert
e78ca34bac memory,devcb: Put capabilities at parity [O. Galibert] 2018-08-10 09:47:03 +02:00
smf-
2c31275f79 sound_stream::sample_rate() was broken since adding support for setting a zero rate, nothing appears to rely on it (nw) 2018-08-09 20:34:19 +01:00
AJR
e41f07fb53 act5a: Move to separate driver; identify what 9316 ROMs do; add keys and DSW definitions (nw) 2018-08-08 17:25:50 -04:00
mooglyguy
0f028a8bd2 -mac: MACHINE_CONFIG removal, nw 2018-08-04 23:03:13 +02:00
Olivier Galibert
d6d228f5f1 I did say it would be dreafully stupid (nw) 2018-08-03 12:40:50 +02:00
Olivier Galibert
639c9b85fc memory: Allow simplified versions of handlers [O. Galibert]
A standard memory handler has as a prototype (where uX = u8, u16, u32 or u64):
  uX device::read(address_space &space, offs_t offset, uX mem_mask);
  void device::write(address_space &space, offs_t offset, uX data, uX mem_mask);

We now allow simplified versions which are:
  uX device::read(offs_t offset, uX mem_mask);
  void device::write(offs_t offset, uX data, uX mem_mask);

  uX device::read(offs_t offset);
  void device::write(offs_t offset, uX data);

  uX device::read();
  void device::write(uX data);

Use them at will.  Also consider
(DECLARE_)(READ|WRITE)(8|16|32|64)_MEMBER on the way out, use the
explicit prototypes.

Same for lambdas in the memory map, the parameters are now optional
following the same combinations.
2018-08-02 21:08:47 +02:00
Vas Crabb
cdb956fd34 (nw) apparently msys glibstdc++ doesn't have that std::abs overload... 2018-08-02 23:42:19 +10:00
Vas Crabb
6ea9ff9042 (nw) Further layout work:
* Allow <orientation> and <color> to work on group references
* Fix some corner cases where group bounds could be miscalculated
* Fix a corner case where MAME could incorrectly refuse to instantiate groups
* Add more checks to complay.py
* Document more of the layout format
2018-08-02 23:11:17 +10:00
mooglyguy
b5ff656e9a -c1541, c1571, c2031, c1551, rastersp: Removed MCFG and MACHINE_CONFIG usage. [Ryan Holtz]
-model3: Some basic MACHINE_CONFIG cleanup, nw

-pla: Added PLS100 device, nw
2018-08-01 04:45:25 +02:00
Vas Crabb
781d943b36 (nw) more layout documentation 2018-07-31 21:40:20 +10:00
Vas Crabb
8999ac2c15 (nw) add warning comment to dangerous API
I'm not sure this API is a great idea - see inline comment on 796abaf7f3

I realise it seems intuitive, but it breaks with a use-after-free (not even a
validity error) if you replace/remove the target device.  Implementing it in a
way that isn't fragile and doesn't hurt the performance of -romident,
-validate and -listxml seems impossible.  If it causes developer confusing and
things start breaking, back to literal tags we go for this case.
2018-07-31 16:12:22 +10:00
AJR
279d066e1b devfind.h: Fix the build by removing calls that don't exist when DeviceClass happens to be an interface (nw) 2018-07-31 00:12:07 -04:00
mooglyguy
0f21c3fc3a -8042kbdc, mb89352, mc6854: Removed legacy devcb accessors. [Ryan Holtz] 2018-07-31 04:56:22 +02:00
Olivier Galibert
796abaf7f3 devfind: Allow set_tag() with a reference or a pointer to a device [O. Galibert] 2018-07-30 23:40:54 +02:00
Vas Crabb
0ce07a8a1e (nw) more render work:
* Clean up some corner cases in layouts with repeating blocks
* Make complay.py validate many more elements and attributes
* Make complay.py easier to use for just validating a layout
* Remove redundant view from Sega VMU layout
* Make buttons visually respond to input in whousetc.lay
* Add view with LED displays as well as terminal for aim65_40 and use repeats
* Clean up some outdated "game" terminology in clifront.cpp
* Initiaise a couple of members in tap/tun network module
* Start documenting layout format
2018-07-31 04:18:28 +10:00
smf-
c70d3cf470 don't try to update m_totalcycles on devices with a zero clock, as it will crash. (nw) 2018-07-29 16:02:01 +01:00
smf-
c41cf669b8 Revert part of 20b5f5d0e6 2018-07-29 16:02:00 +01:00
smf-
3a732c9b1c Fix setting sample rate back to zero & crash for synchronous streams when rate is zero. This fixes all reported bugs. (nw) 2018-07-29 13:47:56 +01:00
Olivier Galibert
64afd77e7c Revert part of 20b5f5d0e6
This is damn sensitive code, and generates differences all over the
place we don't really explain.  The changes should be justified by
themselves and tested in collaboration with Tafoid to ensure the
differences are not a problem.
2018-07-29 13:07:56 +02:00
Vas Crabb
9164b0c5bd ignore SVG dimensions, like we always did (nw) 2018-07-28 15:04:40 +10:00
smf-
20b5f5d0e6 vgmplay: start all clocks at zero and reset all sound chips on a song change [smf] 2018-07-27 23:31:57 +01:00
Olivier Galibert
f9b28ee6f5 Prevent aggressive incompetence (nw) 2018-07-27 22:34:45 +02:00
Vas Crabb
2968620098 make rectangle work better with constexpr, change many things to use designated getters/setters (nw) 2018-07-28 02:27:53 +10:00
AJR
a1c3a96a83 Mask address expressions in debug disasm view 2018-07-26 22:12:55 -04:00
AJR
8de41654fa debugcpu.cpp: Move scripting functions down into console (nw) 2018-07-26 14:41:14 -04:00
AJR
6024c958b9 debug/express.cpp: Use std::deque for token stack (nw) 2018-07-26 14:40:44 -04:00
Vas Crabb
9db24aa2e9 Better support for screen orientation/geometry:
* Eliminates the need for the horizontal/vertical/LCD/SVG layout files
* Screens can now have orientation and physical aspect ratio specified
* RASTER/VECTOR defaults to 4:3, LCD/SVG defaults to square pixels at config time
* System orientation is applied on top of screen orientation

Automatically generated single-screen views and orientation flags in XML
output now work correctly for systems with multiple screens in different
geometries/orientations, e.g. housemnq, rocnms, stepstag, or netmerc.

The "core rotation options" only interact with system orientation.
Allowing multi-screen systems to work well with one monitor per emulated
screen is a complex topic.  System orientation also affects the GFX
viewer while screen orientation doesn't.  The orientation displayed in
the system selection menu is from the system orientation.

Let me know if I've broken any systems or use cases.

Also, add save state support for std::array/C array nested to any depth.
2018-07-26 23:11:02 +10:00
Patrick Mackinlay
890ae60839 nscsi_cd: support media changes (nw)
Together, these changes enable softlist CD-ROM media changes for InterPro, and presumably other nscsi_cd systems. Haven't looked into how other CD-ROM devices work, but the romload fix should apply equally to them too.
* nscsi_cd: detect and respond to media changes
* romload: fix disk entry processing
2018-07-23 20:42:08 +07:00
Vas Crabb
c0ab1c5aa4 (nw) srcclean and some cleanup:
* Make more #include guards follow standard format - using MAME_ as the prefix makes it easy to see which ones come from our code in a preprocessor dump, and having both src/devices/machine/foo.h and src/mame/machine/foo.h causes issues anyway
* Get #include "emu.h" out of headers - it should only be the first thing in a complilation unit or we get differences in behaviour with PCH on/off
* Add out-of-line destructors to some devices - it forces the compiler to instantiate the vtable in a certain location and avoids some non-deterministic compiler behaviours
2018-07-22 20:41:57 +10:00
Vas Crabb
6669489679 allow repeating elements and groups - useful if you need e.g. a lot of numbered labels, but it limits complay.py's ability to check for invalid references as it can't evaluate expressions (nw) 2018-07-22 09:52:50 +10:00
Vas Crabb
035a37c914 remember to unwind if environment changes (nw) 2018-07-22 06:19:26 +10:00
Vas Crabb
dce955c68d rendlay: allow user variables and repetition in layouts, also add a few more predefined variables 2018-07-22 03:22:31 +10:00
mooglyguy
eed782f1e3 ps2sony: Some basic VU1 support, major file reshuffling, nw 2018-07-21 10:07:00 +02:00
AJR
445c94120b pc9801.cpp: Eliminate bogus XTALs (nw) 2018-07-21 00:39:21 -04:00
Vas Crabb
f432c4475a render: improve behaviour in general for systems with two screens (sorry about occasional extra warning messages, it's unavoidable) 2018-07-20 02:38:09 +10:00
Vas Crabb
f18c7cd65f Allow per-device internal layouts and remove some more MCFG_ macros.
Input and screen tags are now resolved relative to a layout's owner
device.

Easy way to demonstrate is with: mame64 intlc440 -tty ie15

Previously you'd only get the IE15 terminal's layout and you'd be unable
to use the INTELLEC 4/40 front panel.  Now you'll get the choice of
layouts from both the system and the terminal device in video options.
2018-07-16 16:26:01 +10:00
Olivier Galibert
177731f5dc Fix some watchpoints (nw) 2018-07-13 15:20:08 +02:00
Vas Crabb
1ee5c62a21 cleanup (nw) 2018-07-12 11:14:59 +10:00
Olivier Galibert
d5d82fa30a Watchpoint fixes (segfaults, wpclear not clearing) (nw) 2018-07-09 23:39:29 +02:00
Vas Crabb
82c6d7dbc5 Allow layouts to specify screen tags rather than indices - makes order of instantiation irrelevant in Model 1 etc. 2018-07-10 04:26:57 +10:00
Vas Crabb
25ee3f9c3f I give in, GCC is screwed (nw) 2018-07-09 19:20:17 +10:00
AJR
a7758702e2 v550: Add main XTAL and derived clocks (nw) 2018-07-08 13:21:16 -04:00
Vas Crabb
ee2cfba202 Hand the delegate mask down the line (nw) 2018-07-08 21:51:17 +10:00
Vas Crabb
1122abfcee if this doesn't work around GCC 8, file a bug with GNU (nw) 2018-07-08 15:19:03 +10:00
smf-
ab0a608f99 and again (nw) 2018-07-07 23:13:58 +01:00
smf-
fe52b5ddfc where did that come from (nw) 2018-07-07 23:11:04 +01:00
smf-
e0dd06bbf4 remove typename which MSVC wanted, will try to find another way (nw) 2018-07-07 23:07:15 +01:00
AJR
dc43087ee5 devcb.h: Looks like GCC does require typename (nw) 2018-07-07 17:48:57 -04:00
AJR
c8f77c0d3d devcb.h: Further attempted GCC build fixing (nw) 2018-07-07 17:46:52 -04:00
AJR
2b802ba442 devcb.h: Attempted fix for GCC build (nw) 2018-07-07 17:36:51 -04:00
smf-
faac6a63e7 Fixes for building with Microsoft Visual Studio 2015. (nw) 2018-07-07 21:46:01 +01:00
Vas Crabb
28ffb7fb98 stupid helper (nw) 2018-07-08 00:48:57 +10:00
smf-
b747b711bb fix building with clang 6.0.1 (nw) 2018-07-07 11:28:01 +01:00
Vas Crabb
27d0cb90ff (nw) well that was dumb - fix crashing ATA devices, slightly modernise some code 2018-07-07 09:37:57 +10:00
Vas Crabb
c3fb11c2c9 devcb3
There are multiple issues with the current device callbacks:
* They always dispatch through a pointer-to-member
* Chained callbacks are a linked list so the branch unit can't predict the early
* There's a runtime decision made on the left/right shift direction
* There are runtime NULL checks on various objects
* Binding a lambda isn't practical
* Arbitrary transformations are not supported
* When chaining callbacks it isn't clear what the MCFG_DEVCB_ modifiers apply to
* It isn't possible to just append to a callback in derived configuration
* The macros need a magic, hidden local called devcb
* Moving code that uses the magic locals around is error-prone
* Writing the MCFG_ macros to make a device usable is a pain
* You can't discover applicable MCFG_ macros with intellisense
* Macros are not scoped
* Using an inappropriate macro isn't detected at compile time
* Lots of other things

This changeset overcomes the biggest obstacle to remving MCFG_ macros
altogether.  Essentially, to allow a devcb to be configured, call
.bind() and expose the result (a bind target for the callback).  Bind
target methods starting with "set" repace the current callbacks; methods
starting with "append" append to them.  You can't reconfigure a callback
after resolving it.  There's no need to use a macro matching the
handler signatures - use FUNC for everything.  Current device is implied
if no tag/finder is supplied (no need for explicit this).

Lambdas are supported, and the memory space and offset are optional.
These kinds of things work:
* .read_cb().set([this] () { return something; });
* .read_cb().set([this] (offs_t offset) { return ~offset; });
* .write_cb().set([this] (offs_t offset, u8 data) { m_array[offset] = data; });
* .write_cb().set([this] (int state) { some_var = state; });

Arbitrary transforms are allowed, and they can modify offset/mask for example:
* .read_cb().set(FUNC(my_state::handler)).transform([] (u8 data) { return bitswap<4>(data, 1, 3, 0, 2); });
* .read_cb().set(m_dev, FUNC(some_device::member)).transform([] (offs_t &offset, u8 data) { offset ^= 3; return data; });

It's possible to stack arbitrary transforms, at the cost of compile
time (the whole transform stack gets inlined at compile time).  Shifts
count as an arbitrary transform, but mask/exor does not.

Order of mask/shift/exor now matters.  Modifications are applied in the
specified order.  These are NOT EQUIVALENT:
* .read_cb().set(FUNC(my_state::handler)).mask(0x06).lshift(2);
* .read_cb().set(FUNC(my_state::handler)).lshift(2).mask(0x06);

The bit helper no longer reverses its behaviour for read callbacks, and
I/O ports are no longer aware of the field mask.  Binding a read
callback to no-op is not supported - specify a constant.  The GND and
VCC aliases have been removed intentionally - they're TTL-centric, and
were already being abused.

Other quirks have been preserved, including write logger only logging
when the data is non-zero (quite unhelpful in many of the cases where
it's used).  Legacy syntax is still supported for simple cases, but will
be phased out.  New devices should not have MCFG_ macros.

I don't think I've missed any fundamental issues, but if I've broken
something, let me know.
2018-07-07 02:40:29 +10:00
Vas Crabb
d4e6275690 misc cleanup and stuff to make macro removal easier (nw) 2018-07-05 23:05:45 +10:00
mooglyguy
9d509bd29c Fix divtlb crash, nw 2018-07-05 13:14:18 +02:00
Olivier Galibert
5725df5542 *DUH* (nw) 2018-07-04 16:44:43 +02:00
Olivier Galibert
5d04fdd06a Ensure split accesses are always done in increasing addresses order (nw) 2018-07-04 10:07:40 +02:00
Olivier Galibert
71d4e521d8 Various watchpoint fixes (nw) 2018-07-01 22:03:51 +02:00
Olivier Galibert
b184ebfd9d Brown paper bag time (nw) 2018-06-30 10:59:11 +02:00
AJR
7c18a71442 A better way to make friends (nw) 2018-06-29 18:29:37 -04:00
Olivier Galibert
39c514fada Fix msvc (?) problem (nw) 2018-06-29 23:19:13 +02:00
Olivier Galibert
b511b8ff39 Oops (nw) 2018-06-29 22:54:21 +02:00
Olivier Galibert
a704ed7b1b emumem: Backend modernization [O. Galibert] 2018-06-29 20:04:28 +02:00
mooglyguy
eb5a8a3dc8 -ps2sony: Fleshing out the skeleton driver. [Ryan Holtz]
* Added ps2timer device to encapsulate Playstation 2 timers.
  * Temporarily hacked R5900 core to always have scratchpad RAM mapped at 0x70000000.
  * Added reference counting to divtlb so that it does not unmap pages that are still shared with other entries.
  * Added a considerable amount of logging to ps2sony.cpp.

-mips3: Added basic Emotion Engine support. [Ryan Holtz]
  * Added S bit to TLB mapping.

  * Added support for VSUB, VIADD, VSQI, VISWR, VOR, LQ, SQ, MFSA, MTSA, MFHI1, MFLO1, MULT1, DIV1, DIVU1, PEXTLW, PADDUW, PMFHI,
  PMFLO, PCPYLD, PCPYUD, SQC2, LQC2 opcodes. [Ryan Holtz]
2018-06-28 18:24:16 +02:00
Vas Crabb
8aa76c1011 Merge tag 'mame0199'
MAME 0.199
2018-06-27 11:54:12 +10:00
AJR
fefcae883f x68000: Compute refresh rates from CRTC parameters and known XTAL values 2018-06-25 20:59:31 -04:00
Vas Crabb
3a1182bdd4 damn PCH (nw) 2018-06-25 14:36:10 +10:00
Vas Crabb
fdc9f38a8e consider double epsilon when comapring crystal values 2018-06-25 14:35:04 +10:00
AJR
b3afc83bde Allow passing std::unique_ptr<TYPE> directly to save_pointer and remove now-superfluous .get() in many drivers/devices (nw) 2018-06-24 09:08:33 -04:00
AJR
297b99c0fa Move ROM loading macros to romentry.h and remove romload.h from emu.h (nw) 2018-06-24 09:05:55 -04:00
Patrick Mackinlay
87e96248f1 debugger: make save/load support virtual memory (nw) (#3683)
This makes these commands useful and consistent with dump in a virtual memory environment. One minor issue is what to do with save for an unmapped memory address: the approach taken here is to write the space.unmap() value, which seems the least harmful. On load, unmapped addresses are not written to, meaning that save/load with a constant address map work as expected.
2018-06-23 17:52:01 +02:00
Patrick Mackinlay
a714997f43 debugger: add command for go_exception (#3682) 2018-06-23 17:41:01 +02:00
hap
0275673dba efdt: XTAL label 14.318 is obviously a common 4*NTSC XTAL (nw) 2018-06-16 15:58:39 +02:00
Vas Crabb
521bf0b88c make it possible to set screen update functions without macros without syntax that looks absolutely terrible - examples will come with devcb3 (nw) 2018-06-16 22:32:22 +10:00
hap
1959691bf6 fidel6502: thanks to Berger's schematics, correct fpres RAM and IRQ and assume same irq on similar boards (nw) 2018-06-16 14:09:11 +02:00
AJR
a69902b460 Remove emupal.h from emu.h (nw) 2018-06-13 14:56:22 -04:00
Vas Crabb
40fb13e6e7 lift some stuff needed by devcb3 out of address map entry (nw) 2018-06-13 13:25:15 +10:00
AJR
54a6f1e9e4 devcb: Despite the variable name, this string is not a tag here (nw) 2018-06-07 21:43:27 -04:00
mooglyguy
b66e57a15c Removed nearly all custom MCFG macros from eepromser, migrated more of policetr to newer syntax, nw 2018-06-07 21:49:11 +02:00
Vas Crabb
93eaa6a494 as if millions of this pointers suddenly cried out in terror, and were suddenly silenced
* streamline templates in addrmap.h
* get rid of overloads on read/write member names - this will become even more important in the near future
2018-06-08 01:29:39 +10:00
Vas Crabb
befb02ba66 Next-gen config: make address map config not look like arse 2018-06-06 23:39:57 +10:00
AJR
1c9092981c diexec.cpp: Better fix for indentation (nw) 2018-06-03 21:00:57 -04:00
AJR
269b06a99b diexec.cpp: Fix formatting and validation mistake (nw) 2018-06-03 19:17:20 -04:00
Ted Green
18edbdcc71 Update dcs audio to get sf2049 closer to working. 2018-06-03 15:34:02 -06:00
mooglyguy
daa92575c4 Point conceded; it is not, at this point, sensible to make m_vblank_interrupt_screen a finder. Indeed, the need for it should be removed from diexec entirely. nw 2018-06-03 21:13:50 +02:00
mooglyguy
df821c674d No. 2018-06-03 19:54:49 +02:00
AJR
7bca70d6fc Back out diexec changes from commit 2cdb153103 (nw) 2018-06-03 13:36:12 -04:00
RobertoFresca
b33e3db5c7 New working machines
--------------------
El Fin Del Tiempo [Esther Barranco, ARPA, Juegos 2.0, Recreativas.org, Roberto Fresca, The Dumping Union]
2018-06-02 09:06:35 -03:00
Vas Crabb
fd41b35c2a (nw) allow BIOS declaration before first ROM region 2018-06-02 03:33:25 +10:00
cracyc
dabbd32a62 osdnet: don't call it close (nw) 2018-06-01 08:41:30 -05:00
cracyc
71046c63c2 osdnet: prevent segfault at stop and when selecting device from menu (nw) 2018-06-01 08:14:05 -05:00
Vas Crabb
ff9123d8ef fixup, improve validation (nw) 2018-06-01 21:50:19 +10:00
mooglyguy
2cdb153103 svis_snd cleanups, nw 2018-06-01 11:41:52 +02:00
Vas Crabb
d96189dfc9 C++14 has one of these in the standard library (nw) 2018-06-01 13:07:01 +10:00
Vas Crabb
062027276e addrmap.h: reduce code duplication and add support for device finders in more places in memory maps 2018-06-01 11:35:02 +10:00
Vas Crabb
44243dcac8 devfind: add asserts to detect being resolved multiple times (nw) 2018-05-31 12:46:34 +10:00
Vas Crabb
550017a2d0 devfind: add asserts to detect tag being set after object resolution (nw) 2018-05-31 12:44:50 +10:00
Vas Crabb
5be75c4a63 Move the +1 to the proper place in the ROM BIOS macros - that's been
confusing people for far too long.  Yes, this is a change in behaviour.

Add a valdiation check for ROMs with BIOS flag set that are
unselectable, fix the things it uncovers.

(nw) Fix other random stuff.
2018-05-29 23:57:09 +10:00
MetalliC
7d77ee4407 motogonki: few more, correct CPU clock, document hidden test mode (nw) 2018-05-27 00:32:55 +03:00
Vas Crabb
c15531dddc srcclean (nw) 2018-05-27 04:48:13 +10:00
Nigel Barnes
c94bfc2f40 acrnsys1: Add XTAL and correct year (nw) 2018-05-25 11:54:37 +01:00
Vas Crabb
5e856f77f6 voodoo: deal with needing to be able to configure screen/CPU or set them at start in a safer way
devfind: revert previous change - if finders aren't set in stone after device_resolve_objects it's going to lead to all kinds of hard-to-diagnose bugs (I'll add more checks for this some time after release)

(nw) also clean up rotting tabulation
2018-05-23 17:25:17 +10:00
AJR
adb6044c4f romload.cpp: Eliminate extraneous machine argument (nw) 2018-05-22 19:58:18 -04:00
Olivier Galibert
fdf0c866e2 Uncrappify voodoo pci devices transfert. Fix some paths on midwayic. (nw) 2018-05-22 22:48:16 +02:00
AJR
1fe4b36065 Fix error in debug build with SMS card options (nw) 2018-05-21 03:01:39 -04:00
AJR
49f354d544 Kludge some absolute tag lookups in the core that can't really be helped (nw) 2018-05-21 01:10:27 -04:00
AJR
7c273f213a Remove some machine().device usage from the core (nw) 2018-05-20 18:39:57 -04:00
AJR
09ab222658 Try to fix the build once again (nw) 2018-05-20 15:19:13 -04:00
AJR
182028ea82 Well, that was a bad typo (nw) 2018-05-20 15:16:18 -04:00
AJR
09ed257925 machine().device(tag) is now deprecated (nw) 2018-05-20 14:24:49 -04:00
wilbertpol
2beba4ce73 Replace set_led_value and set_lamp_value with output_finders. [Wilbe… (#3592)
* Replace set_led_value and set_lamp_value with output_finders.  [Wilbert Pol]

* segaufo: keep the 2 bit lamp outputs
2018-05-20 13:27:20 -04:00
AJR
0ba652e723 diexec: Interrupt API changes (nw)
- PULSE_LINE is no longer a value. Existing uses have been changed to pulse_input_line with attotime::zero as the second argument.
- Formerly only INPUT_LINE_NMI and INPUT_LINE_RESET were allowed with PULSE_LINE. INPUT_LINE_NMI no longer receives special handling; instead, CPU devices must specify which of their input lines are edge-triggered and thus may be used with zero-width pulses by overriding the execute_input_edge_triggered predicate. INPUT_LINE_RESET is still special-cased, however.
- execute_default_irq_vector now allows a different default vector to be specified for each input line. This added flexibility may or may not prove useful.
2018-05-18 13:40:29 -04:00
Vas Crabb
11fa3800f3 prune upfront - makes the other stuff cheaper (nw) 2018-05-18 21:00:54 +10:00
Vas Crabb
74ca2733d0 try this for size - emu.h no net change (nw) 2018-05-18 20:45:39 +10:00
Curt Coder
4d3566cfa7 WARNING emu.h recompile!
debugger: Show save state items in alphabetical order in the debugger view. [Curt Coder]
2018-05-18 13:09:00 +03:00
Vas Crabb
166638ce80 Revert "- Removed MACHINE/SOUND/VIDEO _START/_RESET macros. This has the side effect of making machine-config overrides of these much"
This reverts commit c83e2a853d.

Revert "fix compile. (nw)"

This reverts commit a259ba3e36.

GCC is being bad and allowing invalid C++ that other compilers reject.
2018-05-16 21:56:39 +10:00
MooglyGuy
c83e2a853d - Removed MACHINE/SOUND/VIDEO _START/_RESET macros. This has the side effect of making machine-config overrides of these much
uglier, but this is intended to discourage ongoing use, and will be gradually eliminated.
2018-05-16 11:58:08 +02:00
AJR
4308e2a0c7 sound.cpp: Turn this check into an assert now that the caller should prevent this (nw) 2018-05-15 20:28:54 -04:00
AJR
4f13ab7d12 sound.cpp: Perform the sanity check from a0137c10da in a better place (nw, seems to fix assert error) 2018-05-15 19:28:00 -04:00
Olivier Galibert
a0137c10da sound: If stream->update() is done going back in time (originating from
different devices at a different execution point), don't try to generate
a negative number of samples [O. Galibert]

Not sure why that never happened before.  Oh well.
2018-05-15 19:28:34 +02:00
Vas Crabb
2332572800 More cleanup/streamlining of machine configuration and macros:
* Get rid of implicit prefix for GFX decode names and prefix them all
* Get rid of special macro for adding GFXDECODE in favour of constructor
* Make empty GFX decode a static member of interface
* Allow palette to be specified to GFXDECODE as a device finder
* Removed diserial.h from emu.h as it's used relatively infrequently

Also fix darkseal and vaportra propely.  The palette device
automatically attaches itself to a share with matching tag.  The correct
solution here is to rename one or the other out of the way, since it was
never attached to a share before.
2018-05-15 05:43:28 +10:00
AJR
f3d19e977c Make debugger dump command work with unaligned addresses 2018-05-14 08:08:01 -04:00
Olivier Galibert
b9cc6cc893 Fix NATIVE_MASK, should unbreak all non-zero-address-shift CPUs (nw) 2018-05-13 21:49:40 +02:00
Robbbert
4f0431e85a (nw) Fixed spelling mistakes 2018-05-14 00:15:07 +10:00
MooglyGuy
5cc2319a2e Removed DRIVER_INIT-related macros, made driver init entry in GAME/COMP/CONS explicit. (#3565)
* -Removed DRIVER_INIT macros in favor of explicitly-named member functions, nw

* -Removed DRIVER_INIT_related macros. Made init_ prefix on driver initializers explicit. Renamed init_0 to empty_init. Fixed up GAME/COMP/CONS macro spacing. [Ryan Holtz]

* Missed some files, nw

* Fix compile, (nw)
2018-05-13 22:22:22 +09:00
Sven Schnelle
e6b55ad7a6 Add topcat asic (#3558)
* add topcat template

HP topcat was an ASIC used on HP900/300 graphics cards.

Signed-off-by: Sven Schnelle <svens@stackframe.org>

* hook up topcat asic to HP98544

Signed-off-by: Sven Schnelle <svens@stackframe.org>

* topcat: add basic configuration macros for fb planes, height and width

Signed-off-by: Sven Schnelle <svens@stackframe.org>

* hp98544: move logic to topcat video driver

Preparation to support multi plane graphic cards
like the HP98543/98545/98547.

Signed-off-by: Sven Schnelle <svens@stackframe.org>

* xtal: add 35.904MHz XTAL
2018-05-11 17:17:55 -04:00
cam900
4768a27590 topspeed.cpp : Minor cleanups, Add arrays for reduce duplicates (#3454)
* topspeed.cpp : Minor cleanups, Add arrays for reduce duplicates

* topspeed.cpp : Fix compile

* romload.h : Add macro for when 64 bit ROM data bus case
2018-05-12 02:06:06 +10:00
AJR
cb1c49df0b Make "Keypad ," and "Keypad =" standard keys 2018-05-11 10:31:01 -04:00
Olivier Galibert
74301434ae debug: Simplify now obsolete and buggy memory access code [O. Galibert] 2018-05-11 18:23:04 +09:00
Olivier Galibert
4c24f25845 emumem: Rename direct_read_handler to memory_access_cache. Parametrize the template on more information (data width, endianness) to make it possible to turn it into an handler cache eventually, and not just a memory block cache. Make it capable of large and unaligned accesses. [O. Galibert] 2018-05-11 18:23:04 +09:00
Vas Crabb
6c11b3ce01 dsp16: fix condition mask in disassembler (nw)
(nw) remove more MCFG macros and make speaker config more explicit
2018-05-09 19:26:44 +10:00
Vas Crabb
ecfa838fb5 forgot to git add one line again (nw) 2018-05-08 07:52:32 +10:00
Vas Crabb
4ef4464aec Add support for custom device constructors when replacing devices.
Current syntax: MCFG_DEVICE_REPLACE(tag_or_finder, TYPE, ...)

Next-generation syntax: TYPE(config.replace(), tag_or_finder, ...)

(nw) Kill off some more low-value macros that aren't needed any more,
and get rid of the token-pasting voodoo and casts in the discrete sound
macros.
2018-05-08 07:35:22 +10:00
AJR
93ae59e653 dipalette: Fix faulty assertion that was breaking nes_vt.cpp in debug builds (nw) 2018-05-06 09:29:48 -04:00
Vas Crabb
138b60e6c6 (nw) misc follow-up
Fix MT06964

Fix µPD7759 class hierarchy, and reset callback before resolving it
(fixed assert in Sega C2)

Remove some more low-value device add indirection macros, default some
more clocks

Make cards inherit clock from slot by default
2018-05-06 19:19:48 +10:00
Vas Crabb
4ea3cd0bc1 Streamline machine configuration macros - everyone's a device edition.
Start replacing special device macros with additional constructors,
starting with ISA, INTELLEC 4 and RS-232 buses.

Allow an object finder to take on the target of another object finder.

(For a combination of the previous two things in action, see either the
INTELLEC 4 driver, or the Apple 2 PC Exporter card.  Also check out
looping over a device finder array to instantiate devices in some
places.  Lots of things no longer need to pass tags around.)

Start supplying default clocks for things that have a standard clock or
have all clocks internal.

Eliminate the separate DEV versions of the DEVCB_ macros.  Previously,
the plain versions were a shortcut for DEVICE_SELF as the target.  You
can now supply a string tag (relative to current device being
configured), an object finder (takes on the base and relative tag), or
a reference to a device/interface (only do this if you know the device
won't be replaced out from under it, but that's a safe assumption for
your subdevices).  In almost all cases, you can get the effect you want
by supplying *this as the target.

Eliminate sound and CPU versions of macros.  They serve no useful
purpose, provide no extra checks, make error messages longer, add
indirection, and mislead newbies into thinking there's a difference.

Remove a lot of now-unnecessary ":" prefixes binding things relative to
machine root.

Clean up some miscellaneous rot.

Examples of new functionality in use in (some more subtle than others):
* src/mame/drivers/intellec4.cpp
* src/mame/drivers/tranz330.cpp
* src/mame/drivers/osboren1.cpp
* src/mame/drivers/zorba.cpp
* src/mame/devices/smioc.cpp
* src/devices/bus/a2bus/pc_xporter.cpp
* src/devices/bus/isa/isa.h
* src/devices/bus/isa/isa.h
* src/devices/bus/intellec4/intellec4.h
2018-05-06 00:51:27 +10:00
Vas Crabb
32a73f450d Make MCFG_DEVICE_ADD and callable device types more flexible:
* Allows defaulted clocks (see subtle example with vboy)
* Allows additional constructors (see RS232 port in tranz330)
* Allows use of device finder in place of tag in MCFG_DEVICE_ADD
* Requires out-of-line destructor for devices using incomplete types
* Requires XTAL or explicit u32 for clocks for devices with private types

Devices must still define the standard constructor.  When writing
additional constructors, be aware that the constructor runs before
device_add_mconfig in the context of the existing device, not the new
device.  See osborne1, zorba, tranz330, and vboy for examples of this in
use.  Compilation is a bit slower, but this is temporary while
refactoring is in progress.

Eliminated the need for MCFG_SOUND_ROUTE_EX.

Removed macros from slot option configuration - they just obfuscated
code and slowed it down with needless dynamic casts, but didn't actually
simplify it.
2018-05-04 03:01:32 +10:00
Ivan Vangelista
7d3b4eec89 debughlp.cpp: replaced references to 'decrypted opcodes' with 'opcodes', as suggested (nw) 2018-05-02 19:09:33 +02:00
Vas Crabb
8795d80808 Allow devcb to be bound to a device/mixin or the target of a device
finder.  This works outside machine configuration context so the
workarounds in ATA HLE and MSX slots are no longer necessary.  It also
allows reduction in tag repetition in machine configuration (see
converted osborne1.cpp, zorba.cpp or the more extreme tranz330.cpp).

Allow reimagined device instantiation to take a device finder based on
current device being configured to reduce repetition (see tranz330.cpp).
2018-05-02 14:43:01 +10:00
arbee
dd58d907b6 GCC 8 again (nw) 2018-05-01 22:12:25 -04:00
Vas Crabb
384bf0e510 Route sound relative to current device.
Also, look Ma - no magic prologue!

Slot card additions run in the context of the slot itself, which isn't
entirely intuitive.  Slot configuration needs a bunch of other cleanup
anyway.
2018-05-01 21:35:58 +10:00
Vas Crabb
6487cd2e95 Get rid of the assert replacement. It prevents you from using assert in
a destructor for a literal type due to the implicit nothrow.  It's just
not worth the trouble it's causing.

In file included from ../../../../../src/emu/emu.h:83:
../../../../../src/emu/mconfig.h:70:5: error: '~token' has a non-throwing exception specification but can still throw [-Werror,-Wexceptions]
                               assert(m_device == m_host.m_current_device);
                               ^
In file included from ../../../../../src/emu/emu.h:29:
../../../../../src/emu/emucore.h:230:48: note: expanded from macro 'assert'
 #define assert(x)               do { if (!(x)) throw emu_fatalerror("assert: %s:%d: %s", __FILE__, __LINE__, #x); } while (0)
                                              ^
In file included from ../../../../../src/emu/emu.h:83:
../../../../../src/emu/mconfig.h:66:3: note: destructor has a implicit non-throwing exception specification
               ~token()
               ^
1 error generated.
2018-05-01 04:21:20 +10:00
Vas Crabb
2047471723 Bind devcb relative to current device. This is probably going to break
plenty of things with late bind errors.  Sorry.

Remaining things to switch over include sound routes and things with
custom delegates.
2018-05-01 04:19:51 +10:00
Vas Crabb
b60c852f11 Set finder tag relative to current device being configured rather than
the finder's owner.  This meand you no longer need to care about the
your relationship to the object being configured and a lot of ^ and :
can disappear.  There's a bit reduction in string pasting in macros from
this.

Yes, I have to make this apply to devcb etc. as well, but that's a job
for another day.

There's probably at least one thing broken by this where optional
objects are involved.  Most things can be solved by just getting rid of
the now-problematic ^ and : prefixes.
2018-04-30 23:32:41 +10:00
AJR
1185fb25f3 devcb updates (nw)
- Write callbacks can now be configured as `OUTPUT("item_name")`. This behaves equivalently to a zero-dimensional `output_finder`, while eliminating the need to instantiate and resolve this in driver classes separately from the callback itself.
- The width of a callback's default mask now properly depends on its type (as was half-implemented before), instead of always being reset to 0xffffffffffffffff when actually configured. This allows MCFG_DEVCB_INVERT to work with line write callbacks as one might logically expect.
2018-04-29 19:48:38 -04:00
Vas Crabb
f2568bb918 Make devopt menu localisable.
Make machine_config aware of device being configured so owner doesn't need to be passed everywhere.
2018-04-28 16:34:09 +10:00
Vas Crabb
47d93680d9 duh (nw) 2018-04-28 00:37:54 +10:00
Vas Crabb
57fd28d36a Sarayan made me do it.
Concrete device types now have a call operator that instantiates a
device.

This change means you *must* use DECLARE_DEVICE_TYPE to declare the
public interface of your device, even if it's device_t.  If you want
to use private implementation classes, use DEFINE_DEVICE_TYPE_PRIVATE
and instantiate the object finders.
2018-04-28 00:01:30 +10:00
Vas Crabb
ac79c90607 srcclean (nw) 2018-04-22 09:24:13 +10:00
Olivier Galibert
9ac8320ccc addrmap: Remove the now-unused macros [Vas Crabb, Robbbert] 2018-04-21 16:42:27 +02:00