Previous 15994 Revisions Next

r13380 Saturday 26th November, 2011 at 15:21:50 UTC by Nathan Woods
[COCO] Multiple VHD support
[src/mess/drivers]coco12.c coco3.c
[src/mess/includes]coco.h
[src/mess/machine]coco.c

src/mess/machine/coco.c
r13379r13380
8989     m_ram(*this, RAM_TAG),
9090     m_cassette(*this, CASSETTE_TAG),
9191     m_bitbanger(*this, BITBANGER_TAG),
92     m_vhd(*this, VHD_TAG)
92     m_vhd_0(*this, VHD0_TAG),
93     m_vhd_1(*this, VHD1_TAG)
9394{
9495}
9596
r13379r13380
152153   save_item(NAME(m_dclg_output_v));
153154   save_item(NAME(m_dclg_state));
154155   save_item(NAME(m_dclg_timer));
156   save_item(NAME(m_vhd_select));
155157
156158   /* set up disassembly override */
157159   if (m_maincpu->debug())
r13379r13380
179181   m_dclg_output_v = 0;
180182   m_dclg_state = 0;
181183   m_dclg_timer = 0;
184   m_vhd_select = 0;
182185}
183186
184187
r13379r13380
10661069 ***************************************************************************/
10671070
10681071//-------------------------------------------------
1072//  current_vhd
1073//-------------------------------------------------
1074
1075coco_vhd_image_device *coco_state::current_vhd(void)
1076{
1077   switch(m_vhd_select)
1078   {
1079      case 0:      return m_vhd_0;
1080      case 1:      return m_vhd_1;
1081      default:   return NULL;
1082   }
1083}
1084
1085
1086
1087//-------------------------------------------------
10691088//  ff60_read
10701089//-------------------------------------------------
10711090
r13379r13380
10731092{
10741093   UINT8 result = 0x00;
10751094
1076   if ((m_vhd != NULL) && (offset >= 32) && (offset <= 37))
1095   if ((current_vhd() != NULL) && (offset >= 32) && (offset <= 37))
10771096   {
1078      result = m_vhd->read(offset - 32);
1097      result = current_vhd()->read(offset - 32);
10791098   }
10801099
10811100   return result;
r13379r13380
10891108
10901109WRITE8_MEMBER( coco_state::ff60_write )
10911110{
1092   if ((m_vhd != NULL) && (offset >= 32) && (offset <= 37))
1111   if ((current_vhd() != NULL) && (offset >= 32) && (offset <= 37))
10931112   {
1094      m_vhd->write(offset - 32, data);
1113      current_vhd()->write(offset - 32, data);
10951114   }
1115   else if (offset == 38)
1116   {
1117      /* writes to $FF86 will switch the VHD */
1118      m_vhd_select = data;
1119   }
10961120}
10971121
10981122
src/mess/includes/coco.h
r13379r13380
4848#define DAC_TAG                  "dac"
4949#define CARTRIDGE_TAG            "ext"
5050#define BITBANGER_TAG            "bitbanger"
51#define VHD_TAG                  "vhd"
51#define VHD0_TAG               "vhd0"
52#define VHD1_TAG               "vhd1"
5253
5354/* inputs */
5455#define CTRL_SEL_TAG            "ctrl_sel"
r13379r13380
9293   required_device<ram_device> m_ram;
9394   required_device<cassette_image_device> m_cassette;
9495   optional_device<bitbanger_device> m_bitbanger;
95   optional_device<coco_vhd_image_device> m_vhd;
96   optional_device<coco_vhd_image_device> m_vhd_0;
97   optional_device<coco_vhd_image_device> m_vhd_1;
9698
9799   static const pia6821_interface pia0_config;
98100   static const pia6821_interface pia1_config;
r13379r13380
218220   bool sel2(void)         { return m_pia_0->cb2_output() ? true : false; }
219221   bool snden(void)      { return m_pia_1->cb2_output() ? true : false; }
220222
223   /* VHD selection */
224   coco_vhd_image_device *current_vhd(void);
225
221226   /* disassembly override */
222227   static offs_t dasm_override(device_t &device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options);
223228
r13379r13380
243248   UINT8 m_dclg_output_v;
244249   UINT8 m_dclg_state;
245250   UINT16 m_dclg_timer;
251
252   /* VHD selection */
253   UINT8 m_vhd_select;
246254};
247255
248256#endif /* __COCO__ */
src/mess/drivers/coco12.c
r13379r13380
264264   MCFG_CASSETTE_ADD(CASSETTE_TAG, coco_state::coco_cassette_interface)
265265   MCFG_BITBANGER_ADD(BITBANGER_TAG, coco_state::coco_bitbanger_config)
266266   MCFG_COCO_CARTRIDGE_ADD(CARTRIDGE_TAG, coco_state::cartridge_config, coco_cart, "pak", NULL)
267   MCFG_COCO_VHD_ADD(VHD_TAG)
267   MCFG_COCO_VHD_ADD(VHD0_TAG)
268   MCFG_COCO_VHD_ADD(VHD1_TAG)
268269 
269270   // video hardware
270271    MCFG_SCREEN_MC6847_NTSC_ADD(SCREEN_TAG)
src/mess/drivers/coco3.c
r13379r13380
260260   MCFG_CASSETTE_ADD(CASSETTE_TAG, coco_state::coco_cassette_interface)
261261   MCFG_BITBANGER_ADD(BITBANGER_TAG, coco_state::coco_bitbanger_config)
262262   MCFG_COCO_CARTRIDGE_ADD(CARTRIDGE_TAG, coco_state::cartridge_config, coco_cart, "fdcv11", NULL)
263   MCFG_COCO_VHD_ADD(VHD_TAG)
263   MCFG_COCO_VHD_ADD(VHD0_TAG)
264   MCFG_COCO_VHD_ADD(VHD1_TAG)
264265 
265266   // video hardware
266267   MCFG_DEVICE_ADD(GIME_TAG, GIME_NTSC, XTAL_3_579545MHz)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team