src/mess/machine/coco.c
| r13379 | r13380 | |
| 89 | 89 | m_ram(*this, RAM_TAG), |
| 90 | 90 | m_cassette(*this, CASSETTE_TAG), |
| 91 | 91 | 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) |
| 93 | 94 | { |
| 94 | 95 | } |
| 95 | 96 | |
| r13379 | r13380 | |
| 152 | 153 | save_item(NAME(m_dclg_output_v)); |
| 153 | 154 | save_item(NAME(m_dclg_state)); |
| 154 | 155 | save_item(NAME(m_dclg_timer)); |
| 156 | save_item(NAME(m_vhd_select)); |
| 155 | 157 | |
| 156 | 158 | /* set up disassembly override */ |
| 157 | 159 | if (m_maincpu->debug()) |
| r13379 | r13380 | |
| 179 | 181 | m_dclg_output_v = 0; |
| 180 | 182 | m_dclg_state = 0; |
| 181 | 183 | m_dclg_timer = 0; |
| 184 | m_vhd_select = 0; |
| 182 | 185 | } |
| 183 | 186 | |
| 184 | 187 | |
| r13379 | r13380 | |
| 1066 | 1069 | ***************************************************************************/ |
| 1067 | 1070 | |
| 1068 | 1071 | //------------------------------------------------- |
| 1072 | // current_vhd |
| 1073 | //------------------------------------------------- |
| 1074 | |
| 1075 | coco_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 | //------------------------------------------------- |
| 1069 | 1088 | // ff60_read |
| 1070 | 1089 | //------------------------------------------------- |
| 1071 | 1090 | |
| r13379 | r13380 | |
| 1073 | 1092 | { |
| 1074 | 1093 | UINT8 result = 0x00; |
| 1075 | 1094 | |
| 1076 | | if ((m_vhd != NULL) && (offset >= 32) && (offset <= 37)) |
| 1095 | if ((current_vhd() != NULL) && (offset >= 32) && (offset <= 37)) |
| 1077 | 1096 | { |
| 1078 | | result = m_vhd->read(offset - 32); |
| 1097 | result = current_vhd()->read(offset - 32); |
| 1079 | 1098 | } |
| 1080 | 1099 | |
| 1081 | 1100 | return result; |
| r13379 | r13380 | |
| 1089 | 1108 | |
| 1090 | 1109 | WRITE8_MEMBER( coco_state::ff60_write ) |
| 1091 | 1110 | { |
| 1092 | | if ((m_vhd != NULL) && (offset >= 32) && (offset <= 37)) |
| 1111 | if ((current_vhd() != NULL) && (offset >= 32) && (offset <= 37)) |
| 1093 | 1112 | { |
| 1094 | | m_vhd->write(offset - 32, data); |
| 1113 | current_vhd()->write(offset - 32, data); |
| 1095 | 1114 | } |
| 1115 | else if (offset == 38) |
| 1116 | { |
| 1117 | /* writes to $FF86 will switch the VHD */ |
| 1118 | m_vhd_select = data; |
| 1119 | } |
| 1096 | 1120 | } |
| 1097 | 1121 | |
| 1098 | 1122 | |
src/mess/includes/coco.h
| r13379 | r13380 | |
| 48 | 48 | #define DAC_TAG "dac" |
| 49 | 49 | #define CARTRIDGE_TAG "ext" |
| 50 | 50 | #define BITBANGER_TAG "bitbanger" |
| 51 | | #define VHD_TAG "vhd" |
| 51 | #define VHD0_TAG "vhd0" |
| 52 | #define VHD1_TAG "vhd1" |
| 52 | 53 | |
| 53 | 54 | /* inputs */ |
| 54 | 55 | #define CTRL_SEL_TAG "ctrl_sel" |
| r13379 | r13380 | |
| 92 | 93 | required_device<ram_device> m_ram; |
| 93 | 94 | required_device<cassette_image_device> m_cassette; |
| 94 | 95 | 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; |
| 96 | 98 | |
| 97 | 99 | static const pia6821_interface pia0_config; |
| 98 | 100 | static const pia6821_interface pia1_config; |
| r13379 | r13380 | |
| 218 | 220 | bool sel2(void) { return m_pia_0->cb2_output() ? true : false; } |
| 219 | 221 | bool snden(void) { return m_pia_1->cb2_output() ? true : false; } |
| 220 | 222 | |
| 223 | /* VHD selection */ |
| 224 | coco_vhd_image_device *current_vhd(void); |
| 225 | |
| 221 | 226 | /* disassembly override */ |
| 222 | 227 | static offs_t dasm_override(device_t &device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options); |
| 223 | 228 | |
| r13379 | r13380 | |
| 243 | 248 | UINT8 m_dclg_output_v; |
| 244 | 249 | UINT8 m_dclg_state; |
| 245 | 250 | UINT16 m_dclg_timer; |
| 251 | |
| 252 | /* VHD selection */ |
| 253 | UINT8 m_vhd_select; |
| 246 | 254 | }; |
| 247 | 255 | |
| 248 | 256 | #endif /* __COCO__ */ |
src/mess/drivers/coco12.c
| r13379 | r13380 | |
| 264 | 264 | MCFG_CASSETTE_ADD(CASSETTE_TAG, coco_state::coco_cassette_interface)
|
| 265 | 265 | MCFG_BITBANGER_ADD(BITBANGER_TAG, coco_state::coco_bitbanger_config)
|
| 266 | 266 | 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)
|
| 268 | 269 | |
| 269 | 270 | // video hardware
|
| 270 | 271 | MCFG_SCREEN_MC6847_NTSC_ADD(SCREEN_TAG)
|
src/mess/drivers/coco3.c
| r13379 | r13380 | |
| 260 | 260 | MCFG_CASSETTE_ADD(CASSETTE_TAG, coco_state::coco_cassette_interface)
|
| 261 | 261 | MCFG_BITBANGER_ADD(BITBANGER_TAG, coco_state::coco_bitbanger_config)
|
| 262 | 262 | 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)
|
| 264 | 265 | |
| 265 | 266 | // video hardware
|
| 266 | 267 | MCFG_DEVICE_ADD(GIME_TAG, GIME_NTSC, XTAL_3_579545MHz)
|