src/mame/drivers/viper.c
| r14399 | r14400 | |
| 2004 | 2004 | MCFG_PCI_BUS_DEVICE(0, "mpc8240", mpc8240_pci_r, mpc8240_pci_w) |
| 2005 | 2005 | MCFG_PCI_BUS_DEVICE(12, "voodoo", voodoo3_pci_r, voodoo3_pci_w) |
| 2006 | 2006 | |
| 2007 | | MCFG_IDE_CONTROLLER_ADD("ide", ide_interrupt) |
| 2007 | MCFG_IDE_CONTROLLER_ADD("ide", ide_interrupt, ide_devices, "hdd", NULL) |
| 2008 | 2008 | MCFG_3DFX_VOODOO_3_ADD("voodoo", STD_VOODOO_3_CLOCK, 8, "screen") |
| 2009 | 2009 | MCFG_3DFX_VOODOO_CPU("maincpu") |
| 2010 | 2010 | MCFG_3DFX_VOODOO_VBLANK(voodoo_vblank) |
| r14399 | r14400 | |
| 2071 | 2071 | |
| 2072 | 2072 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2073 | 2073 | |
| 2074 | | DISK_REGION( "ide" ) |
| 2074 | DISK_REGION( "drive_0" ) |
| 2075 | 2075 | DISK_IMAGE( "ppp2nd", 0, SHA1(b8b90483d515c83eac05ffa617af19612ea990b0)) |
| 2076 | 2076 | ROM_END |
| 2077 | 2077 | |
| r14399 | r14400 | |
| 2082 | 2082 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2083 | 2083 | ROM_LOAD("a45jaa_nvram.u39", 0x00000, 0x2000, CRC(c24e29fc) SHA1(efb6ecaf25cbdf9d8dfcafa85e38a195fa5ff6c4)) |
| 2084 | 2084 | |
| 2085 | | DISK_REGION( "ide" ) |
| 2085 | DISK_REGION( "drive_0" ) |
| 2086 | 2086 | DISK_IMAGE( "a45a02", 0, SHA1(9af2481f53de705ae48fad08d8dd26553667c2d0) ) |
| 2087 | 2087 | ROM_END |
| 2088 | 2088 | |
| r14399 | r14400 | |
| 2092 | 2092 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2093 | 2093 | ROM_LOAD("nvram.u39", 0x00000, 0x2000, NO_DUMP ) |
| 2094 | 2094 | |
| 2095 | | DISK_REGION( "ide" ) |
| 2095 | DISK_REGION( "drive_0" ) |
| 2096 | 2096 | DISK_IMAGE( "922d02", 0, SHA1(01f35e324c9e8567da0f51b3e68fff1562c32116) ) |
| 2097 | 2097 | ROM_END |
| 2098 | 2098 | |
| r14399 | r14400 | |
| 2102 | 2102 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2103 | 2103 | ROM_LOAD("nvram.u39", 0x00000, 0x2000, NO_DUMP ) |
| 2104 | 2104 | |
| 2105 | | DISK_REGION( "ide" ) |
| 2105 | DISK_REGION( "drive_0" ) |
| 2106 | 2106 | DISK_IMAGE( "922b02", 0, SHA1(4d288b5dcfab3678af662783e7083a358eee99ce) ) |
| 2107 | 2107 | ROM_END |
| 2108 | 2108 | |
| r14399 | r14400 | |
| 2113 | 2113 | ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(d0604e84) SHA1(18d1183f1331af3e655a56692eb7ab877b4bc239)) //old dump, probably has non-default settings. |
| 2114 | 2114 | ROM_LOAD("941jab_nvram.u39", 0x00000, 0x2000, CRC(6c4a852f) SHA1(2753dda42cdd81af22dc6780678f1ddeb3c62013)) |
| 2115 | 2115 | |
| 2116 | | DISK_REGION( "ide" ) |
| 2116 | DISK_REGION( "drive_0" ) |
| 2117 | 2117 | DISK_IMAGE( "941b02", 0, SHA1(943bc9b1ea7273a8382b94c8a75010dfe296df14) ) |
| 2118 | 2118 | ROM_END |
| 2119 | 2119 | |
| r14399 | r14400 | |
| 2123 | 2123 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2124 | 2124 | ROM_LOAD("941eaa_nvram.u39", 0x00000, 0x2000, CRC(5ee7004d) SHA1(92e0ce01049308f459985d466fbfcfac82f34a47)) |
| 2125 | 2125 | |
| 2126 | | DISK_REGION( "ide" ) |
| 2126 | DISK_REGION( "drive_0" ) |
| 2127 | 2127 | DISK_IMAGE( "941a02", 0, NO_DUMP ) |
| 2128 | 2128 | ROM_END |
| 2129 | 2129 | |
| r14399 | r14400 | |
| 2133 | 2133 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2134 | 2134 | ROM_LOAD("b41ebc_nvram.u39", 0x00000, 0x2000, CRC(55d1681d) SHA1(26868cf0d14f23f06b81f2df0b4186924439bb43)) |
| 2135 | 2135 | |
| 2136 | | DISK_REGION( "ide" ) |
| 2136 | DISK_REGION( "drive_0" ) |
| 2137 | 2137 | DISK_IMAGE( "b41c02", 0, SHA1(fb6b0b43a6f818041d644bcd711f6a727348d3aa) ) |
| 2138 | 2138 | ROM_END |
| 2139 | 2139 | |
| r14399 | r14400 | |
| 2144 | 2144 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2145 | 2145 | ROM_LOAD("b33uaa_nvram.u39", 0x00000, 0x1ff8, BAD_DUMP CRC(0f0ba988) SHA1(5618c03b21fc2ba14b2e159cee3aab7f53c2c34d)) //data looks plain bad (compared to the other games) |
| 2146 | 2146 | |
| 2147 | | DISK_REGION( "ide" ) |
| 2147 | DISK_REGION( "drive_0" ) |
| 2148 | 2148 | DISK_IMAGE( "b33a02", 0, SHA1(819d8fac5d2411542c1b989105cffe38a5545fc2) ) |
| 2149 | 2149 | ROM_END |
| 2150 | 2150 | |
| r14399 | r14400 | |
| 2154 | 2154 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2155 | 2155 | ROM_LOAD("a29aaa_nvram.u39", 0x000000, 0x2000, CRC(14b9fe68) SHA1(3c59e6df1bb46bc1835c13fd182b1bb092c08759)) //supposed to be aab version? |
| 2156 | 2156 | |
| 2157 | | DISK_REGION( "ide" ) |
| 2157 | DISK_REGION( "drive_0" ) |
| 2158 | 2158 | DISK_IMAGE( "a29b02", 0, SHA1(f0c04310caf2cca804fde20805eb30a44c5a6796) ) //missing bootloader |
| 2159 | 2159 | ROM_END |
| 2160 | 2160 | |
| r14399 | r14400 | |
| 2164 | 2164 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2165 | 2165 | ROM_LOAD("a29jaa_nvram.u39", 0x000000, 0x2000, CRC(2f7cdf27) SHA1(0b69d8728be12909e235268268a312982f81d46a)) |
| 2166 | 2166 | |
| 2167 | | DISK_REGION( "ide" ) |
| 2167 | DISK_REGION( "drive_0" ) |
| 2168 | 2168 | DISK_IMAGE( "a29a02", 0, SHA1(00afad399737652b3e17257c70a19f62e37f3c97) ) |
| 2169 | 2169 | ROM_END |
| 2170 | 2170 | |
| r14399 | r14400 | |
| 2174 | 2174 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2175 | 2175 | ROM_LOAD("a00uad_nvram.u39", 0x000000, 0x2000, CRC(cca056ca) SHA1(de1a00d84c1311d48bbe6d24f5b36e22ecf5e85a)) |
| 2176 | 2176 | |
| 2177 | | DISK_REGION( "ide" ) |
| 2177 | DISK_REGION( "drive_0" ) |
| 2178 | 2178 | DISK_IMAGE( "a00uad02", 0, SHA1(6acb8dc41920e7025b87034a3a62b185ef0109d9) ) |
| 2179 | 2179 | ROM_END |
| 2180 | 2180 | |
| r14399 | r14400 | |
| 2184 | 2184 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2185 | 2185 | ROM_LOAD("a00uac_nvram.u39", 0x000000, 0x2000, NO_DUMP ) |
| 2186 | 2186 | |
| 2187 | | DISK_REGION( "ide" ) |
| 2187 | DISK_REGION( "drive_0" ) |
| 2188 | 2188 | DISK_IMAGE( "a00uac02", 0, SHA1(b268789416dbf8886118a634b911f0ee254970de) ) |
| 2189 | 2189 | ROM_END |
| 2190 | 2190 | |
| r14399 | r14400 | |
| 2194 | 2194 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2195 | 2195 | ROM_LOAD("a00kac_nvram.u39", 0x000000, 0x2000, CRC(8ddc921c) SHA1(901538da237679fc74966a301278b36d1335671f) ) |
| 2196 | 2196 | |
| 2197 | | DISK_REGION( "ide" ) |
| 2197 | DISK_REGION( "drive_0" ) |
| 2198 | 2198 | DISK_IMAGE( "a00kac02", 0, SHA1(b268789416dbf8886118a634b911f0ee254970de) ) |
| 2199 | 2199 | ROM_END |
| 2200 | 2200 | |
| r14399 | r14400 | |
| 2204 | 2204 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2205 | 2205 | ROM_LOAD("a00eaa_nvram.u39", 0x000000, 0x2000, CRC(4f3497b6) SHA1(3045c54f98dff92cdf3a1fc0cd4c76ba82d632d7) ) |
| 2206 | 2206 | |
| 2207 | | DISK_REGION( "ide" ) |
| 2207 | DISK_REGION( "drive_0" ) |
| 2208 | 2208 | DISK_IMAGE( "a00eaa02", 0, SHA1(81565a2dce2e2b0a7927078a784354948af1f87c) ) |
| 2209 | 2209 | ROM_END |
| 2210 | 2210 | |
| r14399 | r14400 | |
| 2214 | 2214 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2215 | 2215 | ROM_LOAD("a00jaa_nvram.u39", 0x000000, 0x2000, CRC(9ecf70dc) SHA1(4769a99b0cc28563e219860b8d480f32d1e21f60)) |
| 2216 | 2216 | |
| 2217 | | DISK_REGION( "ide" ) |
| 2217 | DISK_REGION( "drive_0" ) |
| 2218 | 2218 | DISK_IMAGE( "a00jac02", 0, SHA1(d962d3a8ea84c380767d0fe336296911c289c224) ) |
| 2219 | 2219 | ROM_END |
| 2220 | 2220 | |
| r14399 | r14400 | |
| 2224 | 2224 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2225 | 2225 | ROM_LOAD("nvram.u39", 0x000000, 0x2000, NO_DUMP ) |
| 2226 | 2226 | |
| 2227 | | DISK_REGION( "ide" ) |
| 2227 | DISK_REGION( "drive_0" ) |
| 2228 | 2228 | DISK_IMAGE( "b11a02", 0, SHA1(57665664321b78c1913d01f0d2c0b8d3efd42e04) ) |
| 2229 | 2229 | ROM_END |
| 2230 | 2230 | |
| r14399 | r14400 | |
| 2234 | 2234 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2235 | 2235 | ROM_LOAD("nvram.u39", 0x000000, 0x2000, NO_DUMP ) |
| 2236 | 2236 | |
| 2237 | | DISK_REGION( "ide" ) |
| 2237 | DISK_REGION( "drive_0" ) |
| 2238 | 2238 | DISK_IMAGE( "c00jab", 0, BAD_DUMP SHA1(3763aaded9b45388a664edd84a3f7f8ff4101be4) ) |
| 2239 | 2239 | ROM_END |
| 2240 | 2240 | |
| r14399 | r14400 | |
| 2244 | 2244 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2245 | 2245 | ROM_LOAD("a13uaa_nvram.u39", 0x000000, 0x2000, CRC(7b0e1ac8) SHA1(1ea549964539e27f87370e9986bfa44eeed037cd)) |
| 2246 | 2246 | |
| 2247 | | DISK_REGION( "ide" ) |
| 2247 | DISK_REGION( "drive_0" ) |
| 2248 | 2248 | DISK_IMAGE( "a13c02", 0, SHA1(d740784fa51a3f43695ea95e23f92ef05f43284a) ) |
| 2249 | 2249 | ROM_END |
| 2250 | 2250 | |
| r14399 | r14400 | |
| 2256 | 2256 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2257 | 2257 | ROM_LOAD("nvram.u39", 0x000000, 0x2000, CRC(2f325c55) SHA1(0bc44f40f981a815c8ce64eae95ae55db510c565)) |
| 2258 | 2258 | |
| 2259 | | DISK_REGION( "ide" ) |
| 2259 | DISK_REGION( "drive_0" ) |
| 2260 | 2260 | DISK_IMAGE( "a13b02", 0, SHA1(c25a61b76d365794c2da4a9e7de88a5519e944ec) ) |
| 2261 | 2261 | ROM_END |
| 2262 | 2262 | |
| r14399 | r14400 | |
| 2267 | 2267 | ROM_LOAD("a41ebb_nvram.u39", 0x00000, 0x2000, CRC(22f59ac0) SHA1(e14ea2ba95b72edf0a3331ab82c192760bfdbce3)) |
| 2268 | 2268 | // a41eba_nvram == a41ebb_nvram |
| 2269 | 2269 | |
| 2270 | | DISK_REGION( "ide" ) |
| 2270 | DISK_REGION( "drive_0" ) |
| 2271 | 2271 | DISK_IMAGE( "a41b02", 0, SHA1(0426f4bb9001cf457f44e2c22e3d7575b8049aa3) ) |
| 2272 | 2272 | ROM_END |
| 2273 | 2273 | |
| r14399 | r14400 | |
| 2277 | 2277 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2278 | 2278 | ROM_LOAD("a41aaa_nvram.u39", 0x00000, 0x2000, CRC(d5de9b8e) SHA1(768bcd46a6ad20948f60f5e0ecd2f7b9c2901061)) |
| 2279 | 2279 | |
| 2280 | | DISK_REGION( "ide" ) |
| 2280 | DISK_REGION( "drive_0" ) |
| 2281 | 2281 | DISK_IMAGE( "a41a02", 0, SHA1(bbb71e23bddfa07dfa30b6565a35befd82b055b8) ) |
| 2282 | 2282 | ROM_END |
| 2283 | 2283 | |
| r14399 | r14400 | |
| 2288 | 2288 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2289 | 2289 | ROM_LOAD("941eaa_nvram.u39", 0x00000, 0x2000, NO_DUMP ) |
| 2290 | 2290 | |
| 2291 | | DISK_REGION( "ide" ) |
| 2291 | DISK_REGION( "drive_0" ) |
| 2292 | 2292 | DISK_IMAGE( "a41c02", 0, SHA1(ab3020e8709768c0fd2467573e92b679a05944e5) ) |
| 2293 | 2293 | ROM_END |
| 2294 | 2294 | |
| r14399 | r14400 | |
| 2298 | 2298 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2299 | 2299 | ROM_LOAD("a30eab_nvram.u39", 0x00000, 0x2000, CRC(c123342c) SHA1(55416767608fe0311a362854a16b214b04435a31)) |
| 2300 | 2300 | |
| 2301 | | DISK_REGION( "ide" ) |
| 2301 | DISK_REGION( "drive_0" ) |
| 2302 | 2302 | DISK_IMAGE( "a30b02", 0, SHA1(d2be83b7323c365ba445de7697c3fb8eb83d0212) ) |
| 2303 | 2303 | ROM_END |
| 2304 | 2304 | |
| r14399 | r14400 | |
| 2308 | 2308 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2309 | 2309 | ROM_LOAD("a30jac_nvram.u39", 0x00000, 0x2000, NO_DUMP ) |
| 2310 | 2310 | |
| 2311 | | DISK_REGION( "ide" ) |
| 2311 | DISK_REGION( "drive_0" ) |
| 2312 | 2312 | DISK_IMAGE( "a30c02", 0, SHA1(533b5669b00884a800df9ba29651777a76559862) ) |
| 2313 | 2313 | ROM_END |
| 2314 | 2314 | |
| r14399 | r14400 | |
| 2319 | 2319 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2320 | 2320 | ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(4f8b5858) SHA1(68066241c6f9db7f45e55b3c5da101987f4ce53c)) |
| 2321 | 2321 | |
| 2322 | | DISK_REGION( "ide" ) |
| 2322 | DISK_REGION( "drive_0" ) |
| 2323 | 2323 | DISK_IMAGE( "c22d02", 0, BAD_DUMP SHA1(85d2a8b5ec4cfd932190486cad991f0c180ca6b3) ) |
| 2324 | 2324 | ROM_END |
| 2325 | 2325 | |
| r14399 | r14400 | |
| 2329 | 2329 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2330 | 2330 | ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(ebd4d645) SHA1(2fa7e2c6b113214f3eb1900c8ceef4d5fcf0bb76)) |
| 2331 | 2331 | |
| 2332 | | DISK_REGION( "ide" ) |
| 2332 | DISK_REGION( "drive_0" ) |
| 2333 | 2333 | DISK_IMAGE( "c22c02", 0, BAD_DUMP SHA1(8bd1dfbf926ad5b28fa7dafd7e31c475325ec569) ) |
| 2334 | 2334 | ROM_END |
| 2335 | 2335 | |
| r14399 | r14400 | |
| 2339 | 2339 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2340 | 2340 | ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(bd8a6640) SHA1(2d409197ef3fb07d984d27fa943f29c7a711d715)) |
| 2341 | 2341 | |
| 2342 | | DISK_REGION( "ide" ) |
| 2342 | DISK_REGION( "drive_0" ) |
| 2343 | 2343 | DISK_IMAGE( "c22a02", 0, BAD_DUMP SHA1(b607fb2ddfd0bd552b7a736cea4ac1aa3ea021bd) ) |
| 2344 | 2344 | ROM_END |
| 2345 | 2345 | |
| r14399 | r14400 | |
| 2349 | 2349 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2350 | 2350 | ROM_LOAD("b4xjab_nvram.u39", 0x00000, 0x2000, CRC(33708a93) SHA1(715968e3c9c15edf628fa6ac655dc0864e336c6c)) |
| 2351 | 2351 | |
| 2352 | | DISK_REGION( "ide" ) |
| 2352 | DISK_REGION( "drive_0" ) |
| 2353 | 2353 | DISK_IMAGE( "b4xb02", 0, SHA1(d8d54f3f16b762bf0187fe29b2f8696015c0a940) ) |
| 2354 | 2354 | ROM_END |
| 2355 | 2355 | |
| r14399 | r14400 | |
| 2408 | 2408 | ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(9fb551a5) SHA1(a33d185e186d404c3bf62277d7e34e5ad0000b09)) //likely non-default settings |
| 2409 | 2409 | ROM_LOAD("c09jad_nvram.u39", 0x00000, 0x2000, CRC(33e960b7) SHA1(a9a249e68c89b18d4685f1859fe35dc21df18e14)) |
| 2410 | 2410 | |
| 2411 | | DISK_REGION( "ide" ) |
| 2411 | DISK_REGION( "drive_0" ) |
| 2412 | 2412 | DISK_IMAGE( "c09d04", 0, SHA1(7395b7a33e953f65827aea44461e49f8388464fb) ) |
| 2413 | 2413 | ROM_END |
| 2414 | 2414 | |
| r14399 | r14400 | |
| 2419 | 2419 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| 2420 | 2420 | ROM_LOAD("c09jac_nvram.u39", 0x00000, 0x2000, NO_DUMP ) |
| 2421 | 2421 | |
| 2422 | | DISK_REGION( "ide" ) |
| 2422 | DISK_REGION( "drive_0" ) |
| 2423 | 2423 | DISK_IMAGE( "c09c04", 0, SHA1(bf5f7447d74399d34edd4eb6dfcca7f6fc2154f2) ) |
| 2424 | 2424 | ROM_END |
| 2425 | 2425 | |
src/mame/drivers/djmain.c
| r14399 | r14400 | |
| 1488 | 1488 | MCFG_MACHINE_START(djmain) |
| 1489 | 1489 | MCFG_MACHINE_RESET(djmain) |
| 1490 | 1490 | |
| 1491 | | MCFG_IDE_CONTROLLER_ADD("ide", ide_interrupt) |
| 1491 | MCFG_IDE_CONTROLLER_ADD("ide", ide_interrupt, ide_devices, "hdd", NULL) |
| 1492 | 1492 | |
| 1493 | 1493 | /* video hardware */ |
| 1494 | 1494 | MCFG_SCREEN_ADD("screen", RASTER) |
| r14399 | r14400 | |
| 1544 | 1544 | ROM_LOAD16_BYTE( "753jaa09.25d", 0x100000, 0x80000, CRC(B50C3DBB) SHA1(6022ea249aad0793b2279699e68087b4bc9b4ef1) ) |
| 1545 | 1545 | ROM_LOAD16_BYTE( "753jaa10.27d", 0x100001, 0x80000, CRC(391F4BFD) SHA1(791c9889ea3ce639bbfb87934a1cad9aa3c9ccde) ) |
| 1546 | 1546 | |
| 1547 | | DISK_REGION( "ide" ) /* IDE HARD DRIVE */ |
| 1547 | DISK_REGION( "drive_0" ) /* IDE HARD DRIVE */ |
| 1548 | 1548 | DISK_IMAGE( "753jaa11", 0, SHA1(2e70cf31a853322f29f99b6f292c187a2cf33015) ) /* ver 1.00 JA */ |
| 1549 | 1549 | // There is an alternate image |
| 1550 | 1550 | //DISK_IMAGE( "753jaa11", 0, MD5(260c9b72f4a03055e3abad61c6225324) SHA1(2cc3e149744516bf2353a2b47d33bc9d2072b6c4) ) /* ver 1.00 JA */ |
| r14399 | r14400 | |
| 1569 | 1569 | ROM_LOAD16_BYTE( "853jaa09.25d", 0x100000, 0x80000, CRC(8584E21E) SHA1(3d1ca6de00f9ac07bbe7cd1e67093cca7bf484bb) ) |
| 1570 | 1570 | ROM_LOAD16_BYTE( "853jaa10.27d", 0x100001, 0x80000, CRC(9CB92D98) SHA1(6ace4492ba0b5a8f94a9e7b4f7126b31c6254637) ) |
| 1571 | 1571 | |
| 1572 | | DISK_REGION( "ide" ) /* IDE HARD DRIVE */ |
| 1572 | DISK_REGION( "drive_0" ) /* IDE HARD DRIVE */ |
| 1573 | 1573 | DISK_IMAGE( "853jaa11", 0, SHA1(9683ff8462491252b6eb2e5b3aa6496884c01506) ) /* ver 1.10 JA */ |
| 1574 | 1574 | |
| 1575 | 1575 | ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 ) /* K054539 RAM */ |
| r14399 | r14400 | |
| 1592 | 1592 | ROM_LOAD16_BYTE( "853jaa09.25d", 0x100000, 0x80000, CRC(8584E21E) SHA1(3d1ca6de00f9ac07bbe7cd1e67093cca7bf484bb) ) |
| 1593 | 1593 | ROM_LOAD16_BYTE( "853jaa10.27d", 0x100001, 0x80000, CRC(9CB92D98) SHA1(6ace4492ba0b5a8f94a9e7b4f7126b31c6254637) ) |
| 1594 | 1594 | |
| 1595 | | DISK_REGION( "ide" ) /* IDE HARD DRIVE */ |
| 1595 | DISK_REGION( "drive_0" ) /* IDE HARD DRIVE */ |
| 1596 | 1596 | DISK_IMAGE( "853jaa11", 0, SHA1(9683ff8462491252b6eb2e5b3aa6496884c01506) ) /* ver 1.10 JA */ |
| 1597 | 1597 | |
| 1598 | 1598 | ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 ) /* K054539 RAM */ |
| r14399 | r14400 | |
| 1615 | 1615 | ROM_LOAD16_BYTE( "825jaa09.25d", 0x100000, 0x80000, CRC(D3E65669) SHA1(51abf452da60794fa47c05d11c08b203dde563ff) ) |
| 1616 | 1616 | ROM_LOAD16_BYTE( "825jaa10.27d", 0x100001, 0x80000, CRC(44D184F3) SHA1(28f3ec33a29164a6531f53db071272ccf015f66d) ) |
| 1617 | 1617 | |
| 1618 | | DISK_REGION( "ide" ) /* IDE HARD DRIVE */ |
| 1618 | DISK_REGION( "drive_0" ) /* IDE HARD DRIVE */ |
| 1619 | 1619 | DISK_IMAGE( "825jaa11", 0, SHA1(048919977232bbce046406a7212586cf39b77cf2) ) /* ver 1.00 JA */ |
| 1620 | 1620 | |
| 1621 | 1621 | ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 ) /* K054539 RAM */ |
| r14399 | r14400 | |
| 1638 | 1638 | ROM_LOAD16_BYTE( "858jaa09.25d", 0x100000, 0x80000, CRC(0B4AD843) SHA1(c01e15053dd1975dc68db9f4e6da47062d8f9b54) ) |
| 1639 | 1639 | ROM_LOAD16_BYTE( "858jaa10.27d", 0x100001, 0x80000, CRC(00B124EE) SHA1(435d28a327c2707833a8ddfe841104df65ffa3f8) ) |
| 1640 | 1640 | |
| 1641 | | DISK_REGION( "ide" ) /* IDE HARD DRIVE */ |
| 1641 | DISK_REGION( "drive_0" ) /* IDE HARD DRIVE */ |
| 1642 | 1642 | DISK_IMAGE( "858jaa11", 0, SHA1(bc590472046336a1000f29901fe3fd7b29747e47) ) /* ver 1.00 JA */ |
| 1643 | 1643 | |
| 1644 | 1644 | ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 ) /* K054539 RAM */ |
| r14399 | r14400 | |
| 1661 | 1661 | ROM_LOAD16_BYTE( "858uaa09.25d", 0x100000, 0x80000, CRC(99519886) SHA1(664f6bd953201a6e2fc123cb8b3facf72766107d) ) |
| 1662 | 1662 | ROM_LOAD16_BYTE( "858uaa10.27d", 0x100001, 0x80000, CRC(20AA7145) SHA1(eeff87eb9a9864985d751f45e843ee6e73db8cfd) ) |
| 1663 | 1663 | |
| 1664 | | DISK_REGION( "ide" ) /* IDE HARD DRIVE */ |
| 1664 | DISK_REGION( "drive_0" ) /* IDE HARD DRIVE */ |
| 1665 | 1665 | DISK_IMAGE( "858jaa11", 0, SHA1(bc590472046336a1000f29901fe3fd7b29747e47) ) /* ver 1.00 JA */ |
| 1666 | 1666 | |
| 1667 | 1667 | ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 ) /* K054539 RAM */ |
| r14399 | r14400 | |
| 1684 | 1684 | ROM_LOAD16_BYTE( "847jab09.25d", 0x100000, 0x80000, CRC(2E4AC9FE) SHA1(bbd4c6e0c82fc0be88f851e901e5853b6bcf775f) ) |
| 1685 | 1685 | ROM_LOAD16_BYTE( "847jab10.27d", 0x100001, 0x80000, CRC(C78516F5) SHA1(1adf5805c808dc55de14a9a9b20c3d2cf7bf414d) ) |
| 1686 | 1686 | |
| 1687 | | DISK_REGION( "ide" ) /* IDE HARD DRIVE */ |
| 1687 | DISK_REGION( "drive_0" ) /* IDE HARD DRIVE */ |
| 1688 | 1688 | DISK_IMAGE( "847jaa11", 0, SHA1(8cad631531b5616d6a4b0a99d988f4b525932dc7) ) /* ver 1.00 JA */ |
| 1689 | 1689 | |
| 1690 | 1690 | ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 ) /* K054539 RAM */ |
| r14399 | r14400 | |
| 1707 | 1707 | ROM_LOAD16_BYTE( "981jaa09.25d", 0x100000, 0x80000, CRC(D96D4E1C) SHA1(379aa4e82cd06490645f54dab1724c827108735d) ) |
| 1708 | 1708 | ROM_LOAD16_BYTE( "981jaa10.27d", 0x100001, 0x80000, CRC(06BEE0E4) SHA1(6eea8614cb01e7079393b9976b6fd6a52c14e3c0) ) |
| 1709 | 1709 | |
| 1710 | | DISK_REGION( "ide" ) /* IDE HARD DRIVE */ |
| 1710 | DISK_REGION( "drive_0" ) /* IDE HARD DRIVE */ |
| 1711 | 1711 | DISK_IMAGE( "981jaa11", 0, SHA1(dc7353fa436d96ae174a58d3a38ca9928a63727f) ) /* ver 1.00 JA */ |
| 1712 | 1712 | |
| 1713 | 1713 | ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 ) /* K054539 RAM */ |
| r14399 | r14400 | |
| 1730 | 1730 | ROM_LOAD16_BYTE( "993jaa09.25d", 0x100000, 0x80000, CRC(E1A172DD) SHA1(42e850c055dc5bfccf6b6989f9f3a945fce13006) ) |
| 1731 | 1731 | ROM_LOAD16_BYTE( "993jaa10.27d", 0x100001, 0x80000, CRC(9D113A2D) SHA1(eee94a5f7015c49aa630b8df0c8e9d137d238811) ) |
| 1732 | 1732 | |
| 1733 | | DISK_REGION( "ide" ) /* IDE HARD DRIVE */ |
| 1733 | DISK_REGION( "drive_0" ) /* IDE HARD DRIVE */ |
| 1734 | 1734 | DISK_IMAGE( "993hdda01", 0, SHA1(f5d4df1dd27ce6ee2d0897852342691d55b63bfb) ) |
| 1735 | 1735 | // this image has not been verified |
| 1736 | 1736 | // DISK_IMAGE( "993jaa11", 0, MD5(e26eb62d7cf3357585f5066da6063143) ) /* ver 1.00 JA */ |
| r14399 | r14400 | |
| 1755 | 1755 | ROM_LOAD16_BYTE( "988jaa09.25d", 0x100000, 0x80000, CRC(8F3BAE7F) SHA1(c4dac14f6c7f75a2b19153e05bfe969e9eb4aca0) ) |
| 1756 | 1756 | ROM_LOAD16_BYTE( "988jaa10.27d", 0x100001, 0x80000, CRC(248BF0EE) SHA1(d89205ed57e771401bfc2c24043d200ecbd0b7fc) ) |
| 1757 | 1757 | |
| 1758 | | DISK_REGION( "ide" ) /* IDE HARD DRIVE */ |
| 1758 | DISK_REGION( "drive_0" ) /* IDE HARD DRIVE */ |
| 1759 | 1759 | DISK_IMAGE( "988jaa11", 0, SHA1(12a0988c631dd3331e54b8417a9659402afe168b) ) /* ver 1.00 JA */ |
| 1760 | 1760 | |
| 1761 | 1761 | ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 ) /* K054539 RAM */ |
| r14399 | r14400 | |
| 1778 | 1778 | ROM_LOAD16_BYTE( "988uaa09.25d", 0x100000, 0x80000, CRC(C2AD6810) SHA1(706388c5acf6718297fd90e10f8a673463a0893b) ) |
| 1779 | 1779 | ROM_LOAD16_BYTE( "988uaa10.27d", 0x100001, 0x80000, CRC(DAB0F3C9) SHA1(6fd899e753e32f60262c54ab8553c686c7ef28de) ) |
| 1780 | 1780 | |
| 1781 | | DISK_REGION( "ide" ) /* IDE HARD DRIVE */ |
| 1781 | DISK_REGION( "drive_0" ) /* IDE HARD DRIVE */ |
| 1782 | 1782 | DISK_IMAGE( "988jaa11", 0, SHA1(12a0988c631dd3331e54b8417a9659402afe168b) ) /* ver 1.00 JA */ |
| 1783 | 1783 | |
| 1784 | 1784 | ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 ) /* K054539 RAM */ |
| r14399 | r14400 | |
| 1801 | 1801 | ROM_LOAD16_BYTE( "995jaa09.25d", 0x100000, 0x80000, CRC(1510A9C2) SHA1(daf1ab26b7b6b0fe0123b3fbee68684157c2ce51) ) |
| 1802 | 1802 | ROM_LOAD16_BYTE( "995jaa10.27d", 0x100001, 0x80000, CRC(F9E4E9F2) SHA1(fe91badf6b0baeea690d75399d8c66fabcf6d352) ) |
| 1803 | 1803 | |
| 1804 | | DISK_REGION( "ide" ) /* IDE HARD DRIVE */ |
| 1804 | DISK_REGION( "drive_0" ) /* IDE HARD DRIVE */ |
| 1805 | 1805 | DISK_IMAGE( "995jaa11", 0, SHA1(8fec3c4d97f64f48b9867230a97cda4347496075) ) /* ver 1.00 JA */ |
| 1806 | 1806 | |
| 1807 | 1807 | ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 ) /* K054539 RAM */ |
| r14399 | r14400 | |
| 1824 | 1824 | ROM_LOAD16_BYTE( "a05jaa09.25d", 0x100000, 0x80000, CRC(1504D62C) SHA1(3c31c6625bc089235a96fe21021239f2d0c0f6e1) ) |
| 1825 | 1825 | ROM_LOAD16_BYTE( "a05jaa10.27d", 0x100001, 0x80000, CRC(99D75C36) SHA1(9599420863aa0a9492d3caeb03f8ac5fd4c3cdb2) ) |
| 1826 | 1826 | |
| 1827 | | DISK_REGION( "ide" ) /* IDE HARD DRIVE */ |
| 1827 | DISK_REGION( "drive_0" ) /* IDE HARD DRIVE */ |
| 1828 | 1828 | DISK_IMAGE( "a05jaa11", 0, SHA1(7ebc41cc3e9a0a922b49201b34e29201522eb726) ) /* ver 1.00 JA */ |
| 1829 | 1829 | |
| 1830 | 1830 | ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 ) /* K054539 RAM */ |
| r14399 | r14400 | |
| 1847 | 1847 | ROM_LOAD16_BYTE( "a21jaa09.25d", 0x100000, 0x80000, CRC(181E6F70) SHA1(82c7ca3068ace9a66b614ead4b90ea6fe4017d51) ) |
| 1848 | 1848 | ROM_LOAD16_BYTE( "a21jaa10.27d", 0x100001, 0x80000, CRC(1AC33595) SHA1(3173bb8dc420487c4d427e779444a98aad37d51e) ) |
| 1849 | 1849 | |
| 1850 | | DISK_REGION( "ide" ) /* IDE HARD DRIVE */ |
| 1850 | DISK_REGION( "drive_0" ) /* IDE HARD DRIVE */ |
| 1851 | 1851 | DISK_IMAGE( "a21jaa11", 0, SHA1(ed0a07212a360e75934fc22c56265842cf0829b6) ) /* ver 1.00 JA */ |
| 1852 | 1852 | |
| 1853 | 1853 | ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 ) /* K054539 RAM */ |
| r14399 | r14400 | |
| 1870 | 1870 | ROM_LOAD16_BYTE( "b07jaa09.25d", 0x100000, 0x80000, CRC(2530CEDB) SHA1(94b38b4fe198b26a2ff4d99d2cb28a0f935fe940) ) |
| 1871 | 1871 | ROM_LOAD16_BYTE( "b07jaa10.27d", 0x100001, 0x80000, CRC(6B75BA9C) SHA1(aee922adc3bc0296ae6e08e461b20a9e5e72a2df) ) |
| 1872 | 1872 | |
| 1873 | | DISK_REGION( "ide" ) /* IDE HARD DRIVE */ |
| 1873 | DISK_REGION( "drive_0" ) /* IDE HARD DRIVE */ |
| 1874 | 1874 | DISK_IMAGE( "b07jaa11", 0, SHA1(e4925494f0a801abb4d3aa6524c379eb445d8dff) ) /* ver 1.00 JA */ |
| 1875 | 1875 | // this image has not been verified |
| 1876 | 1876 | //DISK_IMAGE( "b07jab11", 0, MD5(0e9440787ca69567792095085e2a3619) ) /* ver 1.00 JA */ |
| r14399 | r14400 | |
| 1895 | 1895 | ROM_LOAD16_BYTE( "c01jaa09.25d", 0x100000, 0x80000, CRC(45CF93B1) SHA1(7c5082bcd1fe15761a0a965e25dda121904ff1bd) ) |
| 1896 | 1896 | ROM_LOAD16_BYTE( "c01jaa10.27d", 0x100001, 0x80000, CRC(C9927749) SHA1(c2644877bda483e241381265e723ea8ab8357761) ) |
| 1897 | 1897 | |
| 1898 | | DISK_REGION( "ide" ) /* IDE HARD DRIVE */ |
| 1898 | DISK_REGION( "drive_0" ) /* IDE HARD DRIVE */ |
| 1899 | 1899 | DISK_IMAGE( "c01jaa11", 0, SHA1(0a53c4412a72a886f5fb98c12c529d056d625244) ) /* ver 1.00 JA */ |
| 1900 | 1900 | // this image has not been verified |
| 1901 | 1901 | //DISK_IMAGE( "c01jaa11", 0, MD5(8bb7e6b6bc63cac8a4f2997307c25748) ) /* ver 1.00 JA */ |
| r14399 | r14400 | |
| 1920 | 1920 | ROM_LOAD16_BYTE( "831jaa09.25d", 0x100000, 0x80000, CRC(AE7838D2) SHA1(4f8a6793065c6c1eb08161f65b1d6246987bf47e) ) |
| 1921 | 1921 | ROM_LOAD16_BYTE( "831jaa10.27d", 0x100001, 0x80000, CRC(85173CB6) SHA1(bc4d86bf4654a9a0a58e624f77090854950f3993) ) |
| 1922 | 1922 | |
| 1923 | | DISK_REGION( "ide" ) /* IDE HARD DRIVE */ |
| 1923 | DISK_REGION( "drive_0" ) /* IDE HARD DRIVE */ |
| 1924 | 1924 | DISK_IMAGE( "831jhdda01", 0, SHA1(ef62d5fcc1a36235fc932e6ecef71dc845d1d72d) ) |
| 1925 | 1925 | |
| 1926 | 1926 | ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 ) /* K054539 RAM */ |
| r14399 | r14400 | |
| 1945 | 1945 | ROM_LOAD16_BYTE( "825jab09.25d", 0x100000, 0x80000, CRC(1407BA5D) SHA1(e7a0d190326589f4d94e83cb7c85dd4e91f4efad) ) |
| 1946 | 1946 | ROM_LOAD16_BYTE( "825jab10.27d", 0x100001, 0x80000, CRC(2AFD0A10) SHA1(1b8b868ac5720bb1b376f4eb8952efb190257bda) ) |
| 1947 | 1947 | |
| 1948 | | DISK_REGION( "ide" ) /* IDE HARD DRIVE */ |
| 1948 | DISK_REGION( "drive_0" ) /* IDE HARD DRIVE */ |
| 1949 | 1949 | DISK_IMAGE( "825jab11", 0, MD5(f4360da10a932ba90e93469df7426d1d) SHA1(1) ) /* ver 1.01 JA */ |
| 1950 | 1950 | |
| 1951 | 1951 | ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 ) /* K054539 RAM */ |
| r14399 | r14400 | |
| 1968 | 1968 | ROM_LOAD16_BYTE( "803jaa09.25d", 0x100000, 0x80000, CRC(204D53EB) SHA1(349de147246b0ed08fb7e473d63e073b71fa30c9) ) |
| 1969 | 1969 | ROM_LOAD16_BYTE( "803jaa10.27d", 0x100001, 0x80000, CRC(535A61A3) SHA1(b24c57601a7e3a349473af69114703133a46806d) ) |
| 1970 | 1970 | |
| 1971 | | DISK_REGION( "ide" ) /* IDE HARD DRIVE */ |
| 1971 | DISK_REGION( "drive_0" ) /* IDE HARD DRIVE */ |
| 1972 | 1972 | DISK_IMAGE( "803jaa11", 0, MD5(54a8ac87857d81740621c622e27736d7) ) /* ver 1.00 JA */ |
| 1973 | 1973 | |
| 1974 | 1974 | ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 ) /* K054539 RAM */ |
| r14399 | r14400 | |
| 1991 | 1991 | ROM_LOAD16_BYTE( "980jaa09.25d", 0x100000, 0x80000, CRC(1CB4D84E) SHA1(9669585c6a2825aeae6e47dd03458624b4c44721) ) |
| 1992 | 1992 | ROM_LOAD16_BYTE( "980jaa10.27d", 0x100001, 0x80000, CRC(7776B87E) SHA1(662b7cd7cb4fb8f8bab240ef543bf9a593e23a03) ) |
| 1993 | 1993 | |
| 1994 | | DISK_REGION( "ide" ) /* IDE HARD DRIVE */ |
| 1994 | DISK_REGION( "drive_0" ) /* IDE HARD DRIVE */ |
| 1995 | 1995 | DISK_IMAGE( "980jaa11", 0, MD5(6e5cc17a6bc75cac0256192cc700215c) ) /* ver 1.00 JA */ |
| 1996 | 1996 | |
| 1997 | 1997 | ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 ) /* K054539 RAM */ |
| r14399 | r14400 | |
| 2014 | 2014 | ROM_LOAD16_BYTE( "970jba09.25d", 0x100000, 0x80000, CRC(5D2BDA52) SHA1(d03c135ac04437b54e4d267ae168fe7ebb9e5b65) ) |
| 2015 | 2015 | ROM_LOAD16_BYTE( "970jba10.27d", 0x100001, 0x80000, CRC(EDC4A245) SHA1(30bbd7bf0299a064119c535abb9be69d725aa130) ) |
| 2016 | 2016 | |
| 2017 | | DISK_REGION( "ide" ) /* IDE HARD DRIVE */ |
| 2017 | DISK_REGION( "drive_0" ) /* IDE HARD DRIVE */ |
| 2018 | 2018 | DISK_IMAGE( "970jba11", 0, MD5(1616905838fdb2b521d53499c6c2a7a4) ) /* ver 1.00 JA */ |
| 2019 | 2019 | |
| 2020 | 2020 | ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 ) /* K054539 RAM */ |
src/mame/drivers/seattle.c
| r14399 | r14400 | |
| 2505 | 2505 | MCFG_MACHINE_RESET(seattle) |
| 2506 | 2506 | MCFG_NVRAM_ADD_1FILL("nvram") |
| 2507 | 2507 | |
| 2508 | | MCFG_IDE_CONTROLLER_ADD("ide", ide_interrupt) |
| 2509 | | MCFG_IDE_BUS_MASTER_SPACE("maincpu", PROGRAM) |
| 2508 | MCFG_IDE_CONTROLLER_ADD("ide", ide_interrupt, ide_devices, "hdd", NULL) |
| 2509 | MCFG_IDE_BUS_MASTER_SPACE("ide", "maincpu", PROGRAM) |
| 2510 | 2510 | |
| 2511 | 2511 | MCFG_3DFX_VOODOO_1_ADD("voodoo", STD_VOODOO_1_CLOCK, 2, "screen") |
| 2512 | 2512 | MCFG_3DFX_VOODOO_CPU("maincpu") |
| r14399 | r14400 | |
| 2587 | 2587 | ROM_REGION32_LE( 0x80000, "user1", 0 ) /* Boot Code Version L1.2 (10/8/96) */ |
| 2588 | 2588 | ROM_LOAD( "wg3dh_12.u32", 0x000000, 0x80000, CRC(15e4cea2) SHA1(72c0db7dc53ce645ba27a5311b5ce803ad39f131) ) |
| 2589 | 2589 | |
| 2590 | | DISK_REGION( "ide" ) /* Hard Drive Version 1.3 (Guts 10/15/96, Main 10/15/96) */ |
| 2590 | DISK_REGION( "drive_0" ) /* Hard Drive Version 1.3 (Guts 10/15/96, Main 10/15/96) */ |
| 2591 | 2591 | DISK_IMAGE( "wg3dh", 0, SHA1(4fc6f25d7f043d9bcf8743aa8df1d9be3cbc375b) ) |
| 2592 | 2592 | |
| 2593 | 2593 | ROM_REGION16_LE( 0x10000, "dcs", 0 ) /* ADSP-2115 data Version L1.1 */ |
| r14399 | r14400 | |
| 2599 | 2599 | ROM_REGION32_LE( 0x80000, "user1", 0 ) /* Boot Code Version 1.0ce 7/2/97 */ |
| 2600 | 2600 | ROM_LOAD( "mace10ce.u32", 0x000000, 0x80000, CRC(7a50b37e) SHA1(33788835f84a9443566c80bee9f20a1691490c6d) ) |
| 2601 | 2601 | |
| 2602 | | DISK_REGION( "ide" ) /* Hard Drive Version 1.0B 6/10/97 (Guts 7/2/97, Main 7/2/97) */ |
| 2602 | DISK_REGION( "drive_0" ) /* Hard Drive Version 1.0B 6/10/97 (Guts 7/2/97, Main 7/2/97) */ |
| 2603 | 2603 | DISK_IMAGE( "mace", 0, SHA1(96ec8d3ff5dd894e21aa81403bcdbeba44bb97ea) ) |
| 2604 | 2604 | |
| 2605 | 2605 | ROM_REGION16_LE( 0x10000, "dcs", 0 ) /* ADSP-2115 data Version L1.1, Labeled as Version 1.0 */ |
| r14399 | r14400 | |
| 2611 | 2611 | ROM_REGION32_LE( 0x80000, "user1", 0 ) /* Boot Code Version ??? 5/7/97 */ |
| 2612 | 2612 | ROM_LOAD( "maceboot.u32", 0x000000, 0x80000, CRC(effe3ebc) SHA1(7af3ca3580d6276ffa7ab8b4c57274e15ee6bcbb) ) |
| 2613 | 2613 | |
| 2614 | | DISK_REGION( "ide" ) /* Hard Drive Version 1.0a (Guts 6/9/97, Main 5/12/97) */ |
| 2614 | DISK_REGION( "drive_0" ) /* Hard Drive Version 1.0a (Guts 6/9/97, Main 5/12/97) */ |
| 2615 | 2615 | DISK_IMAGE( "macea", 0, BAD_DUMP SHA1(9bd4a60627915d71932cab24f89c48ea21f4c1cb) ) |
| 2616 | 2616 | |
| 2617 | 2617 | ROM_REGION16_LE( 0x10000, "dcs", 0 ) /* ADSP-2115 data Version L1.1 */ |
| r14399 | r14400 | |
| 2632 | 2632 | ROM_LOAD32_WORD( "sfrush.u53", 0x800000, 0x200000, CRC(71f8ddb0) SHA1(c24bef801f43bae68fda043c4356e8cf1298ca97) ) |
| 2633 | 2633 | ROM_LOAD32_WORD( "sfrush.u49", 0x800002, 0x200000, CRC(dfb0a54c) SHA1(ed34f9485f7a7e5bb73bf5c6428b27548e12db12) ) |
| 2634 | 2634 | |
| 2635 | | DISK_REGION( "ide" ) /* Hard Drive Version L1.06 */ |
| 2635 | DISK_REGION( "drive_0" ) /* Hard Drive Version L1.06 */ |
| 2636 | 2636 | DISK_IMAGE( "sfrush", 0, SHA1(e2db0270a707fb2115207f988d5751081d6b4994) ) |
| 2637 | 2637 | ROM_END |
| 2638 | 2638 | |
| r14399 | r14400 | |
| 2650 | 2650 | ROM_LOAD32_WORD( "audio.u53", 0x800000, 0x200000, CRC(51c89a14) SHA1(6bc62bcda224040a4596d795132874828011a038) ) |
| 2651 | 2651 | ROM_LOAD32_WORD( "audio.u49", 0x800002, 0x200000, CRC(e6b684d3) SHA1(1f5bab7fae974cecc8756dd23e3c7aa2cf6e7dc7) ) |
| 2652 | 2652 | |
| 2653 | | DISK_REGION( "ide" ) /* Hard Drive Version 1.2 */ |
| 2653 | DISK_REGION( "drive_0" ) /* Hard Drive Version 1.2 */ |
| 2654 | 2654 | DISK_IMAGE( "sfrushrk", 0, SHA1(e763f26aca67ebc17fe8b8df4fba91d492cf7837) ) |
| 2655 | 2655 | ROM_END |
| 2656 | 2656 | |
| r14399 | r14400 | |
| 2659 | 2659 | ROM_REGION32_LE( 0x80000, "user1", 0 ) /* Boot Code Version 1.2 (2/18/98) */ |
| 2660 | 2660 | ROM_LOAD( "caspd1_2.u32", 0x000000, 0x80000, CRC(0a235e4e) SHA1(b352f10fad786260b58bd344b5002b6ea7aaf76d) ) |
| 2661 | 2661 | |
| 2662 | | DISK_REGION( "ide" ) /* Release version 2.1a (4/17/98) (Guts 1.25 4/17/98, Main 4/17/98) */ |
| 2662 | DISK_REGION( "drive_0" ) /* Release version 2.1a (4/17/98) (Guts 1.25 4/17/98, Main 4/17/98) */ |
| 2663 | 2663 | DISK_IMAGE( "calspeed", 0, SHA1(08d411c591d4b8bbdd6437ea80d01c4cec8516f8) ) |
| 2664 | 2664 | |
| 2665 | 2665 | ROM_REGION16_LE( 0x10000, "dcs", 0 ) /* ADSP-2115 data Version 1.02 */ |
| r14399 | r14400 | |
| 2671 | 2671 | ROM_REGION32_LE( 0x80000, "user1", 0 ) /* Boot Code Version 1.2 (2/18/98) */ |
| 2672 | 2672 | ROM_LOAD( "caspd1_2.u32", 0x000000, 0x80000, CRC(0a235e4e) SHA1(b352f10fad786260b58bd344b5002b6ea7aaf76d) ) |
| 2673 | 2673 | |
| 2674 | | DISK_REGION( "ide" ) /* Release version 1.0r7a (3/4/98) (Guts 3/3/98, Main 1/19/98) */ |
| 2674 | DISK_REGION( "drive_0" ) /* Release version 1.0r7a (3/4/98) (Guts 3/3/98, Main 1/19/98) */ |
| 2675 | 2675 | DISK_IMAGE( "calspeda", 0, SHA1(6b1c3a7530195ef7309b06a651b01c8b3ece92c6) ) |
| 2676 | 2676 | |
| 2677 | 2677 | ROM_REGION16_LE( 0x10000, "dcs", 0 ) /* ADSP-2115 data Version 1.02 */ |
| r14399 | r14400 | |
| 2683 | 2683 | ROM_REGION32_LE( 0x80000, "user1", 0 ) |
| 2684 | 2684 | ROM_LOAD( "vtrxboot.bin", 0x000000, 0x80000, CRC(ee487a6c) SHA1(fb9efda85047cf615f24f7276a9af9fd542f3354) ) |
| 2685 | 2685 | |
| 2686 | | DISK_REGION( "ide" ) |
| 2686 | DISK_REGION( "drive_0" ) |
| 2687 | 2687 | DISK_IMAGE( "vaportrx", 0, SHA1(fe53ca7643d2ed2745086abb7f2243c69678cab1) ) |
| 2688 | 2688 | |
| 2689 | 2689 | ROM_REGION16_LE( 0x10000, "dcs", 0 ) /* ADSP-2115 data Version 1.02 */ |
| r14399 | r14400 | |
| 2695 | 2695 | ROM_REGION32_LE( 0x80000, "user1", 0 ) |
| 2696 | 2696 | ROM_LOAD( "vtrxboot.bin", 0x000000, 0x80000, CRC(ee487a6c) SHA1(fb9efda85047cf615f24f7276a9af9fd542f3354) ) |
| 2697 | 2697 | |
| 2698 | | DISK_REGION( "ide" ) /* Guts: Apr 10 1998 11:03:14 Main: Apr 10 1998 11:27:44 */ |
| 2698 | DISK_REGION( "drive_0" ) /* Guts: Apr 10 1998 11:03:14 Main: Apr 10 1998 11:27:44 */ |
| 2699 | 2699 | DISK_IMAGE( "vaportrp", 0, SHA1(6c86637c442ebd6994eee8c0ae0dce343c35dbe9) ) |
| 2700 | 2700 | |
| 2701 | 2701 | ROM_REGION16_LE( 0x10000, "dcs", 0 ) /* ADSP-2115 data Version 1.02 */ |
| r14399 | r14400 | |
| 2710 | 2710 | ROM_REGION32_LE( 0x80000, "user1", 0 ) /* Seattle System Boot ROM Version 0.1i Apr 14 1997 14:52:53 */ |
| 2711 | 2711 | ROM_LOAD( "biofreak.u32", 0x000000, 0x80000, CRC(cefa00bb) SHA1(7e171610ede1e8a448fb8d175f9cb9e7d549de28) ) |
| 2712 | 2712 | |
| 2713 | | DISK_REGION( "ide" ) /* Build Date 12/11/97 */ |
| 2713 | DISK_REGION( "drive_0" ) /* Build Date 12/11/97 */ |
| 2714 | 2714 | DISK_IMAGE( "biofreak", 0, SHA1(711241642f92ded8eaf20c418ea748989183fe10) ) |
| 2715 | 2715 | ROM_END |
| 2716 | 2716 | |
| r14399 | r14400 | |
| 2722 | 2722 | ROM_REGION32_LE( 0x80000, "user1", 0 ) /* Boot Code Version 1.2 */ |
| 2723 | 2723 | ROM_LOAD( "blitz1_2.u32", 0x000000, 0x80000, CRC(38dbecf5) SHA1(7dd5a5b3baf83a7f8f877ff4cd3f5e8b5201b36f) ) |
| 2724 | 2724 | |
| 2725 | | DISK_REGION( "ide" ) /* Hard Drive Version 1.21 */ |
| 2725 | DISK_REGION( "drive_0" ) /* Hard Drive Version 1.21 */ |
| 2726 | 2726 | DISK_IMAGE( "blitz", 0, SHA1(9131c7888e89b3c172780156ed3fe1fe46f78b0a) ) |
| 2727 | 2727 | ROM_END |
| 2728 | 2728 | |
| r14399 | r14400 | |
| 2734 | 2734 | ROM_REGION32_LE( 0x80000, "user1", 0 ) /* Boot Code Version 1.1 */ |
| 2735 | 2735 | ROM_LOAD( "blitz1_1.u32", 0x000000, 0x80000, CRC(8163ce02) SHA1(89b432d8879052f6c5534ee49599f667f50a010f) ) |
| 2736 | 2736 | |
| 2737 | | DISK_REGION( "ide" ) /* Hard Drive Version 1.21 */ |
| 2737 | DISK_REGION( "drive_0" ) /* Hard Drive Version 1.21 */ |
| 2738 | 2738 | DISK_IMAGE( "blitz", 0, SHA1(9131c7888e89b3c172780156ed3fe1fe46f78b0a) ) |
| 2739 | 2739 | ROM_END |
| 2740 | 2740 | |
| r14399 | r14400 | |
| 2746 | 2746 | ROM_REGION32_LE( 0x80000, "user1", 0 ) /* Boot Code Version 1.0 */ |
| 2747 | 2747 | ROM_LOAD( "bltz9910.u32", 0x000000, 0x80000, CRC(777119b2) SHA1(40d255181c2f3a787919c339e83593fd506779a5) ) |
| 2748 | 2748 | |
| 2749 | | DISK_REGION( "ide" ) /* Hard Drive Version 1.30 */ |
| 2749 | DISK_REGION( "drive_0" ) /* Hard Drive Version 1.30 */ |
| 2750 | 2750 | DISK_IMAGE( "blitz99", 0, SHA1(19877e26ffce81dd525031e9e2b4f83ff982e2d9) ) |
| 2751 | 2751 | ROM_END |
| 2752 | 2752 | |
| r14399 | r14400 | |
| 2758 | 2758 | ROM_REGION32_LE( 0x80000, "user1", 0 ) /* Boot Code Version 1.4 */ |
| 2759 | 2759 | ROM_LOAD( "bltz2k14.u32", 0x000000, 0x80000, CRC(ac4f0051) SHA1(b8125c17370db7bfd9b783230b4ef3d5b22a2025) ) |
| 2760 | 2760 | |
| 2761 | | DISK_REGION( "ide" ) /* Hard Drive Version 1.5 */ |
| 2761 | DISK_REGION( "drive_0" ) /* Hard Drive Version 1.5 */ |
| 2762 | 2762 | DISK_IMAGE( "blitz2k", 0, SHA1(e89b7fbd4b4a9854d47ae97493e0afffbd1f69e7) ) |
| 2763 | 2763 | ROM_END |
| 2764 | 2764 | |
| r14399 | r14400 | |
| 2770 | 2770 | ROM_REGION32_LE( 0x80000, "user1", 0 ) /* Boot Rom Version 1.9 */ |
| 2771 | 2771 | ROM_LOAD( "carnevil1_9.u32", 0x000000, 0x80000, CRC(82c07f2e) SHA1(fa51c58022ce251c53bad12fc6ffadb35adb8162) ) |
| 2772 | 2772 | |
| 2773 | | DISK_REGION( "ide" ) /* Hard Drive v1.0.3 Diagnostics v3.4 / Feb 1 1999 16:00:07 */ |
| 2773 | DISK_REGION( "drive_0" ) /* Hard Drive v1.0.3 Diagnostics v3.4 / Feb 1 1999 16:00:07 */ |
| 2774 | 2774 | DISK_IMAGE( "carnevil", 0, SHA1(5cffb0de63ad36eb01c5951bab04d3f8a9e23e16) ) |
| 2775 | 2775 | ROM_END |
| 2776 | 2776 | |
| r14399 | r14400 | |
| 2782 | 2782 | ROM_REGION32_LE( 0x80000, "user1", 0 ) /* Boot Rom Version 1.9 */ |
| 2783 | 2783 | ROM_LOAD( "carnevil1_9.u32", 0x000000, 0x80000, CRC(82c07f2e) SHA1(fa51c58022ce251c53bad12fc6ffadb35adb8162) ) |
| 2784 | 2784 | |
| 2785 | | DISK_REGION( "ide" ) /* Hard Drive v1.0.1 Diagnostics v3.3 / Oct 20 1998 11:44:41 */ |
| 2785 | DISK_REGION( "drive_0" ) /* Hard Drive v1.0.1 Diagnostics v3.3 / Oct 20 1998 11:44:41 */ |
| 2786 | 2786 | DISK_IMAGE( "carnevi1", 0, BAD_DUMP SHA1(94532727512280930a100fe473bf3a938fe2d44f) ) |
| 2787 | 2787 | ROM_END |
| 2788 | 2788 | |
| r14399 | r14400 | |
| 2794 | 2794 | ROM_REGION32_LE( 0x80000, "user1", 0 ) /* Boot Rom Version 9. */ |
| 2795 | 2795 | ROM_LOAD( "hyprdrve.u32", 0x000000, 0x80000, CRC(3e18cb80) SHA1(b18cc4253090ee1d65d72a7ec0c426ed08c4f238) ) |
| 2796 | 2796 | |
| 2797 | | DISK_REGION( "ide" ) /* Version 1.40 Oct 23 1998 15:16:00 */ |
| 2797 | DISK_REGION( "drive_0" ) /* Version 1.40 Oct 23 1998 15:16:00 */ |
| 2798 | 2798 | DISK_IMAGE( "hyprdriv", 0, SHA1(8cfa343797575b32f46cc24150024be48963a03e) ) |
| 2799 | 2799 | ROM_END |
| 2800 | 2800 | |
src/emu/machine/idectrl.c
| r14399 | r14400 | |
| 7 | 7 | #include "emu.h" |
| 8 | 8 | #include "idectrl.h" |
| 9 | 9 | #include "debugger.h" |
| 10 | | #include "imagedev/harddriv.h" |
| 11 | 10 | |
| 12 | 11 | /*************************************************************************** |
| 13 | 12 | DEBUGGING |
| r14399 | r14400 | |
| 27 | 26 | CONSTANTS |
| 28 | 27 | ***************************************************************************/ |
| 29 | 28 | |
| 30 | | #define IDE_DISK_SECTOR_SIZE 512 |
| 31 | | |
| 32 | 29 | #define MINIMUM_COMMAND_TIME (attotime::from_usec(10)) |
| 33 | 30 | |
| 34 | 31 | #define TIME_PER_SECTOR (attotime::from_usec(100)) |
| r14399 | r14400 | |
| 108 | 105 | typedef struct _ide_device ide_device; |
| 109 | 106 | struct _ide_device |
| 110 | 107 | { |
| 111 | | UINT8 features[IDE_DISK_SECTOR_SIZE]; |
| 112 | | |
| 113 | 108 | UINT16 cur_cylinder; |
| 114 | 109 | UINT8 cur_sector; |
| 115 | 110 | UINT8 cur_head; |
| 116 | 111 | UINT8 cur_head_reg; |
| 117 | | |
| 118 | 112 | UINT32 cur_lba; |
| 119 | | |
| 120 | | UINT16 num_cylinders; |
| 121 | | UINT8 num_sectors; |
| 122 | | UINT8 num_heads; |
| 123 | | |
| 124 | | chd_file *handle; |
| 125 | | hard_disk_file *disk; |
| 126 | | bool is_image_device; |
| 113 | ide_slot_device *slot; |
| 127 | 114 | }; |
| 128 | 115 | |
| 129 | 116 | |
| r14399 | r14400 | |
| 172 | 159 | const UINT8 * user_password; |
| 173 | 160 | |
| 174 | 161 | UINT8 gnetreadlock; |
| 175 | | ide_hardware * hardware; |
| 176 | 162 | |
| 177 | 163 | UINT8 cur_drive; |
| 178 | 164 | ide_device drive[2]; |
| r14399 | r14400 | |
| 186 | 172 | |
| 187 | 173 | static TIMER_CALLBACK( reset_callback ); |
| 188 | 174 | |
| 189 | | static void ide_build_features(ide_state *ide, int drive); |
| 190 | | |
| 191 | 175 | static void continue_read(ide_state *ide); |
| 192 | 176 | static void read_sector_done(ide_state *ide); |
| 193 | 177 | static TIMER_CALLBACK( read_sector_done_callback ); |
| r14399 | r14400 | |
| 288 | 272 | UINT8 *ide_get_features(device_t *device, int drive) |
| 289 | 273 | { |
| 290 | 274 | ide_state *ide = get_safe_token(device); |
| 291 | | return ide->drive[drive].features; |
| 275 | return ide->drive[drive].slot->get_features(); |
| 292 | 276 | } |
| 293 | 277 | |
| 294 | 278 | void ide_set_gnet_readlock(device_t *device, const UINT8 onoff) |
| r14399 | r14400 | |
| 388 | 372 | |
| 389 | 373 | /* standard CHS */ |
| 390 | 374 | else |
| 391 | | return (ide->drive[ide->cur_drive].cur_cylinder * ide->drive[ide->cur_drive].num_heads + ide->drive[ide->cur_drive].cur_head) * ide->drive[ide->cur_drive].num_sectors + ide->drive[ide->cur_drive].cur_sector - 1; |
| 375 | return (ide->drive[ide->cur_drive].cur_cylinder * ide->drive[ide->cur_drive].slot->get_heads() + ide->drive[ide->cur_drive].cur_head) * ide->drive[ide->cur_drive].slot->get_sectors() + ide->drive[ide->cur_drive].cur_sector - 1; |
| 392 | 376 | } |
| 393 | 377 | |
| 394 | 378 | |
| r14399 | r14400 | |
| 418 | 402 | { |
| 419 | 403 | /* sectors are 1-based */ |
| 420 | 404 | ide->drive[ide->cur_drive].cur_sector++; |
| 421 | | if (ide->drive[ide->cur_drive].cur_sector > ide->drive[ide->cur_drive].num_sectors) |
| 405 | if (ide->drive[ide->cur_drive].cur_sector > ide->drive[ide->cur_drive].slot->get_sectors()) |
| 422 | 406 | { |
| 423 | 407 | /* heads are 0 based */ |
| 424 | 408 | ide->drive[ide->cur_drive].cur_sector = 1; |
| 425 | 409 | ide->drive[ide->cur_drive].cur_head++; |
| 426 | | if (ide->drive[ide->cur_drive].cur_head >= ide->drive[ide->cur_drive].num_heads) |
| 410 | if (ide->drive[ide->cur_drive].cur_head >= ide->drive[ide->cur_drive].slot->get_heads()) |
| 427 | 411 | { |
| 428 | 412 | ide->drive[ide->cur_drive].cur_head = 0; |
| 429 | 413 | ide->drive[ide->cur_drive].cur_cylinder++; |
| r14399 | r14400 | |
| 455 | 439 | } |
| 456 | 440 | |
| 457 | 441 | |
| 458 | | static void ide_generate_features(ide_state *ide,int drive) |
| 442 | void ide_hdd_device::ide_build_features() |
| 459 | 443 | { |
| 460 | | int total_sectors = ide->drive[drive].num_cylinders * ide->drive[drive].num_heads * ide->drive[drive].num_sectors; |
| 461 | | int sectors_per_track = ide->drive[drive].num_heads * ide->drive[drive].num_sectors; |
| 444 | memset(m_features, 0, IDE_DISK_SECTOR_SIZE); |
| 445 | int total_sectors = m_num_cylinders * m_num_heads * m_num_sectors; |
| 446 | int sectors_per_track = m_num_heads * m_num_sectors; |
| 462 | 447 | |
| 463 | 448 | /* basic geometry */ |
| 464 | | ide->drive[drive].features[ 0*2+0] = 0x5a; /* 0: configuration bits */ |
| 465 | | ide->drive[drive].features[ 0*2+1] = 0x04; |
| 466 | | ide->drive[drive].features[ 1*2+0] = ide->drive[drive].num_cylinders & 0xff; /* 1: logical cylinders */ |
| 467 | | ide->drive[drive].features[ 1*2+1] = ide->drive[drive].num_cylinders >> 8; |
| 468 | | ide->drive[drive].features[ 2*2+0] = 0; /* 2: reserved */ |
| 469 | | ide->drive[drive].features[ 2*2+1] = 0; |
| 470 | | ide->drive[drive].features[ 3*2+0] = ide->drive[drive].num_heads & 0xff; /* 3: logical heads */ |
| 471 | | ide->drive[drive].features[ 3*2+1] = 0;/*ide->num_heads >> 8;*/ |
| 472 | | ide->drive[drive].features[ 4*2+0] = 0; /* 4: vendor specific (obsolete) */ |
| 473 | | ide->drive[drive].features[ 4*2+1] = 0; |
| 474 | | ide->drive[drive].features[ 5*2+0] = 0; /* 5: vendor specific (obsolete) */ |
| 475 | | ide->drive[drive].features[ 5*2+1] = 0; |
| 476 | | ide->drive[drive].features[ 6*2+0] = ide->drive[drive].num_sectors & 0xff; /* 6: logical sectors per logical track */ |
| 477 | | ide->drive[drive].features[ 6*2+1] = 0;/*ide->num_sectors >> 8;*/ |
| 478 | | ide->drive[drive].features[ 7*2+0] = 0; /* 7: vendor-specific */ |
| 479 | | ide->drive[drive].features[ 7*2+1] = 0; |
| 480 | | ide->drive[drive].features[ 8*2+0] = 0; /* 8: vendor-specific */ |
| 481 | | ide->drive[drive].features[ 8*2+1] = 0; |
| 482 | | ide->drive[drive].features[ 9*2+0] = 0; /* 9: vendor-specific */ |
| 483 | | ide->drive[drive].features[ 9*2+1] = 0; |
| 484 | | swap_strncpy(&ide->drive[drive].features[10*2+0], /* 10-19: serial number */ |
| 449 | m_features[ 0*2+0] = 0x5a; /* 0: configuration bits */ |
| 450 | m_features[ 0*2+1] = 0x04; |
| 451 | m_features[ 1*2+0] = m_num_cylinders & 0xff; /* 1: logical cylinders */ |
| 452 | m_features[ 1*2+1] = m_num_cylinders >> 8; |
| 453 | m_features[ 2*2+0] = 0; /* 2: reserved */ |
| 454 | m_features[ 2*2+1] = 0; |
| 455 | m_features[ 3*2+0] = m_num_heads & 0xff; /* 3: logical heads */ |
| 456 | m_features[ 3*2+1] = 0;/*ide->num_heads >> 8;*/ |
| 457 | m_features[ 4*2+0] = 0; /* 4: vendor specific (obsolete) */ |
| 458 | m_features[ 4*2+1] = 0; |
| 459 | m_features[ 5*2+0] = 0; /* 5: vendor specific (obsolete) */ |
| 460 | m_features[ 5*2+1] = 0; |
| 461 | m_features[ 6*2+0] = m_num_sectors & 0xff; /* 6: logical sectors per logical track */ |
| 462 | m_features[ 6*2+1] = 0;/*ide->num_sectors >> 8;*/ |
| 463 | m_features[ 7*2+0] = 0; /* 7: vendor-specific */ |
| 464 | m_features[ 7*2+1] = 0; |
| 465 | m_features[ 8*2+0] = 0; /* 8: vendor-specific */ |
| 466 | m_features[ 8*2+1] = 0; |
| 467 | m_features[ 9*2+0] = 0; /* 9: vendor-specific */ |
| 468 | m_features[ 9*2+1] = 0; |
| 469 | swap_strncpy(&m_features[10*2+0], /* 10-19: serial number */ |
| 485 | 470 | "00000000000000000000", 10); |
| 486 | | ide->drive[drive].features[20*2+0] = 0; /* 20: vendor-specific */ |
| 487 | | ide->drive[drive].features[20*2+1] = 0; |
| 488 | | ide->drive[drive].features[21*2+0] = 0; /* 21: vendor-specific */ |
| 489 | | ide->drive[drive].features[21*2+1] = 0; |
| 490 | | ide->drive[drive].features[22*2+0] = 4; /* 22: # of vendor-specific bytes on read/write long commands */ |
| 491 | | ide->drive[drive].features[22*2+1] = 0; |
| 492 | | swap_strncpy(&ide->drive[drive].features[23*2+0], /* 23-26: firmware revision */ |
| 471 | m_features[20*2+0] = 0; /* 20: vendor-specific */ |
| 472 | m_features[20*2+1] = 0; |
| 473 | m_features[21*2+0] = 0; /* 21: vendor-specific */ |
| 474 | m_features[21*2+1] = 0; |
| 475 | m_features[22*2+0] = 4; /* 22: # of vendor-specific bytes on read/write long commands */ |
| 476 | m_features[22*2+1] = 0; |
| 477 | swap_strncpy(&m_features[23*2+0], /* 23-26: firmware revision */ |
| 493 | 478 | "1.0", 4); |
| 494 | | swap_strncpy(&ide->drive[drive].features[27*2+0], /* 27-46: model number */ |
| 479 | swap_strncpy(&m_features[27*2+0], /* 27-46: model number */ |
| 495 | 480 | "MAME Compressed Hard Disk", 20); |
| 496 | | ide->drive[drive].features[47*2+0] = 0x01; /* 47: read/write multiple support */ |
| 497 | | ide->drive[drive].features[47*2+1] = 0x80; |
| 498 | | ide->drive[drive].features[48*2+0] = 0; /* 48: reserved */ |
| 499 | | ide->drive[drive].features[48*2+1] = 0; |
| 500 | | ide->drive[drive].features[49*2+0] = 0x03; /* 49: capabilities */ |
| 501 | | ide->drive[drive].features[49*2+1] = 0x0f; |
| 502 | | ide->drive[drive].features[50*2+0] = 0; /* 50: reserved */ |
| 503 | | ide->drive[drive].features[50*2+1] = 0; |
| 504 | | ide->drive[drive].features[51*2+0] = 2; /* 51: PIO data transfer cycle timing mode */ |
| 505 | | ide->drive[drive].features[51*2+1] = 0; |
| 506 | | ide->drive[drive].features[52*2+0] = 2; /* 52: single word DMA transfer cycle timing mode */ |
| 507 | | ide->drive[drive].features[52*2+1] = 0; |
| 508 | | ide->drive[drive].features[53*2+0] = 3; /* 53: field validity */ |
| 509 | | ide->drive[drive].features[53*2+1] = 0; |
| 510 | | ide->drive[drive].features[54*2+0] = ide->drive[drive].num_cylinders & 0xff; /* 54: number of current logical cylinders */ |
| 511 | | ide->drive[drive].features[54*2+1] = ide->drive[drive].num_cylinders >> 8; |
| 512 | | ide->drive[drive].features[55*2+0] = ide->drive[drive].num_heads & 0xff; /* 55: number of current logical heads */ |
| 513 | | ide->drive[drive].features[55*2+1] = 0;/*ide->num_heads >> 8;*/ |
| 514 | | ide->drive[drive].features[56*2+0] = ide->drive[drive].num_sectors & 0xff; /* 56: number of current logical sectors per track */ |
| 515 | | ide->drive[drive].features[56*2+1] = 0;/*ide->num_sectors >> 8;*/ |
| 516 | | ide->drive[drive].features[57*2+0] = sectors_per_track & 0xff; /* 57-58: number of current logical sectors per track */ |
| 517 | | ide->drive[drive].features[57*2+1] = sectors_per_track >> 8; |
| 518 | | ide->drive[drive].features[58*2+0] = sectors_per_track >> 16; |
| 519 | | ide->drive[drive].features[58*2+1] = sectors_per_track >> 24; |
| 520 | | ide->drive[drive].features[59*2+0] = 0; /* 59: multiple sector timing */ |
| 521 | | ide->drive[drive].features[59*2+1] = 0; |
| 522 | | ide->drive[drive].features[60*2+0] = total_sectors & 0xff; /* 60-61: total user addressable sectors */ |
| 523 | | ide->drive[drive].features[60*2+1] = total_sectors >> 8; |
| 524 | | ide->drive[drive].features[61*2+0] = total_sectors >> 16; |
| 525 | | ide->drive[drive].features[61*2+1] = total_sectors >> 24; |
| 526 | | ide->drive[drive].features[62*2+0] = 0x07; /* 62: single word dma transfer */ |
| 527 | | ide->drive[drive].features[62*2+1] = 0x00; |
| 528 | | ide->drive[drive].features[63*2+0] = 0x07; /* 63: multiword DMA transfer */ |
| 529 | | ide->drive[drive].features[63*2+1] = 0x04; |
| 530 | | ide->drive[drive].features[64*2+0] = 0x03; /* 64: flow control PIO transfer modes supported */ |
| 531 | | ide->drive[drive].features[64*2+1] = 0x00; |
| 532 | | ide->drive[drive].features[65*2+0] = 0x78; /* 65: minimum multiword DMA transfer cycle time per word */ |
| 533 | | ide->drive[drive].features[65*2+1] = 0x00; |
| 534 | | ide->drive[drive].features[66*2+0] = 0x78; /* 66: mfr's recommended multiword DMA transfer cycle time */ |
| 535 | | ide->drive[drive].features[66*2+1] = 0x00; |
| 536 | | ide->drive[drive].features[67*2+0] = 0x4d; /* 67: minimum PIO transfer cycle time without flow control */ |
| 537 | | ide->drive[drive].features[67*2+1] = 0x01; |
| 538 | | ide->drive[drive].features[68*2+0] = 0x78; /* 68: minimum PIO transfer cycle time with IORDY */ |
| 539 | | ide->drive[drive].features[68*2+1] = 0x00; |
| 540 | | ide->drive[drive].features[69*2+0] = 0x00; /* 69-70: reserved */ |
| 541 | | ide->drive[drive].features[69*2+1] = 0x00; |
| 542 | | ide->drive[drive].features[71*2+0] = 0x00; /* 71: reserved for IDENTIFY PACKET command */ |
| 543 | | ide->drive[drive].features[71*2+1] = 0x00; |
| 544 | | ide->drive[drive].features[72*2+0] = 0x00; /* 72: reserved for IDENTIFY PACKET command */ |
| 545 | | ide->drive[drive].features[72*2+1] = 0x00; |
| 546 | | ide->drive[drive].features[73*2+0] = 0x00; /* 73: reserved for IDENTIFY PACKET command */ |
| 547 | | ide->drive[drive].features[73*2+1] = 0x00; |
| 548 | | ide->drive[drive].features[74*2+0] = 0x00; /* 74: reserved for IDENTIFY PACKET command */ |
| 549 | | ide->drive[drive].features[74*2+1] = 0x00; |
| 550 | | ide->drive[drive].features[75*2+0] = 0x00; /* 75: queue depth */ |
| 551 | | ide->drive[drive].features[75*2+1] = 0x00; |
| 552 | | ide->drive[drive].features[76*2+0] = 0x00; /* 76-79: reserved */ |
| 553 | | ide->drive[drive].features[76*2+1] = 0x00; |
| 554 | | ide->drive[drive].features[80*2+0] = 0x00; /* 80: major version number */ |
| 555 | | ide->drive[drive].features[80*2+1] = 0x00; |
| 556 | | ide->drive[drive].features[81*2+0] = 0x00; /* 81: minor version number */ |
| 557 | | ide->drive[drive].features[81*2+1] = 0x00; |
| 558 | | ide->drive[drive].features[82*2+0] = 0x00; /* 82: command set supported */ |
| 559 | | ide->drive[drive].features[82*2+1] = 0x00; |
| 560 | | ide->drive[drive].features[83*2+0] = 0x00; /* 83: command sets supported */ |
| 561 | | ide->drive[drive].features[83*2+1] = 0x00; |
| 562 | | ide->drive[drive].features[84*2+0] = 0x00; /* 84: command set/feature supported extension */ |
| 563 | | ide->drive[drive].features[84*2+1] = 0x00; |
| 564 | | ide->drive[drive].features[85*2+0] = 0x00; /* 85: command set/feature enabled */ |
| 565 | | ide->drive[drive].features[85*2+1] = 0x00; |
| 566 | | ide->drive[drive].features[86*2+0] = 0x00; /* 86: command set/feature enabled */ |
| 567 | | ide->drive[drive].features[86*2+1] = 0x00; |
| 568 | | ide->drive[drive].features[87*2+0] = 0x00; /* 87: command set/feature default */ |
| 569 | | ide->drive[drive].features[87*2+1] = 0x00; |
| 570 | | ide->drive[drive].features[88*2+0] = 0x00; /* 88: additional DMA modes */ |
| 571 | | ide->drive[drive].features[88*2+1] = 0x00; |
| 572 | | ide->drive[drive].features[89*2+0] = 0x00; /* 89: time required for security erase unit completion */ |
| 573 | | ide->drive[drive].features[89*2+1] = 0x00; |
| 574 | | ide->drive[drive].features[90*2+0] = 0x00; /* 90: time required for enhanced security erase unit completion */ |
| 575 | | ide->drive[drive].features[90*2+1] = 0x00; |
| 576 | | ide->drive[drive].features[91*2+0] = 0x00; /* 91: current advanced power management value */ |
| 577 | | ide->drive[drive].features[91*2+1] = 0x00; |
| 578 | | ide->drive[drive].features[92*2+0] = 0x00; /* 92: master password revision code */ |
| 579 | | ide->drive[drive].features[92*2+1] = 0x00; |
| 580 | | ide->drive[drive].features[93*2+0] = 0x00; /* 93: hardware reset result */ |
| 581 | | ide->drive[drive].features[93*2+1] = 0x00; |
| 582 | | ide->drive[drive].features[94*2+0] = 0x00; /* 94: acoustic management values */ |
| 583 | | ide->drive[drive].features[94*2+1] = 0x00; |
| 584 | | ide->drive[drive].features[95*2+0] = 0x00; /* 95-99: reserved */ |
| 585 | | ide->drive[drive].features[95*2+1] = 0x00; |
| 586 | | ide->drive[drive].features[100*2+0] = total_sectors & 0xff; /* 100-103: maximum 48-bit LBA */ |
| 587 | | ide->drive[drive].features[100*2+1] = total_sectors >> 8; |
| 588 | | ide->drive[drive].features[101*2+0] = total_sectors >> 16; |
| 589 | | ide->drive[drive].features[101*2+1] = total_sectors >> 24; |
| 590 | | ide->drive[drive].features[102*2+0] = 0x00; |
| 591 | | ide->drive[drive].features[102*2+1] = 0x00; |
| 592 | | ide->drive[drive].features[103*2+0] = 0x00; |
| 593 | | ide->drive[drive].features[103*2+1] = 0x00; |
| 594 | | ide->drive[drive].features[104*2+0] = 0x00; /* 104-126: reserved */ |
| 595 | | ide->drive[drive].features[104*2+1] = 0x00; |
| 596 | | ide->drive[drive].features[127*2+0] = 0x00; /* 127: removable media status notification */ |
| 597 | | ide->drive[drive].features[127*2+1] = 0x00; |
| 598 | | ide->drive[drive].features[128*2+0] = 0x00; /* 128: security status */ |
| 599 | | ide->drive[drive].features[128*2+1] = 0x00; |
| 600 | | ide->drive[drive].features[129*2+0] = 0x00; /* 129-159: vendor specific */ |
| 601 | | ide->drive[drive].features[129*2+1] = 0x00; |
| 602 | | ide->drive[drive].features[160*2+0] = 0x00; /* 160: CFA power mode 1 */ |
| 603 | | ide->drive[drive].features[160*2+1] = 0x00; |
| 604 | | ide->drive[drive].features[161*2+0] = 0x00; /* 161-175: reserved for CompactFlash */ |
| 605 | | ide->drive[drive].features[161*2+1] = 0x00; |
| 606 | | ide->drive[drive].features[176*2+0] = 0x00; /* 176-205: current media serial number */ |
| 607 | | ide->drive[drive].features[176*2+1] = 0x00; |
| 608 | | ide->drive[drive].features[206*2+0] = 0x00; /* 206-254: reserved */ |
| 609 | | ide->drive[drive].features[206*2+1] = 0x00; |
| 610 | | ide->drive[drive].features[255*2+0] = 0x00; /* 255: integrity word */ |
| 611 | | ide->drive[drive].features[255*2+1] = 0x00; |
| 481 | m_features[47*2+0] = 0x01; /* 47: read/write multiple support */ |
| 482 | m_features[47*2+1] = 0x80; |
| 483 | m_features[48*2+0] = 0; /* 48: reserved */ |
| 484 | m_features[48*2+1] = 0; |
| 485 | m_features[49*2+0] = 0x03; /* 49: capabilities */ |
| 486 | m_features[49*2+1] = 0x0f; |
| 487 | m_features[50*2+0] = 0; /* 50: reserved */ |
| 488 | m_features[50*2+1] = 0; |
| 489 | m_features[51*2+0] = 2; /* 51: PIO data transfer cycle timing mode */ |
| 490 | m_features[51*2+1] = 0; |
| 491 | m_features[52*2+0] = 2; /* 52: single word DMA transfer cycle timing mode */ |
| 492 | m_features[52*2+1] = 0; |
| 493 | m_features[53*2+0] = 3; /* 53: field validity */ |
| 494 | m_features[53*2+1] = 0; |
| 495 | m_features[54*2+0] = m_num_cylinders & 0xff; /* 54: number of current logical cylinders */ |
| 496 | m_features[54*2+1] = m_num_cylinders >> 8; |
| 497 | m_features[55*2+0] = m_num_heads & 0xff; /* 55: number of current logical heads */ |
| 498 | m_features[55*2+1] = 0;/*ide->num_heads >> 8;*/ |
| 499 | m_features[56*2+0] = m_num_sectors & 0xff; /* 56: number of current logical sectors per track */ |
| 500 | m_features[56*2+1] = 0;/*ide->num_sectors >> 8;*/ |
| 501 | m_features[57*2+0] = sectors_per_track & 0xff; /* 57-58: number of current logical sectors per track */ |
| 502 | m_features[57*2+1] = sectors_per_track >> 8; |
| 503 | m_features[58*2+0] = sectors_per_track >> 16; |
| 504 | m_features[58*2+1] = sectors_per_track >> 24; |
| 505 | m_features[59*2+0] = 0; /* 59: multiple sector timing */ |
| 506 | m_features[59*2+1] = 0; |
| 507 | m_features[60*2+0] = total_sectors & 0xff; /* 60-61: total user addressable sectors */ |
| 508 | m_features[60*2+1] = total_sectors >> 8; |
| 509 | m_features[61*2+0] = total_sectors >> 16; |
| 510 | m_features[61*2+1] = total_sectors >> 24; |
| 511 | m_features[62*2+0] = 0x07; /* 62: single word dma transfer */ |
| 512 | m_features[62*2+1] = 0x00; |
| 513 | m_features[63*2+0] = 0x07; /* 63: multiword DMA transfer */ |
| 514 | m_features[63*2+1] = 0x04; |
| 515 | m_features[64*2+0] = 0x03; /* 64: flow control PIO transfer modes supported */ |
| 516 | m_features[64*2+1] = 0x00; |
| 517 | m_features[65*2+0] = 0x78; /* 65: minimum multiword DMA transfer cycle time per word */ |
| 518 | m_features[65*2+1] = 0x00; |
| 519 | m_features[66*2+0] = 0x78; /* 66: mfr's recommended multiword DMA transfer cycle time */ |
| 520 | m_features[66*2+1] = 0x00; |
| 521 | m_features[67*2+0] = 0x4d; /* 67: minimum PIO transfer cycle time without flow control */ |
| 522 | m_features[67*2+1] = 0x01; |
| 523 | m_features[68*2+0] = 0x78; /* 68: minimum PIO transfer cycle time with IORDY */ |
| 524 | m_features[68*2+1] = 0x00; |
| 525 | m_features[69*2+0] = 0x00; /* 69-70: reserved */ |
| 526 | m_features[69*2+1] = 0x00; |
| 527 | m_features[71*2+0] = 0x00; /* 71: reserved for IDENTIFY PACKET command */ |
| 528 | m_features[71*2+1] = 0x00; |
| 529 | m_features[72*2+0] = 0x00; /* 72: reserved for IDENTIFY PACKET command */ |
| 530 | m_features[72*2+1] = 0x00; |
| 531 | m_features[73*2+0] = 0x00; /* 73: reserved for IDENTIFY PACKET command */ |
| 532 | m_features[73*2+1] = 0x00; |
| 533 | m_features[74*2+0] = 0x00; /* 74: reserved for IDENTIFY PACKET command */ |
| 534 | m_features[74*2+1] = 0x00; |
| 535 | m_features[75*2+0] = 0x00; /* 75: queue depth */ |
| 536 | m_features[75*2+1] = 0x00; |
| 537 | m_features[76*2+0] = 0x00; /* 76-79: reserved */ |
| 538 | m_features[76*2+1] = 0x00; |
| 539 | m_features[80*2+0] = 0x00; /* 80: major version number */ |
| 540 | m_features[80*2+1] = 0x00; |
| 541 | m_features[81*2+0] = 0x00; /* 81: minor version number */ |
| 542 | m_features[81*2+1] = 0x00; |
| 543 | m_features[82*2+0] = 0x00; /* 82: command set supported */ |
| 544 | m_features[82*2+1] = 0x00; |
| 545 | m_features[83*2+0] = 0x00; /* 83: command sets supported */ |
| 546 | m_features[83*2+1] = 0x00; |
| 547 | m_features[84*2+0] = 0x00; /* 84: command set/feature supported extension */ |
| 548 | m_features[84*2+1] = 0x00; |
| 549 | m_features[85*2+0] = 0x00; /* 85: command set/feature enabled */ |
| 550 | m_features[85*2+1] = 0x00; |
| 551 | m_features[86*2+0] = 0x00; /* 86: command set/feature enabled */ |
| 552 | m_features[86*2+1] = 0x00; |
| 553 | m_features[87*2+0] = 0x00; /* 87: command set/feature default */ |
| 554 | m_features[87*2+1] = 0x00; |
| 555 | m_features[88*2+0] = 0x00; /* 88: additional DMA modes */ |
| 556 | m_features[88*2+1] = 0x00; |
| 557 | m_features[89*2+0] = 0x00; /* 89: time required for security erase unit completion */ |
| 558 | m_features[89*2+1] = 0x00; |
| 559 | m_features[90*2+0] = 0x00; /* 90: time required for enhanced security erase unit completion */ |
| 560 | m_features[90*2+1] = 0x00; |
| 561 | m_features[91*2+0] = 0x00; /* 91: current advanced power management value */ |
| 562 | m_features[91*2+1] = 0x00; |
| 563 | m_features[92*2+0] = 0x00; /* 92: master password revision code */ |
| 564 | m_features[92*2+1] = 0x00; |
| 565 | m_features[93*2+0] = 0x00; /* 93: hardware reset result */ |
| 566 | m_features[93*2+1] = 0x00; |
| 567 | m_features[94*2+0] = 0x00; /* 94: acoustic management values */ |
| 568 | m_features[94*2+1] = 0x00; |
| 569 | m_features[95*2+0] = 0x00; /* 95-99: reserved */ |
| 570 | m_features[95*2+1] = 0x00; |
| 571 | m_features[100*2+0] = total_sectors & 0xff; /* 100-103: maximum 48-bit LBA */ |
| 572 | m_features[100*2+1] = total_sectors >> 8; |
| 573 | m_features[101*2+0] = total_sectors >> 16; |
| 574 | m_features[101*2+1] = total_sectors >> 24; |
| 575 | m_features[102*2+0] = 0x00; |
| 576 | m_features[102*2+1] = 0x00; |
| 577 | m_features[103*2+0] = 0x00; |
| 578 | m_features[103*2+1] = 0x00; |
| 579 | m_features[104*2+0] = 0x00; /* 104-126: reserved */ |
| 580 | m_features[104*2+1] = 0x00; |
| 581 | m_features[127*2+0] = 0x00; /* 127: removable media status notification */ |
| 582 | m_features[127*2+1] = 0x00; |
| 583 | m_features[128*2+0] = 0x00; /* 128: security status */ |
| 584 | m_features[128*2+1] = 0x00; |
| 585 | m_features[129*2+0] = 0x00; /* 129-159: vendor specific */ |
| 586 | m_features[129*2+1] = 0x00; |
| 587 | m_features[160*2+0] = 0x00; /* 160: CFA power mode 1 */ |
| 588 | m_features[160*2+1] = 0x00; |
| 589 | m_features[161*2+0] = 0x00; /* 161-175: reserved for CompactFlash */ |
| 590 | m_features[161*2+1] = 0x00; |
| 591 | m_features[176*2+0] = 0x00; /* 176-205: current media serial number */ |
| 592 | m_features[176*2+1] = 0x00; |
| 593 | m_features[206*2+0] = 0x00; /* 206-254: reserved */ |
| 594 | m_features[206*2+1] = 0x00; |
| 595 | m_features[255*2+0] = 0x00; /* 255: integrity word */ |
| 596 | m_features[255*2+1] = 0x00; |
| 612 | 597 | } |
| 613 | 598 | |
| 614 | | |
| 615 | | static void ide_build_features(ide_state *ide, int drive) |
| 616 | | { |
| 617 | | memset(ide->drive[drive].features, 0, IDE_DISK_SECTOR_SIZE); |
| 618 | | if (chd_get_metadata (ide->drive[drive].handle, HARD_DISK_IDENT_METADATA_TAG, 0, ide->drive[drive].features, IDE_DISK_SECTOR_SIZE, 0, 0, 0) != CHDERR_NONE) |
| 619 | | ide_generate_features (ide,drive); |
| 620 | | } |
| 621 | | |
| 622 | 599 | /************************************* |
| 623 | 600 | * |
| 624 | 601 | * security error handling |
| r14399 | r14400 | |
| 743 | 720 | return; |
| 744 | 721 | } |
| 745 | 722 | /* now do the read */ |
| 746 | | if (ide->drive[ide->cur_drive].disk) |
| 747 | | count = hard_disk_read(ide->drive[ide->cur_drive].disk, lba, ide->buffer); |
| 748 | | else if (ide->hardware != NULL) { |
| 749 | | count = ide->hardware->read_sector(ide->device, lba, ide->buffer); |
| 723 | if (ide->drive[ide->cur_drive].slot) { |
| 724 | count = ide->drive[ide->cur_drive].slot->read_sector(lba, ide->buffer); |
| 750 | 725 | } |
| 751 | 726 | |
| 752 | 727 | /* by default, mark the buffer ready and the seek complete */ |
| r14399 | r14400 | |
| 944 | 919 | int lba = lba_address(ide), count = 0; |
| 945 | 920 | |
| 946 | 921 | /* now do the write */ |
| 947 | | if (ide->drive[ide->cur_drive].disk) |
| 948 | | count = hard_disk_write(ide->drive[ide->cur_drive].disk, lba, ide->buffer); |
| 949 | | else if (ide->hardware != NULL) { |
| 950 | | count = ide->hardware->write_sector(ide->device, lba, ide->buffer); |
| 951 | | } |
| 922 | if (ide->drive[ide->cur_drive].slot) { |
| 923 | count = ide->drive[ide->cur_drive].slot->write_sector(lba, ide->buffer); |
| 924 | } |
| 952 | 925 | |
| 953 | 926 | /* by default, mark the buffer ready and the seek complete */ |
| 954 | 927 | ide->status |= IDE_STATUS_BUFFER_READY; |
| r14399 | r14400 | |
| 1152 | 1125 | ide->sector_count = 1; |
| 1153 | 1126 | |
| 1154 | 1127 | /* build the features page */ |
| 1155 | | memcpy(ide->buffer, ide->drive[ide->cur_drive].features, sizeof(ide->buffer)); |
| 1128 | if (ide->drive[ide->cur_drive].slot->get_features()) { |
| 1129 | memcpy(ide->buffer, ide->drive[ide->cur_drive].slot->get_features(), sizeof(ide->buffer)); |
| 1130 | } |
| 1156 | 1131 | |
| 1157 | 1132 | /* indicate everything is ready */ |
| 1158 | 1133 | ide->status |= IDE_STATUS_BUFFER_READY; |
| r14399 | r14400 | |
| 1198 | 1173 | LOGPRINT(("IDE Set configuration (%d heads, %d sectors)\n", ide->drive[ide->cur_drive].cur_head + 1, ide->sector_count)); |
| 1199 | 1174 | ide->status &= ~IDE_STATUS_ERROR; |
| 1200 | 1175 | ide->error = IDE_ERROR_NONE; |
| 1201 | | |
| 1202 | | ide->drive[ide->cur_drive].num_sectors = ide->sector_count; |
| 1203 | | ide->drive[ide->cur_drive].num_heads = ide->drive[ide->cur_drive].cur_head + 1; |
| 1204 | | |
| 1176 | ide->drive[ide->cur_drive].slot->set_geometry(ide->sector_count,ide->drive[ide->cur_drive].cur_head + 1); |
| 1177 | |
| 1205 | 1178 | /* signal an interrupt */ |
| 1206 | 1179 | signal_delayed_interrupt(ide, MINIMUM_COMMAND_TIME, 0); |
| 1207 | 1180 | break; |
| r14399 | r14400 | |
| 1258 | 1231 | LOGPRINT(("IDE GNET Unlock 3\n")); |
| 1259 | 1232 | |
| 1260 | 1233 | /* key check */ |
| 1261 | | chd_get_metadata (ide->drive[ide->cur_drive].handle, HARD_DISK_KEY_METADATA_TAG, 0, key, 5, 0, 0, 0); |
| 1234 | ide->drive[ide->cur_drive].slot->read_key(key); |
| 1262 | 1235 | if ((ide->precomp_offset == key[0]) && (ide->sector_count == key[1]) && (ide->drive[ide->cur_drive].cur_sector == key[2]) && (ide->drive[ide->cur_drive].cur_cylinder == (((UINT16)key[4]<<8)|key[3]))) |
| 1263 | 1236 | { |
| 1264 | 1237 | ide->gnetreadlock= 0; |
| r14399 | r14400 | |
| 1313 | 1286 | // if (BANK(bank, offset) != IDE_BANK0_DATA && BANK(bank, offset) != IDE_BANK0_STATUS_COMMAND && BANK(bank, offset) != IDE_BANK1_STATUS_CONTROL) |
| 1314 | 1287 | LOG(("%s:IDE read at %d:%X, size=%d\n", device->machine().describe_context(), bank, offset, size)); |
| 1315 | 1288 | |
| 1316 | | if (ide->drive[ide->cur_drive].disk) { |
| 1289 | if (ide->drive[ide->cur_drive].slot->is_ready()) { |
| 1317 | 1290 | ide->status |= IDE_STATUS_DRIVE_READY; |
| 1318 | 1291 | } else { |
| 1319 | 1292 | ide->status &= ~IDE_STATUS_DRIVE_READY; |
| r14399 | r14400 | |
| 1505 | 1478 | { |
| 1506 | 1479 | UINT8 key[5] = { 0, 0, 0, 0, 0 }; |
| 1507 | 1480 | int i, bad = 0; |
| 1508 | | chd_get_metadata (ide->drive[ide->cur_drive].handle, HARD_DISK_KEY_METADATA_TAG, 0, key, 5, 0, 0, 0); |
| 1481 | ide->drive[ide->cur_drive].slot->read_key(key); |
| 1509 | 1482 | |
| 1510 | 1483 | for (i=0; !bad && i<512; i++) |
| 1511 | 1484 | bad = ((i < 2 || i >= 7) && ide->buffer[i]) || ((i >= 2 && i < 7) && ide->buffer[i] != key[i-2]); |
| r14399 | r14400 | |
| 1859 | 1832 | static DEVICE_START( ide_controller ) |
| 1860 | 1833 | { |
| 1861 | 1834 | ide_state *ide = get_safe_token(device); |
| 1862 | | const hard_disk_info *hdinfo; |
| 1863 | 1835 | const ide_config *config; |
| 1864 | 1836 | |
| 1865 | 1837 | /* validate some basic stuff */ |
| r14399 | r14400 | |
| 1873 | 1845 | /* set MAME harddisk handle */ |
| 1874 | 1846 | config = (const ide_config *)downcast<const legacy_device_base *>(device)->inline_config(); |
| 1875 | 1847 | |
| 1876 | | ide->drive[0].handle = get_disk_handle(device->machine(), (config->master != NULL) ? config->master : device->tag()); |
| 1877 | | ide->drive[0].disk = hard_disk_open(ide->drive[0].handle); |
| 1878 | | ide->drive[0].is_image_device = false; |
| 1848 | ide->drive[0].slot = device->owner()->subdevice<ide_slot_device>("drive_0"); |
| 1849 | ide->drive[1].slot = device->owner()->subdevice<ide_slot_device>("drive_1"); |
| 1879 | 1850 | |
| 1880 | | if (config->slave) { |
| 1881 | | ide->drive[1].handle = get_disk_handle(device->machine(), config->slave); |
| 1882 | | ide->drive[1].disk = hard_disk_open(ide->drive[1].handle); |
| 1883 | | ide->drive[1].is_image_device = false; |
| 1884 | | } |
| 1885 | | |
| 1886 | | //assert_always(config->slave == NULL, "IDE controller does not yet support slave drives\n"); |
| 1887 | | |
| 1888 | 1851 | /* find the bus master space */ |
| 1889 | 1852 | if (config->bmcpu != NULL) |
| 1890 | 1853 | { |
| r14399 | r14400 | |
| 1900 | 1863 | ide->dma_address_xor = (ide->dma_space->endianness() == ENDIANNESS_LITTLE) ? 0 : 3; |
| 1901 | 1864 | } |
| 1902 | 1865 | |
| 1903 | | /* get and copy the geometry */ |
| 1904 | | if (ide->drive[0].disk != NULL) |
| 1905 | | { |
| 1906 | | hdinfo = hard_disk_get_info(ide->drive[0].disk); |
| 1907 | | if (hdinfo->sectorbytes == IDE_DISK_SECTOR_SIZE) |
| 1908 | | { |
| 1909 | | ide->drive[0].num_cylinders = hdinfo->cylinders; |
| 1910 | | ide->drive[0].num_sectors = hdinfo->sectors; |
| 1911 | | ide->drive[0].num_heads = hdinfo->heads; |
| 1912 | | if (PRINTF_IDE_COMMANDS) mame_printf_debug("CHS: %d %d %d\n", ide->drive[0].num_cylinders, ide->drive[0].num_heads, ide->drive[0].num_sectors); |
| 1913 | | } |
| 1914 | | |
| 1915 | | /* build the features page */ |
| 1916 | | ide_build_features(ide,0); |
| 1917 | | } |
| 1918 | | if (ide->drive[1].disk != NULL) |
| 1919 | | { |
| 1920 | | hdinfo = hard_disk_get_info(ide->drive[1].disk); |
| 1921 | | if (hdinfo->sectorbytes == IDE_DISK_SECTOR_SIZE) |
| 1922 | | { |
| 1923 | | ide->drive[1].num_cylinders = hdinfo->cylinders; |
| 1924 | | ide->drive[1].num_sectors = hdinfo->sectors; |
| 1925 | | ide->drive[1].num_heads = hdinfo->heads; |
| 1926 | | if (PRINTF_IDE_COMMANDS) mame_printf_debug("CHS: %d %d %d\n", ide->drive[1].num_cylinders, ide->drive[1].num_heads, ide->drive[1].num_sectors); |
| 1927 | | } |
| 1928 | | |
| 1929 | | /* build the features page */ |
| 1930 | | ide_build_features(ide,1); |
| 1931 | | } |
| 1932 | | if (config->hardware != NULL) { |
| 1933 | | ide->hardware = (ide_hardware *)config->hardware; |
| 1934 | | ide->hardware->get_info(ide->device, ide->drive[0].features, ide->drive[0].num_cylinders, ide->drive[0].num_sectors, ide->drive[0].num_heads); |
| 1935 | | ide_generate_features (ide,0); |
| 1936 | | } |
| 1937 | | |
| 1938 | 1866 | /* create a timer for timing status */ |
| 1939 | 1867 | ide->last_status_timer = device->machine().scheduler().timer_alloc(FUNC_NULL); |
| 1940 | 1868 | ide->reset_timer = device->machine().scheduler().timer_alloc(FUNC(reset_callback), (void *)device); |
| r14399 | r14400 | |
| 1986 | 1914 | device->save_item(NAME(ide->gnetreadlock)); |
| 1987 | 1915 | } |
| 1988 | 1916 | |
| 1989 | | |
| 1990 | 1917 | /*------------------------------------------------- |
| 1991 | | device exit callback |
| 1992 | | -------------------------------------------------*/ |
| 1993 | | |
| 1994 | | static DEVICE_STOP( ide_controller ) |
| 1995 | | { |
| 1996 | | ide_state *ide = get_safe_token(device); |
| 1997 | | if (!ide->drive[0].is_image_device) { |
| 1998 | | /* close the hard disk */ |
| 1999 | | if (ide->drive[0].disk != NULL) |
| 2000 | | hard_disk_close(ide->drive[0].disk); |
| 2001 | | } |
| 2002 | | if (!ide->drive[1].is_image_device) { |
| 2003 | | /* close the hard disk */ |
| 2004 | | if (ide->drive[1].disk != NULL) |
| 2005 | | hard_disk_close(ide->drive[1].disk); |
| 2006 | | } |
| 2007 | | } |
| 2008 | | |
| 2009 | | |
| 2010 | | /*------------------------------------------------- |
| 2011 | 1918 | device reset callback |
| 2012 | 1919 | -------------------------------------------------*/ |
| 2013 | 1920 | |
| 2014 | 1921 | static DEVICE_RESET( ide_controller ) |
| 2015 | 1922 | { |
| 2016 | 1923 | ide_state *ide = get_safe_token(device); |
| 2017 | | const ide_config *config = (const ide_config *)downcast<const legacy_device_base *>(device)->inline_config(); |
| 2018 | | |
| 1924 | LOG(("IDE controller reset performed\n")); |
| 1925 | /* reset the drive state */ |
| 2019 | 1926 | ide->cur_drive = 0; |
| 2020 | | LOG(("IDE controller reset performed\n")); |
| 2021 | | if (config->master) { |
| 2022 | | astring hardtag_master; |
| 2023 | | device->siblingtag(hardtag_master, config->master); |
| 2024 | | if (!ide->drive[0].disk) |
| 2025 | | { |
| 2026 | | ide->drive[0].handle = device->machine().device<harddisk_image_device>(hardtag_master.cstr())->get_chd_file(); // should be config->master |
| 2027 | | |
| 2028 | | if (ide->drive[0].handle) |
| 2029 | | { |
| 2030 | | ide->drive[0].disk = device->machine().device<harddisk_image_device>(hardtag_master.cstr())->get_hard_disk_file(); // should be config->master |
| 2031 | | ide->drive[0].is_image_device = true; |
| 2032 | | |
| 2033 | | if (ide->drive[0].disk != NULL) |
| 2034 | | { |
| 2035 | | const hard_disk_info *hdinfo; |
| 2036 | | |
| 2037 | | hdinfo = hard_disk_get_info(ide->drive[0].disk); |
| 2038 | | if (hdinfo->sectorbytes == IDE_DISK_SECTOR_SIZE) |
| 2039 | | { |
| 2040 | | ide->drive[0].num_cylinders = hdinfo->cylinders; |
| 2041 | | ide->drive[0].num_sectors = hdinfo->sectors; |
| 2042 | | ide->drive[0].num_heads = hdinfo->heads; |
| 2043 | | if (PRINTF_IDE_COMMANDS) printf("CHS: %d %d %d\n", ide->drive[0].num_cylinders, ide->drive[0].num_heads, ide->drive[0].num_sectors); |
| 2044 | | } |
| 2045 | | |
| 2046 | | /* build the features page */ |
| 2047 | | ide_build_features(ide,0); |
| 2048 | | } |
| 2049 | | } |
| 2050 | | } |
| 2051 | | } |
| 2052 | | if (config->slave) { |
| 2053 | | astring hardtag_slave; |
| 2054 | | device->siblingtag(hardtag_slave, config->slave); |
| 2055 | | if (!ide->drive[1].disk) |
| 2056 | | { |
| 2057 | | ide->drive[1].handle = device->machine().device<harddisk_image_device>(hardtag_slave.cstr())->get_chd_file(); // should be config->master |
| 2058 | | |
| 2059 | | if (ide->drive[1].handle) |
| 2060 | | { |
| 2061 | | ide->drive[1].disk = device->machine().device<harddisk_image_device>(hardtag_slave.cstr())->get_hard_disk_file(); // should be config->master |
| 2062 | | ide->drive[1].is_image_device = true; |
| 2063 | | |
| 2064 | | if (ide->drive[1].disk != NULL) |
| 2065 | | { |
| 2066 | | const hard_disk_info *hdinfo; |
| 2067 | | |
| 2068 | | hdinfo = hard_disk_get_info(ide->drive[1].disk); |
| 2069 | | if (hdinfo->sectorbytes == IDE_DISK_SECTOR_SIZE) |
| 2070 | | { |
| 2071 | | ide->drive[1].num_cylinders = hdinfo->cylinders; |
| 2072 | | ide->drive[1].num_sectors = hdinfo->sectors; |
| 2073 | | ide->drive[1].num_heads = hdinfo->heads; |
| 2074 | | if (PRINTF_IDE_COMMANDS) printf("CHS: %d %d %d\n", ide->drive[1].num_cylinders, ide->drive[1].num_heads, ide->drive[1].num_sectors); |
| 2075 | | } |
| 2076 | | |
| 2077 | | /* build the features page */ |
| 2078 | | ide_build_features(ide,1); |
| 2079 | | } |
| 2080 | | } |
| 2081 | | } |
| 2082 | | } |
| 2083 | | if (ide->hardware != NULL) { |
| 2084 | | ide->hardware->get_info(ide->device, ide->drive[0].features, ide->drive[0].num_cylinders, ide->drive[0].num_sectors, ide->drive[0].num_heads); |
| 2085 | | ide_generate_features (ide,0); |
| 2086 | | } |
| 2087 | | |
| 2088 | | /* reset the drive state */ |
| 2089 | 1927 | ide->status = IDE_STATUS_DRIVE_READY | IDE_STATUS_SEEK_COMPLETE; |
| 2090 | 1928 | ide->error = IDE_ERROR_DEFAULT; |
| 2091 | 1929 | ide->buffer_offset = 0; |
| r14399 | r14400 | |
| 2095 | 1933 | clear_interrupt(ide); |
| 2096 | 1934 | } |
| 2097 | 1935 | |
| 1936 | SLOT_INTERFACE_START(ide_image_devices) |
| 1937 | SLOT_INTERFACE("hdd", IDE_HARDDISK_IMAGE) |
| 1938 | SLOT_INTERFACE_END |
| 2098 | 1939 | |
| 1940 | SLOT_INTERFACE_START(ide_devices) |
| 1941 | SLOT_INTERFACE("hdd", IDE_HARDDISK) |
| 1942 | SLOT_INTERFACE_END |
| 1943 | |
| 2099 | 1944 | /*------------------------------------------------- |
| 2100 | 1945 | device get info callback |
| 2101 | 1946 | -------------------------------------------------*/ |
| r14399 | r14400 | |
| 2110 | 1955 | |
| 2111 | 1956 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2112 | 1957 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(ide_controller); break; |
| 2113 | | case DEVINFO_FCT_STOP: info->stop = DEVICE_STOP_NAME(ide_controller); break; |
| 2114 | 1958 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(ide_controller);break; |
| 2115 | 1959 | |
| 2116 | 1960 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r14399 | r14400 | |
| 2124 | 1968 | |
| 2125 | 1969 | |
| 2126 | 1970 | DEFINE_LEGACY_DEVICE(IDE_CONTROLLER, ide_controller); |
| 1971 | |
| 1972 | //************************************************************************** |
| 1973 | // IDE SLOT DEVICE |
| 1974 | //************************************************************************** |
| 1975 | |
| 1976 | // device type definition |
| 1977 | const device_type IDE_SLOT = &device_creator<ide_slot_device>; |
| 1978 | |
| 1979 | //------------------------------------------------- |
| 1980 | // ide_slot_device - constructor |
| 1981 | //------------------------------------------------- |
| 1982 | |
| 1983 | ide_slot_device::ide_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 1984 | : device_t(mconfig, IDE_SLOT, "IDE Connector", tag, owner, clock), |
| 1985 | device_slot_interface(mconfig, *this), |
| 1986 | m_dev(NULL) |
| 1987 | { |
| 1988 | |
| 1989 | } |
| 1990 | |
| 1991 | //------------------------------------------------- |
| 1992 | // device_config_complete - perform any |
| 1993 | // operations now that the configuration is |
| 1994 | // complete |
| 1995 | //------------------------------------------------- |
| 1996 | |
| 1997 | void ide_slot_device::device_config_complete() |
| 1998 | { |
| 1999 | m_dev = dynamic_cast<ide_device_interface *>(get_card_device()); |
| 2000 | } |
| 2001 | |
| 2002 | //------------------------------------------------- |
| 2003 | // device_start - device-specific startup |
| 2004 | //------------------------------------------------- |
| 2005 | |
| 2006 | void ide_slot_device::device_start() |
| 2007 | { |
| 2008 | } |
| 2009 | |
| 2010 | //************************************************************************** |
| 2011 | // IDE DEVICE INTERFACE |
| 2012 | //************************************************************************** |
| 2013 | |
| 2014 | //------------------------------------------------- |
| 2015 | // ide_device_interface - constructor |
| 2016 | //------------------------------------------------- |
| 2017 | |
| 2018 | ide_device_interface::ide_device_interface(const machine_config &mconfig, device_t &device) |
| 2019 | : device_slot_card_interface(mconfig, device) |
| 2020 | { |
| 2021 | } |
| 2022 | |
| 2023 | |
| 2024 | //************************************************************************** |
| 2025 | // IDE HARD DISK DEVICE |
| 2026 | //************************************************************************** |
| 2027 | |
| 2028 | // device type definition |
| 2029 | const device_type IDE_HARDDISK = &device_creator<ide_hdd_device>; |
| 2030 | |
| 2031 | //------------------------------------------------- |
| 2032 | // ide_hdd_device - constructor |
| 2033 | //------------------------------------------------- |
| 2034 | |
| 2035 | ide_hdd_device::ide_hdd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 2036 | : device_t(mconfig, IDE_HARDDISK, "IDE Hard Disk", tag, owner, clock), |
| 2037 | ide_device_interface( mconfig, *this ) |
| 2038 | { |
| 2039 | } |
| 2040 | |
| 2041 | ide_hdd_device::ide_hdd_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) : |
| 2042 | device_t(mconfig, type, name, tag, owner, clock), |
| 2043 | ide_device_interface(mconfig, *this) |
| 2044 | { |
| 2045 | } |
| 2046 | |
| 2047 | //------------------------------------------------- |
| 2048 | // device_start - device-specific startup |
| 2049 | //------------------------------------------------- |
| 2050 | |
| 2051 | void ide_hdd_device::device_start() |
| 2052 | { |
| 2053 | } |
| 2054 | |
| 2055 | //------------------------------------------------- |
| 2056 | // device_reset - device-specific reset |
| 2057 | //------------------------------------------------- |
| 2058 | |
| 2059 | void ide_hdd_device::device_reset() |
| 2060 | { |
| 2061 | m_handle = get_disk_handle(machine(), owner()->tag()); |
| 2062 | m_disk = hard_disk_open(m_handle); |
| 2063 | |
| 2064 | if (m_disk != NULL) |
| 2065 | { |
| 2066 | const hard_disk_info *hdinfo = hard_disk_get_info(m_disk); |
| 2067 | if (hdinfo->sectorbytes == IDE_DISK_SECTOR_SIZE) |
| 2068 | { |
| 2069 | m_num_cylinders = hdinfo->cylinders; |
| 2070 | m_num_sectors = hdinfo->sectors; |
| 2071 | m_num_heads = hdinfo->heads; |
| 2072 | if (PRINTF_IDE_COMMANDS) mame_printf_debug("CHS: %d %d %d\n", m_num_cylinders, m_num_heads, m_num_sectors); |
| 2073 | mame_printf_debug("CHS: %d %d %d\n", m_num_cylinders, m_num_heads, m_num_sectors); |
| 2074 | } |
| 2075 | // build the features page |
| 2076 | if (chd_get_metadata (m_handle, HARD_DISK_IDENT_METADATA_TAG, 0, m_features, IDE_DISK_SECTOR_SIZE, 0, 0, 0) != CHDERR_NONE) |
| 2077 | ide_build_features(); |
| 2078 | } |
| 2079 | } |
| 2080 | |
| 2081 | //------------------------------------------------- |
| 2082 | // read device key |
| 2083 | //------------------------------------------------- |
| 2084 | |
| 2085 | void ide_hdd_device::read_key(UINT8 key[]) |
| 2086 | { |
| 2087 | chd_get_metadata(m_handle, HARD_DISK_KEY_METADATA_TAG, 0, key, 5, 0, 0, 0); |
| 2088 | } |
| 2089 | |
| 2090 | //************************************************************************** |
| 2091 | // IDE HARD DISK IMAGE DEVICE |
| 2092 | //************************************************************************** |
| 2093 | |
| 2094 | // device type definition |
| 2095 | const device_type IDE_HARDDISK_IMAGE = &device_creator<ide_hdd_image_device>; |
| 2096 | |
| 2097 | //------------------------------------------------- |
| 2098 | // ide_hdd_image_device - constructor |
| 2099 | //------------------------------------------------- |
| 2100 | |
| 2101 | ide_hdd_image_device::ide_hdd_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 2102 | : ide_hdd_device(mconfig, IDE_HARDDISK_IMAGE, "IDE Hard Disk Image", tag, owner, clock) |
| 2103 | { |
| 2104 | } |
| 2105 | |
| 2106 | //------------------------------------------------- |
| 2107 | // device_start - device-specific startup |
| 2108 | //------------------------------------------------- |
| 2109 | |
| 2110 | void ide_hdd_image_device::device_start() |
| 2111 | { |
| 2112 | } |
| 2113 | |
| 2114 | //------------------------------------------------- |
| 2115 | // device_reset - device-specific reset |
| 2116 | //------------------------------------------------- |
| 2117 | |
| 2118 | void ide_hdd_image_device::device_reset() |
| 2119 | { |
| 2120 | m_handle = subdevice<harddisk_image_device>("harddisk")->get_chd_file(); // should be config->master |
| 2121 | |
| 2122 | if (m_handle) |
| 2123 | { |
| 2124 | m_disk = subdevice<harddisk_image_device>("harddisk")->get_hard_disk_file(); // should be config->master |
| 2125 | |
| 2126 | if (m_disk != NULL) |
| 2127 | { |
| 2128 | const hard_disk_info *hdinfo; |
| 2129 | |
| 2130 | hdinfo = hard_disk_get_info(m_disk); |
| 2131 | if (hdinfo->sectorbytes == IDE_DISK_SECTOR_SIZE) |
| 2132 | { |
| 2133 | m_num_cylinders = hdinfo->cylinders; |
| 2134 | m_num_sectors = hdinfo->sectors; |
| 2135 | m_num_heads = hdinfo->heads; |
| 2136 | if (PRINTF_IDE_COMMANDS) printf("CHS: %d %d %d\n", m_num_cylinders, m_num_heads, m_num_sectors); |
| 2137 | } |
| 2138 | // build the features page |
| 2139 | if (chd_get_metadata (m_handle, HARD_DISK_IDENT_METADATA_TAG, 0, m_features, IDE_DISK_SECTOR_SIZE, 0, 0, 0) != CHDERR_NONE) |
| 2140 | ide_build_features(); |
| 2141 | } |
| 2142 | } |
| 2143 | |
| 2144 | } |
| 2145 | |
| 2146 | //------------------------------------------------- |
| 2147 | // machine_config_additions - device-specific |
| 2148 | // machine configurations |
| 2149 | //------------------------------------------------- |
| 2150 | static MACHINE_CONFIG_FRAGMENT( hdd_image ) |
| 2151 | MCFG_HARDDISK_ADD( "harddisk" ) |
| 2152 | MACHINE_CONFIG_END |
| 2153 | |
| 2154 | machine_config_constructor ide_hdd_image_device::device_mconfig_additions() const |
| 2155 | { |
| 2156 | return MACHINE_CONFIG_NAME( hdd_image ); |
| 2157 | } |
| 2158 | |
src/emu/machine/idectrl.h
| r14399 | r14400 | |
| 17 | 17 | #include "devlegcy.h" |
| 18 | 18 | |
| 19 | 19 | #include "harddisk.h" |
| 20 | #include "imagedev/harddriv.h" |
| 20 | 21 | |
| 22 | #define IDE_DISK_SECTOR_SIZE 512 |
| 21 | 23 | |
| 22 | 24 | /*************************************************************************** |
| 23 | 25 | TYPE DEFINITIONS |
| 24 | 26 | ***************************************************************************/ |
| 25 | | typedef struct _ide_hardware ide_hardware; |
| 26 | | struct _ide_hardware |
| 27 | // ======================> ide_device_interface |
| 28 | |
| 29 | class ide_device_interface : public device_slot_card_interface |
| 27 | 30 | { |
| 28 | | void (*get_info)(device_t *device, UINT8 *buffer, UINT16 &cylinders, UINT8 §ors, UINT8 &heads); |
| 29 | | int (*read_sector)(device_t *device, UINT32 lba, void *buffer); |
| 30 | | int (*write_sector)(device_t *device, UINT32 lba, const void *buffer); |
| 31 | public: |
| 32 | ide_device_interface(const machine_config &mconfig, device_t &device); |
| 33 | public: |
| 34 | virtual int read_sector(UINT32 lba, void *buffer) = 0; |
| 35 | virtual int write_sector(UINT32 lba, const void *buffer) = 0; |
| 36 | |
| 37 | UINT8 *get_features() { return m_features;} |
| 38 | |
| 39 | UINT16 get_cylinders() { return m_num_cylinders; } |
| 40 | UINT16 get_sectors() { return m_num_sectors; } |
| 41 | UINT16 get_heads() { return m_num_heads; } |
| 42 | void set_geometry(UINT8 sectors, UINT8 heads) { m_num_sectors= sectors; m_num_heads=heads; } |
| 43 | virtual bool is_ready() { return true; } |
| 44 | virtual void read_key(UINT8 key[]) { } |
| 45 | protected: |
| 46 | UINT8 m_features[IDE_DISK_SECTOR_SIZE]; |
| 47 | UINT16 m_num_cylinders; |
| 48 | UINT8 m_num_sectors; |
| 49 | UINT8 m_num_heads; |
| 31 | 50 | }; |
| 32 | 51 | |
| 52 | // ======================> ide_slot_device |
| 53 | |
| 54 | class ide_slot_device : public device_t, |
| 55 | public device_slot_interface |
| 56 | { |
| 57 | public: |
| 58 | // construction/destruction |
| 59 | ide_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 60 | |
| 61 | int read_sector(UINT32 lba, void *buffer) { return (m_dev) ? m_dev->read_sector(lba,buffer) : 0; } |
| 62 | int write_sector(UINT32 lba, const void *buffer) { return (m_dev) ? m_dev->write_sector(lba,buffer) : 0; } |
| 63 | UINT8 *get_features() { return (m_dev) ? m_dev->get_features() : NULL;} |
| 64 | |
| 65 | UINT16 get_cylinders() { return (m_dev) ? m_dev->get_cylinders() : 0; } |
| 66 | UINT16 get_sectors() { return (m_dev) ? m_dev->get_sectors() : 0; } |
| 67 | UINT16 get_heads() { return (m_dev) ? m_dev->get_heads() : 0; } |
| 68 | void set_geometry(UINT8 sectors, UINT8 heads) { if (m_dev) m_dev->set_geometry(sectors,heads); } |
| 69 | bool is_ready() { return (m_dev) ? m_dev->is_ready() : false; } |
| 70 | void read_key(UINT8 key[]) { if (m_dev) m_dev->read_key(key); } |
| 71 | protected: |
| 72 | // device-level overrides |
| 73 | virtual void device_start(); |
| 74 | virtual void device_config_complete(); |
| 75 | private: |
| 76 | ide_device_interface *m_dev; |
| 77 | }; |
| 78 | |
| 79 | // device type definition |
| 80 | extern const device_type IDE_SLOT; |
| 81 | |
| 82 | // ======================> ide_hdd_device |
| 83 | |
| 84 | class ide_hdd_device : public device_t, |
| 85 | public ide_device_interface |
| 86 | { |
| 87 | public: |
| 88 | // construction/destruction |
| 89 | ide_hdd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 90 | ide_hdd_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); |
| 91 | |
| 92 | virtual int read_sector(UINT32 lba, void *buffer) { return hard_disk_read(m_disk, lba, buffer); } |
| 93 | virtual int write_sector(UINT32 lba, const void *buffer) { return hard_disk_write(m_disk, lba, buffer); } |
| 94 | virtual void read_key(UINT8 key[]); |
| 95 | protected: |
| 96 | // device-level overrides |
| 97 | virtual void device_start(); |
| 98 | virtual void device_reset(); |
| 99 | |
| 100 | void ide_build_features(); |
| 101 | virtual bool is_ready() { return (m_disk != NULL); } |
| 102 | protected: |
| 103 | chd_file *m_handle; |
| 104 | hard_disk_file *m_disk; |
| 105 | }; |
| 106 | // device type definition |
| 107 | extern const device_type IDE_HARDDISK; |
| 108 | |
| 109 | // ======================> ide_hdd_image_device |
| 110 | |
| 111 | class ide_hdd_image_device : public ide_hdd_device |
| 112 | { |
| 113 | public: |
| 114 | // construction/destruction |
| 115 | ide_hdd_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 116 | protected: |
| 117 | // device-level overrides |
| 118 | virtual void device_start(); |
| 119 | virtual void device_reset(); |
| 120 | // optional information overrides |
| 121 | virtual machine_config_constructor device_mconfig_additions() const; |
| 122 | }; |
| 123 | // device type definition |
| 124 | extern const device_type IDE_HARDDISK_IMAGE; |
| 125 | |
| 126 | /*************************************************************************** |
| 127 | TYPE DEFINITIONS |
| 128 | ***************************************************************************/ |
| 129 | |
| 33 | 130 | typedef struct _ide_config ide_config; |
| 34 | 131 | struct _ide_config |
| 35 | 132 | { |
| r14399 | r14400 | |
| 38 | 135 | const char *slave; /* name of slave region (defaults to NULL) */ |
| 39 | 136 | const char *bmcpu; /* name of bus master CPU */ |
| 40 | 137 | UINT32 bmspace; /* address space of bus master transfer */ |
| 41 | | const ide_hardware *hardware; /* connected to hardware that is not an hard disk */ |
| 42 | 138 | }; |
| 43 | 139 | |
| 44 | 140 | |
| 141 | SLOT_INTERFACE_EXTERN(ide_devices); |
| 142 | SLOT_INTERFACE_EXTERN(ide_image_devices); |
| 45 | 143 | |
| 46 | 144 | /*************************************************************************** |
| 47 | 145 | DEVICE CONFIGURATION MACROS |
| 48 | 146 | ***************************************************************************/ |
| 49 | 147 | |
| 50 | | #define MCFG_IDE_CONTROLLER_ADD(_tag, _callback) \ |
| 148 | #define MCFG_IDE_CONTROLLER_ADD(_tag, _callback, _slotintf, _master, _slave) \ |
| 51 | 149 | MCFG_DEVICE_ADD(_tag, IDE_CONTROLLER, 0) \ |
| 52 | | MCFG_DEVICE_CONFIG_DATAPTR(ide_config, interrupt, _callback) |
| 150 | MCFG_DEVICE_CONFIG_DATAPTR(ide_config, interrupt, _callback) \ |
| 151 | MCFG_IDE_SLOT_ADD("drive_0", _slotintf, _master, NULL) \ |
| 152 | MCFG_IDE_SLOT_ADD("drive_1", _slotintf, _slave, NULL) \ |
| 53 | 153 | |
| 54 | | #define MCFG_IDE_CONTROLLER_REGIONS(_master, _slave) \ |
| 55 | | MCFG_DEVICE_CONFIG_DATAPTR(ide_config, master, _master) \ |
| 56 | | MCFG_DEVICE_CONFIG_DATAPTR(ide_config, slave, _slave) |
| 57 | | |
| 58 | | #define MCFG_IDE_BUS_MASTER_SPACE(_cpu, _space) \ |
| 154 | #define MCFG_IDE_BUS_MASTER_SPACE(_tag, _cpu, _space) \ |
| 155 | MCFG_DEVICE_MODIFY(_tag) \ |
| 59 | 156 | MCFG_DEVICE_CONFIG_DATAPTR(ide_config, bmcpu, _cpu) \ |
| 60 | 157 | MCFG_DEVICE_CONFIG_DATA32(ide_config, bmspace, AS_##_space) |
| 61 | 158 | |
| 62 | | #define MCFG_IDE_CONNECTED_TO(_hardware) \ |
| 63 | | MCFG_DEVICE_CONFIG_DATAPTR(ide_config, hardware, _hardware) \ |
| 159 | #define MCFG_IDE_SLOT_ADD(_tag, _slot_intf, _def_slot, _def_inp) \ |
| 160 | MCFG_DEVICE_ADD(_tag, IDE_SLOT, 0) \ |
| 161 | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp) \ |
| 64 | 162 | |
| 65 | | |
| 66 | 163 | /*************************************************************************** |
| 67 | 164 | FUNCTION PROTOTYPES |
| 68 | 165 | ***************************************************************************/ |
src/emu/machine/nscsi_bus.c
| r0 | r14400 | |
| 1 | #include "nscsi_bus.h" |
| 2 | |
| 3 | const device_type NSCSI_BUS = &device_creator<nscsi_bus_device>; |
| 4 | const device_type NSCSI_CONNECTOR = &device_creator<nscsi_connector>; |
| 5 | |
| 6 | nscsi_bus_device::nscsi_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 7 | device_t(mconfig, NSCSI_BUS, "SCSI Bus", tag, owner, clock) |
| 8 | { |
| 9 | devcnt = 0; |
| 10 | memset(dev, 0, sizeof(dev)); |
| 11 | } |
| 12 | |
| 13 | void nscsi_bus_device::device_start() |
| 14 | { |
| 15 | data = 0; |
| 16 | ctrl = 0; |
| 17 | } |
| 18 | |
| 19 | void nscsi_bus_device::device_reset() |
| 20 | { |
| 21 | } |
| 22 | |
| 23 | void nscsi_bus_device::regen_data() |
| 24 | { |
| 25 | data = 0; |
| 26 | for(int i=0; i<devcnt; i++) |
| 27 | data |= dev[i].data; |
| 28 | } |
| 29 | |
| 30 | void nscsi_bus_device::regen_ctrl(int refid) |
| 31 | { |
| 32 | static const char *phase[8] = { |
| 33 | "dout", "din ", "cmd ", "stat", "4 ", "5 ", "mout", "min " |
| 34 | }; |
| 35 | |
| 36 | UINT32 octrl = ctrl; |
| 37 | ctrl = 0; |
| 38 | for(int i=0; i<devcnt; i++) |
| 39 | ctrl |= dev[i].ctrl; |
| 40 | |
| 41 | if(0) { |
| 42 | logerror("%s: ctrl %c%c%c%c%c%c%c%c%c %s %04x -", |
| 43 | tag(), |
| 44 | ctrl & nscsi_device::S_RST ? 'R' : '.', |
| 45 | ctrl & nscsi_device::S_ATN ? 'A' : '.', |
| 46 | ctrl & nscsi_device::S_ACK ? 'K' : '.', |
| 47 | ctrl & nscsi_device::S_REQ ? 'Q' : '.', |
| 48 | ctrl & nscsi_device::S_SEL ? 'S' : '.', |
| 49 | ctrl & nscsi_device::S_BSY ? 'B' : '.', |
| 50 | ctrl & nscsi_device::S_MSG ? 'M' : '.', |
| 51 | ctrl & nscsi_device::S_CTL ? 'C' : '.', |
| 52 | ctrl & nscsi_device::S_INP ? 'I' : '.', |
| 53 | phase[ctrl & 7], |
| 54 | data); |
| 55 | for(int i=0; i<devcnt; i++) |
| 56 | if(dev[i].ctrl) { |
| 57 | logerror(" %d=", i); |
| 58 | logerror("%s%s%s%s%s%s%s%s%s", |
| 59 | dev[i].ctrl & nscsi_device::S_RST ? "R" : "", |
| 60 | dev[i].ctrl & nscsi_device::S_ATN ? "A" : "", |
| 61 | dev[i].ctrl & nscsi_device::S_ACK ? "K" : "", |
| 62 | dev[i].ctrl & nscsi_device::S_REQ ? "Q" : "", |
| 63 | dev[i].ctrl & nscsi_device::S_MSG ? "M" : "", |
| 64 | dev[i].ctrl & nscsi_device::S_INP ? "I" : "", |
| 65 | dev[i].ctrl & nscsi_device::S_CTL ? "C" : "", |
| 66 | dev[i].ctrl & nscsi_device::S_SEL ? "S" : "", |
| 67 | dev[i].ctrl & nscsi_device::S_BSY ? "B" : ""); |
| 68 | } |
| 69 | logerror("\n"); |
| 70 | } |
| 71 | |
| 72 | octrl = octrl ^ ctrl; |
| 73 | if(octrl) |
| 74 | for(int i=0; i<devcnt; i++) |
| 75 | if(i != refid && (dev[i].wait_ctrl & octrl)) |
| 76 | dev[i].dev->scsi_ctrl_changed(); |
| 77 | } |
| 78 | |
| 79 | UINT32 nscsi_bus_device::data_r() const |
| 80 | { |
| 81 | return data; |
| 82 | } |
| 83 | |
| 84 | UINT32 nscsi_bus_device::ctrl_r() const |
| 85 | { |
| 86 | return ctrl; |
| 87 | } |
| 88 | |
| 89 | void nscsi_bus_device::ctrl_w(int refid, UINT32 lines, UINT32 mask) |
| 90 | { |
| 91 | UINT32 c = dev[refid].ctrl; |
| 92 | dev[refid].ctrl = (c & ~mask) | (lines & mask); |
| 93 | regen_ctrl(refid); |
| 94 | } |
| 95 | |
| 96 | void nscsi_bus_device::data_w(int refid, UINT32 lines) |
| 97 | { |
| 98 | dev[refid].data = lines; |
| 99 | regen_data(); |
| 100 | } |
| 101 | |
| 102 | void nscsi_bus_device::ctrl_wait(int refid, UINT32 lines, UINT32 mask) |
| 103 | { |
| 104 | UINT32 w = dev[refid].wait_ctrl; |
| 105 | dev[refid].wait_ctrl = (w & ~mask) | (lines & mask); |
| 106 | } |
| 107 | |
| 108 | void nscsi_bus_device::device_config_complete() |
| 109 | { |
| 110 | char id[3]; |
| 111 | for(int i=0; i<16; i++) { |
| 112 | sprintf(id, "%d", i); |
| 113 | nscsi_connector *conn = downcast<nscsi_connector *>(subdevice(id)); |
| 114 | if(conn) { |
| 115 | nscsi_device *sdev = conn->get_device(); |
| 116 | if(sdev) { |
| 117 | int rid = devcnt++; |
| 118 | dev[rid].dev = sdev; |
| 119 | sdev->connect_to_bus(this, rid, i); |
| 120 | } |
| 121 | } |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | |
| 126 | nscsi_connector::nscsi_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 127 | device_t(mconfig, NSCSI_CONNECTOR, "NSCSI device connector abstraction", tag, owner, clock), |
| 128 | device_slot_interface(mconfig, *this) |
| 129 | { |
| 130 | fixed_subtag = 0; |
| 131 | } |
| 132 | |
| 133 | nscsi_connector::~nscsi_connector() |
| 134 | { |
| 135 | } |
| 136 | |
| 137 | void nscsi_connector::device_start() |
| 138 | { |
| 139 | } |
| 140 | |
| 141 | nscsi_device *nscsi_connector::get_device() |
| 142 | { |
| 143 | return dynamic_cast<nscsi_device *>(fixed_subtag ? subdevice(fixed_subtag) : get_card_device()); |
| 144 | } |
| 145 | |
| 146 | void nscsi_connector::set_fixed_device(const char *subtag) |
| 147 | { |
| 148 | fixed_subtag = subtag; |
| 149 | } |
| 150 | |
| 151 | |
| 152 | nscsi_device::nscsi_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) : |
| 153 | device_t(mconfig, type, name, tag, owner, clock), |
| 154 | device_slot_card_interface(mconfig, *this) |
| 155 | { |
| 156 | scsi_id = scsi_refid = -1; |
| 157 | scsi_bus = 0; |
| 158 | } |
| 159 | |
| 160 | void nscsi_device::connect_to_bus(nscsi_bus_device *bus, int refid, int default_scsi_id) |
| 161 | { |
| 162 | scsi_bus = bus; |
| 163 | scsi_refid = refid; |
| 164 | scsi_id = default_scsi_id; |
| 165 | } |
| 166 | |
| 167 | void nscsi_device::scsi_ctrl_changed() |
| 168 | { |
| 169 | } |
| 170 | |
| 171 | nscsi_full_device::nscsi_full_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) : |
| 172 | nscsi_device(mconfig, type, name, tag, owner, clock) |
| 173 | { |
| 174 | } |
| 175 | |
| 176 | void nscsi_full_device::device_start() |
| 177 | { |
| 178 | scsi_timer = timer_alloc(SCSI_TIMER); |
| 179 | } |
| 180 | |
| 181 | void nscsi_full_device::device_reset() |
| 182 | { |
| 183 | scsi_state = scsi_substate = IDLE; |
| 184 | buf_control_rpos = buf_control_wpos = 0; |
| 185 | scsi_identify = 0; |
| 186 | scsi_bus->data_w(scsi_refid, 0); |
| 187 | scsi_bus->ctrl_w(scsi_refid, 0, S_ALL); |
| 188 | scsi_bus->ctrl_wait(scsi_refid, S_SEL|S_BSY|S_RST, S_ALL); |
| 189 | } |
| 190 | |
| 191 | void nscsi_full_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 192 | { |
| 193 | if(id != SCSI_TIMER) |
| 194 | return; |
| 195 | |
| 196 | step(true); |
| 197 | |
| 198 | } |
| 199 | |
| 200 | void nscsi_full_device::scsi_ctrl_changed() |
| 201 | { |
| 202 | step(false); |
| 203 | } |
| 204 | |
| 205 | void nscsi_full_device::step(bool timeout) |
| 206 | { |
| 207 | UINT32 ctrl = scsi_bus->ctrl_r(); |
| 208 | UINT32 data = scsi_bus->data_r(); |
| 209 | if(ctrl & S_RST) { |
| 210 | scsi_bus->data_w(scsi_refid, 0); |
| 211 | scsi_bus->ctrl_w(scsi_refid, 0, S_ALL); |
| 212 | scsi_state = IDLE; |
| 213 | logerror("%s: scsi bus reset\n", tag()); |
| 214 | return; |
| 215 | } |
| 216 | |
| 217 | if(0) |
| 218 | logerror("%s: state=%d.%d %s\n", |
| 219 | tag(), scsi_state & STATE_MASK, (scsi_state & SUB_MASK) >> SUB_SHIFT, |
| 220 | timeout ? "timeout" : "change"); |
| 221 | |
| 222 | switch(scsi_state & SUB_MASK ? scsi_state & SUB_MASK : scsi_state & STATE_MASK) { |
| 223 | case IDLE: |
| 224 | if(((ctrl & (S_SEL|S_BSY)) == S_SEL) && (scsi_id != -1) && ((data & (1 << scsi_id)) != 0)) { |
| 225 | for(scsi_initiator_id = 0; scsi_initiator_id != 16 && (scsi_initiator_id == scsi_id || (data & (1 << scsi_initiator_id))); scsi_initiator_id++); |
| 226 | if(scsi_initiator_id == 16) |
| 227 | scsi_initiator_id = -1; |
| 228 | scsi_state = TARGET_SELECT_WAIT_BUS_SETTLE; |
| 229 | scsi_timer->adjust(scsi_bus_settle_delay()); |
| 230 | } |
| 231 | break; |
| 232 | |
| 233 | case TARGET_SELECT_WAIT_BUS_SETTLE: |
| 234 | if((ctrl & (S_SEL|S_BSY)) == S_SEL) { |
| 235 | scsi_state = TARGET_SELECT_WAIT_SEL_0; |
| 236 | scsi_bus->ctrl_w(scsi_refid, S_BSY, S_BSY); |
| 237 | } else |
| 238 | scsi_state = IDLE; |
| 239 | break; |
| 240 | |
| 241 | case TARGET_SELECT_WAIT_SEL_0: |
| 242 | if(ctrl & S_SEL) |
| 243 | break; |
| 244 | buf_control_push()->action = BC_MSG_OR_COMMAND; |
| 245 | scsi_state = TARGET_NEXT_CONTROL; |
| 246 | step(false); |
| 247 | break; |
| 248 | |
| 249 | case RECV_BYTE_T_WAIT_ACK_1 << SUB_SHIFT: |
| 250 | if(ctrl & S_ACK) { |
| 251 | received(scsi_bus->data_r()); |
| 252 | scsi_state = (scsi_state & STATE_MASK) | (RECV_BYTE_T_WAIT_ACK_0 << SUB_SHIFT); |
| 253 | scsi_bus->ctrl_w(scsi_refid, 0, S_REQ); |
| 254 | } |
| 255 | break; |
| 256 | |
| 257 | case RECV_BYTE_T_WAIT_ACK_0 << SUB_SHIFT: |
| 258 | if(!(ctrl & S_ACK)) { |
| 259 | scsi_state &= STATE_MASK; |
| 260 | scsi_bus->ctrl_wait(scsi_refid, 0, S_ACK); |
| 261 | step(false); |
| 262 | } |
| 263 | break; |
| 264 | |
| 265 | case SEND_BYTE_T_WAIT_ACK_1 << SUB_SHIFT: |
| 266 | if(ctrl & S_ACK) { |
| 267 | scsi_state = (scsi_state & STATE_MASK) | (SEND_BYTE_T_WAIT_ACK_0 << SUB_SHIFT); |
| 268 | scsi_bus->data_w(scsi_refid, 0); |
| 269 | scsi_bus->ctrl_w(scsi_refid, 0, S_REQ); |
| 270 | } |
| 271 | break; |
| 272 | |
| 273 | case SEND_BYTE_T_WAIT_ACK_0 << SUB_SHIFT: |
| 274 | if(!(ctrl & S_ACK)) { |
| 275 | scsi_state &= STATE_MASK; |
| 276 | scsi_bus->ctrl_wait(scsi_refid, 0, S_ACK); |
| 277 | step(false); |
| 278 | } |
| 279 | break; |
| 280 | |
| 281 | case TARGET_NEXT_CONTROL: { |
| 282 | control *ctl = buf_control_pop(); |
| 283 | switch(ctl->action) { |
| 284 | case BC_MSG_OR_COMMAND: |
| 285 | if(ctrl & S_ATN) { |
| 286 | scsi_state = TARGET_WAIT_MSG_BYTE; |
| 287 | scsi_bus->ctrl_w(scsi_refid, S_PHASE_MSG_OUT, S_PHASE_MASK); |
| 288 | } else { |
| 289 | scsi_state = TARGET_WAIT_CMD_BYTE; |
| 290 | scsi_bus->ctrl_w(scsi_refid, S_PHASE_COMMAND, S_PHASE_MASK); |
| 291 | } |
| 292 | scsi_cmdsize = 0; |
| 293 | target_recv_byte(); |
| 294 | break; |
| 295 | |
| 296 | case BC_STATUS: |
| 297 | scsi_bus->ctrl_w(scsi_refid, S_PHASE_STATUS, S_PHASE_MASK); |
| 298 | target_send_byte(ctl->param1); |
| 299 | break; |
| 300 | |
| 301 | case BC_DATA_IN: |
| 302 | scsi_bus->ctrl_w(scsi_refid, S_PHASE_DATA_IN, S_PHASE_MASK); |
| 303 | data_buffer_id = ctl->param1; |
| 304 | data_buffer_size = ctl->param2; |
| 305 | data_buffer_pos = 0; |
| 306 | scsi_state = TARGET_WAIT_DATA_IN_BYTE; |
| 307 | target_send_buffer_byte(); |
| 308 | break; |
| 309 | |
| 310 | case BC_MESSAGE_1: |
| 311 | scsi_bus->ctrl_w(scsi_refid, S_PHASE_MSG_IN, S_PHASE_MASK); |
| 312 | target_send_byte(ctl->param1); |
| 313 | break; |
| 314 | |
| 315 | case BC_BUS_FREE: |
| 316 | scsi_bus->data_w(scsi_refid, 0); |
| 317 | scsi_bus->ctrl_wait(scsi_refid, S_BSY|S_SEL|S_RST, S_ALL); |
| 318 | scsi_bus->ctrl_w(scsi_refid, 0, S_ALL); |
| 319 | scsi_state = IDLE; |
| 320 | break; |
| 321 | }; |
| 322 | break; |
| 323 | } |
| 324 | |
| 325 | case TARGET_WAIT_DATA_IN_BYTE: |
| 326 | if(data_buffer_pos == data_buffer_size-1) |
| 327 | scsi_state = TARGET_NEXT_CONTROL; |
| 328 | target_send_buffer_byte(); |
| 329 | break; |
| 330 | |
| 331 | case TARGET_WAIT_MSG_BYTE: |
| 332 | if(ctrl & S_SEL) |
| 333 | return; |
| 334 | if(!(ctrl & S_ATN)) { |
| 335 | scsi_message(); |
| 336 | scsi_cmdsize = 0; |
| 337 | scsi_state = TARGET_WAIT_CMD_BYTE; |
| 338 | scsi_bus->ctrl_w(scsi_refid, S_PHASE_COMMAND, S_PHASE_MASK); |
| 339 | } |
| 340 | target_recv_byte(); |
| 341 | break; |
| 342 | |
| 343 | case TARGET_WAIT_CMD_BYTE: |
| 344 | if(ctrl & S_SEL) |
| 345 | return; |
| 346 | if(ctrl & S_ATN) { |
| 347 | logerror("%s: Parity error? Say what?\n", tag()); |
| 348 | scsi_state = IDLE; |
| 349 | break; |
| 350 | } |
| 351 | |
| 352 | if(command_done()) { |
| 353 | scsi_bus->ctrl_wait(scsi_refid, 0, S_ACK); |
| 354 | scsi_command(); |
| 355 | scsi_state = TARGET_NEXT_CONTROL; |
| 356 | step(false); |
| 357 | } else |
| 358 | target_recv_byte(); |
| 359 | break; |
| 360 | |
| 361 | default: |
| 362 | logerror("%s: step() unexpected state %d.%d\n", |
| 363 | tag(), |
| 364 | scsi_state & STATE_MASK, (scsi_state & SUB_MASK) >> SUB_SHIFT); |
| 365 | exit(0); |
| 366 | } |
| 367 | } |
| 368 | |
| 369 | void nscsi_full_device::target_recv_byte() |
| 370 | { |
| 371 | scsi_bus->ctrl_wait(scsi_refid, S_ACK, S_ACK); |
| 372 | scsi_state = (scsi_state & STATE_MASK) | (RECV_BYTE_T_WAIT_ACK_1 << SUB_SHIFT); |
| 373 | scsi_bus->ctrl_w(scsi_refid, S_REQ, S_REQ); |
| 374 | step(false); |
| 375 | } |
| 376 | |
| 377 | void nscsi_full_device::target_send_byte(UINT8 val) |
| 378 | { |
| 379 | scsi_bus->ctrl_wait(scsi_refid, S_ACK, S_ACK); |
| 380 | scsi_state = (scsi_state & STATE_MASK) | (SEND_BYTE_T_WAIT_ACK_1 << SUB_SHIFT); |
| 381 | scsi_bus->data_w(scsi_refid, val); |
| 382 | scsi_bus->ctrl_w(scsi_refid, S_REQ, S_REQ); |
| 383 | step(false); |
| 384 | } |
| 385 | |
| 386 | void nscsi_full_device::received(UINT8 val) |
| 387 | { |
| 388 | scsi_cmdbuf[scsi_cmdsize++] = val; |
| 389 | } |
| 390 | |
| 391 | UINT8 nscsi_full_device::scsi_get_data(int id, int pos) |
| 392 | { |
| 393 | switch(id) { |
| 394 | case SBUF_MAIN: |
| 395 | return scsi_cmdbuf[pos]; |
| 396 | case SBUF_SENSE: |
| 397 | return scsi_sense_buffer[pos]; |
| 398 | default: |
| 399 | abort(); |
| 400 | } |
| 401 | } |
| 402 | |
| 403 | void nscsi_full_device::target_send_buffer_byte() |
| 404 | { |
| 405 | target_send_byte(scsi_get_data(data_buffer_id, data_buffer_pos++)); |
| 406 | } |
| 407 | |
| 408 | bool nscsi_full_device::command_done() |
| 409 | { |
| 410 | if(!scsi_cmdsize) |
| 411 | return false; |
| 412 | UINT8 h = scsi_cmdbuf[0]; |
| 413 | switch(h >> 5) { |
| 414 | case 0: return scsi_cmdsize == 6; |
| 415 | case 1: return scsi_cmdsize == 10; |
| 416 | case 2: return scsi_cmdsize == 10; |
| 417 | case 3: return true; |
| 418 | case 4: return true; |
| 419 | case 5: return scsi_cmdsize == 12; |
| 420 | case 6: return true; |
| 421 | case 7: return true; |
| 422 | } |
| 423 | return true; |
| 424 | } |
| 425 | |
| 426 | nscsi_full_device::control *nscsi_full_device::buf_control_push() |
| 427 | { |
| 428 | if(buf_control_wpos == int(sizeof(buf_control)/sizeof(buf_control[0]))) |
| 429 | throw emu_fatalerror("%s: buf_control overflow\n", tag()); |
| 430 | |
| 431 | control *c = buf_control + buf_control_wpos; |
| 432 | buf_control_wpos++; |
| 433 | return c; |
| 434 | } |
| 435 | |
| 436 | nscsi_full_device::control *nscsi_full_device::buf_control_pop() |
| 437 | { |
| 438 | if(buf_control_rpos == buf_control_wpos) |
| 439 | throw emu_fatalerror("%s: buf_control underflow\n", tag()); |
| 440 | |
| 441 | control *c = buf_control + buf_control_rpos; |
| 442 | buf_control_rpos++; |
| 443 | if(buf_control_rpos == buf_control_wpos) |
| 444 | buf_control_rpos = buf_control_wpos = 0; |
| 445 | return c; |
| 446 | } |
| 447 | |
| 448 | void nscsi_full_device::scsi_status_complete(UINT8 st) |
| 449 | { |
| 450 | control *c; |
| 451 | c = buf_control_push(); |
| 452 | c->action = BC_STATUS; |
| 453 | c->param1 = st; |
| 454 | c = buf_control_push(); |
| 455 | c->action = BC_MESSAGE_1; |
| 456 | c->param1 = SM_COMMAND_COMPLETE; |
| 457 | c = buf_control_push(); |
| 458 | c->action = BC_BUS_FREE; |
| 459 | } |
| 460 | |
| 461 | void nscsi_full_device::scsi_data_in(int buf, int size) |
| 462 | { |
| 463 | control *c; |
| 464 | c = buf_control_push(); |
| 465 | c->action = BC_DATA_IN; |
| 466 | c->param1 = buf; |
| 467 | c->param2 = size; |
| 468 | } |
| 469 | |
| 470 | void nscsi_full_device::scsi_data_out(int buf, int size) |
| 471 | { |
| 472 | control *c; |
| 473 | c = buf_control_push(); |
| 474 | c->action = BC_DATA_OUT; |
| 475 | c->param1 = buf; |
| 476 | c->param2 = size; |
| 477 | } |
| 478 | |
| 479 | void nscsi_full_device::sense(bool deferred, UINT8 key) |
| 480 | { |
| 481 | memset(scsi_sense_buffer, 0, sizeof(scsi_sense_buffer)); |
| 482 | scsi_sense_buffer[0] = deferred ? 0x71 : 0x70; |
| 483 | scsi_sense_buffer[2] = key; |
| 484 | } |
| 485 | |
| 486 | void nscsi_full_device::scsi_unknown_command() |
| 487 | { |
| 488 | logerror("%s: Unknown command", tag()); |
| 489 | for(int i=0; i != scsi_cmdsize; i++) |
| 490 | logerror(" %02x", scsi_cmdbuf[i]); |
| 491 | logerror("\n"); |
| 492 | |
| 493 | scsi_status_complete(SS_CHECK_CONDITION); |
| 494 | sense(false, 5); |
| 495 | } |
| 496 | |
| 497 | void nscsi_full_device::scsi_command() |
| 498 | { |
| 499 | switch(scsi_cmdbuf[0]) { |
| 500 | case SC_REQUEST_SENSE: |
| 501 | logerror("%s: command REQUEST SENSE\n", tag()); |
| 502 | scsi_data_in(SBUF_SENSE, 8); |
| 503 | scsi_status_complete(SS_GOOD); |
| 504 | break; |
| 505 | default: |
| 506 | scsi_unknown_command(); |
| 507 | break; |
| 508 | } |
| 509 | } |
| 510 | |
| 511 | void nscsi_full_device::scsi_message() |
| 512 | { |
| 513 | if(scsi_cmdbuf[0] & 0x80) { |
| 514 | scsi_identify = scsi_cmdbuf[0]; |
| 515 | return; |
| 516 | } |
| 517 | |
| 518 | logerror("%s: Unknown message", tag()); |
| 519 | for(int i=0; i != scsi_cmdsize; i++) |
| 520 | logerror(" %02x", scsi_cmdbuf[i]); |
| 521 | logerror("\n"); |
| 522 | } |
| 523 | |
| 524 | int nscsi_full_device::get_lun(int def) |
| 525 | { |
| 526 | if(scsi_identify & 0x80) |
| 527 | return scsi_identify & 0x7f; |
| 528 | return def; |
| 529 | } |
| 530 | |
| 531 | void nscsi_full_device::bad_lun() |
| 532 | { |
| 533 | scsi_status_complete(SS_CHECK_CONDITION); |
| 534 | sense(false, 2); |
| 535 | } |
| 536 | |
| 537 | // Arbitration delay (2.4us) |
| 538 | attotime nscsi_full_device::scsi_arbitation_delay() |
| 539 | { |
| 540 | return attotime::from_nsec(2400); |
| 541 | } |
| 542 | |
| 543 | // Assertion period (90ns) |
| 544 | attotime nscsi_full_device::scsi_assertion_period() |
| 545 | { |
| 546 | return attotime::from_nsec(90); |
| 547 | } |
| 548 | |
| 549 | // Bus clear delay (800ns) |
| 550 | attotime nscsi_full_device::scsi_bus_clear_delay() |
| 551 | { |
| 552 | return attotime::from_nsec(800); |
| 553 | } |
| 554 | |
| 555 | // Bus free delay (800ns) |
| 556 | attotime nscsi_full_device::scsi_bus_free_delay() |
| 557 | { |
| 558 | return attotime::from_nsec(800); |
| 559 | } |
| 560 | |
| 561 | // Bus set delay (1.8us) |
| 562 | attotime nscsi_full_device::scsi_bus_set_delay() |
| 563 | { |
| 564 | return attotime::from_nsec(1800); |
| 565 | } |
| 566 | |
| 567 | // Bus settle delay (400ns) |
| 568 | attotime nscsi_full_device::scsi_bus_settle_delay() |
| 569 | { |
| 570 | return attotime::from_nsec(400); |
| 571 | } |
| 572 | |
| 573 | // Cable skew delay (10ns) |
| 574 | attotime nscsi_full_device::scsi_cable_skew_delay() |
| 575 | { |
| 576 | return attotime::from_nsec(10); |
| 577 | } |
| 578 | |
| 579 | // Data release delay (400ns) |
| 580 | attotime nscsi_full_device::scsi_data_release_delay() |
| 581 | { |
| 582 | return attotime::from_nsec(40); |
| 583 | } |
| 584 | |
| 585 | // Deskew delay (45ns) |
| 586 | attotime nscsi_full_device::scsi_deskew_delay() |
| 587 | { |
| 588 | return attotime::from_nsec(45); |
| 589 | } |
| 590 | |
| 591 | // Disconnection delay (200us) |
| 592 | attotime nscsi_full_device::scsi_disconnection_delay() |
| 593 | { |
| 594 | return attotime::from_usec(200); |
| 595 | } |
| 596 | |
| 597 | // Hold time (45ns) |
| 598 | attotime nscsi_full_device::scsi_hold_time() |
| 599 | { |
| 600 | return attotime::from_nsec(45); |
| 601 | } |
| 602 | |
| 603 | // Negation period (90ns) |
| 604 | attotime nscsi_full_device::scsi_negation_period() |
| 605 | { |
| 606 | return attotime::from_nsec(90); |
| 607 | } |
| 608 | |
| 609 | // Reset hold time (25us) |
| 610 | attotime nscsi_full_device::scsi_reset_hold_time() |
| 611 | { |
| 612 | return attotime::from_usec(25); |
| 613 | } |
| 614 | |
| 615 | // Selection abort time (200us) |
| 616 | attotime nscsi_full_device::scsi_selection_abort_time() |
| 617 | { |
| 618 | return attotime::from_usec(200); |
| 619 | } |
| 620 | |
| 621 | // Selection timeout delay (250ms) |
| 622 | attotime nscsi_full_device::scsi_selection_timeout_delay() |
| 623 | { |
| 624 | return attotime::from_msec(250); |
| 625 | } |
| 626 | |
| 627 | // Fast assertion period (30ns) |
| 628 | attotime nscsi_full_device::scsi_fast_assertion_period() |
| 629 | { |
| 630 | return attotime::from_nsec(30); |
| 631 | } |
| 632 | |
| 633 | // Fast cable skew delay (5ns) |
| 634 | attotime nscsi_full_device::scsi_fast_cable_skew_delay() |
| 635 | { |
| 636 | return attotime::from_nsec(5); |
| 637 | } |
| 638 | |
| 639 | // Fast deskew delay (20ns) |
| 640 | attotime nscsi_full_device::scsi_fast_deskew_delay() |
| 641 | { |
| 642 | return attotime::from_nsec(20); |
| 643 | } |
| 644 | |
| 645 | // Fast hold time (10ns) |
| 646 | attotime nscsi_full_device::scsi_fast_hold_time() |
| 647 | { |
| 648 | return attotime::from_nsec(10); |
| 649 | } |
| 650 | |
| 651 | // Fast negation period (30ns) |
| 652 | attotime nscsi_full_device::scsi_fast_negation_period() |
| 653 | { |
| 654 | return attotime::from_nsec(30); |
| 655 | } |
| 656 | |
src/emu/machine/nscsi_bus.h
| r0 | r14400 | |
| 1 | #ifndef __NSCSI_BUS_H__ |
| 2 | #define __NSCSI_BUS_H__ |
| 3 | |
| 4 | #include "emu.h" |
| 5 | |
| 6 | #define MCFG_NSCSI_BUS_ADD(_tag) \ |
| 7 | MCFG_DEVICE_ADD(_tag, NSCSI_BUS, 0) |
| 8 | |
| 9 | #define MCFG_NSCSI_DEVICE_ADD(_tag, _subtag, _type, _clock) \ |
| 10 | MCFG_DEVICE_ADD(_tag, NSCSI_CONNECTOR, 0) \ |
| 11 | downcast<nscsi_connector *>(device)->set_fixed_device(_subtag); \ |
| 12 | MCFG_DEVICE_ADD(_tag ":" _subtag, _type, _clock) |
| 13 | |
| 14 | #define MCFG_NSCSI_FULL_DEVICE_ADD(_tag, _subtag, _type, _clock) \ |
| 15 | MCFG_NSCSI_DEVICE_ADD(_tag, _subtag, _type, _clock) |
| 16 | |
| 17 | #define MCFG_NSCSI_ADD(_tag, _slot_intf, _def_slot, _def_inp) \ |
| 18 | MCFG_DEVICE_ADD(_tag, NSCSI_CONNECTOR, 0) \ |
| 19 | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp) |
| 20 | |
| 21 | class nscsi_device; |
| 22 | |
| 23 | class nscsi_bus_device : public device_t |
| 24 | { |
| 25 | public: |
| 26 | nscsi_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 27 | |
| 28 | void ctrl_w(int refid, UINT32 lines, UINT32 mask); |
| 29 | void data_w(int refid, UINT32 lines); |
| 30 | void ctrl_wait(int refid, UINT32 lines, UINT32 mask); |
| 31 | |
| 32 | UINT32 ctrl_r() const; |
| 33 | UINT32 data_r() const; |
| 34 | |
| 35 | protected: |
| 36 | virtual void device_start(); |
| 37 | virtual void device_reset(); |
| 38 | virtual void device_config_complete(); |
| 39 | |
| 40 | private: |
| 41 | struct dev_t { |
| 42 | nscsi_device *dev; |
| 43 | UINT32 ctrl, wait_ctrl; |
| 44 | UINT32 data; |
| 45 | }; |
| 46 | |
| 47 | dev_t dev[16]; |
| 48 | int devcnt; |
| 49 | |
| 50 | UINT32 data, ctrl; |
| 51 | |
| 52 | void regen_data(); |
| 53 | void regen_ctrl(int refid); |
| 54 | }; |
| 55 | |
| 56 | class nscsi_connector: public device_t, |
| 57 | public device_slot_interface |
| 58 | { |
| 59 | public: |
| 60 | nscsi_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 61 | virtual ~nscsi_connector(); |
| 62 | |
| 63 | nscsi_device *get_device(); |
| 64 | void set_fixed_device(const char *subtag); |
| 65 | |
| 66 | protected: |
| 67 | virtual void device_start(); |
| 68 | |
| 69 | private: |
| 70 | const char *fixed_subtag; |
| 71 | }; |
| 72 | |
| 73 | class nscsi_device : public device_t, |
| 74 | public device_slot_card_interface |
| 75 | { |
| 76 | public: |
| 77 | // Here because the biggest users are the devices, not the bus |
| 78 | enum { |
| 79 | S_INP = 0x0001, |
| 80 | S_CTL = 0x0002, |
| 81 | S_MSG = 0x0004, |
| 82 | S_BSY = 0x0008, |
| 83 | S_SEL = 0x0010, |
| 84 | S_REQ = 0x0020, |
| 85 | S_ACK = 0x0040, |
| 86 | S_ATN = 0x0080, |
| 87 | S_RST = 0x0100, |
| 88 | S_ALL = 0x01ff, |
| 89 | |
| 90 | S_PHASE_DATA_OUT = 0, |
| 91 | S_PHASE_DATA_IN = S_INP, |
| 92 | S_PHASE_COMMAND = S_CTL, |
| 93 | S_PHASE_STATUS = S_CTL|S_INP, |
| 94 | S_PHASE_MSG_OUT = S_MSG|S_CTL, |
| 95 | S_PHASE_MSG_IN = S_MSG|S_CTL|S_INP, |
| 96 | S_PHASE_MASK = S_MSG|S_CTL|S_INP, |
| 97 | }; |
| 98 | |
| 99 | nscsi_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); |
| 100 | |
| 101 | void connect_to_bus(nscsi_bus_device *bus, int refid, int default_scsi_id); |
| 102 | virtual void scsi_ctrl_changed(); |
| 103 | protected: |
| 104 | int scsi_id; |
| 105 | int scsi_refid; |
| 106 | nscsi_bus_device *scsi_bus; |
| 107 | }; |
| 108 | |
| 109 | class nscsi_full_device : public nscsi_device |
| 110 | { |
| 111 | public: |
| 112 | nscsi_full_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); |
| 113 | |
| 114 | virtual void scsi_ctrl_changed(); |
| 115 | protected: |
| 116 | enum { SCSI_TIMER = 100 }; |
| 117 | |
| 118 | // SCSI status returns |
| 119 | enum { |
| 120 | SS_GOOD = 0x00, |
| 121 | SS_CHECK_CONDITION = 0x02, |
| 122 | SS_CONDITION_MET = 0x04, |
| 123 | SS_BUSY = 0x08, |
| 124 | SS_INT_GOOD = 0x10, |
| 125 | SS_INT_CONDITION_MET = 0x14, |
| 126 | SS_RESV_CONFLICT = 0x18, |
| 127 | SS_TERMINATED = 0x22, |
| 128 | SS_QUEUE_FULL = 0x28, |
| 129 | }; |
| 130 | |
| 131 | // SCSI commands |
| 132 | enum { |
| 133 | SC_TEST_UNIT_READY = 0x00, |
| 134 | SC_REZERO = 0x01, |
| 135 | SC_REQUEST_SENSE = 0x03, |
| 136 | SC_FORMAT_UNIT = 0x04, |
| 137 | SC_REASSIGN_BLOCKS = 0x07, |
| 138 | SC_READ = 0x08, |
| 139 | SC_WRITE = 0x0a, |
| 140 | SC_SEEK = 0x0b, |
| 141 | SC_INQUIRY = 0x12, |
| 142 | SC_MODE_SELECT_6 = 0x15, |
| 143 | SC_RESERVE_6 = 0x16, |
| 144 | SC_RELEASE_6 = 0x17, |
| 145 | SC_MODE_SENSE_6 = 0x1a, |
| 146 | SC_START_STOP_UNIT = 0x1b, |
| 147 | SC_RECIEVE_DIAG_RES = 0x1c, |
| 148 | SC_SEND_DIAGNOSTICS = 0x1d, |
| 149 | SC_READ_CAPACITY = 0x25, |
| 150 | SC_READ_EXTENDED = 0x28, |
| 151 | SC_WRITE_EXTENDED = 0x2a, |
| 152 | SC_SEEK_EXTENDED = 0x2b, |
| 153 | SC_WRITE_VERIFY = 0x2e, |
| 154 | SC_VERIFY = 0x2f, |
| 155 | SC_SYNC_CACHE = 0x35, |
| 156 | SC_READ_DEFECT_DATA = 0x37, |
| 157 | SC_READ_DATA_BUFFER = 0x3c, |
| 158 | SC_READ_LONG = 0x3e, |
| 159 | SC_WRITE_LONG = 0x3f, |
| 160 | SC_CHANGE_DEFINITION = 0x40, |
| 161 | SC_LOG_SELECT = 0x4c, |
| 162 | SC_LOG_SENSE = 0x4d, |
| 163 | SC_MODE_SELECT_10 = 0x55, |
| 164 | SC_RESERVE_10 = 0x56, |
| 165 | SC_RELEASE_10 = 0x57, |
| 166 | SC_MODE_SENSE_10 = 0x5a, |
| 167 | }; |
| 168 | |
| 169 | // SCSI Messages |
| 170 | enum { |
| 171 | SM_COMMAND_COMPLETE = 0x00, |
| 172 | SM_EXTENDED_MSG = 0x01, |
| 173 | SM_SAVE_DATA_PTR = 0x02, |
| 174 | SM_RESTORE_PTR = 0x03, |
| 175 | SM_DISCONNECT = 0x04, |
| 176 | SM_INITIATOR_ERROR = 0x05, |
| 177 | SM_ABORT = 0x06, |
| 178 | SM_MSG_REJECT = 0x07, |
| 179 | SM_NOP = 0x08, |
| 180 | SM_MSG_PARITY = 0x09, |
| 181 | SM_LCMD_COMPLETE = 0x0a, |
| 182 | SM_LCMD_COMPLETE_F = 0x0b, |
| 183 | SM_BUS_DEVICE_RESET = 0x0c, |
| 184 | SM_ABORT_TAG = 0x0d, |
| 185 | SM_CLEAR_QUEUE = 0x0e, |
| 186 | SM_INIT_RECOVERY = 0x0f, |
| 187 | SM_RELEASE_RECOVERY = 0x10, |
| 188 | SM_TERMINATE_IO = 0x11, |
| 189 | SM_SIMPLE_QUEUE = 0x20, |
| 190 | SM_HEAD_QUEUE = 0x21, |
| 191 | SM_ORDERED_QUEUE = 0x22, |
| 192 | SM_IGNORE_WIDE_RES = 0x23, |
| 193 | }; |
| 194 | |
| 195 | enum { |
| 196 | SBUF_MAIN, |
| 197 | SBUF_SENSE, |
| 198 | }; |
| 199 | |
| 200 | UINT8 scsi_cmdbuf[4096], scsi_sense_buffer[8]; |
| 201 | int scsi_cmdsize; |
| 202 | UINT8 scsi_identify; |
| 203 | |
| 204 | virtual void device_start(); |
| 205 | virtual void device_reset(); |
| 206 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 207 | |
| 208 | virtual void scsi_message(); |
| 209 | virtual void scsi_command(); |
| 210 | |
| 211 | void scsi_unknown_command(); |
| 212 | void scsi_status_complete(UINT8 st); |
| 213 | void scsi_data_in(int buf, int size); |
| 214 | void scsi_data_out(int buf, int size); |
| 215 | |
| 216 | void sense(bool deferred, UINT8 key); |
| 217 | int get_lun(int def = 0); |
| 218 | void bad_lun(); |
| 219 | |
| 220 | virtual UINT8 scsi_get_data(int buf, int offset); |
| 221 | |
| 222 | // Default delays: |
| 223 | |
| 224 | // Arbitration delay (2.4us) |
| 225 | virtual attotime scsi_arbitation_delay(); |
| 226 | |
| 227 | // Assertion period (90ns) |
| 228 | virtual attotime scsi_assertion_period(); |
| 229 | |
| 230 | // Bus clear delay (800ns) |
| 231 | virtual attotime scsi_bus_clear_delay(); |
| 232 | |
| 233 | // Bus free delay (800ns) |
| 234 | virtual attotime scsi_bus_free_delay(); |
| 235 | |
| 236 | // Bus set delay (1.8us) |
| 237 | virtual attotime scsi_bus_set_delay(); |
| 238 | |
| 239 | // Bus settle delay (400ns) |
| 240 | virtual attotime scsi_bus_settle_delay(); |
| 241 | |
| 242 | // Cable skew delay (10ns) |
| 243 | virtual attotime scsi_cable_skew_delay(); |
| 244 | |
| 245 | // Data release delay (400ns) |
| 246 | virtual attotime scsi_data_release_delay(); |
| 247 | |
| 248 | // Deskew delay (45ns) |
| 249 | virtual attotime scsi_deskew_delay(); |
| 250 | |
| 251 | // Disconnection delay (200us) |
| 252 | virtual attotime scsi_disconnection_delay(); |
| 253 | |
| 254 | // Hold time (45ns) |
| 255 | virtual attotime scsi_hold_time(); |
| 256 | |
| 257 | // Negation period (90ns) |
| 258 | virtual attotime scsi_negation_period(); |
| 259 | |
| 260 | // Reset hold time (25us) |
| 261 | virtual attotime scsi_reset_hold_time(); |
| 262 | |
| 263 | // Selection abort time (200us) |
| 264 | virtual attotime scsi_selection_abort_time(); |
| 265 | |
| 266 | // Selection timeout delay (250ms) |
| 267 | virtual attotime scsi_selection_timeout_delay(); |
| 268 | |
| 269 | // Fast assertion period (30ns) |
| 270 | virtual attotime scsi_fast_assertion_period(); |
| 271 | |
| 272 | // Fast cable skew delay (5ns) |
| 273 | virtual attotime scsi_fast_cable_skew_delay(); |
| 274 | |
| 275 | // Fast deskew delay (20ns) |
| 276 | virtual attotime scsi_fast_deskew_delay(); |
| 277 | |
| 278 | // Fast hold time (10ns) |
| 279 | virtual attotime scsi_fast_hold_time(); |
| 280 | |
| 281 | // Fast negation period (30ns) |
| 282 | virtual attotime scsi_fast_negation_period(); |
| 283 | |
| 284 | private: |
| 285 | enum { |
| 286 | IDLE, |
| 287 | }; |
| 288 | |
| 289 | enum { |
| 290 | TARGET_SELECT_WAIT_BUS_SETTLE = 1, |
| 291 | TARGET_SELECT_WAIT_SEL_0, |
| 292 | |
| 293 | TARGET_NEXT_CONTROL, |
| 294 | TARGET_WAIT_MSG_BYTE, |
| 295 | TARGET_WAIT_CMD_BYTE, |
| 296 | TARGET_WAIT_DATA_IN_BYTE, |
| 297 | }; |
| 298 | |
| 299 | enum { |
| 300 | RECV_BYTE_T_WAIT_ACK_0 = 1, |
| 301 | RECV_BYTE_T_WAIT_ACK_1, |
| 302 | SEND_BYTE_T_WAIT_ACK_0, |
| 303 | SEND_BYTE_T_WAIT_ACK_1, |
| 304 | }; |
| 305 | |
| 306 | enum { |
| 307 | STATE_MASK = 0x00ff, |
| 308 | SUB_SHIFT = 8, |
| 309 | SUB_MASK = 0xff00, |
| 310 | }; |
| 311 | |
| 312 | enum { |
| 313 | BC_MSG_OR_COMMAND, |
| 314 | BC_STATUS, |
| 315 | BC_MESSAGE_1, |
| 316 | BC_MESSAGE_2, |
| 317 | BC_DATA_IN, |
| 318 | BC_DATA_OUT, |
| 319 | BC_BUS_FREE, |
| 320 | }; |
| 321 | |
| 322 | struct control { |
| 323 | int action; |
| 324 | int param1, param2; |
| 325 | }; |
| 326 | |
| 327 | emu_timer *scsi_timer; |
| 328 | |
| 329 | int scsi_state, scsi_substate; |
| 330 | int scsi_initiator_id; |
| 331 | int data_buffer_id, data_buffer_size, data_buffer_pos; |
| 332 | |
| 333 | control buf_control[32]; |
| 334 | int buf_control_rpos; |
| 335 | int buf_control_wpos; |
| 336 | |
| 337 | control *buf_control_push(); |
| 338 | control *buf_control_pop(); |
| 339 | |
| 340 | void step(bool timeout); |
| 341 | void target_recv_byte(); |
| 342 | void target_send_byte(UINT8 val); |
| 343 | void received(UINT8 val); |
| 344 | void target_send_buffer_byte(); |
| 345 | bool command_done(); |
| 346 | }; |
| 347 | |
| 348 | |
| 349 | extern const device_type NSCSI_BUS; |
| 350 | extern const device_type NSCSI_CONNECTOR; |
| 351 | |
| 352 | #endif |
| 353 | |