Previous 199869 Revisions Next

r17399 Wednesday 22nd August, 2012 at 15:29:26 UTC by Curt Coder
(MESS) c1551: Added passthru expansion port. (nw)
[src/mess/machine]c1551.c c1551.h

trunk/src/mess/machine/c1551.c
r17398r17399
1111
1212    TODO:
1313
14   - paddle expansion port passthru
1514    - byte latching does not match hardware behavior
1615      (CPU skips data bytes if implemented per schematics)
1716
1817*/
1918
20#include "c1541.h"
2119#include "c1551.h"
2220
2321
r17398r17399
3230#define C64H156_TAG      "u6"
3331#define PLA_TAG         "u1"
3432
33
3534enum
3635{
3736   LED_POWER = 0,
r17398r17399
368367
369368
370369//-------------------------------------------------
370//  PLUS4_EXPANSION_INTERFACE( expansion_intf )
371//-------------------------------------------------
372
373READ8_MEMBER( c1551_device::exp_dma_r )
374{
375   return m_slot->dma_cd_r(offset);
376}
377
378WRITE8_MEMBER( c1551_device::exp_dma_w )
379{
380   m_slot->dma_cd_w(offset, data);
381}
382
383WRITE_LINE_MEMBER( c1551_device::exp_irq_w )
384{
385   m_slot->irq_w(state);
386}
387
388WRITE_LINE_MEMBER( c1551_device::exp_aec_w )
389{
390   m_slot->aec_w(state);
391}
392
393static PLUS4_EXPANSION_INTERFACE( expansion_intf )
394{
395   DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c1551_device, exp_dma_r),
396   DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c1551_device, exp_dma_w),
397   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c1551_device, exp_irq_w),
398   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c1551_device, exp_aec_w)
399};
400
401
402//-------------------------------------------------
371403//  MACHINE_DRIVER( c1551 )
372404//-------------------------------------------------
373405
r17398r17399
383415
384416   MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, c1541_floppy_interface)
385417   MCFG_64H156_ADD(C64H156_TAG, XTAL_16MHz, ga_intf)
418
419   MCFG_PLUS4_EXPANSION_SLOT_ADD(PLUS4_EXPANSION_SLOT_TAG, 0, expansion_intf, plus4_expansion_cards, NULL, NULL)
386420MACHINE_CONFIG_END
387421
388422
r17398r17399
437471     m_ga(*this, C64H156_TAG),
438472     m_pla(*this, PLA_TAG),
439473     m_image(*this, FLOPPY_0),
474     m_exp(*this, PLUS4_EXPANSION_SLOT_TAG),
440475     m_tcbm_data(0xff),
441476     m_status(1),
442477     m_dav(1),
r17398r17399
465500   save_item(NAME(m_status));
466501   save_item(NAME(m_dav));
467502   save_item(NAME(m_ack));
503   save_item(NAME(m_dev));
468504}
469505
470506
r17398r17399
537573
538574UINT8 c1551_device::plus4_cd_r(address_space &space, offs_t offset, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h)
539575{
540   UINT8 data = 0;
576   UINT8 data = m_exp->cd_r(space, offset, ba, cs0, c1l, c2l, cs1, c1h, c2h);
541577
542578   if (tpi1_selected(offset))
543579   {
r17398r17399
558594   {
559595      tpi6525_w(m_tpi1, offset & 0x07, data);
560596   }
597
598   m_exp->cd_w(space, offset, data, ba, cs0, c1l, c2l, cs1, c1h, c2h);
561599}
562600
563601
564602//-------------------------------------------------
603//  plus4_screen_update - screen update
604//-------------------------------------------------
605
606UINT32 c1551_device::plus4_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
607{
608   return m_exp->screen_update(screen, bitmap, cliprect);
609}
610
611
612//-------------------------------------------------
565613//  plus4_breset_w - buffered reset write
566614//-------------------------------------------------
567615
r17398r17399
571619   {
572620      device_reset();
573621   }
622
623   m_exp->breset_w(state);
574624}
575625
576626
trunk/src/mess/machine/c1551.h
r17398r17399
2020#include "formats/g64_dsk.h"
2121#include "machine/64h156.h"
2222#include "machine/6525tpi.h"
23#include "machine/c1541.h"
24#include "machine/cbmipt.h"
2325#include "machine/pls100.h"
2426#include "machine/plus4exp.h"
2527
r17398r17399
4850
4951   DECLARE_READ8_MEMBER( port_r );
5052   DECLARE_WRITE8_MEMBER( port_w );
53
5154   DECLARE_READ8_MEMBER( tcbm_data_r );
5255   DECLARE_WRITE8_MEMBER( tcbm_data_w );
5356   DECLARE_READ8_MEMBER( yb_r );
5457   DECLARE_WRITE8_MEMBER( yb_w );
5558   DECLARE_READ8_MEMBER( tpi0_pc_r );
5659   DECLARE_WRITE8_MEMBER( tpi0_pc_w );
60
5761   DECLARE_READ8_MEMBER( tpi1_pa_r );
5862   DECLARE_WRITE8_MEMBER( tpi1_pa_w );
5963   DECLARE_READ8_MEMBER( tpi1_pb_r );
6064   DECLARE_READ8_MEMBER( tpi1_pc_r );
6165   DECLARE_WRITE8_MEMBER( tpi1_pc_w );
6266
67   DECLARE_READ8_MEMBER( exp_dma_r );
68   DECLARE_WRITE8_MEMBER( exp_dma_w );
69   DECLARE_WRITE_LINE_MEMBER( exp_irq_w );
70   DECLARE_WRITE_LINE_MEMBER( exp_aec_w );
71
6372protected:
6473    // device-level overrides
6574    virtual void device_config_complete() { m_shortname = "c1551"; }
r17398r17399
7079    // device_plus4_expansion_card_interface overrides
7180   virtual UINT8 plus4_cd_r(address_space &space, offs_t offset, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h);
7281   virtual void 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);
82   virtual UINT32 plus4_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7383   virtual void plus4_breset_w(int state);
7484
7585private:
r17398r17399
8191   required_device<c64h156_device> m_ga;
8292   required_device<pls100_device> m_pla;
8393   required_device<legacy_floppy_image_device> m_image;
94   required_device<plus4_expansion_slot_device> m_exp;
8495
8596   // TCBM bus
8697   UINT8 m_tcbm_data;                  // data

Previous 199869 Revisions Next


© 1997-2024 The MAME Team