trunk/src/mess/machine/sa1403d.c
| r0 | r19154 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | Shugart SA1403D Winchester Disk Controller emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | #include "sa1403d.h" |
| 11 | |
| 12 | |
| 13 | |
| 14 | //************************************************************************** |
| 15 | // DEVICE DEFINITIONS |
| 16 | //************************************************************************** |
| 17 | |
| 18 | const device_type SA1403D = &device_creator<sa1403d_device>; |
| 19 | |
| 20 | |
| 21 | //------------------------------------------------- |
| 22 | // ROM( sa1403d ) |
| 23 | //------------------------------------------------- |
| 24 | |
| 25 | ROM_START( sa1403d ) |
| 26 | ROM_REGION( 0x4000, "sa1403d", 0 ) |
| 27 | ROM_DEFAULT_BIOS( "as31" ) |
| 28 | ROM_SYSTEM_BIOS( 0, "as30", "AS30" ) |
| 29 | ROMX_LOAD( "i", 0x0000, 0x1000, NO_DUMP, ROM_BIOS(1) ) |
| 30 | ROMX_LOAD( "ii", 0x1000, 0x1000, NO_DUMP, ROM_BIOS(1) ) |
| 31 | ROMX_LOAD( "iii", 0x2000, 0x1000, NO_DUMP, ROM_BIOS(1) ) |
| 32 | ROMX_LOAD( "iv", 0x3000, 0x1000, NO_DUMP, ROM_BIOS(1) ) |
| 33 | ROM_SYSTEM_BIOS( 1, "as31", "AS31" ) |
| 34 | ROMX_LOAD( "i", 0x0000, 0x1000, NO_DUMP, ROM_BIOS(2) ) |
| 35 | ROMX_LOAD( "ii", 0x1000, 0x1000, NO_DUMP, ROM_BIOS(2) ) |
| 36 | ROMX_LOAD( "iii", 0x2000, 0x1000, NO_DUMP, ROM_BIOS(2) ) |
| 37 | ROMX_LOAD( "iv", 0x3000, 0x1000, NO_DUMP, ROM_BIOS(2) ) |
| 38 | ROM_SYSTEM_BIOS( 2, "u50", "Diagnostic PROM set 12668" ) |
| 39 | ROMX_LOAD( "i", 0x0000, 0x1000, NO_DUMP, ROM_BIOS(3) ) |
| 40 | ROMX_LOAD( "ii", 0x1000, 0x1000, NO_DUMP, ROM_BIOS(3) ) |
| 41 | ROMX_LOAD( "iii", 0x2000, 0x1000, NO_DUMP, ROM_BIOS(3) ) |
| 42 | ROMX_LOAD( "iv", 0x3000, 0x1000, NO_DUMP, ROM_BIOS(3) ) |
| 43 | ROM_END |
| 44 | |
| 45 | |
| 46 | //------------------------------------------------- |
| 47 | // rom_region - device-specific ROM region |
| 48 | //------------------------------------------------- |
| 49 | |
| 50 | const rom_entry *sa1403d_device::device_rom_region() const |
| 51 | { |
| 52 | return ROM_NAME( sa1403d ); |
| 53 | } |
| 54 | |
| 55 | |
| 56 | //------------------------------------------------- |
| 57 | // MACHINE_DRIVER( sa1403d ) |
| 58 | //------------------------------------------------- |
| 59 | |
| 60 | static MACHINE_CONFIG_FRAGMENT( sa1403d ) |
| 61 | MCFG_HARDDISK_ADD("image") |
| 62 | MACHINE_CONFIG_END |
| 63 | |
| 64 | |
| 65 | //------------------------------------------------- |
| 66 | // machine_config_additions - device-specific |
| 67 | // machine configurations |
| 68 | //------------------------------------------------- |
| 69 | |
| 70 | machine_config_constructor sa1403d_device::device_mconfig_additions() const |
| 71 | { |
| 72 | return MACHINE_CONFIG_NAME( sa1403d ); |
| 73 | } |
| 74 | |
| 75 | |
| 76 | //------------------------------------------------- |
| 77 | // INPUT_PORTS( sa1403d ) |
| 78 | //------------------------------------------------- |
| 79 | |
| 80 | INPUT_PORTS_START( sa1403d ) |
| 81 | PORT_START("2H") |
| 82 | PORT_DIPNAME( 0xc0, 0x40, "LUN 0 Drive Type" ) PORT_DIPLOCATION("2H:7,8") |
| 83 | PORT_DIPSETTING( 0x00, "SA1002" ) // 2 heads, 256 cylinders |
| 84 | PORT_DIPSETTING( 0x40, "SA1004" ) // 4 heads, 256 cylinders |
| 85 | PORT_DIPSETTING( 0x80, "SA800" ) // 1 head, 77 cylinders |
| 86 | PORT_DIPSETTING( 0xc0, "SA850" ) // 2 heads, 77 cylinders |
| 87 | PORT_DIPNAME( 0x30, 0x30, "LUN 1 Drive Type" ) PORT_DIPLOCATION("2H:5,6") |
| 88 | PORT_DIPSETTING( 0x00, "SA1002" ) |
| 89 | PORT_DIPSETTING( 0x10, "SA1004" ) |
| 90 | PORT_DIPSETTING( 0x20, "SA800" ) |
| 91 | PORT_DIPSETTING( 0x30, "SA850" ) |
| 92 | PORT_DIPNAME( 0x0c, 0x0c, "LUN 2 Drive Type" ) PORT_DIPLOCATION("2H:3,4") |
| 93 | PORT_DIPSETTING( 0x00, "SA1002" ) |
| 94 | PORT_DIPSETTING( 0x04, "SA1004" ) |
| 95 | PORT_DIPSETTING( 0x08, "SA800" ) |
| 96 | PORT_DIPSETTING( 0x0c, "SA850" ) |
| 97 | PORT_DIPNAME( 0x03, 0x03, "LUN 3 Drive Type" ) PORT_DIPLOCATION("2H:1,2") |
| 98 | PORT_DIPSETTING( 0x00, "SA1002" ) |
| 99 | PORT_DIPSETTING( 0x01, "SA1004" ) |
| 100 | PORT_DIPSETTING( 0x02, "SA800" ) |
| 101 | PORT_DIPSETTING( 0x03, "SA850" ) |
| 102 | INPUT_PORTS_END |
| 103 | |
| 104 | |
| 105 | //------------------------------------------------- |
| 106 | // input_ports - device-specific input ports |
| 107 | //------------------------------------------------- |
| 108 | |
| 109 | ioport_constructor sa1403d_device::device_input_ports() const |
| 110 | { |
| 111 | return INPUT_PORTS_NAME( sa1403d ); |
| 112 | } |
| 113 | |
| 114 | |
| 115 | |
| 116 | //************************************************************************** |
| 117 | // LIVE DEVICE |
| 118 | //************************************************************************** |
| 119 | |
| 120 | //------------------------------------------------- |
| 121 | // sa1403d_device - constructor |
| 122 | //------------------------------------------------- |
| 123 | |
| 124 | sa1403d_device::sa1403d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 125 | : scsihd_device(mconfig, SA1403D, "Shugart SA1403D", tag, owner, clock) |
| 126 | { |
| 127 | } |
| 128 | |
| 129 | void sa1403d_device::ExecCommand( int *transferLength ) |
| 130 | { |
| 131 | switch( command[ 0 ] ) |
| 132 | { |
| 133 | default: |
| 134 | scsihd_device::ExecCommand( transferLength ); |
| 135 | break; |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | void sa1403d_device::WriteData( UINT8 *data, int dataLength ) |
| 140 | { |
| 141 | switch( command[ 0 ] ) |
| 142 | { |
| 143 | default: |
| 144 | scsihd_device::WriteData( data, dataLength ); |
| 145 | break; |
| 146 | } |
| 147 | } |