Previous 199869 Revisions Next

r30928 Tuesday 10th June, 2014 at 17:21:09 UTC by Curt Coder
(MESS) ql: Added preliminary CST Q+4 emulation. [Curt Coder]
[src/emu/bus/ql]cst_q_plus4.c cst_q_plus4.h

trunk/src/emu/bus/ql/cst_q_plus4.h
r30927r30928
1515#define __CST_Q_PLUS4__
1616
1717#include "exp.h"
18#include "machine/6821pia.h"
1819
1920
2021
r30927r30928
3435
3536   // optional information overrides
3637   virtual const rom_entry *device_rom_region() const;
38   virtual machine_config_constructor device_mconfig_additions() const;
3739
40   DECLARE_WRITE_LINE_MEMBER( exp1_extintl_w ) { m_exp1_extinl = state; update_extintl(); }
41   DECLARE_WRITE_LINE_MEMBER( exp2_extintl_w ) { m_exp2_extinl = state; update_extintl(); }
42   DECLARE_WRITE_LINE_MEMBER( exp3_extintl_w ) { m_exp3_extinl = state; update_extintl(); }
43   DECLARE_WRITE_LINE_MEMBER( exp4_extintl_w ) { m_exp4_extinl = state; update_extintl(); }
44
3845protected:
3946   // device-level overrides
4047   virtual void device_start();
r30927r30928
4451   virtual void write(address_space &space, offs_t offset, UINT8 data);
4552
4653private:
54   void update_extintl() { m_slot->extintl_w(m_exp1_extinl || m_exp2_extinl || m_exp3_extinl || m_exp4_extinl); }
55
56   required_device<ql_expansion_slot_t> m_exp1;
57   required_device<ql_expansion_slot_t> m_exp2;
58   required_device<ql_expansion_slot_t> m_exp3;
59   required_device<ql_expansion_slot_t> m_exp4;
60   required_memory_region m_rom;
61
62   int m_exp1_extinl;
63   int m_exp2_extinl;
64   int m_exp3_extinl;
65   int m_exp4_extinl;
4766};
4867
4968
trunk/src/emu/bus/ql/cst_q_plus4.c
r30927r30928
1414
1515
1616//**************************************************************************
17//  MACROS/CONSTANTS
18//**************************************************************************
19
20#define MC6821_TAG "mc6821"
21
22
23
24//**************************************************************************
1725//  DEVICE DEFINITIONS
1826//**************************************************************************
1927
r30927r30928
4048}
4149
4250
51//-------------------------------------------------
52//  MACHINE_CONFIG_FRAGMENT( cst_q_plus4 )
53//-------------------------------------------------
4354
55static MACHINE_CONFIG_FRAGMENT( cst_q_plus4 )
56   MCFG_DEVICE_ADD(MC6821_TAG, PIA6821, 0)
57
58   MCFG_QL_EXPANSION_SLOT_ADD("exp1", ql_expansion_cards, NULL)
59   MCFG_QL_EXPANSION_SLOT_EXTINTL_CALLBACK(WRITELINE(cst_q_plus4_t, exp1_extintl_w))
60
61   MCFG_QL_EXPANSION_SLOT_ADD("exp2", ql_expansion_cards, NULL)
62   MCFG_QL_EXPANSION_SLOT_EXTINTL_CALLBACK(WRITELINE(cst_q_plus4_t, exp2_extintl_w))
63
64   MCFG_QL_EXPANSION_SLOT_ADD("exp3", ql_expansion_cards, NULL)
65   MCFG_QL_EXPANSION_SLOT_EXTINTL_CALLBACK(WRITELINE(cst_q_plus4_t, exp3_extintl_w))
66
67   MCFG_QL_EXPANSION_SLOT_ADD("exp4", ql_expansion_cards, NULL)
68   MCFG_QL_EXPANSION_SLOT_EXTINTL_CALLBACK(WRITELINE(cst_q_plus4_t, exp4_extintl_w))
69MACHINE_CONFIG_END
70
71
72//-------------------------------------------------
73//  machine_config_additions - device-specific
74//  machine configurations
75//-------------------------------------------------
76
77machine_config_constructor cst_q_plus4_t::device_mconfig_additions() const
78{
79   return MACHINE_CONFIG_NAME( cst_q_plus4 );
80}
81
82
83
4484//**************************************************************************
4585//  LIVE DEVICE
4686//**************************************************************************
r30927r30928
5191
5292cst_q_plus4_t::cst_q_plus4_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
5393   device_t(mconfig, CST_Q_PLUS4, "CST Q+4", tag, owner, clock, "ql_qplus4", __FILE__),
54   device_ql_expansion_card_interface(mconfig, *this)
94   device_ql_expansion_card_interface(mconfig, *this),
95   m_exp1(*this, "exp1"),
96   m_exp2(*this, "exp2"),
97   m_exp3(*this, "exp3"),
98   m_exp4(*this, "exp4"),
99   m_rom(*this, "rom"),
100   m_exp1_extinl(CLEAR_LINE),
101   m_exp2_extinl(CLEAR_LINE),
102   m_exp3_extinl(CLEAR_LINE),
103   m_exp4_extinl(CLEAR_LINE)
55104{
56105}
57106
r30927r30928
71120
72121UINT8 cst_q_plus4_t::read(address_space &space, offs_t offset, UINT8 data)
73122{
123   if (offset >= 0xc000 && offset < 0xc200)
124   {
125      data = m_rom->base()[offset & 0x1fff];
126   }
127
128   data = m_exp1->read(space, offset, data);
129   data = m_exp2->read(space, offset, data);
130   data = m_exp3->read(space, offset, data);
131   data = m_exp4->read(space, offset, data);
132
74133   return data;
75134}
76135
r30927r30928
81140
82141void cst_q_plus4_t::write(address_space &space, offs_t offset, UINT8 data)
83142{
143   m_exp1->write(space, offset, data);
144   m_exp2->write(space, offset, data);
145   m_exp3->write(space, offset, data);
146   m_exp4->write(space, offset, data);
84147}

Previous 199869 Revisions Next


© 1997-2024 The MAME Team