Previous 15994 Revisions Next

r15269 Tuesday 22nd May, 2012 at 02:51:54 UTC by R. Belmont
Apple II: Add ALF Apple Music II card (3x SN76489s) [R. Belmont]
[src/mess]mess.mak
[src/mess/drivers]apple2.c apple2gs.c
[src/mess/machine]a2alfam2.c* a2alfam2.h*

src/mess/machine/a2alfam2.c
r0r15269
1/*********************************************************************
2
3    a2alfsm2.c
4
5    Implementation of the ALF Apple Music II card
6
7*********************************************************************/
8
9#include "a2alfam2.h"
10#include "includes/apple2.h"
11#include "sound/sn76496.h"
12
13/***************************************************************************
14    PARAMETERS
15***************************************************************************/
16
17//**************************************************************************
18//  GLOBAL VARIABLES
19//**************************************************************************
20
21const device_type A2BUS_ALFAM2 = &device_creator<a2bus_alfam2_device>;
22
23#define SN1_TAG         "sn76489_1" // left
24#define SN2_TAG         "sn76489_2" // center
25#define SN3_TAG         "sn76489_3" // right
26
27MACHINE_CONFIG_FRAGMENT( a2alfam2 )
28    MCFG_SPEAKER_STANDARD_STEREO("alf_l", "alf_r")
29    MCFG_SOUND_ADD(SN1_TAG, SN76489, XTAL_3_579545MHz)
30    MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_l", 0.50)
31    MCFG_SOUND_ADD(SN2_TAG, SN76489, XTAL_3_579545MHz)
32    MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_l", 0.50)
33    MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_r", 0.50)
34    MCFG_SOUND_ADD(SN3_TAG, SN76489, XTAL_3_579545MHz)
35    MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_r", 0.50)
36MACHINE_CONFIG_END
37
38/***************************************************************************
39    FUNCTION PROTOTYPES
40***************************************************************************/
41
42//-------------------------------------------------
43//  machine_config_additions - device-specific
44//  machine configurations
45//-------------------------------------------------
46
47machine_config_constructor a2bus_alfam2_device::device_mconfig_additions() const
48{
49   return MACHINE_CONFIG_NAME( a2alfam2 );
50}
51
52//**************************************************************************
53//  LIVE DEVICE
54//**************************************************************************
55
56a2bus_alfam2_device::a2bus_alfam2_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
57    device_t(mconfig, type, name, tag, owner, clock),
58    device_a2bus_card_interface(mconfig, *this),
59    m_sn1(*this, SN1_TAG),
60    m_sn2(*this, SN2_TAG),
61    m_sn3(*this, SN3_TAG)
62{
63   m_shortname = "a2alfam2";
64}
65
66a2bus_alfam2_device::a2bus_alfam2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
67    device_t(mconfig, A2BUS_ALFAM2, "ALF Apple Music II", tag, owner, clock),
68    device_a2bus_card_interface(mconfig, *this),
69    m_sn1(*this, SN1_TAG),
70    m_sn2(*this, SN2_TAG),
71    m_sn3(*this, SN3_TAG)
72{
73   m_shortname = "a2alfam2";
74}
75
76//-------------------------------------------------
77//  device_start - device-specific startup
78//-------------------------------------------------
79
80void a2bus_alfam2_device::device_start()
81{
82   // set_a2bus_device makes m_slot valid
83   set_a2bus_device();
84}
85
86void a2bus_alfam2_device::device_reset()
87{
88}
89
90void a2bus_alfam2_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
91{
92    switch (offset)
93    {
94        case 0:
95            sn76496_w(m_sn1, 0, data);
96            break;
97
98        case 1:
99            sn76496_w(m_sn2, 0, data);
100            break;
101
102        case 2:
103            sn76496_w(m_sn3, 0, data);
104            break;
105    }
106}
107
108bool a2bus_alfam2_device::take_c800()
109{
110    return false;
111}
112
src/mess/machine/a2alfam2.h
r0r15269
1/*********************************************************************
2
3    a2alfam2.h
4
5    Implementation of the ALF Apple Music II card
6
7*********************************************************************/
8
9#ifndef __A2BUS_ALFAM2__
10#define __A2BUS_ALFAM2__
11
12#include "emu.h"
13#include "machine/a2bus.h"
14
15//**************************************************************************
16//  TYPE DEFINITIONS
17//**************************************************************************
18
19class a2bus_alfam2_device:
20    public device_t,
21    public device_a2bus_card_interface
22{
23public:
24    // construction/destruction
25    a2bus_alfam2_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
26    a2bus_alfam2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
27
28    // optional information overrides
29    virtual machine_config_constructor device_mconfig_additions() const;
30
31    required_device<device_t> m_sn1;
32    required_device<device_t> m_sn2;
33    required_device<device_t> m_sn3;
34
35protected:
36    virtual void device_start();
37    virtual void device_reset();
38
39    // overrides of standard a2bus slot functions
40    virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
41    virtual bool take_c800();
42};
43
44// device type definition
45extern const device_type A2BUS_ALFAM2;
46
47#endif /* __A2BUS_ALFAM2__ */
48
src/mess/drivers/apple2gs.c
r15268r15269
6565#include "machine/a2memexp.h"
6666#include "machine/a2scsi.h"
6767#include "machine/a2softcard.h"
68#include "machine/a2sam.h"
69#include "machine/a2alfam2.h"
6870
6971static const gfx_layout apple2gs_text_layout =
7072{
r15268r15269
223225    SLOT_INTERFACE("cffa202", A2BUS_CFFA2_6502)  /* CFFA2000 Compact Flash for Apple II (www.dreher.net), 6502 firmware */
224226    SLOT_INTERFACE("memexp", A2BUS_MEMEXP)  /* Apple II Memory Expansion Card */
225227    SLOT_INTERFACE("ramfactor", A2BUS_RAMFACTOR)    /* Applied Engineering RamFactor */
228    SLOT_INTERFACE("sam", A2BUS_SAM)    /* SAM Software Automated Mouth (8-bit DAC + speaker) */
229    SLOT_INTERFACE("alfam2", A2BUS_ALFAM2)    /* ALF Apple Music II */
226230//    SLOT_INTERFACE("softcard", A2BUS_SOFTCARD)  /* Microsoft SoftCard */  // appears not to be IIgs compatible?
227231//    SLOT_INTERFACE("scsi", A2BUS_SCSI)  /* Apple II SCSI Card */
228232SLOT_INTERFACE_END
src/mess/drivers/apple2.c
r15268r15269
206206#include "machine/a2swyft.h"
207207#include "machine/a2themill.h"
208208#include "machine/a2sam.h"
209#include "machine/a2alfam2.h"
209210
210211/***************************************************************************
211212    PARAMETERS
r15268r15269
623624    SLOT_INTERFACE("swyft", A2BUS_SWYFT)    /* IAI SwyftCard */
624625    SLOT_INTERFACE("themill", A2BUS_THEMILL)    /* Stellation Two The Mill (6809 card) */
625626    SLOT_INTERFACE("sam", A2BUS_SAM)    /* SAM Software Automated Mouth (8-bit DAC + speaker) */
627    SLOT_INTERFACE("alfam2", A2BUS_ALFAM2)    /* ALF Apple Music II */
626628//    SLOT_INTERFACE("scsi", A2BUS_SCSI)  /* Apple II SCSI Card */
627629SLOT_INTERFACE_END
628630
src/mess/mess.mak
r15268r15269
662662    $(MESS_MACHINE)/a2eauxslot.o \
663663    $(MESS_MACHINE)/a2themill.o \
664664    $(MESS_MACHINE)/a2sam.o \
665    $(MESS_MACHINE)/a2alfam2.o \
665666   $(MESS_MACHINE)/lisa.o      \
666667   $(MESS_DRIVERS)/lisa.o      \
667668   $(MESS_MACHINE)/nubus.o     \

Previous 15994 Revisions Next


© 1998-2018 The MESS Team