Commit Graph

23 Commits

Author SHA1 Message Date
Couriersud
6a0043bf8a Added TMS5220C variant to tms5220.c [Credit: Lord Nightmare]
- implemented reset for TMS5220C if /RS and /WS are pulled down together
- Inserted LNs email and corrections as comment into source
- Created a TODO section.
2009-09-21 21:32:38 +00:00
Couriersud
d93f2fec5c Added comment that looping has tms5220 hooked up to cpu. 2009-09-21 19:59:36 +00:00
Couriersud
fecae12d70 Changed irq callback to be of type devcb_write_line
- Updated drivers accordingly
- Removed some trampoline functions
2009-09-21 19:24:48 +00:00
Couriersud
7b6de74a1e Changed all tms5220 lines to (READ|WRITE)_LINE_DEVICE_HANDLER
- Added q suffix to denote active low lines
- Updated all drivers accordingly.
2009-09-21 17:43:16 +00:00
Couriersud
12992dad26 Implemented a RS and WS line interface for tms5220
- this emulates the RS/WS and READY handshaking according
  to the tms5220 manual. Drivers reading the ready line
  should most probably use it. 
- Note: For cases where the READY handshake is done by the cpu
  sufficient cycles have to be burnt to simulate that the
  cpu waited. This yet has to be implemented.
2009-09-20 23:35:27 +00:00
Aaron Giles
ac3d58fad5 Cleanups and version bump. 2009-08-21 01:52:51 +00:00
Aaron Giles
fd1eff262e And bye bye 5110intf.* 2009-08-19 15:11:13 +00:00
Aaron Giles
e4b94176bb Bye bye 5220intf.* 2009-08-19 14:50:17 +00:00
Aaron Giles
ad4910a8a8 Bulk change alert.
This update changes the way we handle memory allocation. Rather
than allocating in terms of bytes, allocations are now done in
terms of objects. This is done via new set of macros that replace
the malloc_or_die() macro:

  alloc_or_die(t) - allocate memory for an object of type 't'
  alloc_array_or_die(t,c) - allocate memory for an array of 'c' objects of type 't'
  alloc_clear_or_die(t) - same as alloc_or_die but memset's the memory to 0
  alloc_array_clear_or_die(t,c) - same as alloc_array_or_die but memset's the memory to 0

All original callers of malloc_or_die have been updated to call these
new macros. If you just need an array of bytes, you can use
alloc_array_or_die(UINT8, numbytes).

Made a similar change to the auto_* allocation macros. In addition,
added 'machine' as a required parameter to the auto-allocation macros,
as the resource pools will eventually be owned by the machine object.
The new macros are:

  auto_alloc(m,t) - allocate memory for an object of type 't'
  auto_alloc_array(m,t,c) - allocate memory for an array of 'c' objects of type 't'
  auto_alloc_clear(m,t) - allocate and memset
  auto_alloc_array_clear(m,t,c) - allocate and memset

All original calls or auto_malloc have been updated to use the new
macros. In addition, auto_realloc(), auto_strdup(), auto_astring_alloc(),
and auto_bitmap_alloc() have been updated to take a machine parameter.

Changed validity check allocations to not rely on auto_alloc* anymore
because they are not done in the context of a machine.

One final change that is included is the removal of SMH_BANKn macros.
Just use SMH_BANK(n) instead, which is what the previous macros mapped
to anyhow.
2009-04-26 23:54:37 +00:00
Aaron Giles
475762a3fd Sound cores compile cleanly. 2009-03-12 15:25:58 +00:00
Aaron Giles
5cb6bf00e9 Ok, this is The Big One.
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
2009-02-11 19:48:39 +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
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
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
Jonathan Gevaryahu
89769efec7 Update comments for tms5220 and sn76496. Add a Couriersud-style pinout to tms5220.c 2008-06-06 03:16:02 +00:00
Aaron Giles
d5ff8c002a Cleanups and version bump. 2008-05-22 05:19:16 +00:00
Aaron Giles
a300da2178 From: Atari Ace [mailto:atari_ace@verizon.net]
Subject: [patch] More Machine->machine changes, add machine to irq
callbacks

Hi mamedev,

Here are two more patches to eliminate Machine globals.  The first
patch was autogenerated by the attached fixup script.  That script has
been updated to catch additional cases which it previously missed
(when Machine is the last parameter to a function or Machine is used
in an assignment).  This makes ~50 more files deprecat.h free.

A sizable chunk (~20%) of the remaining uses of the Machine global in
the drivers are due to irq callbacks for sound and machine updates.
Typically such callbacks need to call cpunum_set_input_line, which
requires a machine parameter, so if the callbacks don't pass the
machine parameter, these routines have no choice but to reference the
global variable.

The second patch attempts to address most cases of this by adding the
machine parameter to the callback interfaces.  This allows us to
remove #include "deprecat.h" from ~150 files, at the cost of having to
fix up hundreds of callbacks.

In total, these patches reduced the number of files with deprecat.h
from 783 to 575.

~aa
2008-05-22 03:23:28 +00:00
Jonathan Gevaryahu
ae6bf98511 Added proper interpolation sub-cycles ('PC' cycles and A/B subcycles of each) and updated comments 2008-05-20 01:53:25 +00:00
Aaron Giles
21a686cf7d Cleanups and version bump. 2008-05-15 08:56:29 +00:00
Jonathan Gevaryahu
16942d210b Update TMS5200/5220 documentation and comments
Fix the chirp table implementation in both the 51xx and 52xx chips.
2008-05-13 04:56:47 +00:00
Aaron Giles
2299164694 Pushed CUSTOM_INPUT macro to all users.
Changed TMS0285 -> TMC0285.
Spacing cleanups for 0.122u6.
Version bump to 0.122u6.
2008-01-17 16:06:09 +00:00
Zsolt Vasvari
120a6070e8 Fixes victory137b4gre and victory37b16gre
src/mame/audio/berzerk.c
    - Added sh_reset

src/mame/audio/exidy.c
src/mame/includes/exidy.h
    - Added reset functionality
    - Moved Victory hardware routines here

src/mame/drivers/victory.c
    - Some clean-up, mirrored memory map for audio CPU

src/mame/video/victory.c
    - Simplified code by removing complicated
      dirty tracking.  Now VIDEO_UPDATE is
      called on every frame, further simplifing
      code

src/mame/drivers/exidy.c
    - Mirrored memory map for audio CPU
    - Added sh_reset

src/emu/machine/6821pia.c
src/emu/machine/6821pia.h
    - Added orthogonal accessors
    - Removed hacky update_shared_irq_handler(), now the same
      IRQ callback maybe called multiple times, but this shouldn't 
      be a problem
    - IRQ lines are cleared on a reset

src/emu/sound/tms5220.c
    - Disabled code that set the Buffer Empty flag after a stop
      frame.  This fixes Victory.  This might be the incorrect fix
      but the old code wasn't working either.
2008-01-13 06:14:20 +00:00
Aaron Giles
7b77f12186 Initial checkin of MAME 0.121. 2007-12-17 15:19:59 +00:00