| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
area". If true, it will show the whole video area including border + blanking areas. [Angelo Salese]
Bulk replaced const mc6845_interface -> MC6845_INTERFACE, nw
(MESS)
SMC-777: enabled to show the border area in MC6845 interface, changed various video related function accordingly [Angelo Salese]
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
device_memory_interface::space() assert against NULL and
return a reference, and pushed references throughout all
address space usage in the system. Added a has_space()
method to check for those rare case when it is ambiguous.
[Aaron Giles]
Also reinstated the generic space and added fatal error
handlers if anyone tries to actually read/write from it.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
read/write handlers to take an address_space & instead
of an address_space *. Also update pretty much all other
functions to take a reference where appropriate.
[Aaron Giles]
|
|
|
|
| |
changed to be members of state classes (no whatsnew)
|
|
|
|
|
|
|
| |
and cputag_set_input_line_and_vector, replacing them
with machine.device("tag")->execute().set_input_line[_and_vector].
[Aaron Giles]
|
|
|
|
|
| |
Added DECLARE_DRIVER_INIT macro to define it H file, and
DRIVER_INIT_MEMBER for member declaration in C files
Updated all drivers accordingly (no whatsnew)
|
|
|
|
| |
DRIVER_INIT change (no whatsnew)
|
|
|
|
| |
Studio Code Analysis (no whatsnew)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
intended differences from previous behavior. For drivers,
the main change is that input_port_read() no longer exists.
Instead, the port must be fetched from the appropriate device,
and then read() is called.
For member functions, this is actually simpler/cleaner:
value = ioport("tag")->read()
For legacy functions which have a driver_data state, it goes:
value = state->ioport("tag")->read()
For other legacy functions, they need to fetch the root device:
value = machine.root_device().ioport("tag")->read()
The other big change for drivers is that IPT_VBLANK is gone.
Instead, it has been replaced by a device line callback on the
screen device. There's a new macro PORT_VBLANK("tag") which
automatically points things to the right spot.
Here's a set of imperfect search & replace strings to convert
the input_port_read calls and fix up IPT_VBLANK:
input_port_read( *\( *)(machine\(\)) *, *([^)]+ *\))
ioport\1\3->read\(\)
input_port_read( *\( *)(.*machine[()]*) *, *([^)]+ *\))
\2\.root_device\(\)\.ioport\1\3->read\(\)
(state = .*driver_data[^}]+)space->machine\(\)\.root_device\(\)\.
\1state->
(state = .*driver_data[^}]+)device->machine\(\)\.root_device\(\)\.
\1state->
input_port_read_safe( *\( *)(machine\(\)) *, *([^,]+), *([^)]+\))
ioport\1\3->read_safe\(\4\)
IPT_VBLANK( *\))
IPT_CUSTOM\1 PORT_VBLANK("screen")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
memory_region management into the memory manager instead
of directly in the machine. Hid the global region method;
now all regions must be looked up relative to a device.
If you're a member function, you can just use memregion("tag")
directly. If you're a global function or a device referencing
global regions, use machine().root_device().memregion("tag")
to look up regions relative to the root.
S&R to convert all references:
machine([()]*)\.region
machine\1\.root_device\(\).subregion
Then remove redundant machine().root_device() within src/mame:
([ \t])machine\(\)\.root_device\(\)\.
\1
And use state->memregion() if we have a state variable present:
(state *= *[^;]+driver_data[^}]+)([^ \t]*)machine[()]*\.root_device\(\)\.
\1state->
Finally some cleanup:
screen.state->
state->
device->state->
state->
space->state->
state->
And a few hand-tweaks.
|
|
|
| |
Also drivers/galaxian.c and video/dkong.c changes for compile
|
|
|
|
|
|
|
|
| |
necessary to fetch the color_prom directly. Made PALETTE_INIT
into just another basic callback with an overridable palette_init()
in the driver_device, and support for arbitrary member functions via
MCFG_PALETTE_INIT_OVERRIDE.
|
|
|
|
|
|
|
|
|
|
|
|
| |
You still need target() if you want to cast to another pointer size.
This should be rare, and in fact fixing these pointed out a few
cases where code was missing BYTE/WORD/DWORD_XOR_* macros. I flagged
these with:
// ERROR: This cast is NOT endian-safe without the use of BYTE/WORD/DWORD_XOR_* macros!
For future fixing.
|
| |
|
| |
|
|
|
|
|
| |
Moved video/generic flip screen management into the base
driver_device class and updated all callers.
|
| |
|
| |
|
| |
|
|
|
|
| |
- Added 4th parameter to all address maps
- Added missing state classes
|
|
|
|
|
|
|
| |
- Fixed Dip Switches and Inputs (after verification of the M6502
code)
|
| |
|
|
|
|
|
|
|
| |
recent changes.
Also, did a pass through the code to take advantage of new
methods available on rectangles.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
almost certainly some regressions lurking. Let me know if
something seems busted.
Bitmaps are now strongly typed based on format. bitmap_t still
exists as an abstract base class, but it is almost never used.
Instead, format-specific bitmap classes are provided:
bitmap_ind8 == 8bpp indexed
bitmap_ind16 == 16bpp indexed
bitmap_ind32 == 32bpp indexed
bitmap_ind64 == 64bpp indexed
bitmap_rgb32 == 32bpp RGB
bitmap_argb32 == 32bpp ARGB
bitmap_yuy16 == 16bpp YUY
For each format, a generic pix() method is provided which
references pixels of the correct type. The old pix8/pix16/pix32/
pix64 methods still exist in the short term, but the only one
available is the one that matches the bitmap's pixel size. Note
also that the old RGB15 format bitmaps are no longer supported
at all.
Converted model1, megadriv, and stv drivers away from the RGB15
format bitmaps.
New auto_bitmap_<type>_alloc() macros are provided for allocating
the appropriate type of bitmap.
Screen update functions now must specify the correct bitmap type
as their input parameters. For static update functions the
SCREEN_UPDATE macro is now replaced with SCREEN_UPDATE_RGB32 and
SCREEN_UPDATE_IND16 macros. All existing drivers have been
updated to use the correct macros.
Screen update functions are now required for all screens; there
is no longer any default behavior of copying a "default" bitmap
to the screen (in fact the default bitmap has been deprecated).
Use one of the following to specify your screen_update callback:
MCFG_SCREEN_UPDATE_STATIC(name) - static functions
MCFG_SCREEN_UPDATE_DRIVER(class, func) - driver members
MCFG_SCREEN_UPDATE_DEVICE(tag, class, func) - device members
Because the target bitmap format can now be deduced from the
screen update function itself, the MCFG_SCREEN_FORMAT macro is
no longer necessary, and has been removed. If you specify a
screen update callback that takes a bitmap_ind16, then the screen
will be configured to use a 16bpp indexed bitmap, and if you
specify a callback that takes a bitmap_rgb32, then a 32bpp RGB
bitmap will be provided.
Extended the bitmap classes to support wrapping a subregion of
another bitmap, and cleaner allocation/resetting. The preferred
use of bitmaps now is to define them directly in drivers/devices
and use allocate() or wrap() to set them up, rather than
allocating them via auto_bitmap_*_alloc().
Several common devices needed overhauls or changes as a result
of the above changes:
* Reorganized the laserdisc base driver and all the laserdisc
drivers as modern C++ devices, cleaning the code up
considerably. Merged ldsound device into the laserdsc
device since modern devices are flexible enough to handle
it.
* Reorganized the v9938 device as a modern C++ device. Removed
v9938mod.c in favor of template functions in v9938.c directly.
* Added independent ind16 and rgb32 callbacks for TMS340x0 devices.
* All video devices are now hard-coded to either ind16 or rgb32
bitmaps. The most notable is the mc6845 which is rgb32, and
required changes to a number of consumers.
* Added screen_update methods to most video devices so they can be
directly called via MCFG_SCREEN_UPDATE_DEVICE instead of creating
tons of stub functions.
|
|
|
|
|
|
|
|
| |
parameters for the global SCREEN_UPDATE callback match the parameters
for the driver_device version. Added allocate() and deallocate()
methods to bitmap_t to permit cleaner handling of bitmaps in drivers
and modern devices. [Aaron Giles]
|
|
|
|
|
|
|
|
|
|
| |
cliprects mandatory everywhere. In general, cliprects were being
correctly passed through the video side of most drivers already, so
it is mostly a semantic change. Note that with my previous change,
bitmaps have cliprects, so if you just want to clip to the bitmap's
boundaries, pass bitmap->cliprect() instead of NULL (which is no
longer permitted). [Aaron Giles]
|
|
|
|
|
|
|
|
| |
macros with bitmap->pix* functions, and moved bitmap_fill() to bitmap->fill()
among other similar changes. Bitmap fields now only available via accessors.
Replaced sect_rect with &= and union_rect with |= operators for rectangle
classes. Some general cleanup as a result of these changes. [Aaron Giles]
|
|
|
|
|
|
|
|
|
| |
reference. Remove redundant machine parameter from SCREEN_EOF. Remove old
vestiges of driver_device video_eof override since it wasn't being used.
Update all multi-screen games to use separate functions for each screen
(calling into common code where appropriate). [Aaron Giles]
(nw: equivalent MESS changes are ready, will send along shortly)
|
|
|
|
|
|
| |
languages down dark alleys, knocks them over and goes through their pockets for loose grammar!"
Hand-checked the most popular English word misspellings and made the appropriate changes. Nearly all of the changes made were in commented areas. (no whatsnew)
|
| |
|
|
|
|
|
| |
Changed signature for callbacks to take an input_field_config
reference instead of pointer.
|
|
|
|
|
|
|
|
|
| |
Remove the old tokenizing helpers. Add basic classes for ports, fields,
settings, and dip locations as a first step. These will be fully cleaned
up later. Added machine() method to field to hide all the necessary
indirection. Changed custom/changed handlers into generic read/write
handlers, and added wrappers to convert them to device read/write
lines. [Aaron Giles]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
driver_device classes have an m_ prefix on them. When we
eventually move functions using these into member functions,
we will be able to remove the state-> pointers, and having
the member variables prefixed will allow them to be
distinguished from local variables.
Some regex'es used (plus manually fixing the remaining stuff):
In src/mame/...
state->([a-zA-Z_][^_][a-zA-Z0-9_]*)
state->m_\1
state->([^m]_[a-zA-Z0-9_]*)
state->m_\1
state->m_save_item
state->save_item
state->m_save_pointer
state->save_pointer
(AM_BASE_MEMBER *\( *[a-zA-Z0-9_]+ *, *)([a-zA-Z_][^_])
\1m_\2
(AM_BASE_SIZE_MEMBER *\( *[a-zA-Z0-9_]+ *, *)([a-zA-Z_][^_][a-zA-Z0-9_]* *, *)([a-zA-Z_][^_])
\1m_\2m_\3
(AM_SIZE_MEMBER *\( *[a-zA-Z0-9_]+ *, *)([a-zA-Z_][^_])
\1m_\2
m__
m_
In src/mame/includes/...
(\t[a-zA-Z0-9_<>]+[ \t]+[&*]*[ \t]*)([a-zA-Z_][^_][][a-zA-Z0-9_]*;)$
\1m_\2
(\t[a-zA-Z0-9_<>]+[ \t]*[&*]*[ \t]+)([a-zA-Z_][^_][][a-zA-Z0-9_]*;)$
\1m_\2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 *)
|
|
|
|
|
|
|
|
|
|
|
|
| |
space by index. Update functions and methods that accepted an
address space index to take an address_spacenum instead. Note that
this means you can't use a raw integer in ADDRESS_SPACE macros, so
instead of 0 use the enumerated AS_0.
Standardized the project on the shortened constants AS_* over the
older ADDRESS_SPACE_*. Removed the latter to prevent confusion.
Also centralized the location of these definitions to memory.h.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
or assert if not present.
Split address_space::install_[legacy_]handler into
install_[legacy_]read_handler, install_[legacy_]write_handler,
and install_[legacy_]readwrite_handler.
Added variants of address_space handler installers which don't take
mirror or mask parameters, since this is by far the most common case.
Deprecated API cleanup. Simple search & replace:
cpu_suspend ==> device_suspend
cpu_resume ==> device_resume
cpu_yield ==> device_yield
cpu_spin ==> device_spin
cpu_spinuntil_trigger ==> device_spin_until_trigger
cpu_spinuntil_time ==> device_spin_until_time
cpu_spinuntil_int ==> device_spin_until_interrupt
cpu_eat_cycles ==> device_eat_cycles
cpu_adjust_icount ==> device_adjust_icount
cpu_triggerint ==> device_triggerint
cpu_set_input_line ==> device_set_input_line
cpu_set_input_line_vector ==> device_set_input_line_vector
cpu_set_input_line_and_vector ==> device_set_input_line_and_vector
cpu_set_irq_callback ==> device_set_irq_callback
More complex changes:
device_memory(device) ==> device->memory()
device_get_space(device, spacenum) ==> device->memory().space(spacenum)
cpu_get_address_space(cpu, spacenum) ==> cpu->memory().space(spacenum)
cputag_get_address_space(mach, tag, spacenum) ==> mach->device("tag")->memory().space(spacenum)
cputag_get_clock(mach, tag) ==> mach->device("tag")->unscaled_clock()
cputag_set_clock(mach, tag, hz) ==> mach->device("tag")->set_unscaled_clock(hz)
Some regex'es for the more prevalent cases above:
S: cpu_get_address_space( *)\(( *)([^,]+)( *), *
R: \3->memory().space\1\(\2
S: cputag_get_address_space( *)\(( *)([^,]+)( *),( *)([^,]+)( *), *
R: \3->device\1\(\2\6\7\)->memory().space\1\(\2
S: cputag_get_clock( *)\(( *)([^,]+)( *),( *)([^ )]+) *\)
R: \3->device\1\(\2\6\7\)->unscaled_clock\(\)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Screen update function is now per screen device
(it was before but was attached to machine driver)
MCFG_VIDEO_UPDATE -> MCFG_SCREEN_UPDATE
MCFG_VIDEO_EOF -> MCFG_SCREEN_EOF
EOF is now executed for all screens, so for all existing it
is defined just for one screen. This part will be updated in future.
Note that there are now screen_update and screen_eof virtual functions
for "modern" drivers which are called same as they did before.
All drivers are updated and in places where update function was separated per
screen I did name separate function.
This change will enable us to put screen definition fully into device.
|
|
|
|
|
|
| |
capcom/cinemat/dataeast drivers by introducing/using driver_device
classes. [Atari Ace]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
memory_region() == machine->region()->base()
memory_region_length() == machine->region()->bytes()
region_info -> memory_region
Regex searches:
S: memory_region( *)\(( *)([^,&]+), *([^)]+)\)
R: \3->region\1\(\2\4\)->base\(\)
S: memory_region_length( *)\(( *)([^,&]+), *([^)]+)\)
R: \3->region\1\(\2\4\)->bytes\(\)
|
|
|
|
|
| |
There hasn't been a machine driver for many years.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
have no core use, they are simply there for the convenience of drivers.
Now that drivers are required to have devices, the data should move there.
[Atari Ace]
---------- Forwarded message ----------
From: Atari Ace <atari_ace@frontier.com>
Date: Sun, Sep 5, 2010 at 4:45 PM
Subject: [patch] Eliminate generic.videoramm generic.videoram_size
To: submit@mamedev.org
Cc: atariace@hotmail.com
Hi mamedev,
This set of patches removes generic.videoram and
generic.videoram_size. These generics have no core use, they are
simply there for the convenience of drivers. Now that drivers are
required to have devices, the data should move there.
The first patch sets the stage for the rest of the patch. It includes
several changes.
1. It replaces all the uses of generic.videoram_size with appropriate
constants.
2. It eliminates the write handlers from pc_video.c. These are
unused in MAME and MESS appears to have a private copy.
3. It splits some drivers:
a. It separates mcr68 from the mcr driver, mostly by dividing
machine/mcr.c.
b. It separates naughtyb from the phoenix driver by introducing an
audio/pleiads.h include.
c. It replaces video/system1.h with includes/system1.h.
4. It fixes some videoram related bugs.
a. balsente, mole didn't need videoram.
b. sbowling has a dangling reference to videoram from an earlier
driver_data conversion
5. It expands some namcona functions to multiple lines so that later
scripted-edits look sensible.
The second patch is generated by vram01_1.pl. It introduces videoram
local variables in function that use videoram read-only and removes
AM_SIZE_GENERIC(videoram).
The third patch is generated by vram01_2.pl. It replaces all
occurances of generic.videoram with state->videoram,
introducing/modifying driver_device classes as needed.
The fourth patch then actually removes the generics, and fixes one
issue the scripts didn't handle.
~aa
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
class with a new driver_device class, which is the base class for all
driver_data objects now. The new driver devices are added as the
first device in the device list, with a tag of "root"; all other
devices are now owned by the driver device.
Moved core callbacks (machine_start/_reset, sound_start/_reset,
video_start/_reset/_eof/_update, and palette_init) into device
configuration parameters on these new devices. The driver_device
base class overrides device_start(), ensures all other devices have
been started, and then calls, in order, the following overridable
methods:
find_devices() - new, used to locate devices prior to DRIVER_INIT
DRIVER_INIT function from the game driver
palette_init() - by default calls the MDRV_PALETTE_INIT function
driver_start() - new
machine_start() - by default calls the MDRV_MACHINE_START function
sound_start() - by default calls the MDRV_SOUND_START function
video_start() - by default calls the MDRV_VIDEO_START function
Similarly, the driver_device class overrides device_reset() and then
calls these methods in order:
driver_reset() - new
machine_reset() - by default calls the MDRV_MACHINE_RESET function
sound_reset() - by default calls the MDRV_SOUND_RESET function
video_reset() - by default calls the MDRV_VIDEO_RESET function
To accommodate these changes, initialization order is slightly
altered from before. The tilemap, video, sound, and debug systems
are now initialized prior to the devices' start. And the user
callbacks for DRIVER_INIT, PALETTE_INIT, MACHINE_START, SOUND_START,
and VIDEO_START are all called back-to-back. The net effect should
be similar, however.
Added methods (optional_device and required_device) to the new
driver_device class to find devices, intended to be used from the
find_devices() callback. See harddriv.h and beathead.h for examples
of usage.
Changed device_t::subtag to only prepend a prefix if the device is
not the 'root' device, in order to keep compatibility with existing
tag searching.
Changed device startup to actively reorder devices when they report
missing dependencies. This ensures that the reset functions get
called in the same order that the start functions did.
Bulk updated drivers as follows:
First removed the old static alloc function from the driver_data_t:
S: [ \t]*static driver_device \*alloc *\( *running_machine *\&machine *\) *\{ *return auto_alloc_clear *\( *\&machine *, *[a-zA-Z0-9_]+_state *\( *machine *\) *\); *\}[\r\n]*
R:
Then switched from driver_data_t to driver_device:
S: driver_data_t
R: driver_device
Then changed the constructors to pass the correct parameters:
S: ([a-zA-Z0-9_]+)_state *\( *running_machine *\&machine *\)([\r\n\t ]+): *driver_device *\( *machine *\)
R: \1_state\(running_machine \&machine, const driver_device_config_base \&config\)\2: driver_device\(machine, config\)
|