trunk/src/mess/drivers/excali64.c
| r242493 | r242494 | |
| 12 | 12 | There are 2 versions of the colour prom, which have different palettes. |
| 13 | 13 | We have the later version. |
| 14 | 14 | |
| 15 | | Control W then Enter will switch between 40 and 80 characters per line. |
| 15 | Notes: |
| 16 | - Control W then Enter will switch between 40 and 80 characters per line. |
| 17 | - Control V turns cursor on |
| 18 | - Graphics commands such as LINE, CIRCLE, HGRCLS, HGRSET etc only work with disk basic |
| 16 | 19 | |
| 17 | 20 | ToDo: |
| 18 | 21 | - Colours are approximate. |
| 19 | | - Disk controller |
| 20 | | - Graphics commands such as LINE and CIRCLE produce a syntax error. |
| 21 | | - Some commands such as HGRCLS are missing from the rom. Perhaps we need a later version? |
| 22 | - Issues with bitmap graphics |
| 23 | - Disk controller, works with old wd17xx but crashes on new wd. |
| 24 | - Hardware supports 8 and 5.25 inch floppies, but we only support 5.25 as this |
| 25 | is the only software that exists. |
| 22 | 26 | - The schematic shows the audio counter connected to 2MHz, but this produces |
| 23 | 27 | sounds that are too high. Connected to 1MHz for now. |
| 24 | 28 | - Serial |
| 25 | 29 | - Parallel / Centronics |
| 26 | | - Need software |
| 30 | - Need more software |
| 27 | 31 | - Pasting can sometimes drop a character. |
| 28 | 32 | |
| 29 | 33 | ****************************************************************************/ |
| r242493 | r242494 | |
| 44 | 48 | #include "sound/wave.h" |
| 45 | 49 | #include "sound/speaker.h" |
| 46 | 50 | #include "machine/z80dma.h" |
| 51 | #include "machine/rescap.h" |
| 52 | #include "machine/74123.h" |
| 47 | 53 | #if NEWFDC |
| 48 | 54 | #include "machine/wd_fdc.h" |
| 49 | 55 | #include "formats/excali64_dsk.h" |
| r242493 | r242494 | |
| 64 | 70 | , m_crtc(*this, "crtc") |
| 65 | 71 | , m_io_keyboard(*this, "KEY") |
| 66 | 72 | , m_dma(*this, "dma") |
| 73 | , m_u12(*this, "u12") |
| 67 | 74 | , m_fdc(*this, "fdc") |
| 68 | 75 | #if NEWFDC |
| 69 | 76 | , m_floppy0(*this, "fdc:0") |
| r242493 | r242494 | |
| 92 | 99 | MC6845_UPDATE_ROW(update_row); |
| 93 | 100 | DECLARE_WRITE_LINE_MEMBER(crtc_de); |
| 94 | 101 | DECLARE_WRITE_LINE_MEMBER(crtc_vs); |
| 102 | DECLARE_WRITE8_MEMBER(motor_w); |
| 95 | 103 | DECLARE_MACHINE_RESET(excali64); |
| 96 | 104 | required_device<palette_device> m_palette; |
| 97 | 105 | |
| r242493 | r242494 | |
| 103 | 111 | UINT8 m_kbdrow; |
| 104 | 112 | bool m_crtc_vs; |
| 105 | 113 | bool m_crtc_de; |
| 114 | bool m_motor; |
| 106 | 115 | required_device<cpu_device> m_maincpu; |
| 107 | 116 | required_device<cassette_image_device> m_cass; |
| 108 | 117 | required_device<mc6845_device> m_crtc; |
| 109 | 118 | required_ioport_array<8> m_io_keyboard; |
| 110 | 119 | required_device<z80dma_device> m_dma; |
| 120 | required_device<ttl74123_device> m_u12; |
| 111 | 121 | #if NEWFDC |
| 112 | 122 | required_device<wd2793_t> m_fdc; |
| 113 | 123 | required_device<floppy_connector> m_floppy0; |
| r242493 | r242494 | |
| 256 | 266 | }; |
| 257 | 267 | #endif |
| 258 | 268 | |
| 269 | // pulses from port E4 bit 5 restart the 74123. After 3.6 secs without a pulse, the motor gets turned off. |
| 270 | WRITE8_MEMBER( excali64_state::motor_w ) |
| 271 | { |
| 272 | m_motor = BIT(data, 0); |
| 273 | #if NEWFDC |
| 274 | m_floppy0->get_device()->mon_w(!m_motor); |
| 275 | #else |
| 276 | //const char *floppy_tags[4] = { FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3 }; |
| 277 | legacy_floppy_image_device *flop = subdevice<legacy_floppy_image_device>(FLOPPY_0); |
| 278 | flop->floppy_mon_w(!m_motor); // motor on |
| 279 | //flop->floppy_drive_set_ready_state(1, 0); // this is commented out in flopdrv.c, so does nothing |
| 280 | #endif |
| 281 | } |
| 282 | |
| 259 | 283 | READ8_MEMBER( excali64_state::porte8_r ) |
| 260 | 284 | { |
| 261 | | return 0xff; |
| 285 | return 0xfc | (UINT8)m_motor; |
| 262 | 286 | } |
| 263 | 287 | |
| 264 | 288 | WRITE8_MEMBER( excali64_state::porte4_w ) |
| 265 | 289 | { |
| 266 | | //printf("%X ",data); |
| 267 | 290 | #if NEWFDC |
| 268 | 291 | floppy_image_device *floppy = NULL; |
| 269 | 292 | if (BIT(data, 0)) floppy = m_floppy0->get_device(); |
| r242493 | r242494 | |
| 272 | 295 | if (floppy) |
| 273 | 296 | floppy->ss_w(BIT(data, 4)); |
| 274 | 297 | #else |
| 275 | | UINT8 i; |
| 276 | | for (i = 0; i < 4; i++) |
| 277 | | { |
| 278 | | if BIT(data, i) |
| 279 | | { |
| 280 | | m_fdc->set_drive(i); |
| 281 | | break; |
| 282 | | } |
| 283 | | } |
| 284 | | //if (data & 0x01) m_fdc->set_drive(0); |
| 285 | | //if (data & 0x02) m_fdc->set_drive(1); |
| 286 | | //if (data & 0x04) m_fdc->set_drive(2); |
| 287 | | //if (data & 0x08) m_fdc->set_drive(3); |
| 288 | | //if (data & 0x10) m_fdc->set_side((data & 0x10) >> 4); |
| 289 | | const char *floppy_tags[4] = { FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3 }; |
| 298 | //UINT8 i; |
| 299 | //for (i = 0; i < 4; i++) |
| 300 | //{ |
| 301 | // if BIT(data, i) |
| 302 | // { |
| 303 | // m_fdc->set_drive(i); |
| 304 | // break; |
| 305 | // } |
| 306 | //} |
| 307 | if BIT(data, 0) m_fdc->set_drive(0); |
| 308 | //if BIT(data, 1) m_fdc->set_drive(1); |
| 309 | //if BIT(data, 2) m_fdc->set_drive(2); |
| 310 | //if BIT(data, 3) m_fdc->set_drive(3); |
| 311 | m_fdc->set_side(BIT(data, 4)); |
| 290 | 312 | |
| 291 | 313 | m_fdc->dden_w(1);//!BIT(data, 6)); // we want double density |
| 292 | | //if ((data & 0x04) == 0) // reset |
| 293 | | //m_fdc->reset(); |
| 294 | | |
| 295 | | // bit 3 connected to pin 23 "HRDY" of FDC |
| 296 | | // TEMP HACK, FDD motor and RDY FDC pin controlled by HLD pin of FDC |
| 297 | | legacy_floppy_image_device *flop = subdevice<legacy_floppy_image_device>(floppy_tags[i]); |
| 298 | | flop->floppy_mon_w(0); // motor on |
| 299 | | flop->floppy_drive_set_ready_state(1, 0); |
| 300 | 314 | #endif |
| 315 | m_u12->b_w(space,offset, BIT(data, 5)); |
| 301 | 316 | } |
| 302 | 317 | |
| 303 | 318 | WRITE8_MEMBER( excali64_state::portec_w ) |
| r242493 | r242494 | |
| 624 | 639 | MCFG_CASSETTE_ADD( "cassette" ) |
| 625 | 640 | #if NEWFDC |
| 626 | 641 | MCFG_WD2793x_ADD("fdc", XTAL_16MHz / 16) |
| 642 | MCFG_WD_FDC_FORCE_READY |
| 643 | MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE("dma", z80dma_device, rdy_w)) |
| 627 | 644 | MCFG_FLOPPY_DRIVE_ADD("fdc:0", excali64_floppies, "525dd", floppy_image_device::default_floppy_formats)// excali64_state::floppy_formats) |
| 628 | | MCFG_FLOPPY_DRIVE_ADD("fdc:1", excali64_floppies, "525dd", floppy_image_device::default_floppy_formats) |
| 645 | //MCFG_FLOPPY_DRIVE_ADD("fdc:1", excali64_floppies, "525dd", floppy_image_device::default_floppy_formats) |
| 629 | 646 | #else |
| 630 | 647 | MCFG_DEVICE_ADD("fdc", WD2793, 0) |
| 631 | | MCFG_WD17XX_DEFAULT_DRIVE4_TAGS |
| 632 | | //MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(nascom1_state, nascom2_fdc_intrq_w)) |
| 633 | | //MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(nascom1_state, nascom2_fdc_drq_w)) |
| 634 | | //MCFG_WD17XX_DDEN_CALLBACK(VCC) |
| 635 | | MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(excali64_floppy_interface) |
| 648 | MCFG_WD17XX_DEFAULT_DRIVE1_TAGS |
| 649 | MCFG_WD17XX_DRQ_CALLBACK(DEVWRITELINE("dma", z80dma_device, rdy_w)) |
| 650 | MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, excali64_floppy_interface) |
| 651 | //MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(excali64_floppy_interface) |
| 636 | 652 | #endif |
| 637 | 653 | MCFG_DEVICE_ADD("dma", Z80DMA, XTAL_16MHz/4) |
| 638 | 654 | MCFG_Z80DMA_OUT_BUSREQ_CB(WRITELINE(excali64_state, busreq_w)) |
| r242493 | r242494 | |
| 640 | 656 | MCFG_Z80DMA_OUT_MREQ_CB(WRITE8(excali64_state, memory_write_byte)) |
| 641 | 657 | MCFG_Z80DMA_IN_IORQ_CB(READ8(excali64_state, io_read_byte)) |
| 642 | 658 | MCFG_Z80DMA_OUT_IORQ_CB(WRITE8(excali64_state, io_write_byte)) |
| 659 | |
| 660 | MCFG_DEVICE_ADD("u12", TTL74123, 0) |
| 661 | MCFG_TTL74123_CONNECTION_TYPE(TTL74123_GROUNDED) /* the hook up type (no idea what this means */ |
| 662 | MCFG_TTL74123_RESISTOR_VALUE(RES_K(100)) /* resistor connected between RCext & 5v */ |
| 663 | MCFG_TTL74123_CAPACITOR_VALUE(CAP_U(100)) /* capacitor connected between Cext and RCext */ |
| 664 | MCFG_TTL74123_A_PIN_VALUE(0) /* A pin - grounded */ |
| 665 | MCFG_TTL74123_B_PIN_VALUE(1) /* B pin - driven by port e4 bit 5 */ |
| 666 | MCFG_TTL74123_CLEAR_PIN_VALUE(1) /* Clear pin - pulled high */ |
| 667 | MCFG_TTL74123_OUTPUT_CHANGED_CB(WRITE8(excali64_state, motor_w)) |
| 643 | 668 | MACHINE_CONFIG_END |
| 644 | 669 | |
| 645 | 670 | /* ROM definition */ |