summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/sound/msm5232.c
Commit message (Collapse)AuthorAgeFilesLines
* Correct a long-standing design flaw: device configuration state Aaron Giles2010-01-181-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* First round of an attempted cleanup of header files in the system. Aaron Giles2010-01-101-3/+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
|
* Cleanups and version bump.mame0129u4 Aaron Giles2009-02-171-1/+1
|
* Ok, this is The Big One. Aaron Giles2009-02-111-64/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+0
| | | | | | | | | | | | | | | | | | | > 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/+3
| | | | | 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-1/+1
|
* Cleaned up device and sound interfaces to match the CPU Aaron Giles2008-12-191-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-12/+12
| | | | | | | | | | | | | | | | | | | | | | 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
* This patch furthers the process of aligning the sound cores with the Aaron Giles2008-12-041-4/+8
| | | | | | | | | | | | | recent cpu core changes. Specifically, it adds a fake device implementation similar to the one the cpu cores were using in 128u3 (i.e. it only provides the machine pointer and the token), and makes some interface adjustments aligned to 128u4 (i.e. adding snd_class_header, adding get_ to various getter functions). The primary benefit of this change is the removal of "deprecat.h" from 23 sound cores. I also adjusted ui.c to stop calling sndnum_clock and access the clock data similarly to how it does the cpu clock data. [AtariAce]
* From AtariAce: Aaron Giles2008-11-131-12/+12
| | | | | | | | | | | 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).
* Updated src\emu\sound headers from K-S, so they use latest naming/structure ↵ Derrick Renaud2008-08-101-4/+4
| | | | | | | and re-inclusion support. Also lowercased the handler names. What a PITA. :) I'll have to go back and do A-J to lower case the handlers to match the new structure names I already did. Sorry Mess and other port developers, but the code should match what is stated on the official WIKI. But don't worry, I don't plan on updating anything but the sound cores.
* Changed the way memory regions are referenced. Instead of a single Aaron Giles2008-07-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Cleanups for 0.124. Marked Mermaid as working per checkin comment. Aaron Giles2008-03-241-1/+1
|
* Added Noise Output to the MSM5232 emulation Nicola Salmoria2008-03-191-1/+4
| | | Added placeholder effects for cymbal and hihat to equites.c. These will need further work to properly emulate the discrete circuitry.
* Alpha Denshi major update Nicola Salmoria2008-03-171-26/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is still WIP bug I've been working on it for sveral weeks and I want to get it out before leaving for holidays. - Fixed Alpha 8201/830x MCU simulation. - all hacks from the equites driver removed - fixed equites restart position after going underground - fixed hvolume, splndrbt 2 players - removed hacks from exctsccr2 - fixed CPU gameplay in shougi - Gekisou promoted to working - added dump of Alpha 8201 MCU to games that use it (the ROM isn't used yet, HMCS44 CPU core needs to be written first) - major cleanup of the mess in equites.c: - many thanks to Corrado Tomaselli for precious hardware info. - implemented bg perspective scrolling using PROMs - fixed sprite flip & disable - fixed bg color - converted bg to tilemaps - fixed fg banking - fixed screen flip - removed meaningless banking of player inputs - added UI adjuster for MSM5232 frequency - MSM5232 volume control - fixed MSM5232 noise LFSR formula (done by Jarek Burczynski; thanks to Corrado Tomaselli for samples) - changed MSM5232 emulator to output channels separately - added output of SOLO channels to MSM5232 emulator. - mametesters bugs fixed: - 00217 splndrbt: On boot the pcb displays a clean light blu screen while in mame there is a black road. - 00220 splndrbt: Concerning the gfx, on the pcb the background is not linear as shown in mame. - 00223 splndrbt: On the first level when you pass the asteroid belt the star road should be light blue instead of black like mam - fixed champbas inputs - merged talbot with champbas, some driver clenaup - fixed shougi inputs - switched exctsccb to use the correct gfx ROMs (matches screenshot found in 01058 exctsccb: Exciting soccer bootleg should be placed in champbas.c.) - fixed sprite bpp in exctscrr, removed the horrible hacks that were used to fix colors and transparency. - fixed sound clipping in exctsccr
* From: Atari Ace [mailto:atari_ace@verizon.net] Aaron Giles2008-01-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Subject: [patch] Fix C4305 warnings, other MSVC tweaks Hi mamedev, This patch is a bit of a potpourri. It is the result of enabling most of the suppressed warnings when using MSVC compilers and seeing what issues arose with different compilers (I used 70,71,80,90). Two of the warnings were judged to be useful to enable and methodically fix. Some issues spotted by the other warnings were also fixed. 1. Fixed issues flagged by MSVC warning C4305 (type truncation). Almost all of these are harmless double->float narrowing in initializers, but one warning spotlighted a bug in segasyse.c, where code to use a higher sprite number had no effect due to the insufficient range of UINT8. 2. Removed /wd4550 for VS7/VS71 compilers (expression evaluates to a function which is missing an argument list). There are no cases of this warning currently, and if there were they would most certainly be bugs. This also allowed the warning suppression lists to be remerged for VS7 and VS2005. 3. Decoupled intrinsic support decisions from PTR64 in eivc.h. 4. Fixed some VS7-specific issues (OPTIMIZE=0 at least compiles now). That compiler doesn't support "long long" or "ll" (rsp.c/dkong.c). 5. Added a missing case statement in sm8500d.c. Noticed while reviewing dead code warnings. 6. Replaced a number of static constants with an enum in sidenvel.h. This is unrelated to the rest of this patch, but it was overdue to be done.
* Copyright cleanup: Aaron Giles2008-01-061-1/+1
| | | | | | - removed years from copyright notices - removed redundant (c) from copyright notices - updated "the MAME Team" to be "Nicola Salmoria and the MAME Team"
* Changes for MAME 0.121u4.mame0121u4 Aaron Giles2007-12-171-2/+2
|
* Changes for MAME 0.121u1.mame0121u1 Aaron Giles2007-12-171-1/+1
|
* Initial checkin of MAME 0.121.mame0121 Aaron Giles2007-12-171-0/+803