| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
SASI drives, and allow hard disk image subdevices. [Curt Coder]
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 *)
|
| |
|
| |
|
|
|
|
| |
from MESS [Miodrag Milanovic]
|
|
|
|
|
|
| |
devtag_get_device ... machine->device()
memory_find_address_space ... device->space()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Created new central header "emu.h"; this should be included
by pretty much any driver or device as the first include. This
file in turn includes pretty much everything a driver or device
will need, minus any other devices it references. Note that
emu.h should *never* be included by another header file.
- Updated all files in the core (src/emu) to use emu.h.
- Removed a ton of redundant and poorly-tracked header includes
from within other header files.
- Temporarily changed driver.h to map to emu.h until we update
files outside of the core.
Added class wrapper around tagmap so it can be directly included
and accessed within objects that need it. Updated all users to
embed tagmap objects and changed them to call through the class.
Added nicer functions for finding devices, ports, and regions in
a machine:
machine->device("tag") -- return the named device, or NULL
machine->port("tag") -- return the named port, or NULL
machine->region("tag"[, &length[, &flags]]) -- return the
named region and optionally its length and flags
Made the device tag an astring. This required touching a lot of
code that printed the device to explicitly fetch the C-string
from it. (Thank you gcc for flagging that issue!)
|
| |
|
|
|
|
| |
input buffer size in WD33C93 controller [Harmony]
|
| |
|
|
|
|
|
|
| |
- Fixed parameter interpretation for READ(10) and READ(12)
- Added WRITE(10)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
> From: Atari Ace [mailto:atari_ace@verizon.net]
> Sent: Monday, August 03, 2009 10:52 PM
> To: submit@mamedev.org
> Cc: atariace@hotmail.com
> Subject: [patch] De-globalize romload.c/validity.c
>
> Hi mamedev,
>
> Static and global variables in the core of MAME have slowly been
> replaced with opaque structures latched onto the running machine. This
> patch extends this idiom to two more files, romload.c and validity.c.
> validity.c in fact didn't need any global state (it was used only to
> pass data between function calls), and romload.c already had a struct
> that largely served that purpose.
>
> ~aa
|
|
|
|
| |
to make them compile as either C or C++.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
assumption that all device tags are unique. Specifically, the
following no longer need to provide a device type:
AM_DEVREAD/WRITE
DEVCB_DEVICE_HANDLER
devtag_get_device
devtag_reset
device_list_find_by_tag
as well as several device interfaces that referenced other devices.
Also fixed assertion due to overflow in the recent sound fix.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
necessary to remove 12 of the final 14 references to the global
Machine. The remaining 2 are in fatalerror() and logerror(), which
are both local to mame.c, so Machine is now fully static.
--
From: Atari Ace [mailto:atari_ace@verizon.net]
Sent: Thursday, December 18, 2008 5:47 PM
To: submit@mamedev.org
Cc: atariace@hotmail.com
Subject: [patch] Make Machine static followup
Hi mamedev,
This incremental patch to my last patch undoes the change that caches
the ppu2c0x videorom. I changed the code back to how it behaved
originally, using an existing machine on the chip struct to eliminate
the one troublesome Machine reference.
~aa
--
From: Atari Ace [mailto:atari_ace@verizon.net]
Sent: Thursday, December 18, 2008 2:54 PM
To: submit@mamedev.org
Cc: atariace@hotmail.com
Subject: [patch] Make Machine static!
Hi mamedev,
This large patch completes the removal of the use of Machine
throughout MAME. It does so primarily by adding machine, device or
space to various apis and modifying the callers, but for some
remaining cases it adds a new api, mame_get_running_machine(), which
will be called instead. There are only 14 uses of this api currently,
and that number should drop over time.
There are a few changes of note:
1. 6821pia.c. I attached machine to the 'device' structure. I'm
working on converting this to a proper device, but that change isn't
ready.
2. fddebug.c. I added a proper header so that the apis won't get
accidentally converted to static again.
3. scsi.c. I added a machine to SCSIInstance.
4. system16.c. I modified sys16_patch_code to take an array of
patches.
4. custom.h. I added the owning sound device to the reset/stop
routines as well as the token. Note that passing only the device
would require exposing the internals of custom_sound, as the token
passed is not the device token, but the token returned from the
CUSTOM_START routine. Better ideas here are welcome.
4. ppc2c0x.c. To avoid changing more interfaces, the init routine
saves the videorom location rather than looks it up each time.
I tried to choose what I felt was the natural parameter for an api,
rather than always pass machine, but in some cases I used machine to
limit the number of additional changes. Some additional cleanup here
is probably warranted, I'll look into that later once I'm recovered
from this two-week project.
~aa
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a reworked/expanded version of the patch I sent yesterday.
This one is split into three parts:
1. This introduces function macros for SAMPLES_START,
CUSTOM_{START,STOP,RESET}, and ANTIC_RENDERER.
2. This introduces running_machine *machine throughout MAME.
Principally it adds running_machine *machine = Machine to the top of
functions, but in some static functions the parameter is added
directly. Some similar changes in 99xxcore.h, v9938.c, v9938mod.c,
galaxold.c, psx.c, taito_l.c are also made to eliminate Machine
params. No global API is changed.
3. This changes the APIs introduced in the first part to pass device
or space as appropriate. A few similar changes in some other global
apis are made as well.
The net result of this sequence of patches is to remove 40% of the
Machine references and 27 deprecat.h includes.
~aa
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
appropriate, and to keep all global variables hanging off the
machine structure. Once again, this means all state registration
call sites have been touched:
- state_save_register_global* now takes a machine parameter
- state_save_register_item* now takes a machine parameter
- added new state_save_register_device_item* which now uses
the device name and tag to generate the base name
Extended the fake sound devices to have more populated fields.
Modified sound cores to use tags from the devices and simplified
the start function.
Renumbered CPU and sound get/set info constants to align with
the device constants, and shared values where they were perfectly
aligned.
Set the type field in the fake device_configs for CPU and sound
chips to a get_info stub which calls through to the CPU and sound
specific get_info functions. This means the device_get_info()
functions work for CPU and sound cores, even in their fake state.
Changed device information getters from device_info() to
device_get_info() to match the CPU and sound macros.
|
|
|
|
|
|
| |
state_save_combine_module_and_tag() function in favor of passing
the tag when registering. Revisited all save state item registrations
and changed them to use the tag where appropriate.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead, they are identified by the region they were loaded in. This
generally means one disk per region. get_disk_handle() now takes a
region name in place of an index. Updated all callers to do this.
The SCSI modules in particular posed a challenge to make this work,
so watch out for potential bugs there.
Changed the IDE interfaces to default to choosing the region with the
same tag as the device for its master disk (assuming no slave). Added
support for specifying explicit master/slave disk regions as part of
the configuration, though slave disks are still not supported yet.
Change the laserdisc interface to no longer require a disk number or
a custom sound device. Both are now assumed to be tagged the same as
the laserdisc device. Updated all drivers accordingly.
|
|
|
|
|
|
|
|
|
|
| |
This small patch makes some minor "code quality" improvements to MAME.
First off, some remaing static/const qualifier missed cases were
addressed. Secondly, a few cases of missing #include "foo.h" were
added. Thirdly, a few global names were modified to make them less
generic/more consistent (voodoo.c, vrender0.c, lethal.c, rungun.c,
zac2650.c). Fourthly, some dead/useless code was removed
(i8051.c,model1.c,romcmp.c).
|
| |
|
|
|