~ubuntu-branches/ubuntu/lucid/sdlmame/lucid

« back to all changes in this revision

Viewing changes to src/mame/audio/exidy.c

  • Committer: Bazaar Package Importer
  • Author(s): Cesare Falco
  • Date: 2009-11-03 17:10:15 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20091103171015-6hop4ory5lxnumpn
Tags: 0.135-0ubuntu1
* New upstream release - Closes (LP: #403212)
* debian/watch: unstable releases are no longer detected
* mame.ini: added the cheat subdirectories to cheatpath so zipped
  cheatfiles will be searched too
* renamed crsshair subdirectory to crosshair to reflect upstream change
* mame.ini: renamed references to crosshair subdirectory (see above)

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#include "machine/6821pia.h"
13
13
#include "machine/6532riot.h"
14
14
#include "sound/hc55516.h"
15
 
#include "sound/5220intf.h"
 
15
#include "sound/tms5220.h"
16
16
#include "exidy.h"
17
17
 
18
18
 
459
459
}
460
460
 
461
461
 
462
 
static void r6532_porta_w(const device_config *device, UINT8 newdata, UINT8 olddata)
 
462
static WRITE8_DEVICE_HANDLER( r6532_porta_w )
463
463
{
464
464
        if (has_mc3417)
465
 
                cputag_set_input_line(device->machine, "cvsdcpu", INPUT_LINE_RESET, (newdata & 0x10) ? CLEAR_LINE : ASSERT_LINE);
466
 
}
467
 
 
468
 
 
469
 
static void r6532_portb_w(const device_config *device, UINT8 newdata, UINT8 olddata)
470
 
{
471
 
        const device_config *tms = devtag_get_device(device->machine, "tms");
472
 
        if (device != NULL)
473
 
        {
474
 
                if ((olddata & 0x01) && !(newdata & 0x01))
475
 
                {
476
 
                        riot6532_porta_in_set(riot, tms5220_status_r(tms, 0), 0xff);
477
 
                        logerror("(%f)%s:TMS5220 status read = %02X\n", attotime_to_double(timer_get_time(device->machine)), cpuexec_describe_context(device->machine), tms5220_status_r(tms, 0));
478
 
                }
479
 
                if ((olddata & 0x02) && !(newdata & 0x02))
480
 
                {
481
 
                        logerror("(%f)%s:TMS5220 data write = %02X\n", attotime_to_double(timer_get_time(device->machine)), cpuexec_describe_context(device->machine), riot6532_porta_out_get(riot));
482
 
                        tms5220_data_w(tms, 0, riot6532_porta_out_get(riot));
483
 
                }
484
 
        }
485
 
}
486
 
 
487
 
 
488
 
static UINT8 r6532_portb_r(const device_config *device, UINT8 olddata)
489
 
{
490
 
        UINT8 newdata = olddata;
 
465
                cputag_set_input_line(device->machine, "cvsdcpu", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
 
466
 
 
467
        if (has_tms5220)
 
468
        {
 
469
                const device_config *tms = devtag_get_device(device->machine, "tms");
 
470
                logerror("(%f)%s:TMS5220 data write = %02X\n", attotime_to_double(timer_get_time(device->machine)), cpuexec_describe_context(device->machine), riot6532_porta_out_get(riot));
 
471
                tms5220_data_w(tms, 0, data);
 
472
        }
 
473
}
 
474
 
 
475
static READ8_DEVICE_HANDLER( r6532_porta_r )
 
476
{
 
477
        if (has_tms5220)
 
478
        {
 
479
                const device_config *tms = devtag_get_device(device->machine, "tms");
 
480
                logerror("(%f)%s:TMS5220 status read = %02X\n", attotime_to_double(timer_get_time(device->machine)), cpuexec_describe_context(device->machine), tms5220_status_r(tms, 0));
 
481
                return tms5220_status_r(tms, 0);
 
482
        }
 
483
        else
 
484
                return 0xff;
 
485
}
 
486
 
 
487
static WRITE8_DEVICE_HANDLER( r6532_portb_w )
 
488
{
 
489
        if (has_tms5220)
 
490
        {
 
491
                const device_config *tms = devtag_get_device(device->machine, "tms");
 
492
 
 
493
                tms5220_rsq_w(tms, data & 0x01);
 
494
                tms5220_wsq_w(tms, (data >> 1) & 0x01);
 
495
        }
 
496
}
 
497
 
 
498
 
 
499
static READ8_DEVICE_HANDLER( r6532_portb_r )
 
500
{
 
501
        UINT8 newdata = riot6532_portb_in_get(device);
491
502
        if (has_tms5220)
492
503
        {
493
504
                const device_config *tms = devtag_get_device(device->machine, "tms");
494
505
                newdata &= ~0x0c;
495
 
                if (!tms5220_ready_r(tms)) newdata |= 0x04;
496
 
                if (!tms5220_int_r(tms)) newdata |= 0x08;
 
506
                if (tms5220_readyq_r(tms)) newdata |= 0x04;
 
507
                if (tms5220_intq_r(tms)) newdata |= 0x08;
497
508
        }
498
509
        return newdata;
499
510
}
501
512
 
502
513
static const riot6532_interface r6532_interface =
503
514
{
504
 
        NULL,                                   /* port A read handler */
505
 
        r6532_portb_r,                  /* port B read handler */
506
 
        r6532_porta_w,                  /* port A write handler */
507
 
        r6532_portb_w,                  /* port B write handler */
508
 
        r6532_irq                               /* IRQ callback */
 
515
        DEVCB_HANDLER(r6532_porta_r),   /* port A read handler */
 
516
        DEVCB_HANDLER(r6532_portb_r),   /* port B read handler */
 
517
        DEVCB_HANDLER(r6532_porta_w),   /* port A write handler */
 
518
        DEVCB_HANDLER(r6532_portb_w),   /* port B write handler */
 
519
        DEVCB_LINE(r6532_irq)                   /* IRQ callback */
509
520
};
510
521
 
511
522