Previous 199869 Revisions Next

r17651 Wednesday 5th September, 2012 at 09:28:15 UTC by Tafoid
Continuing new device implementation for SN76496 and clones - bbc.c, mycom.c, pasopia7.c, smc777.c, a2alfam2.c)  [Osso]

Updated looping.c to use the new tms52xx device implementation.  [Osso]
[src/mame/drivers]looping.c
[src/mess/drivers]bbc.c mycom.c pasopia7.c smc777.c
[src/mess/includes]bbc.h
[src/mess/machine]a2alfam2.c a2alfam2.h bbc.c

trunk/src/mame/drivers/looping.c
r17650r17651
546546   AM_RANGE(0x3c00, 0x3c00) AM_MIRROR(0x00f4) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_address_w)
547547   AM_RANGE(0x3c02, 0x3c02) AM_MIRROR(0x00f4) AM_READNOP AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
548548   AM_RANGE(0x3c03, 0x3c03) AM_MIRROR(0x00f6) AM_NOP
549   AM_RANGE(0x3e00, 0x3e00) AM_MIRROR(0x00f4) AM_READNOP AM_DEVWRITE_LEGACY("tms", tms5220_data_w)
550   AM_RANGE(0x3e02, 0x3e02) AM_MIRROR(0x00f4) AM_DEVREAD_LEGACY("tms", tms5220_status_r) AM_WRITENOP
549   AM_RANGE(0x3e00, 0x3e00) AM_MIRROR(0x00f4) AM_READNOP AM_DEVWRITE("tms", tms5220n_device, write)
550   AM_RANGE(0x3e02, 0x3e02) AM_MIRROR(0x00f4) AM_DEVREAD("tms", tms5220n_device, read) AM_WRITENOP
551551   AM_RANGE(0x3e03, 0x3e03) AM_MIRROR(0x00f6) AM_NOP
552552ADDRESS_MAP_END
553553
r17650r17651
606606 *
607607 *************************************/
608608
609static const tms5220_interface tms5220_config =
609static const tms52xx_config tms5220interface =
610610{
611611   DEVCB_DRIVER_LINE_MEMBER(looping_state,looping_spcint),      // IRQ
612612   DEVCB_NULL                  // READYQ
r17650r17651
673673   MCFG_SOUND_CONFIG(ay8910_config)
674674   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
675675
676   MCFG_SOUND_ADD("tms", TMS5220, TMS_CLOCK)
677   MCFG_SOUND_CONFIG(tms5220_config)
676   MCFG_SOUND_ADD("tms", TMS5220N, TMS_CLOCK)
677   MCFG_SOUND_CONFIG(tms5220interface)
678678   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
679679
680680   MCFG_DAC_ADD("dac")
trunk/src/mess/machine/bbc.c
r17650r17651
918918   if (state->m_b0_sound == 0)
919919   {
920920      //logerror("Doing an unsafe write to the sound chip %d \n",data);
921      sn76496_w(device->machine().device("sn76489"), 0,state->m_via_system_porta);
921      state->m_sn->write(*device->machine().device<legacy_cpu_device>("maincpu")->space(), 0,state->m_via_system_porta);
922922   }
923923   if (state->m_b3_keyboard == 0)
924924   {
r17650r17651
10301030         if (state->m_b0_sound == 1)
10311031         {
10321032            state->m_b0_sound = 0;
1033            sn76496_w(space->machine().device("sn76489"), 0, state->m_via_system_porta);
1033            state->m_sn->write(*device->machine().device<legacy_cpu_device>("maincpu")->space(), 0, state->m_via_system_porta);
10341034         }
10351035         break;
10361036      case 1:
trunk/src/mess/machine/a2alfam2.c
r17650r17651
2424#define SN2_TAG         "sn76489_2" // center
2525#define SN3_TAG         "sn76489_3" // right
2626
27//-------------------------------------------------
28//  sn76496_config psg_intf
29//-------------------------------------------------
30
31static const sn76496_config psg_intf =
32{
33    DEVCB_NULL
34};
35
2736MACHINE_CONFIG_FRAGMENT( a2alfam2 )
2837    MCFG_SPEAKER_STANDARD_STEREO("alf_l", "alf_r")
29    MCFG_SOUND_ADD(SN1_TAG, SN76489, XTAL_3_579545MHz)
38    MCFG_SOUND_ADD(SN1_TAG, SN76489_NEW, XTAL_3_579545MHz)
39   MCFG_SOUND_CONFIG(psg_intf)
3040    MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_l", 0.50)
31    MCFG_SOUND_ADD(SN2_TAG, SN76489, XTAL_3_579545MHz)
41    MCFG_SOUND_ADD(SN2_TAG, SN76489_NEW, XTAL_3_579545MHz)
42   MCFG_SOUND_CONFIG(psg_intf)
3243    MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_l", 0.50)
3344    MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_r", 0.50)
34    MCFG_SOUND_ADD(SN3_TAG, SN76489, XTAL_3_579545MHz)
45    MCFG_SOUND_ADD(SN3_TAG, SN76489_NEW, XTAL_3_579545MHz)
46   MCFG_SOUND_CONFIG(psg_intf)
3547    MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_r", 0.50)
3648MACHINE_CONFIG_END
3749
r17650r17651
92104    switch (offset)
93105    {
94106        case 0:
95            sn76496_w(m_sn1, 0, data);
107            m_sn1->write(space, 0, data);
96108            break;
97109
98110        case 1:
99            sn76496_w(m_sn2, 0, data);
111            m_sn2->write(space, 0, data);
100112            break;
101113
102114        case 2:
103            sn76496_w(m_sn3, 0, data);
115            m_sn3->write(space, 0, data);
104116            break;
105117    }
106118}
trunk/src/mess/machine/a2alfam2.h
r17650r17651
1111
1212#include "emu.h"
1313#include "machine/a2bus.h"
14#include "sound/sn76496.h"
1415
1516//**************************************************************************
1617//  TYPE DEFINITIONS
r17650r17651
2829    // optional information overrides
2930    virtual machine_config_constructor device_mconfig_additions() const;
3031
31    required_device<device_t> m_sn1;
32    required_device<device_t> m_sn2;
33    required_device<device_t> m_sn3;
32    required_device<sn76489_new_device> m_sn1;
33    required_device<sn76489_new_device> m_sn2;
34    required_device<sn76489_new_device> m_sn3;
3435
3536protected:
3637    virtual void device_start();
trunk/src/mess/includes/bbc.h
r17650r17651
1717#include "machine/wd17xx.h"
1818#include "machine/upd7002.h"
1919#include "video/mc6845.h"
20#include "sound/sn76496.h"
2021
2122class bbc_state : public driver_device
2223{
r17650r17651
2425   bbc_state(const machine_config &mconfig, device_type type, const char *tag)
2526      : driver_device(mconfig, type, tag),
2627        m_maincpu(*this, "maincpu"),
28        m_sn(*this, "sn76489"),
2729        m_ACCCON_IRR(CLEAR_LINE),
2830        m_via_system_irq(CLEAR_LINE),
2931        m_via_user_irq(CLEAR_LINE),
r17650r17651
3133   { }
3234
3335   required_device<cpu_device> m_maincpu;
36   optional_device<sn76489_new_device> m_sn;
3437
3538   void check_interrupts();
3639
trunk/src/mess/drivers/mycom.c
r17650r17651
8787   required_device<device_t> m_wave;
8888   required_device<mc6845_device> m_crtc;
8989   required_device<device_t> m_fdc;
90   required_device<device_t> m_audio;
90   required_device<sn76489_new_device> m_audio;
9191   required_device<msm5832_device> m_rtc;
9292   DECLARE_READ8_MEMBER( mycom_upper_r );
9393   DECLARE_WRITE8_MEMBER( mycom_upper_w );
r17650r17651
418418
419419   // if WE & CE are low, pass sound command to audio chip
420420   if ((data & 0x30)==0)
421      sn76496_w(m_audio, 0, m_sn_we);
421      m_audio->write(space, 0, m_sn_we);
422422}
423423
424424static WRITE8_DEVICE_HANDLER( mycom_rtc_w )
r17650r17651
549549};
550550
551551
552/*************************************
553 *
554 *  Sound interface
555 *
556 *************************************/
557 
558 
559//-------------------------------------------------
560//  sn76496_config psg_intf
561//-------------------------------------------------
562
563static const sn76496_config psg_intf =
564{
565    DEVCB_NULL
566};
567
568
552569MACHINE_START_MEMBER(mycom_state)
553570{
554571   m_p_ram = memregion("maincpu")->base();
r17650r17651
595612   MCFG_SPEAKER_STANDARD_MONO("mono")
596613   MCFG_SOUND_WAVE_ADD(WAVE_TAG, CASSETTE_TAG)
597614   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
598   MCFG_SOUND_ADD("sn1", SN76489, XTAL_10MHz / 4)
615   MCFG_SOUND_ADD("sn1", SN76489_NEW, XTAL_10MHz / 4)
599616   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.50)
617   MCFG_SOUND_CONFIG(psg_intf)
600618
601619   /* Devices */
602620   MCFG_MSM5832_ADD(MSM5832RS_TAG, XTAL_32_768kHz)
trunk/src/mess/drivers/smc777.c
r17650r17651
3232{
3333public:
3434   smc777_state(const machine_config &mconfig, device_type type, const char *tag)
35      : driver_device(mconfig, type, tag) { }
36
35      : driver_device(mconfig, type, tag),
36   m_sn(*this, "sn1")
37   { }
38     
39   optional_device<sn76489a_new_device> m_sn;
3740   UINT16 m_cursor_addr;
3841   UINT16 m_cursor_raster;
3942   UINT8 m_keyb_press;
r17650r17651
686689   else if(low_offs >= 0x48 && low_offs <= 0x4f) { logerror("HDD (Winchester) write %02x %02x\n",low_offs & 1,data); } //might be 0x48 - 0x50
687690   else if(low_offs == 0x51)                 { smc777_color_mode_w(space,0,data); }
688691   else if(low_offs == 0x52)                 { smc777_ramdac_w(space,offset & 0xff00,data); }
689   else if(low_offs == 0x53)                 { sn76496_w(machine().device("sn1"),0,data); }
692   else if(low_offs == 0x53)                 { m_sn->write(space,0,data); }
690693   else if(low_offs >= 0x54 && low_offs <= 0x59) { logerror("VTR Controller write [%02x] %02x\n",low_offs & 7,data); }
691694   else if(low_offs == 0x5a || low_offs == 0x5b) { logerror("RAM Banking write [%02x] %02x\n",low_offs & 1,data); }
692695   else if(low_offs == 0x70)                 { logerror("Auto-start ROM write %02x\n",data); }
r17650r17651
10491052      device_set_input_line(device,0,HOLD_LINE);
10501053}
10511054
1055
1056/*************************************
1057 *
1058 *  Sound interface
1059 *
1060 *************************************/
1061 
1062 
1063//-------------------------------------------------
1064//  sn76496_config psg_intf
1065//-------------------------------------------------
1066
1067static const sn76496_config psg_intf =
1068{
1069    DEVCB_NULL
1070};
1071
1072
10521073#define MASTER_CLOCK XTAL_4_028MHz
10531074
10541075static MACHINE_CONFIG_START( smc777, smc777_state )
r17650r17651
10831104
10841105   MCFG_SPEAKER_STANDARD_MONO("mono")
10851106
1086   MCFG_SOUND_ADD("sn1", SN76489A, MASTER_CLOCK) // unknown clock / divider
1107   MCFG_SOUND_ADD("sn1", SN76489A_NEW, MASTER_CLOCK) // unknown clock / divider
10871108   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
1109   MCFG_SOUND_CONFIG(psg_intf)
10881110
10891111   MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0)
10901112   MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50)
trunk/src/mess/drivers/pasopia7.c
r17650r17651
4949   required_device<z80pio_device> m_pio;
5050   required_device<mc6845_device> m_crtc;
5151   required_device<device_t> m_fdc;
52   required_device<device_t> m_sn1;
53   required_device<device_t> m_sn2;
52   required_device<sn76489a_new_device> m_sn1;
53   required_device<sn76489a_new_device> m_sn2;
5454   DECLARE_READ8_MEMBER(vram_r);
5555   DECLARE_WRITE8_MEMBER(vram_w);
5656   DECLARE_WRITE8_MEMBER(pasopia7_memory_ctrl_w);
r17650r17651
736736      m_pio->write_alt(space, io_port & 3, data);
737737   else
738738   if(io_port == 0x3a)
739      sn76496_w(m_sn1, 0, data);
739      m_sn1->write(space, 0, data);
740740   else
741741   if(io_port == 0x3b)
742      sn76496_w(m_sn2, 0, data);
742      m_sn2->write(space, 0, data);
743743   else
744744   if(io_port == 0x3c)
745745      pasopia7_memory_ctrl_w(space,0, data);
r17650r17651
10431043   NULL
10441044};
10451045
1046
1047/*************************************
1048 *
1049 *  Sound interface
1050 *
1051 *************************************/
1052 
1053 
1054//-------------------------------------------------
1055//  sn76496_config psg_intf
1056//-------------------------------------------------
1057
1058static const sn76496_config psg_intf =
1059{
1060    DEVCB_NULL
1061};
1062
1063
10461064static MACHINE_CONFIG_START( p7_base, pasopia7_state )
10471065   /* basic machine hardware */
10481066   MCFG_CPU_ADD("maincpu",Z80, XTAL_4MHz)
r17650r17651
10541072
10551073   /* Audio */
10561074   MCFG_SPEAKER_STANDARD_MONO("mono")
1057   MCFG_SOUND_ADD("sn1", SN76489A, 1996800) // unknown clock / divider
1075   MCFG_SOUND_ADD("sn1", SN76489A_NEW, 1996800) // unknown clock / divider
10581076   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
1059   MCFG_SOUND_ADD("sn2", SN76489A, 1996800) // unknown clock / divider
1077   MCFG_SOUND_CONFIG(psg_intf)
1078   MCFG_SOUND_ADD("sn2", SN76489A_NEW, 1996800) // unknown clock / divider
10601079   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
1080   MCFG_SOUND_CONFIG(psg_intf)
10611081
10621082   /* Devices */
10631083   MCFG_Z80CTC_ADD( "z80ctc", XTAL_4MHz, z80ctc_intf )
trunk/src/mess/drivers/bbc.c
r17650r17651
787787   DEVCB_NULL
788788};
789789
790//-------------------------------------------------
791//  sn76496_config psg_intf
792//-------------------------------------------------
793
794static const sn76496_config psg_intf =
795{
796    DEVCB_NULL
797};
798
790799static WRITE_LINE_DEVICE_HANDLER( econet_clk_w )
791800{
792801   mc6854_rxc_w(device, state);
r17650r17651
853862
854863   /* sound hardware */
855864   MCFG_SPEAKER_STANDARD_MONO("mono")
856   MCFG_SOUND_ADD("sn76489", SN76489, 4000000)   /* 4 MHz */
865   MCFG_SOUND_ADD("sn76489", SN76489_NEW, 4000000)   /* 4 MHz */
866   MCFG_SOUND_CONFIG(psg_intf)
857867   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
858868//  MCFG_SOUND_ADD("tms5220", TMS5220, tms5220_interface)
859869
r17650r17651
946956
947957   /* sound hardware */
948958   MCFG_SPEAKER_STANDARD_MONO("mono")
949   MCFG_SOUND_ADD("sn76489", SN76489, 4000000)   /* 4 MHz */
959   MCFG_SOUND_ADD("sn76489", SN76489_NEW, 4000000)   /* 4 MHz */
960   MCFG_SOUND_CONFIG(psg_intf)
950961   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
951962
952963   MCFG_MC146818_ADD( "rtc", MC146818_STANDARD )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team