Previous 199869 Revisions Next

r17381 Tuesday 21st August, 2012 at 19:54:25 UTC by Curt Coder
(MESS) c1551: Preparing to use the PLA for address decoding. (nw)
[src/mess/machine]c1551.c c1551.h

trunk/src/mess/machine/c1551.c
r17380r17381
1111
1212    TODO:
1313
14   - paddle expansion port passthru
1415    - byte latching does not match hardware behavior
1516      (CPU skips data bytes if implemented per schematics)
1617
r17380r17381
101102   return data;
102103}
103104
104
105105WRITE8_MEMBER( c1551_device::port_w )
106106{
107107   /*
r17380r17381
132132   m_ga->ds_w((data >> 5) & 0x03);
133133}
134134
135
136135static const m6502_interface m6510t_intf =
137136{
138137   NULL,         // read_indexed_func
r17380r17381
166165   return m_tcbm_data;
167166}
168167
169
170168WRITE8_MEMBER( c1551_device::tcbm_data_w )
171169{
172170   /*
r17380r17381
187185   m_tcbm_data = data;
188186}
189187
190
191188READ8_MEMBER( c1551_device::tpi0_pc_r )
192189{
193190   /*
r17380r17381
219216   return data;
220217}
221218
222
223219WRITE8_MEMBER( c1551_device::tpi0_pc_w )
224220{
225221   /*
r17380r17381
250246   m_ga->oe_w(BIT(data, 4));
251247}
252248
253
254249static const tpi6525_interface tpi0_intf =
255250{
256251   DEVCB_NULL,
r17380r17381
289284   return m_status & 0x03;
290285}
291286
292
293287READ8_MEMBER( c1551_device::tpi1_pc_r )
294288{
295289   /*
r17380r17381
315309   return data;
316310}
317311
318
319312WRITE8_MEMBER( c1551_device::tpi1_pc_w )
320313{
321314   /*
r17380r17381
337330   m_dav = BIT(data, 6);
338331}
339332
340
341333static const tpi6525_interface tpi1_intf =
342334{
343335   DEVCB_NULL,
r17380r17381
443435     m_tpi0(*this, M6523_0_TAG),
444436     m_tpi1(*this, M6523_1_TAG),
445437     m_ga(*this, C64H156_TAG),
438     m_pla(*this, PLA_TAG),
446439     m_image(*this, FLOPPY_0),
447440     m_tcbm_data(0xff),
448441     m_status(1),
r17380r17381
515508
516509
517510//-------------------------------------------------
511//  tpi1_selected -
512//-------------------------------------------------
513
514bool c1551_device::tpi1_selected(offs_t offset)
515{
516#ifdef PLA_DUMPED
517   int mux = 0, ras = 0, phi0 = 0, f7 = 0;
518   UINT16 input = A5 << 15 | A6 << 14 | A7 << 13 | A8 << 12 | A9 << 11 | mux << 10 | A10 << 9 | m_dev << 8 | ras << 7 | phi0 << 6 | A15 << 5 | A14 << 4 | A13 << 3 | A12 << 2 | A11 << 1 | f7;
519   UINT8 data = m_pla->read(input);
520   return BIT(data, 0) ? true : false;
521#endif
522
523   offs_t start_address = m_dev ? 0xfee0 : 0xfec0;
524
525   if (offset >= start_address && offset < (start_address + 0x20))
526   {
527      return true;
528   }
529
530   return false;
531}
532
533
534//-------------------------------------------------
518535//  plus4_cd_r - cartridge data read
519536//-------------------------------------------------
520537
r17380r17381
522539{
523540   UINT8 data = 0;
524541
525   offs_t start_address = m_dev ? 0xfef0 : 0xfec0;
526
527   if (offset >= start_address && offset < (start_address + 8))
542   if (tpi1_selected(offset))
528543   {
529544      data = tpi6525_r(m_tpi1, offset & 0x07);
530545   }
r17380r17381
539554
540555void c1551_device::plus4_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h)
541556{
542   offs_t start_address = m_dev ? 0xfef0 : 0xfec0;
543
544   if (offset >= start_address && offset < (start_address + 8))
557   if (tpi1_selected(offset))
545558   {
546559      tpi6525_w(m_tpi1, offset & 0x07, data);
547560   }
trunk/src/mess/machine/c1551.h
r17380r17381
7373   virtual void plus4_breset_w(int state);
7474
7575private:
76   bool tpi1_selected(offs_t offset);
77
7678   required_device<cpu_device> m_maincpu;
7779   required_device<device_t> m_tpi0;
7880   required_device<device_t> m_tpi1;
7981   required_device<c64h156_device> m_ga;
82   required_device<pls100_device> m_pla;
8083   required_device<legacy_floppy_image_device> m_image;
8184
8285   // TCBM bus

Previous 199869 Revisions Next


© 1997-2024 The MAME Team