trunk/src/mess/includes/bw12.h
| r18990 | r18991 | |
| 1 | 1 | #ifndef __BW12__ |
| 2 | 2 | #define __BW12__ |
| 3 | 3 | |
| 4 | #include "emu.h" |
| 5 | #include "cpu/z80/z80.h" |
| 4 | 6 | #include "machine/ram.h" |
| 7 | #include "formats/bw12_dsk.h" |
| 8 | #include "formats/hxcmfm_dsk.h" |
| 9 | #include "formats/imd_dsk.h" |
| 10 | #include "formats/mfi_dsk.h" |
| 11 | #include "machine/6821pia.h" |
| 12 | #include "machine/ctronics.h" |
| 13 | #include "machine/kb3600.h" |
| 14 | #include "machine/pit8253.h" |
| 15 | #include "machine/ram.h" |
| 16 | #include "machine/rescap.h" |
| 17 | #include "machine/upd765.h" |
| 18 | #include "machine/z80dart.h" |
| 19 | #include "video/mc6845.h" |
| 20 | #include "sound/dac.h" |
| 5 | 21 | |
| 6 | 22 | #define SCREEN_TAG "screen" |
| 7 | 23 | #define Z80_TAG "ic35" |
| r18990 | r18991 | |
| 31 | 47 | m_crtc(*this, MC6845_TAG), |
| 32 | 48 | m_centronics(*this, CENTRONICS_TAG), |
| 33 | 49 | m_ram(*this, RAM_TAG), |
| 34 | | m_floppy0(*this, UPD765_TAG ":0:525ssdd"), |
| 35 | | m_floppy1(*this, UPD765_TAG ":1:525ssdd"), |
| 36 | | m_floppy_timer(*this, FLOPPY_TIMER_TAG) |
| 37 | | , |
| 38 | | m_video_ram(*this, "video_ram"){ } |
| 50 | m_floppy0(*this, UPD765_TAG ":0:525dd"), |
| 51 | m_floppy1(*this, UPD765_TAG ":1:525dd"), |
| 52 | m_floppy_timer(*this, FLOPPY_TIMER_TAG), |
| 53 | m_video_ram(*this, "video_ram") |
| 54 | { } |
| 39 | 55 | |
| 40 | 56 | required_device<cpu_device> m_maincpu; |
| 41 | 57 | required_device<pia6821_device> m_pia; |
trunk/src/mess/drivers/bw12.c
| r18990 | r18991 | |
| 23 | 23 | |
| 24 | 24 | ****************************************************************************/ |
| 25 | 25 | |
| 26 | | |
| 27 | | #include "emu.h" |
| 28 | | #include "cpu/z80/z80.h" |
| 29 | | #include "machine/ram.h" |
| 30 | | #include "formats/mfi_dsk.h" |
| 31 | | #include "machine/6821pia.h" |
| 32 | | #include "machine/ctronics.h" |
| 33 | | #include "machine/upd765.h" |
| 34 | | #include "machine/pit8253.h" |
| 35 | | #include "machine/rescap.h" |
| 36 | | #include "machine/z80dart.h" |
| 37 | | #include "machine/kb3600.h" |
| 38 | | #include "video/mc6845.h" |
| 39 | | #include "sound/dac.h" |
| 40 | 26 | #include "includes/bw12.h" |
| 41 | 27 | |
| 42 | 28 | /* |
| r18990 | r18991 | |
| 81 | 67 | |
| 82 | 68 | void bw12_state::floppy_motor_off() |
| 83 | 69 | { |
| 84 | | m_floppy0->mon_w(true); |
| 85 | | m_floppy1->mon_w(true); |
| 70 | m_floppy0->mon_w(1); |
| 71 | m_floppy1->mon_w(1); |
| 86 | 72 | |
| 87 | 73 | m_motor_on = 0; |
| 88 | 74 | } |
| r18990 | r18991 | |
| 97 | 83 | if (m_motor0 || m_motor1) |
| 98 | 84 | { |
| 99 | 85 | m_motor_on = 1; |
| 100 | | m_floppy_timer->enable(0); |
| 86 | m_floppy_timer->enable(false); |
| 101 | 87 | } |
| 102 | 88 | else |
| 103 | 89 | { |
| r18990 | r18991 | |
| 142 | 128 | |
| 143 | 129 | if (data) |
| 144 | 130 | { |
| 145 | | m_floppy0->mon_w(false); |
| 131 | m_floppy0->mon_w(0); |
| 146 | 132 | } |
| 147 | 133 | |
| 148 | 134 | set_floppy_motor_off_timer(); |
| r18990 | r18991 | |
| 153 | 139 | |
| 154 | 140 | if (data) |
| 155 | 141 | { |
| 156 | | m_floppy1->mon_w(false); |
| 142 | m_floppy1->mon_w(0); |
| 157 | 143 | } |
| 158 | 144 | |
| 159 | 145 | set_floppy_motor_off_timer(); |
| r18990 | r18991 | |
| 352 | 338 | static MC6845_UPDATE_ROW( bw12_update_row ) |
| 353 | 339 | { |
| 354 | 340 | bw12_state *state = device->machine().driver_data<bw12_state>(); |
| 355 | | const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
| 356 | 341 | |
| 357 | 342 | int column, bit; |
| 358 | 343 | |
| r18990 | r18991 | |
| 372 | 357 | int x = (column * 8) + bit; |
| 373 | 358 | int color = BIT(data, 7); |
| 374 | 359 | |
| 375 | | bitmap.pix32(y, x) = palette[color]; |
| 360 | bitmap.pix32(y, x) = RGB_MONOCHROME_AMBER[color]; |
| 376 | 361 | |
| 377 | 362 | data <<= 1; |
| 378 | 363 | } |
| r18990 | r18991 | |
| 525 | 510 | { |
| 526 | 511 | XTAL_1_8432MHz, |
| 527 | 512 | DEVCB_NULL, |
| 528 | | DEVCB_DRIVER_LINE_MEMBER(bw12_state,pit_out0_w) |
| 513 | DEVCB_DRIVER_LINE_MEMBER(bw12_state, pit_out0_w) |
| 529 | 514 | }, |
| 530 | 515 | { |
| 531 | 516 | XTAL_1_8432MHz, |
| r18990 | r18991 | |
| 618 | 603 | |
| 619 | 604 | void bw12_state::machine_reset() |
| 620 | 605 | { |
| 621 | | int i; |
| 622 | | |
| 623 | | for (i = 0; i < 8; i++) |
| 606 | for (int i = 0; i < 8; i++) |
| 624 | 607 | { |
| 625 | 608 | ls259_w(i, 0); |
| 626 | 609 | } |
| 627 | 610 | } |
| 628 | 611 | |
| 629 | 612 | static SLOT_INTERFACE_START( bw12_floppies ) |
| 630 | | SLOT_INTERFACE( "525ssdd", FLOPPY_525_SSDD ) |
| 613 | SLOT_INTERFACE( "525dd", FLOPPY_525_SSDD ) |
| 631 | 614 | SLOT_INTERFACE_END |
| 632 | 615 | |
| 633 | 616 | static const floppy_format_type bw12_floppy_formats[] = { |
| 617 | FLOPPY_BW12_FORMAT, |
| 618 | FLOPPY_IMD_FORMAT, |
| 634 | 619 | FLOPPY_MFI_FORMAT, |
| 620 | FLOPPY_MFM_FORMAT, |
| 635 | 621 | NULL |
| 636 | 622 | }; |
| 637 | 623 | |
| 638 | 624 | static SLOT_INTERFACE_START( bw14_floppies ) |
| 639 | | SLOT_INTERFACE( "525hd", FLOPPY_525_HD ) |
| 625 | SLOT_INTERFACE( "525dd", FLOPPY_525_DD ) |
| 640 | 626 | SLOT_INTERFACE_END |
| 641 | 627 | |
| 642 | 628 | static const floppy_format_type bw14_floppy_formats[] = { |
| 629 | FLOPPY_BW12_FORMAT, |
| 630 | FLOPPY_IMD_FORMAT, |
| 643 | 631 | FLOPPY_MFI_FORMAT, |
| 632 | FLOPPY_MFM_FORMAT, |
| 644 | 633 | NULL |
| 645 | 634 | }; |
| 646 | 635 | |
| r18990 | r18991 | |
| 679 | 668 | MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1) |
| 680 | 669 | |
| 681 | 670 | MCFG_GFXDECODE(bw12) |
| 682 | | MCFG_PALETTE_LENGTH(2) |
| 683 | | MCFG_PALETTE_INIT(monochrome_amber) |
| 684 | 671 | |
| 685 | 672 | MCFG_MC6845_ADD(MC6845_TAG, MC6845, XTAL_16MHz/8, bw12_mc6845_interface) |
| 686 | 673 | |
| r18990 | r18991 | |
| 704 | 691 | |
| 705 | 692 | static MACHINE_CONFIG_DERIVED( bw12, common ) |
| 706 | 693 | /* floppy drives */ |
| 707 | | MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":0", bw12_floppies, "525ssdd", 0, bw12_floppy_formats) |
| 708 | | MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":1", bw12_floppies, "525ssdd", 0, bw12_floppy_formats) |
| 694 | MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":0", bw12_floppies, "525dd", 0, bw12_floppy_formats) |
| 695 | MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":1", bw12_floppies, "525dd", 0, bw12_floppy_formats) |
| 709 | 696 | |
| 710 | 697 | // software lists |
| 711 | 698 | MCFG_SOFTWARE_LIST_ADD("flop_list", "bw12") |
| r18990 | r18991 | |
| 717 | 704 | |
| 718 | 705 | static MACHINE_CONFIG_DERIVED( bw14, common ) |
| 719 | 706 | /* floppy drives */ |
| 720 | | MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":0", bw14_floppies, "525hd", 0, bw14_floppy_formats) |
| 721 | | MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":1", bw14_floppies, "525hd", 0, bw14_floppy_formats) |
| 707 | MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":0", bw14_floppies, "525dd", 0, bw14_floppy_formats) |
| 708 | MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":1", bw14_floppies, "525dd", 0, bw14_floppy_formats) |
| 722 | 709 | |
| 723 | 710 | /* internal ram */ |
| 724 | 711 | MCFG_RAM_ADD(RAM_TAG) |