Commit Graph

16 Commits

Author SHA1 Message Date
Aaron Giles
42c9aeff39 Cleaned up device and sound interfaces to match the CPU
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.
2008-12-19 06:46:17 +00:00
Aaron Giles
785b6a50c6 From: Atari Ace [mailto:atari_ace@verizon.net]
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
2008-12-18 08:32:50 +00:00
Aaron Giles
b400e7978b From: Atari Ace [mailto:atari_ace@verizon.net]
Sent: Thursday, December 11, 2008 6:52 PM
To: submit@mamedev.org
Cc: atariace@hotmail.com
Subject: [patch] deprecat.h cpu cleanup

Hi mamedev,

This patch purges the last few uses of deprecat.h from the cpu cores,
plus a handful of other Machine cases elsewhere that were found by
script inspection.

~aa

--

Hi mamedev,

This patch eliminates most uses of deprecat.h in the sound cores by
attaching the device to the state object and using it where
appropriate.  Given that all the cpu objects use this convention, and
three sound cores already do this, this seemed an appropriate
approach.

~aa
2008-12-12 06:11:15 +00:00
Aaron Giles
e2a760bcbd From: Atari Ace [mailto:atari_ace@verizon.net]
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
2008-12-10 06:31:23 +00:00
Aaron Giles
b24198a1cd Hi mamedev,
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
2008-12-08 06:53:40 +00:00
Aaron Giles
3c6eacc96f Changed save state system to accept machine parameters where
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.
2008-12-05 08:00:13 +00:00
Aaron Giles
78622af0eb This patch furthers the process of aligning the sound cores with the
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]
2008-12-04 10:44:15 +00:00
Aaron Giles
a5bf427929 Added "tag" parameter to state_save_register_item_* calls. Removed
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.
2008-11-17 06:21:26 +00:00
Aaron Giles
eb08400613 From AtariAce:
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).
2008-11-13 07:07:54 +00:00
Derrick Renaud
cc94c8207d Updated structure and naming conventions of the following sound interfaces.
struct CustomSound_interface to custom_sound_interface
struct Samplesinterface to samples_interface
struct SN76477interface to SN76477_interface
struct AY8910interface to AY8910_interface
2008-08-08 01:50:00 +00:00
Aaron Giles
27fed1ec97 Changed the way memory regions are referenced. Instead of a single
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.
2008-07-28 09:35:36 +00:00
Aaron Giles
dbb98c5473 Reduced the number of save state callback types from 3 to 1. The
only remaining form is the one that takes a pointer parameter.

Added macros for STATE_PRESAVE and STATE_POSTLOAD to define common
functions. Added machine parameter to these functions.

Updated all drivers and CPU/sound cores  to use the new macros 
and consolidate on the single function type. As a result pushed
the machine parameter through a few initialization stacks.

Removed unnecessary postload callbacks which only marked all tiles
dirty, since this is done automatically by the tilemap engine.
2008-04-11 05:41:46 +00:00
Zsolt Vasvari
4930b2dbfd - Added deprecat.h that contains some deprecated/discouraged contructs (see below)
The idea is to create extra work if a driver wants to use these and hopefully
  gives an incentive to look for an alternate solution
- Added #include of deprecat.h that rely on these contructs
- Removed a bunch of unneccassary #include's from these files
2008-01-25 09:30:43 +00:00
Aaron Giles
ee9f88963c Copyright cleanup:
- removed years from copyright notices
 - removed redundant (c) from copyright notices
 - updated "the MAME Team" to be "Nicola Salmoria and the MAME Team"
2008-01-06 00:47:40 +00:00
Aaron Giles
df34329a47 Changes for MAME 0.121u3. 2007-12-17 16:39:40 +00:00
Aaron Giles
7b77f12186 Initial checkin of MAME 0.121. 2007-12-17 15:19:59 +00:00