Commit Graph

45 Commits

Author SHA1 Message Date
cam900
cd8d9575f7 deco16ic.cpp : Move cninja exclusive transmask function into cninja.cpp 2019-03-20 14:20:29 +09:00
Ivan Vangelista
c9922586a3 some more MCFG macros removal (nw) 2019-02-08 18:35:41 +01:00
Vas Crabb
f1f0591f43 Start cleaning up palette configuration:
* Basically, initialisers go in the constructor arguments, and things for setting format go in set_format.
* Initialisation patterns can be specified with an enum discriminator or with a FUNC and optionally a tag.
* Formats can be specified with an enum discriminator or a size and function pointer.
* You must always supply the number of entries when setting the format.
* When initislising with a paletter initialisation member, you can specify the entries and indirecte entries together.
* The palette_device now has a standard constructor, so use .set_entries if you are specifying entry count with no format/initialisation.
* Also killed an overload on delegates that wasn't being useful.
2018-12-29 05:53:50 +11:00
Ivan Vangelista
bb1a1ed956 src/mame: more MCFG removal (nw) 2018-12-06 18:47:12 +01:00
Vas Crabb
e1ffc337ff srcclean and manual fixup (nw) 2018-08-26 13:50:14 +10:00
mooglyguy
f10c6be54f ds1315, ds1386, ds2404, ds75160a, ds75161a, eeprom, eepromser, eeprompar: Removed MCFG, nw 2018-08-23 18:34:21 +02:00
Ivan Vangelista
33983bf43e deco156.cpp: corrected wcvol95 region, thanks to Brian Troha (nw) 2018-08-12 07:02:01 +02:00
Ivan Vangelista
25bec6910e new working clone
-------------------------------
World Cup Volley '95 (Europe v1.0?) [Fabrice Arzeno, The Dumping Union]
2018-08-11 09:36:18 +02:00
David Haywood
6d6b562ffd more private member use in 'D, E, F, G' drivers (nw) (#3704)
* more private member use in 'D' drivers (nw)

* same for 'E' drivers (nw)

* and 'F' (nw)

* 'G' (nw)

(left galaxian/galaxold alone because I know somebody is looking at them)
2018-06-27 15:32:24 +02: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
a69902b460 Remove emupal.h from emu.h (nw) 2018-06-13 14:56:22 -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
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
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
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
04da61a4c5 (nw) checkpoint since Midway SSIO sound is fixed - periodic interrupt doesn't support derived clock, kill off some more low-value macros, add a validity check, fix changes to Okim M6295 pin 7 in vgmplay 2018-05-07 22:41:52 +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
smf-
5336bb02b6 Standardise on IPT_CUSTOM for hooking up custom code in PORT_BIT, leaving IPT_SPECIAL for the UI. [smf] 2018-04-03 11:58:48 +01:00
Vas Crabb
ffd19cda0f Restrict ROM labels to a filesystem- and shell-safe subset of printable
ASCII.

This has not been done unilaterally - I have the support of @galibert,
@Tafoid, and @rb6502 to do something about the current free-for-all.

The trouble with the ROM label field in MAME is that it serves multiple
competing purposes: it's supposed to identify the device in the original
system, and also act as a filename when searching for media image files
to load.  It also has to appear in listings of needed/missing files
(e.g. in cases where the image _isn't_ found).

To identify the original device, the ROM label field in MAME often
contains text derived from some combination of one or more of the text
on a label if present, the silkscreen on an IC package, the location on
the circuit board, and the device designation.  There's no standard for
the order in which these appear and how they're separated.  Some people
add arbitrary filename extensions and other annotations.

There are practical limitations on what can appear in the string, given
it's used as a filename:
* Path/name length limits.
* Restrictions on characters that can appear in a filename.
* Practicality of using the filename in a command-line environment.
* Ambiguity when describing a filename.

Filesystems themselves typically restrict characters in filenames:
* Windows defines MAX_PATH as 260 characters - longer paths are
  difficult to use with Win32 APIs and don't work properly in Windows
  Explorer
* Most filesystems don't allow ^@ or the path separator in names.
* Windows doesn't allow C0 control characters or <>:"/\|?* characters in
  filenames.
* Filesystems may have collation, e.g. FAT16 is case-folding, NTFS and
  HFS+ are case-preserving but case-insensitive, while EXT and XFS are
  case-sensitive.
* Filesystems may perform Unicode normalisation, e.g. NTFS forces NFC,
  HFS+ forces NFD, while ZFS stores filenames as supplied at creation,
  but may be configured to apply normalisation when testing equality.

Shells use various ASCII characters for special purposes:
* C0 control characters for line editing and control (e.g. ^C to cancel
  a line, ^V for control charecter escape, ^R for history search).
* The "'\ chracaters for quoting/escaping.
* The ><| characters for redirection.
* The *?[] characters for pattern matching.
* The ${}~ characters for variable substitution/sequence expansion.
* The ! or ^ characters for history substitution.
* The ()` characters for controlling subshells.
* The %& characters for job control.
* The ; character as a command separator.
* The # character for comments.

There's also the issue of whether users across a range of locales will
be able to type/display characters.  We still don't have good support
for Unicode console output on Windows (std::wcout doesn't seem to work
properly), many users don't install C/J/K fonts, and many users aren't
comfortable entering text in unfamiliar languages.  This means we're
limited to printable ASCII for practical purposes.

The practical limitations mean the subset of "safe" characters is
limited to ASCII digits, either uppercase or lowercase English Latin
(but not both due to collation behaving differently across systems), and
the +,-.=_ punctuation chracters.  We've decided on lowercase, digits,
and safe punctuation.  In addition to this, spaces are allowed, as they
can be quoted/escaped easily enough if no other special characters are
used.

There have been some arguments that allowing uppercase is "more
accurate", but in practical terms it doesn't add much value.  A string
in a C++ program can't represent layout, relative size of text, colour
and shape of the label, text font, graphics, and many other details.  It
also does nothing to address labels with text outside the English Latin
alphabet (e.g. labels with Chinese ideographs).  Besides missing
information, the lack of hard and fast rules means you need to intuit
what a label string in MAME is trying to represent.  There is simply no
substitute for photographs.  There wasn't even any consistency in case
within individual machine sets.  For example, several games in
vigilant.cpp had inconsistent case for "ic" vs "IC" in designation
suffixes, and ibm6850.cpp had inconsistent case for filename extensions
withing a set.  There were sets that used uppercase for text from the
label but not from the part number/PCB location, and vice versa.  It was
a huge mess.

There's some merit to the idea of allowing a wider variety of characters
in the label strings in the source, and mapping to a more restricted set
when searching for files.  However it creates more issues than it
solves.  It would require a change to the XML output to provide both the
label and filename, and a corresponding change to external ROM
management tools.  It would be impractical to do for software lists,
because it would require ROM management tools to implement the exact
same mapping algorithm as MAME.

But that aside, actually doing useful mapping would be impractical.
What would you do with C/J/K ideographs, like the chip labelled
東方不敗 (Dongfang Bubai)?  There's no intuitive way to do the mapping
wtihout incluing something like Unihan data, which would add a lot of
bloat.  Even the, without a language hint the Romanisation would be less
than ideal in many cases (using Chinese reading for Japanese text and
vice versa).  There's still the messy issue of filesystem collation to
deal with.

We do allow full Unicode in comments in the source.  If you want to
provide a more detailed description of a ROM label, that's the place for
it.  You've got more characters available, and the possibility of using
mulitple lines.  There are too many other competing requirements on the
label field in the ROM definitions.
2018-03-18 06:34:43 +11:00
Olivier Galibert
115bb9936c Address maps macros removal, pass 1 [O. Galibert] 2018-03-14 14:07:14 +01:00
Olivier Galibert
c521964316 API change: Memory maps are now methods of the owner class [O. Galibert]
Also, a lot more freedom happened, that's going to be more visible
soon.
2018-02-12 10:04:52 +01:00
AJR
9a1d0535cb decbac06, deckarn, decmxc06, decospr: Set flip screen state without peeking into driver_data (nw) 2018-02-03 19:04:20 -05:00
cam900
1eed9f5783 deco16ic : Split pf1/2 size (#3124)
cninja : cleanup ioprot
2018-01-25 09:29:53 -05:00
cam900
5b9c7cbadd Get rid of nonbuffered_palette_w at decocomn (#3103)
* Get rid of nonbuffered_palette_w at decocomn
backfire.cpp : Palette cleanup
deco156.cpp : Get rid of unused functions, nw
cninja.cpp : Add MCFG_SCREEN_RAWS
dassault : Add MCFG_SCREEN_RAWS, Demote Thunder Zone/Desert Assault with MACHINE_IMPERFECT_GRAPHICS, because blending effects aren't fully emulated

* dassault.cpp : notes
rohga : Demote Nitro Ball / Gun Ball with MACHINE_IMPERFECT_GRAPHICS, because it has priority/blending issue
2018-01-24 22:55:36 -05:00
Olivier Galibert
d0715c830d memory: Deambiguate handlers, also a hint of things to come (nw) 2018-01-19 08:23:19 +01:00
Olivier Galibert
d469cc04bc API Change: Machine configs are now a method of the owner class, and the prototype is simplified [O. Galibert]
Beware, the device context does not follow in MCFG_FRAGMENT_ADD
anymore due to the prototype change.  So creating a device then
configuring through a fragment doesn't work as-is.  The simplest
solution is just to add a MCFG_DEVICE_MODIFY at the start of the
fragment with the correct tag.
2018-01-17 16:11:18 +01:00
Firehawke
9ece34eb21 Revert "Revert "Merge branch 'master' of https://github.com/mamedev/mame""
This reverts commit 54155441e9.
2017-12-13 21:31:27 -07:00
Firehawke
54155441e9 Revert "Merge branch 'master' of https://github.com/mamedev/mame"
This reverts commit f537428e5a, reversing
changes made to 0d70d79810.
2017-12-13 21:01:10 -07:00
Vas Crabb
9bf81912d3 get rid of legacy BITSWAP* (nw) 2017-12-13 19:26:12 +11:00
Dirk Best
ff82930d50 deco156: Palette cleanup 2017-09-22 13:19:01 +02:00
Vas Crabb
0f0d39ef81 Move static data out of devices into the device types. This is a significant change, so please pay attention.
The core changes are:
* Short name, full name and source file are no longer members of device_t, they are part of the device type
* MACHINE_COFIG_START no longer needs a driver class
* MACHINE_CONFIG_DERIVED_CLASS is no longer necessary
* Specify the state class you want in the GAME/COMP/CONS line
* The compiler will work out the base class where the driver init member is declared
* There is one static device type object per driver rather than one per machine configuration

Use DECLARE_DEVICE_TYPE or DECLARE_DEVICE_TYPE_NS to declare device type.
* DECLARE_DEVICE_TYPE forward-declares teh device type and class, and declares extern object finders.
* DECLARE_DEVICE_TYPE_NS is for devices classes in namespaces - it doesn't forward-declare the device type.

Use  DEFINE_DEVICE_TYPE or DEFINE_DEVICE_TYPE_NS to define device types.
* These macros declare storage for the static data, and instantiate the device type and device finder templates.

The rest of the changes are mostly just moving stuff out of headers that shouldn't be there, renaming stuff for consistency, and scoping stuff down where appropriate.

Things I've actually messed with substantially:
* More descriptive names for a lot of devices
* Untangled the fantasy sound from the driver state, which necessitates breaking up sound/flip writes
* Changed DECO BSMT2000 ready callback into a device delegate
* Untangled Microprose 3D noise from driver state
* Used object finders for CoCo multipak, KC85 D002, and Irem sound subdevices
* Started to get TI-99 stuff out of the TI-990 directory and arrange bus devices properly
* Started to break out common parts of Samsung ARM SoC devices
* Turned some of FM, SID, SCSP DSP, EPIC12 and Voodoo cores into something resmbling C++
* Tried to make Z180 table allocation/setup a bit safer
* Converted generic keyboard/terminal to not use WRITE8 - space/offset aren't relevant
* Dynamically allocate generic terminal buffer so derived devices (e.g. teleprinter) can specify size
* Imporved encapsulation of Z80DART channels
* Refactored the SPC7110 bit table generator loop to make it more readable
* Added wrappers for SNES PPU operations so members can be made protected
* Factored out some boilerplate for YM chips with PSG
* toaplan2 gfx
* stic/intv resolution
* Video System video
* Out Run/Y-board sprite alignment
* GIC video hookup
* Amstrad CPC ROM box members
* IQ151 ROM cart region
* MSX cart IRQ callback resolution time
* SMS passthrough control devices starting subslots

I've smoke-tested several drivers, but I've probably missed something.  Things I've missed will likely blow up spectacularly with failure to bind errors and the like.  Let me know if there's more subtle breakage (could have happened in FM or Voodoo).

And can everyone please, please try to keep stuff clean.  In particular, please stop polluting the global namespace.  Keep things out of headers that don't need to be there, and use things that can be scoped down rather than macros.
It feels like an uphill battle trying to get this stuff under control while more of it's added.
2017-05-14 21:44:11 +10:00
Vas Crabb
6c23897483 Self-registering devices prep:
* Make device_creator a variable template and get rid of the ampersands
* Remove screen.h and speaker.h from emu.h and add where necessary
* Centralise instantiations of screen and speaker finder templates
* Add/standardise #include guards in many hearers
* Remove many redundant #includes
* Order #includesr to help catch headers that can't be #included alone

(nw) This changes #include order to be prefix, unit header if applicable
then other stuff roughly in order from most dependent to least dependent
library.  This helps catch headers that don't #include things that they
use.
2017-02-27 22:57:14 +11:00
Miodrag Milanovic
ddb290d5f6 NOTICE (TYPE NAME CONSOLIDATION)
Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8
also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
2016-10-22 13:13:17 +02:00
Miodrag Milanovic
d2e8f61149 dynamic_buffer is just std::vector<UINT8> (nw) 2016-10-21 12:35:05 +02:00
Olivier Galibert
7f37b29274 okim6295: Directly use set_rom_bank [O. Galibert]
dirom: Add a mandatory callback on bank change [O. Galibert]
2016-09-06 11:44:15 +02:00
Miodrag Milanovic
61349c9eaa Fix deco crypt separate compile (nw) 2016-04-30 18:49:36 +02:00
AJR
27a27d460c Reduce the incidence of required_device<palette_device> in subdevices
Any device implementing device_gfx_interface will require a palette and, once it has started (which many video devices already check for), allow other devices to access it through a getter. This makes it unnecessary in most cases for devices to require both a gfxdecode and a palette; indeed, many devices went on to not use the palette at all.

Most cases have been solved in one of two contrasting ways: remove the palette finder and associated macros for configuring it, or implement device_gfx_interface and remove the gfxdecode finder. The latter solution, generally adopted for devices that decoded their own graphics internally or through their own subdevice, has doubled the number of implementations of device_gfx_interface and eliminated the need for Konami games to provide empty gfxdecodes.
2016-04-02 17:40:09 -04:00
David Haywood
d18260287d gals (nw) 2016-02-06 22:43:08 +00:00
David Haywood
a560877764 new clones
World Cup Volley '95 Extra Version (Asia v2.0B) [Kevin Eshbach]
2016-02-06 22:17:48 +00:00
Miodrag Milanovic
4e8e3066f8 reverting:
SHA-1: 1f90ceab07

* tags are now strings (nw)
fix start project for custom builds in Visual Studio (nw)
2016-01-20 21:42:13 +01:00
Miodrag Milanovic
1f90ceab07 tags are now strings (nw)
fix start project for custom builds in Visual Studio (nw)
2016-01-16 14:54:42 +01:00
Miodrag Milanovic
174720a64d removed auto_bitmap_ind*_alloc and auto_bitmap_rgb32_alloc and replaced with std::unique_ptr (nw)
auto_alloc_array to unique_ptr
Added make_unique_clear
2015-12-17 11:10:30 +01:00
Miodrag Milanovic
9e020f8a89 overrides in drivers (nw) 2015-12-06 14:51:03 +01:00
Miodrag Milanovic
7c19aac60e Rename *.c -> *.cpp in our source (nw) 2015-11-08 12:56:12 +01:00