[Atari Ace]
---------- Forwarded message ----------
From: Atari Ace <atari_ace@frontier.com>
Date: Tue, Aug 31, 2010 at 5:50 AM
Subject: [patch] Despecialize legacy sound devices
To: submit@mamedev.org
Cc: atariace@hotmail.com
Hi mamedev,
While poking around in the MAME source code, I came across the odd
type snes_sound_sound_device, which led me to the fact that legacy
sound devices are named a bit differently than other legacy devices,
probably a kludge intended to be changed later but forgotten. Anyhow,
this patch fixes it. The first patch goes part way, changing all but
the tag (which fixes the weird type issue). It also changes type
names in the scsp and msm5232 cores to avoid a name collision if/when
the second patch is applied. The second patch then touches a lot of
files, mostly removing the SOUND_ prefix from type asserts, but it
also needed to change the tags for the LASERDISC, S2636 and SPEAKER
sound cores to avoid collisions with other devices with the same name.
~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\)
* Cashcade workaround for topgear [Frasher]
* Improved a few memory handlers [Palindrome]
out of whatsnew: the original patch contained more changes so probably someone might want to contact Palindrome & c. about these.
1. the way ticket output was handled has been rejected (MAME should not print out files like they did)
2. they changed a rom in autmoon and another PROM: since I'm not sure if the roms are available and the commit message did not mention them at all, I cannot judge if the change is fine
3. the way they implemented Robot Test is debatable, but I know nothing about the hardware, so someone should review that part
4. if they want to remap Jackpot inputs, they should choose a key not already in use ('I' is taken as well) and possibly use the common IPT_GAMBLE we have
1. Renamed MACHINE_DRIVER_* to MACHINE_CONFIG_* to match the name
of the object it actually describes. The MDRV_* prefix may
eventually be bulk updated at some point, but not now.
2. MACHINE_CONFIG_START() now takes a driver_data_t-derived
class as a required second parameter. This means that
MDRV_DRIVER_DATA() is no longer required, and every "root"
machine config *must* specify a driver data class (or driver_data_t
itself if the driver has not yet been updated to use driver data).
3. New MACHINE_CONFIG_DERIVED() macro defines a machine_config
that is derived from another machine_config. This takes the place
of the very typical MACHINE_DRIVER_START()/MDRV_IMPORT_FROM()
combination.
4. New MACHINE_CONFIG_FRAGMENT() macro defines a partial
machine_config that can only be included in another "root"
machine_config. This is also used for machine_configs that are
specified as part of a device.
5. Changed MDRV_IMPORT_FROM() to MDRV_FRAGMENT_ADD() to more
accurately describe what is happening.
6. Added asserts to the above three macros to ensure they are
properly used.
Updated all machine drivers to use the new macros. Search & replace
lists below cover 99% of the changes, with just a few manual fixups.
S: MACHINE_DRIVER_START\( *([a-zA-Z0-9_]+) *\)[\r\n\t ]*MDRV_DRIVER_DATA\( *([a-zA-Z0-9_]+) *\)
R: MACHINE_CONFIG_START\( \1, \2 \)
S: MACHINE_DRIVER_START\( *([a-zA-Z0-9_]+) *\)[\r\n\t ]*/\* driver data \*/[\r\n\t ]*MDRV_DRIVER_DATA\( *([a-zA-Z0-9_]+) *\)
R: MACHINE_CONFIG_START\( \1, \2 \)
S: MACHINE_DRIVER_START\( *([a-zA-Z0-9_]+) *\)[\r\n\t ]*MDRV_IMPORT_FROM\( *([a-zA-Z0-9_]+) *\)
R: MACHINE_CONFIG_DERIVED\( \1, \2 \)
S: MACHINE_DRIVER_START\( *([a-zA-Z0-9_]+) *\)[\r\n\t ]*/\* basic machine hardware \*/[\r\n\t ]*MDRV_IMPORT_FROM\( *([a-zA-Z0-9_]+) *\)
R: MACHINE_CONFIG_DERIVED\( \1, \2 \)\r\n\r\n\t/\* basic machine hardware \*/
For all files outside of mame/drivers....
S: MACHINE_DRIVER_START
R: MACHINE_CONFIG_FRAGMENT in all non-drivers
For all files within mame/drivers....
S: MACHINE_DRIVER_START\( *([a-zA-Z0-9_]+) *\)
R: MACHINE_CONFIG_START\( \1, driver_data_t \)
S: MDRV_IMPORT_FROM
R: MDRV_FRAGMENT_ADD
S: MACHINE_DRIVER_END
R: MACHINE_CONFIG_END
S: MACHINE_DRIVER_NAME
R: MACHINE_CONFIG_NAME
S: MACHINE_DRIVER_EXTERN
R: MACHINE_CONFIG_EXTERN
Final step: run mame -valid and fix the incorrect macros at the lines
where the asserts show up.
split screen and scrolling effects using a regular mc6845. [Wilbert Pol]
Interface change:
The screen tag is no longer mandatory. If a screen tag is provided then the mc6845 device will resize
the screen and visible area based on the parameters set in the 6845 config and registers. If the screen
tag is not provided then the driver is supposed to be in charge of setting the proper screen configuration.
Warning: This breaks the relationship between the timing of a screen device and the signals generated
by the 6845.
it's related to:
00171: lethalen: mask rom check they all come up bad.
in konicdev.c there's in READ8_DEVICE_HANDLER( k053244_r ):
addr = (k053244->rombank << 19) | ((k053244->regs[11] & 0x7) << 18) | (k053244->regs[8] << 10) | (k053244->regs[9] << 2) | ((offset & 3) ^ 1 );
for the A10 test and A8 test (GFX2 region of lethalen) we need:
........ | ((offset & 3) ^ 3 );
is there any doc about k053244?
Chihiro.c Improvements: [Samuele Zannoli]
- Fixed the mapping of the bios at the top of the cpu addrsss space
- Updated the ram size to 128 megabytes
- Added some SMBus handling, to let the bios run
- Added placeholders for a few devices on the PCI bus
- Added the "jamdis StartAddress,Length" command to the debugger that lets you disassemble the "jam table" instructions used by the bios to do some basic hardware initialization.
This time it works for good ;)
Chihiro.c Improvements: [Samuele Zannoli]
- Fixed the mapping of the bios at the top of the cpu addrsss space
- Updated the ram size to 128 megabytes
- Added some SMBus handling, to let the bios run
- Added placeholders for a few devices on the PCI bus
- Added the "jamdis StartAddress,Length" command to the debugger that lets you disassemble the "jam table" instructions used by the bios to do some basic hardware initialization.