in order to make things more consistent with behaving when cmd line
parameters are sent, also added emuopts support to add newly created
options if some is added with adding software item in slot (no whatsnew)
and paths consistently for devices, I/O ports, memory
regions, memory banks, and memory shares. [Aaron Giles]
NOTE: there are likely regressions lurking here, mostly
due to devices not being properly found. I have temporarily
added more logging to -verbose to help understand what's
going on. Please let me know ASAP if anything that is being
actively worked on got broken.
As before, the driver device is the root device and all
other devices are owned by it. Previously all devices
were kept in a single master list, and the hierarchy was
purely logical. With this change, each device owns its
own list of subdevices, and the hierarchy is explicitly
manifest. This means when a device is removed, all of its
subdevices are automatically removed as well.
A side effect of this is that walking the device list is
no longer simple. To address this, a new set of iterator
classes is provided, which walks the device tree in a depth
first manner. There is a general device_iterator class for
walking all devices, plus templates for a device_type_iterator
and a device_interface_iterator which are used to build
iterators for identifying only devices of a given type or
with a given interface. Typedefs for commonly-used cases
(e.g., screen_device_iterator, memory_interface_iterator)
are provided. Iterators can also provide counts, and can
perform indexed lookups.
All device name lookups are now done relative to another
device. The maching_config and running_machine classes now
have a root_device() method to get the root of the hierarchy.
The existing machine->device("name") is now equivalent to
machine->root_device().subdevice("name").
A proper and normalized device path structure is now
supported. Device names that start with a colon are
treated as absolute paths from the root device. Device
names can also use a caret (^) to refer to the owning
device. Querying the device's tag() returns the device's
full path from the root. A new method basetag() returns
just the final tag.
The new pathing system is built on top of the
device_t::subtag() method, so anyone using that will
automatically support the new pathing rules. Each device
has its own internal map to cache successful lookups so
that subsequent lookups should be very fast.
Updated every place I could find that referenced devices,
memory regions, I/O ports, memory banks and memory shares
to leverage subtag/subdevice (or siblingtag/siblingdevice
which are built on top).
Removed the device_list class, as it doesn't apply any
more. Moved some of its methods into running_machine
instead.
Simplified the device callback system since the new
pathing can describe all of the special-case devices that
were previously handled manually.
Changed the core output function callbacks to be delegates.
Completely rewrote the validity checking mechanism. The
validity checker is now a proper C++ class, and temporarily
takes over the error and warning outputs. All errors and
warnings are collected during a session, and then output in
a consistent manner, with an explicit driver and source file
listed for each one, as well as additional device and/or
I/O port contexts where appropriate. Validity checkers
should no longer explicitly output this information, just
the error, assuming that the context is provided.
Rewrote the software_list_device as a modern device, getting
rid of the software_list_config abstraction and simplifying
things.
Changed the way FLAC compiles so that it works like other
external libraries, and also compiles successfully for MSVC
builds.
out of log:
This way it is possible to link two or more separated executables with different
copyright/xml out/name/... in one compilation, just one step closer...
Also update lib/util/options.c so now parsing is not stopped on first unknown parameter, this way order of options in command line is not important for dynamic options (no whatsnew)
* Added the possibility to press contradictory direction digital
joystick input at the same time (i.e. up-down, left-right);
* Added the possibility to set an arbitrary value for coin impulses;
* fixed a bug with loop lever routine
* fixed a bug with analog joystick routine
Various fixes in tnzs.c driver [kanikani]
* Plump Pop
- update DIPSW item (collision between each players' child)
- added DIPLOCATION
* Extermination
* Arkanoid Revenge of DOH
* Dr.Toppel
* Kageki
* Chuka Taisen
* The Newzealand Story
- added DIPLOCATION
* Kabuki Z
- fixed difficulty DIPSW (EASY and MEDIUM is reversed)
- added DIPLOCATION
* Insector X
- fixed difficulty DIPSW (based on manual)
- added DIPLOCATION
Various fixes in tmnt.c driver [kanikani]
* T.M.N.T.
- fixed visible area (garbage on each side is correct (verified on PCB))
- fixed DIPSW
- added DIPLOCATION
* Golfing Greats
- fixed inputs
- fixed DIPSW
- added DIPLOCATION
* Trigon
* Cuebrick
* M.I.A.
* Punk Shot
- fixed DIPSW
- added DIPLOCATION
* Premiere Soccer
- added DIPLOCATION
Various fixes in ninjaw.c driver [kanikani]
* Ninja Warriors
- added DIPSW notes
* Darius II
- fixed DIPSW
- fixed game description
Various fixes in twin16.c driver [kanikani]
* Majuu no Oukoku
- fixed inputs
- fixed DIPSW
- added DIPLOCATION
* Gradius II
* Hard Puncher
* M.I.A.
* Cuebrick
- fixed DIPSW
- added DIPLOCATION
Fixed DIPSW in Darius II [kanikani]
Fixed DIPSW in Ninja Ryuukenden / Ninja Gaiden [kanikani]
Fixed inputs and DIPSW in toaplan1.c, toaplan2.c, twincobr.c, wardner.c drivers [kanikani]
Various fixes in galaga.c driver [kanikani]
* Bosconian
- fixed DIPSW
- fixed DIPLOCATION
* Galaga
* Xevious
* DigDug
- fixed DIPLOCATION
Fixed DIPSW and DIPLOCATION in segas24.c driver [kanikani]
Fixed DIPSW and DIPLOCATION in segas18.c driver [kanikani]
Fixed DIPSW in segag80r.c driver [kanikani]
Fixed DIPSW in segag80v.c driver [kanikani]
Fixed DIPSW in segald.c driver [kanikani]
Fixed DIPSW in Ninjakun and Penguin-Kun Wars [kanikani]
Various fixes in dec0.c driver [kanikani]
* Heavy Barrel
- fixed DIPSW
- fixed DIPLOCATION
* Birdie Try
* Dragon Ninja
* Fighting Fantasy
* Midnight Resistance
- fixed DIPSW
* Robocop
- fixed DIPLOCATION
Fixed coinage DIPSW using Sega common setting in segaybd.c,
segaorun.c, segaxbd.c, segahang.c, segae.c, segac2.c, segas16a.c
and segas16b.c drivers [kanikani]
Fixed coinage DIPSW using Konami common setting in chqflag.c, pooyan.c
and rockrage.c drivers [kanikani]
Various fixes in sega16b.c driver [kanikani]
* Ace Attacker
- added I/O board read routine
* Dunk Shot
- fixed DIPLOCATION
* Sukeban Janshi Ryuko
- added DIPSW
* Time Scanner
- fixed DIPSW
Various fixes in sega16a.c driver [kanikani]
* Ace Attacker
- changed to use analog device
* Sukeban Janshi Ryuko
- added DIPSW
* Time Scanner
- fixed DIPSW
Fixed / added comments in ninjakd2.c driver [kanikani]
Made some video optimizations in toypop.c driver [kanikani]
Fixed inputs and DIPSW in djmain.c driver [kanikani]
Fixed DIPLOCATION in Pop'n Stage [kanikani]
marking image device to be mounted on. If soft item is found
it will be loaded on first image device that have needed
interface defined [Miodrag Milanovic]
a 'confirm quit' screen rather than directly quit emulation. [MamePlus Team, Mamesick, Fabio Priuli]
out of whatsnew: feel free to suggest a better quit message, if you don't like the one I added.
existing modern devices and the legacy wrappers to work in this
environment. This in general greatly simplifies writing a modern
device. [Aaron Giles]
General notes:
* some more cleanup probably needs to happen behind this change,
but I needed to get it in before the next device modernization
or import from MESS :)
* new template function device_creator which automatically defines
the static function that creates the device; use this instead of
creating a static_alloc_device_config function
* added device_stop() method which is called at around the time
the previous device_t's destructor was called; if you auto_free
anything, do it here because the machine is gone when the
destructor is called
* changed the static_set_* calls to pass a device_t & instead of
a device_config *
* for many devices, the static config structure member names over-
lapped the device's names for devcb_* functions; in these cases
the members in the interface were renamed to have a _cb suffix
* changed the driver_enumerator to only cache 100 machine_configs
because caching them all took a ton of memory; fortunately this
implementation detail is completely hidden behind the
driver_enumerator interface
* got rid of the macros for creating derived classes; doing it
manually is now clean enough that it isn't worth hiding the
details in a macro
loader rewrite, which is still in progress....)
Replaced mamedriv.c with a new driver list mechanism that is generated
by the build tools. The emulator core now expects the presence of a
file called src/$(TARGET)/$(SUBTARGET).lst which is just a raw list of
driver names, one per line. C and C++ comments are still permitted.
This file is parsed by a new build tool makelist which extracts the
driver names, sorts them, and generates a file called drivlist.c, which
is consumed by the core. [Aaron Giles]
Added new osdcore function osd_malloc_array() which is identical to
osd_malloc() but obviously hints that the underlying allocation is for
an array. Updated all callers to use the appropriate form. Modified the
Windows allocator to only use guard pages for array-style allocations,
allowing us to enable them once again in debug builds. [Aaron Giles]
Created new static class driver_list to wrap accesses to the list of
available drivers. Improved speed of driver lookups by relying on the
presorting done by makelist. [Aaron Giles]
Created helper class driver_enumerator as a helper for iterating through
the list of drivers. This class supports basic filtering and iteration,
and also serves as a temporary cache of machine_configs. [Aaron Giles]
Created cli_frontend object to wrap all the CLI handling code in
clifront.c. Updated/simplified all the code to take advantage of the
driver_enumerator. [Aaron Giles]
Created media_auditor object to wrap all the auditing functions in
audit.c. Updated all users to the new interface. Note that the new
auditing mechanism is slightly out of sync with the romload code in
terms of finding ROMs owned by devices, so it may mis-report some
issues until the new ROM loading code is in. [Aaron Giles]
Added concept of a per-device searchpath. For most devices, their
searchpath is just the short name of the device. For driver_devices, the
searchpath is driver[;parent[;bios]]. This searchpath will eventually be
used by the rom loader to find ROMs. For now it is used by the media
auditor only. [Aaron Giles]
Created info_xml_creator object to wrap all the info generation functions
in info.c. Converted the file to C++ and cleaned up the input processing
code. [Aaron Giles]
(not for whatsnew ... Known issues: auditing of CHDs appears busted, and
debug builds report unfreed memory if you use the built-in game picker)
Remove redundant machine items from address_space and device_t.
Neither machine nor m_machine are directly accessible anymore.
Instead a new getter machine() is available which returns a
machine reference. So:
space->machine->xxx ==> space->machine().xxx
device->machine->yyy ==> device->machine().yyy
Globally changed all running_machine pointers to running_machine
references. Any function/method that takes a running_machine takes
it as a required parameter (1 or 2 exceptions). Being consistent
here gets rid of a lot of odd &machine or *machine, but it does
mean a very large bulk change across the project.
Structs which have a running_machine * now have that variable
renamed to m_machine, and now have a shiny new machine() method
that works like the space and device methods above. Since most of
these are things that should eventually be devices anyway, consider
this a step in that direction.
98% of the update was done with regex searches. The changes are
architected such that the compiler will catch the remaining
errors:
// find things that use an embedded machine directly and replace
// with a machine() getter call
S: ->machine->
R: ->machine\(\)\.
// do the same if via a reference
S: \.machine->
R: \.machine\(\)\.
// convert function parameters to running_machine &
S: running_machine \*machine([^;])
R: running_machine \&machine\1
// replace machine-> with machine.
S: machine->
R: machine\.
// replace &machine() with machine()
S: \&([()->a-z0-9_]+machine\(\))
R: \1
// sanity check: look for this used as a cast
(running_machine &)
// and change to this:
*(running_machine *)
functionality in favor of alternate mechanisms. Errors are
now reported via an astring rather than via callbacks. Every
option must now specify a type (command, integer, float, string,
boolean, etc). Command behavior has changed so that only one
command is permitted. [Aaron Giles]
Changed fileio system to accept just a raw searchpath instead of
an options/option name combination. [Aaron Giles]
Created emu_options class dervied from core_options which wraps
core emulator options. Added mechanisms to cleanly change the
system name and add/remove system-specific options, versus the
old way using callbacks. Also added read accessors for all the
options, to ensure consistency in how parameters are handled.
Changed most core systems to access emu_options instead of
core_options. Also changed machine->options() to return emu_options.
[Aaron Giles]
Created cli_options class derived from emu_options which adds the
command-line specific options. Updated clifront code to leverage
the new class and the new core behaviors. cli_execute() now accepts
a cli_options object when called. [Aaron Giles]
Updated both SDL and Windows to have their own options classes,
derived from cli_options, which add the OSD-specific options on
top of everything else. Added accessors for all the options so
that queries are strongly typed and simplified. [Aaron Giles]
Out of whatsnew: I've surely screwed up some stuff, though I have
smoke tested a bunch of things. Let me know if you hit anything odd.
Also I know this change will impact the WINUI stuff, please let me
know if there are issues. All the functionality necessary should
still be present. If it's not obvious, please talk to me before
adding stuff to the core_options class.
to pass a core_options object to the constructor, along with
a search path. This required pushing either a running_machine
or a core_options through some code that wasn't previously
ready to handle it. emu_files can be reused over multiple
open/close sessions, and a lot of core code cleaned up
nicely as things were converted to them.
Also created a file_enumerator class for iterating over files
in a searchpath. This replaces the old mame_openpath functions.
Changed machine->options() to return a reference.
Removed public nvram_open() and fixed jchan/kaneko16 to
stop directly saving NVRAM.
Removed most of the mame_options() calls; this will soon go
away entirely, so don't add any more.
Added core_options to device_validity_check() so they can be
used to validate things.
- Default for writeconfig is now 0 for MESS since it is not needed anymore
- Fixed handling of mounted devices on hard reset
- Unified some emuopts code, and removed ifdefs
if it owns a given font (based on the name), and if it does, it is
responsible for generating bitmaps on the fly as characters are requested.
Added new option -uifont to specify the UI font. It can be set to a filename,
in which case a BDF font will be loaded. It can also be set to a font name
(assuming the OSD support is present), in which case the OSD font by that
name is used. The default value is 'default' which can be used by the OSD
to substitute a default font or by the OSD, which will default to ui.bdf
as before. In all cases, it falls back to the built-in font by default if
none of the previous options works.
On Windows, the OSD will default to Tahoma as the font name. Also on
Windows, font names can be specified with [b] to indicate bold or [i] to
indicate italic.
Moved -effect implementation out of OSD code and into core since
the implementations were identical across Windows/SDL and implemented
in the core itself.
device interface. This means all ROMs are now exposed via devices,
and thus the process of enumerating ROMs gets simpler.
Changed all instances of temporarily allocating machine_config objects
to just put them on the stack for simplicity, letting the destructor
handle the cleanup work automatically.
Changed machine_config constructor to take a game_driver, from which
the machine_config constructor is obtained. This also means the
resulting machine_config holds a reference to the game_driver.
Changed running_machine constructor to no longer take a game_driver,
since the game_driver is now obtainable via the machine_config.
running_machine definition and implementation.
Moved global machine-level operations and accessors into methods on the
running_machine class. For the most part, this doesn't affect drivers
except for a few occasional bits:
mame_get_phase() == machine->phase()
add_reset_callback() == machine->add_notifier(MACHINE_NOTIFY_RESET, ...)
add_exit_callback() == machine->add_notifier(MACHINE_NOTIFY_EXIT, ...)
mame_get_base_datetime() == machine->base_datetime()
mame_get_current_datetime() == machine->current_datetime()
Cleaned up the region_info class, removing most global region accessors
except for memory_region() and memory_region_length(). Again, this doesn't
generally affect drivers.