trunk/src/emu/imagedev/floppy.c
r17443 | r17444 | |
17 | 17 | const device_type FLOPPY_35_HD = &device_creator<floppy_35_hd>; |
18 | 18 | const device_type FLOPPY_35_ED = &device_creator<floppy_35_ed>; |
19 | 19 | const device_type FLOPPY_525_DD = &device_creator<floppy_525_dd>; |
| 20 | const device_type FLOPPY_525_HD = &device_creator<floppy_525_hd>; |
20 | 21 | |
21 | 22 | floppy_connector::floppy_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
22 | 23 | device_t(mconfig, FLOPPY_CONNECTOR, "Floppy drive connector abstraction", tag, owner, clock), |
r17443 | r17444 | |
884 | 885 | variants[var_count++] = floppy_image::SSSD; |
885 | 886 | variants[var_count++] = floppy_image::SSDD; |
886 | 887 | } |
| 888 | |
| 889 | floppy_525_hd::floppy_525_hd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 890 | floppy_image_device(mconfig, FLOPPY_525_HD, "5.25\" high density floppy drive", tag, owner, clock) |
| 891 | { |
| 892 | } |
| 893 | |
| 894 | floppy_525_hd::~floppy_525_hd() |
| 895 | { |
| 896 | } |
| 897 | |
| 898 | void floppy_525_hd::setup_characteristics() |
| 899 | { |
| 900 | form_factor = floppy_image::FF_525; |
| 901 | tracks = 82; |
| 902 | sides = 2; |
| 903 | set_rpm(300); |
| 904 | } |
| 905 | |
| 906 | void floppy_525_hd::handled_variants(UINT32 *variants, int &var_count) const |
| 907 | { |
| 908 | var_count = 0; |
| 909 | variants[var_count++] = floppy_image::SSSD; |
| 910 | variants[var_count++] = floppy_image::SSDD; |
| 911 | variants[var_count++] = floppy_image::DSDD; |
| 912 | variants[var_count++] = floppy_image::DSHD; |
| 913 | |
| 914 | } |
trunk/src/mess/drivers/ht68k.c
r17443 | r17444 | |
26 | 26 | #include "emu.h" |
27 | 27 | #include "cpu/m68000/m68000.h" |
28 | 28 | #include "machine/68681.h" |
| 29 | #include "formats/hxcmfm_dsk.h" |
| 30 | #include "formats/mfi_dsk.h" |
29 | 31 | #include "imagedev/flopdrv.h" |
30 | | #include "machine/wd17xx.h" |
| 32 | #include "machine/wd1772.h" |
31 | 33 | #include "machine/terminal.h" |
32 | 34 | |
33 | 35 | |
r17443 | r17444 | |
43 | 45 | , |
44 | 46 | m_p_ram(*this, "p_ram"){ } |
45 | 47 | |
| 48 | |
| 49 | static const floppy_format_type floppy_formats[]; |
| 50 | |
46 | 51 | required_device<cpu_device> m_maincpu; |
47 | 52 | required_device<generic_terminal_device> m_terminal; |
48 | 53 | required_device<device_t> m_duart; |
49 | | required_device<device_t> m_fdc; |
| 54 | required_device<wd1770_t> m_fdc; |
50 | 55 | DECLARE_WRITE8_MEMBER(kbd_put); |
51 | 56 | DECLARE_WRITE_LINE_MEMBER(ht68k_fdc_intrq_w); |
52 | 57 | required_shared_ptr<UINT16> m_p_ram; |
53 | 58 | }; |
54 | 59 | |
55 | 60 | |
| 61 | const floppy_format_type ht68k_state::floppy_formats[] = { |
| 62 | FLOPPY_MFM_FORMAT, FLOPPY_MFI_FORMAT, |
| 63 | NULL |
| 64 | }; |
56 | 65 | |
| 66 | |
57 | 67 | static ADDRESS_MAP_START(ht68k_mem, AS_PROGRAM, 16, ht68k_state) |
58 | 68 | ADDRESS_MAP_UNMAP_HIGH |
59 | 69 | AM_RANGE(0x00000000, 0x0007ffff) AM_RAM AM_SHARE("p_ram") // 512 KB RAM / ROM at boot |
60 | 70 | //AM_RANGE(0x00080000, 0x000fffff) // Expansion |
61 | 71 | //AM_RANGE(0x00d80000, 0x00d8ffff) // Printer |
62 | | AM_RANGE(0x00e00000, 0x00e00007) AM_MIRROR(0xfff8) AM_DEVREADWRITE8_LEGACY("wd1770", wd17xx_r, wd17xx_w, 0x00ff) // FDC WD1770 |
| 72 | AM_RANGE(0x00e00000, 0x00e00007) AM_MIRROR(0xfff8) AM_DEVREADWRITE8("wd1770", wd177x_t, read, write, 0x00ff) // FDC WD1770 |
63 | 73 | AM_RANGE(0x00e80000, 0x00e800ff) AM_MIRROR(0xff00) AM_DEVREADWRITE8_LEGACY("duart68681", duart68681_r, duart68681_w, 0xff ) |
64 | 74 | AM_RANGE(0x00f00000, 0x00f07fff) AM_ROM AM_MIRROR(0xf8000) AM_REGION("user1",0) |
65 | 75 | ADDRESS_MAP_END |
r17443 | r17444 | |
99 | 109 | { |
100 | 110 | ht68k_state *state = device->machine().driver_data<ht68k_state>(); |
101 | 111 | |
102 | | wd17xx_set_side(state->m_fdc, BIT(data,3) ? 0 : 1); |
103 | | |
104 | | if (BIT(data,7)==0) |
105 | | wd17xx_set_drive(state->m_fdc,0); |
106 | | else |
107 | | if (BIT(data,6)==0) |
108 | | wd17xx_set_drive(state->m_fdc,1); |
109 | | else |
110 | | if (BIT(data,5)==0) |
111 | | wd17xx_set_drive(state->m_fdc,2); |
112 | | else |
113 | | if (BIT(data,4)==0) |
114 | | wd17xx_set_drive(state->m_fdc,3); |
| 112 | static const char *names[] = { "fd0", "fd1", "fd2", "fd3" }; |
| 113 | floppy_image_device *floppy = 0; |
| 114 | for(int i=0; i<4; i++) { |
| 115 | if(BIT(data, 7-i)==0) { |
| 116 | floppy_connector *con = device->machine().device<floppy_connector>(names[i]); |
| 117 | if(con) |
| 118 | floppy = con->get_device(); |
| 119 | break; |
| 120 | } |
| 121 | } |
| 122 | if (floppy) floppy->ss_w(BIT(data,3) ? 0 : 1); |
| 123 | state->m_fdc->set_floppy(floppy); |
115 | 124 | } |
116 | 125 | |
117 | 126 | WRITE8_MEMBER( ht68k_state::kbd_put ) |
r17443 | r17444 | |
132 | 141 | duart_output |
133 | 142 | }; |
134 | 143 | |
135 | | WRITE_LINE_MEMBER( ht68k_state::ht68k_fdc_intrq_w ) |
136 | | { |
137 | | //cputag_set_input_line_and_vector(machine(), "maincpu", M68K_IRQ_4, HOLD_LINE, M68K_INT_ACK_AUTOVECTOR); |
138 | | } |
| 144 | static SLOT_INTERFACE_START( ht68k_floppies ) |
| 145 | SLOT_INTERFACE( "525hd", FLOPPY_525_HD ) |
| 146 | SLOT_INTERFACE_END |
139 | 147 | |
140 | | static const wd17xx_interface ht68k_wd17xx_interface = |
141 | | { |
142 | | DEVCB_NULL, |
143 | | DEVCB_DRIVER_LINE_MEMBER(ht68k_state, ht68k_fdc_intrq_w), |
144 | | DEVCB_NULL, |
145 | | {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} |
146 | | }; |
147 | 148 | |
148 | | static const floppy_interface ht68k_floppy_interface = |
149 | | { |
150 | | DEVCB_NULL, |
151 | | DEVCB_NULL, |
152 | | DEVCB_NULL, |
153 | | DEVCB_NULL, |
154 | | DEVCB_NULL, |
155 | | FLOPPY_STANDARD_5_25_DSHD, |
156 | | LEGACY_FLOPPY_OPTIONS_NAME(default), |
157 | | NULL, |
158 | | NULL |
159 | | }; |
160 | | |
161 | 149 | static MACHINE_CONFIG_START( ht68k, ht68k_state ) |
162 | 150 | /* basic machine hardware */ |
163 | 151 | MCFG_CPU_ADD("maincpu",M68000, XTAL_8MHz) |
r17443 | r17444 | |
169 | 157 | MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, terminal_intf) |
170 | 158 | |
171 | 159 | MCFG_DUART68681_ADD( "duart68681", XTAL_8MHz / 2, ht68k_duart68681_config ) |
172 | | MCFG_WD1770_ADD("wd1770", ht68k_wd17xx_interface ) |
173 | | MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(ht68k_floppy_interface) |
| 160 | |
| 161 | MCFG_WD1770x_ADD("wd1770", XTAL_8MHz ) |
| 162 | |
| 163 | MCFG_FLOPPY_DRIVE_ADD("fd0", ht68k_floppies, "525hd", 0, ht68k_state::floppy_formats) |
| 164 | MCFG_FLOPPY_DRIVE_ADD("fd1", ht68k_floppies, "525hd", 0, ht68k_state::floppy_formats) |
| 165 | MCFG_FLOPPY_DRIVE_ADD("fd2", ht68k_floppies, "525hd", 0, ht68k_state::floppy_formats) |
| 166 | MCFG_FLOPPY_DRIVE_ADD("fd3", ht68k_floppies, "525hd", 0, ht68k_state::floppy_formats) |
174 | 167 | MACHINE_CONFIG_END |
175 | 168 | |
176 | 169 | /* ROM definition */ |