trunk/src/mess/drivers/unixpc.c
| r30655 | r30656 | |
| 13 | 13 | #include "emu.h" |
| 14 | 14 | #include "cpu/m68000/m68000.h" |
| 15 | 15 | #include "machine/ram.h" |
| 16 | | #include "machine/wd17xx.h" |
| 17 | | #include "imagedev/flopdrv.h" |
| 16 | #include "machine/wd_fdc.h" |
| 18 | 17 | #include "unixpc.lh" |
| 19 | 18 | |
| 20 | 19 | |
| r30655 | r30656 | |
| 30 | 29 | m_maincpu(*this, "maincpu"), |
| 31 | 30 | m_ram(*this, RAM_TAG), |
| 32 | 31 | m_wd2797(*this, "wd2797"), |
| 33 | | m_floppy(*this, FLOPPY_0), |
| 32 | m_floppy(*this, "wd2797:0:525dd"), |
| 34 | 33 | m_mapram(*this, "mapram"), |
| 35 | 34 | m_videoram(*this, "videoram"){ } |
| 36 | 35 | |
| 37 | 36 | required_device<cpu_device> m_maincpu; |
| 38 | 37 | required_device<ram_device> m_ram; |
| 39 | | required_device<wd2797_device> m_wd2797; |
| 40 | | required_device<legacy_floppy_image_device> m_floppy; |
| 38 | required_device<wd2797_t> m_wd2797; |
| 39 | required_device<floppy_image_device> m_floppy; |
| 41 | 40 | |
| 42 | 41 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 43 | 42 | |
| r30655 | r30656 | |
| 117 | 116 | { |
| 118 | 117 | logerror("disk_control_w: %04x\n", data); |
| 119 | 118 | |
| 120 | | m_floppy->floppy_mon_w(!BIT(data, 5)); |
| 119 | m_floppy->mon_w(!BIT(data, 5)); |
| 121 | 120 | |
| 122 | 121 | // bit 6 = floppy selected / not selected |
| 123 | | m_wd2797->set_drive(0); |
| 122 | if (BIT(data, 6)) |
| 123 | m_wd2797->set_floppy(m_floppy); |
| 124 | else |
| 125 | m_wd2797->set_floppy(NULL); |
| 124 | 126 | } |
| 125 | 127 | |
| 126 | 128 | WRITE_LINE_MEMBER( unixpc_state::wd2797_intrq_w ) |
| r30655 | r30656 | |
| 161 | 163 | AM_RANGE(0x4a0000, 0x4a0001) AM_WRITE(misc_control_w) |
| 162 | 164 | AM_RANGE(0x4e0000, 0x4e0001) AM_WRITE(disk_control_w) |
| 163 | 165 | AM_RANGE(0x800000, 0xbfffff) AM_MIRROR(0x7fc000) AM_ROM AM_REGION("bootrom", 0) |
| 164 | | AM_RANGE(0xe10000, 0xe10007) AM_DEVREADWRITE8("wd2797", wd2797_device, read, write, 0x00ff) |
| 166 | AM_RANGE(0xe10000, 0xe10007) AM_DEVREADWRITE8("wd2797", wd_fdc_t, read, write, 0x00ff) |
| 165 | 167 | AM_RANGE(0xe43000, 0xe43001) AM_WRITE(romlmap_w) |
| 166 | 168 | ADDRESS_MAP_END |
| 167 | 169 | |
| r30655 | r30656 | |
| 178 | 180 | MACHINE DRIVERS |
| 179 | 181 | ***************************************************************************/ |
| 180 | 182 | |
| 181 | | static const floppy_interface unixpc_floppy_interface = |
| 182 | | { |
| 183 | | FLOPPY_STANDARD_5_25_DSDD, |
| 184 | | LEGACY_FLOPPY_OPTIONS_NAME(default), |
| 185 | | NULL |
| 186 | | }; |
| 183 | static SLOT_INTERFACE_START( unixpc_floppies ) |
| 184 | SLOT_INTERFACE( "525dd", FLOPPY_525_DD ) |
| 185 | SLOT_INTERFACE_END |
| 187 | 186 | |
| 188 | 187 | static MACHINE_CONFIG_START( unixpc, unixpc_state ) |
| 189 | 188 | // basic machine hardware |
| r30655 | r30656 | |
| 207 | 206 | MCFG_RAM_EXTRA_OPTIONS("2M") |
| 208 | 207 | |
| 209 | 208 | // floppy |
| 210 | | MCFG_DEVICE_ADD("wd2797", WD2797, 0) |
| 211 | | MCFG_WD17XX_DEFAULT_DRIVE1_TAGS |
| 212 | | MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(unixpc_state, wd2797_intrq_w)) |
| 213 | | MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(unixpc_state, wd2797_drq_w)) |
| 214 | | |
| 215 | | MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, unixpc_floppy_interface) |
| 209 | MCFG_DEVICE_ADD("wd2797", WD2797x, 1000000) |
| 210 | MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(unixpc_state, wd2797_intrq_w)) |
| 211 | MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(unixpc_state, wd2797_drq_w)) |
| 212 | MCFG_FLOPPY_DRIVE_ADD("wd2797:0", unixpc_floppies, "525dd", floppy_image_device::default_floppy_formats) |
| 216 | 213 | MACHINE_CONFIG_END |
| 217 | 214 | |
| 218 | 215 | |