summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/sound/gaelco.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Move all devices into separate part of src tree (nw) Miodrag Milanovic2015-09-131-276/+0
|
* Update license and email for Manuel Abadia (nw) Miodrag Milanovic2015-05-231-2/+2
|
* sorted out more (nw) Miodrag Milanovic2015-05-141-1/+1
|
* Added dummy license headers for EMU section (nw) Miodrag Milanovic2015-05-071-0/+2
|
* Touching all the candy again: [Alex Jackson] Alex W. Jackson2014-11-171-3/+1
| | | | | | | | | | | | | | | | Fixed an annoying inconsistency between memory_share and memory_region: the width() method of the former returned the width in bits (8, 16, 32 or 64) while the width() method of the latter returned the width in bytes (1, 2, 4 or 8). Now both classes have a bitwidth() method and a bytewidth() method. Updated all callers to use whichever one was more appropriate. Removed the implicit-cast-to-any-integer-pointer ability of memory_regions, which was rather unsafe (if you weren't careful with your * operators and casts it was easy to accidentally get a pointer to the memory_region object itself instead of to the data, with no warning from the compiler... or at least I kept doing it) Updated all devices and drivers that were accessing regions that way to use a region_ptr_finder when possible, and otherwise to call base() explicitly.
* Gaelco CG-1V/GAE1: converted to use inline configs. nw. Fabio Priuli2014-05-151-14/+8
|
* extended large amount of devices with shortname and source file data (nw) Miodrag Milanovic2013-06-211-4/+4
|
* Cleanups and version bumpmame0148 Miodrag Milanovic2013-01-111-12/+12
|
* Reverted last change (nw). Andrew Gardner2012-12-291-2/+2
| | | | | Will continue to stick to keeping my source changes to a minimum.
* Modernize Gaelco sound devices. [Andrew Gardner] Andrew Gardner2012-12-281-128/+65
| | | | | | | Out of whatsnew: These are really simple to do between the inevitable holiday distractions. Zen. Etc.
* Stop allocating arrays of UINT8s for the tokens, when Aaron Giles2012-09-181-2/+2
| | | | we can allocate objects of the real type.
* First pass at modernizing struct definitions. Aaron Giles2012-09-151-4/+2
|
* Cleanup and some inheritance fixes (no whatsnew) Miodrag Milanovic2012-09-031-55/+0
|
* conversion of legacy devices into modern wip (no whatsnew) Miodrag Milanovic2012-09-031-3/+62
|
* Changed device->subregion to device->memregion. Moved Aaron Giles2012-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Collapsed device_config and device_t into one class. Updated all Aaron Giles2011-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* BIG update. Aaron Giles2011-03-291-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 *)
* As promised, the bulk update of timer calls: Aaron Giles2011-02-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | timer_adjust_oneshot(t,...) => t->adjust(...) timer_adjust_periodic(t,...) => t->adjust(...) timer_reset(t,...) => t->reset(...) timer_enable(t,...) => t->enable(...) timer_enabled(t) => t->enabled() timer_get_param(t) => t->param() timer_get_ptr(t) => t->ptr() timer_set_param(t,...) => t->set_param(...) timer_set_ptr(t) => t->set_ptr(...) timer_timeelapsed(t) => t->elapsed() timer_timeleft(t) => t->remaining() timer_starttime(t) => t->start() timer_firetime(t) => t->expire() Also remove some stray legacy cpuexec* macros that were lurking in schedule.h): cpuexec_describe_context(m) => m->describe_context() cpuexec_boost_interleave(m,...) => m->scheduler().boot_interleave(...) cpuexec_trigger(m,...) => m->scheduler().trigger(...) cpuexec_triggertime(m,...) => m->scheduler().trigger(...) Specific regex'es used: timer_adjust_oneshot( *)\(( *)([^,;]+), * \3->adjust\1\(\2 timer_adjust_periodic( *)\(( *)([^,;]+), * \3->adjust\1\(\2 (->adjust.*), *0( *)\) \1\2\) timer_reset( *)\(( *)([^,;]+), * \3->reset\1\(\2 (->reset *\(.*)attotime::never \1 timer_enable( *)\(( *)([^,;]+), * \3->enable\1\(\2 timer_enabled( *)\(( *)([^,;)]+)\) \3->enabled\1\(\2\) timer_get_param( *)\(( *)([^,;)]+)\) \3->param\1\(\2\) timer_get_ptr( *)\(( *)([^,;)]+)\) \3->ptr\1\(\2\) timer_timeelapsed( *)\(( *)([^,;)]+)\) \3->elapsed\1\(\2\) timer_timeleft( *)\(( *)([^,;)]+)\) \3->remaining\1\(\2\) timer_starttime( *)\(( *)([^,;)]+)\) \3->start\1\(\2\) timer_firetime( *)\(( *)([^,;)]+)\) \3->expire\1\(\2\) timer_set_param( *)\(( *)([^,;]+), * \3->set_param\1\(\2 timer_set_ptr( *)\(( *)([^,;]+), * \3->set_ptr\1\(\2 cpuexec_describe_context( *)\(( *)([^,;)]+)\) \3->describe_context\1\(\2\) \&m_machine->describe_context m_machine.describe_context cpuexec_boost_interleave( *)\(( *)([^,;]+), * \3->scheduler().boost_interleave\1\(\2 cpuexec_trigger( *)\(( *)([^,;]+), * \3->scheduler().trigger\1\(\2 cpuexec_triggertime( *)\(( *)([^,;]+), * \3->scheduler().trigger\1\(\2
* C++-ified the sound and streams interfaces. Combined sound.c and streams.c Aaron Giles2011-01-271-3/+2
| | | | | | | | | | | | | | | | | | | into one file, and separated the speaker device into its own file. Generalized the concept of dynamically assigned inputs and re-wired the speaker to work this way, so it is now treated just like any other sound device. Added methods to the device_sound_interface for controlling output gain and mapping device inputs/outputs to stream inputs/outputs. Also made the sound_stream_update() method pure virtual, so all modern sound devices must use the new mechanism for stream updates. Primary changes outside of the core are: stream_update(stream) == stream->update() stream_create(device,...) == machine->sound().stream_alloc(*device,...) sound_global_enable(machine,enable) == machine->sound().system_enable(enable) Beyond this, the patterns are relatively obvious for the remaining calls.
* Ok, last major rename for this round: Aaron Giles2011-01-011-1/+1
| | | | | | | | | | | | | | | | 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\(\)
* running_device -> device_t Aaron Giles2010-12-311-1/+1
| | | | | They both already existed. No sense in having two names for the same object type.
* Remove artificial SOUND_ prefix from sound device names. Aaron Giles2010-09-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | [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
* Removed global variables from gaelco, namco, and nile sound cores. Aaron Giles2010-08-041-23/+25
| | | | | | | | | | | | | | | | | | | | | | | | [Atari Ace] -- From: Atari Ace <atari_ace@frontier.net> Date: Mon, Aug 2, 2010 at 5:07 AM Subject: [patch] Remove globals from gaelco, namco and nile sound cores To: submit@mamedev.org Cc: atariace@hotmail.com Hi mamedev, This patch removes some global variables from the gaelco, namco and nile sound cores. Properly implemented devices should have all their variables in their device state to allow for multiple instances. ~aa
* Split implementation for legacy devices into a separate macro. Updated all Aaron Giles2010-06-111-0/+3
| | | | | | | | devices to use this macro in their .c file. This greatly reduces the amount of work the linker has to do to combine all the instances, and reduces the final binary size when building with symbols. Unfortunately, in order to do it I had to switch back to macros from templates, but I can live with that for legacy devices.
* WARNING: There are likely to be regressions in both functionality and Aaron Giles2010-06-081-11/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | performance as a result of this change. Do not panic; report issues to the list in the short term and I will look into them. There are probably also some details I forgot to mention. Please ask questions if anything is not clear. NOTE: This is a major internal change to the way devices are handled in MAME. There is a small impact on drivers, but the bulk of the changes are to the devices themselves. Full documentation on the new device handling is in progress at http://mamedev.org/devwiki/index.php/MAME_Device_Basics Defined two new casting helpers: [Aaron Giles] downcast<type>(value) should be used for safe and efficient downcasting from a base class to a derived class. It wraps static_cast<> by adding an assert that a matching dynamic_cast<> returns the same result in debug builds. crosscast<type>(value) should be used for safe casting from one type to another in multiple inheritance scenarios. It compiles to a dynamic_cast<> plus an assert on the result. Since it does not optimize down to static_cast<>, you should prefer downcast<> over crosscast<> when you can. Redefined running_device to be a proper C++ class (now called device_t). Same for device_config (still called device_config). All devices and device_configs must now be derived from these base classes. This means each device type now has a pair of its own unique classes that describe the device. Drivers are encouraged to use the specific device types instead of the generic running_device or device_t classes. Drivers that have a state class defined in their header file are encouraged to use initializers off the constructor to locate devices. [Aaron Giles] Removed the following fields from the device and device configuration classes as they never were necessary or provided any use: device class, device family, source file, version, credits. [Aaron Giles] Added templatized variant of machine->device() which performs a downcast as part of the device fetch. Thus machine->device<timer_device>("timer") will locate a device named "timer", downcast it to a timer_device, and assert if the downcast fails. [Aaron Giles] Removed most publically accessible members of running_device/device_t in favor of inline accessor functions. The only remaining public member is machine. Thus all references to device->type are now device->type(), etc. [Aaron Giles] Created a number of device interface classes which are designed to be mix- ins for the device classes, providing specific extended functionality and information. There are standard interface classes for sound, execution, state, nvram, memory, and disassembly. Devices can opt into 0 or more of these classes. [Aaron Giles] Converted the classic CPU device to a standard device that uses the execution, state, memory, and disassembly interfaces. Used this new class (cpu_device) to implement the existing CPU device interface. In the future it will be possible to convert each CPU core to its own device type, but for now they are still all CPU devices with a cpu_type() that specifies exactly which kind of CPU. [Aaron Giles] Created a new header devlegcy.h which wraps the old device interface using some special template classes. To use these with an existing device, simply remove from the device header the DEVICE_GET_INFO() declaration and the #define mapping the ALL_CAPS name to the DEVICE_GET_INFO. In their place #include "devlegcy.h" and use the DECLARE_LEGACY_DEVICE() macro. In addition, there is a DECLARE_LEGACY_SOUND_DEVICE() macro for wrapping existing sound devices into new-style devices, and a DECLARE_LEGACY_NVRAM_DEVICE() for wrapping NVRAM devices. Also moved the token and inline_config members to the legacy device class, as these are not used in modern devices. [Aaron Giles] Converted the standard base devices (VIDEO_SCREEN, SPEAKER, and TIMER) from legacy devices to the new C++ style. Also renamed VIDEO_SCREEN to simply SCREEN. The various global functions that were previously used to access information or modify the state of these devices are now replaced by methods on the device classes. Specifically: video_screen_configure() == screen->configure() video_screen_set_visarea() == screen->set_visible_area() video_screen_update_partial() == screen->update_partial() video_screen_update_now() == screen->update_now() video_screen_get_vpos() == screen->vpos() video_screen_get_hpos() == screen->hpos() video_screen_get_vblank() == screen->vblank() video_screen_get_hblank() == screen->hblank() video_screen_get_width() == screen->width() video_screen_get_height() == screen->height() video_screen_get_visible_area() == screen->visible_area() video_screen_get_time_until_pos() == screen->time_until_pos() video_screen_get_time_until_vblank_start() == screen->time_until_vblank_start() video_screen_get_time_until_vblank_end() == screen->time_until_vblank_end() video_screen_get_time_until_update() == screen->time_until_update() video_screen_get_scan_period() == screen->scan_period() video_screen_get_frame_period() == screen->frame_period() video_screen_get_frame_number() == screen->frame_number() timer_device_adjust_oneshot() == timer->adjust() timer_device_adjust_periodic() == timer->adjust() timer_device_reset() == timer->reset() timer_device_enable() == timer->enable() timer_device_enabled() == timer->enabled() timer_device_get_param() == timer->param() timer_device_set_param() == timer->set_param() timer_device_get_ptr() == timer->get_ptr() timer_device_set_ptr() == timer->set_ptr() timer_device_timeelapsed() == timer->time_elapsed() timer_device_timeleft() == timer->time_left() timer_device_starttime() == timer->start_time() timer_device_firetime() == timer->fire_time() Updated all drivers that use the above functions to fetch the specific device type (timer_device or screen_device) and call the appropriate method. [Aaron Giles] Changed machine->primary_screen and the 'screen' parameter to VIDEO_UPDATE to specifically pass in a screen_device object. [Aaron Giles] Defined a new custom interface for the Z80 daisy chain. This interface behaves like the standard interfaces, and can be added to any device that implements the Z80 daisy chain behavior. Converted all existing Z80 daisy chain devices to new-style devices that inherit this interface. [Aaron Giles] Changed the way CPU state tables are built up. Previously, these were data structures defined by a CPU core which described all the registers and how to output them. This functionality is now part of the state interface and is implemented via the device_state_entry class. Updated all CPU cores which were using the old data structure to use the new form. The syntax is currently awkward, but will be cleaner for CPUs that are native new devices. [Aaron Giles] Converted the okim6295 and eeprom devices to the new model. These were necessary because they both require multiple interfaces to operate and it didn't make sense to create legacy device templates for these single cases. (okim6295 needs the sound interface and the memory interface, while eeprom requires both the nvram and memory interfaces). [Aaron Giles] Changed parameters in a few callback functions from pointers to references in situations where they are guaranteed to never be NULL. [Aaron Giles] Removed MDRV_CPU_FLAGS() which was only used for disabling a CPU. Changed it to MDRV_DEVICE_DISABLE() instead. Updated drivers. [Aaron Giles] Reorganized the token parsing for machine configurations. The core parsing code knows how to create/replace/remove devices, but all device token parsing is now handled in the device_config class, which in turn will make use of any interface classes or device-specific token handling for custom token processing. [Aaron Giles] Moved many validity checks out of validity.c and into the device interface classes. For example, address space validation is now part of the memory interface class. [Aaron Giles] Consolidated address space parameters (bus width, endianness, etc.) into a single address_space_config class. Updated all code that queried for address space parameters to use the new mechanism. [Aaron Giles]
* Correct a long-standing design flaw: device configuration state Aaron Giles2010-01-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is now separate from runtime device state. I have larger plans for devices, so there is some temporary scaffolding to hold everything together, but this first step does separate things out. There is a new class 'running_device' which represents the state of a live device. A list of these running_devices sits in machine->devicelist and is created when a running_machine is instantiated. To access the configuration state, use device->baseconfig() which returns a reference to the configuration. The list of running_devices in machine->devicelist has a 1:1 correspondance with the list of device configurations in machine->config->devicelist, and most navigation options work equally on either (scanning by class, type, etc.) For the most part, drivers will now deal with running_device objects instead of const device_config objects. In fact, in order to do this patch, I did the following global search & replace: const device_config -> running_device device->static_config -> device->baseconfig().static_config device->inline_config -> device->baseconfig().inline_config and then fixed up the compiler errors that fell out. Some specifics: Removed device_get_info_* functions and replaced them with methods called get_config_*. Added methods for get_runtime_* to access runtime state from the running_device. DEVICE_GET_INFO callbacks are only passed a device_config *. This means they have no access to the token or runtime state at all. For most cases this is fine. Added new DEVICE_GET_RUNTIME_INFO callback that is passed the running_device for accessing data that is live at runtime. In the future this will go away to make room for a cleaner mechanism. Cleaned up the handoff of memory regions from the memory subsystem to the devices.
* Added casting operators to the region_info class so you can assign Aaron Giles2010-01-161-1/+1
| | | | | | | | | | | | | | | | a region to a generic type pointer and have it automatically convert. Also added a bytes() method which is safe if the region is NULL (useful for saying machine->region("foo")->bytes() and not crashing if foo doesn't exist). Changed the region field in the device_config to be a region_info *, and removed the regionbytes field. Updated all users of these fields to use the new casting operators and bytes() methods instead. Added subdevice and subregion methods to the device_config class, so you can easily query for devices and regions that are device-specific. The device prefix ("devicename:") is automatically prepended.
* First round of an attempted cleanup of header files in the system. Aaron Giles2010-01-101-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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!)
* Results of running the latest srcclean. Aaron Giles2009-12-281-1/+1
|
* Sound cores compile cleanly. Aaron Giles2009-03-121-3/+3
|
* Ok, this is The Big One. Aaron Giles2009-02-111-65/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Please note: regression testing is in progress, but the first round of glaring regressions have already been taken care of. That said, there is likely to be a host of regressions as a result of this change. Also note: There are still a few rough edges in the interfaces. I will try to clean them up systematically once the basic system is working. All sound chips are now proper devices. Merged the sound chip interface into the device interface, removing any differences (such as the whole ALIASing concept). Modified every sound chip in the following ways: * updated to match the device interface * reduced read/write handlers down to the minimal number * added the use of get_safe_token() for ensuring correctness * other minor cleanup Removed the custom sound device. The additional work to just make custom sound cases into full devices is minimal, so I just converted them all over to be actual devices. Vastly simplified the sound interfaces, removing the ghastly sndti_* business and moving everyone over to using tags for sound identity. sndintrf, like cpuintrf, is now just a header file with no implementation. Modified each and every driver that references a sound chip: * all memory maps explicitly reference the targeted device via AM_DEVREAD/AM_DEVWRITE/AM_DEVREADWRITE * 16-bit and 32-bit accesses to 8-bit chips no longer use trampoline functions but instead use the 8-bit AM_DEVREAD/WRITE macros * all references to sound chips are now done via tags * note that these changes are brute force, not optimal; in many cases drivers should grab pointers to devices in MACHINE_START and stash them away
* On Mon, Jan 19, 2009 at 02:48:05PM +0100, Olivier Galibert wrote: Aaron Giles2009-01-221-5/+3
| | | | | | | | | | | | | | | | | | | > On Mon, Jan 19, 2009 at 05:37:35AM -0800, R. Belmont wrote: > > My mistake. I thought you were suggesting that we should actually > > somehow handle malloc failures. Given that aborting is an OK way to > > express failure, I'd suggest the return values be changed to DEFER > > and DONT_DEFER to eliminate the conceptual imbalance of OK/DEFER. > > That's where comes the fact that we have 130 OK/DONT_DEFER and 1 > DEFER. It makes me think that the exceptional DEFER case should be > handled by an exceptional function call. > > I know, code talks, but I'm at work right now :-) Here we go. OG.
* Sound cores no longer allocate their own tokens. Instead they return a new Aaron Giles2009-01-181-5/+5
| | | | | integer value indicating the size of token they want, and the core allocates it for them. This mirrors the standard device behavior.
* Removed redundant config parameter from SND_START. Aaron Giles2009-01-181-4/+4
|
* Cleaned up device and sound interfaces to match the CPU Aaron Giles2008-12-191-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | interfaces when handling strings. Namely, the generic get_info functions allocate a temporary string and the device in question copies its string to the target, instead of assigning a const char *. Updated all device and sound cores to operate this way. Added the concept of a cpu_state_table, which is supplied by the CPU cores and which describes all the register state accessible to the debugger and other subsystems. The format of the table is such that most data can be simply fetched from memory without the further involvement of the CPU core, including the display of common formats. Extensibility points are available for custom display and for importing/exporting the data to intermediate variables for more complicated scenarios. Updated the ADSP21xx, TMS340x0, and i86 cores to use this. Removed the old debugger register list, which was never used. Replaced it with using ordering from the cpu_state_table. Renamed REG_PC -> REG_GENPC, REG_SP -> REG_GENSP, and REG_PREVIOUSPC -> REG_GENPCBASE. Updated a few spots that were using these directly. Moved these definitions into the end of the register area rather than leaving them outside which put them in a weird range.
* From: Atari Ace [mailto:atari_ace@verizon.net] Aaron Giles2008-12-181-5/+5
| | | | | | | | | | | | | | | | | | | | | | Sent: Wednesday, December 17, 2008 9:03 PM To: submit@mamedev.org Cc: atariace@hotmail.com Subject: [patch] STREAM_UPDATE update Hi mamedev, This patch modifies the parameters of the stream_update_func callback. The first two patches go through and changes all the callbacks to use a consistent set of parameters (the larger patch was mechanically generated, the smaller second patch are hand edits where review or compilation showed issues with the automatic conversion). The third patch then macroizes all the callbacks to STREAM_UPDATE, and was done mechanically except for the change to streams.h. The fourth patch then adds device to the callback, and eliminates Machine in a handful of callbacks by referencing the device. deprecat.h -= 8. ~aa
* From: Atari Ace [mailto:atari_ace@verizon.net] Aaron Giles2008-12-101-1/+1
| | | | | | | | | | | | | | | | | Sent: Tuesday, December 09, 2008 8:13 PM To: submit@mamedev.org Cc: atariace@hotmail.com Subject: [patch] Add device parameter to stream_create() Hi mamedev, This patch adds the sound device to the parameters passed to stream_create so that the global Machine can be removed from streams.c. It assumes my previous patch which added CUSTOM_START and SAMPLES_START has been applied. ~aa
* From: Atari Ace [mailto:atari_ace@verizon.net] Aaron Giles2008-12-071-1/+0
| | | | | | | | | | | | | | | | | | Sent: Saturday, December 06, 2008 4:52 PM To: submit@mamedev.org Cc: atariace@hotmail.com Subject: [patch] Deprecat.h cleanup Hi mamedev, This patch changes some global Machine references to use machine, device->machine, ... instead, and removes any unneeded #include "deprecat.h" lines as well (about 10% of them in fact). It was generated using the attached script, and then reverting some cases where it was overzealous. ~aa
* Changed save state system to accept machine parameters where Aaron Giles2008-12-051-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* WARNING: this compiles, but not fully cleanly, and a number of drivers Aaron Giles2008-11-141-2/+2
| | | | | | | | | | | | | | | | are broken. Changed READ/WRITE handlers to accept an address_space * instead of a machine *. The address_space object was enhanced to contain a machine and a pointer to the relevant CPU object. Fixed a number of errors found by the compiler, mostly in the core and CPU/sound handlers, but there is a lot remaining to fix. Added new function cpu_get_address_space() to fetch the address space for calling in manually to these functions. In some instances, code which should eventually be converted to a device is hard-coding fetching the program space of CPU #0 in order to have something valid to pass.
* From AtariAce: Aaron Giles2008-11-131-13/+13
| | | | | | | | | | | With Aaron's change to macroize the cpu apis, the cpu/sound interfaces are now using different idioms. This patch fixes that. It uses the prefix SND_ instead of SOUND_, to avoid changing SOUND_START, SOUND_RESET in driver.h. While working on it, I noticed that the reset routines for k053260, msm5205, upd7759 and vlm5030 aren't hooked up, but I decided this was an oversight and macroized the functions anyways (but left them unhooked).
* Major cpuintrf changes: Aaron Giles2008-11-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | * added a set of cpu_* calls which accept a CPU device object; these are now the preferred means of manipulating a CPU * removed the cpunum_* calls; added an array of cpu[] to the running_machine object; converted all existing cpunum_* calls to cpu_* calls, pulling the CPU device object from the new array in the running_machine * removed the activecpu_* calls; added an activecpu member to the running_machine object; converted all existing activecpu_* calls to cpu_* calls, pulling the active CPU device object from the running_machine * changed cpuintrf_push_context() to cpu_push_context(), taking a CPU object pointer; changed cpuintrf_pop_context() to cpu_pop_context(); eventually these will go away * many other similar changes moving toward a model where all CPU references are done by the CPU object and not by index
* more sound core structure/renaming updates. Derrick Renaud2008-08-091-1/+1
| | | | | | | | | | | | | | | You may have to do a clean compile, or delete the affected driver object files. struct C140interface to c140_interface struct cem3394_interface to cem3394_interface struct ES5503interface to es5503_interface struct ES5505interface to es5505_interface struct ES5506interface to es5506_interface struct ssg_callbacks to ssg_callbacks struct gaelcosnd_interface to gaelcosnd_interface struct ics2115_interface to ics2115_interface I'll stop until my posted question about chip names and upper case is answered.
* Region classes go bye-bye. Aaron Giles2008-07-281-2/+2
|
* Changed the way memory regions are referenced. Instead of a single Aaron Giles2008-07-281-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | integer value, regions are now referred to by a region class and a region tag. The class specifies the type of region (one of CPU, gfx, sound, user, disk, prom, pld) while the tag uniquely specifies the region. This change required updating all the ROM region definitions in the project to specify the class/tag instead of region number. Updated the core memory_region_* functions to accept a class/tag pair. Added new memory_region_next() function to allow for iteration over all memory regions of a given class. Added new function memory_region_class_name() to return the name for a given CPU memory region class. Changed the auto-binding behavior of CPU regions. Previously, the first CPU would auto-bind to REGION_CPU1 (that is, any ROM references would automatically assume that they lived in the corresponding region). Now, each CPU automatically binds to the RGNCLASS_CPU region with the same tag as the CPU itself. This behavior required ensuring that all previous REGION_CPU* regions were changed to RGNCLASS_CPU with the same tag as the CPU. Introduced a new auto-binding mechanism for sound cores. This works similarly to the CPU binding. Each sound core that requires a memory region now auto-binds to the RGNCLASS_SOUND with the same tag as the sound core. In almost all cases, this allowed for the removal of the explicit region item in the sound configuration, which in turn allowed for many sound configurations to removed altogether. Updated the expression engine's memory reference behavior. A recent update expanded the scope of memory references to allow for referencing data in non-active CPU spaces, in memory regions, and in EEPROMs. However, this previous update required an index, which is no longer appropriate for regions and will become increasingly less appropriate for CPUs over time. Instead, a new syntax is supported, of the form: "[tag.][space]size@addr", where 'tag' is an optional tag for the CPU or memory region you wish to access, followed by a period as a separator; 'space' is the memory address space or region class you wish to access (p/d/i for program/data/I/O spaces; o for opcode space; r for direct RAM; c/u/g/s for CPU/user/gfx/sound regions; e for EEPROMs); and 'size' is the usual b/w/d/q for byte/word/dword/qword. Cleaned up ROM definition flags and removed some ugly hacks that had existed previously. Expanded to support up to 256 BIOSes. Updated ROM_COPY to support specifying class/tag for the source region. Updated the address map AM_REGION macro to support specifying a class/tag for the region. Updated debugger windows to display the CPU and region tags where appropriate. Updated -listxml to output region class and tag for each ROM entry.
* From: Atari Ace [mailto:atari_ace@verizon.net] Aaron Giles2008-07-241-13/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Subject: [patch] Conditional code cleanup resubmit Hi mamedev, This is a resubmit of a previous patch. The earlier version would not compile with 32-bit MSVC, due to the fact that its linker required external dependencies in dead code to be met before dead code elimination was done, causing linker errors. The proper fix for this would be to add the necessary dependencies, so I instead simply left the conditional code in place in winalloc.c and chd.c. ~aa Original submission email below: ---- Conditionally compiled code tends to bitrot, so MAME should try to avoid it as much as possible. I sent a patch six months ago to eliminate conditional code associated with logging, here's another patch that does more of this. Some notes: 1. drc_ops.c: I couldn't find a LOG_CODE anywhere, so I used if (0). 2. romload.c: I converted all the users of debugload to use LOG((...)) instead, following the traditional conditional logging pattern. 3. windows/sound.c: I eliminated the separate sound log and directed the few outputs to the error log. ~aa
* From: Atari Ace [mailto:atari_ace@verizon.net] Aaron Giles2008-06-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | Subject: [patch] memory_region madness reloaded Hi mamedev, The memory_region and memory_region_length functions are probably the two most common functions in MAME that don't take a machine parameter but should given the syntax of the related apis memory_region_type and memory_region_flags. Clearly they didn't get the parameter because of the sheer number of changes needed to change the apis. This pair of patches makes the change, and deals with the consequences. The second patch then changes the api for memory_region and memory_region_length, and fixes the fallout. It generally plumbs through machine parameters where needed, except for the case of sound apis which I deferred doing so till later. This increased the number of deprecat.h includes by ~50. Given it is a massive patch, there are bound to be a few mistakes in it (I had to make ~20% of the changes by hand), but I exercised care and reviewed the patch several times to minimize the problems.
* Copyright cleanup: Aaron Giles2008-01-061-2/+2
| | | | | | - removed years from copyright notices - removed redundant (c) from copyright notices - updated "the MAME Team" to be "Nicola Salmoria and the MAME Team"
* (From Atari Ace) Aaron Giles2007-12-311-17/+10
| | | | | | | | The attached patch adjusts most conditional logging in MAME to use the idiom "do { if (VERBOSE) logerror x; } while (0)". This has the benefit that the compiler checks the syntax of the logging even in the case it will be eliminated, and in fact a number of cases here needed adjustments to compile because of this.
* Initial checkin of MAME 0.121.mame0121 Aaron Giles2007-12-171-0/+377