src/mess/machine/comx35.c
| r11069 | r11070 | |
| 114 | 114 | |
| 115 | 115 | */ |
| 116 | 116 | |
| 117 | | #include "emu.h" |
| 118 | | #include "cpu/cosmac/cosmac.h" |
| 119 | | #include "machine/wd17xx.h" |
| 120 | | #include "imagedev/printer.h" |
| 121 | | #include "imagedev/snapquik.h" |
| 122 | | #include "sound/cdp1869.h" |
| 123 | | #include "video/mc6845.h" |
| 124 | 117 | #include "includes/comx35.h" |
| 125 | | #include "machine/rescap.h" |
| 126 | | #include "imagedev/flopdrv.h" |
| 127 | | #include "machine/ram.h" |
| 128 | 118 | |
| 129 | 119 | enum |
| 130 | 120 | { |
| r11069 | r11070 | |
| 137 | 127 | UINT8 comx35_state::read_expansion() |
| 138 | 128 | { |
| 139 | 129 | UINT8 result; |
| 140 | | switch(m_machine.phase()) |
| 130 | |
| 131 | switch (m_machine.phase()) |
| 141 | 132 | { |
| 142 | 133 | case MACHINE_PHASE_RESET: |
| 143 | 134 | case MACHINE_PHASE_RUNNING: |
| r11069 | r11070 | |
| 148 | 139 | result = 0x00; |
| 149 | 140 | break; |
| 150 | 141 | } |
| 142 | |
| 151 | 143 | return result; |
| 152 | 144 | } |
| 153 | 145 | |
| r11069 | r11070 | |
| 169 | 161 | } |
| 170 | 162 | |
| 171 | 163 | /* Floppy Disc Controller */ |
| 172 | | static WRITE_LINE_DEVICE_HANDLER( comx35_fdc_intrq_w ) |
| 164 | |
| 165 | WRITE_LINE_MEMBER( comx35_state::fdc_intrq_w ) |
| 173 | 166 | { |
| 174 | | comx35_state *driver_state = device->machine().driver_data<comx35_state>(); |
| 175 | | driver_state->m_fdc_irq = state; |
| 167 | m_fdc_irq = state; |
| 176 | 168 | } |
| 177 | 169 | |
| 178 | | static WRITE_LINE_DEVICE_HANDLER( comx35_fdc_drq_w ) |
| 170 | WRITE_LINE_MEMBER( comx35_state::fdc_drq_w ) |
| 179 | 171 | { |
| 180 | | comx35_state *driver_state = device->machine().driver_data<comx35_state>(); |
| 181 | | |
| 182 | | if (driver_state->m_fdc_drq_enable) |
| 183 | | driver_state->m_cdp1802_ef4 = state; |
| 172 | if (m_fdc_drq_enable) |
| 173 | m_cdp1802_ef4 = state; |
| 184 | 174 | } |
| 185 | 175 | |
| 186 | 176 | const wd17xx_interface comx35_wd17xx_interface = |
| 187 | 177 | { |
| 188 | 178 | DEVCB_NULL, |
| 189 | | DEVCB_LINE(comx35_fdc_intrq_w), |
| 190 | | DEVCB_LINE(comx35_fdc_drq_w), |
| 179 | DEVCB_DRIVER_LINE_MEMBER(comx35_state, fdc_intrq_w), |
| 180 | DEVCB_DRIVER_LINE_MEMBER(comx35_state, fdc_drq_w), |
| 191 | 181 | { FLOPPY_0, FLOPPY_1, NULL, NULL } |
| 192 | 182 | }; |
| 193 | 183 | |
src/mess/includes/comx35.h
| r11069 | r11070 | |
| 1 | #pragma once |
| 2 | |
| 1 | 3 | #ifndef __COMX35__ |
| 2 | 4 | #define __COMX35__ |
| 3 | 5 | |
| 6 | #define ADDRESS_MAP_MODERN |
| 7 | |
| 8 | #include "emu.h" |
| 4 | 9 | #include "cpu/cosmac/cosmac.h" |
| 5 | 10 | #include "sound/cdp1869.h" |
| 11 | #include "sound/wave.h" |
| 12 | #include "imagedev/flopdrv.h" |
| 13 | #include "formats/comx35_dsk.h" |
| 14 | #include "formats/comx35_comx.h" |
| 15 | #include "imagedev/cassette.h" |
| 16 | #include "imagedev/printer.h" |
| 17 | #include "imagedev/snapquik.h" |
| 6 | 18 | #include "machine/cdp1871.h" |
| 7 | | #include "imagedev/snapquik.h" |
| 19 | #include "machine/comxpl80.h" |
| 8 | 20 | #include "machine/wd17xx.h" |
| 9 | 21 | #include "machine/ram.h" |
| 22 | #include "machine/rescap.h" |
| 23 | #include "video/mc6845.h" |
| 10 | 24 | |
| 11 | 25 | #define SCREEN_TAG "screen" |
| 12 | 26 | #define MC6845_SCREEN_TAG "screen80" |
| r11069 | r11070 | |
| 67 | 81 | virtual void video_start(); |
| 68 | 82 | virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect); |
| 69 | 83 | |
| 70 | | DECLARE_WRITE8_MEMBER(cdp1869_w); |
| 71 | | DECLARE_READ8_MEMBER(io_r); |
| 72 | | DECLARE_READ8_MEMBER(io2_r); |
| 73 | | DECLARE_WRITE8_MEMBER(bank_select_w); |
| 74 | | DECLARE_WRITE8_MEMBER(io_w); |
| 75 | | DECLARE_READ_LINE_MEMBER(clear_r); |
| 76 | | DECLARE_READ_LINE_MEMBER(ef2_r); |
| 77 | | DECLARE_READ_LINE_MEMBER(ef4_r); |
| 78 | | DECLARE_WRITE_LINE_MEMBER(comx35_q_w); |
| 79 | | DECLARE_READ_LINE_MEMBER(comx35_shift_r); |
| 80 | | DECLARE_READ_LINE_MEMBER(comx35_control_r); |
| 84 | DECLARE_WRITE8_MEMBER( cdp1869_w ); |
| 85 | DECLARE_READ8_MEMBER( io_r ); |
| 86 | DECLARE_READ8_MEMBER( io2_r ); |
| 87 | DECLARE_WRITE8_MEMBER( bank_select_w ); |
| 88 | DECLARE_WRITE8_MEMBER( io_w ); |
| 89 | DECLARE_READ_LINE_MEMBER( clear_r ); |
| 90 | DECLARE_READ_LINE_MEMBER( ef2_r ); |
| 91 | DECLARE_READ_LINE_MEMBER( ef4_r ); |
| 92 | DECLARE_WRITE_LINE_MEMBER( q_w ); |
| 93 | DECLARE_READ_LINE_MEMBER( shift_r ); |
| 94 | DECLARE_READ_LINE_MEMBER( control_r ); |
| 95 | DECLARE_WRITE_LINE_MEMBER( fdc_intrq_w ); |
| 96 | DECLARE_WRITE_LINE_MEMBER( fdc_drq_w ); |
| 81 | 97 | |
| 82 | 98 | UINT8 read_expansion(); |
| 83 | 99 | bool is_expansion_box_installed(); |
src/mess/drivers/comx35.c
| r11069 | r11070 | |
| 10 | 10 | |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | | #define ADDRESS_MAP_MODERN |
| 14 | | |
| 15 | | #include "emu.h" |
| 16 | 13 | #include "includes/comx35.h" |
| 17 | | #include "cpu/cosmac/cosmac.h" |
| 18 | | #include "sound/cdp1869.h" |
| 19 | | #include "sound/wave.h" |
| 20 | | #include "imagedev/flopdrv.h" |
| 21 | | #include "formats/comx35_dsk.h" |
| 22 | | #include "formats/comx35_comx.h" |
| 23 | | #include "imagedev/cassette.h" |
| 24 | | #include "imagedev/printer.h" |
| 25 | | #include "imagedev/snapquik.h" |
| 26 | | #include "machine/cdp1871.h" |
| 27 | | #include "machine/comxpl80.h" |
| 28 | | #include "machine/wd17xx.h" |
| 29 | | #include "machine/ram.h" |
| 30 | | #include "video/mc6845.h" |
| 31 | 14 | |
| 32 | 15 | /* Memory Maps */ |
| 33 | 16 | |
| r11069 | r11070 | |
| 201 | 184 | |
| 202 | 185 | /* CDP1802 Interface */ |
| 203 | 186 | |
| 204 | | static READ_LINE_DEVICE_HANDLER( clear_r ) |
| 187 | READ_LINE_MEMBER( comx35_state::clear_r ) |
| 205 | 188 | { |
| 206 | | comx35_state *state = device->machine().driver_data<comx35_state>(); |
| 207 | | |
| 208 | | return state->m_reset; |
| 189 | return m_reset; |
| 209 | 190 | } |
| 210 | 191 | |
| 211 | | static READ_LINE_DEVICE_HANDLER( ef2_r ) |
| 192 | READ_LINE_MEMBER( comx35_state::ef2_r ) |
| 212 | 193 | { |
| 213 | | comx35_state *state = device->machine().driver_data<comx35_state>(); |
| 214 | | |
| 215 | | if (state->m_iden) |
| 194 | if (m_iden) |
| 216 | 195 | { |
| 217 | 196 | // interrupts disabled: PAL/NTSC |
| 218 | | return state->m_vis->pal_ntsc_r(); |
| 197 | return m_vis->pal_ntsc_r(); |
| 219 | 198 | } |
| 220 | 199 | else |
| 221 | 200 | { |
| 222 | 201 | // interrupts enabled: keyboard repeat |
| 223 | | return state->m_kbe->rpt_r(); |
| 202 | return m_kbe->rpt_r(); |
| 224 | 203 | } |
| 225 | 204 | } |
| 226 | 205 | |
| 227 | | static READ_LINE_DEVICE_HANDLER( ef4_r ) |
| 206 | READ_LINE_MEMBER( comx35_state::ef4_r ) |
| 228 | 207 | { |
| 229 | | comx35_state *state = device->machine().driver_data<comx35_state>(); |
| 230 | | |
| 231 | | return (cassette_input(device) < 0) | state->m_cdp1802_ef4; |
| 208 | return (cassette_input(m_cassette) < 0) | m_cdp1802_ef4; |
| 232 | 209 | } |
| 233 | 210 | |
| 234 | 211 | static COSMAC_SC_WRITE( comx35_sc_w ) |
| r11069 | r11070 | |
| 270 | 247 | } |
| 271 | 248 | } |
| 272 | 249 | |
| 273 | | static WRITE_LINE_DEVICE_HANDLER( comx35_q_w ) |
| 250 | WRITE_LINE_MEMBER( comx35_state::q_w ) |
| 274 | 251 | { |
| 275 | | comx35_state *driver_state = device->machine().driver_data<comx35_state>(); |
| 252 | m_cdp1802_q = state; |
| 276 | 253 | |
| 277 | | driver_state->m_cdp1802_q = state; |
| 278 | | |
| 279 | | if (driver_state->m_iden && state) |
| 254 | if (m_iden && state) |
| 280 | 255 | { |
| 281 | 256 | // enable interrupts |
| 282 | | driver_state->m_iden = 0; |
| 257 | m_iden = 0; |
| 283 | 258 | } |
| 284 | 259 | |
| 285 | 260 | // cassette output |
| 286 | | cassette_output(driver_state->m_cassette, state ? +1.0 : -1.0); |
| 261 | cassette_output(m_cassette, state ? +1.0 : -1.0); |
| 287 | 262 | } |
| 288 | 263 | |
| 289 | 264 | static COSMAC_INTERFACE( cosmac_intf ) |
| 290 | 265 | { |
| 291 | 266 | DEVCB_LINE_VCC, // wait |
| 292 | | DEVCB_LINE(clear_r), // clear |
| 267 | DEVCB_DRIVER_LINE_MEMBER(comx35_state, clear_r),// clear |
| 293 | 268 | DEVCB_NULL, // EF1 |
| 294 | | DEVCB_LINE(ef2_r), // EF2 |
| 269 | DEVCB_DRIVER_LINE_MEMBER(comx35_state, ef2_r), // EF2 |
| 295 | 270 | DEVCB_NULL, // EF3 |
| 296 | | DEVCB_DEVICE_LINE(CASSETTE_TAG, ef4_r), // EF4 |
| 297 | | DEVCB_LINE(comx35_q_w), // Q |
| 271 | DEVCB_DRIVER_LINE_MEMBER(comx35_state, ef4_r), // EF4 |
| 272 | DEVCB_DRIVER_LINE_MEMBER(comx35_state, q_w), // Q |
| 298 | 273 | DEVCB_NULL, // DMA in |
| 299 | 274 | DEVCB_NULL, // DMA out |
| 300 | 275 | comx35_sc_w, // SC |
| r11069 | r11070 | |
| 304 | 279 | |
| 305 | 280 | /* CDP1871 Interface */ |
| 306 | 281 | |
| 307 | | static READ_LINE_DEVICE_HANDLER( comx35_shift_r ) |
| 282 | READ_LINE_MEMBER( comx35_state::shift_r ) |
| 308 | 283 | { |
| 309 | | return BIT(input_port_read(device->machine(), "MODIFIERS"), 0); |
| 284 | return BIT(input_port_read(m_machine, "MODIFIERS"), 0); |
| 310 | 285 | } |
| 311 | 286 | |
| 312 | | static READ_LINE_DEVICE_HANDLER( comx35_control_r ) |
| 287 | READ_LINE_MEMBER( comx35_state::control_r ) |
| 313 | 288 | { |
| 314 | | return BIT(input_port_read(device->machine(), "MODIFIERS"), 1); |
| 289 | return BIT(input_port_read(m_machine, "MODIFIERS"), 1); |
| 315 | 290 | } |
| 316 | 291 | |
| 317 | 292 | static CDP1871_INTERFACE( comx35_cdp1871_intf ) |
| r11069 | r11070 | |
| 327 | 302 | DEVCB_INPUT_PORT("D9"), |
| 328 | 303 | DEVCB_INPUT_PORT("D10"), |
| 329 | 304 | DEVCB_INPUT_PORT("D11"), |
| 330 | | DEVCB_LINE(comx35_shift_r), |
| 331 | | DEVCB_LINE(comx35_control_r), |
| 305 | DEVCB_DRIVER_LINE_MEMBER(comx35_state, shift_r), |
| 306 | DEVCB_DRIVER_LINE_MEMBER(comx35_state, control_r), |
| 332 | 307 | DEVCB_NULL, |
| 333 | 308 | DEVCB_CPU_INPUT_LINE(CDP1802_TAG, COSMAC_INPUT_LINE_EF3), |
| 334 | 309 | DEVCB_NULL // polled |
| r11069 | r11070 | |
| 445 | 420 | ROM_LOAD( "f&m.eprom.board.1.1.bin",0x0000, 0x0800, CRC(a042a31a) SHA1(13831a1350aa62a87988bfcc99c4b7db8ef1cf62) ) |
| 446 | 421 | |
| 447 | 422 | ROM_REGION( 0x2000, "80column", 0 ) /* 80 Column Card */ |
| 448 | | ROM_LOAD( "p.cl1", 0x0000, 0x0800, CRC(b417d30a) SHA1(d428b0467945ecb9aec884211d0f4b1d8d56d738) ) // V1.0 |
| 423 | ROM_LOAD( "p 1.0.cl1", 0x0000, 0x0800, CRC(b417d30a) SHA1(d428b0467945ecb9aec884211d0f4b1d8d56d738) ) // V1.0 |
| 449 | 424 | ROM_LOAD( "p 1.1.cl1", 0x0000, 0x0800, CRC(0a2eaf19) SHA1(3f1f640caef964fb47aaa147cab6d215c2b30e9d) ) // V1.1 |
| 450 | 425 | |
| 451 | 426 | ROM_REGION( 0x800, "chargen", 0 ) /* 80 Column Card */ |
| 452 | | ROM_LOAD( "c.cl4", 0x0000, 0x0800, CRC(69dd7b07) SHA1(71d368adbb299103d165eab8359a97769e463e26) ) // V1.0 |
| 427 | ROM_LOAD( "c 1.0.cl4", 0x0000, 0x0800, CRC(69dd7b07) SHA1(71d368adbb299103d165eab8359a97769e463e26) ) // V1.0 |
| 453 | 428 | ROM_LOAD( "c 1.1.cl4", 0x0000, 0x0800, CRC(dc9b5046) SHA1(4e041cec03dda6dba5e2598d060c49908a4fab2a) ) // V1.1 |
| 454 | 429 | ROM_END |
| 455 | 430 | |