Previous 199869 Revisions Next

r18075 Saturday 22nd September, 2012 at 20:55:35 UTC by Curt Coder
(MESS) cbm2: Address decoding WIP. (nw)
[src/mess/drivers]cbm2.c
[src/mess/includes]cbm2.h

trunk/src/mess/includes/cbm2.h
r18074r18075
9090   DECLARE_MACHINE_START( cbm2_pal );
9191   DECLARE_MACHINE_RESET( cbm2 );
9292
93   virtual void read_pla(offs_t offset, int busy2, int eras, int ecas, int refen, int cas, int ras, int *casseg1, int *casseg2, int *casseg3, int *casseg4);
94
9395   void bankswitch(offs_t offset, int busy2, int eras, int ecas, int refen, int cas, int ras, int *sysioen, int *dramen,
9496      int *casseg1, int *casseg2, int *casseg3, int *casseg4, int *buframcs, int *extbufcs, int *vidramcs,
9597      int *diskromcs, int *csbank1, int *csbank2, int *csbank3, int *basiccs, int *knbcs, int *kernalcs,
r18074r18075
113115
114116   DECLARE_WRITE8_MEMBER( tpi2_pa_w );
115117   DECLARE_WRITE8_MEMBER( tpi2_pb_w );
118   DECLARE_READ8_MEMBER( tpi2_pc_r );
116119
117120   DECLARE_READ8_MEMBER( cia_pa_r );
118121   DECLARE_WRITE8_MEMBER( cia_pa_w );
r18074r18075
151154};
152155
153156
157class cbm2hp_state : public cbm2_state
158{
159public:
160   cbm2hp_state(const machine_config &mconfig, device_type type, const char *tag)
161      : cbm2_state(mconfig, type, tag)
162   { }
163
164   virtual void read_pla(offs_t offset, int busy2, int eras, int ecas, int refen, int cas, int ras, int *casseg1, int *casseg2, int *casseg3, int *casseg4);
165
166   DECLARE_READ8_MEMBER( tpi2_pc_r );
167};
168
169
154170class p500_state : public cbm2_state
155171{
156172public:
r18074r18075
203219};
204220
205221
206class cbm2lp_state : public cbm2_state
207{
208public:
209   cbm2lp_state(const machine_config &mconfig, device_type type, const char *tag)
210      : cbm2_state(mconfig, type, tag)
211   { }
212222
213   DECLARE_READ8_MEMBER( tpi2_pc_r );
214};
215
216
217class cbm2hp_state : public cbm2_state
218{
219public:
220   cbm2hp_state(const machine_config &mconfig, device_type type, const char *tag)
221      : cbm2_state(mconfig, type, tag)
222   { }
223
224   DECLARE_READ8_MEMBER( tpi2_pc_r );
225};
226
227
228
229223#endif
trunk/src/mess/drivers/cbm2.c
r18074r18075
3939//**************************************************************************
4040
4141//-------------------------------------------------
42//  bankswitch -
42//  read_pla -
4343//-------------------------------------------------
4444
45void cbm2_state::bankswitch(offs_t offset, int busy2, int eras, int ecas, int refen, int cas, int ras, int *sysioen, int *dramen,
46   int *casseg1, int *casseg2, int *casseg3, int *casseg4, int *buframcs, int *extbufcs, int *vidramcs,
47   int *diskromcs, int *csbank1, int *csbank2, int *csbank3, int *basiccs, int *knbcs, int *kernalcs,
48   int *crtccs, int *cs1, int *sidcs, int *extprtcs, int *ciacs, int *aciacs, int *tript1cs, int *tript2cs)
45void cbm2_state::read_pla(offs_t offset, int busy2, int eras, int ecas, int refen, int cas, int ras, int *casseg1, int *casseg2, int *casseg3, int *casseg4)
4946{
5047   UINT32 input = P0 << 15 | P1 << 14 | P2 << 13 | P3 << 12 | busy2 << 11 | eras << 10 | ecas << 9 | refen << 8 | cas << 7 | ras << 6;
5148   UINT32 data = m_pla1->read(input);
r18074r18075
5855   *casseg4 = BIT(data, 5);
5956   *casseg3 = BIT(data, 6);
6057   //*rasseg3 = BIT(data, 7);
58}
6159
60void cbm2hp_state::read_pla(offs_t offset, int busy2, int eras, int ecas, int refen, int cas, int ras, int *casseg1, int *casseg2, int *casseg3, int *casseg4)
61{
62   UINT32 input = ras << 13 | cas << 12 | refen << 11 | eras << 10 | ecas << 9 | busy2 << 8 | P3 << 3 | P2 << 2 | P1 << 1 | P0;
63   UINT32 data = m_pla1->read(input);
64
65   *casseg1 = BIT(data, 0);
66   *casseg2 = BIT(data, 1);
67   *casseg3 = BIT(data, 2);
68   *casseg4 = BIT(data, 3);
69   //*rasseg1 = BIT(data, 4);
70   //*rasseg2 = BIT(data, 5);
71   //*rasseg3 = BIT(data, 6);
72   //*rasseg4 = BIT(data, 7);
73}
74
75
76//-------------------------------------------------
77//  bankswitch -
78//-------------------------------------------------
79
80void cbm2_state::bankswitch(offs_t offset, int busy2, int eras, int ecas, int refen, int cas, int ras, int *sysioen, int *dramen,
81   int *casseg1, int *casseg2, int *casseg3, int *casseg4, int *buframcs, int *extbufcs, int *vidramcs,
82   int *diskromcs, int *csbank1, int *csbank2, int *csbank3, int *basiccs, int *knbcs, int *kernalcs,
83   int *crtccs, int *cs1, int *sidcs, int *extprtcs, int *ciacs, int *aciacs, int *tript1cs, int *tript2cs)
84{
85   //this->read_pla(offset, busy2, eras, ecas, refen, cas, ras, casseg1, casseg2, casseg3, casseg4);
86
87   switch (offset >> 16)
88   {
89   case 1: *casseg1 = 0; break;
90   case 2: *casseg2 = 0; break;
91   case 3: *casseg3 = 0; break;
92   case 4: *casseg4 = 0; break;
93   }
94
6295   int busen1 = m_dramon;
6396   int decoden = 0; // TODO
6497   *sysioen = !(P0 && P1 && P2 && P3) && busen1;
r18074r18075
415448*/
416449   UINT8 data = 0xff;
417450
418   if (ae)
419   {
420      data = m_vic->bus_r();
421   }
422
423451   if (aec && !datxen && !_64kcasen)
424452   {
425453      data = m_ram->pointer()[offset & 0xffff];
r18074r18075
12571285   m_tpi2_pb = data;
12581286}
12591287
1260READ8_MEMBER( cbm2lp_state::tpi2_pc_r )
1288READ8_MEMBER( cbm2_state::tpi2_pc_r )
12611289{
12621290   /*
12631291   
r18074r18075
13441372   DEVCB_DRIVER_MEMBER(cbm2_state, tpi2_pa_w),
13451373   DEVCB_NULL,
13461374   DEVCB_DRIVER_MEMBER(cbm2_state, tpi2_pb_w),
1347   DEVCB_DRIVER_MEMBER(cbm2lp_state, tpi2_pc_r),
1375   DEVCB_DRIVER_MEMBER(cbm2_state, tpi2_pc_r),
13481376   DEVCB_NULL,
13491377   DEVCB_NULL,
13501378   DEVCB_NULL
r18074r18075
17291757//  MACHINE_CONFIG( cbm2lp_ntsc )
17301758//-------------------------------------------------
17311759
1732static MACHINE_CONFIG_START( cbm2lp_ntsc, cbm2lp_state )
1760static MACHINE_CONFIG_START( cbm2lp_ntsc, cbm2_state )
17331761   MCFG_MACHINE_START_OVERRIDE(cbm2_state, cbm2_ntsc)
17341762   MCFG_MACHINE_RESET_OVERRIDE(cbm2_state, cbm2)
17351763
r18074r18075
17801808//  MACHINE_CONFIG( b128 )
17811809//-------------------------------------------------
17821810
1783static MACHINE_CONFIG_START( b128, cbm2lp_state )
1811static MACHINE_CONFIG_START( b128, cbm2_state )
17841812   MCFG_FRAGMENT_ADD(cbm2lp_ntsc)
17851813   MCFG_FRAGMENT_ADD(128k)
17861814MACHINE_CONFIG_END
r18074r18075
17901818//  MACHINE_CONFIG( b256 )
17911819//-------------------------------------------------
17921820
1793static MACHINE_CONFIG_START( b256, cbm2lp_state )
1821static MACHINE_CONFIG_START( b256, cbm2_state )
17941822   MCFG_FRAGMENT_ADD(cbm2lp_ntsc)
17951823   MCFG_FRAGMENT_ADD(256k)
17961824MACHINE_CONFIG_END
r18074r18075
18001828//  MACHINE_CONFIG( cbm2lp_pal )
18011829//-------------------------------------------------
18021830
1803static MACHINE_CONFIG_START( cbm2lp_pal, cbm2lp_state )
1831static MACHINE_CONFIG_START( cbm2lp_pal, cbm2_state )
18041832   MCFG_FRAGMENT_ADD(cbm2lp_ntsc)
18051833
18061834   MCFG_MACHINE_START_OVERRIDE(cbm2_state, cbm2_pal)
r18074r18075
18141842//  MACHINE_CONFIG( cbm610 )
18151843//-------------------------------------------------
18161844
1817static MACHINE_CONFIG_START( cbm610, cbm2lp_state )
1845static MACHINE_CONFIG_START( cbm610, cbm2_state )
18181846   MCFG_FRAGMENT_ADD(cbm2lp_pal)
18191847   MCFG_FRAGMENT_ADD(128k)
18201848MACHINE_CONFIG_END
r18074r18075
18241852//  MACHINE_CONFIG( cbm620 )
18251853//-------------------------------------------------
18261854
1827static MACHINE_CONFIG_START( cbm620, cbm2lp_state )
1855static MACHINE_CONFIG_START( cbm620, cbm2_state )
18281856   MCFG_FRAGMENT_ADD(cbm2lp_pal)
18291857   MCFG_FRAGMENT_ADD(256k)
18301858MACHINE_CONFIG_END

Previous 199869 Revisions Next


© 1997-2024 The MAME Team