Previous 199869 Revisions Next

r29633 Monday 14th April, 2014 at 11:50:39 UTC by smf
SCSI Port using WRITELINE and DEVCB2. The slot number and SCSI ID are separate so you can for example have -harddisk1 as ID 6 and -harddisk 2 as ID 5. The HLE'd CD & HD have configuration switches to set the ID, real emulated hardware will specify the ID using it's own method. [smf]
[src/emu]emu.mak
[src/emu/bus]bus.mak
[src/emu/bus/a2bus]a2hsscsi.c a2scsi.c
[src/emu/bus/abcbus]hdc.c hdc.h lux21056.c lux21056.h lux4105.c lux4105.h
[src/emu/bus/cbmiec]cmdhd.c cmdhd.h
[src/emu/bus/econet]e01.c e01.h
[src/emu/bus/ieee488]d9060.c d9060.h
[src/emu/bus/scsi]acb4070.c acb4070.h cdu76s.c* cdu76s.h* d9060hd.c d9060hd.h s1410.c s1410.h sa1403d.h scsi.c* scsi.h* scsicd.c* scsicd.h* scsihd.c* scsihd.h* scsihle.c* scsihle.h*
[src/emu/bus/wangpc]wdc.c
[src/emu/bus/x68k]x68k_scsiext.c
[src/emu/machine]53c810.c 53c810.h am53cf96.c am53cf96.h atapihle.h cdu76s.c cdu76s.h legscsi.c* legscsi.h* machine.mak mb89352.c mb89352.h ncr5380.c ncr5380.h ncr539x.c ncr539x.h scsibus.c scsibus.h scsicb.c scsicb.h scsicd.c scsicd.h scsidev.c scsidev.h scsihd.c scsihd.h scsihle.c scsihle.h wd33c93.c wd33c93.h
[src/mame]mame.mak
[src/mame/drivers]cps3.c konamigq.c konamigv.c model3.c twinkle.c
[src/mame/includes]model3.h
[src/mess]mess.mak
[src/mess/drivers]bebox.c bullet.c fmtowns.c ip20.c ip22.c mac.c pc9801.c rmnimbus.c v1050.c x68k.c xerox820.c
[src/mess/includes]bebox.h bullet.h mac.h rmnimbus.h v1050.h xerox820.h
[src/mess/machine]fm_scsi.c fm_scsi.h rmnimbus.c

trunk/src/mame/drivers/twinkle.c
r29632r29633
230230#include "cpu/psx/psx.h"
231231#include "cpu/m68000/m68000.h"
232232#include "video/psx.h"
233#include "machine/scsibus.h"
234#include "machine/scsicd.h"
233#include "bus/scsi/scsi.h"
234#include "bus/scsi/scsicd.h"
235235#include "machine/am53cf96.h"
236236#include "machine/rtc65271.h"
237237#include "machine/i2cmem.h"
r29632r29633
246246public:
247247   twinkle_state(const machine_config &mconfig, device_type type, const char *tag)
248248      : driver_device(mconfig, type, tag),
249      m_am53cf96(*this, "scsi:am53cf96"),
249      m_am53cf96(*this, "am53cf96"),
250250      m_maincpu(*this, "maincpu"),
251251      m_audiocpu(*this, "audiocpu")
252252   {
r29632r29633
673673
674674static ADDRESS_MAP_START( main_map, AS_PROGRAM, 32, twinkle_state )
675675   AM_RANGE(0x1f000000, 0x1f0007ff) AM_READWRITE8(shared_psx_r, shared_psx_w, 0x00ff00ff)
676   AM_RANGE(0x1f200000, 0x1f20001f) AM_DEVREADWRITE8("scsi:am53cf96", am53cf96_device, read, write, 0x00ff00ff)
676   AM_RANGE(0x1f200000, 0x1f20001f) AM_DEVREADWRITE8("am53cf96", am53cf96_device, read, write, 0x00ff00ff)
677677   AM_RANGE(0x1f20a01c, 0x1f20a01f) AM_WRITENOP /* scsi? */
678678   AM_RANGE(0x1f210400, 0x1f2107ff) AM_READNOP
679679   AM_RANGE(0x1f218000, 0x1f218003) AM_WRITE8(watchdog_reset_w, 0x000000ff) /* LTC1232 */
r29632r29633
855855}
856856
857857
858static MACHINE_CONFIG_FRAGMENT( cdrom_config )
859   MCFG_DEVICE_MODIFY( "cdda" )
860   MCFG_SOUND_ROUTE( 0, "^^^^speakerleft", 1.0 )
861   MCFG_SOUND_ROUTE( 1, "^^^^speakerright", 1.0 )
862MACHINE_CONFIG_END
863
858864static MACHINE_CONFIG_START( twinkle, twinkle_state )
859865   /* basic machine hardware */
860866   MCFG_CPU_ADD( "maincpu", CXD8530CQ, XTAL_67_7376MHz )
r29632r29633
871877
872878   MCFG_WATCHDOG_TIME_INIT(attotime::from_msec(1200)) /* check TD pin on LTC1232 */
873879
874   MCFG_SCSIBUS_ADD("scsi")
875   MCFG_SCSIDEV_ADD("scsi:cdrom", SCSICD, SCSI_ID_4)
876   MCFG_AM53CF96_ADD("scsi:am53cf96")
877   MCFG_AM53CF96_IRQ_HANDLER(DEVWRITELINE("^maincpu:irq", psxirq_device, intin10))
880   MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
881   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "cdrom", SCSICD, SCSI_ID_4)
882   MCFG_SLOT_OPTION_MACHINE_CONFIG("cdrom", cdrom_config)
878883
884   MCFG_DEVICE_ADD("am53cf96", AM53CF96, 0)
885   MCFG_LEGACY_SCSI_PORT("scsi")
886   MCFG_AM53CF96_IRQ_HANDLER(DEVWRITELINE("maincpu:irq", psxirq_device, intin10))
887
879888   MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", NULL, true)
880889   MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(twinkle_state, ide_interrupt))
881890
r29632r29633
894903   MCFG_RF5C400_ADD("rfsnd", 32000000/2)
895904   MCFG_SOUND_ROUTE(0, "speakerleft", 1.0)
896905   MCFG_SOUND_ROUTE(1, "speakerright", 1.0)
897
898   MCFG_SOUND_MODIFY( "scsi:cdrom:cdda" )
899   MCFG_SOUND_ROUTE( 0, "^^^speakerleft", 1.0 )
900   MCFG_SOUND_ROUTE( 1, "^^^speakerright", 1.0 )
901906MACHINE_CONFIG_END
902907
903908static MACHINE_CONFIG_DERIVED( twinklex, twinkle )
r29632r29633
10011006   ROM_REGION( 0x224, "security", 0 )
10021007   ROM_LOAD( "863a02", 0x000000, 0x000224, BAD_DUMP CRC(7b2a429b) SHA1(f710d19c7b900a58584c07ab8fd3ab7b9f0121d7) )
10031008
1004   DISK_REGION( "scsi:cdrom" ) // program
1009   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" ) // program
10051010   DISK_IMAGE_READONLY( "gq863-jab01", 0, SHA1(331f80b40ed560c7e017621b7daeeb8275d92b9a) )
10061011
10071012   DISK_REGION( "cdrom1" ) // video CD
r29632r29633
10171022   ROM_REGION( 0x224, "security", 0 )
10181023   ROM_LOAD( "863a02", 0x000000, 0x000224, BAD_DUMP CRC(7b2a429b) SHA1(f710d19c7b900a58584c07ab8fd3ab7b9f0121d7) )
10191024
1020   DISK_REGION( "scsi:cdrom" ) // program
1025   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" ) // program
10211026   DISK_IMAGE_READONLY( "gq863a01", 0, SHA1(07fc467f6500504729becbaf77dabc093a134e65) )
10221027
10231028   DISK_REGION( "cdrom1" ) // video CD
r29632r29633
10331038   ROM_REGION( 0x100, "security", 0 )
10341039   ROM_LOAD( "985a02", 0x000000, 0x000100, BAD_DUMP CRC(a35143a9) SHA1(1c0feeab60d9dc50dc4b9a2f3dac73ca619e74b0) )
10351040
1036   DISK_REGION( "scsi:cdrom" )
1041   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
10371042   DISK_IMAGE_READONLY( "gc985a01", 0, SHA1(0b783f11317f64552ebf3323459139529e7f315f) )
10381043
10391044   DISK_REGION( "cdrom1" ) // video CD
r29632r29633
10491054   ROM_REGION( 0x100, "security", 0 )
10501055   ROM_LOAD( "992a02", 0x000000, 0x000100, BAD_DUMP CRC(51f24913) SHA1(574b555e3d0c234011198d218d7ae5e95091acb1) )
10511056
1052   DISK_REGION( "scsi:cdrom" )
1057   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
10531058   DISK_IMAGE_READONLY( "gc992-jac01", 0, NO_DUMP )
10541059
10551060   DISK_REGION( "cdrom1" ) // video CD
r29632r29633
10651070   ROM_REGION( 0x100, "security", 0 )
10661071   ROM_LOAD( "992a02", 0x000000, 0x000100, BAD_DUMP CRC(51f24913) SHA1(574b555e3d0c234011198d218d7ae5e95091acb1) )
10671072
1068   DISK_REGION( "scsi:cdrom" )
1073   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
10691074   DISK_IMAGE_READONLY( "gc992-jaa01", 0, BAD_DUMP SHA1(7e5389735dff379bb286ba3744edf59b7dfcc74b) )
10701075
10711076   DISK_REGION( "cdrom1" ) // video CD
r29632r29633
10811086   ROM_REGION( 0x100, "security", 0 )
10821087   ROM_LOAD( "a03", 0x000000, 0x000100, BAD_DUMP CRC(8860cfb6) SHA1(85a5b27f24d4baa7960e692b91c0cf3dc5388e72) )
10831088
1084   DISK_REGION( "scsi:cdrom" )
1089   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
10851090   DISK_IMAGE_READONLY( "a03jaa01", 0, SHA1(f54fc778c2187ccd950402a159babef956b71492   ) )
10861091
10871092   DISK_REGION( "cdrom1" ) // video CD
r29632r29633
10971102   ROM_REGION( 0x100, "security", 0 )
10981103   ROM_LOAD( "a17", 0x000000, 0x000100, BAD_DUMP CRC(9428afb0) SHA1(ba907d3361256b022583d6a42fe223e90590e3c6) )
10991104
1100   DISK_REGION( "scsi:cdrom" )
1105   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
11011106   DISK_IMAGE_READONLY( "a17jaa01", 0, BAD_DUMP SHA1(9f552eaa0acbdbddf93cabe99f8f829afbf29e02) )
11021107
11031108   DISK_REGION( "cdrom1" ) // video CD
r29632r29633
11131118   ROM_REGION( 0x100, "security", 0 )
11141119   ROM_LOAD( "b4u", 0x000000, 0x000100, BAD_DUMP CRC(0ab15633) SHA1(df004ff41f35b16089f69808ccf53a5e5cc13ac3) )
11151120
1116   DISK_REGION( "scsi:cdrom" )
1121   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
11171122   DISK_IMAGE_READONLY( "b4ujab01", 0, NO_DUMP )
11181123
11191124   DISK_REGION( "cdrom1" ) // DVD
r29632r29633
11291134   ROM_REGION( 0x100, "security", 0 )
11301135   ROM_LOAD( "b4u", 0x000000, 0x000100, BAD_DUMP CRC(0ab15633) SHA1(df004ff41f35b16089f69808ccf53a5e5cc13ac3) )
11311136
1132   DISK_REGION( "scsi:cdrom" )
1137   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
11331138   DISK_IMAGE_READONLY( "b4ujaa01", 0, BAD_DUMP SHA1(d8f5d56b8728bea761dc4cdbc04851094d276bd6) )
11341139
11351140   DISK_REGION( "cdrom1" ) // DVD
r29632r29633
11451150   ROM_REGION( 0x100, "security", 0 )
11461151   ROM_LOAD( "b44", 0x000000, 0x000100, BAD_DUMP CRC(5baf4761) SHA1(aa7e07eb2cada03b85bdf11ac6a3de65f4253eef) )
11471152
1148   DISK_REGION( "scsi:cdrom" )
1153   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
11491154   DISK_IMAGE_READONLY( "b44jaa01", 0, SHA1(57fb0312d8102e959658e48a97e46aa16e592b60) )
11501155
11511156   DISK_REGION( "cdrom1" ) // DVD
r29632r29633
11611166   ROM_REGION( 0x100, "security", 0 )
11621167   ROM_LOAD( "c44", 0x000000, 0x000100, BAD_DUMP CRC(04c22349) SHA1(d1cb78911cb1ca660d393a81ed3ed07b24c51525) )
11631168
1164   DISK_REGION( "scsi:cdrom" )
1169   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
11651170   DISK_IMAGE_READONLY( "c44jaa01", 0, BAD_DUMP SHA1(8b544c81bc56b19e4aa1649e68824811d6d51ce5) )
11661171
11671172   DISK_REGION( "cdrom1" ) // DVD
r29632r29633
11771182   ROM_REGION( 0x224, "security", 0 )
11781183   ROM_LOAD( "896a02", 0x000000, 0x000224, BAD_DUMP CRC(7b2a429b) SHA1(f710d19c7b900a58584c07ab8fd3ab7b9f0121d7) )
11791184
1180   DISK_REGION( "scsi:cdrom" )
1185   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
11811186   DISK_IMAGE_READONLY( "896jabbm", 0, BAD_DUMP SHA1(117ae4c876207bbaf9e8fe0fdf5bb161155c1bdb) )
11821187
11831188   DISK_REGION( "cdrom1" ) // video CD
r29632r29633
11931198   ROM_REGION( 0x224, "security", 0 )
11941199   ROM_LOAD( "896a02", 0x000000, 0x000224, BAD_DUMP CRC(7b2a429b) SHA1(f710d19c7b900a58584c07ab8fd3ab7b9f0121d7) )
11951200
1196   DISK_REGION( "scsi:cdrom" )
1201   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
11971202   DISK_IMAGE_READONLY( "896jaabm", 0, SHA1(ea7205f86543d9273efcc226666ab530c32b23c1) )
11981203
11991204   DISK_REGION( "cdrom1" ) // video CD
r29632r29633
12091214   ROM_REGION( 0x224, "security", 0 )
12101215   ROM_LOAD( "983a02", 0x000000, 0x000224, NO_DUMP )
12111216
1212   DISK_REGION( "scsi:cdrom" )
1217   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
12131218   DISK_IMAGE_READONLY( "gc983a01", 0, NO_DUMP )
12141219
12151220   DISK_REGION( "cdrom1" ) // video CD
r29632r29633
12251230   ROM_REGION( 0x224, "security", 0 )
12261231   ROM_LOAD( "984a02", 0x000000, 0x000224, BAD_DUMP CRC(5b08e1ef) SHA1(d43ad5d958313ccb2420246621d9180230b4782d) )
12271232
1228   DISK_REGION( "scsi:cdrom" )
1233   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
12291234   DISK_IMAGE_READONLY( "ge984a01(bm)", 0, SHA1(03b083ba09652dfab6f328000c3c9de2a7a4e618) )
12301235
12311236   DISK_REGION( "cdrom1" ) // video CD
trunk/src/mame/drivers/konamigv.c
r29632r29633
127127#include "machine/eepromser.h"
128128#include "machine/intelfsh.h"
129129#include "machine/mb89371.h"
130#include "machine/scsibus.h"
131#include "machine/scsicd.h"
130#include "bus/scsi/scsi.h"
131#include "bus/scsi/scsicd.h"
132132#include "sound/spu.h"
133133#include "sound/cdda.h"
134134
r29632r29633
137137public:
138138   konamigv_state(const machine_config &mconfig, device_type type, const char *tag)
139139      : driver_device(mconfig, type, tag),
140      m_am53cf96(*this, "scsi:am53cf96"),
140      m_am53cf96(*this, "am53cf96"),
141141      m_maincpu(*this, "maincpu")
142142   {
143143   }
r29632r29633
174174};
175175
176176static ADDRESS_MAP_START( konamigv_map, AS_PROGRAM, 32, konamigv_state )
177   AM_RANGE(0x1f000000, 0x1f00001f) AM_DEVREADWRITE8("scsi:am53cf96", am53cf96_device, read, write, 0x00ff00ff)
177   AM_RANGE(0x1f000000, 0x1f00001f) AM_DEVREADWRITE8("am53cf96", am53cf96_device, read, write, 0x00ff00ff)
178178   AM_RANGE(0x1f100000, 0x1f100003) AM_READ_PORT("P1")
179179   AM_RANGE(0x1f100004, 0x1f100007) AM_READ_PORT("P2")
180180   AM_RANGE(0x1f100008, 0x1f10000b) AM_READ_PORT("P3_P4")
r29632r29633
309309   save_item(NAME(m_btc_trackball_data));
310310}
311311
312static MACHINE_CONFIG_FRAGMENT( cdrom_config )
313   MCFG_DEVICE_MODIFY( "cdda" )
314   MCFG_SOUND_ROUTE( 0, "^^^^lspeaker", 1.0 )
315   MCFG_SOUND_ROUTE( 1, "^^^^rspeaker", 1.0 )
316MACHINE_CONFIG_END
317
312318static MACHINE_CONFIG_START( konamigv, konamigv_state )
313319   /* basic machine hardware */
314320   MCFG_CPU_ADD( "maincpu", CXD8530BQ, XTAL_67_7376MHz )
r29632r29633
323329   MCFG_DEVICE_ADD("mb89371", MB89371, 0)
324330   MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
325331
326   MCFG_SCSIBUS_ADD("scsi")
327   MCFG_SCSIDEV_ADD("scsi:cdrom", SCSICD, SCSI_ID_4)
328   MCFG_AM53CF96_ADD("scsi:am53cf96")
329   MCFG_AM53CF96_IRQ_HANDLER(DEVWRITELINE("^maincpu:irq", psxirq_device, intin10))
332   MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
333   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "cdrom", SCSICD, SCSI_ID_4)
334   MCFG_SLOT_OPTION_MACHINE_CONFIG("cdrom", cdrom_config)
330335
336   MCFG_DEVICE_ADD("am53cf96", AM53CF96, 0)
337   MCFG_LEGACY_SCSI_PORT("scsi")
338   MCFG_AM53CF96_IRQ_HANDLER(DEVWRITELINE("maincpu:irq", psxirq_device, intin10))
339
331340   /* video hardware */
332341   MCFG_PSXGPU_ADD( "maincpu", "gpu", CXD8514Q, 0x100000, XTAL_53_693175MHz )
333342
r29632r29633
337346   MCFG_SPU_ADD( "spu", XTAL_67_7376MHz/2 )
338347   MCFG_SOUND_ROUTE( 0, "lspeaker", 0.75 )
339348   MCFG_SOUND_ROUTE( 1, "rspeaker", 0.75 )
340
341   MCFG_SOUND_MODIFY( "scsi:cdrom:cdda" )
342   MCFG_SOUND_ROUTE( 0, "^^^lspeaker", 1.0 )
343   MCFG_SOUND_ROUTE( 1, "^^^rspeaker", 1.0 )
344349MACHINE_CONFIG_END
345350
346351
r29632r29633
679684   ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
680685   ROM_LOAD( "lacrazyc.25c",   0x000000, 0x000080, CRC(e20e5730) SHA1(066b49236c658a4ef2930f7bacc4b2354dd7f240) )
681686
682   DISK_REGION( "scsi:cdrom" )
687   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
683688   DISK_IMAGE_READONLY( "gv027-a1", 0, BAD_DUMP SHA1(840d0d4876cf1b814c9d8db975aa6c92e1fe4039) )
684689ROM_END
685690
r29632r29633
689694   ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
690695   ROM_LOAD( "susume.25c",   0x000000, 0x000080, CRC(52f17df7) SHA1(b8ad7787b0692713439d7d9bebfa0c801c806006) )
691696
692   DISK_REGION( "scsi:cdrom" )
697   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
693698   DISK_IMAGE_READONLY( "gv027j1", 0, BAD_DUMP SHA1(e7e6749ac65de7771eb8fed7d5eefaec3f902255) )
694699ROM_END
695700
r29632r29633
699704   ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
700705   ROM_LOAD( "hyperath.25c", 0x000000, 0x000080, CRC(20a8c435) SHA1(a0f203a999757fba68b391c525ac4b9684a57ba9) )
701706
702   DISK_REGION( "scsi:cdrom" )
707   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
703708   DISK_IMAGE_READONLY( "gv021-j1", 0, SHA1(579442444025b18da658cd6455c51459fbc3de0e) )
704709ROM_END
705710
r29632r29633
709714   ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
710715   ROM_LOAD( "powyak96.25c", 0x000000, 0x000080, CRC(405a7fc9) SHA1(e2d978f49748ba3c4a425188abcd3d272ec23907) )
711716
712   DISK_REGION( "scsi:cdrom" )
717   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
713718   DISK_IMAGE_READONLY( "powyak96", 0, BAD_DUMP SHA1(ebd0ea18ff9ce300ea1e30d66a739a96acfb0621) )
714719ROM_END
715720
r29632r29633
719724   ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
720725   ROM_LOAD( "weddingr.25c", 0x000000, 0x000080, CRC(b90509a0) SHA1(41510a0ceded81dcb26a70eba97636d38d3742c3) )
721726
722   DISK_REGION( "scsi:cdrom" )
727   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
723728   DISK_IMAGE_READONLY( "weddingr", 0, BAD_DUMP SHA1(4e7122b191747ab7220fe4ce1b4483d62ab579af) )
724729ROM_END
725730
r29632r29633
729734   ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
730735   ROM_LOAD( "simpbowl.25c", 0x000000, 0x000080, CRC(2c61050c) SHA1(16ae7f81cbe841c429c5c7326cf83e87db1782bf) )
731736
732   DISK_REGION( "scsi:cdrom" )
737   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
733738   DISK_IMAGE_READONLY( "simpbowl", 0, BAD_DUMP SHA1(72b32a863e6891ad3bfc1fdfe9cb90a2bd334d71) )
734739ROM_END
735740
r29632r29633
739744   ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
740745   ROM_LOAD( "btchmp.25c", 0x000000, 0x000080, CRC(6d02ea54) SHA1(d3babf481fd89db3aec17f589d0d3d999a2aa6e1) )
741746
742   DISK_REGION( "scsi:cdrom" )
747   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
743748   DISK_IMAGE_READONLY( "btchamp", 0, BAD_DUMP SHA1(c9c858e9034826e1a12c3c003dd068a49a3577e1) )
744749ROM_END
745750
r29632r29633
749754   ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
750755   ROM_LOAD( "kdeadeye.25c", 0x000000, 0x000080, CRC(3935d2df) SHA1(cbb855c475269077803c380dbc3621e522efe51e) )
751756
752   DISK_REGION( "scsi:cdrom" )
757   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
753758   DISK_IMAGE_READONLY( "kdeadeye", 0, BAD_DUMP SHA1(3c737c51717925be724dcb93d30769649029b8ce) )
754759ROM_END
755760
r29632r29633
759764   ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
760765   ROM_LOAD( "nagano98.25c",  0x000000, 0x000080, CRC(b64b7451) SHA1(a77a37e0cc580934d1e7e05d523bae0acd2c1480) )
761766
762   DISK_REGION( "scsi:cdrom" )
767   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
763768   DISK_IMAGE_READONLY( "nagano98", 0, BAD_DUMP SHA1(1be7bd4531f249ff2233dd40a206c8d60054a8c6) )
764769ROM_END
765770
r29632r29633
769774   ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
770775   ROM_LOAD( "720ja.25c",  0x000000, 0x000080, CRC(34c473ba) SHA1(768225b04a293bdbc114a092d14dee28d52044e9) )
771776
772   DISK_REGION( "scsi:cdrom" )
777   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
773778   DISK_IMAGE_READONLY( "720jaa01", 0, SHA1(437160996551ef4dfca43899d1d14beca62eb4c9) )
774779ROM_END
775780
r29632r29633
779784   ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
780785   ROM_LOAD( "tmosh.25c", 0x000000, 0x000080, NO_DUMP )
781786
782   DISK_REGION( "scsi:cdrom" )
787   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
783788   DISK_IMAGE_READONLY( "673jaa01", 0, SHA1(eaa76073749f9db48c1bee3dff9bea955683c8a8) )
784789ROM_END
785790
r29632r29633
789794   ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
790795   ROM_LOAD( "tmoshs.25c", 0x000000, 0x000080, CRC(e57b833f) SHA1(f18a0974a6be69dc179706643aab837ff61c2738) )
791796
792   DISK_REGION( "scsi:cdrom" )
797   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
793798   DISK_IMAGE_READONLY( "755jaa01", 0, SHA1(fc742a0b763ba38350ba7eb5d775948632aafd9d) )
794799ROM_END
795800
r29632r29633
799804   ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
800805   ROM_LOAD( "tmoshsp.25c", 0x000000, 0x000080, CRC(af4cdd87) SHA1(97041e287e4c80066043967450779b81b62b2b8e) )
801806
802   DISK_REGION( "scsi:cdrom" )
807   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
803808   DISK_IMAGE_READONLY( "756jab01", 0, SHA1(b2c59b9801debccbbd986728152f314535c67e53) )
804809ROM_END
805810
r29632r29633
809814   ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
810815   ROM_LOAD( "tmoshsp.25c", 0x000000, 0x000080, CRC(af4cdd87) SHA1(97041e287e4c80066043967450779b81b62b2b8e) )
811816
812   DISK_REGION( "scsi:cdrom" )
817   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
813818   DISK_IMAGE_READONLY( "756jaa01", 0, BAD_DUMP SHA1(5e6d349ad1a22c0dbb1ec26aa05febc830254339) ) // The CD was damaged
814819ROM_END
815820
trunk/src/mame/drivers/model3.c
r29632r29633
54365436   MCFG_SOUND_ROUTE(0, "lspeaker", 2.0)
54375437   MCFG_SOUND_ROUTE(0, "rspeaker", 2.0)
54385438
5439   MCFG_SCSIBUS_ADD("scsi")
5440   MCFG_DEVICE_ADD("scsi:lsi53c810", LSI53C810, 0)
5439   MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
5440
5441   MCFG_DEVICE_ADD("lsi53c810", LSI53C810, 0)
54415442   MCFG_LSI53C810_IRQ_CB(model3_state, scsi_irq_callback)
54425443   MCFG_LSI53C810_DMA_CB(model3_state, real3d_dma_callback)
54435444   MCFG_LSI53C810_FETCH_CB(model3_state, scsi_fetch)
5445   MCFG_LEGACY_SCSI_PORT("scsi")
54445446MACHINE_CONFIG_END
54455447
54465448static MACHINE_CONFIG_START( model3_15, model3_state )
r29632r29633
54795481   MCFG_SOUND_ROUTE(0, "lspeaker", 2.0)
54805482   MCFG_SOUND_ROUTE(0, "rspeaker", 2.0)
54815483
5482   MCFG_SCSIBUS_ADD("scsi")
5483   MCFG_DEVICE_ADD("scsi:lsi53c810", LSI53C810, 0)
5484   MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
5485
5486   MCFG_DEVICE_ADD("lsi53c810", LSI53C810, 0)
54845487   MCFG_LSI53C810_IRQ_CB(model3_state, scsi_irq_callback)
54855488   MCFG_LSI53C810_DMA_CB(model3_state, real3d_dma_callback)
54865489   MCFG_LSI53C810_FETCH_CB(model3_state, scsi_fetch)
5490   MCFG_LEGACY_SCSI_PORT("scsi")
54875491MACHINE_CONFIG_END
54885492
54895493static MACHINE_CONFIG_DERIVED(scud, model3_15)
trunk/src/mame/drivers/cps3.c
r29632r29633
462462#include "machine/intelfsh.h"
463463#include "machine/nvram.h"
464464#include "includes/cps3.h"
465#include "machine/scsibus.h"
466#include "machine/scsicd.h"
465#include "bus/scsi/scsi.h"
466#include "bus/scsi/scsicd.h"
467467#include "machine/wd33c93.h"
468468
469469#define MASTER_CLOCK    42954500
r29632r29633
22342234   AM_RANGE(0x05100000, 0x05100003) AM_WRITE(cps3_irq12_ack_w )
22352235   AM_RANGE(0x05110000, 0x05110003) AM_WRITE(cps3_irq10_ack_w )
22362236
2237   AM_RANGE(0x05140000, 0x05140003) AM_DEVREADWRITE8("scsi:wd33c93", wd33c93_device, read, write, 0x00ff00ff )
2237   AM_RANGE(0x05140000, 0x05140003) AM_DEVREADWRITE8("wd33c93", wd33c93_device, read, write, 0x00ff00ff )
22382238
22392239   AM_RANGE(0x06000000, 0x067fffff) AM_READWRITE(cps3_flash1_r, cps3_flash1_w ) /* Flash ROMs simm 1 */
22402240   AM_RANGE(0x06800000, 0x06ffffff) AM_READWRITE(cps3_flash2_r, cps3_flash2_w ) /* Flash ROMs simm 2 */
r29632r29633
25602560   MCFG_CPU_PERIODIC_INT_DRIVER(cps3_state, cps3_other_interrupt, 80) /* ?source? */
25612561   MCFG_CPU_CONFIG(sh2_conf_cps3)
25622562
2563   MCFG_SCSIBUS_ADD("scsi")
2564   MCFG_SCSIDEV_ADD("scsi:cdrom", SCSICD, SCSI_ID_1)
2565   MCFG_DEVICE_ADD("scsi:wd33c93", WD33C93, 0)
2563   MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
2564   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "cdrom", SCSICD, SCSI_ID_1)
25662565
2566   MCFG_DEVICE_ADD("wd33c93", WD33C93, 0)
2567   MCFG_LEGACY_SCSI_PORT("scsi")
2568
25672569   /* video hardware */
25682570   MCFG_SCREEN_ADD("screen", RASTER)
25692571   MCFG_SCREEN_RAW_PARAMS(XTAL_60MHz/8, 486, 0, 384, 259, 0, 224)
r29632r29633
26482650   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
26492651   ROM_LOAD( "redearth_euro.29f400.u2", 0x000000, 0x080000, CRC(02e0f336) SHA1(acc37e830dfeb9674f5a0fb24f4cc23217ae4ff5) )
26502652
2651   DISK_REGION( "scsi:cdrom" )
2653   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
26522654   DISK_IMAGE_READONLY( "cap-wzd-5", 0, BAD_DUMP SHA1(e5676752b08283dc4a98c3d7b759e8aa6dcd0679) )
26532655ROM_END
26542656
r29632r29633
26562658   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
26572659   ROM_LOAD( "redearth_euro.29f400.u2", 0x000000, 0x080000, CRC(02e0f336) SHA1(acc37e830dfeb9674f5a0fb24f4cc23217ae4ff5) )
26582660
2659   DISK_REGION( "scsi:cdrom" )
2661   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
26602662   DISK_IMAGE_READONLY( "cap-wzd-3", 0, SHA1(a6ff67093db6bc80ee5fc46e4300e0177b213a52) )
26612663ROM_END
26622664
r29632r29633
26642666   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
26652667   ROM_LOAD( "warzard_japan.29f400.u2", 0x000000, 0x080000, CRC(f8e2f0c6) SHA1(93d6a986f44c211fff014e55681eca4d2a2774d6) )
26662668
2667   DISK_REGION( "scsi:cdrom" )
2669   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
26682670   DISK_IMAGE_READONLY( "cap-wzd-5", 0, BAD_DUMP SHA1(e5676752b08283dc4a98c3d7b759e8aa6dcd0679) )
26692671ROM_END
26702672
r29632r29633
26722674   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
26732675   ROM_LOAD( "warzard_japan.29f400.u2", 0x000000, 0x080000, CRC(f8e2f0c6) SHA1(93d6a986f44c211fff014e55681eca4d2a2774d6) )
26742676
2675   DISK_REGION( "scsi:cdrom" )
2677   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
26762678   DISK_IMAGE_READONLY( "cap-wzd-3", 0, SHA1(a6ff67093db6bc80ee5fc46e4300e0177b213a52) )
26772679ROM_END
26782680
r29632r29633
26812683   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
26822684   ROM_LOAD( "sfiii_euro.29f400.u2", 0x000000, 0x080000, CRC(27699ddc) SHA1(d8b525cd27e584560b129598df31fd2c5b2a682a) )
26832685
2684   DISK_REGION( "scsi:cdrom" )
2686   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
26852687   DISK_IMAGE_READONLY( "cap-sf3-3", 0, BAD_DUMP SHA1(606e62cc5f46275e366e7dbb412dbaeb7e54cd0c) )
26862688ROM_END
26872689
r29632r29633
26892691   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
26902692   ROM_LOAD( "sfiii_usa_region_b1.29f400.u2", 0x000000, 0x080000, CRC(fb172a8e) SHA1(48ebf59910f246835f7dc0c588da30f7a908072f) )
26912693
2692   DISK_REGION( "scsi:cdrom" )
2694   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
26932695   DISK_IMAGE_READONLY( "cap-sf3-3", 0, BAD_DUMP SHA1(606e62cc5f46275e366e7dbb412dbaeb7e54cd0c) )
26942696ROM_END
26952697
r29632r29633
26972699   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
26982700   ROM_LOAD( "sfiii_asia_region_bd.29f400.u2", 0x000000, 0x080000,  CRC(cbd28de7) SHA1(9c15ecb73b9587d20850e62e8683930a45caa01b) )
26992701
2700   DISK_REGION( "scsi:cdrom" )
2702   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
27012703   DISK_IMAGE_READONLY( "cap-sf3-3", 0, BAD_DUMP SHA1(606e62cc5f46275e366e7dbb412dbaeb7e54cd0c) )
27022704ROM_END
27032705
r29632r29633
27052707   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
27062708   ROM_LOAD( "sfiii_japan.29f400.u2", 0x000000, 0x080000, CRC(74205250) SHA1(c3e83ace7121d32da729162662ec6b5285a31211) )
27072709
2708   DISK_REGION( "scsi:cdrom" )
2710   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
27092711   DISK_IMAGE_READONLY( "cap-sf3-3", 0, BAD_DUMP SHA1(606e62cc5f46275e366e7dbb412dbaeb7e54cd0c) )
27102712ROM_END
27112713
r29632r29633
27132715   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
27142716   ROM_LOAD( "sfiii_hispanic.29f400.u2", 0x000000, 0x080000, CRC(d2b3cd48) SHA1(00ebb270c24a66515c97e35331de54ff5358000e) )
27152717
2716   DISK_REGION( "scsi:cdrom" )
2718   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
27172719   DISK_IMAGE_READONLY( "cap-sf3-3", 0, BAD_DUMP SHA1(606e62cc5f46275e366e7dbb412dbaeb7e54cd0c) )
27182720ROM_END
27192721
r29632r29633
27222724   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
27232725   ROM_LOAD( "sfiii2_usa.29f400.u2", 0x000000, 0x080000, CRC(75dd72e0) SHA1(5a12d6ea6734df5de00ecee6f9ef470749d2f242) )
27242726
2725   DISK_REGION( "scsi:cdrom" )
2727   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
27262728   DISK_IMAGE_READONLY( "cap-3ga000", 0, BAD_DUMP SHA1(4e162885b0b3265a56e0265037bcf247e820f027) )
27272729ROM_END
27282730
r29632r29633
27302732   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
27312733   ROM_LOAD( "sfiii2_japan.29f400.u2", 0x000000, 0x080000, CRC(faea0a3e) SHA1(a03cd63bcf52e4d57f7a598c8bc8e243694624ec) )
27322734
2733   DISK_REGION( "scsi:cdrom" )
2735   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
27342736   DISK_IMAGE_READONLY( "cap-3ga000", 0, BAD_DUMP SHA1(4e162885b0b3265a56e0265037bcf247e820f027) )
27352737ROM_END
27362738
r29632r29633
27392741   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
27402742   ROM_LOAD( "jojo_usa.29f400.u2", 0x000000, 0x080000, CRC(8d40f7be) SHA1(2a4bd83db2f959c33b071e517941aa55a0f919c0) )
27412743
2742   DISK_REGION( "scsi:cdrom" )
2744   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
27432745   DISK_IMAGE_READONLY( "cap-jjk-3", 0, SHA1(dc6e74b5e02e13f62cb8c4e234dd6061501e49c1) )
27442746ROM_END
27452747
r29632r29633
27472749   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
27482750   ROM_LOAD( "jojo_usa.29f400.u2", 0x000000, 0x080000, CRC(8d40f7be) SHA1(2a4bd83db2f959c33b071e517941aa55a0f919c0) )
27492751
2750   DISK_REGION( "scsi:cdrom" )
2752   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
27512753   DISK_IMAGE_READONLY( "cap-jjk-2", 0, BAD_DUMP SHA1(0f5c09171409213e191a607ee89ca3a91fe9c96a) )
27522754ROM_END
27532755
r29632r29633
27552757   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
27562758   ROM_LOAD( "jojo_usa.29f400.u2", 0x000000, 0x080000, CRC(8d40f7be) SHA1(2a4bd83db2f959c33b071e517941aa55a0f919c0) )
27572759
2758   DISK_REGION( "scsi:cdrom" )
2760   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
27592761   DISK_IMAGE_READONLY( "cap-jjk000", 0, BAD_DUMP SHA1(09869f6d8c032b527e02d815749dc8fab1289e86) )
27602762ROM_END
27612763
r29632r29633
27632765   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
27642766   ROM_LOAD( "jojo_japan.29f400.u2", 0x000000, 0x080000, CRC(02778f60) SHA1(a167f9ebe030592a0cdb0c6a3c75835c6a43be4c) )
27652767
2766   DISK_REGION( "scsi:cdrom" )
2768   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
27672769   DISK_IMAGE_READONLY( "cap-jjk-3", 0, SHA1(dc6e74b5e02e13f62cb8c4e234dd6061501e49c1) )
27682770ROM_END
27692771
r29632r29633
27712773   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
27722774   ROM_LOAD( "jojo_japan.29f400.u2", 0x000000, 0x080000, CRC(02778f60) SHA1(a167f9ebe030592a0cdb0c6a3c75835c6a43be4c) )
27732775
2774   DISK_REGION( "scsi:cdrom" )
2776   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
27752777   DISK_IMAGE_READONLY( "cap-jjk-2", 0, BAD_DUMP SHA1(0f5c09171409213e191a607ee89ca3a91fe9c96a) )
27762778ROM_END
27772779
r29632r29633
27792781   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
27802782   ROM_LOAD( "jojo_japan.29f400.u2", 0x000000, 0x080000, CRC(02778f60) SHA1(a167f9ebe030592a0cdb0c6a3c75835c6a43be4c) )
27812783
2782   DISK_REGION( "scsi:cdrom" )
2784   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
27832785   DISK_IMAGE_READONLY( "cap-jjk000", 0, BAD_DUMP SHA1(09869f6d8c032b527e02d815749dc8fab1289e86) )
27842786ROM_END
27852787
r29632r29633
27882790   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
27892791   ROM_LOAD( "sfiii3_euro.29f400.u2", 0x000000, 0x080000, CRC(30bbf293) SHA1(f094c2eeaf4f6709060197aca371a4532346bf78) )
27902792
2791   DISK_REGION( "scsi:cdrom" )
2793   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
27922794   DISK_IMAGE_READONLY( "cap-33s-2", 0, BAD_DUMP SHA1(41b0e246db91cbfc3f8f0f62d981734feb4b4ab5) )
27932795ROM_END
27942796
r29632r29633
27962798   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
27972799   ROM_LOAD( "sfiii3_euro.29f400.u2", 0x000000, 0x080000, CRC(30bbf293) SHA1(f094c2eeaf4f6709060197aca371a4532346bf78) )
27982800
2799   DISK_REGION( "scsi:cdrom" )
2801   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
28002802   DISK_IMAGE_READONLY( "cap-33s-1", 0, BAD_DUMP SHA1(2f4a9006a31903114f9f9dc09465ae253e565c51) )
28012803ROM_END
28022804
r29632r29633
28042806   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
28052807   ROM_LOAD( "sfiii3_usa.29f400.u2", 0x000000, 0x080000, CRC(ecc545c1) SHA1(e39083820aae914fd8b80c9765129bedb745ceba) )
28062808
2807   DISK_REGION( "scsi:cdrom" )
2809   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
28082810   DISK_IMAGE_READONLY( "cap-33s-2", 0, BAD_DUMP SHA1(41b0e246db91cbfc3f8f0f62d981734feb4b4ab5) )
28092811ROM_END
28102812
r29632r29633
28122814   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
28132815   ROM_LOAD( "sfiii3_usa.29f400.u2", 0x000000, 0x080000, CRC(ecc545c1) SHA1(e39083820aae914fd8b80c9765129bedb745ceba) )
28142816
2815   DISK_REGION( "scsi:cdrom" )
2817   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
28162818   DISK_IMAGE_READONLY( "cap-33s-1", 0, BAD_DUMP SHA1(2f4a9006a31903114f9f9dc09465ae253e565c51) )
28172819ROM_END
28182820
r29632r29633
28212823   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
28222824   ROM_LOAD( "jojoba_japan.29f400.u2", 0x000000, 0x080000, CRC(3085478c) SHA1(055eab1fc42816f370a44b17fd7e87ffcb10e8b7) )
28232825
2824   DISK_REGION( "scsi:cdrom" )
2826   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
28252827   DISK_IMAGE_READONLY( "cap-jjm-1", 0, SHA1(8628d3fa555fbd5f4121082e925c1834b76c5e65) )
28262828ROM_END
28272829
r29632r29633
28292831   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
28302832   ROM_LOAD( "jojoba_japan.29f400.u2", 0x000000, 0x080000, CRC(3085478c) SHA1(055eab1fc42816f370a44b17fd7e87ffcb10e8b7) )
28312833
2832   DISK_REGION( "scsi:cdrom" )
2834   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
28332835   DISK_IMAGE_READONLY( "cap-jjm-0", 0, BAD_DUMP SHA1(0678a0baeb853dcff1d230c14f0873cc9f143d7b) )
28342836ROM_END
28352837
r29632r29633
36903692   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
36913693   ROM_LOAD( "no-battery_bios_29f400_for_hd6417095_sh2.u2", 0x000000, 0x080000, CRC(cb9bd5b0) SHA1(ea7ecb3deb69f5307a62d8f0d7d8e68d49013d07))
36923694
3693   DISK_REGION( "scsi:cdrom" )
3695   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
36943696   DISK_IMAGE_READONLY( "no-battery_multi-game_bootleg_cd_for_hd6417095_sh2", 0, SHA1(123f2fcb0f3dd3d6b859e82a51d0127e46763776) )
36953697ROM_END
36963698
r29632r29633
36983700   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
36993701   ROM_LOAD( "no-battery_bios_29f400_for_hd6417095_sh2.u2", 0x000000, 0x080000, CRC(cb9bd5b0) SHA1(ea7ecb3deb69f5307a62d8f0d7d8e68d49013d07))
37003702
3701   DISK_REGION( "scsi:cdrom" )
3703   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
37023704   DISK_IMAGE_READONLY( "sfiii_2nd_impact_converted_for_standard_sh2_v3", 0, SHA1(8f180d159e88042a1e819cefd39eef67f5e86e3d) )
37033705ROM_END
37043706
r29632r29633
37063708   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
37073709   ROM_LOAD( "no-battery_bios_29f400_for_hd6417095_sh2.u2", 0x000000, 0x080000, CRC(cb9bd5b0) SHA1(ea7ecb3deb69f5307a62d8f0d7d8e68d49013d07))
37083710
3709   DISK_REGION( "scsi:cdrom" )
3711   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
37103712   DISK_IMAGE_READONLY( "sfiii_2nd_impact_converted_for_standard_sh2_older", 0, SHA1(8a8e4138c3bf12435933ab9d9ace510513200843) ) // v1 or v2?
37113713ROM_END
37123714
r29632r29633
37143716   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
37153717   ROM_LOAD( "no-battery_bios_29f400_for_dead_security_cart.u2", 0x000000, 0x080000, CRC(0fd56fb3) SHA1(5a8bffc07eb7da73cf4bca6718df72e471296bfd) )
37163718
3717   DISK_REGION( "scsi:cdrom" )
3719   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
37183720   DISK_IMAGE_READONLY( "no-battery_multi-game_bootleg_cd_for_dead_security_cart", 0, SHA1(4b0b673b45dac94da018576c0a7f8644653fc564) )
37193721ROM_END
37203722
trunk/src/mame/drivers/konamigq.c
r29632r29633
5353#include "machine/am53cf96.h"
5454#include "machine/eepromser.h"
5555#include "machine/mb89371.h"
56#include "machine/scsibus.h"
57#include "machine/scsihd.h"
56#include "bus/scsi/scsi.h"
57#include "bus/scsi/scsihd.h"
5858#include "sound/k056800.h"
5959#include "sound/k054539.h"
6060
r29632r29633
6666      m_maincpu(*this, "maincpu"),
6767      m_soundcpu(*this, "soundcpu"),
6868      m_dasp(*this, "dasp"),
69      m_am53cf96(*this, "scsi:am53cf96"),
69      m_am53cf96(*this, "am53cf96"),
7070      m_k056800(*this, "k056800")
7171   {
7272   }
r29632r29633
135135/* Video */
136136
137137static ADDRESS_MAP_START( konamigq_map, AS_PROGRAM, 32, konamigq_state )
138   AM_RANGE(0x1f000000, 0x1f00001f) AM_DEVREADWRITE8("scsi:am53cf96", am53cf96_device, read, write, 0x00ff00ff)
138   AM_RANGE(0x1f000000, 0x1f00001f) AM_DEVREADWRITE8("am53cf96", am53cf96_device, read, write, 0x00ff00ff)
139139   AM_RANGE(0x1f100000, 0x1f10001f) AM_DEVREADWRITE8("k056800", k056800_device, host_r, host_w, 0x00ff00ff)
140140   AM_RANGE(0x1f180000, 0x1f180003) AM_WRITE16(eeprom_w, 0x0000ffff)
141141   AM_RANGE(0x1f198000, 0x1f198003) AM_WRITENOP            /* cabinet lamps? */
r29632r29633
315315   MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
316316   MCFG_EEPROM_SERIAL_DATA(konamigq_def_eeprom, 128)
317317
318   MCFG_SCSIBUS_ADD("scsi")
319   MCFG_SCSIDEV_ADD("scsi:disk", SCSIHD, SCSI_ID_0)
320   MCFG_AM53CF96_ADD("scsi:am53cf96")
321   MCFG_AM53CF96_IRQ_HANDLER(DEVWRITELINE("^maincpu:irq", psxirq_device, intin10))
318   MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
319   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
322320
321   MCFG_DEVICE_ADD("am53cf96", AM53CF96, 0)
322   MCFG_LEGACY_SCSI_PORT("scsi")
323   MCFG_AM53CF96_IRQ_HANDLER(DEVWRITELINE("maincpu:irq", psxirq_device, intin10))
324
323325   /* video hardware */
324326   MCFG_PSXGPU_ADD("maincpu", "gpu", CXD8538Q, 0x200000, XTAL_53_693175MHz)
325327
r29632r29633
433435   ROM_REGION32_LE( 0x080000, "maincpu:rom", 0 ) /* bios */
434436   ROM_LOAD( "420b03.27p",   0x0000000, 0x080000, CRC(aab391b1) SHA1(bf9dc7c0c8168c22a4be266fe6a66d3738df916b) )
435437
436   DISK_REGION( "scsi:disk:image" )
438   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":harddisk:image" )
437439   DISK_IMAGE( "420uaa04", 0, SHA1(67cb1418fc0de2a89fc61847dc9efb9f1bebb347) )
438440ROM_END
439441
trunk/src/mame/includes/model3.h
r29632r29633
11#include "video/polylgcy.h"
2#include "machine/scsibus.h"
2#include "bus/scsi/scsi.h"
33#include "machine/53c810.h"
44#include "audio/dsbz80.h"
55#include "machine/eepromser.h"
r29632r29633
2121   model3_state(const machine_config &mconfig, device_type type, const char *tag)
2222      : driver_device(mconfig, type, tag),
2323      m_maincpu(*this,"maincpu"),
24      m_lsi53c810(*this, "scsi:lsi53c810"),
24      m_lsi53c810(*this, "lsi53c810"),
2525      m_audiocpu(*this, "audiocpu"),
2626      m_scsp1(*this, "scsp1"),
2727      m_eeprom(*this, "eeprom"),
trunk/src/mame/mame.mak
r29632r29633
494494#-------------------------------------------------
495495BUSES += CENTRONICS
496496BUSES += ISA
497BUSES += SCSI
497498
498499#-------------------------------------------------
499500# this is the list of driver libraries that
trunk/src/emu/bus/abcbus/lux21056.c
r29632r29633
7575*/
7676
7777#include "lux21056.h"
78#include "bus/scsi/s1410.h"
7879
7980
8081
r29632r29633
207208   DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, luxor_55_21056_device, io_write_byte),
208209};
209210
210WRITE_LINE_MEMBER( luxor_55_21056_device::sasi_bsy_w )
211WRITE_LINE_MEMBER( luxor_55_21056_device::write_sasi_bsy )
211212{
212   if (state)
213   m_sasi_bsy = state;
214
215   if (m_sasi_bsy)
213216   {
214      m_sasibus->scsi_sel_w(0);
217      m_sasibus->write_sel(!m_sasi_bsy);
215218   }
216219}
217220
218WRITE_LINE_MEMBER( luxor_55_21056_device::sasi_io_w )
221WRITE_LINE_MEMBER( luxor_55_21056_device::write_sasi_io )
219222{
220   if (!state)
223   m_sasi_io = state;
224
225   if (!m_sasi_io)
221226   {
222      m_sasibus->scsi_data_w(m_sasi_data);
227      m_sasi_data_out->write(m_sasi_data);
223228   }
224229   else
225230   {
226      m_sasibus->scsi_data_w(0);
231      m_sasi_data_out->write(0);
227232   }
228233}
229234
230WRITE_LINE_MEMBER( luxor_55_21056_device::sasi_req_w )
235WRITE_LINE_MEMBER( luxor_55_21056_device::write_sasi_req )
231236{
232   if (state)
237   m_sasi_req = state;
238
239   if (m_sasi_req)
233240   {
234      m_req = 0;
235      m_sasibus->scsi_ack_w(!m_req);
241      m_sasibus->write_ack(!m_sasi_req);
236242   }
237243}
238244
245WRITE_LINE_MEMBER( luxor_55_21056_device::write_sasi_cd )
246{
247   m_sasi_cd = state;
248}
239249
250WRITE_LINE_MEMBER( luxor_55_21056_device::write_sasi_msg )
251{
252   m_sasi_msg = state;
253}
254
240255//-------------------------------------------------
241256//  MACHINE_DRIVER( luxor_55_21056 )
242257//-------------------------------------------------
r29632r29633
249264
250265   MCFG_Z80DMA_ADD(Z80DMA_TAG, XTAL_8MHz/2, dma_intf)
251266
252   MCFG_SCSIBUS_ADD(SASIBUS_TAG)
253   MCFG_SCSIDEV_ADD(SASIBUS_TAG ":harddisk0", S1410, SCSI_ID_0)
254   MCFG_SCSICB_ADD(SASIBUS_TAG ":host")
255   MCFG_SCSICB_BSY_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, luxor_55_21056_device, sasi_bsy_w))
256   MCFG_SCSICB_IO_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, luxor_55_21056_device, sasi_io_w))
257   MCFG_SCSICB_REQ_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, luxor_55_21056_device, sasi_req_w))
267   MCFG_DEVICE_ADD(SASIBUS_TAG, SCSI_PORT, 0)
268   MCFG_SCSI_DATA_INPUT_BUFFER("sasi_data_in")
269   MCFG_SCSI_REQ_HANDLER(WRITELINE(luxor_55_21056_device, write_sasi_req))
270   MCFG_SCSI_IO_HANDLER(WRITELINE(luxor_55_21056_device, write_sasi_io))
271   MCFG_SCSI_CD_HANDLER(WRITELINE(luxor_55_21056_device, write_sasi_cd))
272   MCFG_SCSI_MSG_HANDLER(WRITELINE(luxor_55_21056_device, write_sasi_msg))
273   MCFG_SCSI_BSY_HANDLER(WRITELINE(luxor_55_21056_device, write_sasi_bsy))
274   MCFG_SCSIDEV_ADD(SASIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", S1410, SCSI_ID_0)
275
276   MCFG_SCSI_OUTPUT_LATCH_ADD("sasi_data_out", SASIBUS_TAG)
277   MCFG_DEVICE_ADD("sasi_data_in", INPUT_BUFFER, 0)
258278MACHINE_CONFIG_END
259279
260280
r29632r29633
329349      device_abcbus_card_interface(mconfig, *this),
330350      m_maincpu(*this, Z80_TAG),
331351      m_dma(*this, Z80DMA_TAG),
332      m_sasibus(*this, SASIBUS_TAG ":host"),
352      m_sasibus(*this, SASIBUS_TAG),
353      m_sasi_data_out(*this, "sasi_data_out"),
354      m_sasi_data_in(*this, "sasi_data_in"),
333355      m_s1(*this, "S1"),
334356      m_cs(false),
335357      m_rdy(0),
336      m_req(0),
358      m_sasi_req(0),
359      m_sasi_io(0),
360      m_sasi_cd(0),
361      m_sasi_msg(0),
362      m_sasi_bsy(0),
337363      m_stat(0),
338364      m_sasi_data(0)
339365{
r29632r29633
349375   // state saving
350376   save_item(NAME(m_cs));
351377   save_item(NAME(m_rdy));
352   save_item(NAME(m_req));
353378   save_item(NAME(m_inp));
354379   save_item(NAME(m_out));
355380   save_item(NAME(m_stat));
381   save_item(NAME(m_sasi_req));
382   save_item(NAME(m_sasi_io));
383   save_item(NAME(m_sasi_cd));
384   save_item(NAME(m_sasi_msg));
385   save_item(NAME(m_sasi_bsy));
356386   save_item(NAME(m_sasi_data));
357387}
358388
r29632r29633
492522
493523   data |= m_rdy ^ STAT_DIR;
494524
495   data |= (m_req || m_sasibus->scsi_req_r()) << 1;
496   data |= m_sasibus->scsi_io_r() << 2;
497   data |= !m_sasibus->scsi_cd_r() << 3;
498   data |= !m_sasibus->scsi_msg_r() << 4;
499   data |= !m_sasibus->scsi_bsy_r() << 5;
525   data |= !m_sasi_req << 1;
526   data |= !m_sasi_io << 2;
527   data |= !m_sasi_cd << 3;
528   data |= !m_sasi_msg << 4;
529   data |= !m_sasi_bsy << 5;
500530
501531   return data ^ 0xff;
502532}
r29632r29633
546576
547577READ8_MEMBER( luxor_55_21056_device::sasi_data_r )
548578{
549   UINT8 data = m_sasibus->scsi_data_r();
579   UINT8 data = m_sasi_data_in->read();
550580
551   m_req = !m_sasibus->scsi_req_r();
552   m_sasibus->scsi_ack_w(!m_req);
581   m_sasibus->write_ack(!m_sasi_req);
553582
554583   return data;
555584}
r29632r29633
563592{
564593   m_sasi_data = data;
565594
566   if (!m_sasibus->scsi_io_r())
595   if (!m_sasi_io)
567596   {
568      m_sasibus->scsi_data_w(m_sasi_data);
597      m_sasi_data_out->write(m_sasi_data);
569598   }
570599
571   m_req = !m_sasibus->scsi_req_r();
572   m_sasibus->scsi_ack_w(!m_req);
600   m_sasibus->write_ack(!m_sasi_req);
573601}
574602
575603
r29632r29633
613641
614642WRITE8_MEMBER( luxor_55_21056_device::sasi_sel_w )
615643{
616   m_sasibus->scsi_sel_w(!m_sasibus->scsi_bsy_r());
644   m_sasibus->write_sel(!m_sasi_bsy);
617645}
618646
619647
r29632r29633
635663
636664WRITE8_MEMBER( luxor_55_21056_device::sasi_rst_w )
637665{
638   m_sasibus->scsi_rst_w(1);
639   m_sasibus->scsi_rst_w(0);
666   m_sasibus->write_rst(1);
667   m_sasibus->write_rst(0);
640668}
641669
642670
trunk/src/emu/bus/abcbus/lux21056.h
r29632r29633
1616
1717#include "emu.h"
1818#include "abcbus.h"
19#include "bus/scsi/s1410.h"
19#include "bus/scsi/scsi.h"
2020#include "cpu/z80/z80.h"
2121#include "cpu/z80/z80daisy.h"
22#include "machine/scsibus.h"
23#include "machine/scsicb.h"
24#include "machine/scsihd.h"
2522#include "machine/z80dma.h"
2623
2724
r29632r29633
6259   DECLARE_READ8_MEMBER( io_read_byte );
6360   DECLARE_WRITE8_MEMBER( io_write_byte );
6461
65   DECLARE_WRITE_LINE_MEMBER( sasi_bsy_w );
66   DECLARE_WRITE_LINE_MEMBER( sasi_io_w );
67   DECLARE_WRITE_LINE_MEMBER( sasi_req_w );
62   DECLARE_WRITE_LINE_MEMBER( write_sasi_req );
63   DECLARE_WRITE_LINE_MEMBER( write_sasi_io );
64   DECLARE_WRITE_LINE_MEMBER( write_sasi_cd );
65   DECLARE_WRITE_LINE_MEMBER( write_sasi_msg );
66   DECLARE_WRITE_LINE_MEMBER( write_sasi_bsy );
6867
6968protected:
7069   // device-level overrides
r29632r29633
8483
8584   required_device<cpu_device> m_maincpu;
8685   required_device<z80dma_device> m_dma;
87   required_device<scsicb_device> m_sasibus;
86   required_device<SCSI_PORT_DEVICE> m_sasibus;
87   required_device<output_latch_device> m_sasi_data_out;
88   required_device<input_buffer_device> m_sasi_data_in;
8889   required_ioport m_s1;
8990
9091   int m_cs;
9192   int m_rdy;
92   int m_req;
93   int m_sasi_req;
94   int m_sasi_io;
95   int m_sasi_cd;
96   int m_sasi_msg;
97   int m_sasi_bsy;
9398
9499   UINT8 m_inp;
95100   UINT8 m_out;
trunk/src/emu/bus/abcbus/lux4105.c
r29632r29633
1010*********************************************************************/
1111
1212#include "lux4105.h"
13#include "machine/scsibus.h"
14#include "machine/scsicb.h"
15#include "machine/scsihd.h"
13#include "bus/scsi/scsihd.h"
1614#include "bus/scsi/s1410.h"
1715
1816
r29632r29633
3230const device_type LUXOR_4105 = &device_creator<luxor_4105_device>;
3331
3432
35WRITE_LINE_MEMBER( luxor_4105_device::sasi_bsy_w )
33WRITE_LINE_MEMBER( luxor_4105_device::write_sasi_bsy )
3634{
35   m_sasi_bsy = state;
36
3737   if (state)
3838   {
39      m_sasibus->scsi_sel_w(0);
39      m_sasibus->write_sel(0);
4040   }
4141}
4242
43WRITE_LINE_MEMBER( luxor_4105_device::sasi_io_w )
43WRITE_LINE_MEMBER( luxor_4105_device::write_sasi_io )
4444{
45   if (!state)
45   m_sasi_io = state;
46
47   if (!m_sasi_io)
4648   {
47      m_sasibus->scsi_data_w(m_data);
49      m_sasi_data_out->write(m_data);
4850   }
4951
5052   update_trrq_int();
5153}
5254
53WRITE_LINE_MEMBER( luxor_4105_device::sasi_req_w )
55WRITE_LINE_MEMBER( luxor_4105_device::write_sasi_req )
5456{
55   if (state)
57   m_sasi_req = state;
58
59   if (m_sasi_req)
5660   {
57      m_sasibus->scsi_ack_w(0);
61      m_sasibus->write_ack(0);
5862   }
5963
6064   update_trrq_int();
6165}
6266
67WRITE_LINE_MEMBER( luxor_4105_device::write_sasi_cd )
68{
69   m_sasi_cd = state;
70}
6371
72
6473//-------------------------------------------------
6574//  MACHINE_DRIVER( luxor_4105 )
6675//-------------------------------------------------
6776
6877static MACHINE_CONFIG_FRAGMENT( luxor_4105 )
69   MCFG_SCSIBUS_ADD(SASIBUS_TAG)
70   MCFG_SCSIDEV_ADD(SASIBUS_TAG ":harddisk0", S1410, SCSI_ID_0)
71   MCFG_SCSICB_ADD(SASIBUS_TAG ":host")
72   MCFG_SCSICB_BSY_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, luxor_4105_device, sasi_bsy_w))
73   MCFG_SCSICB_IO_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, luxor_4105_device, sasi_io_w))
74   MCFG_SCSICB_REQ_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, luxor_4105_device, sasi_req_w))
78   MCFG_DEVICE_ADD(SASIBUS_TAG, SCSI_PORT, 0)
79   MCFG_SCSI_DATA_INPUT_BUFFER("sasi_data_in")
80   MCFG_SCSI_BSY_HANDLER(WRITELINE(luxor_4105_device, write_sasi_bsy))
81   MCFG_SCSI_REQ_HANDLER(WRITELINE(luxor_4105_device, write_sasi_req))
82   MCFG_SCSI_CD_HANDLER(WRITELINE(luxor_4105_device, write_sasi_cd))
83   MCFG_SCSI_IO_HANDLER(WRITELINE(luxor_4105_device, write_sasi_io))
84   MCFG_SCSIDEV_ADD(SASIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", S1410, SCSI_ID_0)
85
86   MCFG_SCSI_OUTPUT_LATCH_ADD("sasi_data_out", SASIBUS_TAG)
87   MCFG_DEVICE_ADD("sasi_data_in", INPUT_BUFFER, 0)
7588MACHINE_CONFIG_END
7689
7790
r29632r29633
131144
132145inline void luxor_4105_device::update_trrq_int()
133146{
134   int cd = !m_sasibus->scsi_cd_r();
135   int req = !m_sasibus->scsi_req_r();
147   int cd = !m_sasi_cd;
148   int req = !m_sasi_req;
136149   int trrq = !(cd & !req);
137150
138151   if (BIT(m_dma, 5))
r29632r29633
167180luxor_4105_device::luxor_4105_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
168181   : device_t(mconfig, LUXOR_4105, "Luxor 4105", tag, owner, clock, "lux4105", __FILE__),
169182      device_abcbus_card_interface(mconfig, *this),
170      m_sasibus(*this, SASIBUS_TAG ":host"),
183      m_sasibus(*this, SASIBUS_TAG),
184      m_sasi_data_out(*this, "sasi_data_out"),
185      m_sasi_data_in(*this, "sasi_data_in"),
171186      m_1e(*this, "1E"),
172187      m_5e(*this, "5E")
173188{
r29632r29633
197212   m_data = 0;
198213   m_dma = 0;
199214
200   m_sasibus->scsi_rst_w(1);
201   m_sasibus->scsi_rst_w(0);
215   m_sasibus->write_rst(1);
216   m_sasibus->write_rst(0);
202217
203218   m_slot->trrq_w(1);
204219}
r29632r29633
249264
250265      */
251266
252      data = m_sasibus->scsi_bsy_r();
253      data |= m_sasibus->scsi_req_r() << 2;
254      data |= m_sasibus->scsi_cd_r() << 3;
255      data |= m_sasibus->scsi_io_r() << 6;
267      data = m_sasi_bsy;
268      data |= m_sasi_req << 2;
269      data |= m_sasi_cd << 3;
270      data |= m_sasi_io << 6;
256271   }
257272
258273   return data;
r29632r29633
269284
270285   if (m_cs)
271286   {
272      if (!m_sasibus->scsi_bsy_r())
287      if (!m_sasi_bsy)
273288      {
274289         data = m_1e->read();
275290      }
276291      else
277292      {
278         if (m_sasibus->scsi_io_r())
293         if (m_sasi_io)
279294         {
280            data = m_sasibus->scsi_data_r();
295            data = m_sasi_data_in->read();
281296
282            if (m_sasibus->scsi_req_r())
297            if (m_sasi_req)
283298            {
284               m_sasibus->scsi_ack_w(1);
299               m_sasibus->write_ack(1);
285300            }
286301         }
287302      }
r29632r29633
301316   {
302317      m_data = data;
303318
304      if (!m_sasibus->scsi_io_r())
319      if (!m_sasi_io)
305320      {
306         m_sasibus->scsi_data_w(m_data);
321         m_sasi_data_out->write(m_data);
307322
308         if (m_sasibus->scsi_req_r())
323         if (m_sasi_req)
309324         {
310            m_sasibus->scsi_ack_w(1);
325            m_sasibus->write_ack(1);
311326         }
312327      }
313328   }
r29632r29633
322337{
323338   if (m_cs)
324339   {
325      m_sasibus->scsi_sel_w(1);
340      m_sasibus->write_sel(1);
326341   }
327342}
328343
r29632r29633
338353      m_data = 0;
339354      m_dma = 0;
340355
341      m_sasibus->scsi_rst_w(1);
342      m_sasibus->scsi_rst_w(0);
356      m_sasibus->write_rst(1);
357      m_sasibus->write_rst(0);
343358   }
344359}
345360
trunk/src/emu/bus/abcbus/lux4105.h
r29632r29633
1717
1818#include "emu.h"
1919#include "abcbus.h"
20#include "machine/scsicb.h"
20#include "bus/scsi/scsi.h"
2121
2222
2323
r29632r29633
3636// ======================> luxor_4105_device
3737
3838class luxor_4105_device :  public device_t,
39                     public device_abcbus_card_interface
39   public device_abcbus_card_interface
4040{
4141public:
4242   // construction/destruction
r29632r29633
4747   virtual ioport_constructor device_input_ports() const;
4848
4949   // not really public
50   DECLARE_WRITE_LINE_MEMBER( sasi_bsy_w );
51   DECLARE_WRITE_LINE_MEMBER( sasi_io_w );
52   DECLARE_WRITE_LINE_MEMBER( sasi_req_w );
50   DECLARE_WRITE_LINE_MEMBER( write_sasi_bsy );
51   DECLARE_WRITE_LINE_MEMBER( write_sasi_req );
52   DECLARE_WRITE_LINE_MEMBER( write_sasi_cd );
53   DECLARE_WRITE_LINE_MEMBER( write_sasi_io );
5354
5455protected:
5556   // device-level overrides
r29632r29633
6970private:
7071   inline void update_trrq_int();
7172
72   required_device<scsicb_device> m_sasibus;
73   required_device<SCSI_PORT_DEVICE> m_sasibus;
74   required_device<output_latch_device> m_sasi_data_out;
75   required_device<input_buffer_device> m_sasi_data_in;
7376   required_ioport m_1e;
7477   required_ioport m_5e;
7578
7679   int m_cs;
7780   UINT8 m_data;
7881   UINT8 m_dma;
82
83   int m_sasi_bsy;
84   int m_sasi_req;
85   int m_sasi_cd;
86   int m_sasi_io;
7987};
8088
8189
trunk/src/emu/bus/abcbus/hdc.c
r29632r29633
8989   MCFG_CPU_IO_MAP(abc_hdc_io)
9090   MCFG_CPU_CONFIG(daisy_chain)
9191
92   MCFG_SCSIBUS_ADD(SASIBUS_TAG)
93   MCFG_SCSIDEV_ADD(SASIBUS_TAG ":harddisk0", SCSIHD, SCSI_ID_0)
94   MCFG_SCSICB_ADD(SASIBUS_TAG ":host")
92   MCFG_DEVICE_ADD(SASIBUS_TAG, SCSI_PORT, 0)
93   MCFG_SCSIDEV_ADD(SASIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
9594MACHINE_CONFIG_END
9695
9796
r29632r29633
118117abc_hdc_device::abc_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
119118   : device_t(mconfig, ABC_HDC, "ABC HDC", tag, owner, clock, "abc_hdc", __FILE__),
120119      device_abcbus_card_interface(mconfig, *this),
121      m_maincpu(*this, Z80_TAG),
122      m_sasibus(*this, SASIBUS_TAG)
120      m_maincpu(*this, Z80_TAG)
123121{
124122}
125123
trunk/src/emu/bus/abcbus/hdc.h
r29632r29633
1818#include "abcbus.h"
1919#include "cpu/z80/z80.h"
2020#include "cpu/z80/z80daisy.h"
21#include "machine/scsibus.h"
22#include "machine/scsicb.h"
23#include "machine/scsihd.h"
21#include "bus/scsi/scsihd.h"
2422
2523
2624
r29632r29633
5149
5250private:
5351   required_device<cpu_device> m_maincpu;
54   required_device<scsibus_device> m_sasibus;
5552};
5653
5754
trunk/src/emu/bus/bus.mak
r29632r29633
10301030
10311031#-------------------------------------------------
10321032#
1033#@src/emu/bus/scsi/???.h,BUSES += SCSI
1033#@src/emu/bus/scsi/scsi.h,BUSES += SCSI
10341034#-------------------------------------------------
10351035ifneq ($(filter SCSI,$(BUSES)),)
10361036OBJDIRS += $(BUSOBJ)/scsi
1037BUSOBJS += $(BUSOBJ)/scsi/scsi.o
1038BUSOBJS += $(BUSOBJ)/scsi/scsicd.o
1039BUSOBJS += $(BUSOBJ)/scsi/scsihd.o
1040BUSOBJS += $(BUSOBJ)/scsi/scsihle.o
1041BUSOBJS += $(BUSOBJ)/scsi/cdu76s.o
10371042BUSOBJS += $(BUSOBJ)/scsi/acb4070.o
10381043BUSOBJS += $(BUSOBJ)/scsi/d9060hd.o
10391044BUSOBJS += $(BUSOBJ)/scsi/sa1403d.o
trunk/src/emu/bus/x68k/x68k_scsiext.c
r29632r29633
77 */
88
99#include "emu.h"
10#include "machine/scsibus.h"
11#include "machine/scsihd.h"
10#include "bus/scsi/scsi.h"
11#include "bus/scsi/scsihd.h"
1212#include "machine/mb89352.h"
1313#include "x68k_scsiext.h"
1414
r29632r29633
3434
3535// device machine config
3636static MACHINE_CONFIG_FRAGMENT( x68k_scsiext )
37   MCFG_SCSIBUS_ADD("scsi")
38   MCFG_SCSIDEV_ADD("scsi:harddisk0", SCSIHD, SCSI_ID_0)
39   MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_1)
40   MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_2)
41   MCFG_SCSIDEV_ADD("scsi:harddisk3", SCSIHD, SCSI_ID_3)
42   MCFG_SCSIDEV_ADD("scsi:harddisk4", SCSIHD, SCSI_ID_4)
43   MCFG_SCSIDEV_ADD("scsi:harddisk5", SCSIHD, SCSI_ID_5)
44   MCFG_SCSIDEV_ADD("scsi:harddisk6", SCSIHD, SCSI_ID_6)
45   MCFG_DEVICE_ADD("scsi:mb89352", MB89352A, 0)
46   MCFG_MB89352A_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_scsiext_device, irq_w))
47   MCFG_MB89352A_DRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_scsiext_device, drq_w))
37   MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
38   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
39   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_1)
40   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE3, "harddisk", SCSIHD, SCSI_ID_2)
41   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE4, "harddisk", SCSIHD, SCSI_ID_3)
42   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE5, "harddisk", SCSIHD, SCSI_ID_4)
43   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE6, "harddisk", SCSIHD, SCSI_ID_5)
44   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE7, "harddisk", SCSIHD, SCSI_ID_6)
45
46   MCFG_DEVICE_ADD("mb89352", MB89352A, 0)
47   MCFG_LEGACY_SCSI_PORT("scsi")
48   MCFG_MB89352A_IRQ_CB(WRITELINE(x68k_scsiext_device, irq_w))
49   MCFG_MB89352A_DRQ_CB(WRITELINE(x68k_scsiext_device, drq_w))
4850MACHINE_CONFIG_END
4951
5052machine_config_constructor x68k_scsiext_device::device_mconfig_additions() const
r29632r29633
5557x68k_scsiext_device::x68k_scsiext_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5658      : device_t(mconfig, X68K_SCSIEXT, "Sharp CZ-6BS1 SCSI-1", tag, owner, clock, "x68k_cz6bs1", __FILE__),
5759      device_x68k_expansion_card_interface(mconfig, *this),
58      m_spc(*this, "scsi:mb89352")
60      m_spc(*this, "mb89352")
5961{
6062}
6163
trunk/src/emu/bus/ieee488/d9060.h
r29632r29633
1919#include "cpu/m6502/m6502.h"
2020#include "machine/6522via.h"
2121#include "machine/6532riot.h"
22#include "machine/scsicb.h"
22#include "bus/scsi/scsi.h"
2323
2424
2525
r29632r29633
4949   virtual ioport_constructor device_input_ports() const;
5050
5151   // not really public
52   DECLARE_WRITE_LINE_MEMBER( req_w );
5352   DECLARE_READ8_MEMBER( dio_r );
5453   DECLARE_WRITE8_MEMBER( dio_w );
5554   DECLARE_READ8_MEMBER( riot1_pa_r );
r29632r29633
7978   required_device<riot6532_device> m_riot0;
8079   required_device<riot6532_device> m_riot1;
8180   required_device<via6522_device> m_via;
82   required_device<scsicb_device> m_sasibus;
81   required_device<SCSI_PORT_DEVICE> m_sasibus;
82   required_device<output_latch_device> m_sasi_data_out;
8383   required_ioport m_address;
8484
8585   // IEEE-488 bus
trunk/src/emu/bus/ieee488/d9060.c
r29632r29633
3232
3333#include "d9060.h"
3434#include "bus/scsi/d9060hd.h"
35#include "machine/scsibus.h"
36#include "machine/scsicb.h"
3735
3836
3937
r29632r29633
336334};
337335
338336
339READ8_MEMBER( base_d9060_device::via_pb_r )
337WRITE8_MEMBER( base_d9060_device::via_pb_w )
340338{
341339   /*
342340
343341       bit     description
344342
345       PB0
346       PB1
343       PB0     SEL
344       PB1     RST
347345       PB2     C/D
348346       PB3     BUSY
349347       PB4     J14 (1=9060, 0=9090)
r29632r29633
353351
354352   */
355353
356   UINT8 data = 0;
357
358   data |= m_sasibus->scsi_cd_r() << 2;
359   data |= m_sasibus->scsi_bsy_r() << 3;
360   data |= m_sasibus->scsi_io_r() << 6;
361   data |= m_sasibus->scsi_msg_r() << 7;
362
363   // drive type
364   data |= (m_variant == TYPE_9060) << 4;
365
366   return data;
354   m_sasibus->write_sel(BIT(data, 0));
355   m_sasibus->write_rst(BIT(data, 1));
367356}
368357
369WRITE8_MEMBER( base_d9060_device::via_pb_w )
370{
371   /*
372
373       bit     description
374
375       PB0     SEL
376       PB1     RST
377       PB2
378       PB3
379       PB4
380       PB5
381       PB6
382       PB7
383
384   */
385
386   m_sasibus->scsi_sel_w(BIT(data, 0));
387   m_sasibus->scsi_rst_w(BIT(data, 1));
388}
389
390358WRITE_LINE_MEMBER( base_d9060_device::ack_w )
391359{
392   m_sasibus->scsi_ack_w(!state);
360   m_sasibus->write_ack(!state);
393361}
394362
395363WRITE_LINE_MEMBER( base_d9060_device::enable_w )
r29632r29633
398366
399367   if( !m_enable )
400368   {
401      m_sasibus->scsi_data_w( m_data );
369      m_sasi_data_out->write( m_data );
402370   }
403371   else
404372   {
405      m_sasibus->scsi_data_w( 0 );
373      m_sasi_data_out->write( 0 );
406374   }
407375}
408376
r29632r29633
412380
413381   if( !m_enable )
414382   {
415      m_sasibus->scsi_data_w( m_data );
383      m_sasi_data_out->write( m_data );
416384   }
417385}
418386
419WRITE_LINE_MEMBER( base_d9060_device::req_w )
420{
421   m_via->write_ca1(state);
422}
423387
424
425388//-------------------------------------------------
426389//  MACHINE_CONFIG_FRAGMENT( d9060 )
427390//-------------------------------------------------
r29632r29633
439402   MCFG_CPU_PROGRAM_MAP(d9060_hdc_mem)
440403
441404   MCFG_DEVICE_ADD(M6522_TAG, VIA6522, XTAL_4MHz/4)
442   MCFG_VIA6522_READPA_HANDLER(DEVREAD8(SASIBUS_TAG ":host", scsicb_device, scsi_data_r))
443   MCFG_VIA6522_READPB_HANDLER(READ8(base_d9060_device, via_pb_r))
444405   MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(base_d9060_device, scsi_data_w))
445406   MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(base_d9060_device, via_pb_w))
446407   MCFG_VIA6522_CA2_HANDLER(WRITELINE(base_d9060_device, ack_w))
447408   MCFG_VIA6522_CB2_HANDLER(WRITELINE(base_d9060_device, enable_w))
448409   MCFG_VIA6522_IRQ_HANDLER(DEVWRITELINE(M6502_HDC_TAG, m6502_device, irq_line))
449410
450   MCFG_SCSIBUS_ADD(SASIBUS_TAG)
451   MCFG_SCSIDEV_ADD(SASIBUS_TAG ":harddisk0", D9060HD, SCSI_ID_0)
452   MCFG_SCSICB_ADD(SASIBUS_TAG ":host")
453   MCFG_SCSICB_REQ_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, base_d9060_device, req_w))
411   MCFG_DEVICE_ADD(SASIBUS_TAG, SCSI_PORT, 0)
412   MCFG_SCSI_REQ_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_ca1))
413   MCFG_SCSI_CD_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pb2))
414   MCFG_SCSI_BSY_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pb3))
415   MCFG_SCSI_IO_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pb6))
416   MCFG_SCSI_MSG_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pb7))
417   MCFG_SCSI_DATA0_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa0))
418   MCFG_SCSI_DATA1_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa1))
419   MCFG_SCSI_DATA2_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa2))
420   MCFG_SCSI_DATA3_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa3))
421   MCFG_SCSI_DATA4_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa4))
422   MCFG_SCSI_DATA5_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa5))
423   MCFG_SCSI_DATA6_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa6))
424   MCFG_SCSI_DATA7_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa7))
425
426   MCFG_SCSI_OUTPUT_LATCH_ADD("sasi_data_out", SASIBUS_TAG)
427
428   MCFG_SCSIDEV_ADD(SASIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", D9060HD, SCSI_ID_0)
454429MACHINE_CONFIG_END
455430
456431
r29632r29633
530505      m_riot0(*this, M6532_0_TAG),
531506      m_riot1(*this, M6532_1_TAG),
532507      m_via(*this, M6522_TAG),
533      m_sasibus(*this, SASIBUS_TAG ":host"),
508      m_sasibus(*this, SASIBUS_TAG),
509      m_sasi_data_out(*this, "sasi_data_out"),
534510      m_address(*this, "ADDRESS"),
535511      m_rfdo(1),
536512      m_daco(1),
r29632r29633
568544   save_item(NAME(m_daco));
569545   save_item(NAME(m_atna));
570546   save_item(NAME(m_enable));
547
548   m_via->write_pb4(!(m_variant == TYPE_9090)); // J14 (6 HEADS)
549   m_via->write_pb5(!(m_variant == TYPE_9060)); // J13 (4 HEADS)
571550}
572551
573552
trunk/src/emu/bus/a2bus/a2scsi.c
r29632r29633
3131
3232#include "a2scsi.h"
3333#include "includes/apple2.h"
34#include "machine/scsibus.h"
3534#include "machine/nscsi_cd.h"
3635#include "machine/nscsi_hd.h"
3736
r29632r29633
6160SLOT_INTERFACE_END
6261
6362MACHINE_CONFIG_FRAGMENT( scsi )
64   MCFG_SCSIBUS_ADD("scsi")
6563   MCFG_NSCSI_BUS_ADD(SCSI_BUS_TAG)
6664   MCFG_NSCSI_ADD("scsibus:0", scsi_devices, 0, false)
6765   MCFG_NSCSI_ADD("scsibus:1", scsi_devices, 0, false)
trunk/src/emu/bus/a2bus/a2hsscsi.c
r29632r29633
3838
3939#include "a2hsscsi.h"
4040#include "includes/apple2.h"
41#include "machine/scsibus.h"
4241#include "machine/nscsi_cd.h"
4342#include "machine/nscsi_hd.h"
4443
r29632r29633
6867SLOT_INTERFACE_END
6968
7069static MACHINE_CONFIG_FRAGMENT( hsscsi )
71   MCFG_SCSIBUS_ADD("scsi")
7270   MCFG_NSCSI_BUS_ADD(SCSI_BUS_TAG)
7371   MCFG_NSCSI_ADD("scsibus:0", hsscsi_devices, 0, false)
7472   MCFG_NSCSI_ADD("scsibus:1", hsscsi_devices, 0, false)
trunk/src/emu/bus/econet/e01.c
r29632r29633
5555*/
5656
5757#include "e01.h"
58#include "machine/scsibus.h"
59#include "machine/scsicb.h"
60#include "machine/scsihd.h"
58#include "bus/scsi/scsihd.h"
6159
6260
6361
r29632r29633
206204
207205WRITE_LINE_MEMBER( e01_device::scsi_bsy_w )
208206{
207   m_scsi_ctrl_in->write_bit1(state);
208
209209   if (state)
210210   {
211      m_scsibus->scsi_sel_w(0);
211      m_scsibus->write_sel(0);
212212   }
213213}
214214
215215WRITE_LINE_MEMBER( e01_device::scsi_req_w )
216216{
217   m_scsi_ctrl_in->write_bit5(state);
218
217219   if (!state)
218220   {
219      m_scsibus->scsi_ack_w(0);
221      m_scsibus->write_ack(0);
220222   }
221223
222224   m_hdc_irq = !state;
r29632r29633
240242   AM_RANGE(0xfc28, 0xfc28) AM_MIRROR(0x00c3) AM_READWRITE(network_irq_enable_r, network_irq_enable_w)
241243   AM_RANGE(0xfc2c, 0xfc2c) AM_MIRROR(0x00c3) AM_READ_PORT("FLAP")
242244   AM_RANGE(0xfc30, 0xfc30) AM_MIRROR(0x00c0) AM_READWRITE(hdc_data_r, hdc_data_w)
243   AM_RANGE(0xfc31, 0xfc31) AM_MIRROR(0x00c0) AM_READ(hdc_status_r)
245   AM_RANGE(0xfc31, 0xfc31) AM_MIRROR(0x00c0) AM_DEVREAD("scsi_ctrl_in", input_buffer_device, read)
244246   AM_RANGE(0xfc32, 0xfc32) AM_MIRROR(0x00c0) AM_WRITE(hdc_select_w)
245247   AM_RANGE(0xfc33, 0xfc33) AM_MIRROR(0x00c0) AM_WRITE(hdc_irq_enable_w)
246248ADDRESS_MAP_END
r29632r29633
275277
276278   MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG)
277279
278   MCFG_SCSIBUS_ADD(SCSIBUS_TAG)
279   MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":harddisk0", SCSIHD, SCSI_ID_0)
280   MCFG_SCSICB_ADD(SCSIBUS_TAG ":host")
281   MCFG_SCSICB_BSY_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, e01_device, scsi_bsy_w))
282   MCFG_SCSICB_REQ_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, e01_device, scsi_req_w))
280   MCFG_DEVICE_ADD(SCSIBUS_TAG, SCSI_PORT, 0)
281   MCFG_SCSI_DATA_INPUT_BUFFER("scsi_data_in")
282   MCFG_SCSI_MSG_HANDLER(DEVWRITELINE("scsi_ctrl_in", input_buffer_device, write_bit0))
283   MCFG_SCSI_BSY_HANDLER(WRITELINE(e01_device, scsi_bsy_w)) // bit1
284   // bit 2 0
285   // bit 3 0
286   // bit 4 NIRQ
287   MCFG_SCSI_REQ_HANDLER(WRITELINE(e01_device, scsi_req_w)) // bit5
288   MCFG_SCSI_IO_HANDLER(DEVWRITELINE("scsi_ctrl_in", input_buffer_device, write_bit6))
289   MCFG_SCSI_CD_HANDLER(DEVWRITELINE("scsi_ctrl_in", input_buffer_device, write_bit7))
290   MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
283291
292   MCFG_SCSI_OUTPUT_LATCH_ADD("scsi_data_out", SCSIBUS_TAG)
293   MCFG_DEVICE_ADD("scsi_data_in", INPUT_BUFFER, 0)
294   MCFG_DEVICE_ADD("scsi_ctrl_in", INPUT_BUFFER, 0)
295
284296   // internal ram
285297   MCFG_RAM_ADD(RAM_TAG)
286298   MCFG_RAM_DEFAULT_SIZE("64K")
r29632r29633
384396      m_adlc(*this, MC6854_TAG),
385397      m_rtc(*this, HD146818_TAG),
386398      m_ram(*this, RAM_TAG),
387      m_scsibus(*this, SCSIBUS_TAG ":host"),
399      m_scsibus(*this, SCSIBUS_TAG),
400      m_scsi_data_out(*this, "scsi_data_out"),
401      m_scsi_data_in(*this, "scsi_data_in"),
402      m_scsi_ctrl_in(*this, "scsi_ctrl_in"),
388403      m_floppy0(*this, WD2793_TAG":0"),
389404      m_floppy1(*this, WD2793_TAG":1"),
390405      m_rom(*this, R65C102_TAG),
r29632r29633
410425      m_adlc(*this, MC6854_TAG),
411426      m_rtc(*this, HD146818_TAG),
412427      m_ram(*this, RAM_TAG),
413      m_scsibus(*this, SCSIBUS_TAG ":host"),
428      m_scsibus(*this, SCSIBUS_TAG),
429      m_scsi_data_out(*this, "scsi_data_out"),
430      m_scsi_data_in(*this, "scsi_data_in"),
431      m_scsi_ctrl_in(*this, "scsi_ctrl_in"),
414432      m_floppy0(*this, WD2793_TAG":0"),
415433      m_floppy1(*this, WD2793_TAG":1"),
416434      m_rom(*this, R65C102_TAG),
r29632r29633
613631
614632READ8_MEMBER( e01_device::hdc_data_r )
615633{
616   UINT8 data = m_scsibus->scsi_data_r(space, 0);
634   UINT8 data = m_scsi_data_in->read();
617635
618   m_scsibus->scsi_ack_w(1);
636   m_scsibus->write_ack(1);
619637
620638   return data;
621639}
r29632r29633
627645
628646WRITE8_MEMBER( e01_device::hdc_data_w )
629647{
630   m_scsibus->scsi_data_w(space, 0, data);
648   m_scsi_data_out->write(data);
631649
632   m_scsibus->scsi_ack_w(1);
650   m_scsibus->write_ack(1);
633651}
634652
635653
636654//-------------------------------------------------
637//  hdc_status_r -
638//-------------------------------------------------
639
640READ8_MEMBER( e01_device::hdc_status_r )
641{
642   /*
643
644       bit     description
645
646       0       MSG
647       1       BSY
648       2       0
649       3       0
650       4       NIRQ
651       5       REQ
652       6       I/O
653       7       C/D
654
655   */
656
657   UINT8 data = 0;
658
659   // SCSI bus
660   data |= m_scsibus->scsi_msg_r();
661   data |= m_scsibus->scsi_bsy_r() << 1;
662   data |= m_scsibus->scsi_req_r() << 5;
663   data |= m_scsibus->scsi_io_r() << 6;
664   data |= m_scsibus->scsi_cd_r() << 7;
665
666   // TODO NIRQ
667
668   return data;
669}
670
671
672//-------------------------------------------------
673655//  hdc_select_w -
674656//-------------------------------------------------
675657
676658WRITE8_MEMBER( e01_device::hdc_select_w )
677659{
678   m_scsibus->scsi_sel_w(1);
660   m_scsibus->write_sel(1);
679661}
680662
681663
trunk/src/emu/bus/econet/e01.h
r29632r29633
1414#ifndef __E01__
1515#define __E01__
1616
17#include "emu.h"
1817#include "econet.h"
18#include "bus/centronics/ctronics.h"
19#include "bus/scsi/scsi.h"
1920#include "cpu/m6502/m65c02.h"
2021#include "machine/6522via.h"
21#include "bus/centronics/ctronics.h"
22#include "machine/buffer.h"
23#include "machine/latch.h"
2224#include "machine/mc146818.h"
2325#include "machine/mc6854.h"
2426#include "machine/ram.h"
25#include "machine/scsicb.h"
2627#include "machine/wd_fdc.h"
2728
2829class e01_device : public device_t,
r29632r29633
8687   required_device<mc6854_device> m_adlc;
8788   required_device<mc146818_device> m_rtc;
8889   required_device<ram_device> m_ram;
89   required_device<scsicb_device> m_scsibus;
90   required_device<SCSI_PORT_DEVICE> m_scsibus;
91   required_device<output_latch_device> m_scsi_data_out;
92   required_device<input_buffer_device> m_scsi_data_in;
93   required_device<input_buffer_device> m_scsi_ctrl_in;
9094   required_device<floppy_connector> m_floppy0;
9195   required_device<floppy_connector> m_floppy1;
9296   required_memory_region m_rom;
trunk/src/emu/bus/wangpc/wdc.c
r29632r29633
1010**********************************************************************/
1111
1212#include "wdc.h"
13#include "machine/scsihd.h"
13#include "bus/scsi/scsihd.h"
1414
1515
1616
trunk/src/emu/bus/scsi/scsihle.c
r0r29633
1// license:MAME
2// copyright-holders:smf
3/*
4
5scsihle.c
6
7Base class for HLE'd SCSI devices.
8
9*/
10
11#include "scsihle.h"
12
13scsihle_device::scsihle_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
14   device_t(mconfig, type, name, tag, owner, clock, shortname, source),
15   scsi_port_interface(mconfig, *this),
16   m_scsi_id(*this, "SCSI_ID"),
17   m_input_data(0)
18{
19}
20
21static INPUT_PORTS_START(scsihle)
22   PORT_START("SCSI_ID")
23   PORT_CONFNAME(0x07, 0x07, "SCSI ID")
24   PORT_CONFSETTING( 0x00, "0")
25   PORT_CONFSETTING( 0x01, "1")
26   PORT_CONFSETTING( 0x02, "2")
27   PORT_CONFSETTING( 0x03, "3")
28   PORT_CONFSETTING( 0x04, "4")
29   PORT_CONFSETTING( 0x05, "5")
30   PORT_CONFSETTING( 0x06, "6")
31   PORT_CONFSETTING( 0x07, "7")
32INPUT_PORTS_END
33
34DEVICE_INPUT_DEFAULTS_START( SCSI_ID_0 )
35   DEVICE_INPUT_DEFAULTS( "SCSI_ID", 7, 0 )
36DEVICE_INPUT_DEFAULTS_END
37
38DEVICE_INPUT_DEFAULTS_START( SCSI_ID_1 )
39   DEVICE_INPUT_DEFAULTS( "SCSI_ID", 7, 1 )
40DEVICE_INPUT_DEFAULTS_END
41
42DEVICE_INPUT_DEFAULTS_START( SCSI_ID_2 )
43   DEVICE_INPUT_DEFAULTS( "SCSI_ID", 7, 2 )
44DEVICE_INPUT_DEFAULTS_END
45
46DEVICE_INPUT_DEFAULTS_START( SCSI_ID_3 )
47   DEVICE_INPUT_DEFAULTS( "SCSI_ID", 7, 3 )
48DEVICE_INPUT_DEFAULTS_END
49
50DEVICE_INPUT_DEFAULTS_START( SCSI_ID_4 )
51   DEVICE_INPUT_DEFAULTS( "SCSI_ID", 7, 4 )
52DEVICE_INPUT_DEFAULTS_END
53
54DEVICE_INPUT_DEFAULTS_START( SCSI_ID_5 )
55   DEVICE_INPUT_DEFAULTS( "SCSI_ID", 7, 5 )
56DEVICE_INPUT_DEFAULTS_END
57
58DEVICE_INPUT_DEFAULTS_START( SCSI_ID_6 )
59   DEVICE_INPUT_DEFAULTS( "SCSI_ID", 7, 6 )
60DEVICE_INPUT_DEFAULTS_END
61
62DEVICE_INPUT_DEFAULTS_START( SCSI_ID_7 )
63   DEVICE_INPUT_DEFAULTS( "SCSI_ID", 7, 7 )
64DEVICE_INPUT_DEFAULTS_END
65
66ioport_constructor scsihle_device::device_input_ports() const
67{
68   return INPUT_PORTS_NAME(scsihle);
69}
70
71void scsihle_device::device_start()
72{
73   t10_start(*this);
74
75   req_timer = timer_alloc(0);
76   sel_timer = timer_alloc(1);
77   dataout_timer = timer_alloc(2);
78}
79
80void scsihle_device::device_reset()
81{
82   scsiID = m_scsi_id->read();
83   t10_reset();
84}
85
86int scsihle_device::GetDeviceID()
87{
88   return scsiID;
89}
90
91#define BSY_DELAY_NS    50
92#define REQ_DELAY_NS    90
93
94static const char *const phasenames[] =
95{
96   "data out", "data in", "command", "status", "none", "none", "message out", "message in", "bus free","select"
97};
98
99// scsihle
100#define SCSI_CMD_BUFFER_WRITE ( 0x3b )
101#define SCSI_CMD_BUFFER_READ ( 0x3c )
102
103// scsihd
104#define SCSI_CMD_FORMAT_UNIT        0x04
105#define SCSI_CMD_SEARCH_DATA_EQUAL  0x31
106#define SCSI_CMD_READ_DEFECT        0x37
107
108
109#define IS_COMMAND(cmd)             (command[0]==cmd)
110
111#define FORMAT_UNIT_TIMEOUT         5
112
113/*
114    LOGLEVEL
115        0   no logging,
116        1   just commands
117        2   1 + data
118        3   2 + line changes
119*/
120
121#define LOGLEVEL            0
122
123#define LOG(level, ...)     if(LOGLEVEL>=level) logerror(__VA_ARGS__)
124
125void scsihle_device::data_out(UINT8 data)
126{
127//   printf( "%s data out %02x\n", tag(), data );
128   output_data0(BIT(data, 0));
129   output_data1(BIT(data, 1));
130   output_data2(BIT(data, 2));
131   output_data3(BIT(data, 3));
132   output_data4(BIT(data, 4));
133   output_data5(BIT(data, 5));
134   output_data6(BIT(data, 6));
135   output_data7(BIT(data, 7));
136}
137
138void scsihle_device::scsi_out_req_delay(UINT8 state)
139{
140   req_timer->adjust(attotime::from_nsec(REQ_DELAY_NS),state);
141}
142
143void scsihle_device::dump_bytes(UINT8 *buff, int count)
144{
145   int byteno;
146
147   for(byteno=0; byteno<count; byteno++)
148   {
149      logerror("%02X ",buff[byteno]);
150   }
151}
152
153void scsihle_device::dump_command_bytes()
154{
155   logerror("sending command 0x%02X to ScsiID %d\n",command[0],scsiID);
156   dump_bytes(command,cmd_idx);
157   logerror("\n\n");
158}
159
160void scsihle_device::dump_data_bytes(int count)
161{
162   logerror("Data buffer[0..%d]\n",count);
163   dump_bytes(buffer,count);
164   logerror("\n\n");
165}
166
167void scsihle_device::scsibus_read_data()
168{
169   data_last = (bytes_left >= m_sector_bytes) ? m_sector_bytes : bytes_left;
170
171   LOG(2,"SCSIBUS:scsibus_read_data bytes_left=%04X, data_last=%04X\n",bytes_left,data_last);
172
173   data_idx=0;
174
175   if (data_last > 0)
176   {
177      ReadData(buffer, data_last);
178      bytes_left-=data_last;
179
180      data_out(buffer[ data_idx++ ]);
181   }
182}
183
184void scsihle_device::scsibus_write_data()
185{
186   if (data_last > 0)
187   {
188      WriteData(buffer, data_last);
189      bytes_left -= data_last;
190   }
191
192   data_idx=0;
193}
194
195void scsihle_device::device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr)
196{
197   switch (tid)
198   {
199   case 0:
200      output_req(param);
201      break;
202
203   case 1:
204      output_bsy(param);
205      break;
206
207   case 2:
208      // Some drives, notably the ST225N and ST125N, accept fromat unit commands
209      // with flags set indicating that bad block data should be transfered but
210      // don't then implemnt a data in phase, this timeout it to catch these !
211      if (IS_COMMAND(SCSI_CMD_FORMAT_UNIT) && (data_idx==0))
212      {
213         scsi_change_phase(SCSI_PHASE_STATUS);
214      }
215      break;
216   }
217}
218
219void scsihle_device::scsibus_exec_command()
220{
221   int command_local = 0;
222
223   if (LOGLEVEL)
224      dump_command_bytes();
225
226   //is_linked=command[cmd_idx-1] & 0x01;
227   is_linked=0;
228
229   // Check for locally executed commands, and if found execute them
230   switch (command[0])
231   {
232      // Format unit
233      case SCSI_CMD_FORMAT_UNIT:
234         LOG(1,"SCSIBUS: format unit command[1]=%02X & 0x10\n",(command[1] & 0x10));
235         command_local=1;
236         if ((command[1] & 0x10)==0x10)
237            m_phase = SCSI_PHASE_DATAOUT;
238         else
239            m_phase = SCSI_PHASE_STATUS;
240
241         m_status_code = SCSI_STATUS_CODE_GOOD;
242         bytes_left=4;
243         dataout_timer->adjust(attotime::from_seconds(FORMAT_UNIT_TIMEOUT));
244         break;
245
246      case SCSI_CMD_SEARCH_DATA_EQUAL:
247         LOG(1,"SCSIBUS: Search_data_equaln");
248         command_local=1;
249         bytes_left=0;
250         m_phase = SCSI_PHASE_STATUS;
251         m_status_code = SCSI_STATUS_CODE_GOOD;
252         break;
253
254      case SCSI_CMD_READ_DEFECT:
255         LOG(1,"SCSIBUS: read defect list\n");
256         command_local=1;
257
258         buffer[0] = 0x00;
259         buffer[1] = command[2];
260         buffer[3] = 0x00; // defect list len msb
261         buffer[4] = 0x00; // defect list len lsb
262
263         bytes_left=4;
264         m_phase = SCSI_PHASE_DATAIN;
265         m_status_code = SCSI_STATUS_CODE_GOOD;
266         break;
267
268      // write buffer
269      case SCSI_CMD_BUFFER_WRITE:
270         LOG(1,"SCSIBUS: write_buffer\n");
271         command_local=1;
272         bytes_left=(command[7]<<8)+command[8];
273         m_phase = SCSI_PHASE_DATAOUT;
274         m_status_code = SCSI_STATUS_CODE_GOOD;
275         break;
276
277      // read buffer
278      case SCSI_CMD_BUFFER_READ:
279         LOG(1,"SCSIBUS: read_buffer\n");
280         command_local=1;
281         bytes_left = (command[7]<<8) + command[8];
282         m_phase = SCSI_PHASE_DATAIN;
283         m_status_code = SCSI_STATUS_CODE_GOOD;
284         break;
285   }
286
287
288   // Check for locally executed command, if not then pass it on
289   // to the disk driver
290   if (!command_local)
291   {
292      SetCommand(command, cmd_idx);
293      ExecCommand();
294      GetLength(&bytes_left);
295      data_idx=0;
296   }
297
298   scsi_change_phase(m_phase);
299
300   LOG(1,"SCSIBUS:bytes_left=%02X data_idx=%02X\n",bytes_left,data_idx);
301
302   // This is correct as we need to read from disk for commands other than just read data
303   if ((m_phase == SCSI_PHASE_DATAIN) && (!command_local))
304      scsibus_read_data();
305}
306
307UINT8 scsihle_device::scsibus_driveno(UINT8 drivesel)
308{
309   switch (drivesel)
310   {
311      case 0x01: return 0;
312      case 0x02: return 1;
313      case 0x04: return 2;
314      case 0x08: return 3;
315      case 0x10: return 4;
316      case 0x20: return 5;
317      case 0x40: return 6;
318      case 0x80: return 7;
319      default: return 0;
320   }
321}
322
323void scsihle_device::scsi_change_phase(UINT8 newphase)
324{
325   LOG(1,"scsi_change_phase() from=%s, to=%s\n",phasenames[m_phase],phasenames[newphase]);
326
327   m_phase=newphase;
328   cmd_idx=0;
329   data_idx=0;
330
331   switch(m_phase)
332   {
333      case SCSI_PHASE_BUS_FREE:
334         output_bsy(0);
335         // sel
336         output_cd(0);
337         output_io(0);
338         output_msg(0);
339         output_req(0);
340         // ack
341         // atn
342         // rst
343         data_out(0);
344         LOG(1,"SCSIBUS: done\n\n");
345         break;
346
347      case SCSI_PHASE_COMMAND:
348         output_cd(1);
349         output_io(0);
350         output_msg(0);
351         scsi_out_req_delay(1);
352         data_out(0);
353         LOG(1,"\nSCSIBUS: Command begin\n");
354         break;
355
356      case SCSI_PHASE_DATAOUT:
357         output_cd(0);
358         output_io(0);
359         output_msg(0);
360         scsi_out_req_delay(1);
361         data_out(0);
362         break;
363
364      case SCSI_PHASE_DATAIN:
365         output_cd(0);
366         output_io(1);
367         output_msg(0);
368         scsi_out_req_delay(1);
369         break;
370
371      case SCSI_PHASE_STATUS:
372         output_cd(1);
373         output_io(1);
374         output_msg(0);
375         scsi_out_req_delay(1);
376         data_out(m_status_code);
377         break;
378
379      case SCSI_PHASE_MESSAGE_OUT:
380         output_cd(1);
381         output_io(0);
382         output_msg(1);
383         scsi_out_req_delay(1);
384         data_out(0);
385         break;
386
387      case SCSI_PHASE_MESSAGE_IN:
388         output_cd(1);
389         output_io(1);
390         output_msg(1);
391         scsi_out_req_delay(1);
392         data_out(0); // no errors for the time being !
393         break;
394   }
395}
396
397WRITE_LINE_MEMBER( scsihle_device::input_sel )
398{
399//   printf( "sel %d %d %02x\n", state, m_phase, m_input_data );
400   switch (m_phase)
401   {
402   case SCSI_PHASE_BUS_FREE:
403      // Note this assumes we only have one initiator and therefore
404      // only one line active.
405      if (scsibus_driveno(m_input_data) == scsiID)
406      {
407         void *hdfile = NULL;
408         // Check to see if device had image file mounted, if not, do not set busy,
409         // and stay busfree.
410         GetDevice(&hdfile);
411         if (hdfile != NULL)
412         {
413            if (!state)
414            {
415               scsi_change_phase(SCSI_PHASE_COMMAND);
416            }
417            else
418            {
419               sel_timer->adjust(attotime::from_nsec(BSY_DELAY_NS),1);
420            }
421         }
422      }
423      break;
424   }
425}
426
427WRITE_LINE_MEMBER( scsihle_device::input_ack )
428{
429   switch (m_phase)
430   {
431      case SCSI_PHASE_COMMAND:
432         if (!state)
433         {
434            command[ cmd_idx++ ] = m_input_data;
435
436            // If the command is ready go and execute it
437            if (cmd_idx == get_scsi_cmd_len(command[0]))
438            {
439               scsibus_exec_command();
440            }
441            else
442            {
443               scsi_out_req_delay(1);
444            }
445         }
446         else
447         {
448            scsi_out_req_delay(0);
449         }
450         break;
451
452      case SCSI_PHASE_DATAIN:
453         if (!state)
454         {
455            // check to see if we have reached the end of the block buffer
456            // and that there is more data to read from the scsi disk
457            if (data_idx == m_sector_bytes && bytes_left > 0)
458            {
459               scsibus_read_data();
460               scsi_out_req_delay(1);
461            }
462            else if (data_idx == data_last && bytes_left == 0)
463            {
464               scsi_change_phase(SCSI_PHASE_STATUS);
465            }
466            else
467            {
468               data_out(buffer[data_idx++]);
469               scsi_out_req_delay(1);
470            }
471         }
472         else
473         {
474            scsi_out_req_delay(0);
475         }
476         break;
477
478      case SCSI_PHASE_DATAOUT:
479         if (!state)
480         {
481            //LOG(1,"SCSIBUS:bytes_left=%02X data_idx=%02X\n",bytes_left,data_idx);
482            buffer[data_idx++] = m_input_data;
483
484            if (IS_COMMAND(SCSI_CMD_FORMAT_UNIT))
485            {
486               // If we have the first byte, then cancel the dataout timout
487               if (data_idx == 1)
488                  dataout_timer->adjust(attotime::never);
489
490               // When we have the first 3 bytes, calculate how many more are in the
491               // bad block list.
492               if (data_idx == 3)
493               {
494                  bytes_left += ((buffer[2]<<8) + buffer[3]);
495                  LOG(1, "format_unit reading an extra %d bytes\n", bytes_left - 4);
496                  dump_data_bytes(4);
497               }
498            }
499
500            // If the data buffer is full flush it to the SCSI disk
501
502            data_last = (bytes_left >= m_sector_bytes) ? m_sector_bytes : bytes_left;
503
504            if (data_idx == data_last)
505               scsibus_write_data();
506
507            if (data_idx == 0 && bytes_left == 0)
508            {
509               scsi_change_phase(SCSI_PHASE_STATUS);
510            }
511            else
512            {
513               scsi_out_req_delay(1);
514            }
515         }
516         else
517         {
518            scsi_out_req_delay(0);
519         }
520         break;
521
522      case SCSI_PHASE_STATUS:
523         if (!state)
524         {
525            if (cmd_idx > 0)
526            {
527               scsi_change_phase(SCSI_PHASE_MESSAGE_IN);
528            }
529            else
530            {
531               scsi_out_req_delay(1);
532            }
533         }
534         else
535         {
536            cmd_idx++;
537            scsi_out_req_delay(0);
538         }
539         break;
540
541      case SCSI_PHASE_MESSAGE_IN:
542         if (!state)
543         {
544            if (cmd_idx > 0)
545            {
546               if (is_linked)
547                  scsi_change_phase(SCSI_PHASE_COMMAND);
548               else
549                  scsi_change_phase(SCSI_PHASE_BUS_FREE);
550            }
551            else
552            {
553               scsi_out_req_delay(1);
554            }
555         }
556         else
557         {
558            cmd_idx++;
559            scsi_out_req_delay(0);
560         }
561         break;
562   }
563}
564
565WRITE_LINE_MEMBER( scsihle_device::input_rst )
566{
567   if (state)
568   {
569      scsi_change_phase(SCSI_PHASE_BUS_FREE);
570      cmd_idx = 0;
571      data_idx = 0;
572      is_linked = 0;
573   }
574}
575
576// get the length of a SCSI command based on it's command byte type
577int scsihle_device::get_scsi_cmd_len(int cbyte)
578{
579   int group;
580
581   group = (cbyte>>5) & 7;
582
583   if (group == 0 || group == 3 || group == 6 || group == 7) return 6;
584   if (group == 1 || group == 2) return 10;
585   if (group == 5) return 12;
586
587   fatalerror("scsihle: Unknown SCSI command group %d, command byte=%02X\n", group,cbyte);
588
589   return 6;
590}
Property changes on: trunk/src/emu/bus/scsi/scsihle.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/scsi/scsihle.h
r0r29633
1// license:MAME
2// copyright-holders:smf
3/*
4
5scsihle.h
6
7Base class for HLE'd SCSI devices.
8
9*/
10
11#ifndef _SCSIHLE_H_
12#define _SCSIHLE_H_
13
14#include "scsi.h"
15#include "machine/t10spc.h"
16
17class scsihle_device : public device_t,
18   public scsi_port_interface,
19   public virtual t10spc
20{
21public:
22   // construction/destruction
23   scsihle_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
24
25   virtual int GetDeviceID(); // hack for legacy_scsi_host_adapter::get_device
26
27   virtual DECLARE_WRITE_LINE_MEMBER( input_sel );
28   virtual DECLARE_WRITE_LINE_MEMBER( input_ack );
29   virtual DECLARE_WRITE_LINE_MEMBER( input_rst );
30   virtual DECLARE_WRITE_LINE_MEMBER( input_data0 ) { if (state) m_input_data |= 0x01; else m_input_data &= ~0x01; }
31   virtual DECLARE_WRITE_LINE_MEMBER( input_data1 ) { if (state) m_input_data |= 0x02; else m_input_data &= ~0x02; }
32   virtual DECLARE_WRITE_LINE_MEMBER( input_data2 ) { if (state) m_input_data |= 0x04; else m_input_data &= ~0x04; }
33   virtual DECLARE_WRITE_LINE_MEMBER( input_data3 ) { if (state) m_input_data |= 0x08; else m_input_data &= ~0x08; }
34   virtual DECLARE_WRITE_LINE_MEMBER( input_data4 ) { if (state) m_input_data |= 0x10; else m_input_data &= ~0x10; }
35   virtual DECLARE_WRITE_LINE_MEMBER( input_data5 ) { if (state) m_input_data |= 0x20; else m_input_data &= ~0x20; }
36   virtual DECLARE_WRITE_LINE_MEMBER( input_data6 ) { if (state) m_input_data |= 0x40; else m_input_data &= ~0x40; }
37   virtual DECLARE_WRITE_LINE_MEMBER( input_data7 ) { if (state) m_input_data |= 0x80; else m_input_data &= ~0x80; }
38
39protected:
40   // device-level overrides
41   virtual ioport_constructor device_input_ports() const;
42   virtual void device_start();
43   virtual void device_reset();
44   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
45
46private:
47   required_ioport m_scsi_id;
48   void data_out(UINT8 data);
49   void scsi_out_req_delay(UINT8 state);
50   void scsi_change_phase(UINT8 newphase);
51   int get_scsi_cmd_len(int cbyte);
52   UINT8 scsibus_driveno(UINT8  drivesel);
53   void scsibus_read_data();
54   void scsibus_write_data();
55   void scsibus_exec_command();
56   void dump_command_bytes();
57   void dump_data_bytes(int count);
58   void dump_bytes(UINT8 *buff, int count);
59
60   emu_timer *req_timer;
61   emu_timer *sel_timer;
62   emu_timer *dataout_timer;
63
64   UINT8 cmd_idx;
65   UINT8 is_linked;
66
67   UINT8 buffer[ 1024 ];
68   UINT16 data_idx;
69   int bytes_left;
70   int data_last;
71
72   int scsiID;
73   UINT8 m_input_data;
74};
75
76extern const input_device_default DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_0)[];
77extern const input_device_default DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_1)[];
78extern const input_device_default DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_2)[];
79extern const input_device_default DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_3)[];
80extern const input_device_default DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_4)[];
81extern const input_device_default DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_5)[];
82extern const input_device_default DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_6)[];
83extern const input_device_default DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_7)[];
84
85#define MCFG_SCSIDEV_ADD(_tag, _option, _type, _id) \
86   MCFG_DEVICE_MODIFY(_tag ) \
87   MCFG_SLOT_OPTION_ADD( _option, _type ) \
88   MCFG_SLOT_OPTION_DEVICE_INPUT_DEFAULTS( _option, _id ) \
89   MCFG_SLOT_DEFAULT_OPTION( _option ) \
90
91#endif
Property changes on: trunk/src/emu/bus/scsi/scsihle.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/scsi/acb4070.c
r29632r29633
33 *
44 */
55
6#include "emu.h"
76#include "acb4070.h"
87
98// device type definition
trunk/src/emu/bus/scsi/scsi.c
r0r29633
1// license:MAME
2// copyright-holders:smf
3
4#include "scsi.h"
5
6SCSI_PORT_DEVICE::SCSI_PORT_DEVICE(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
7   : device_t(mconfig, SCSI_PORT, "SCSI Port", tag, owner, clock, "scsi", __FILE__),
8   m_bsy_handler(*this),
9   m_sel_handler(*this),
10   m_cd_handler(*this),
11   m_io_handler(*this),
12   m_msg_handler(*this),
13   m_req_handler(*this),
14   m_ack_handler(*this),
15   m_atn_handler(*this),
16   m_rst_handler(*this),
17   m_data0_handler(*this),
18   m_data1_handler(*this),
19   m_data2_handler(*this),
20   m_data3_handler(*this),
21   m_data4_handler(*this),
22   m_data5_handler(*this),
23   m_data6_handler(*this),
24   m_data7_handler(*this),
25   m_bsy_in(0),
26   m_sel_in(0),
27   m_cd_in(0),
28   m_io_in(0),
29   m_msg_in(0),
30   m_req_in(0),
31   m_ack_in(0),
32   m_rst_in(0),
33   m_data0_in(0),
34   m_data1_in(0),
35   m_data2_in(0),
36   m_data3_in(0),
37   m_data4_in(0),
38   m_data5_in(0),
39   m_data6_in(0),
40   m_data7_in(0),
41   m_bsy_out(0),
42   m_sel_out(0),
43   m_cd_out(0),
44   m_io_out(0),
45   m_msg_out(0),
46   m_req_out(0),
47   m_ack_out(0),
48   m_rst_out(0),
49   m_data0_out(0),
50   m_data1_out(0),
51   m_data2_out(0),
52   m_data3_out(0),
53   m_data4_out(0),
54   m_data5_out(0),
55   m_data6_out(0),
56   m_data7_out(0)
57{
58}
59
60static MACHINE_CONFIG_FRAGMENT( scsi_port )
61   MCFG_DEVICE_ADD( SCSI_PORT_DEVICE1, SCSI_PORT_SLOT, 0 )
62   MCFG_DEVICE_ADD( SCSI_PORT_DEVICE2, SCSI_PORT_SLOT, 0 )
63   MCFG_DEVICE_ADD( SCSI_PORT_DEVICE3, SCSI_PORT_SLOT, 0 )
64   MCFG_DEVICE_ADD( SCSI_PORT_DEVICE4, SCSI_PORT_SLOT, 0 )
65   MCFG_DEVICE_ADD( SCSI_PORT_DEVICE5, SCSI_PORT_SLOT, 0 )
66   MCFG_DEVICE_ADD( SCSI_PORT_DEVICE6, SCSI_PORT_SLOT, 0 )
67   MCFG_DEVICE_ADD( SCSI_PORT_DEVICE7, SCSI_PORT_SLOT, 0 )
68MACHINE_CONFIG_END
69
70machine_config_constructor SCSI_PORT_DEVICE::device_mconfig_additions() const
71{
72   return MACHINE_CONFIG_NAME( scsi_port );
73}
74
75void SCSI_PORT_DEVICE::device_start()
76{
77   const char *deviceName[] =
78   {
79      SCSI_PORT_DEVICE1,
80      SCSI_PORT_DEVICE2,
81      SCSI_PORT_DEVICE3,
82      SCSI_PORT_DEVICE4,
83      SCSI_PORT_DEVICE5,
84      SCSI_PORT_DEVICE6,
85      SCSI_PORT_DEVICE7
86   };
87
88   m_device_count = 0;
89
90   for (int i = 0; i < 7; i++)
91   {
92      SCSI_PORT_SLOT_device *slot = subdevice<SCSI_PORT_SLOT_device>(deviceName[i]);
93      m_slot[i] = slot;
94
95      if (slot != NULL)
96         m_device_count = i + 1;
97   }
98
99   m_bsy_handler.resolve_safe();
100   m_sel_handler.resolve_safe();
101   m_cd_handler.resolve_safe();
102   m_io_handler.resolve_safe();
103   m_msg_handler.resolve_safe();
104   m_req_handler.resolve_safe();
105   m_ack_handler.resolve_safe();
106   m_atn_handler.resolve_safe();
107   m_rst_handler.resolve_safe();
108   m_data0_handler.resolve_safe();
109   m_data1_handler.resolve_safe();
110   m_data2_handler.resolve_safe();
111   m_data3_handler.resolve_safe();
112   m_data4_handler.resolve_safe();
113   m_data5_handler.resolve_safe();
114   m_data6_handler.resolve_safe();
115   m_data7_handler.resolve_safe();
116}
117
118void SCSI_PORT_DEVICE::update_bsy()
119{
120   int bsy = m_bsy_in;
121   for (int i = 0; i < m_device_count; i++)
122   {
123      bsy |= m_slot[i]->m_bsy;
124   }
125
126   if (m_bsy_out != bsy)
127   {
128      m_bsy_out = bsy;
129      m_bsy_handler(bsy);
130
131      for (int i = 0; i < m_device_count; i++)
132      {
133         scsi_port_interface *dev = m_slot[i]->dev();
134         if (dev != NULL)
135            dev->input_bsy(bsy);
136      }
137   }
138}
139
140void SCSI_PORT_DEVICE::update_sel()
141{
142   int sel = m_sel_in;
143   for (int i = 0; i < m_device_count; i++)
144   {
145      sel |= m_slot[i]->m_sel;
146   }
147
148   if (m_sel_out != sel)
149   {
150      m_sel_out = sel;
151      m_sel_handler(sel);
152
153      for (int i = 0; i < m_device_count; i++)
154      {
155         scsi_port_interface *dev = m_slot[i]->dev();
156         if (dev != NULL)
157            dev->input_sel(sel);
158      }
159   }
160}
161
162void SCSI_PORT_DEVICE::update_cd()
163{
164   int cd = m_cd_in;
165   for (int i = 0; i < m_device_count; i++)
166   {
167      cd |= m_slot[i]->m_cd;
168   }
169
170   if (m_cd_out != cd)
171   {
172      m_cd_out = cd;
173      m_cd_handler(cd);
174
175      for (int i = 0; i < m_device_count; i++)
176      {
177         scsi_port_interface *dev = m_slot[i]->dev();
178         if (dev != NULL)
179            dev->input_cd(cd);
180      }
181   }
182}
183
184void SCSI_PORT_DEVICE::update_io()
185{
186   int io = m_io_in;
187   for (int i = 0; i < m_device_count; i++)
188   {
189      io |= m_slot[i]->m_io;
190   }
191
192   if (m_io_out != io)
193   {
194      m_io_out = io;
195      m_io_handler(io);
196
197      for (int i = 0; i < m_device_count; i++)
198      {
199         scsi_port_interface *dev = m_slot[i]->dev();
200         if (dev != NULL)
201            dev->input_io(io);
202      }
203   }
204}
205
206void SCSI_PORT_DEVICE::update_msg()
207{
208   int msg = m_msg_in;
209   for (int i = 0; i < m_device_count; i++)
210   {
211      msg |= m_slot[i]->m_msg;
212   }
213
214   if (m_msg_out != msg)
215   {
216      m_msg_out = msg;
217      m_msg_handler(msg);
218
219      for (int i = 0; i < m_device_count; i++)
220      {
221         scsi_port_interface *dev = m_slot[i]->dev();
222         if (dev != NULL)
223            dev->input_msg(msg);
224      }
225   }
226}
227
228void SCSI_PORT_DEVICE::update_req()
229{
230   int req = m_req_in;
231   for (int i = 0; i < m_device_count; i++)
232   {
233      req |= m_slot[i]->m_req;
234   }
235
236   if (m_req_out != req)
237   {
238      m_req_out = req;
239      m_req_handler(req);
240
241      for (int i = 0; i < m_device_count; i++)
242      {
243         scsi_port_interface *dev = m_slot[i]->dev();
244         if (dev != NULL)
245            dev->input_req(req);
246      }
247   }
248}
249
250void SCSI_PORT_DEVICE::update_ack()
251{
252   int ack = m_ack_in;
253   for (int i = 0; i < m_device_count; i++)
254   {
255      ack |= m_slot[i]->m_ack;
256   }
257
258   if (m_ack_out != ack)
259   {
260      m_ack_out = ack;
261      m_ack_handler(ack);
262
263      for (int i = 0; i < m_device_count; i++)
264      {
265         scsi_port_interface *dev = m_slot[i]->dev();
266         if (dev != NULL)
267            dev->input_ack(ack);
268      }
269   }
270}
271
272void SCSI_PORT_DEVICE::update_atn()
273{
274   int atn = m_atn_in;
275   for (int i = 0; i < m_device_count; i++)
276   {
277      atn |= m_slot[i]->m_atn;
278   }
279
280   if (m_atn_out != atn)
281   {
282      m_atn_out = atn;
283      m_atn_handler(atn);
284
285      for (int i = 0; i < m_device_count; i++)
286      {
287         scsi_port_interface *dev = m_slot[i]->dev();
288         if (dev != NULL)
289            dev->input_atn(atn);
290      }
291   }
292}
293
294void SCSI_PORT_DEVICE::update_rst()
295{
296   int rst = m_rst_in;
297   for (int i = 0; i < m_device_count; i++)
298   {
299      rst |= m_slot[i]->m_rst;
300   }
301
302   if (m_rst_out != rst)
303   {
304      m_rst_out = rst;
305      m_rst_handler(rst);
306
307      for (int i = 0; i < m_device_count; i++)
308      {
309         scsi_port_interface *dev = m_slot[i]->dev();
310         if (dev != NULL)
311            dev->input_rst(rst);
312      }
313   }
314}
315
316void SCSI_PORT_DEVICE::update_data0()
317{
318   int data0 = m_data0_in;
319   for (int i = 0; i < m_device_count; i++)
320   {
321      data0 |= m_slot[i]->m_data0;
322   }
323
324   if (m_data0_out != data0)
325   {
326      m_data0_out = data0;
327      m_data0_handler(data0);
328
329      for (int i = 0; i < m_device_count; i++)
330      {
331         scsi_port_interface *dev = m_slot[i]->dev();
332         if (dev != NULL)
333            dev->input_data0(data0);
334      }
335   }
336}
337
338void SCSI_PORT_DEVICE::update_data1()
339{
340   int data1 = m_data1_in;
341   for (int i = 0; i < m_device_count; i++)
342   {
343      data1 |= m_slot[i]->m_data1;
344   }
345
346   if (m_data1_out != data1)
347   {
348      m_data1_out = data1;
349      m_data1_handler(data1);
350
351      for (int i = 0; i < m_device_count; i++)
352      {
353         scsi_port_interface *dev = m_slot[i]->dev();
354         if (dev != NULL)
355            dev->input_data1(data1);
356      }
357   }
358}
359
360void SCSI_PORT_DEVICE::update_data2()
361{
362   int data2 = m_data2_in;
363   for (int i = 0; i < m_device_count; i++)
364   {
365      data2 |= m_slot[i]->m_data2;
366   }
367
368   if (m_data2_out != data2)
369   {
370      m_data2_out = data2;
371      m_data2_handler(data2);
372
373      for (int i = 0; i < m_device_count; i++)
374      {
375         scsi_port_interface *dev = m_slot[i]->dev();
376         if (dev != NULL)
377            dev->input_data2(data2);
378      }
379   }
380}
381
382void SCSI_PORT_DEVICE::update_data3()
383{
384   int data3 = m_data3_in;
385   for (int i = 0; i < m_device_count; i++)
386   {
387      data3 |= m_slot[i]->m_data3;
388   }
389
390   if (m_data3_out != data3)
391   {
392      m_data3_out = data3;
393      m_data3_handler(data3);
394
395      for (int i = 0; i < m_device_count; i++)
396      {
397         scsi_port_interface *dev = m_slot[i]->dev();
398         if (dev != NULL)
399            dev->input_data3(data3);
400      }
401   }
402}
403
404void SCSI_PORT_DEVICE::update_data4()
405{
406   int data4 = m_data4_in;
407   for (int i = 0; i < m_device_count; i++)
408   {
409      data4 |= m_slot[i]->m_data4;
410   }
411
412   if (m_data4_out != data4)
413   {
414      m_data4_out = data4;
415      m_data4_handler(data4);
416
417      for (int i = 0; i < m_device_count; i++)
418      {
419         scsi_port_interface *dev = m_slot[i]->dev();
420         if (dev != NULL)
421            dev->input_data4(data4);
422      }
423   }
424}
425
426void SCSI_PORT_DEVICE::update_data5()
427{
428   int data5 = m_data5_in;
429   for (int i = 0; i < m_device_count; i++)
430   {
431      data5 |= m_slot[i]->m_data5;
432   }
433
434   if (m_data5_out != data5)
435   {
436      m_data5_out = data5;
437      m_data5_handler(data5);
438
439      for (int i = 0; i < m_device_count; i++)
440      {
441         scsi_port_interface *dev = m_slot[i]->dev();
442         if (dev != NULL)
443            dev->input_data5(data5);
444      }
445   }
446}
447
448void SCSI_PORT_DEVICE::update_data6()
449{
450   int data6 = m_data6_in;
451   for (int i = 0; i < m_device_count; i++)
452   {
453      data6 |= m_slot[i]->m_data6;
454   }
455
456   if (m_data6_out != data6)
457   {
458      m_data6_out = data6;
459      m_data6_handler(data6);
460
461      for (int i = 0; i < m_device_count; i++)
462      {
463         scsi_port_interface *dev = m_slot[i]->dev();
464         if (dev != NULL)
465            dev->input_data6(data6);
466      }
467   }
468}
469
470void SCSI_PORT_DEVICE::update_data7()
471{
472   int data7 = m_data7_in;
473   for (int i = 0; i < m_device_count; i++)
474   {
475      data7 |= m_slot[i]->m_data7;
476   }
477
478   if (m_data7_out != data7)
479   {
480      m_data7_out = data7;
481      m_data7_handler(data7);
482
483      for (int i = 0; i < m_device_count; i++)
484      {
485         scsi_port_interface *dev = m_slot[i]->dev();
486         if (dev != NULL)
487            dev->input_data7(data7);
488      }
489   }
490}
491
492WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_bsy )
493{
494   if (m_bsy_in != state)
495   {
496      m_bsy_in = state;
497      update_bsy();
498   }
499}
500
501WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_sel )
502{
503   if (m_sel_in != state)
504   {
505      m_sel_in = state;
506      update_sel();
507   }
508}
509
510WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_cd )
511{
512   if (m_cd_in != state)
513   {
514      m_cd_in = state;
515      update_cd();
516   }
517}
518
519WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_io )
520{
521   if (m_io_in != state)
522   {
523      m_io_in = state;
524      update_io();
525   }
526}
527
528WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_msg )
529{
530   if (m_msg_in != state)
531   {
532      m_msg_in = state;
533      update_msg();
534   }
535}
536
537WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_req )
538{
539   if (m_req_in != state)
540   {
541      m_req_in = state;
542      update_req();
543   }
544}
545
546WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_ack )
547{
548   if (m_ack_in != state)
549   {
550      m_ack_in = state;
551      update_ack();
552   }
553}
554
555WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_atn )
556{
557   if (m_atn_in != state)
558   {
559      m_atn_in = state;
560      update_atn();
561   }
562}
563
564WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_rst )
565{
566   if (m_rst_in != state)
567   {
568      m_rst_in = state;
569      update_rst();
570   }
571}
572
573WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_data0 )
574{
575   if (m_data0_in != state)
576   {
577      m_data0_in = state;
578      update_data0();
579   }
580}
581
582WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_data1 )
583{
584   if (m_data1_in != state)
585   {
586      m_data1_in = state;
587      update_data1();
588   }
589}
590
591WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_data2 )
592{
593   if (m_data2_in != state)
594   {
595      m_data2_in = state;
596      update_data2();
597   }
598}
599
600WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_data3 )
601{
602   if (m_data3_in != state)
603   {
604      m_data3_in = state;
605      update_data3();
606   }
607}
608
609WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_data4 )
610{
611   if (m_data4_in != state)
612   {
613      m_data4_in = state;
614      update_data4();
615   }
616}
617
618WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_data5 )
619{
620   if (m_data5_in != state)
621   {
622      m_data5_in = state;
623      update_data5();
624   }
625}
626
627WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_data6 )
628{
629   if (m_data6_in != state)
630   {
631      m_data6_in = state;
632      update_data6();
633   }
634}
635
636WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_data7 )
637{
638   if (m_data7_in != state)
639   {
640      m_data7_in = state;
641      update_data7();
642   }
643}
644
645const device_type SCSI_PORT = &device_creator<SCSI_PORT_DEVICE>;
646
647SCSI_PORT_SLOT_device::SCSI_PORT_SLOT_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
648   device_t(mconfig, SCSI_PORT_SLOT, "SCSI Connector", tag, owner, clock, "scsi_slot", __FILE__),
649   device_slot_interface(mconfig, *this),
650   m_dev(NULL),
651   m_bsy(0),
652   m_sel(0),
653   m_cd(0),
654   m_io(0),
655   m_msg(0),
656   m_req(0),
657   m_ack(0),
658   m_rst(0),
659   m_data0(0),
660   m_data1(0),
661   m_data2(0),
662   m_data3(0),
663   m_data4(0),
664   m_data5(0),
665   m_data6(0),
666   m_data7(0)
667{
668   m_port = dynamic_cast<SCSI_PORT_DEVICE *>(device().owner());
669}
670
671void SCSI_PORT_SLOT_device::device_config_complete()
672{
673   m_dev = dynamic_cast<scsi_port_interface *>(get_card_device());
674}
675
676void SCSI_PORT_SLOT_device::device_start()
677{
678}
679
680const device_type SCSI_PORT_SLOT = &device_creator<SCSI_PORT_SLOT_device>;
681
682scsi_port_interface::scsi_port_interface(const machine_config &mconfig, device_t &device)
683   : device_slot_card_interface(mconfig, device)
684{
685   m_slot = dynamic_cast<SCSI_PORT_SLOT_device *>(device.owner());
686}
687
688scsi_port_interface::~scsi_port_interface()
689{
690}
Property changes on: trunk/src/emu/bus/scsi/scsi.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/scsi/acb4070.h
r29632r29633
33#ifndef __ACB4070__
44#define __ACB4070__
55
6#include "machine/scsihd.h"
6#include "scsihd.h"
77
88class acb4070_device : public scsihd_device
99{
trunk/src/emu/bus/scsi/scsi.h
r0r29633
1// license:MAME
2// copyright-holders:smf
3
4#pragma once
5
6#ifndef _SCSI_H_
7#define _SCSI_H_
8
9#include "emu.h"
10#include "machine/buffer.h"
11#include "machine/latch.h"
12
13#define SCSI_PORT_DEVICE1 "1"
14#define SCSI_PORT_DEVICE2 "2"
15#define SCSI_PORT_DEVICE3 "3"
16#define SCSI_PORT_DEVICE4 "4"
17#define SCSI_PORT_DEVICE5 "5"
18#define SCSI_PORT_DEVICE6 "6"
19#define SCSI_PORT_DEVICE7 "7"
20
21#define MCFG_SCSI_BSY_HANDLER(_devcb) \
22   devcb = &SCSI_PORT_DEVICE::set_bsy_handler(*device, DEVCB2_##_devcb);
23
24#define MCFG_SCSI_SEL_HANDLER(_devcb) \
25   devcb = &SCSI_PORT_DEVICE::set_sel_handler(*device, DEVCB2_##_devcb);
26
27#define MCFG_SCSI_CD_HANDLER(_devcb) \
28   devcb = &SCSI_PORT_DEVICE::set_cd_handler(*device, DEVCB2_##_devcb);
29
30#define MCFG_SCSI_IO_HANDLER(_devcb) \
31   devcb = &SCSI_PORT_DEVICE::set_io_handler(*device, DEVCB2_##_devcb);
32
33#define MCFG_SCSI_MSG_HANDLER(_devcb) \
34   devcb = &SCSI_PORT_DEVICE::set_msg_handler(*device, DEVCB2_##_devcb);
35
36#define MCFG_SCSI_REQ_HANDLER(_devcb) \
37   devcb = &SCSI_PORT_DEVICE::set_req_handler(*device, DEVCB2_##_devcb);
38
39#define MCFG_SCSI_ACK_HANDLER(_devcb) \
40   devcb = &SCSI_PORT_DEVICE::set_ack_handler(*device, DEVCB2_##_devcb);
41
42#define MCFG_SCSI_ATN_HANDLER(_devcb) \
43   devcb = &SCSI_PORT_DEVICE::set_atn_handler(*device, DEVCB2_##_devcb);
44
45#define MCFG_SCSI_RST_HANDLER(_devcb) \
46   devcb = &SCSI_PORT_DEVICE::set_rst_handler(*device, DEVCB2_##_devcb);
47
48#define MCFG_SCSI_DATA0_HANDLER(_devcb) \
49   devcb = &SCSI_PORT_DEVICE::set_data0_handler(*device, DEVCB2_##_devcb);
50
51#define MCFG_SCSI_DATA1_HANDLER(_devcb) \
52   devcb = &SCSI_PORT_DEVICE::set_data1_handler(*device, DEVCB2_##_devcb);
53
54#define MCFG_SCSI_DATA2_HANDLER(_devcb) \
55   devcb = &SCSI_PORT_DEVICE::set_data2_handler(*device, DEVCB2_##_devcb);
56
57#define MCFG_SCSI_DATA3_HANDLER(_devcb) \
58   devcb = &SCSI_PORT_DEVICE::set_data3_handler(*device, DEVCB2_##_devcb);
59
60#define MCFG_SCSI_DATA4_HANDLER(_devcb) \
61   devcb = &SCSI_PORT_DEVICE::set_data4_handler(*device, DEVCB2_##_devcb);
62
63#define MCFG_SCSI_DATA5_HANDLER(_devcb) \
64   devcb = &SCSI_PORT_DEVICE::set_data5_handler(*device, DEVCB2_##_devcb);
65
66#define MCFG_SCSI_DATA6_HANDLER(_devcb) \
67   devcb = &SCSI_PORT_DEVICE::set_data6_handler(*device, DEVCB2_##_devcb);
68
69#define MCFG_SCSI_DATA7_HANDLER(_devcb) \
70   devcb = &SCSI_PORT_DEVICE::set_data7_handler(*device, DEVCB2_##_devcb);
71
72#define MCFG_SCSI_OUTPUT_LATCH_ADD(_tag, scsi_port_tag) \
73   MCFG_DEVICE_ADD(_tag, OUTPUT_LATCH, 0) \
74   MCFG_OUTPUT_LATCH_BIT0_HANDLER(DEVWRITELINE(scsi_port_tag, SCSI_PORT_DEVICE, write_data0)) \
75   MCFG_OUTPUT_LATCH_BIT1_HANDLER(DEVWRITELINE(scsi_port_tag, SCSI_PORT_DEVICE, write_data1)) \
76   MCFG_OUTPUT_LATCH_BIT2_HANDLER(DEVWRITELINE(scsi_port_tag, SCSI_PORT_DEVICE, write_data2)) \
77   MCFG_OUTPUT_LATCH_BIT3_HANDLER(DEVWRITELINE(scsi_port_tag, SCSI_PORT_DEVICE, write_data3)) \
78   MCFG_OUTPUT_LATCH_BIT4_HANDLER(DEVWRITELINE(scsi_port_tag, SCSI_PORT_DEVICE, write_data4)) \
79   MCFG_OUTPUT_LATCH_BIT5_HANDLER(DEVWRITELINE(scsi_port_tag, SCSI_PORT_DEVICE, write_data5)) \
80   MCFG_OUTPUT_LATCH_BIT6_HANDLER(DEVWRITELINE(scsi_port_tag, SCSI_PORT_DEVICE, write_data6)) \
81   MCFG_OUTPUT_LATCH_BIT7_HANDLER(DEVWRITELINE(scsi_port_tag, SCSI_PORT_DEVICE, write_data7))
82
83#define MCFG_SCSI_DATA_INPUT_BUFFER(_tag) \
84   MCFG_SCSI_DATA0_HANDLER(DEVWRITELINE(_tag, input_buffer_device, write_bit0)) \
85   MCFG_SCSI_DATA1_HANDLER(DEVWRITELINE(_tag, input_buffer_device, write_bit1)) \
86   MCFG_SCSI_DATA2_HANDLER(DEVWRITELINE(_tag, input_buffer_device, write_bit2)) \
87   MCFG_SCSI_DATA3_HANDLER(DEVWRITELINE(_tag, input_buffer_device, write_bit3)) \
88   MCFG_SCSI_DATA4_HANDLER(DEVWRITELINE(_tag, input_buffer_device, write_bit4)) \
89   MCFG_SCSI_DATA5_HANDLER(DEVWRITELINE(_tag, input_buffer_device, write_bit5)) \
90   MCFG_SCSI_DATA6_HANDLER(DEVWRITELINE(_tag, input_buffer_device, write_bit6)) \
91   MCFG_SCSI_DATA7_HANDLER(DEVWRITELINE(_tag, input_buffer_device, write_bit7))
92
93class SCSI_PORT_SLOT_device;
94class scsi_port_interface;
95
96class SCSI_PORT_DEVICE : public device_t
97{
98   friend class scsi_port_interface;
99
100public:
101   // construction/destruction
102   SCSI_PORT_DEVICE(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
103
104   template<class _Object> static devcb2_base &set_bsy_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_bsy_handler.set_callback(object); }
105   template<class _Object> static devcb2_base &set_sel_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_sel_handler.set_callback(object); }
106   template<class _Object> static devcb2_base &set_cd_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_cd_handler.set_callback(object); }
107   template<class _Object> static devcb2_base &set_io_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_io_handler.set_callback(object); }
108   template<class _Object> static devcb2_base &set_msg_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_msg_handler.set_callback(object); }
109   template<class _Object> static devcb2_base &set_req_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_req_handler.set_callback(object); }
110   template<class _Object> static devcb2_base &set_ack_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_ack_handler.set_callback(object); }
111   template<class _Object> static devcb2_base &set_atn_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_atn_handler.set_callback(object); }
112   template<class _Object> static devcb2_base &set_rst_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_rst_handler.set_callback(object); }
113   template<class _Object> static devcb2_base &set_data0_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_data0_handler.set_callback(object); }
114   template<class _Object> static devcb2_base &set_data1_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_data1_handler.set_callback(object); }
115   template<class _Object> static devcb2_base &set_data2_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_data2_handler.set_callback(object); }
116   template<class _Object> static devcb2_base &set_data3_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_data3_handler.set_callback(object); }
117   template<class _Object> static devcb2_base &set_data4_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_data4_handler.set_callback(object); }
118   template<class _Object> static devcb2_base &set_data5_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_data5_handler.set_callback(object); }
119   template<class _Object> static devcb2_base &set_data6_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_data6_handler.set_callback(object); }
120   template<class _Object> static devcb2_base &set_data7_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_data7_handler.set_callback(object); }
121
122   DECLARE_WRITE_LINE_MEMBER( write_bsy );
123   DECLARE_WRITE_LINE_MEMBER( write_sel );
124   DECLARE_WRITE_LINE_MEMBER( write_cd );
125   DECLARE_WRITE_LINE_MEMBER( write_io );
126   DECLARE_WRITE_LINE_MEMBER( write_msg );
127   DECLARE_WRITE_LINE_MEMBER( write_req );
128   DECLARE_WRITE_LINE_MEMBER( write_ack );
129   DECLARE_WRITE_LINE_MEMBER( write_atn );
130   DECLARE_WRITE_LINE_MEMBER( write_rst );
131   DECLARE_WRITE_LINE_MEMBER( write_data0 );
132   DECLARE_WRITE_LINE_MEMBER( write_data1 );
133   DECLARE_WRITE_LINE_MEMBER( write_data2 );
134   DECLARE_WRITE_LINE_MEMBER( write_data3 );
135   DECLARE_WRITE_LINE_MEMBER( write_data4 );
136   DECLARE_WRITE_LINE_MEMBER( write_data5 );
137   DECLARE_WRITE_LINE_MEMBER( write_data6 );
138   DECLARE_WRITE_LINE_MEMBER( write_data7 );
139
140protected:
141   // device-level overrides
142   virtual void device_start();
143   virtual machine_config_constructor device_mconfig_additions() const;
144
145   void update_bsy();
146   void update_sel();
147   void update_cd();
148   void update_io();
149   void update_msg();
150   void update_req();
151   void update_ack();
152   void update_atn();
153   void update_rst();
154   void update_data0();
155   void update_data1();
156   void update_data2();
157   void update_data3();
158   void update_data4();
159   void update_data5();
160   void update_data6();
161   void update_data7();
162
163private:
164   devcb2_write_line m_bsy_handler;
165   devcb2_write_line m_sel_handler;
166   devcb2_write_line m_cd_handler;
167   devcb2_write_line m_io_handler;
168   devcb2_write_line m_msg_handler;
169   devcb2_write_line m_req_handler;
170   devcb2_write_line m_ack_handler;
171   devcb2_write_line m_atn_handler;
172   devcb2_write_line m_rst_handler;
173   devcb2_write_line m_data0_handler;
174   devcb2_write_line m_data1_handler;
175   devcb2_write_line m_data2_handler;
176   devcb2_write_line m_data3_handler;
177   devcb2_write_line m_data4_handler;
178   devcb2_write_line m_data5_handler;
179   devcb2_write_line m_data6_handler;
180   devcb2_write_line m_data7_handler;
181
182   SCSI_PORT_SLOT_device *m_slot[7];
183   int m_device_count;
184
185   int m_bsy_in;
186   int m_sel_in;
187   int m_cd_in;
188   int m_io_in;
189   int m_msg_in;
190   int m_req_in;
191   int m_ack_in;
192   int m_atn_in;
193   int m_rst_in;
194   int m_data0_in;
195   int m_data1_in;
196   int m_data2_in;
197   int m_data3_in;
198   int m_data4_in;
199   int m_data5_in;
200   int m_data6_in;
201   int m_data7_in;
202   int m_bsy_out;
203   int m_sel_out;
204   int m_cd_out;
205   int m_io_out;
206   int m_msg_out;
207   int m_req_out;
208   int m_ack_out;
209   int m_atn_out;
210   int m_rst_out;
211   int m_data0_out;
212   int m_data1_out;
213   int m_data2_out;
214   int m_data3_out;
215   int m_data4_out;
216   int m_data5_out;
217   int m_data6_out;
218   int m_data7_out;
219};
220
221extern const device_type SCSI_PORT;
222
223class scsi_port_interface;
224
225class SCSI_PORT_SLOT_device : public device_t,
226   public device_slot_interface
227{
228   friend class SCSI_PORT_DEVICE;
229   friend class scsi_port_interface;
230
231public:
232   SCSI_PORT_SLOT_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
233
234   scsi_port_interface *dev() { return m_dev; }
235   SCSI_PORT_DEVICE *port() { return m_port; }
236
237protected:
238   // device-level overrides
239   virtual void device_start();
240   virtual void device_config_complete();
241
242protected:
243   scsi_port_interface *m_dev;
244   SCSI_PORT_DEVICE *m_port;
245
246   int m_bsy;
247   int m_sel;
248   int m_cd;
249   int m_io;
250   int m_msg;
251   int m_req;
252   int m_ack;
253   int m_atn;
254   int m_rst;
255   int m_data0;
256   int m_data1;
257   int m_data2;
258   int m_data3;
259   int m_data4;
260   int m_data5;
261   int m_data6;
262   int m_data7;
263};
264
265extern const device_type SCSI_PORT_SLOT;
266
267class scsi_port_interface : public device_slot_card_interface
268{
269public:
270   scsi_port_interface(const machine_config &mconfig, device_t &device);
271   virtual ~scsi_port_interface();
272
273   virtual DECLARE_WRITE_LINE_MEMBER( input_bsy ) {}
274   virtual DECLARE_WRITE_LINE_MEMBER( input_sel ) {}
275   virtual DECLARE_WRITE_LINE_MEMBER( input_cd ) {}
276   virtual DECLARE_WRITE_LINE_MEMBER( input_io ) {}
277   virtual DECLARE_WRITE_LINE_MEMBER( input_msg ) {}
278   virtual DECLARE_WRITE_LINE_MEMBER( input_req ) {}
279   virtual DECLARE_WRITE_LINE_MEMBER( input_ack ) {}
280   virtual DECLARE_WRITE_LINE_MEMBER( input_atn ) {}
281   virtual DECLARE_WRITE_LINE_MEMBER( input_rst ) {}
282   virtual DECLARE_WRITE_LINE_MEMBER( input_data0 ) {}
283   virtual DECLARE_WRITE_LINE_MEMBER( input_data1 ) {}
284   virtual DECLARE_WRITE_LINE_MEMBER( input_data2 ) {}
285   virtual DECLARE_WRITE_LINE_MEMBER( input_data3 ) {}
286   virtual DECLARE_WRITE_LINE_MEMBER( input_data4 ) {}
287   virtual DECLARE_WRITE_LINE_MEMBER( input_data5 ) {}
288   virtual DECLARE_WRITE_LINE_MEMBER( input_data6 ) {}
289   virtual DECLARE_WRITE_LINE_MEMBER( input_data7 ) {}
290
291   DECLARE_WRITE_LINE_MEMBER( output_bsy ) { if (m_slot->m_bsy != state) { m_slot->m_bsy = state; m_slot->port()->update_bsy(); } }
292   DECLARE_WRITE_LINE_MEMBER( output_sel ) { if (m_slot->m_sel != state) { m_slot->m_sel = state; m_slot->port()->update_sel(); } }
293   DECLARE_WRITE_LINE_MEMBER( output_cd ) { if (m_slot->m_cd != state) { m_slot->m_cd = state; m_slot->port()->update_cd(); } }
294   DECLARE_WRITE_LINE_MEMBER( output_io ) { if (m_slot->m_io != state) { m_slot->m_io = state; m_slot->port()->update_io(); } }
295   DECLARE_WRITE_LINE_MEMBER( output_msg ) { if (m_slot->m_msg != state) { m_slot->m_msg = state; m_slot->port()->update_msg(); } }
296   DECLARE_WRITE_LINE_MEMBER( output_req ) { if (m_slot->m_req != state) { m_slot->m_req = state; m_slot->port()->update_req(); } }
297   DECLARE_WRITE_LINE_MEMBER( output_ack ) { if (m_slot->m_ack != state) { m_slot->m_ack = state; m_slot->port()->update_ack(); } }
298   DECLARE_WRITE_LINE_MEMBER( output_atn ) { if (m_slot->m_atn != state) { m_slot->m_atn = state; m_slot->port()->update_atn(); } }
299   DECLARE_WRITE_LINE_MEMBER( output_rst ) { if (m_slot->m_rst != state) { m_slot->m_rst = state; m_slot->port()->update_rst(); } }
300   DECLARE_WRITE_LINE_MEMBER( output_data0 ) { if (m_slot->m_data0 != state) { m_slot->m_data0 = state; m_slot->port()->update_data0(); } }
301   DECLARE_WRITE_LINE_MEMBER( output_data1 ) { if (m_slot->m_data1 != state) { m_slot->m_data1 = state; m_slot->port()->update_data1(); } }
302   DECLARE_WRITE_LINE_MEMBER( output_data2 ) { if (m_slot->m_data2 != state) { m_slot->m_data2 = state; m_slot->port()->update_data2(); } }
303   DECLARE_WRITE_LINE_MEMBER( output_data3 ) { if (m_slot->m_data3 != state) { m_slot->m_data3 = state; m_slot->port()->update_data3(); } }
304   DECLARE_WRITE_LINE_MEMBER( output_data4 ) { if (m_slot->m_data4 != state) { m_slot->m_data4 = state; m_slot->port()->update_data4(); } }
305   DECLARE_WRITE_LINE_MEMBER( output_data5 ) { if (m_slot->m_data5 != state) { m_slot->m_data5 = state; m_slot->port()->update_data5(); } }
306   DECLARE_WRITE_LINE_MEMBER( output_data6 ) { if (m_slot->m_data6 != state) { m_slot->m_data6 = state; m_slot->port()->update_data6(); } }
307   DECLARE_WRITE_LINE_MEMBER( output_data7 ) { if (m_slot->m_data7 != state) { m_slot->m_data7 = state; m_slot->port()->update_data7(); } }
308
309private:
310   SCSI_PORT_SLOT_device *m_slot;
311};
312
313#endif
Property changes on: trunk/src/emu/bus/scsi/scsi.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/scsi/s1410.c
r29632r29633
8686*/
8787
8888
89#include "emu.h"
9089#include "s1410.h"
9190#include "cpu/z80/z80.h"
9291#include "imagedev/harddriv.h"
trunk/src/emu/bus/scsi/scsicd.c
r0r29633
1// license:MAME
2// copyright-holders:smf
3/***************************************************************************
4
5 scsicd.c - Implementation of a SCSI CD-ROM device
6
7***************************************************************************/
8
9#include "scsicd.h"
10
11// device type definition
12const device_type SCSICD = &device_creator<scsicd_device>;
13
14scsicd_device::scsicd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
15   scsihle_device(mconfig, SCSICD, "SCSI CD", tag, owner, clock, "scsicd", __FILE__)
16{
17}
18
19scsicd_device::scsicd_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
20   scsihle_device(mconfig, type, name, tag, owner, clock, shortname, source)
21{
22}
23
24void scsicd_device::device_start()
25{
26   m_image = subdevice<cdrom_image_device>("image");
27   m_cdda = subdevice<cdda_device>("cdda");
28
29   scsihle_device::device_start();
30}
31
32cdrom_interface scsicd_device::cd_intf = { "cdrom", NULL };
33
34static MACHINE_CONFIG_FRAGMENT(scsi_cdrom)
35   MCFG_CDROM_ADD("image", scsicd_device::cd_intf)
36   MCFG_SOUND_ADD("cdda", CDDA, 0)
37MACHINE_CONFIG_END
38
39machine_config_constructor scsicd_device::device_mconfig_additions() const
40{
41   return MACHINE_CONFIG_NAME(scsi_cdrom);
42}
Property changes on: trunk/src/emu/bus/scsi/scsicd.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/scsi/cdu76s.c
r0r29633
1#include "cdu76s.h"
2
3void sony_cdu76s_device::ExecCommand()
4{
5   switch ( command[0] )
6   {
7      case 0x12: // INQUIRY
8         logerror("CDU76S: INQUIRY\n");
9         m_phase = SCSI_PHASE_DATAIN;
10         m_status_code = SCSI_STATUS_CODE_GOOD;
11         m_transfer_length = SCSILengthFromUINT8( &command[ 4 ] );
12         break;
13   }
14}
15
16void sony_cdu76s_device::ReadData( UINT8 *data, int dataLength )
17{
18   switch ( command[0] )
19   {
20      case 0x12: // INQUIRY
21         memset( data, 0, dataLength );
22         data[0] = 0x05; // device is present, device is CD/DVD (MMC-3)
23         data[1] = 0x80; // media is removable
24         data[2] = 0x05; // device complies with SPC-3 standard
25         data[3] = 0x02; // response data format = SPC-3 standard
26         // some Konami games freak out if this isn't "Sony", so we'll lie
27         // this is the actual drive on my Nagano '98 board
28         strcpy((char *)&data[8], "Sony");
29         strcpy((char *)&data[16], "CDU-76S");
30         strcpy((char *)&data[32], "1.0");
31         break;
32
33      default:
34         scsicd_device::ReadData( data, dataLength );
35         break;
36   }
37}
38
39// device type definition
40const device_type CDU76S = &device_creator<sony_cdu76s_device>;
41
42sony_cdu76s_device::sony_cdu76s_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
43   scsicd_device(mconfig, CDU76S, "Sony CDU-76S", tag, owner, clock, "cdu76s", __FILE__)
44{
45}
Property changes on: trunk/src/emu/bus/scsi/cdu76s.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/scsi/s1410.h
r29632r29633
1414#ifndef __S1410__
1515#define __S1410__
1616
17#include "emu.h"
18#include "machine/scsihd.h"
17#include "scsihd.h"
1918
2019class s1410_device  : public scsihd_device
2120{
trunk/src/emu/bus/scsi/scsicd.h
r0r29633
1// license:MAME
2// copyright-holders:smf
3/***************************************************************************
4
5 scsicd.h
6
7***************************************************************************/
8
9#ifndef _SCSICD_H_
10#define _SCSICD_H_
11
12#include "scsihle.h"
13#include "machine/t10mmc.h"
14
15class scsicd_device : public scsihle_device,
16   public t10mmc
17{
18public:
19   // construction/destruction
20   scsicd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
21   scsicd_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
22   virtual machine_config_constructor device_mconfig_additions() const;
23
24   static struct cdrom_interface cd_intf;
25
26protected:
27   virtual void device_start();
28};
29
30// device type definition
31extern const device_type SCSICD;
32
33#endif
Property changes on: trunk/src/emu/bus/scsi/scsicd.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/scsi/scsihd.c
r0r29633
1// license:MAME
2// copyright-holders:smf
3/***************************************************************************
4
5 scsihd.c - Implementation of a SCSI hard disk drive
6
7***************************************************************************/
8
9#include "scsihd.h"
10
11// device type definition
12const device_type SCSIHD = &device_creator<scsihd_device>;
13
14scsihd_device::scsihd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
15   : scsihle_device(mconfig, SCSIHD, "SCSI HD", tag, owner, clock, "scsihd", __FILE__)
16{
17}
18
19scsihd_device::scsihd_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
20   scsihle_device(mconfig, type, name, tag, owner, clock, shortname, source)
21{
22}
23
24void scsihd_device::device_start()
25{
26   m_image = subdevice<harddisk_image_device>("image");
27
28   scsihle_device::device_start();
29}
30
31harddisk_interface scsihd_device::hd_intf = { "scsi_hdd", NULL };
32
33static MACHINE_CONFIG_FRAGMENT(scsi_harddisk)
34   MCFG_HARDDISK_CONFIG_ADD("image", scsihd_device::hd_intf)
35MACHINE_CONFIG_END
36
37machine_config_constructor scsihd_device::device_mconfig_additions() const
38{
39   return MACHINE_CONFIG_NAME(scsi_harddisk);
40}
Property changes on: trunk/src/emu/bus/scsi/scsihd.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/scsi/d9060hd.c
r29632r29633
33 *
44 */
55
6#include "emu.h"
76#include "d9060hd.h"
87
98// device type definition
trunk/src/emu/bus/scsi/cdu76s.h
r0r29633
1/***************************************************************************
2
3    cdu76s.h
4
5    Sony CDU-76S
6
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10***************************************************************************/
11
12#pragma once
13
14#ifndef __CDU76S_H__
15#define __CDU76S_H__
16
17#include "scsicd.h"
18#include "machine/t10mmc.h"
19
20class sony_cdu76s_device : public scsicd_device
21{
22public:
23   sony_cdu76s_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
24
25   virtual void ExecCommand();
26   virtual void ReadData( UINT8 *data, int dataLength );
27};
28
29// device type definition
30extern const device_type CDU76S;
31
32#endif
Property changes on: trunk/src/emu/bus/scsi/cdu76s.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/scsi/scsihd.h
r0r29633
1// license:MAME
2// copyright-holders:smf
3/***************************************************************************
4
5 scsihd.h
6
7***************************************************************************/
8
9#ifndef _SCSIHD_H_
10#define _SCSIHD_H_
11
12#include "scsihle.h"
13#include "machine/t10sbc.h"
14
15class scsihd_device : public scsihle_device,
16   public t10sbc
17{
18public:
19   // construction/destruction
20   scsihd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
21   scsihd_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
22   virtual machine_config_constructor device_mconfig_additions() const;
23
24   static struct harddisk_interface hd_intf;
25
26protected:
27   virtual void device_start();
28};
29
30// device type definition
31extern const device_type SCSIHD;
32
33#endif
Property changes on: trunk/src/emu/bus/scsi/scsihd.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/scsi/d9060hd.h
r29632r29633
33#ifndef __D9060HD__
44#define __D9060HD__
55
6#include "machine/scsihd.h"
6#include "scsihd.h"
77
88class d9060hd_device : public scsihd_device
99{
trunk/src/emu/bus/scsi/sa1403d.h
r29632r29633
1414#ifndef __SA1403D__
1515#define __SA1403D__
1616
17#include "emu.h"
17#include "scsihd.h"
1818#include "imagedev/harddriv.h"
19#include "machine/scsihd.h"
2019
2120class sa1403d_device  : public scsihd_device
2221{
trunk/src/emu/bus/cbmiec/cmdhd.c
r29632r29633
101101   MCFG_I8255A_ADD(I8255A_TAG, ppi_intf)
102102   //MCFG_RTC72421A_ADD(RTC72421A_TAG)
103103
104   MCFG_SCSIBUS_ADD(SCSIBUS_TAG)
105   MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":harddisk0", SCSIHD, SCSI_ID_0)
106   MCFG_SCSICB_ADD(SCSIBUS_TAG ":host")
104   MCFG_DEVICE_ADD(SCSIBUS_TAG, SCSI_PORT, 0)
105   MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
107106MACHINE_CONFIG_END
108107
109108
r29632r29633
131130   : device_t(mconfig, CMD_HD, "HD", tag, owner, clock, "cmdhd", __FILE__),
132131      device_cbm_iec_interface(mconfig, *this),
133132      m_maincpu(*this, M6502_TAG),
134      m_scsibus(*this, SCSIBUS_TAG":host")
133      m_scsibus(*this, SCSIBUS_TAG)
135134{
136135}
137136
trunk/src/emu/bus/cbmiec/cmdhd.h
r29632r29633
2020#include "imagedev/harddriv.h"
2121#include "machine/6522via.h"
2222#include "machine/i8255.h"
23#include "machine/scsibus.h"
24#include "machine/scsicb.h"
25#include "machine/scsihd.h"
23#include "bus/scsi/scsihd.h"
2624
2725
2826
r29632r29633
6563   void cbm_iec_reset(int state);
6664
6765   required_device<cpu_device> m_maincpu;
68   required_device<scsicb_device> m_scsibus;
66   required_device<SCSI_PORT_DEVICE> m_scsibus;
6967};
7068
7169
trunk/src/emu/emu.mak
r29632r29633
171171   $(EMUMACHINE)/netlist.o     \
172172   $(EMUMACHINE)/nvram.o       \
173173   $(EMUMACHINE)/ram.o         \
174   $(EMUMACHINE)/legscsi.o     \
174175   $(EMUMACHINE)/terminal.o    \
175176
176177EMUIMAGEDEVOBJS = \
trunk/src/emu/machine/scsicb.c
r29632r29633
1// license:MAME
2// copyright-holders:smf
3/*
4
5scsicb.c
6
7Implementation of a raw SCSI/SASI bus for machines that don't use a SCSI
8controler chip such as the RM Nimbus, which implements it as a bunch of
974LS series chips.
10
11*/
12
13#include "scsicb.h"
14#include "scsibus.h"
15
16#define VERBOSE_LEVEL ( 0 )
17
18INLINE void ATTR_PRINTF( 3, 4 ) verboselog( int n_level, running_machine &machine, const char *s_fmt, ... )
19{
20   if( VERBOSE_LEVEL >= n_level )
21   {
22      va_list v;
23      char buf[ 32768 ];
24      va_start( v, s_fmt );
25      vsprintf( buf, s_fmt, v );
26      va_end( v );
27      logerror( "%s: %s", machine.describe_context( ), buf );
28   }
29}
30
31scsicb_device::scsicb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
32   : scsidev_device(mconfig, SCSICB, "SCSI callback", tag, owner, clock, "scsicb", __FILE__),
33   m_bsy_handler(*this),
34   m_sel_handler(*this),
35   m_cd_handler(*this),
36   m_io_handler(*this),
37   m_msg_handler(*this),
38   m_req_handler(*this),
39   m_ack_handler(*this),
40   m_atn_handler(*this),
41   m_rst_handler(*this)
42{
43}
44
45void scsicb_device::device_start()
46{
47   scsidev_device::device_start();
48
49   linestate = 0;
50
51   m_bsy_handler.resolve_safe();
52   m_sel_handler.resolve_safe();
53   m_cd_handler.resolve_safe();
54   m_io_handler.resolve_safe();
55   m_msg_handler.resolve_safe();
56   m_req_handler.resolve_safe();
57   m_ack_handler.resolve_safe();
58   m_atn_handler.resolve_safe();
59   m_rst_handler.resolve_safe();
60}
61
62void scsicb_device::scsi_in( UINT32 data, UINT32 mask )
63{
64   linestate = data;
65
66   trigger_callback( mask, SCSI_MASK_BSY, m_bsy_handler );
67   trigger_callback( mask, SCSI_MASK_SEL, m_sel_handler );
68   trigger_callback( mask, SCSI_MASK_CD, m_cd_handler );
69   trigger_callback( mask, SCSI_MASK_IO, m_io_handler );
70   trigger_callback( mask, SCSI_MASK_MSG, m_msg_handler );
71   trigger_callback( mask, SCSI_MASK_REQ, m_req_handler );
72   trigger_callback( mask, SCSI_MASK_ACK, m_ack_handler );
73   trigger_callback( mask, SCSI_MASK_ATN, m_atn_handler );
74   trigger_callback( mask, SCSI_MASK_RST, m_rst_handler );
75}
76
77UINT8 scsicb_device::scsi_data_r()
78{
79   UINT8 data = linestate & SCSI_MASK_DATA;
80   verboselog( 1, machine(), "%s scsi_data_r() %02x\n", tag(), data );
81   return data;
82}
83
84void scsicb_device::scsi_data_w( UINT8 data )
85{
86   verboselog( 1, machine(), "%s scsi_data_w( %02x )\n", tag(), data );
87   scsi_out( data, SCSI_MASK_DATA );
88}
89
90READ8_MEMBER( scsicb_device::scsi_data_r )
91{
92   return scsi_data_r();
93}
94
95WRITE8_MEMBER( scsicb_device::scsi_data_w )
96{
97   scsi_data_w( data );
98}
99
100READ_LINE_MEMBER( scsicb_device::scsi_bsy_r ) { return get_scsi_line(SCSI_MASK_BSY); }
101READ_LINE_MEMBER( scsicb_device::scsi_sel_r ) { return get_scsi_line(SCSI_MASK_SEL); }
102READ_LINE_MEMBER( scsicb_device::scsi_cd_r ) { return get_scsi_line(SCSI_MASK_CD); }
103READ_LINE_MEMBER( scsicb_device::scsi_io_r ) { return get_scsi_line(SCSI_MASK_IO); }
104READ_LINE_MEMBER( scsicb_device::scsi_msg_r ) { return get_scsi_line(SCSI_MASK_MSG); }
105READ_LINE_MEMBER( scsicb_device::scsi_req_r ) { return get_scsi_line(SCSI_MASK_REQ); }
106READ_LINE_MEMBER( scsicb_device::scsi_ack_r ) { return get_scsi_line(SCSI_MASK_ACK); }
107READ_LINE_MEMBER( scsicb_device::scsi_atn_r ) { return get_scsi_line(SCSI_MASK_ATN); }
108READ_LINE_MEMBER( scsicb_device::scsi_rst_r ) { return get_scsi_line(SCSI_MASK_RST); }
109
110WRITE_LINE_MEMBER( scsicb_device::scsi_bsy_w ) { set_scsi_line(SCSI_MASK_BSY, state); }
111WRITE_LINE_MEMBER( scsicb_device::scsi_sel_w ) { set_scsi_line(SCSI_MASK_SEL, state); }
112WRITE_LINE_MEMBER( scsicb_device::scsi_cd_w ) { set_scsi_line(SCSI_MASK_CD, state); }
113WRITE_LINE_MEMBER( scsicb_device::scsi_io_w ) { set_scsi_line(SCSI_MASK_IO, state); }
114WRITE_LINE_MEMBER( scsicb_device::scsi_msg_w ) { set_scsi_line(SCSI_MASK_MSG, state); }
115WRITE_LINE_MEMBER( scsicb_device::scsi_req_w ) { set_scsi_line(SCSI_MASK_REQ, state); }
116WRITE_LINE_MEMBER( scsicb_device::scsi_ack_w ) { set_scsi_line(SCSI_MASK_ACK, state); }
117WRITE_LINE_MEMBER( scsicb_device::scsi_atn_w ) { set_scsi_line(SCSI_MASK_ATN, state); }
118WRITE_LINE_MEMBER( scsicb_device::scsi_rst_w ) { set_scsi_line(SCSI_MASK_RST, state); }
119
120UINT8 scsicb_device::get_scsi_line( UINT32 mask )
121{
122   UINT8 state;
123
124   if( ( linestate & mask ) != 0 )
125   {
126      state = 1;
127   }
128   else
129   {
130      state = 0;
131   }
132
133   verboselog( 1, machine(), "%s get_scsi_line %s %d\n", tag(), get_line_name( mask ), state );
134
135   return state;
136}
137
138void scsicb_device::set_scsi_line( UINT32 mask, UINT8 state )
139{
140   verboselog( 1, machine(), "%s set_scsi_line %s %d\n", tag(), get_line_name( mask ), state );
141
142   if( state )
143   {
144      scsi_out( mask, mask );
145   }
146   else
147   {
148      scsi_out( 0, mask );
149   }
150}
151
152void scsicb_device::trigger_callback( UINT32 update_mask, UINT32 line_mask, devcb2_write_line &write_line )
153{
154   if( ( update_mask & line_mask ) != 0 && !write_line.isnull() )
155   {
156      UINT8 state;
157
158      if( ( linestate & line_mask ) != 0 )
159      {
160         state = 1;
161      }
162      else
163      {
164         state = 0;
165      }
166
167      verboselog( 1, machine(), "%s trigger_callback %s %d\n", tag(), get_line_name( line_mask ), state );
168
169      write_line( state );
170   }
171}
172
173const char *scsicb_device::get_line_name( UINT32 mask )
174{
175   switch( mask )
176   {
177   case SCSI_MASK_BSY:
178      return "bsy";
179
180   case SCSI_MASK_SEL:
181      return "sel";
182
183   case SCSI_MASK_CD:
184      return "cd";
185
186   case SCSI_MASK_IO:
187      return "io";
188
189   case SCSI_MASK_MSG:
190      return "msg";
191
192   case SCSI_MASK_REQ:
193      return "req";
194
195   case SCSI_MASK_ACK:
196      return "ack";
197
198   case SCSI_MASK_ATN:
199      return "atn";
200
201   case SCSI_MASK_RST:
202      return "rst";
203   }
204
205   return "?";
206}
207
208const device_type SCSICB = &device_creator<scsicb_device>;
trunk/src/emu/machine/scsicb.h
r29632r29633
1// license:MAME
2// copyright-holders:smf
3/*
4
5scsicb.h
6
7Implementation of a raw SCSI/SASI bus for machines that don't use a SCSI
8controler chip such as the RM Nimbus, which implements it as a bunch of
974LS series chips.
10
11*/
12
13#pragma once
14
15#ifndef _SCSICB_H_
16#define _SCSICB_H_
17
18#include "scsidev.h"
19
20class scsicb_device : public scsidev_device
21{
22public:
23   // construction/destruction
24   scsicb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
25
26   // static configuration helpers
27   template<class _Object> static devcb2_base &set_bsy_handler(device_t &device, _Object object) { return downcast<scsicb_device &>(device).m_bsy_handler.set_callback(object); }
28   template<class _Object> static devcb2_base &set_sel_handler(device_t &device, _Object object) { return downcast<scsicb_device &>(device).m_sel_handler.set_callback(object); }
29   template<class _Object> static devcb2_base &set_cd_handler(device_t &device, _Object object) { return downcast<scsicb_device &>(device).m_cd_handler.set_callback(object); }
30   template<class _Object> static devcb2_base &set_io_handler(device_t &device, _Object object) { return downcast<scsicb_device &>(device).m_io_handler.set_callback(object); }
31   template<class _Object> static devcb2_base &set_msg_handler(device_t &device, _Object object) { return downcast<scsicb_device &>(device).m_msg_handler.set_callback(object); }
32   template<class _Object> static devcb2_base &set_req_handler(device_t &device, _Object object) { return downcast<scsicb_device &>(device).m_req_handler.set_callback(object); }
33   template<class _Object> static devcb2_base &set_ack_handler(device_t &device, _Object object) { return downcast<scsicb_device &>(device).m_ack_handler.set_callback(object); }
34   template<class _Object> static devcb2_base &set_atn_handler(device_t &device, _Object object) { return downcast<scsicb_device &>(device).m_atn_handler.set_callback(object); }
35   template<class _Object> static devcb2_base &set_rst_handler(device_t &device, _Object object) { return downcast<scsicb_device &>(device).m_rst_handler.set_callback(object); }
36
37   virtual void scsi_in( UINT32 data, UINT32 mask );
38
39   UINT8 scsi_data_r();
40   void scsi_data_w( UINT8 data );
41
42   DECLARE_READ8_MEMBER( scsi_data_r );
43   DECLARE_WRITE8_MEMBER( scsi_data_w );
44
45   DECLARE_READ_LINE_MEMBER( scsi_bsy_r );
46   DECLARE_READ_LINE_MEMBER( scsi_sel_r );
47   DECLARE_READ_LINE_MEMBER( scsi_cd_r );
48   DECLARE_READ_LINE_MEMBER( scsi_io_r );
49   DECLARE_READ_LINE_MEMBER( scsi_msg_r );
50   DECLARE_READ_LINE_MEMBER( scsi_req_r );
51   DECLARE_READ_LINE_MEMBER( scsi_ack_r );
52   DECLARE_READ_LINE_MEMBER( scsi_atn_r );
53   DECLARE_READ_LINE_MEMBER( scsi_rst_r );
54
55   DECLARE_WRITE_LINE_MEMBER( scsi_bsy_w );
56   DECLARE_WRITE_LINE_MEMBER( scsi_sel_w );
57   DECLARE_WRITE_LINE_MEMBER( scsi_cd_w );
58   DECLARE_WRITE_LINE_MEMBER( scsi_io_w );
59   DECLARE_WRITE_LINE_MEMBER( scsi_msg_w );
60   DECLARE_WRITE_LINE_MEMBER( scsi_req_w );
61   DECLARE_WRITE_LINE_MEMBER( scsi_ack_w );
62   DECLARE_WRITE_LINE_MEMBER( scsi_atn_w );
63   DECLARE_WRITE_LINE_MEMBER( scsi_rst_w );
64
65protected:
66   // device-level overrides
67   virtual void device_start();
68
69private:
70   UINT8 get_scsi_line(UINT32 mask);
71   void set_scsi_line(UINT32 mask, UINT8 state);
72   void trigger_callback(UINT32 update_mask, UINT32 line_mask, devcb2_write_line &write_line);
73   const char *get_line_name(UINT32 mask);
74
75   devcb2_write_line m_bsy_handler;
76   devcb2_write_line m_sel_handler;
77   devcb2_write_line m_cd_handler;
78   devcb2_write_line m_io_handler;
79   devcb2_write_line m_msg_handler;
80   devcb2_write_line m_req_handler;
81   devcb2_write_line m_ack_handler;
82   devcb2_write_line m_atn_handler;
83   devcb2_write_line m_rst_handler;
84
85   UINT32 linestate;
86};
87
88#define MCFG_SCSICB_ADD(_tag) \
89   MCFG_DEVICE_ADD(_tag, SCSICB, 0)
90
91#define MCFG_SCSICB_BSY_HANDLER(_devcb) \
92   devcb = &scsicb_device::set_bsy_handler(*device, DEVCB2_##_devcb);
93#define MCFG_SCSICB_SEL_HANDLER(_devcb) \
94   devcb = &scsicb_device::set_sel_handler(*device, DEVCB2_##_devcb);
95#define MCFG_SCSICB_CD_HANDLER(_devcb) \
96   devcb = &scsicb_device::set_cd_handler(*device, DEVCB2_##_devcb);
97#define MCFG_SCSICB_IO_HANDLER(_devcb) \
98   devcb = &scsicb_device::set_io_handler(*device, DEVCB2_##_devcb);
99#define MCFG_SCSICB_MSG_HANDLER(_devcb) \
100   devcb = &scsicb_device::set_msg_handler(*device, DEVCB2_##_devcb);
101#define MCFG_SCSICB_REQ_HANDLER(_devcb) \
102   devcb = &scsicb_device::set_req_handler(*device, DEVCB2_##_devcb);
103#define MCFG_SCSICB_ACK_HANDLER(_devcb) \
104   devcb = &scsicb_device::set_ack_handler(*device, DEVCB2_##_devcb);
105#define MCFG_SCSICB_ATN_HANDLER(_devcb) \
106   devcb = &scsicb_device::set_atn_handler(*device, DEVCB2_##_devcb);
107#define MCFG_SCSICB_RST_HANDLER(_devcb) \
108   devcb = &scsicb_device::set_rst_handler(*device, DEVCB2_##_devcb);
109// device type definition
110extern const device_type SCSICB;
111
112#endif
trunk/src/emu/machine/cdu76s.c
r29632r29633
1#include "cdu76s.h"
2
3void sony_cdu76s_device::ExecCommand()
4{
5   switch ( command[0] )
6   {
7      case 0x12: // INQUIRY
8         logerror("CDU76S: INQUIRY\n");
9         m_phase = SCSI_PHASE_DATAIN;
10         m_status_code = SCSI_STATUS_CODE_GOOD;
11         m_transfer_length = SCSILengthFromUINT8( &command[ 4 ] );
12         break;
13   }
14}
15
16void sony_cdu76s_device::ReadData( UINT8 *data, int dataLength )
17{
18   switch ( command[0] )
19   {
20      case 0x12: // INQUIRY
21         memset( data, 0, dataLength );
22         data[0] = 0x05; // device is present, device is CD/DVD (MMC-3)
23         data[1] = 0x80; // media is removable
24         data[2] = 0x05; // device complies with SPC-3 standard
25         data[3] = 0x02; // response data format = SPC-3 standard
26         // some Konami games freak out if this isn't "Sony", so we'll lie
27         // this is the actual drive on my Nagano '98 board
28         strcpy((char *)&data[8], "Sony");
29         strcpy((char *)&data[16], "CDU-76S");
30         strcpy((char *)&data[32], "1.0");
31         break;
32
33      default:
34         scsicd_device::ReadData( data, dataLength );
35         break;
36   }
37}
38
39// device type definition
40const device_type CDU76S = &device_creator<sony_cdu76s_device>;
41
42sony_cdu76s_device::sony_cdu76s_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
43   scsicd_device(mconfig, CDU76S, "Sony CDU-76S", tag, owner, clock, "cdu76s", __FILE__)
44{
45}
trunk/src/emu/machine/cdu76s.h
r29632r29633
1/***************************************************************************
2
3    cdu76s.h
4
5    Sony CDU-76S
6
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10***************************************************************************/
11
12#pragma once
13
14#ifndef __CDU76S_H__
15#define __CDU76S_H__
16
17#include "scsicd.h"
18#include "t10mmc.h"
19
20class sony_cdu76s_device : public scsicd_device
21{
22public:
23   sony_cdu76s_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
24
25   virtual void ExecCommand();
26   virtual void ReadData( UINT8 *data, int dataLength );
27};
28
29// device type definition
30extern const device_type CDU76S;
31
32#endif
trunk/src/emu/machine/scsihd.c
r29632r29633
1// license:MAME
2// copyright-holders:smf
3/***************************************************************************
4
5 scsihd.c - Implementation of a SCSI hard disk drive
6
7***************************************************************************/
8
9#include "scsihd.h"
10
11// device type definition
12const device_type SCSIHD = &device_creator<scsihd_device>;
13
14scsihd_device::scsihd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
15   : scsihle_device(mconfig, SCSIHD, "SCSIHD", tag, owner, clock, "scsihd", __FILE__)
16{
17}
18
19scsihd_device::scsihd_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
20   scsihle_device(mconfig, type, name, tag, owner, clock, shortname, source)
21{
22}
23
24void scsihd_device::device_start()
25{
26   m_image = subdevice<harddisk_image_device>("image");
27
28   scsihle_device::device_start();
29}
30
31harddisk_interface scsihd_device::hd_intf = { "scsi_hdd", NULL };
32
33static MACHINE_CONFIG_FRAGMENT(scsi_harddisk)
34   MCFG_HARDDISK_CONFIG_ADD("image", scsihd_device::hd_intf)
35MACHINE_CONFIG_END
36
37machine_config_constructor scsihd_device::device_mconfig_additions() const
38{
39   return MACHINE_CONFIG_NAME(scsi_harddisk);
40}
trunk/src/emu/machine/scsihd.h
r29632r29633
1// license:MAME
2// copyright-holders:smf
3/***************************************************************************
4
5 scsihd.h
6
7***************************************************************************/
8
9#ifndef _SCSIHD_H_
10#define _SCSIHD_H_
11
12#include "machine/scsihle.h"
13#include "machine/t10sbc.h"
14
15class scsihd_device : public scsihle_device,
16   public t10sbc
17{
18public:
19   // construction/destruction
20   scsihd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
21   scsihd_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
22   virtual machine_config_constructor device_mconfig_additions() const;
23
24   static struct harddisk_interface hd_intf;
25
26protected:
27   virtual void device_start();
28};
29
30// device type definition
31extern const device_type SCSIHD;
32
33#endif
trunk/src/emu/machine/scsicd.c
r29632r29633
1// license:MAME
2// copyright-holders:smf
3/***************************************************************************
4
5 scsicd.c - Implementation of a SCSI CD-ROM device
6
7***************************************************************************/
8
9#include "scsicd.h"
10
11// device type definition
12const device_type SCSICD = &device_creator<scsicd_device>;
13
14scsicd_device::scsicd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
15   scsihle_device(mconfig, SCSICD, "SCSICD", tag, owner, clock, "scsicd", __FILE__)
16{
17}
18
19scsicd_device::scsicd_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
20   scsihle_device(mconfig, type, name, tag, owner, clock, shortname, source)
21{
22}
23
24void scsicd_device::device_start()
25{
26   m_image = subdevice<cdrom_image_device>("image");
27   m_cdda = subdevice<cdda_device>("cdda");
28
29   scsihle_device::device_start();
30}
31
32cdrom_interface scsicd_device::cd_intf = { "cdrom", NULL };
33
34static MACHINE_CONFIG_FRAGMENT(scsi_cdrom)
35   MCFG_CDROM_ADD("image", scsicd_device::cd_intf)
36   MCFG_SOUND_ADD("cdda", CDDA, 0)
37MACHINE_CONFIG_END
38
39machine_config_constructor scsicd_device::device_mconfig_additions() const
40{
41   return MACHINE_CONFIG_NAME(scsi_cdrom);
42}
trunk/src/emu/machine/scsicd.h
r29632r29633
1// license:MAME
2// copyright-holders:smf
3/***************************************************************************
4
5 scsicd.h
6
7***************************************************************************/
8
9#ifndef _SCSICD_H_
10#define _SCSICD_H_
11
12#include "machine/scsihle.h"
13#include "machine/t10mmc.h"
14
15class scsicd_device : public scsihle_device,
16   public t10mmc
17{
18public:
19   // construction/destruction
20   scsicd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
21   scsicd_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
22   virtual machine_config_constructor device_mconfig_additions() const;
23
24   static struct cdrom_interface cd_intf;
25
26protected:
27   virtual void device_start();
28};
29
30// device type definition
31extern const device_type SCSICD;
32
33#endif
trunk/src/emu/machine/scsidev.c
r29632r29633
1// license:MAME
2// copyright-holders:smf
3/*
4
5scsidev.c
6
7Base class for SCSI devices.
8
9*/
10
11#include "machine/scsibus.h"
12#include "machine/scsidev.h"
13
14#define LOG ( 0 )
15
16scsidev_device::scsidev_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
17   device_t(mconfig, type, name, tag, owner, clock, shortname, source)
18{
19}
20
21void scsidev_device::device_start()
22{
23   data_out = 0;
24}
25
26void scsidev_device::scsi_out( UINT32 data, UINT32 mask )
27{
28#if LOG
29   printf( "%s scsi_out", tag() );
30
31   printf( " rst " );
32   if( ( mask & SCSI_MASK_RST ) != 0 )
33   {
34      printf( "%d", (int)( ( data & SCSI_MASK_RST ) != 0 ) );
35   }
36   else
37   {
38      printf( "-" );
39   }
40
41   printf( " atn " );
42   if( ( mask & SCSI_MASK_ATN ) != 0 )
43   {
44      printf( " %d", (int)( ( data & SCSI_MASK_ATN ) != 0 ) );
45   }
46   else
47   {
48      printf( "-" );
49   }
50
51   printf( " ack " );
52   if( ( mask & SCSI_MASK_ACK ) != 0 )
53   {
54      printf( "%d", (int)( ( data & SCSI_MASK_ACK ) != 0 ) );
55   }
56   else
57   {
58      printf( "-" );
59   }
60
61   printf( " req " );
62   if( ( mask & SCSI_MASK_REQ ) != 0 )
63   {
64      printf( "%d", (int)( ( data & SCSI_MASK_REQ ) != 0 ) );
65   }
66   else
67   {
68      printf( "-" );
69   }
70
71   printf( " msg " );
72   if( ( mask & SCSI_MASK_MSG ) != 0 )
73   {
74      printf( "%d", (int)( ( data & SCSI_MASK_MSG ) != 0 ) );
75   }
76   else
77   {
78      printf( "-" );
79   }
80
81   printf( " io " );
82   if( ( mask & SCSI_MASK_IO ) != 0 )
83   {
84      printf( "%d", (int)( ( data & SCSI_MASK_IO ) != 0 ) );
85   }
86   else
87   {
88      printf( "-" );
89   }
90
91   printf( " cd " );
92   if( ( mask & SCSI_MASK_CD ) != 0 )
93   {
94      printf( "%d", (int)( ( data & SCSI_MASK_CD ) != 0 ) );
95   }
96   else
97   {
98      printf( "-" );
99   }
100
101   printf( " sel " );
102   if( ( mask & SCSI_MASK_SEL ) != 0 )
103   {
104      printf( "%d", (int)( ( data & SCSI_MASK_SEL ) != 0 ) );
105   }
106   else
107   {
108      printf( "-" );
109   }
110
111   printf( " bsy " );
112   if( ( mask & SCSI_MASK_BSY ) != 0 )
113   {
114      printf( "%d", (int)( ( data & SCSI_MASK_BSY ) != 0 ) );
115   }
116   else
117   {
118      printf( "-" );
119   }
120
121   printf( " p " );
122   if( ( mask & SCSI_MASK_DATAP ) != 0 )
123   {
124      printf( "%d", (int)( ( data & SCSI_MASK_DATAP ) != 0 ) );
125   }
126   else
127   {
128      printf( "-" );
129   }
130
131   printf( " " );
132
133   if( ( mask & SCSI_MASK_DATAH ) != 0 )
134   {
135      printf( "%02x", ( data & SCSI_MASK_DATAH ) >> 8 );
136   }
137   else
138   {
139      printf( "--" );
140   }
141
142   if( ( mask & SCSI_MASK_DATA ) != 0 )
143   {
144      printf( "%02x", data & SCSI_MASK_DATA );
145   }
146   else
147   {
148      printf( "--" );
149   }
150
151   printf( "\n" );
152#endif
153
154   data_out = ( data_out & ~mask ) | ( data & mask );
155
156   m_scsibus->scsi_update();
157}
trunk/src/emu/machine/scsidev.h
r29632r29633
1// license:MAME
2// copyright-holders:smf
3/*
4
5scsidev.h
6
7Base class for SCSI devices.
8
9*/
10
11#ifndef _SCSIDEV_H_
12#define _SCSIDEV_H_
13
14#include "emu.h"
15
16#define SCSI_MASK_DATA  ( 0x00000ff )
17#define SCSI_MASK_DATAH ( 0x000ff00 )
18#define SCSI_MASK_DATAP ( 0x0010000 )
19#define SCSI_MASK_BSY   ( 0x0020000 )
20#define SCSI_MASK_SEL   ( 0x0040000 )
21#define SCSI_MASK_CD    ( 0x0080000 )
22#define SCSI_MASK_IO    ( 0x0100000 )
23#define SCSI_MASK_MSG   ( 0x0200000 )
24#define SCSI_MASK_REQ   ( 0x0400000 )
25#define SCSI_MASK_ACK   ( 0x0800000 )
26#define SCSI_MASK_ATN   ( 0x1000000 )
27#define SCSI_MASK_RST   ( 0x2000000 )
28#define SCSI_MASK_ALL   ( 0x3ffffff )
29
30class scsibus_device;
31
32// base handler
33class scsidev_device : public device_t
34{
35   friend class scsibus_device;
36
37public:
38   // construction/destruction
39   scsidev_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
40
41protected:
42   // device-level overrides
43   virtual void device_start();
44
45   void scsi_out( UINT32 data, UINT32 mask );
46
47private:
48   virtual void scsi_in( UINT32 data, UINT32 mask ) = 0;
49
50   UINT32 data_out;
51   scsibus_device *m_scsibus;
52};
53
54#endif
trunk/src/emu/machine/scsibus.c
r29632r29633
1// license:MAME
2// copyright-holders:smf
3/*
4
5scsibus.c
6
7*/
8
9#include "emu.h"
10#include "machine/scsibus.h"
11
12void scsibus_device::scsi_update()
13{
14   UINT32 newdata = 0;
15
16   for( int i = 0; i < deviceCount; i++ )
17   {
18      newdata |= devices[ i ]->data_out;
19   }
20
21   newdata &= SCSI_MASK_ALL;
22
23   UINT32 mask = data ^ newdata;
24
25   if( mask != 0 )
26   {
27      data = newdata;
28
29      for( int i = 0; i < deviceCount; i++ )
30      {
31         devices[ i ]->scsi_in( data, mask );
32      }
33   }
34}
35
36scsibus_device::scsibus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
37   : device_t(mconfig, SCSIBUS, "SCSI bus", tag, owner, clock, "scsibus", __FILE__)
38{
39}
40
41void scsibus_device::device_start()
42{
43   deviceCount = 0;
44
45   for( device_t *device = first_subdevice(); device != NULL; device = device->next() )
46   {
47      scsidev_device *scsidev = dynamic_cast<scsidev_device *>(device);
48      if( scsidev != NULL )
49      {
50         devices[ deviceCount++ ] = scsidev;
51         scsidev->m_scsibus = this;
52      }
53   }
54
55   data = 0;
56}
57
58const device_type SCSIBUS = &device_creator<scsibus_device>;
trunk/src/emu/machine/scsibus.h
r29632r29633
1// license:MAME
2// copyright-holders:smf
3/*
4
5scsibus.h
6
7*/
8
9#pragma once
10
11#ifndef _SCSIBUS_H_
12#define _SCSIBUS_H_
13
14#include "machine/scsidev.h"
15
16class scsibus_device : public device_t
17{
18public:
19   // construction/destruction
20   scsibus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
21   /* SCSI Bus read/write */
22
23   void scsi_update();
24
25protected:
26   // device-level overrides
27   virtual void device_start();
28
29private:
30   scsidev_device *devices[16];
31
32   UINT32 data;
33   int deviceCount;
34};
35
36#define MCFG_SCSIBUS_ADD(_tag) \
37   MCFG_DEVICE_ADD(_tag, SCSIBUS, 0)
38
39// device type definition
40extern const device_type SCSIBUS;
41
42#endif
trunk/src/emu/machine/scsihle.c
r29632r29633
1// license:MAME
2// copyright-holders:smf
3/*
4
5scsihle.c
6
7Base class for HLE'd SCSI devices.
8
9*/
10
11#include "machine/scsihle.h"
12
13scsihle_device::scsihle_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
14   scsidev_device(mconfig, type, name, tag, owner, clock, shortname, source)
15{
16}
17
18void scsihle_device::device_start()
19{
20   scsidev_device::device_start();
21   t10_start(*this);
22
23   req_timer = timer_alloc(0);
24   sel_timer = timer_alloc(1);
25   dataout_timer = timer_alloc(2);
26}
27
28void scsihle_device::device_reset()
29{
30   t10_reset();
31}
32
33int scsihle_device::GetDeviceID()
34{
35   return scsiID;
36}
37
38void scsihle_device::static_set_deviceid( device_t &device, int _scsiID )
39{
40   scsihle_device &scsidev = downcast<scsihle_device &>(device);
41   scsidev.scsiID = _scsiID;
42}
43
44#define BSY_DELAY_NS    50
45#define REQ_DELAY_NS    90
46
47static const char *const phasenames[] =
48{
49   "data out", "data in", "command", "status", "none", "none", "message out", "message in", "bus free","select"
50};
51
52// scsidev
53#define SCSI_CMD_BUFFER_WRITE ( 0x3b )
54#define SCSI_CMD_BUFFER_READ ( 0x3c )
55
56// scsihd
57#define SCSI_CMD_FORMAT_UNIT        0x04
58#define SCSI_CMD_SEARCH_DATA_EQUAL  0x31
59#define SCSI_CMD_READ_DEFECT        0x37
60
61
62#define IS_COMMAND(cmd)             (command[0]==cmd)
63
64#define FORMAT_UNIT_TIMEOUT         5
65
66/*
67    LOGLEVEL
68        0   no logging,
69        1   just commands
70        2   1 + data
71        3   2 + line changes
72*/
73
74#define LOGLEVEL            0
75
76#define LOG(level, ...)     if(LOGLEVEL>=level) logerror(__VA_ARGS__)
77
78void scsihle_device::scsi_out_req_delay(UINT8 state)
79{
80   req_timer->adjust(attotime::from_nsec(REQ_DELAY_NS),state);
81}
82
83void scsihle_device::dump_bytes(UINT8 *buff, int count)
84{
85   int byteno;
86
87   for(byteno=0; byteno<count; byteno++)
88   {
89      logerror("%02X ",buff[byteno]);
90   }
91}
92
93void scsihle_device::dump_command_bytes()
94{
95   logerror("sending command 0x%02X to ScsiID %d\n",command[0],scsiID);
96   dump_bytes(command,cmd_idx);
97   logerror("\n\n");
98}
99
100void scsihle_device::dump_data_bytes(int count)
101{
102   logerror("Data buffer[0..%d]\n",count);
103   dump_bytes(buffer,count);
104   logerror("\n\n");
105}
106
107void scsihle_device::scsibus_read_data()
108{
109   data_last = (bytes_left >= m_sector_bytes) ? m_sector_bytes : bytes_left;
110
111   LOG(2,"SCSIBUS:scsibus_read_data bytes_left=%04X, data_last=%04X\n",bytes_left,data_last);
112
113   data_idx=0;
114
115   if (data_last > 0)
116   {
117      ReadData(buffer, data_last);
118      bytes_left-=data_last;
119
120      scsi_out( buffer[ data_idx++ ], SCSI_MASK_DATA );
121   }
122}
123
124void scsihle_device::scsibus_write_data()
125{
126   if (data_last > 0)
127   {
128      WriteData(buffer, data_last);
129      bytes_left-=data_last;
130   }
131
132   data_idx=0;
133}
134
135void scsihle_device::device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr)
136{
137   switch( tid )
138   {
139   case 0:
140      scsi_out(param ? SCSI_MASK_REQ : 0, SCSI_MASK_REQ);
141      break;
142
143   case 1:
144      scsi_out(param ? SCSI_MASK_BSY : 0, SCSI_MASK_BSY);
145      break;
146
147   case 2:
148      // Some drives, notably the ST225N and ST125N, accept fromat unit commands
149      // with flags set indicating that bad block data should be transfered but
150      // don't then implemnt a data in phase, this timeout it to catch these !
151      if(IS_COMMAND(SCSI_CMD_FORMAT_UNIT) && (data_idx==0))
152      {
153         scsi_change_phase(SCSI_PHASE_STATUS);
154   }
155      break;
156}
157}
158
159void scsihle_device::scsibus_exec_command()
160{
161   int command_local = 0;
162
163   if(LOGLEVEL)
164      dump_command_bytes();
165
166   //is_linked=command[cmd_idx-1] & 0x01;
167   is_linked=0;
168
169   // Check for locally executed commands, and if found execute them
170   switch (command[0])
171   {
172      // Format unit
173      case SCSI_CMD_FORMAT_UNIT:
174         LOG(1,"SCSIBUS: format unit command[1]=%02X & 0x10\n",(command[1] & 0x10));
175         command_local=1;
176         if((command[1] & 0x10)==0x10)
177            m_phase = SCSI_PHASE_DATAOUT;
178         else
179            m_phase = SCSI_PHASE_STATUS;
180
181         m_status_code = SCSI_STATUS_CODE_GOOD;
182         bytes_left=4;
183         dataout_timer->adjust(attotime::from_seconds(FORMAT_UNIT_TIMEOUT));
184         break;
185
186      case SCSI_CMD_SEARCH_DATA_EQUAL:
187         LOG(1,"SCSIBUS: Search_data_equaln");
188         command_local=1;
189         bytes_left=0;
190         m_phase = SCSI_PHASE_STATUS;
191         m_status_code = SCSI_STATUS_CODE_GOOD;
192         break;
193
194      case SCSI_CMD_READ_DEFECT:
195         LOG(1,"SCSIBUS: read defect list\n");
196         command_local=1;
197
198         buffer[0] = 0x00;
199         buffer[1] = command[2];
200         buffer[3] = 0x00; // defect list len msb
201         buffer[4] = 0x00; // defect list len lsb
202
203         bytes_left=4;
204         m_phase = SCSI_PHASE_DATAIN;
205         m_status_code = SCSI_STATUS_CODE_GOOD;
206         break;
207
208      // write buffer
209      case SCSI_CMD_BUFFER_WRITE:
210         LOG(1,"SCSIBUS: write_buffer\n");
211         command_local=1;
212         bytes_left=(command[7]<<8)+command[8];
213         m_phase = SCSI_PHASE_DATAOUT;
214         m_status_code = SCSI_STATUS_CODE_GOOD;
215         break;
216
217      // read buffer
218      case SCSI_CMD_BUFFER_READ:
219         LOG(1,"SCSIBUS: read_buffer\n");
220         command_local=1;
221         bytes_left=(command[7]<<8)+command[8];
222         m_phase = SCSI_PHASE_DATAIN;
223         m_status_code = SCSI_STATUS_CODE_GOOD;
224         break;
225   }
226
227
228   // Check for locally executed command, if not then pass it on
229   // to the disk driver
230   if(!command_local)
231   {
232      SetCommand(command, cmd_idx);
233      ExecCommand();
234      GetLength(&bytes_left);
235      data_idx=0;
236   }
237
238   scsi_change_phase(m_phase);
239
240   LOG(1,"SCSIBUS:bytes_left=%02X data_idx=%02X\n",bytes_left,data_idx);
241
242   // This is correct as we need to read from disk for commands other than just read data
243   if ((m_phase == SCSI_PHASE_DATAIN) && (!command_local))
244      scsibus_read_data();
245}
246
247UINT8 scsihle_device::scsibus_driveno(UINT8 drivesel)
248{
249   switch (drivesel)
250   {
251      case 0x01: return 0;
252      case 0x02: return 1;
253      case 0x04: return 2;
254      case 0x08: return 3;
255      case 0x10: return 4;
256      case 0x20: return 5;
257      case 0x40: return 6;
258      case 0x80: return 7;
259      default: return 0;
260   }
261}
262
263void scsihle_device::scsi_change_phase(UINT8 newphase)
264{
265   LOG(1,"scsi_change_phase() from=%s, to=%s\n",phasenames[m_phase],phasenames[newphase]);
266
267   m_phase=newphase;
268   cmd_idx=0;
269   data_idx=0;
270
271   switch(m_phase)
272   {
273      case SCSI_PHASE_BUS_FREE:
274         scsi_out( 0, SCSI_MASK_ALL );
275         LOG(1,"SCSIBUS: done\n\n");
276         break;
277
278      case SCSI_PHASE_COMMAND:
279         scsi_out( SCSI_MASK_CD, SCSI_MASK_DATA | SCSI_MASK_CD | SCSI_MASK_IO | SCSI_MASK_MSG );
280         LOG(1,"\nSCSIBUS: Command begin\n");
281         scsi_out_req_delay( 1 );
282         break;
283
284      case SCSI_PHASE_DATAOUT:
285         scsi_out( 0, SCSI_MASK_DATA | SCSI_MASK_CD | SCSI_MASK_IO | SCSI_MASK_MSG );
286         scsi_out_req_delay( 1 );
287         break;
288
289      case SCSI_PHASE_DATAIN:
290         scsi_out( SCSI_MASK_IO, SCSI_MASK_CD | SCSI_MASK_IO | SCSI_MASK_MSG );
291         scsi_out_req_delay( 1 );
292         break;
293
294      case SCSI_PHASE_STATUS:
295         scsi_out( m_status_code | SCSI_MASK_CD | SCSI_MASK_IO, SCSI_MASK_DATA | SCSI_MASK_CD | SCSI_MASK_IO | SCSI_MASK_MSG );
296         scsi_out_req_delay( 1 );
297         break;
298
299      case SCSI_PHASE_MESSAGE_OUT:
300         scsi_out( SCSI_MASK_CD | SCSI_MASK_MSG, SCSI_MASK_DATA | SCSI_MASK_CD | SCSI_MASK_IO | SCSI_MASK_MSG );
301         scsi_out_req_delay( 1 );
302         break;
303
304      case SCSI_PHASE_MESSAGE_IN:
305         scsi_out( 0 | SCSI_MASK_CD | SCSI_MASK_IO | SCSI_MASK_MSG, SCSI_MASK_DATA | SCSI_MASK_CD | SCSI_MASK_IO | SCSI_MASK_MSG );// no errors for the time being !
306         scsi_out_req_delay( 1 );
307         break;
308   }
309}
310
311void scsihle_device::scsi_in( UINT32 data, UINT32 mask )
312{
313   // Reset aborts and returns to bus free
314   if( ( mask & SCSI_MASK_RST ) != 0 && ( data & SCSI_MASK_RST ) != 0 )
315   {
316      scsi_change_phase(SCSI_PHASE_BUS_FREE);
317      cmd_idx=0;
318      data_idx=0;
319      is_linked=0;
320
321      return;
322   }
323
324   switch (m_phase)
325   {
326      case SCSI_PHASE_BUS_FREE:
327         // Note this assumes we only have one initiator and therefore
328         // only one line active.
329         if( ( mask & SCSI_MASK_SEL ) != 0 && scsibus_driveno(data & SCSI_MASK_DATA) == scsiID)
330         {
331            void *hdfile = NULL;
332            // Check to see if device had image file mounted, if not, do not set busy,
333            // and stay busfree.
334            GetDevice(&hdfile);
335            if(hdfile!=(void *)NULL)
336            {
337               if( ( data & SCSI_MASK_SEL ) == 0 )
338               {
339                  scsi_change_phase(SCSI_PHASE_COMMAND);
340               }
341               else
342               {
343                  sel_timer->adjust(attotime::from_nsec(BSY_DELAY_NS),1);
344               }
345            }
346         }
347         break;
348
349      case SCSI_PHASE_COMMAND:
350         if( ( mask & SCSI_MASK_ACK ) != 0 )
351         {
352            if( ( data & SCSI_MASK_ACK ) == 0 )
353            {
354               command[ cmd_idx++ ] = data & SCSI_MASK_DATA;
355
356               // If the command is ready go and execute it
357               if(cmd_idx==get_scsi_cmd_len(command[0]))
358               {
359                  scsibus_exec_command();
360               }
361               else
362               {
363                  scsi_out_req_delay( 1 );
364               }
365            }
366            else
367            {
368               scsi_out_req_delay( 0 );
369            }
370         }
371         break;
372
373      case SCSI_PHASE_DATAIN:
374         if( ( mask & SCSI_MASK_ACK ) != 0 )
375         {
376            if( ( data & SCSI_MASK_ACK ) == 0 )
377            {
378               // check to see if we have reached the end of the block buffer
379               // and that there is more data to read from the scsi disk
380               if(data_idx == m_sector_bytes && bytes_left > 0)
381               {
382                  scsibus_read_data();
383                  scsi_out_req_delay( 1 );
384               }
385               else if(data_idx == data_last && bytes_left == 0)
386               {
387                  scsi_change_phase(SCSI_PHASE_STATUS);
388               }
389               else
390               {
391                  scsi_out( buffer[ data_idx++ ], SCSI_MASK_DATA );
392                  scsi_out_req_delay( 1 );
393               }
394            }
395            else
396            {
397               scsi_out_req_delay( 0 );
398            }
399         }
400         break;
401
402      case SCSI_PHASE_DATAOUT:
403         if( ( mask & SCSI_MASK_ACK ) != 0 )
404         {
405            if( ( data & SCSI_MASK_ACK ) == 0 )
406            {
407               //LOG(1,"SCSIBUS:bytes_left=%02X data_idx=%02X\n",bytes_left,data_idx);
408               buffer[data_idx++]=data & SCSI_MASK_DATA;
409
410               if(IS_COMMAND(SCSI_CMD_FORMAT_UNIT))
411               {
412                  // If we have the first byte, then cancel the dataout timout
413                  if(data_idx==1)
414                     dataout_timer->adjust(attotime::never);
415
416                  // When we have the first 3 bytes, calculate how many more are in the
417                  // bad block list.
418                  if(data_idx==3)
419                  {
420                     bytes_left+=((buffer[2]<<8)+buffer[3]);
421                     LOG(1,"format_unit reading an extra %d bytes\n",bytes_left-4);
422                     dump_data_bytes(4);
423                  }
424               }
425
426               // If the data buffer is full flush it to the SCSI disk
427
428               data_last = (bytes_left >= m_sector_bytes) ? m_sector_bytes : bytes_left;
429
430               if(data_idx == data_last)
431                  scsibus_write_data();
432
433               if(data_idx == 0 && bytes_left == 0)
434               {
435                  scsi_change_phase(SCSI_PHASE_STATUS);
436               }
437               else
438               {
439                  scsi_out_req_delay( 1 );
440               }
441            }
442            else
443            {
444               scsi_out_req_delay( 0 );
445            }
446         }
447         break;
448
449      case SCSI_PHASE_STATUS:
450         if( ( mask & SCSI_MASK_ACK ) != 0 )
451         {
452            if( ( data & SCSI_MASK_ACK ) == 0 )
453            {
454               if(cmd_idx > 0)
455               {
456                  scsi_change_phase(SCSI_PHASE_MESSAGE_IN);
457               }
458               else
459               {
460                  scsi_out_req_delay( 1 );
461               }
462            }
463            else
464            {
465               cmd_idx++;
466               scsi_out_req_delay( 0 );
467            }
468         }
469         break;
470
471      case SCSI_PHASE_MESSAGE_IN:
472         if( ( mask & SCSI_MASK_ACK ) != 0 )
473         {
474            if( ( data & SCSI_MASK_ACK ) == 0 )
475            {
476               if(cmd_idx > 0)
477               {
478                  if(is_linked)
479                     scsi_change_phase(SCSI_PHASE_COMMAND);
480                  else
481                     scsi_change_phase(SCSI_PHASE_BUS_FREE);
482               }
483               else
484               {
485                  scsi_out_req_delay( 1 );
486               }
487            }
488            else
489            {
490               cmd_idx++;
491               scsi_out_req_delay( 0 );
492            }
493         }
494         break;
495   }
496}
497
498// get the length of a SCSI command based on it's command byte type
499int scsihle_device::get_scsi_cmd_len(int cbyte)
500{
501   int group;
502
503   group = (cbyte>>5) & 7;
504
505   if (group == 0 || group == 3 || group == 6 || group == 7) return 6;
506   if (group == 1 || group == 2) return 10;
507   if (group == 5) return 12;
508
509   fatalerror("scsihle: Unknown SCSI command group %d, command byte=%02X\n", group,cbyte);
510
511   return 6;
512}
trunk/src/emu/machine/scsihle.h
r29632r29633
1// license:MAME
2// copyright-holders:smf
3/*
4
5scsihle.h
6
7Base class for HLE'd SCSI devices.
8
9*/
10
11#ifndef _SCSIHLE_H_
12#define _SCSIHLE_H_
13
14#include "machine/scsibus.h"
15#include "machine/scsidev.h"
16#include "machine/t10spc.h"
17
18class scsihle_device : public scsidev_device,
19   public virtual t10spc
20{
21public:
22   // construction/destruction
23   scsihle_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
24
25   virtual int GetDeviceID();
26
27   virtual void scsi_in( UINT32 data, UINT32 mask );
28
29   // configuration helpers
30   static void static_set_deviceid(device_t &device, int _scsiID);
31
32protected:
33   // device-level overrides
34   virtual void device_start();
35   virtual void device_reset();
36   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
37
38private:
39   void scsi_out_req_delay(UINT8 state);
40   void scsi_change_phase(UINT8 newphase);
41   int get_scsi_cmd_len(int cbyte);
42   UINT8 scsibus_driveno(UINT8  drivesel);
43   void scsibus_read_data();
44   void scsibus_write_data();
45   void scsibus_exec_command();
46   void dump_command_bytes();
47   void dump_data_bytes(int count);
48   void dump_bytes(UINT8 *buff, int count);
49
50   emu_timer *req_timer;
51   emu_timer *sel_timer;
52   emu_timer *dataout_timer;
53
54   UINT8 cmd_idx;
55   UINT8 is_linked;
56
57   UINT8 buffer[ 1024 ];
58   UINT16 data_idx;
59   int bytes_left;
60   int data_last;
61
62   int scsiID;
63};
64
65//
66// Status / Sense data taken from Adaptec ACB40x0 documentation.
67//
68
69// SCSI IDs
70enum
71{
72   SCSI_ID_0 = 0,
73   SCSI_ID_1,
74   SCSI_ID_2,
75   SCSI_ID_3,
76   SCSI_ID_4,
77   SCSI_ID_5,
78   SCSI_ID_6,
79   SCSI_ID_7
80};
81
82#define MCFG_SCSIDEV_ADD(_tag, _type, _id) \
83   MCFG_DEVICE_ADD(_tag, _type, 0) \
84   scsihle_device::static_set_deviceid(*device, _id);
85
86#endif
trunk/src/emu/machine/53c810.c
r29632r29633
22
33#include "emu.h"
44#include "53c810.h"
5#include "machine/scsihle.h"
5#include "bus/scsi/scsihle.h"
66
77#define DMA_MAX_ICOUNT  512     /* Maximum number of DMA Scripts opcodes to run */
88#define DASM_OPCODES 0
r29632r29633
104104   }
105105   else
106106   {
107      select((dcmd>>16)&7);
108
107109      /* initiator mode */
108110      logerror("53c810: SELECT: our ID %d, target ID %d\n", scid&7, (dcmd>>16)&7);
109111
r29632r29633
616618}
617619
618620lsi53c810_device::lsi53c810_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
619   : device_t(mconfig, LSI53C810, "53C810 SCSI", tag, owner, clock, "lsi53c810", __FILE__)
621   : legacy_scsi_host_adapter(mconfig, LSI53C810, "53C810 SCSI", tag, owner, clock, "lsi53c810", __FILE__)
620622{
621623}
622624
623625void lsi53c810_device::device_start()
624626{
627   legacy_scsi_host_adapter::device_start();
628
625629   m_irq_cb.bind_relative_to(*owner());
626630   m_dma_cb.bind_relative_to(*owner());
627631   m_fetch_cb.bind_relative_to(*owner());
r29632r29633
647651   add_opcode(0xc0, 0xfe, opcode_handler_delegate(FUNC( lsi53c810_device::dmaop_move_memory ), this));
648652   add_opcode(0xe0, 0xed, opcode_handler_delegate(FUNC( lsi53c810_device::dmaop_store ), this));
649653   add_opcode(0xe1, 0xed, opcode_handler_delegate(FUNC( lsi53c810_device::dmaop_load ), this));
650
651   memset(devices, 0, sizeof(devices));
652
653   // try to open the devices
654   for (device_t *device = owner()->first_subdevice(); device != NULL; device = device->next())
655   {
656      scsihle_device *scsidev = dynamic_cast<scsihle_device *>(device);
657      if (scsidev != NULL)
658      {
659         devices[scsidev->GetDeviceID()] = scsidev;
660      }
661   }
662654}
663655
664void lsi53c810_device::lsi53c810_read_data(int bytes, UINT8 *pData)
665{
666   if (devices[last_id])
667   {
668      devices[last_id]->ReadData( pData, bytes);
669   }
670   else
671   {
672      logerror("lsi53c810: read unknown device SCSI ID %d\n", last_id);
673   }
674}
675
676void lsi53c810_device::lsi53c810_write_data(int bytes, UINT8 *pData)
677{
678   if (devices[last_id])
679   {
680      devices[last_id]->WriteData( pData, bytes );
681   }
682   else
683   {
684      logerror("lsi53c810: write to unknown device SCSI ID %d\n", last_id);
685   }
686}
687
688656/*************************************
689657 *
690658 *  Disassembler
trunk/src/emu/machine/53c810.h
r29632r29633
11#ifndef LSI53C810_H
22#define LSI53C810_H
33
4#include "machine/scsihle.h"
4#include "legscsi.h"
55
66typedef device_delegate<void (int state)> lsi53c810_irq_delegate;
77#define LSI53C810_IRQ_CB(name)  void name(int state)
r29632r29633
1313#define LSI53C810_FETCH_CB(name)  UINT32 name(UINT32 dsp)
1414
1515
16class lsi53c810_device : public device_t
16class lsi53c810_device : public legacy_scsi_host_adapter
1717{
1818public:
1919   // construction/destruction
r29632r29633
6767   UINT32 lsi53c810_dasm_fetch(UINT32 pc);
6868   unsigned lsi53c810_dasm(char *buf, UINT32 pc);
6969
70   scsihle_device *devices[8]; /* SCSI IDs 0-7 */
7170   UINT8 last_id;
7271
7372   UINT8 scntl0;
trunk/src/emu/machine/legscsi.c
r0r29633
1#include "legscsi.h"
2
3legacy_scsi_host_adapter::legacy_scsi_host_adapter(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
4   device_t(mconfig, type, name, tag, owner, clock, shortname, source),
5   m_scsi_port(*this)
6{
7}
8
9void legacy_scsi_host_adapter::device_start()
10{
11}
12
13void legacy_scsi_host_adapter::reset_bus()
14{
15   for (int i = 0; i <= 7; i++)
16   {
17      scsihle_device *scsidev = get_device(i);
18      if (scsidev != NULL)
19      {
20         scsidev->reset();
21      }
22   }
23}
24
25bool legacy_scsi_host_adapter::select(int id)
26{
27   m_selected = id;
28
29   scsihle_device *scsidev = get_device(m_selected);
30   if (scsidev != NULL)
31   {
32      return true;
33   }
34
35   return false;
36}
37
38void legacy_scsi_host_adapter::send_command(UINT8 *data, int bytes)
39{
40   scsihle_device *scsidev = get_device(m_selected);
41   if (scsidev != NULL)
42   {
43      scsidev->SetCommand(data, bytes);
44      scsidev->ExecCommand();
45   }
46   else
47   {
48      logerror("%s: send_command unknown SCSI id %d\n", tag(), m_selected);
49   }
50}
51
52int legacy_scsi_host_adapter::get_length(void)
53{
54   scsihle_device *scsidev = get_device(m_selected);
55   if (scsidev != NULL)
56   {
57      int length;
58      scsidev->GetLength(&length);
59      return length;
60   }
61   else
62   {
63      logerror("%s: get_length unknown SCSI id %d\n", tag(), m_selected);
64      return 0;
65   }
66}
67
68int legacy_scsi_host_adapter::get_phase(void)
69{
70   scsihle_device *scsidev = get_device(m_selected);
71   if (scsidev != NULL)
72   {
73      int phase;
74      scsidev->GetPhase(&phase);
75      return phase;
76   }
77   else
78   {
79      logerror("%s: get_phase unknown SCSI id %d\n", tag(), m_selected);
80      return 0;
81   }
82}
83
84void legacy_scsi_host_adapter::read_data(UINT8 *data, int bytes)
85{
86   scsihle_device *scsidev = get_device(m_selected);
87   if (scsidev != NULL)
88   {
89      scsidev->ReadData(data, bytes);
90   }
91   else
92   {
93      logerror("%s: read_data unknown SCSI id %d\n", tag(), m_selected);
94   }
95}
96
97void legacy_scsi_host_adapter::write_data(UINT8 *data, int bytes)
98{
99   scsihle_device *scsidev = get_device(m_selected);
100   if (scsidev != NULL)
101   {
102      scsidev->WriteData(data, bytes);
103   }
104   else
105   {
106      logerror("%s: write_data unknown SCSI id %d\n", tag(), m_selected);
107   }
108}
109
110UINT8 legacy_scsi_host_adapter::get_status()
111{
112   scsihle_device *scsidev = get_device(m_selected);
113   if (scsidev != NULL)
114   {
115      void *image;
116
117      scsidev->GetDevice(&image);
118      if (image != NULL)
119         return 0x00;
120
121      return 0x02;
122   }
123   else
124   {
125      logerror("%s: get_status unknown SCSI id %d\n", tag(), m_selected);
126      return 0;
127   }
128}
129
130scsihle_device *legacy_scsi_host_adapter::get_device(int id)
131{
132   // steal scsi devices from bus
133   for (device_t *device = m_scsi_port->first_subdevice(); device != NULL; device = device->next())
134   {
135      SCSI_PORT_SLOT_device *slot = dynamic_cast<SCSI_PORT_SLOT_device *>(device);
136      if (slot != NULL)
137      {
138         scsihle_device *scsidev = dynamic_cast<scsihle_device *>(slot->dev());
139         if (scsidev != NULL)
140         {
141            if (scsidev->GetDeviceID() == id)
142            {
143               return scsidev;
144            }
145         }
146      }
147   }
148
149   return NULL;
150}
Property changes on: trunk/src/emu/machine/legscsi.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/machine/legscsi.h
r0r29633
1#ifndef _LEGSCSI_H_
2#define _LEGSCSI_H_
3
4#pragma once
5
6#include "bus/scsi/scsihle.h"
7
8#define MCFG_LEGACY_SCSI_PORT(_tag) \
9   legacy_scsi_host_adapter::set_scsi_port(*device, "^" _tag);
10
11class legacy_scsi_host_adapter : public device_t
12{
13public:
14   legacy_scsi_host_adapter(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
15
16   static void set_scsi_port(device_t &device, const char *tag) { downcast<legacy_scsi_host_adapter &>(device).m_scsi_port.set_tag(tag); }
17
18protected:
19   virtual void device_start();
20
21   void reset_bus();
22   bool select(int id);
23   void send_command(UINT8 *data, int bytes);
24   int get_length();
25   int get_phase();
26   void read_data(UINT8 *data, int bytes);
27   void write_data(UINT8 *data, int bytes);
28   UINT8 get_status();
29
30private:
31   int m_selected;
32   scsihle_device *get_device(int id);
33
34   required_device<SCSI_PORT_DEVICE> m_scsi_port;
35};
36
37#endif
Property changes on: trunk/src/emu/machine/legscsi.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/machine/ncr5380.c
r29632r29633
7575//  ncr5380_device - constructor/destructor
7676//-------------------------------------------------
7777
78ncr5380_device::ncr5380_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
79   : device_t(mconfig, NCR5380, "5380 SCSI", tag, owner, clock, "ncr5380", __FILE__),
78ncr5380_device::ncr5380_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
79   legacy_scsi_host_adapter(mconfig, NCR5380, "5380 SCSI", tag, owner, clock, "ncr5380", __FILE__),
8080   m_irq_cb(*this)
8181{
8282}
r29632r29633
8787
8888void ncr5380_device::device_start()
8989{
90   legacy_scsi_host_adapter::device_start();
91
9092   memset(m_5380_Registers, 0, sizeof(m_5380_Registers));
9193   memset(m_5380_Data, 0, sizeof(m_5380_Data));
92   memset(m_scsi_devices, 0, sizeof(m_scsi_devices));
9394
9495   m_next_req_flag = 0;
9596   m_irq_cb.resolve_safe();
r29632r29633
102103   save_item(NAME(m_d_ptr));
103104   save_item(NAME(m_d_limit));
104105   save_item(NAME(m_next_req_flag));
105
106   // try to open the devices
107   for( device_t *device = owner()->first_subdevice(); device != NULL; device = device->next() )
108   {
109      scsihle_device *scsidev = dynamic_cast<scsihle_device *>(device);
110      if( scsidev != NULL )
111      {
112         m_scsi_devices[scsidev->GetDeviceID()] = scsidev;
113      }
114   }
115106}
116107
117108//-------------------------------------------------
r29632r29633
184175                  // don't issue a "false" read
185176                  if (m_d_limit > 0)
186177                  {
187                     ncr5380_read_data((m_d_limit < 512) ? m_d_limit : 512, m_5380_Data);
178                     read_data(m_5380_Data, (m_d_limit < 512) ? m_d_limit : 512);
188179                  }
189180                  else
190181                  {
r29632r29633
282273            // if we've hit a sector, flush
283274            if (m_d_ptr == 511)
284275            {
285               ncr5380_write_data(512, &m_5380_Data[0]);
276               write_data(&m_5380_Data[0], 512);
286277
287278               m_d_limit -= 512;
288279               m_d_ptr = 0;
r29632r29633
318309                  if (VERBOSE)
319310                     logerror("%s NCR5380: Command (to ID %d): %x %x %x %x %x %x %x %x %x %x\n", machine().describe_context(), m_last_id, m_5380_Command[0], m_5380_Command[1], m_5380_Command[2], m_5380_Command[3], m_5380_Command[4], m_5380_Command[5], m_5380_Command[6], m_5380_Command[7], m_5380_Command[8], m_5380_Command[9]);
320311
321                  m_scsi_devices[m_last_id]->SetCommand(&m_5380_Command[0], 16);
322                  m_scsi_devices[m_last_id]->ExecCommand();
323                  m_scsi_devices[m_last_id]->GetLength(&m_d_limit);
312                  send_command(&m_5380_Command[0], 16);
313                  m_d_limit = get_length();
324314
325315                  if (VERBOSE)
326316                     logerror("NCR5380: Command returned %d bytes\n",  m_d_limit);
r29632r29633
337327                     }
338328
339329                     // read back the amount available, or 512 bytes, whichever is smaller
340                     ncr5380_read_data((m_d_limit < 512) ? m_d_limit : 512, m_5380_Data);
330                     read_data(m_5380_Data, (m_d_limit < 512) ? m_d_limit : 512);
341331
342332                     // raise REQ to indicate data is available
343333                     m_5380_Registers[R5380_BUSSTATUS] |= 0x20;
r29632r29633
352342            // if the device exists, make the bus busy.
353343            // otherwise don't.
354344
355            if (m_scsi_devices[m_last_id])
345            if (select(m_last_id))
356346            {
357347               if (VERBOSE)
358348                  logerror("NCR5380: Giving the bus for ID %d\n", m_last_id);
r29632r29633
429419      m_5380_Registers[R5380_BUSANDSTAT] = 0x48;
430420   }
431421}
432
433
434void ncr5380_device::ncr5380_read_data(int bytes, UINT8 *pData)
435{
436   if (m_scsi_devices[m_last_id])
437   {
438      if (VERBOSE)
439         logerror("NCR5380: issuing read for %d bytes\n", bytes);
440      m_scsi_devices[m_last_id]->ReadData(pData, bytes);
441   }
442   else
443   {
444      logerror("ncr5380: read unknown device SCSI ID %d\n", m_last_id);
445   }
446}
447
448
449void ncr5380_device::ncr5380_write_data(int bytes, UINT8 *pData)
450{
451   if (m_scsi_devices[m_last_id])
452   {
453      m_scsi_devices[m_last_id]->WriteData(pData, bytes);
454   }
455   else
456   {
457      logerror("ncr5380: write to unknown device SCSI ID %d\n", m_last_id);
458   }
459}
trunk/src/emu/machine/ncr5380.h
r29632r29633
66#ifndef _NCR5380_H_
77#define _NCR5380_H_
88
9#include "machine/scsihle.h"
9#include "legscsi.h"
1010
1111// 5380 registers
1212enum
r29632r29633
3535#define MCFG_NCR5380_IRQ_CB(_devcb) \
3636   devcb = &ncr5380_device::set_irq_callback(*device, DEVCB2_##_devcb);
3737
38class ncr5380_device : public device_t
38class ncr5380_device : public legacy_scsi_host_adapter
3939{
4040public:
4141   // construction/destruction
r29632r29633
4747   UINT8 ncr5380_read_reg(UINT32 offset);
4848   void ncr5380_write_reg(UINT32 offset, UINT8 data);
4949
50   void ncr5380_read_data(int bytes, UINT8 *pData);
51   void ncr5380_write_data(int bytes, UINT8 *pData);
52
5350protected:
5451   // device-level overrides
5552   virtual void device_start();
r29632r29633
5754   virtual void device_stop();
5855
5956private:
60   scsihle_device *m_scsi_devices[8];
61
6257   UINT8 m_5380_Registers[8];
6358   UINT8 m_last_id;
6459   UINT8 m_5380_Command[32];
trunk/src/emu/machine/atapihle.h
r29632r29633
1717#define __ATAPIHLE_H__
1818
1919#include "atahle.h"
20#include "scsihle.h"
20#include "t10spc.h"
2121
2222class atapi_hle_device : public ata_hle_device,
2323   public virtual t10spc
trunk/src/emu/machine/mb89352.c
r29632r29633
113113 * Device
114114 */
115115
116mb89352_device::mb89352_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
117   : device_t(mconfig, MB89352A, "MB89352A", tag, owner, clock, "mb89352", __FILE__),
118      m_irq_cb(*this),
119      m_drq_cb(*this)
116mb89352_device::mb89352_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
117   legacy_scsi_host_adapter(mconfig, MB89352A, "MB89352A", tag, owner, clock, "mb89352", __FILE__),
118   m_irq_cb(*this),
119   m_drq_cb(*this)
120120{
121121}
122122
123123void mb89352_device::device_start()
124124{
125   legacy_scsi_host_adapter::device_start();
126
125127   m_phase = SCSI_PHASE_BUS_FREE;
126128   m_target = 0;
127129   m_command_index = 0;
r29632r29633
136138   m_irq_cb.resolve_safe();
137139   m_drq_cb.resolve_safe();
138140
139   memset(m_SCSIdevices,0,sizeof(m_SCSIdevices));
140
141141   // allocate read timer
142142   m_transfer_timer = timer_alloc(TIMER_TRANSFER);
143
144   // try to open the devices
145   for( device_t *device = owner()->first_subdevice(); device != NULL; device = device->next() )
146   {
147      scsihle_device *scsidev = dynamic_cast<scsihle_device *>(device);
148      if( scsidev != NULL )
149      {
150         m_SCSIdevices[scsidev->GetDeviceID()] = scsidev;
151      }
152   }
153143}
154144
155145void mb89352_device::device_reset()
r29632r29633
304294         m_transfer_index++;
305295         m_transfer_count--;
306296         if(m_transfer_index % 512 == 0)
307            m_SCSIdevices[m_target]->ReadData(m_buffer,512);
297            read_data(m_buffer, 512);
308298         if(m_transfer_count == 0)
309299         {
310300            // End of transfer
r29632r29633
437427         {
438428            //m_ints |= INTS_SELECTION;
439429         }
430         select(m_target);
440431         set_phase(SCSI_PHASE_COMMAND); // straight to command phase, may need a delay between selection and command phases
441432         m_line_status |= MB89352_LINE_SEL;
442433         m_line_status |= MB89352_LINE_BSY;
r29632r29633
462453         if(m_phase == SCSI_PHASE_DATAIN)  // if we are reading data...
463454         {
464455            m_spc_status &= ~SSTS_DREG_EMPTY;  // DREG is no longer empty
465            m_SCSIdevices[m_target]->ReadData(m_buffer,512);
456            read_data(m_buffer, 512);
466457         }
467458         if(m_phase == SCSI_PHASE_MESSAGE_IN)
468459         {
r29632r29633
504495               int x;
505496               int phase;
506497               // execute SCSI command
507               m_SCSIdevices[m_target]->SetCommand(m_command,m_command_index);
508               m_SCSIdevices[m_target]->ExecCommand();
509               m_SCSIdevices[m_target]->GetLength(&m_result_length);
510               m_SCSIdevices[m_target]->GetPhase(&phase);
498               send_command(m_command, m_command_index);
499               phase = get_phase();
511500               if(m_command[0] == 1) // Rezero Unit - not implemented in SCSI code
512501                  set_phase(SCSI_PHASE_STATUS);
513502               else
r29632r29633
521510         }
522511         if(m_phase == SCSI_PHASE_STATUS)
523512         {
524            void *image;
525            m_SCSIdevices[m_target]->GetDevice(&image);
526            if (image != NULL)
527               m_temp = 0x00;
528            else
529               m_temp = 0x02;
513            m_temp = get_status();
530514            set_phase(SCSI_PHASE_MESSAGE_IN);
531515            return;
532516         }
r29632r29633
570554            int x;
571555            int phase;
572556            // execute SCSI command
573            m_SCSIdevices[m_target]->SetCommand(m_command,m_command_index);
574            m_SCSIdevices[m_target]->ExecCommand();
575            m_SCSIdevices[m_target]->GetLength(&m_result_length);
576            m_SCSIdevices[m_target]->GetPhase(&phase);
557            send_command(m_command, m_command_index);
558            phase = get_phase();
577559            if(m_command[0] == 1) // Rezero Unit - not implemented in SCSI code
578560               set_phase(SCSI_PHASE_STATUS);
579561            else
r29632r29633
592574         m_transfer_index++;
593575         m_transfer_count--;
594576         if(m_transfer_index % 512 == 0)
595            m_SCSIdevices[m_target]->WriteData(m_buffer,512);
577            write_data(m_buffer, 512);
596578         if(m_transfer_count == 0)
597579         {
598580            // End of transfer
trunk/src/emu/machine/mb89352.h
r29632r29633
77#ifndef MB89352_H_
88#define MB89352_H_
99
10#include "machine/scsihle.h"
10#include "legscsi.h"
1111
1212// SCSI lines readable via PSNS register (reg 5)
1313#define MB89352_LINE_REQ 0x80
r29632r29633
5454#define MCFG_MB89352A_DRQ_CB(_devcb) \
5555   devcb = &mb89352_device::set_drq_callback(*device, DEVCB2_##_devcb);
5656
57class mb89352_device : public device_t
57class mb89352_device : public legacy_scsi_host_adapter
5858{
5959public:
6060   // construction/destruction
r29632r29633
8787   devcb2_write_line m_irq_cb;  /* irq callback */
8888   devcb2_write_line m_drq_cb;  /* drq callback */
8989
90   scsihle_device* m_SCSIdevices[8];
91
9290   UINT8 m_phase;  // current SCSI phase
9391   UINT8 m_target; // current SCSI target
9492   UINT8 m_bdid;  // Bus device ID (SCSI ID of the bus?)
r29632r29633
109107   UINT8 m_command_index;
110108   UINT8 m_command[16];
111109   UINT32 m_transfer_index;
112   int m_result_length;
113110   UINT8 m_buffer[512];
114111
115112   emu_timer* m_transfer_timer;
trunk/src/emu/machine/am53cf96.c
r29632r29633
1111
1212#include "emu.h"
1313#include "am53cf96.h"
14#include "machine/scsihle.h"
14#include "bus/scsi/scsihle.h"
1515
1616READ8_MEMBER( am53cf96_device::read )
1717{
r29632r29633
9090            scsi_regs[REG_IRQSTATE] = 8;    // indicate success
9191            xfer_state = 0;
9292            break;
93         case 2: // reset device
93         case 2: // reset am53cf96
9494            scsi_regs[REG_IRQSTATE] = 8;    // indicate success
9595
9696            logerror("53cf96: reset  target ID = %d (PC = %x)\n", last_id, space.device().safe_pc());
97            if (last_id <= 7 && devices[last_id])
98            {
99               devices[last_id]->reset();
100            }
101            else
102            {
103               logerror("53cf96: reset request for unknown device SCSI ID %d\n", last_id);
104            }
10597
10698            xfer_state = 0;
10799            break;
108100         case 3: // reset SCSI bus
109101            scsi_regs[REG_INTSTATE] = 4;    // command sent OK
102
103            reset_bus();
104
110105            xfer_state = 0;
111106            m_transfer_timer->adjust( attotime::from_hz( 16384 ) );
112107            break;
r29632r29633
122117            }
123118
124119            logerror("53cf96: command %x exec.  target ID = %d (PC = %x)\n", fifo[1], last_id, space.device().safe_pc());
125            if (last_id <= 7 && devices[last_id])
126            {
127               int length;
128120
129               devices[last_id]->SetCommand( &fifo[1], 12 );
130               devices[last_id]->ExecCommand();
131               devices[last_id]->GetLength(&length);
132            }
133            else
134            {
135               logerror("53cf96: request for unknown device SCSI ID %d\n", last_id);
136            }
121            select(last_id);
122            send_command(&fifo[1], 12);
137123            xfer_state = 0;
138124            break;
139125         case 0x44:  // enable selection/reselection
r29632r29633
159145}
160146
161147am53cf96_device::am53cf96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
162   device_t(mconfig, AM53CF96, "53CF96 SCSI", tag, owner, clock, "am53cf96", __FILE__),
148   legacy_scsi_host_adapter(mconfig, AM53CF96, "53CF96 SCSI", tag, owner, clock, "am53cf96", __FILE__),
163149   m_irq_handler(*this)
164150{
165151}
166152
167153void am53cf96_device::device_start()
168154{
155   legacy_scsi_host_adapter::device_start();
156
169157   m_irq_handler.resolve_safe();
170158
171159   memset(scsi_regs, 0, sizeof(scsi_regs));
172   memset(devices, 0, sizeof(devices));
173160
174   // try to open the devices
175   for( device_t *device = owner()->first_subdevice(); device != NULL; device = device->next() )
176   {
177      scsihle_device *scsidev = dynamic_cast<scsihle_device *>(device);
178      if( scsidev != NULL )
179      {
180         devices[scsidev->GetDeviceID()] = scsidev;
181      }
182   }
183
184161   fptr = 0;
185162   xfer_state = 0;
186163   last_id = -1;
r29632r29633
199176{
200177   scsi_regs[REG_STATUS] |= 0x10;  // indicate DMA finished
201178
202   if (last_id <= 7 && devices[last_id])
203   {
204      devices[last_id]->ReadData( pData, bytes );
205   }
206   else
207   {
208      logerror("53cf96: request for unknown device SCSI ID %d\n", last_id);
209   }
179   read_data(pData, bytes);
210180}
211181
212182// write data to the SCSI controller
r29632r29633
216186
217187   scsi_regs[REG_STATUS] |= 0x10;  // indicate DMA finished
218188
219   if (last_id <= 7 && devices[last_id])
220   {
221      devices[last_id]->WriteData( pData, bytes );
222   }
223   else
224   {
225      logerror("53cf96: request for unknown device SCSI ID %d\n", last_id);
226   }
189   write_data(pData, bytes);
227190}
228191
229192const device_type AM53CF96 = &device_creator<am53cf96_device>;
trunk/src/emu/machine/am53cf96.h
r29632r29633
66#ifndef _AM53CF96_H_
77#define _AM53CF96_H_
88
9#include "machine/scsihle.h"
9#pragma once
1010
11#define MCFG_AM53CF96_ADD( _tag ) \
12   MCFG_DEVICE_ADD( _tag, AM53CF96, 0 )
11#include "legscsi.h"
1312
1413#define MCFG_AM53CF96_IRQ_HANDLER(_devcb) \
1514   devcb = &am53cf96_device::set_irq_handler(*device, DEVCB2_##_devcb);
15
1616// 53CF96 register set
1717enum
1818{
r29632r29633
3535   REG_DATAALIGN       // data alignment (write only)
3636};
3737
38class am53cf96_device : public device_t
38class am53cf96_device : public legacy_scsi_host_adapter
3939{
4040public:
4141   // construction/destruction
r29632r29633
5858private:
5959   static const device_timer_id TIMER_TRANSFER = 0;
6060
61   scsihle_device *devices[8];
62
6361   UINT8 scsi_regs[32];
6462   UINT8 fifo[16];
6563   UINT8 fptr;
trunk/src/emu/machine/wd33c93.c
r29632r29633
162162   return count;
163163}
164164
165void wd33c93_device::read_data(int bytes, UINT8 *pData)
166{
167   UINT8 unit = getunit();
168
169   if ( devices[unit] )
170   {
171      devices[unit]->ReadData( pData, bytes );
172   }
173   else
174   {
175      logerror("wd33c93: request for unknown device SCSI ID %d\n", unit);
176   }
177}
178
179165void wd33c93_device::complete_immediate( int status )
180166{
181167   /* reset our timer */
r29632r29633
285271   UINT8 newstatus;
286272
287273   /* see if we can select that device */
288   if ( devices[unit] )
274   if (select(unit))
289275   {
290276      /* device is available - signal selection done */
291277      newstatus = CSR_SELECT;
r29632r29633
321307   UINT8 newstatus;
322308
323309   /* see if we can select that device */
324   if ( devices[unit] )
310   if (select(unit))
325311   {
326312      if ( regs[WD_COMMAND_PHASE] < 0x45 )
327313      {
328314         /* device is available */
329         int xfercount;
330315         int phase;
331316
332317         /* do the request */
333         devices[unit]->SetCommand( &regs[WD_CDB_1], 12 );
334         devices[unit]->ExecCommand();
335         devices[unit]->GetLength( &xfercount );
336         devices[unit]->GetPhase( &phase );
318         send_command(&regs[WD_CDB_1], 12);
319         phase = get_phase();
337320
338321         /* set transfer count */
339322         if ( get_xfer_count() > TEMP_INPUT_LEN )
r29632r29633
357340         if ( get_xfer_count() < len ) len = get_xfer_count();
358341
359342         memset( &temp_input[0], 0, TEMP_INPUT_LEN );
360         read_data( len, &temp_input[0] );
343         read_data(&temp_input[0], len);
361344         temp_input_pos = 0;
362345         read_pending = 0;
363346      }
r29632r29633
549532
550533                     case PHS_COMMAND:
551534                     {
552                        UINT8 unit = getunit();
553535                        int xfercount;
554536                        int phase;
555537
556538                        /* Execute the command. Depending on the command, we'll move to data in or out */
557                        devices[unit]->SetCommand( &fifo[0], 12 );
558                        devices[unit]->ExecCommand();
559                        devices[unit]->GetLength( &xfercount );
560                        devices[unit]->GetPhase( &phase );
539                        send_command(&fifo[0], 12);
540                        xfercount = get_length();
541                        phase = get_phase();
561542
562543                        /* reset fifo */
563544                        fifo_pos = 0;
r29632r29633
586567                     case PHS_DATA_OUT:
587568                     {
588569                        /* write data out to device */
589                        write_data( fifo_pos, fifo );
570                        write_data(fifo, fifo_pos);
590571
591572                        /* reset fifo */
592573                        fifo_pos = 0;
r29632r29633
683664                  int len = TEMP_INPUT_LEN;
684665
685666                  if ( (count+1) < len ) len = count+1;
686                  read_data( len, &temp_input[0] );
667                  read_data(&temp_input[0], len);
687668                  temp_input_pos = 0;
688669                  read_pending = 0;
689670               }
r29632r29633
741722   return 0;
742723}
743724
744wd33c93_device::wd33c93_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
745   : device_t(mconfig, WD33C93, "33C93 SCSI", tag, owner, clock, "wd33c93", __FILE__),
746      m_irq_cb(*this)
725wd33c93_device::wd33c93_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
726   legacy_scsi_host_adapter(mconfig, WD33C93, "33C93 SCSI", tag, owner, clock, "wd33c93", __FILE__),
727   m_irq_cb(*this)
747728{
748729}
749730
750731void wd33c93_device::device_start()
751732{
733   legacy_scsi_host_adapter::device_start();
734
752735   memset(regs, 0, sizeof(regs));
753   memset(devices, 0, sizeof(devices));
754736   memset(fifo, 0, sizeof(fifo));
755737   memset(temp_input, 0, sizeof(temp_input));
756738
r29632r29633
761743   identify = 0;
762744   read_pending = 0;
763745
764   // try to open the devices
765   for( device_t *device = owner()->first_subdevice(); device != NULL; device = device->next() )
766   {
767      scsihle_device *scsidev = dynamic_cast<scsihle_device *>(device);
768      if( scsidev != NULL )
769      {
770         devices[scsidev->GetDeviceID()] = scsidev;
771      }
772   }
773746   m_irq_cb.resolve();
774747
775748   /* allocate a timer for commands */
r29632r29633
788761   save_item( NAME( read_pending ) );
789762}
790763
791void wd33c93_device::get_dma_data( int bytes, UINT8 *pData )
764void wd33c93_device::dma_read_data( int bytes, UINT8 *pData )
792765{
793766   int len = bytes;
794767
r29632r29633
813786   set_xfer_count(len);
814787}
815788
816void wd33c93_device::write_data(int bytes, UINT8 *pData)
789void wd33c93_device::dma_write_data(int bytes, UINT8 *pData)
817790{
818   UINT8 unit = getunit();
819
820   if (devices[unit])
821   {
822      devices[unit]->WriteData( pData, bytes );
823   }
824   else
825   {
826      logerror("wd33c93: request for unknown device SCSI ID %d\n", unit);
827   }
791   write_data(pData, bytes);
828792}
829793
830794void wd33c93_device::clear_dma()
trunk/src/emu/machine/wd33c93.h
r29632r29633
66#ifndef _WD33C93_H_
77#define _WD33C93_H_
88
9#include "machine/scsihle.h"
9#include "legscsi.h"
1010
1111/* wd register names */
1212
r29632r29633
4848#define MCFG_WD33C93_IRQ_CB(_devcb) \
4949   devcb = &wd33c93_device::set_irq_callback(*device, DEVCB2_##_devcb);
5050
51class wd33c93_device : public device_t
51class wd33c93_device : public legacy_scsi_host_adapter
5252{
5353public:
5454   // construction/destruction
r29632r29633
5959   DECLARE_READ8_MEMBER(read);
6060   DECLARE_WRITE8_MEMBER(write);
6161
62   void get_dma_data( int bytes, UINT8 *pData );
63   void write_data(int bytes, UINT8 *pData);
62   void dma_read_data( int bytes, UINT8 *pData );
63   void dma_write_data(int bytes, UINT8 *pData);
6464   void clear_dma();
6565   int get_dma_count();
6666
r29632r29633
7373   UINT8 getunit( void );
7474   void set_xfer_count( int count );
7575   int get_xfer_count( void );
76   void read_data(int bytes, UINT8 *pData);
7776   void complete_immediate( int status );
7877   void complete_cmd( UINT8 status );
7978   void unimplemented_cmd();
r29632r29633
8786   void xferinfo_cmd();
8887   void dispatch_command();
8988
90   scsihle_device *devices[8]; // SCSI IDs 0-7
91
9289   UINT8       sasr;
9390   UINT8       regs[WD_AUXILIARY_STATUS+1];
9491   UINT8       fifo[FIFO_SIZE];
trunk/src/emu/machine/machine.mak
r29632r29633
372372
373373#-------------------------------------------------
374374#
375#@src/emu/machine/cdu76s.h,MACHINES += CDU76S
376#-------------------------------------------------
377
378ifneq ($(filter CDU76S,$(MACHINES)),)
379MACHINEOBJS += $(MACHINEOBJ)/cdu76s.o
380endif
381
382#-------------------------------------------------
383#
384375#@src/emu/machine/com8116.h,MACHINES += COM8116
385376#-------------------------------------------------
386377
r29632r29633
13701361
13711362#-------------------------------------------------
13721363#
1373#@src/emu/machine/scsibus.h,MACHINES += SCSI
1374#@src/emu/machine/scsicb.h,MACHINES += SCSI
1375#@src/emu/machine/scsicd.h,MACHINES += SCSI
1376#@src/emu/machine/scsidev.h,MACHINES += SCSI
1377#@src/emu/machine/scsihd.h,MACHINES += SCSI
1378#@src/emu/machine/scsihle.h,MACHINES += SCSI
1379#-------------------------------------------------
1380
1381ifneq ($(filter SCSI,$(MACHINES)),)
1382MACHINEOBJS += $(MACHINEOBJ)/scsibus.o
1383MACHINEOBJS += $(MACHINEOBJ)/scsicb.o
1384MACHINEOBJS += $(MACHINEOBJ)/scsicd.o
1385MACHINEOBJS += $(MACHINEOBJ)/scsidev.o
1386MACHINEOBJS += $(MACHINEOBJ)/scsihd.o
1387MACHINEOBJS += $(MACHINEOBJ)/scsihle.o
1388MACHINES += T10
1389endif
1390
1391#-------------------------------------------------
1392#
13931364#@src/emu/machine/seibu_cop.h,MACHINES += SEIBU_COP
13941365#-------------------------------------------------
13951366
r29632r29633
14351406
14361407#-------------------------------------------------
14371408#
1409#
14381410#-------------------------------------------------
14391411
1412ifneq ($(filter SCSI,$(BUSES)),)
1413MACHINES += T10
1414endif
1415
14401416ifneq ($(filter T10,$(MACHINES)),)
14411417MACHINEOBJS += $(MACHINEOBJ)/t10mmc.o
14421418MACHINEOBJS += $(MACHINEOBJ)/t10sbc.o
14431419MACHINEOBJS += $(MACHINEOBJ)/t10spc.o
1444MACHINES += T10
14451420endif
14461421
14471422#-------------------------------------------------
trunk/src/emu/machine/ncr539x.c
r29632r29633
114114//  ncr539x_device - constructor/destructor
115115//-------------------------------------------------
116116
117ncr539x_device::ncr539x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
118   : device_t(mconfig, NCR539X, "539x SCSI", tag, owner, clock, "ncr539x", __FILE__),
117ncr539x_device::ncr539x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
118   legacy_scsi_host_adapter(mconfig, NCR539X, "539x SCSI", tag, owner, clock, "ncr539x", __FILE__),
119119   m_out_irq_cb(*this),
120120   m_out_drq_cb(*this)
121121{
r29632r29633
127127
128128void ncr539x_device::device_start()
129129{
130   memset(m_scsi_devices, 0, sizeof(m_scsi_devices));
130   legacy_scsi_host_adapter::device_start();
131131
132132   // resolve line callbacks
133133   m_out_irq_cb.resolve_safe();
134134   m_out_drq_cb.resolve_safe();
135135
136   // try to open the devices
137   for( device_t *device = owner()->first_subdevice(); device != NULL; device = device->next() )
138   {
139      scsihle_device *scsidev = dynamic_cast<scsihle_device *>(device);
140      if( scsidev != NULL )
141      {
142         m_scsi_devices[scsidev->GetDeviceID()] = scsidev;
143      }
144   }
145
146136   m_operation_timer = timer_alloc(0, NULL);
147137}
148138
r29632r29633
152142
153143void ncr539x_device::device_reset()
154144{
155   memset(m_scsi_devices, 0, sizeof(m_scsi_devices));
156
157145   m_fifo_ptr = 0;
158146   m_irq_status = 0;
159147   m_status = SCSI_PHASE_STATUS;
r29632r29633
174162
175163void ncr539x_device::dma_read_data(int bytes, UINT8 *pData)
176164{
177   if (m_scsi_devices[m_last_id])
178   {
179      if (VERBOSE)
180         logerror("NCR539x: issuing read for %d bytes\n", bytes);
181      m_scsi_devices[m_last_id]->ReadData(pData, bytes);
182   }
183   else
184   {
185      logerror("ncr539x: read unknown device SCSI ID %d\n", m_last_id);
186   }
165   read_data(pData, bytes);
187166}
188167
189168
190169void ncr539x_device::dma_write_data(int bytes, UINT8 *pData)
191170{
192   if (bytes)
193   {
194      if (m_scsi_devices[m_last_id])
195      {
196         m_scsi_devices[m_last_id]->WriteData(pData, bytes);
197      }
198      else
199      {
200         logerror("ncr539x: write to unknown device SCSI ID %d\n", m_last_id);
201      }
202   }
171   write_data(pData, bytes);
203172}
204173
205174void ncr539x_device::device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr)
r29632r29633
218187         switch (m_command & 0x7f)
219188         {
220189            case 0x41:  // select without ATN steps
221               if (m_scsi_devices[m_last_id])
190               if (select(m_last_id))
222191               {
223192                  m_irq_status |= IRQ_STATUS_SERVICE_REQUEST | IRQ_STATUS_SUCCESS;
224193                  // we should now be in the command phase
r29632r29633
250219               break;
251220
252221            case 0x42:  // Select with ATN steps
253               if (m_scsi_devices[m_last_id])
222               if (select(m_last_id))
254223               {
255224                  m_irq_status |= IRQ_STATUS_SERVICE_REQUEST | IRQ_STATUS_SUCCESS;
256225                  // we should now be in the command phase
r29632r29633
532501               m_irq_status = IRQ_STATUS_SUCCESS;
533502
534503               int phase;
535               m_scsi_devices[m_last_id]->GetPhase( &phase );
504               phase = get_phase();
536505
537506               #if VERBOSE
538507               printf("Information transfer: phase %d buffer remaining %x\n", phase, m_buffer_remaining);
r29632r29633
556525
557526                     if (amtToGet > 0)
558527                     {
559                        m_scsi_devices[m_last_id]->ReadData(m_buffer, amtToGet);
528                        read_data(m_buffer, amtToGet);
560529
561530                        m_total_data -= amtToGet;
562531                        m_buffer_offset = 0;
r29632r29633
647616               break;
648617
649618            case 0x47:  // Reselect with ATN3 steps
650               if (m_scsi_devices[m_last_id])
619               if (select(m_last_id))
651620               {
652621                  m_irq_status |= IRQ_STATUS_SERVICE_REQUEST | IRQ_STATUS_SUCCESS;
653622                  // we should now be in the command phase
r29632r29633
754723{
755724   int length, phase;
756725
757   m_scsi_devices[m_last_id]->SetCommand(&m_fifo[0], 12);
758   m_scsi_devices[m_last_id]->ExecCommand();
759   m_scsi_devices[m_last_id]->GetLength(&length);
760   m_scsi_devices[m_last_id]->GetPhase(&phase);
726   send_command(&m_fifo[0], 12);
727   length = get_length();
728   phase = get_phase();
761729
762730   #if VERBOSE
763731   printf("Command executed (id %d), new phase %d, length %x\n", m_last_id, phase, length);
r29632r29633
818786         #if VERBOSE
819787         printf("Flushing buffer to device, %x bytes left in buffer (%x total)\n", m_xfer_count, m_total_data);
820788         #endif
821         m_scsi_devices[m_last_id]->WriteData(m_buffer, flush_size);
789         write_data(m_buffer, flush_size);
822790         m_buffer_offset = 0;
823791
824792         // need a service request here too
trunk/src/emu/machine/ncr539x.h
r29632r29633
66#ifndef _NCR539x_H_
77#define _NCR539x_H_
88
9#include "machine/scsihle.h"
9#include "legscsi.h"
1010
1111//// 539x registers
1212//enum
r29632r29633
2121#define MCFG_NCR539X_OUT_DRQ_CB(_devcb) \
2222   devcb = &ncr539x_device::set_out_drq_callback(*device, DEVCB2_##_devcb);
2323   
24
25class ncr539x_device : public device_t
24class ncr539x_device : public legacy_scsi_host_adapter
2625{
2726public:
2827   // construction/destruction
r29632r29633
5049   void exec_fifo();
5150   void update_fifo_internal_state(int bytes);
5251
53   scsihle_device *m_scsi_devices[8];
54
5552   UINT32 m_xfer_count;
5653   UINT32 m_dma_size;
5754   UINT8 m_command;
trunk/src/mess/includes/mac.h
r29632r29633
2525#include "cpu/m68000/m68000.h"
2626
2727#define MAC_SCREEN_NAME "screen"
28#define MAC_539X_1_TAG "scsi:539x_1"
29#define MAC_539X_2_TAG "scsi:539x_2"
28#define MAC_539X_1_TAG "539x_1"
29#define MAC_539X_2_TAG "539x_2"
3030#define MACKBD_TAG "mackbd"
3131
3232// uncomment to run i8021 keyboard in orignal Mac/512(e)/Plus
r29632r29633
200200      m_ram(*this, RAM_TAG),
201201      m_539x_1(*this, MAC_539X_1_TAG),
202202      m_539x_2(*this, MAC_539X_2_TAG),
203      m_ncr5380(*this, "scsi:ncr5380"),
203      m_ncr5380(*this, "ncr5380"),
204204      m_mackbd(*this, MACKBD_TAG),
205205      m_rtc(*this,"rtc"),
206206      m_mouse0(*this, "MOUSE0"),
trunk/src/mess/includes/bullet.h
r29632r29633
99#include "cpu/z80/z80.h"
1010#include "bus/centronics/ctronics.h"
1111#include "machine/ram.h"
12#include "machine/scsibus.h"
13#include "machine/scsicb.h"
14#include "machine/scsihd.h"
12#include "bus/scsi/scsi.h"
1513#include "machine/wd_fdc.h"
1614#include "machine/z80ctc.h"
1715#include "machine/z80dart.h"
r29632r29633
136134class bulletf_state : public bullet_state
137135{
138136public:
139   bulletf_state(const machine_config &mconfig, device_type type, const char *tag)
140      : bullet_state(mconfig, type, tag),
141         m_floppy8(*this, MB8877_TAG":8"),
142         m_floppy9(*this, MB8877_TAG":9"),
143         m_scsibus(*this, SCSIBUS_TAG ":host")
144   { }
137   bulletf_state(const machine_config &mconfig, device_type type, const char *tag) :
138      bullet_state(mconfig, type, tag),
139      m_floppy8(*this, MB8877_TAG":8"),
140      m_floppy9(*this, MB8877_TAG":9"),
141      m_scsibus(*this, SCSIBUS_TAG),
142      m_scsi_data_in(*this, "scsi_data_in"),
143      m_scsi_data_out(*this, "scsi_data_out"),
144      m_scsi_ctrl_in(*this, "scsi_ctrl_in")
145   {
146   }
145147
146148   required_device<floppy_connector> m_floppy8;
147149   required_device<floppy_connector> m_floppy9;
148   required_device<scsicb_device> m_scsibus;
150   required_device<SCSI_PORT_DEVICE> m_scsibus;
151   required_device<input_buffer_device> m_scsi_data_in;
152   required_device<output_latch_device> m_scsi_data_out;
153   required_device<input_buffer_device> m_scsi_ctrl_in;
149154
150155   virtual void machine_start();
151156   virtual void machine_reset();
r29632r29633
161166
162167   DECLARE_READ8_MEMBER( dma_mreq_r );
163168   DECLARE_WRITE8_MEMBER( dma_mreq_w );
164   DECLARE_READ8_MEMBER( pio_pa_r );
165169   DECLARE_WRITE8_MEMBER( pio_pa_w );
166170   DECLARE_WRITE_LINE_MEMBER( cstrb_w );
167171   DECLARE_WRITE_LINE_MEMBER( req_w );
trunk/src/mess/includes/rmnimbus.h
r29632r29633
99#include "cpu/i86/i186.h"
1010#include "machine/z80sio.h"
1111#include "machine/wd17xx.h"
12#include "machine/scsicb.h"
12#include "bus/scsi/scsi.h"
1313#include "machine/6522via.h"
1414#include "machine/ram.h"
1515#include "machine/er59256.h"
r29632r29633
133133struct nimbus_drives_t
134134{
135135   UINT8   reg400;
136   UINT8   reg410_in;
137   UINT8   reg410_out;
138136   UINT8   reg418;
139137
140138   UINT8   drq_ff;
r29632r29633
283281#define HDC_DRQ_ENABLED()   ((m_nimbus_drives.reg400 & HDC_DRQ_MASK) ? 1 : 0)
284282#define FDC_DRQ_ENABLED()   ((m_nimbus_drives.reg400 & FDC_DRQ_MASK) ? 1 : 0)
285283
286/* Masks for port 0x410 read*/
287284
288#define FDC_READY_MASK  0x01
289#define FDC_INDEX_MASK  0x02
290#define FDC_MOTOR_MASKI 0x04
291#define HDC_MSG_MASK    0x08
292#define HDC_BSY_MASK    0x10
293#define HDC_IO_MASK     0x20
294#define HDC_CD_MASK     0x40
295#define HDC_REQ_MASK    0x80
296
297#define FDC_BITS_410    (FDC_READY_MASK | FDC_INDEX_MASK | FDC_MOTOR_MASKI)
298#define HDC_BITS_410    (HDC_MSG_MASK | HDC_BSY_MASK | HDC_IO_MASK | HDC_CD_MASK | HDC_REQ_MASK)
299#define INV_BITS_410    (HDC_BSY_MASK | HDC_IO_MASK | HDC_CD_MASK | HDC_REQ_MASK)
300
301#define HDC_INT_TRIGGER (HDC_IO_MASK | HDC_CD_MASK | HDC_REQ_MASK)
302
303/* Masks for port 0x410 write*/
304
305#define HDC_RESET_MASK  0x01
306#define HDC_SEL_MASK    0x02
307#define HDC_IRQ_MASK    0x04
308#define HDC_IRQ_ENABLED()   ((m_nimbus_drives.reg410_out & HDC_IRQ_MASK) ? 1 : 0)
309
310
311#define SCSI_ID_NONE    0x80
312
313
314285/* 8031/8051 Peripheral controler */
315286
316287#define IPC_OUT_ADDR        0X01
r29632r29633
388359class rmnimbus_state : public driver_device
389360{
390361public:
391   rmnimbus_state(const machine_config &mconfig, device_type type, const char *tag)
392      : driver_device(mconfig, type, tag),
362   rmnimbus_state(const machine_config &mconfig, device_type type, const char *tag) :
363      driver_device(mconfig, type, tag),
393364      m_maincpu(*this, "maincpu"),
394365      m_msm(*this, MSM5205_TAG),
395366      m_ay8910(*this, AY8910_TAG),
396      m_scsibus(*this, SCSIBUS_TAG ":host"),
367      m_scsibus(*this, SCSIBUS_TAG),
397368      m_ram(*this, RAM_TAG),
398369      m_eeprom(*this, ER59256_TAG),
399370      m_via(*this, VIA_TAG),
400371      m_centronics(*this, CENTRONICS_TAG),
401      m_palette(*this, "palette")
372      m_palette(*this, "palette"),
373      m_scsi_data_out(*this, "scsi_data_out"),
374      m_scsi_data_in(*this, "scsi_data_in"),
375      m_scsi_ctrl_out(*this, "scsi_ctrl_out")
402376   {
403377   }
404378
405379   required_device<i80186_cpu_device> m_maincpu;
406380   required_device<msm5205_device> m_msm;
407381   required_device<ay8910_device> m_ay8910;
408   required_device<scsicb_device> m_scsibus;
382   required_device<SCSI_PORT_DEVICE> m_scsibus;
409383   required_device<ram_device> m_ram;
410384   required_device<er59256_device> m_eeprom;
411385   required_device<via6522_device> m_via;
412386   required_device<centronics_device> m_centronics;
413387   required_device<palette_device> m_palette;
388   required_device<output_latch_device> m_scsi_data_out;
389   required_device<input_buffer_device> m_scsi_data_in;
390   required_device<output_latch_device> m_scsi_ctrl_out;
414391
415392   UINT32 m_debug_machine;
416393//  i186_state m_i186;
r29632r29633
476453   DECLARE_WRITE8_MEMBER(nimbus_via_write_portb);
477454   DECLARE_WRITE_LINE_MEMBER(nimbus_via_irq_w);
478455   DECLARE_WRITE_LINE_MEMBER(nimbus_ack_w);
479   DECLARE_WRITE_LINE_MEMBER(nimbus_scsi_bsy_w);
480   DECLARE_WRITE_LINE_MEMBER(nimbus_scsi_cd_w);
481   DECLARE_WRITE_LINE_MEMBER(nimbus_scsi_io_w);
482   DECLARE_WRITE_LINE_MEMBER(nimbus_scsi_msg_w);
483   DECLARE_WRITE_LINE_MEMBER(nimbus_scsi_req_w);
456   DECLARE_WRITE_LINE_MEMBER(write_scsi_bsy);
457   DECLARE_WRITE_LINE_MEMBER(write_scsi_cd);
458   DECLARE_WRITE_LINE_MEMBER(write_scsi_io);
459   DECLARE_WRITE_LINE_MEMBER(write_scsi_msg);
460   DECLARE_WRITE_LINE_MEMBER(write_scsi_req);
484461   DECLARE_WRITE_LINE_MEMBER(nimbus_msm5205_vck);
462   DECLARE_WRITE_LINE_MEMBER(write_scsi_iena);
485463
486   void nimbus_scsi_linechange( UINT8 mask, UINT8 state );
487464   IRQ_CALLBACK_MEMBER(int_callback);
488465   UINT8 get_pixel(UINT16 x, UINT16 y);
489466   UINT16 read_pixel_line(UINT16 x, UINT16 y, UINT8 width);
r29632r29633
535512   void iou_reset();
536513   void rmni_sound_reset();
537514   void mouse_js_reset();
515
516   int m_scsi_iena;
517   int m_scsi_msg;
518   int m_scsi_bsy;
519   int m_scsi_io;
520   int m_scsi_cd;
521   int m_scsi_req;
538522};
trunk/src/mess/includes/xerox820.h
r29632r29633
1111#include "machine/com8116.h"
1212#include "machine/keyboard.h"
1313#include "machine/ram.h"
14#include "machine/scsibus.h"
15#include "machine/scsicb.h"
16#include "machine/scsihd.h"
14#include "bus/scsi/scsi.h"
15#include "bus/scsi/scsihd.h"
1716#include "machine/wd_fdc.h"
1817#include "machine/z80pio.h"
1918#include "machine/z80ctc.h"
r29632r29633
140139class xerox820ii_state : public xerox820_state
141140{
142141public:
143   xerox820ii_state(const machine_config &mconfig, device_type type, const char *tag)
144      : xerox820_state(mconfig, type, tag),
145         m_speaker(*this, "speaker"),
146         m_sasibus(*this, SASIBUS_TAG ":host")
147   { }
142   xerox820ii_state(const machine_config &mconfig, device_type type, const char *tag) :
143      xerox820_state(mconfig, type, tag),
144      m_speaker(*this, "speaker"),
145      m_sasibus(*this, SASIBUS_TAG)
146   {
147   }
148148
149149   required_device<speaker_sound_device> m_speaker;
150   required_device<scsicb_device> m_sasibus;
150   required_device<SCSI_PORT_DEVICE> m_sasibus;
151151
152152   virtual void machine_reset();
153153
r29632r29633
157157   DECLARE_WRITE8_MEMBER( lowlite_w );
158158   DECLARE_WRITE8_MEMBER( sync_w );
159159
160   DECLARE_READ8_MEMBER( rdpio_pb_r );
161160   DECLARE_WRITE8_MEMBER( rdpio_pb_w );
162161   DECLARE_WRITE_LINE_MEMBER( rdpio_pardy_w );
163162
trunk/src/mess/includes/v1050.h
r29632r29633
1616#include "machine/i8255.h"
1717#include "machine/msm58321.h"
1818#include "machine/ram.h"
19#include "machine/scsibus.h"
20#include "machine/scsicb.h"
21#include "machine/scsihd.h"
19#include "bus/scsi/scsi.h"
20#include "bus/scsi/scsihd.h"
2221#include "machine/v1050kb.h"
2322#include "machine/wd_fdc.h"
2423#include "video/mc6845.h"
r29632r29633
8483      m_clock_sio(*this, CLOCK_SIO_TAG),
8584      m_timer_ack(*this, TIMER_ACK_TAG),
8685      m_timer_rst(*this, TIMER_RST_TAG),
87      m_sasibus(*this, SASIBUS_TAG ":host"),
86      m_sasibus(*this, SASIBUS_TAG),
87      m_sasi_data_out(*this, "scsi_data_out"),
88      m_sasi_data_in(*this, "scsi_data_in"),
89      m_sasi_ctrl_in(*this, "scsi_ctrl_in"),
8890      m_rom(*this, Z80_TAG),
8991      m_video_ram(*this, "video_ram"),
9092      m_attr_ram(*this, "attr_ram"),
r29632r29633
124126   DECLARE_WRITE8_MEMBER( videoram_w );
125127   DECLARE_WRITE_LINE_MEMBER( crtc_vs_w );
126128   DECLARE_WRITE8_MEMBER(sasi_data_w);
127   DECLARE_WRITE_LINE_MEMBER(sasi_io_w);
129   DECLARE_WRITE_LINE_MEMBER(write_sasi_io);
128130   DECLARE_READ8_MEMBER( sasi_status_r );
129131   DECLARE_WRITE8_MEMBER( sasi_ctrl_w );
130132
r29632r29633
182184   required_device<clock_device> m_clock_sio;
183185   required_device<timer_device> m_timer_ack;
184186   required_device<timer_device> m_timer_rst;
185   required_device<scsicb_device> m_sasibus;
187   required_device<SCSI_PORT_DEVICE> m_sasibus;
188   required_device<output_latch_device> m_sasi_data_out;
189   required_device<input_buffer_device> m_sasi_data_in;
190   required_device<input_buffer_device> m_sasi_ctrl_in;
186191   required_memory_region m_rom;
187192   required_shared_ptr<UINT8> m_video_ram;
188193   optional_shared_ptr<UINT8> m_attr_ram;
r29632r29633
211216   UINT8 m_attr;               // attribute latch
212217
213218   // sasi state
214   UINT8 data_out;
219   UINT8 m_sasi_data;
220   int m_sasi_data_enable;
215221
216222   UINT8 m_rtc_ppi_pa;
217223   UINT8 m_rtc_ppi_pc;
trunk/src/mess/includes/bebox.h
r29632r29633
3131      : driver_device(mconfig, type, tag),
3232         m_ppc1(*this, "ppc1"),
3333         m_ppc2(*this, "ppc2"),
34         m_lsi53c810(*this, "scsi:lsi53c810"),
34         m_lsi53c810(*this, "lsi53c810"),
3535         m_dma8237_1(*this, "dma8237_1"),
3636         m_dma8237_2(*this, "dma8237_2"),
3737         m_pic8259_1(*this, "pic8259_1"),
trunk/src/mess/drivers/ip22.c
r29632r29633
5050#include "video/newport.h"
5151#include "sound/dac.h"
5252#include "machine/nvram.h"
53#include "machine/scsibus.h"
54#include "machine/scsicd.h"
55#include "machine/scsihd.h"
53#include "bus/scsi/scsi.h"
54#include "bus/scsi/scsicd.h"
55#include "bus/scsi/scsihd.h"
5656#include "machine/wd33c93.h"
5757
5858struct RTC_t
r29632r29633
9797      TIMER_IP22_MSEC
9898   };
9999
100   ip22_state(const machine_config &mconfig, device_type type, const char *tag)
101      : driver_device(mconfig, type, tag),
102   m_maincpu(*this, "maincpu"),
103   m_wd33c93(*this, "scsi:wd33c93"),
104   m_unkpbus0(*this, "unkpbus0"),
105   m_mainram(*this, "mainram"),
106   m_lpt0(*this, "lpt_0"),
107   m_pit(*this, "pit8254"),
108   m_sgi_mc(*this, "sgi_mc"),
109   m_newport(*this, "newport"),
110   m_dac(*this, "dac"),
111   m_kbdc8042(*this, "kbdc")
112   { }
100   ip22_state(const machine_config &mconfig, device_type type, const char *tag) :
101      driver_device(mconfig, type, tag),
102      m_maincpu(*this, "maincpu"),
103      m_wd33c93(*this, "wd33c93"),
104      m_unkpbus0(*this, "unkpbus0"),
105      m_mainram(*this, "mainram"),
106      m_lpt0(*this, "lpt_0"),
107      m_pit(*this, "pit8254"),
108      m_sgi_mc(*this, "sgi_mc"),
109      m_newport(*this, "newport"),
110      m_dac(*this, "dac"),
111      m_kbdc8042(*this, "kbdc")
112   {
113   }
113114
114115   required_device<cpu_device> m_maincpu;
115116   required_device<wd33c93_device> m_wd33c93;
r29632r29633
12751276            if (words <= (512/4))
12761277            {
12771278               // one-shot
1278               //m_wd33c93->get_dma_data(m_wd33c93->get_dma_count(), m_dma_buffer);
1279               //m_wd33c93->dma_read_data(m_wd33c93->get_dma_count(), m_dma_buffer);
12791280
12801281               while (words)
12811282               {
r29632r29633
13021303               }
13031304
13041305               words = m_wd33c93->get_dma_count();
1305               m_wd33c93->write_data(words, m_dma_buffer);
1306               m_wd33c93->dma_write_data(words, m_dma_buffer);
13061307            }
13071308            else
13081309            {
13091310               while (words)
13101311               {
1311                  //m_wd33c93->get_dma_data(512, m_dma_buffer);
1312                  //m_wd33c93->dma_read_data(512, m_dma_buffer);
13121313                  twords = 512/4;
13131314                  m_HPC3.nSCSI0Descriptor += 512;
13141315                  dptr = 0;
r29632r29633
13371338                     twords--;
13381339                  }
13391340
1340                  m_wd33c93->write_data(512, m_dma_buffer);
1341                  m_wd33c93->dma_write_data(512, m_dma_buffer);
13411342
13421343                  words -= (512/4);
13431344               }
r29632r29633
14161417            if (words <= (1024/4))
14171418            {
14181419               // one-shot
1419               m_wd33c93->get_dma_data(m_wd33c93->get_dma_count(), m_dma_buffer);
1420               m_wd33c93->dma_read_data(m_wd33c93->get_dma_count(), m_dma_buffer);
14201421
14211422               while (words)
14221423               {
r29632r29633
14391440            {
14401441               while (words)
14411442               {
1442                  m_wd33c93->get_dma_data(512, m_dma_buffer);
1443                  m_wd33c93->dma_read_data(512, m_dma_buffer);
14431444                  twords = 512/4;
14441445                  sptr = 0;
14451446
r29632r29633
15851586};
15861587#endif
15871588
1589static MACHINE_CONFIG_FRAGMENT( cdrom_config )
1590   MCFG_DEVICE_MODIFY( "cdda" )
1591   MCFG_SOUND_ROUTE( 0, "^^^^lspeaker", 1.0 )
1592   MCFG_SOUND_ROUTE( 1, "^^^^rspeaker", 1.0 )
1593MACHINE_CONFIG_END
1594
15881595static MACHINE_CONFIG_START( ip225015, ip22_state )
15891596   MCFG_CPU_ADD( "maincpu", R5000BE, 50000000*3 )
15901597   MCFG_CPU_CONFIG( config )
r29632r29633
16221629   MCFG_SOUND_ADD( "dac", DAC, 0 )
16231630   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5)
16241631
1625   MCFG_SCSIBUS_ADD("scsi")
1626   MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_1)
1627   MCFG_SCSIDEV_ADD("scsi:cdrom", SCSICD, SCSI_ID_4)
1628   MCFG_DEVICE_ADD("scsi:wd33c93", WD33C93, 0)
1629   MCFG_WD33C93_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, ip22_state,scsi_irq))
1632   MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
1633   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_1)
1634   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "cdrom", SCSICD, SCSI_ID_4)
1635   MCFG_SLOT_OPTION_MACHINE_CONFIG("cdrom", cdrom_config)
16301636
1631   MCFG_SOUND_MODIFY( "scsi:cdrom:cdda" )
1632   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "^^^lspeaker", 1.0)
1633   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "^^^rspeaker", 1.0)
1637   MCFG_DEVICE_ADD("wd33c93", WD33C93, 0)
1638   MCFG_LEGACY_SCSI_PORT("scsi")
1639   MCFG_WD33C93_IRQ_CB(WRITELINE(ip22_state,scsi_irq))
16341640
16351641   MCFG_DEVICE_ADD("kbdc", KBDC8042, 0)
16361642   MCFG_KBDC8042_KEYBOARD_TYPE(KBDC8042_STANDARD)
trunk/src/mess/drivers/bullet.c
r29632r29633
6060
6161#include "includes/bullet.h"
6262#include "bus/rs232/rs232.h"
63#include "bus/scsi/scsihd.h"
6364
6465
6566
r29632r29633
530531
531532READ8_MEMBER( bulletf_state::scsi_r )
532533{
533   UINT8 data = m_scsibus->scsi_data_r();
534   UINT8 data = m_scsi_data_in->read();
534535
535   m_scsibus->scsi_ack_w(1);
536   m_scsibus->write_ack(1);
536537
537538   m_wack = 0;
538539   update_dma_rdy();
r29632r29633
547548
548549WRITE8_MEMBER( bulletf_state::scsi_w )
549550{
550   m_scsibus->scsi_data_w(data);
551   m_scsi_data_out->write(data);
551552
552   m_scsibus->scsi_ack_w(1);
553   m_scsibus->write_ack(1);
553554
554555   m_wack = 0;
555556   update_dma_rdy();
r29632r29633
970971};
971972
972973
973//-------------------------------------------------
974//  Z80PIO_INTERFACE( bulletf_pio_intf )
975//-------------------------------------------------
976
977READ8_MEMBER( bulletf_state::pio_pa_r )
974WRITE8_MEMBER( bulletf_state::pio_pa_w )
978975{
979976   /*
980977
981978       bit     signal
982979
983       0
984       1
985       2
980       0       ATN
981       1       RST
982       2       SEL
986983       3       BUSY
987984       4       MSG
988985       5       C/D
r29632r29633
991988
992989   */
993990
994   UINT8 data = 0;
995
996   data |= m_scsibus->scsi_bsy_r() << 3;
997   data |= m_scsibus->scsi_msg_r() << 4;
998   data |= m_scsibus->scsi_cd_r() << 5;
999   data |= m_scsibus->scsi_req_r() << 6;
1000   data |= m_scsibus->scsi_io_r() << 7;
1001
1002   return data;
991   m_scsibus->write_atn(BIT(data, 0));
992   m_scsibus->write_rst(BIT(data, 1));
993   m_scsibus->write_sel(BIT(data, 2));
1003994}
1004995
1005WRITE8_MEMBER( bulletf_state::pio_pa_w )
1006{
1007   /*
1008
1009       bit     signal
1010
1011       0       ATN
1012       1       RST
1013       2       SEL
1014       3
1015       4
1016       5
1017       6
1018       7
1019
1020   */
1021
1022   m_scsibus->scsi_atn_w(BIT(data, 0));
1023   m_scsibus->scsi_rst_w(BIT(data, 1));
1024   m_scsibus->scsi_sel_w(BIT(data, 2));
1025}
1026
1027996WRITE_LINE_MEMBER( bulletf_state::cstrb_w )
1028997{
1029998   m_centronics->write_strobe(!state);
r29632r29633
10321001static Z80PIO_INTERFACE( bulletf_pio_intf )
10331002{
10341003   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0),
1035   DEVCB_DRIVER_MEMBER(bulletf_state, pio_pa_r),
1004   DEVCB_DEVICE_MEMBER("scsi_ctrl_in", input_buffer_device, read),
10361005   DEVCB_DRIVER_MEMBER(bulletf_state, pio_pa_w),
10371006   DEVCB_DEVICE_MEMBER("cent_data_out", output_latch_device, write),
10381007   DEVCB_NULL,
r29632r29633
10701039{
10711040   if (!state)
10721041   {
1073      m_scsibus->scsi_ack_w(0);
1042      m_scsibus->write_ack(0);
10741043
10751044      m_wack = 1;
10761045   }
10771046
10781047   m_wrdy = !state;
10791048   update_dma_rdy();
1049
1050   m_scsi_ctrl_in->write_bit6(state);
10801051}
10811052
10821053
r29632r29633
13041275   MCFG_RS232_PORT_ADD(RS232_B_TAG, default_rs232_devices, NULL)
13051276   MCFG_RS232_RXD_HANDLER(DEVWRITELINE(Z80DART_TAG, z80dart_device, rxb_w))
13061277
1307   MCFG_SCSIBUS_ADD(SCSIBUS_TAG)
1308   MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":harddisk0", SCSIHD, SCSI_ID_0)
1309   MCFG_SCSICB_ADD(SCSIBUS_TAG ":host")
1310   MCFG_SCSICB_REQ_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, bulletf_state, req_w))
1278   MCFG_DEVICE_ADD(SCSIBUS_TAG, SCSI_PORT, 0)
1279   MCFG_SCSI_BSY_HANDLER(DEVWRITELINE("scsi_ctrl_in", input_buffer_device, write_bit3))
1280   MCFG_SCSI_MSG_HANDLER(DEVWRITELINE("scsi_ctrl_in", input_buffer_device, write_bit4))
1281   MCFG_SCSI_CD_HANDLER(DEVWRITELINE("scsi_ctrl_in", input_buffer_device, write_bit5))
1282   MCFG_SCSI_REQ_HANDLER(WRITELINE(bulletf_state, req_w))
1283   MCFG_SCSI_IO_HANDLER(DEVWRITELINE("scsi_ctrl_in", input_buffer_device, write_bit7))
1284   MCFG_SCSI_DATA_INPUT_BUFFER("scsi_data_in")
13111285
1286   MCFG_SCSI_OUTPUT_LATCH_ADD("scsi_data_out", SCSIBUS_TAG)
1287   MCFG_DEVICE_ADD("scsi_ctrl_in", INPUT_BUFFER, 0)
1288   MCFG_DEVICE_ADD("scsi_data_in", INPUT_BUFFER, 0)
1289
1290   MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
1291
13121292   // software lists
13131293   MCFG_SOFTWARE_LIST_ADD("flop_list", "wmbullet")
13141294
trunk/src/mess/drivers/xerox820.c
r29632r29633
355355   DEVCB_NULL      /* portB ready active callback */
356356};
357357
358READ8_MEMBER( xerox820ii_state::rdpio_pb_r )
358WRITE8_MEMBER( xerox820ii_state::rdpio_pb_w )
359359{
360360   /*
361361
362362       bit     description
363363
364       0       NBSY
364      0       NBSY
365365       1       NMSG
366366       2       NC/D
367367       3       NREQ
368368       4       NI/O
369       5
370       6       LS74 Q
371       7
372
373   */
374
375   UINT8 data = 0;
376
377   data |= !m_sasibus->scsi_bsy_r();
378   data |= !m_sasibus->scsi_msg_r() << 1;
379   data |= !m_sasibus->scsi_cd_r() << 2;
380   data |= !m_sasibus->scsi_req_r() << 3;
381   data |= !m_sasibus->scsi_io_r() << 4;
382
383   return data;
384}
385
386WRITE8_MEMBER( xerox820ii_state::rdpio_pb_w )
387{
388   /*
389
390       bit     description
391
392       0
393       1
394       2
395       3
396       4
397369       5       NSEL
398       6
370       6       LS74 Q
399371       7       NRST
400
401372   */
402373
403   m_sasibus->scsi_sel_w(!BIT(data, 5));
404   m_sasibus->scsi_rst_w(!BIT(data, 7));
374   m_sasibus->write_sel(!BIT(data, 5));
375   m_sasibus->write_rst(!BIT(data, 7));
376   // TODO: LS74 Q
405377}
406378
407379WRITE_LINE_MEMBER( xerox820ii_state::rdpio_pardy_w )
r29632r29633
412384static Z80PIO_INTERFACE( rdpio_intf )
413385{
414386   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0), /* callback when change interrupt status */
415   DEVCB_DEVICE_MEMBER(SASIBUS_TAG ":host", scsicb_device, scsi_data_r),   /* port A read callback */
416   DEVCB_DEVICE_MEMBER(SASIBUS_TAG ":host", scsicb_device, scsi_data_w),   /* port A write callback */
387   DEVCB_DEVICE_MEMBER("sasi_data_in", input_buffer_device, read),   /* port A read callback */
388   DEVCB_DEVICE_MEMBER("sasi_data_out", output_latch_device, write),   /* port A write callback */
417389   DEVCB_DRIVER_LINE_MEMBER(xerox820ii_state, rdpio_pardy_w),      /* portA ready active callback */
418   DEVCB_DRIVER_MEMBER(xerox820ii_state, rdpio_pb_r),      /* port B read callback */
390   DEVCB_DEVICE_MEMBER("sasi_ctrl_in", input_buffer_device, read),      /* port B read callback */
419391   DEVCB_DRIVER_MEMBER(xerox820ii_state, rdpio_pb_w),      /* port B write callback */
420392   DEVCB_NULL      /* portB ready active callback */
421393};
r29632r29633
779751   MCFG_GENERIC_KEYBOARD_CB(WRITE8(xerox820_state, kbd_w))
780752
781753   // SASI bus
782   MCFG_SCSIBUS_ADD(SASIBUS_TAG)
783   MCFG_SCSIDEV_ADD(SASIBUS_TAG ":harddisk0", SA1403D, SCSI_ID_0)
784   MCFG_SCSICB_ADD(SASIBUS_TAG ":host")
754   MCFG_DEVICE_ADD(SASIBUS_TAG, SCSI_PORT, 0)
755   MCFG_SCSI_DATA_INPUT_BUFFER("sasi_data_in")
756   MCFG_SCSI_BSY_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit0)) MCFG_DEVCB_XOR(1)
757   MCFG_SCSI_MSG_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit1)) MCFG_DEVCB_XOR(1)
758   MCFG_SCSI_CD_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit2)) MCFG_DEVCB_XOR(1)
759   MCFG_SCSI_REQ_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit3)) MCFG_DEVCB_XOR(1)
760   MCFG_SCSI_IO_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit4)) MCFG_DEVCB_XOR(1)
785761
762   MCFG_SCSIDEV_ADD(SASIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", SA1403D, SCSI_ID_0)
763
764   MCFG_SCSI_OUTPUT_LATCH_ADD("sasi_data_out", SASIBUS_TAG)
765   MCFG_DEVICE_ADD("sasi_data_in", INPUT_BUFFER, 0)
766   MCFG_DEVICE_ADD("sasi_ctrl_in", INPUT_BUFFER, 0)
767
786768   /* internal ram */
787769   MCFG_RAM_ADD(RAM_TAG)
788770   MCFG_RAM_DEFAULT_SIZE("64K")
trunk/src/mess/drivers/x68k.c
r29632r29633
130130#include "bus/x68k/x68kexp.h"
131131#include "bus/x68k/x68k_neptunex.h"
132132#include "bus/x68k/x68k_scsiext.h"
133#include "machine/scsibus.h"
134#include "machine/scsihd.h"
133#include "bus/scsi/scsi.h"
134#include "bus/scsi/scsihd.h"
135135#include "x68000.lh"
136136
137137
r29632r29633
12751275   AM_RANGE(0xe94000, 0xe94003) AM_DEVICE8("upd72065", upd72065_device, map, 0x00ff)
12761276   AM_RANGE(0xe94004, 0xe94007) AM_READWRITE(x68k_fdc_r, x68k_fdc_w)
12771277//  AM_RANGE(0xe96000, 0xe9601f) AM_DEVREADWRITE("x68k_hdc", x68k_hdc_image_device, hdc_r, hdc_w)
1278   AM_RANGE(0xe96020, 0xe9603f) AM_DEVREADWRITE8("scsi:mb89352",mb89352_device,mb89352_r,mb89352_w,0x00ff)
1278   AM_RANGE(0xe96020, 0xe9603f) AM_DEVREADWRITE8("mb89352",mb89352_device,mb89352_r,mb89352_w,0x00ff)
12791279   AM_RANGE(0xe98000, 0xe99fff) AM_READWRITE(x68k_scc_r, x68k_scc_w)
12801280   AM_RANGE(0xe9a000, 0xe9bfff) AM_READWRITE(x68k_ppi_r, x68k_ppi_w)
12811281   AM_RANGE(0xe9c000, 0xe9dfff) AM_READWRITE(x68k_ioc_r, x68k_ioc_w)
r29632r29633
13141314   AM_RANGE(0xe94000, 0xe94003) AM_DEVICE8("upd72065", upd72065_device, map, 0x00ff00ff)
13151315   AM_RANGE(0xe94004, 0xe94007) AM_READWRITE16(x68k_fdc_r, x68k_fdc_w,0xffffffff)
13161316//  AM_RANGE(0xe96000, 0xe9601f) AM_DEVREADWRITE16("x68k_hdc", x68k_hdc_image_device, hdc_r, hdc_w, 0xffffffff)
1317   AM_RANGE(0xe96020, 0xe9603f) AM_DEVREADWRITE8("scsi:mb89352",mb89352_device,mb89352_r,mb89352_w,0x00ff00ff)
1317   AM_RANGE(0xe96020, 0xe9603f) AM_DEVREADWRITE8("mb89352",mb89352_device,mb89352_r,mb89352_w,0x00ff00ff)
13181318   AM_RANGE(0xe98000, 0xe99fff) AM_READWRITE16(x68k_scc_r, x68k_scc_w,0xffffffff)
13191319   AM_RANGE(0xe9a000, 0xe9bfff) AM_READWRITE16(x68k_ppi_r, x68k_ppi_w,0xffffffff)
13201320   AM_RANGE(0xe9c000, 0xe9dfff) AM_READWRITE16(x68k_ioc_r, x68k_ioc_w,0xffffffff)
r29632r29633
19061906   MCFG_CPU_MODIFY("maincpu")
19071907   MCFG_CPU_PROGRAM_MAP(x68kxvi_map)
19081908
1909   MCFG_SCSIBUS_ADD("scsi")
1910   MCFG_SCSIDEV_ADD("scsi:harddisk0", SCSIHD, SCSI_ID_0)
1911   MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_1)
1912   MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_2)
1913   MCFG_SCSIDEV_ADD("scsi:harddisk3", SCSIHD, SCSI_ID_3)
1914   MCFG_SCSIDEV_ADD("scsi:harddisk4", SCSIHD, SCSI_ID_4)
1915   MCFG_SCSIDEV_ADD("scsi:harddisk5", SCSIHD, SCSI_ID_5)
1916   MCFG_SCSIDEV_ADD("scsi:harddisk6", SCSIHD, SCSI_ID_6)
1917   MCFG_DEVICE_ADD("scsi:mb89352", MB89352A, 0)
1918   MCFG_MB89352A_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_state, x68k_scsi_irq))
1919   MCFG_MB89352A_DRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_state, x68k_scsi_drq))
1909   MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
1910   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
1911   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_1)
1912   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE3, "harddisk", SCSIHD, SCSI_ID_2)
1913   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE4, "harddisk", SCSIHD, SCSI_ID_3)
1914   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE5, "harddisk", SCSIHD, SCSI_ID_4)
1915   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE6, "harddisk", SCSIHD, SCSI_ID_5)
1916   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE7, "harddisk", SCSIHD, SCSI_ID_6)
1917
1918   MCFG_DEVICE_ADD("mb89352", MB89352A, 0)
1919   MCFG_LEGACY_SCSI_PORT("scsi")
1920   MCFG_MB89352A_IRQ_CB(WRITELINE(x68k_state, x68k_scsi_irq))
1921   MCFG_MB89352A_DRQ_CB(WRITELINE(x68k_state, x68k_scsi_drq))
19201922MACHINE_CONFIG_END
19211923
19221924static MACHINE_CONFIG_START( x68kxvi, x68k_state )
r29632r29633
19291931   MCFG_CPU_CLOCK(16000000)  /* 16 MHz */
19301932   MCFG_CPU_PROGRAM_MAP(x68kxvi_map)
19311933
1932   MCFG_SCSIBUS_ADD("scsi")
1933   MCFG_SCSIDEV_ADD("scsi:harddisk0", SCSIHD, SCSI_ID_0)
1934   MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_1)
1935   MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_2)
1936   MCFG_SCSIDEV_ADD("scsi:harddisk3", SCSIHD, SCSI_ID_3)
1937   MCFG_SCSIDEV_ADD("scsi:harddisk4", SCSIHD, SCSI_ID_4)
1938   MCFG_SCSIDEV_ADD("scsi:harddisk5", SCSIHD, SCSI_ID_5)
1939   MCFG_SCSIDEV_ADD("scsi:harddisk6", SCSIHD, SCSI_ID_6)
1940   MCFG_DEVICE_ADD("scsi:mb89352", MB89352A, 0)
1941   MCFG_MB89352A_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_state, x68k_scsi_irq))
1942   MCFG_MB89352A_DRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_state, x68k_scsi_drq))
1934   MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
1935   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
1936   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_1)
1937   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE3, "harddisk", SCSIHD, SCSI_ID_2)
1938   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE4, "harddisk", SCSIHD, SCSI_ID_3)
1939   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE5, "harddisk", SCSIHD, SCSI_ID_4)
1940   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE6, "harddisk", SCSIHD, SCSI_ID_5)
1941   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE7, "harddisk", SCSIHD, SCSI_ID_6)
1942
1943   MCFG_DEVICE_ADD("mb89352", MB89352A, 0)
1944   MCFG_LEGACY_SCSI_PORT("scsi")
1945   MCFG_MB89352A_IRQ_CB(WRITELINE(x68k_state, x68k_scsi_irq))
1946   MCFG_MB89352A_DRQ_CB(WRITELINE(x68k_state, x68k_scsi_drq))
19431947MACHINE_CONFIG_END
19441948
19451949static MACHINE_CONFIG_START( x68030, x68k_state )
r29632r29633
19531957
19541958   MCFG_NVRAM_ADD_0FILL("nvram32")
19551959
1956   MCFG_SCSIBUS_ADD("scsi")
1957   MCFG_SCSIDEV_ADD("scsi:harddisk0", SCSIHD, SCSI_ID_0)
1958   MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_1)
1959   MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_2)
1960   MCFG_SCSIDEV_ADD("scsi:harddisk3", SCSIHD, SCSI_ID_3)
1961   MCFG_SCSIDEV_ADD("scsi:harddisk4", SCSIHD, SCSI_ID_4)
1962   MCFG_SCSIDEV_ADD("scsi:harddisk5", SCSIHD, SCSI_ID_5)
1963   MCFG_SCSIDEV_ADD("scsi:harddisk6", SCSIHD, SCSI_ID_6)
1964   MCFG_DEVICE_ADD("scsi:mb89352", MB89352A, 0)
1965   MCFG_MB89352A_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_state, x68k_scsi_irq))
1966   MCFG_MB89352A_DRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_state, x68k_scsi_drq))
1960   MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
1961   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
1962   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_1)
1963   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE3, "harddisk", SCSIHD, SCSI_ID_2)
1964   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE4, "harddisk", SCSIHD, SCSI_ID_3)
1965   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE5, "harddisk", SCSIHD, SCSI_ID_4)
1966   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE6, "harddisk", SCSIHD, SCSI_ID_5)
1967   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE7, "harddisk", SCSIHD, SCSI_ID_6)
1968
1969   MCFG_DEVICE_ADD("mb89352", MB89352A, 0)
1970   MCFG_LEGACY_SCSI_PORT("scsi")
1971   MCFG_MB89352A_IRQ_CB(WRITELINE(x68k_state, x68k_scsi_irq))
1972   MCFG_MB89352A_DRQ_CB(WRITELINE(x68k_state, x68k_scsi_drq))
19671973MACHINE_CONFIG_END
19681974
19691975ROM_START( x68000 )
trunk/src/mess/drivers/mac.c
r29632r29633
5353#include "machine/sonydriv.h"
5454#include "formats/ap_dsk35.h"
5555#include "machine/ram.h"
56#include "machine/scsibus.h"
57#include "machine/scsihd.h"
58#include "machine/scsicd.h"
56#include "bus/scsi/scsi.h"
57#include "bus/scsi/scsihd.h"
58#include "bus/scsi/scsicd.h"
5959#include "sound/asc.h"
6060#include "sound/awacs.h"
6161#include "sound/cdda.h"
r29632r29633
972972   MCFG_CPU_MODIFY( "maincpu" )
973973   MCFG_CPU_PROGRAM_MAP(macplus_map)
974974
975   MCFG_SCSIBUS_ADD("scsi")
976   MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_6)
977   MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_5)
978   MCFG_DEVICE_ADD("scsi:ncr5380", NCR5380, C7M)
979   MCFG_NCR5380_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, mac_state, mac_scsi_irq))
975   MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
976   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_6)
977   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_5)
980978
979   MCFG_DEVICE_ADD("ncr5380", NCR5380, C7M)
980   MCFG_LEGACY_SCSI_PORT("scsi")
981   MCFG_NCR5380_IRQ_CB(WRITELINE(mac_state, mac_scsi_irq))
982
981983   MCFG_LEGACY_FLOPPY_SONY_2_DRIVES_MODIFY(mac_floppy_interface)
982984
983985   /* internal ram */
r29632r29633
10641066
10651067   /* devices */
10661068   MCFG_RTC3430042_ADD("rtc", XTAL_32_768kHz)
1067   MCFG_SCSIBUS_ADD("scsi")
1068   MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_6)
1069   MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_5)
1070   MCFG_DEVICE_ADD("scsi:ncr5380", NCR5380, C7M)
1071   MCFG_NCR5380_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, mac_state, mac_scsi_irq))
10721069
1070   MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
1071   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_6)
1072   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_5)
1073
1074   MCFG_DEVICE_ADD("ncr5380", NCR5380, C7M)
1075   MCFG_LEGACY_SCSI_PORT("scsi")
1076   MCFG_NCR5380_IRQ_CB(WRITELINE(mac_state, mac_scsi_irq))
1077
10731078   MCFG_IWM_ADD("fdc", mac_iwm_interface)
10741079   MCFG_LEGACY_FLOPPY_SONY_2_DRIVES_ADD(mac_floppy_interface)
10751080
r29632r29633
11161121   MCFG_NUBUS_SLOT_ADD("nubus","nbd", mac_nubus_cards, NULL)
11171122   MCFG_NUBUS_SLOT_ADD("nubus","nbe", mac_nubus_cards, NULL)
11181123
1119   MCFG_SCSIBUS_ADD("scsi")
1120   MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_6)
1121   MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_5)
1122   MCFG_SCSIDEV_ADD("scsi:cdrom1", SCSICD, SCSI_ID_4)
1123   MCFG_DEVICE_ADD("scsi:ncr5380", NCR5380, C7M)
1124   MCFG_NCR5380_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, mac_state, mac_scsi_irq))
1124   MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
1125   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_6)
1126   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_5)
1127   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE3, "cdrom", SCSICD, SCSI_ID_4)
11251128
1129   MCFG_DEVICE_ADD("ncr5380", NCR5380, C7M)
1130   MCFG_LEGACY_SCSI_PORT("scsi")
1131   MCFG_NCR5380_IRQ_CB(WRITELINE(mac_state, mac_scsi_irq))
1132
11261133   MCFG_IWM_ADD("fdc", mac_iwm_interface)
11271134   MCFG_LEGACY_FLOPPY_SONY_2_DRIVES_ADD(mac_floppy_interface)
11281135
r29632r29633
11811188   MCFG_NUBUS_SLOT_ADD("nubus","nbd", mac_nubus_cards, NULL)
11821189   MCFG_NUBUS_SLOT_ADD("nubus","nbe", mac_nubus_cards, NULL)
11831190
1184   MCFG_SCSIBUS_ADD("scsi")
1185   MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_6)
1186   MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_5)
1187   MCFG_DEVICE_ADD("scsi:ncr5380", NCR5380, C7M)
1188   MCFG_NCR5380_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, mac_state, mac_scsi_irq))
1191   MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
1192   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_6)
1193   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_5)
11891194
1195   MCFG_DEVICE_ADD("ncr5380", NCR5380, C7M)
1196   MCFG_LEGACY_SCSI_PORT("scsi")
1197   MCFG_NCR5380_IRQ_CB(WRITELINE(mac_state, mac_scsi_irq))
1198
11901199   MCFG_IWM_ADD("fdc", mac_iwm_interface)
11911200   MCFG_LEGACY_FLOPPY_SONY_2_DRIVES_ADD(mac_floppy_interface)
11921201
r29632r29633
14241433
14251434   /* devices */
14261435   MCFG_RTC3430042_ADD("rtc", XTAL_32_768kHz)
1427   MCFG_SCSIBUS_ADD("scsi")
1428   MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_6)
1429   MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_5)
1430   MCFG_DEVICE_ADD("scsi:ncr5380", NCR5380, C7M)
1431   MCFG_NCR5380_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, mac_state, mac_scsi_irq))
14321436
1437   MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
1438   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_6)
1439   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_5)
1440
1441   MCFG_DEVICE_ADD("ncr5380", NCR5380, C7M)
1442   MCFG_LEGACY_SCSI_PORT("scsi")
1443   MCFG_NCR5380_IRQ_CB(WRITELINE(mac_state, mac_scsi_irq))
1444
14331445   MCFG_NUBUS_BUS_ADD("pds", "maincpu", nubus_intf)
14341446   MCFG_NUBUS_SLOT_ADD("pds","pds030", mac_pds030_cards, NULL)
14351447
r29632r29633
14901502   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
14911503
14921504   /* devices */
1493   MCFG_SCSIBUS_ADD("scsi")
1494   MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_6)
1495   MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_5)
1496   MCFG_DEVICE_ADD("scsi:ncr5380", NCR5380, C7M)
1497   MCFG_NCR5380_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, mac_state, mac_scsi_irq))
1505   MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
1506   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_6)
1507   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_5)
14981508
1509   MCFG_DEVICE_ADD("ncr5380", NCR5380, C7M)
1510   MCFG_LEGACY_SCSI_PORT("scsi")
1511   MCFG_NCR5380_IRQ_CB(WRITELINE(mac_state, mac_scsi_irq))
1512
14991513   MCFG_SWIM_ADD("fdc", mac_iwm_interface)
15001514   MCFG_LEGACY_FLOPPY_SONY_2_DRIVES_ADD(mac_floppy_interface)
15011515
r29632r29633
15731587   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
15741588
15751589   /* devices */
1576   MCFG_SCSIBUS_ADD("scsi")
1577   MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_6)
1578   MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_5)
1579   MCFG_DEVICE_ADD("scsi:ncr5380", NCR5380, C7M)
1580   MCFG_NCR5380_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, mac_state, mac_scsi_irq))
1590   MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
1591   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_6)
1592   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_5)
15811593
1594   MCFG_DEVICE_ADD("ncr5380", NCR5380, C7M)
1595   MCFG_LEGACY_SCSI_PORT("scsi")
1596   MCFG_NCR5380_IRQ_CB(WRITELINE(mac_state, mac_scsi_irq))
1597
15821598   MCFG_SWIM_ADD("fdc", mac_iwm_interface)
15831599   MCFG_LEGACY_FLOPPY_SONY_2_DRIVES_ADD(mac_floppy_interface)
15841600
r29632r29633
17701786   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
17711787
17721788   /* devices */
1773   MCFG_SCSIBUS_ADD("scsi")
1774   MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_6)
1775   MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_5)
1776   MCFG_DEVICE_ADD("scsi:ncr5380", NCR5380, C7M)
1777   MCFG_NCR5380_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, mac_state, mac_scsi_irq))
1789   MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
1790   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_6)
1791   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_5)
17781792
1793   MCFG_DEVICE_ADD("ncr5380", NCR5380, C7M)
1794   MCFG_LEGACY_SCSI_PORT("scsi")
1795   MCFG_NCR5380_IRQ_CB(WRITELINE(mac_state, mac_scsi_irq))
1796
17791797   MCFG_IWM_ADD("fdc", mac_iwm_interface)
17801798   MCFG_LEGACY_FLOPPY_SONY_2_DRIVES_ADD(mac_floppy_interface)
17811799
r29632r29633
18591877   MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(mac_state,mac_via2_out_b))
18601878   MCFG_VIA6522_IRQ_HANDLER(WRITELINE(mac_state,mac_via2_irq))
18611879
1862   MCFG_SCSIBUS_ADD("scsi")
1863   MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_6)
1864   MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_5)
1880   MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
1881   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_6)
1882   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_5)
1883
18651884   MCFG_DEVICE_ADD(MAC_539X_1_TAG, NCR539X, C7M)
1866   MCFG_NCR539X_OUT_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, mac_state, irq_539x_1_w))
1867   MCFG_NCR539X_OUT_DRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, mac_state, drq_539x_1_w))
1868   
1885   MCFG_LEGACY_SCSI_PORT("scsi")
1886   MCFG_NCR539X_OUT_IRQ_CB(WRITELINE(mac_state, irq_539x_1_w))
1887   MCFG_NCR539X_OUT_DRQ_CB(WRITELINE(mac_state, drq_539x_1_w))
1888
18691889   /* internal ram */
18701890   MCFG_RAM_ADD(RAM_TAG)
18711891   MCFG_RAM_DEFAULT_SIZE("4M")
trunk/src/mess/drivers/bebox.c
r29632r29633
2424#include "machine/idectrl.h"
2525#include "bus/pci/mpc105.h"
2626#include "machine/intelfsh.h"
27#include "machine/scsibus.h"
27#include "bus/scsi/scsi.h"
2828#include "machine/53c810.h"
2929
3030/* Devices */
31#include "machine/scsicd.h"
32#include "machine/scsihd.h"
31#include "bus/scsi/scsicd.h"
32#include "bus/scsi/scsihd.h"
3333#include "formats/pc_dsk.h"
3434#include "machine/ram.h"
3535#include "machine/8042kbdc.h"
r29632r29633
188188
189189   MCFG_FUJITSU_29F016A_ADD("flash")
190190
191   MCFG_SCSIBUS_ADD("scsi")
192   MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_0)
193   MCFG_SCSIDEV_ADD("scsi:cdrom", SCSICD, SCSI_ID_3)
191   MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
192   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
193   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "cdrom", SCSICD, SCSI_ID_3)
194
194195   MCFG_DEVICE_ADD("scsi:lsi53c810", LSI53C810, 0)
195196   MCFG_LSI53C810_IRQ_CB(bebox_state, scsi_irq_callback)
196197   MCFG_LSI53C810_DMA_CB(bebox_state, scsi_dma_callback)
197198   MCFG_LSI53C810_FETCH_CB(bebox_state, scsi_fetch)
199   MCFG_LEGACY_SCSI_PORT("scsi")
198200
199201   MCFG_IDE_CONTROLLER_ADD( "ide", ata_devices, "hdd", NULL, false ) /* FIXME */
200202   MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(bebox_state, bebox_ide_interrupt))
trunk/src/mess/drivers/rmnimbus.c
r29632r29633
1414#include "machine/ram.h"
1515#include "formats/pc_dsk.h"
1616#include "includes/rmnimbus.h"
17#include "machine/scsibus.h"
18#include "machine/scsicb.h"
19#include "machine/scsihd.h"
17#include "bus/scsi/scsihd.h"
2018#include "bus/scsi/s1410.h"
2119#include "bus/scsi/acb4070.h"
2220#include "machine/6522via.h"
r29632r29633
297295   MCFG_WD2793_ADD(FDC_TAG, nimbus_wd17xx_interface )
298296   MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(nimbus_floppy_interface)
299297
300   MCFG_SCSIBUS_ADD(SCSIBUS_TAG)
301   MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":harddisk0", SCSIHD, SCSI_ID_0)
302   MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":harddisk1", SCSIHD, SCSI_ID_1)
303   MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":harddisk2", ACB4070, SCSI_ID_2)
304   MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":harddisk3", S1410, SCSI_ID_3)
305   MCFG_SCSICB_ADD(SCSIBUS_TAG ":host")
306   MCFG_SCSICB_BSY_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, rmnimbus_state, nimbus_scsi_bsy_w))
307   MCFG_SCSICB_CD_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, rmnimbus_state, nimbus_scsi_cd_w))
308   MCFG_SCSICB_IO_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, rmnimbus_state, nimbus_scsi_io_w))
309   MCFG_SCSICB_MSG_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, rmnimbus_state, nimbus_scsi_msg_w))
310   MCFG_SCSICB_REQ_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, rmnimbus_state, nimbus_scsi_req_w))
298   MCFG_DEVICE_ADD(SCSIBUS_TAG, SCSI_PORT, 0)
299   MCFG_SCSI_DATA_INPUT_BUFFER("scsi_data_in")
300   MCFG_SCSI_MSG_HANDLER(WRITELINE(rmnimbus_state, write_scsi_msg))
301   MCFG_SCSI_BSY_HANDLER(WRITELINE(rmnimbus_state, write_scsi_bsy))
302   MCFG_SCSI_IO_HANDLER(WRITELINE(rmnimbus_state, write_scsi_io))
303   MCFG_SCSI_CD_HANDLER(WRITELINE(rmnimbus_state, write_scsi_cd))
304   MCFG_SCSI_REQ_HANDLER(WRITELINE(rmnimbus_state, write_scsi_req))
311305
306   MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
307   MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_1)
308   MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":" SCSI_PORT_DEVICE3, "harddisk", ACB4070, SCSI_ID_2)
309   MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":" SCSI_PORT_DEVICE4, "harddisk", S1410, SCSI_ID_3)
310
311   MCFG_SCSI_OUTPUT_LATCH_ADD("scsi_data_out", SCSIBUS_TAG)
312   MCFG_DEVICE_ADD("scsi_data_in", INPUT_BUFFER, 0)
313
314   MCFG_DEVICE_ADD("scsi_ctrl_out", OUTPUT_LATCH, 0)
315   MCFG_OUTPUT_LATCH_BIT0_HANDLER(DEVWRITELINE(SCSIBUS_TAG, SCSI_PORT_DEVICE, write_rst))
316   MCFG_OUTPUT_LATCH_BIT1_HANDLER(DEVWRITELINE(SCSIBUS_TAG, SCSI_PORT_DEVICE, write_sel))
317   MCFG_OUTPUT_LATCH_BIT2_HANDLER(WRITELINE(rmnimbus_state, write_scsi_iena))
318
312319   MCFG_RAM_ADD(RAM_TAG)
313320   MCFG_RAM_DEFAULT_SIZE("1536K")
314321   MCFG_RAM_EXTRA_OPTIONS("128K,256K,384K,512K,640K,1024K")
trunk/src/mess/drivers/fmtowns.c
r29632r29633
173173*/
174174
175175#include "includes/fmtowns.h"
176#include "machine/scsibus.h"
177#include "machine/scsihd.h"
176#include "bus/scsi/scsi.h"
177#include "bus/scsi/scsihd.h"
178178
179179// CD controller IRQ types
180180#define TOWNS_CD_IRQ_MPU 1
r29632r29633
22532253   // Keyboard (8042 MCU)
22542254   AM_RANGE(0x0600,0x0607) AM_READWRITE8(towns_keyboard_r, towns_keyboard_w,0x00ff00ff)
22552255   // SCSI controller
2256   AM_RANGE(0x0c30,0x0c37) AM_DEVREADWRITE8("scsi:fm",fmscsi_device,fmscsi_r,fmscsi_w,0x00ff00ff)
2256   AM_RANGE(0x0c30,0x0c37) AM_DEVREADWRITE8("fmscsi",fmscsi_device,fmscsi_r,fmscsi_w,0x00ff00ff)
22572257   // CMOS
22582258   AM_RANGE(0x3000,0x4fff) AM_READWRITE8(towns_cmos_r, towns_cmos_w,0x00ff00ff)
22592259   // Something (MS-DOS wants this 0x41ff to be 1)
r29632r29633
23052305   // Keyboard (8042 MCU)
23062306   AM_RANGE(0x0600,0x0607) AM_READWRITE8(towns_keyboard_r, towns_keyboard_w,0x00ff)
23072307   // SCSI controller
2308   AM_RANGE(0x0c30,0x0c37) AM_DEVREADWRITE8("scsi:fm",fmscsi_device,fmscsi_r,fmscsi_w,0x00ff)
2308   AM_RANGE(0x0c30,0x0c37) AM_DEVREADWRITE8("fmscsi",fmscsi_device,fmscsi_r,fmscsi_w,0x00ff)
23092309   // CMOS
23102310   AM_RANGE(0x3000,0x4fff) AM_READWRITE8(towns_cmos_r, towns_cmos_w,0x00ff)
23112311   // Something (MS-DOS wants this 0x41ff to be 1)
r29632r29633
26142614   m_messram = m_ram;
26152615   m_cdrom = machine().device<cdrom_image_device>("cdrom");
26162616   m_cdda = machine().device<cdda_device>("cdda");
2617   m_scsi = machine().device<fmscsi_device>("scsi:fm");
2617   m_scsi = machine().device<fmscsi_device>("fmscsi");
26182618   m_ftimer = 0x00;
26192619   m_freerun_timer = 0x00;
26202620   m_nmi_mask = 0x00;
r29632r29633
27592759
27602760   MCFG_CDROM_ADD("cdrom",towns_cdrom)
27612761
2762   MCFG_SCSIBUS_ADD("scsi")
2763   MCFG_SCSIDEV_ADD("scsi:harddisk0", SCSIHD, SCSI_ID_0)
2764   MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_1)
2765   MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_2)
2766   MCFG_SCSIDEV_ADD("scsi:harddisk3", SCSIHD, SCSI_ID_3)
2767   MCFG_SCSIDEV_ADD("scsi:harddisk4", SCSIHD, SCSI_ID_4)
2768   MCFG_FMSCSI_ADD("scsi:fm")
2769   MCFG_FMSCSI_IRQ_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, towns_state, towns_scsi_irq))
2770   MCFG_FMSCSI_DRQ_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, towns_state, towns_scsi_drq))
2762   MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
2763   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
2764   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_1)
2765   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE3, "harddisk", SCSIHD, SCSI_ID_2)
2766   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE4, "harddisk", SCSIHD, SCSI_ID_3)
2767   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE5, "harddisk", SCSIHD, SCSI_ID_4)
27712768
2769   MCFG_FMSCSI_ADD("fmscsi")
2770   MCFG_LEGACY_SCSI_PORT("scsi")
2771   MCFG_FMSCSI_IRQ_HANDLER(WRITELINE(towns_state, towns_scsi_irq))
2772   MCFG_FMSCSI_DRQ_HANDLER(WRITELINE(towns_state, towns_scsi_drq))
2773
27722774   MCFG_UPD71071_ADD("dma_1",towns_dma_config)
27732775   MCFG_UPD71071_ADD("dma_2",towns_dma_config)
27742776
trunk/src/mess/drivers/v1050.c
r29632r29633
388388
389389WRITE8_MEMBER( v1050_state::sasi_data_w )
390390{
391   data_out = data;
391   m_sasi_data = data;
392392
393   if( !m_sasibus->scsi_io_r() )
393   if (m_sasi_data_enable)
394394   {
395      m_sasibus->scsi_data_w( data );
395      m_sasi_data_out->write(m_sasi_data);
396396   }
397397}
398398
399WRITE_LINE_MEMBER( v1050_state::sasi_io_w )
399WRITE_LINE_MEMBER( v1050_state::write_sasi_io )
400400{
401   if( !state )
401   m_sasi_ctrl_in->write_bit4(state);
402
403   m_sasi_data_enable = state;
404
405   if (m_sasi_data_enable)
402406   {
403      m_sasibus->scsi_data_w( data_out );
407      m_sasi_data_out->write(m_sasi_data);
404408   }
405409   else
406410   {
407      m_sasibus->scsi_data_w( 0 );
411      m_sasi_data_out->write(0);
408412   }
409413}
410414
411READ8_MEMBER( v1050_state::sasi_status_r )
412{
413   /*
414
415       bit     description
416
417       0       REQ-
418       1       BUSY
419       2       MESSAGE
420       3       C/D-
421       4       I-/O
422       5
423       6
424       7
425
426   */
427
428   UINT8 data = 0;
429
430   data |= !m_sasibus->scsi_req_r();
431   data |= m_sasibus->scsi_bsy_r() << 1;
432   data |= m_sasibus->scsi_msg_r() << 2;
433   data |= m_sasibus->scsi_cd_r() << 3;
434   data |= !m_sasibus->scsi_io_r() << 4;
435
436   return data;
437}
438
439415TIMER_DEVICE_CALLBACK_MEMBER(v1050_state::sasi_ack_tick)
440416{
441   m_sasibus->scsi_ack_w(0);
417   m_sasibus->write_ack(0);
442418}
443419
444420TIMER_DEVICE_CALLBACK_MEMBER(v1050_state::sasi_rst_tick)
445421{
446   m_sasibus->scsi_rst_w(0);
422   m_sasibus->write_rst(0);
447423}
448424
449425WRITE8_MEMBER( v1050_state::sasi_ctrl_w )
r29632r29633
463439
464440   */
465441
466   m_sasibus->scsi_sel_w(BIT(data, 0));
442   m_sasibus->write_sel(BIT(data, 0));
467443
468444   if (BIT(data, 1))
469445   {
470446      // send acknowledge pulse
471      m_sasibus->scsi_ack_w(1);
447      m_sasibus->write_ack(1);
472448
473449      m_timer_ack->adjust(attotime::from_nsec(100));
474450   }
r29632r29633
476452   if (BIT(data, 7))
477453   {
478454      // send reset pulse
479      m_sasibus->scsi_rst_w(1);
455      m_sasibus->write_rst(1);
480456
481457      m_timer_rst->adjust(attotime::from_nsec(100));
482458   }
r29632r29633
510486   AM_RANGE(0xb0, 0xb0) AM_READWRITE(dint_clr_r, dint_clr_w)
511487   AM_RANGE(0xc0, 0xc0) AM_WRITE(v1050_i8214_w)
512488   AM_RANGE(0xd0, 0xd0) AM_WRITE(bank_w)
513   AM_RANGE(0xe0, 0xe0) AM_WRITE(sasi_data_w) AM_DEVREAD(SASIBUS_TAG ":host", scsicb_device, scsi_data_r)
514   AM_RANGE(0xe1, 0xe1) AM_READWRITE(sasi_status_r, sasi_ctrl_w)
489   AM_RANGE(0xe0, 0xe0) AM_WRITE(sasi_data_w) AM_DEVREAD("scsi_data_in", input_buffer_device, read)
490   AM_RANGE(0xe1, 0xe1) AM_DEVREAD("scsi_ctrl_in", input_buffer_device, read) AM_WRITE(sasi_ctrl_w)
515491ADDRESS_MAP_END
516492
517493static ADDRESS_MAP_START( v1050_crt_mem, AS_PROGRAM, 8, v1050_state )
r29632r29633
11571133   MCFG_FLOPPY_DRIVE_ADD(MB8877_TAG":3", v1050_floppies, NULL,    floppy_image_device::default_floppy_formats)
11581134
11591135   // SASI bus
1160   MCFG_SCSIBUS_ADD(SASIBUS_TAG)
1161   MCFG_SCSIDEV_ADD(SASIBUS_TAG ":harddisk0", S1410, SCSI_ID_0)
1162   MCFG_SCSICB_ADD(SASIBUS_TAG ":host")
1163   MCFG_SCSICB_IO_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, v1050_state, sasi_io_w))
1136   MCFG_DEVICE_ADD(SASIBUS_TAG, SCSI_PORT, 0)
1137   MCFG_SCSI_DATA_INPUT_BUFFER("scsi_data_in")
1138   MCFG_SCSI_REQ_HANDLER(DEVWRITELINE("scsi_ctrl_in", input_buffer_device, write_bit0)) MCFG_DEVCB_XOR(1)
1139   MCFG_SCSI_BSY_HANDLER(DEVWRITELINE("scsi_ctrl_in", input_buffer_device, write_bit1))
1140   MCFG_SCSI_MSG_HANDLER(DEVWRITELINE("scsi_ctrl_in", input_buffer_device, write_bit2))
1141   MCFG_SCSI_CD_HANDLER(DEVWRITELINE("scsi_ctrl_in", input_buffer_device, write_bit3))
1142   MCFG_SCSI_IO_HANDLER(WRITELINE(v1050_state, write_sasi_io)) MCFG_DEVCB_XOR(1) // bit4
1143   MCFG_SCSIDEV_ADD(SASIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", S1410, SCSI_ID_0)
11641144
1145   MCFG_SCSI_OUTPUT_LATCH_ADD("scsi_data_out", SASIBUS_TAG)
1146   MCFG_DEVICE_ADD("scsi_data_in", INPUT_BUFFER, 0)
1147   MCFG_DEVICE_ADD("scsi_ctrl_in", INPUT_BUFFER, 0)
1148
11651149   MCFG_TIMER_DRIVER_ADD(TIMER_ACK_TAG, v1050_state, sasi_ack_tick)
11661150   MCFG_TIMER_DRIVER_ADD(TIMER_RST_TAG, v1050_state, sasi_rst_tick)
11671151
trunk/src/mess/drivers/pc9801.c
r29632r29633
400400#include "machine/i8251.h"
401401
402402#include "bus/scsi/s1410.h"
403#include "machine/scsibus.h"
404#include "machine/scsicb.h"
405#include "machine/scsihd.h"
403#include "bus/scsi/scsi.h"
404#include "bus/scsi/scsihd.h"
405#include "machine/buffer.h"
406#include "machine/latch.h"
406407
407408#include "sound/beep.h"
408409#include "sound/speaker.h"
r29632r29633
445446      m_sio(*this, UPD8251_TAG),
446447      m_hgdc1(*this, "upd7220_chr"),
447448      m_hgdc2(*this, "upd7220_btm"),
448      m_sasibus(*this, SASIBUS_TAG ":host"),
449      m_sasibus(*this, SASIBUS_TAG),
450      m_sasi_data_out(*this, "sasi_data_out"),
451      m_sasi_data_in(*this, "sasi_data_in"),
452      m_sasi_ctrl_in(*this, "sasi_ctrl_in"),
449453      m_ide(*this, "ide"),
450454      m_video_ram_1(*this, "video_ram_1"),
451455      m_video_ram_2(*this, "video_ram_2"),
r29632r29633
468472   required_device<i8251_device> m_sio;
469473   required_device<upd7220_device> m_hgdc1;
470474   required_device<upd7220_device> m_hgdc2;
471   optional_device<scsicb_device> m_sasibus;
475   optional_device<SCSI_PORT_DEVICE> m_sasibus;
476   optional_device<output_latch_device> m_sasi_data_out;
477   optional_device<input_buffer_device> m_sasi_data_in;
478   optional_device<input_buffer_device> m_sasi_ctrl_in;
472479   optional_device<ata_interface_device> m_ide;
473480   required_shared_ptr<UINT8> m_video_ram_1;
474481   required_shared_ptr<UINT8> m_video_ram_2;
r29632r29633
590597   UINT32 pc9801_286_a20(bool state);
591598
592599   DECLARE_WRITE8_MEMBER(sasi_data_w);
593   DECLARE_WRITE_LINE_MEMBER(sasi_io_w);
594   DECLARE_READ8_MEMBER( sasi_status_r );
595   DECLARE_WRITE8_MEMBER( sasi_ctrl_w );
600   DECLARE_WRITE_LINE_MEMBER(write_sasi_io);
601   DECLARE_READ8_MEMBER(sasi_status_r);
602   DECLARE_WRITE8_MEMBER(sasi_ctrl_w);
596603
597   struct{
598      UINT8 data_out;
599      UINT8 ctrl;
600   }m_sasi;
604   UINT8 m_sasi_data;
605   int m_sasi_data_enable;
606   UINT8 m_sasi_ctrl;
601607
602608   DECLARE_READ8_MEMBER(pc9801rs_wram_r);
603609   DECLARE_WRITE8_MEMBER(pc9801rs_wram_w);
r29632r29633
17231729
17241730WRITE8_MEMBER( pc9801_state::sasi_data_w )
17251731{
1726   m_sasi.data_out = data;
1732   m_sasi_data = data;
17271733
1728   if( !m_sasibus->scsi_io_r() )
1734   if (m_sasi_data_enable)
17291735   {
1730      m_sasibus->scsi_data_w( data );
1736      m_sasi_data_out->write(m_sasi_data);
17311737   }
17321738}
17331739
1734WRITE_LINE_MEMBER( pc9801_state::sasi_io_w )
1740WRITE_LINE_MEMBER( pc9801_state::write_sasi_io )
17351741{
1736   if( !state )
1742   m_sasi_ctrl_in->write_bit2(state);
1743
1744   m_sasi_data_enable = !state;
1745
1746   if (m_sasi_data_enable)
17371747   {
1738      m_sasibus->scsi_data_w( m_sasi.data_out );
1748      m_sasi_data_out->write(m_sasi_data);
17391749   }
17401750   else
17411751   {
1742      m_sasibus->scsi_data_w( 0 );
1752      m_sasi_data_out->write(0);
17431753   }
17441754}
17451755
r29632r29633
17491759{
17501760   UINT8 res = 0;
17511761
1752   if(m_sasi.ctrl & 0x40) // read status
1762   if(m_sasi_ctrl & 0x40) // read status
17531763   {
17541764   /*
17551765       x--- -.-- REQ
r29632r29633
17601770       ---- -x-- IO
17611771       ---- ---x INT?
17621772   */
1763//      res |= m_sasibus->scsi_cd_r() << 0;
1764      res |= m_sasibus->scsi_io_r() << 2;
1765      res |= m_sasibus->scsi_cd_r() << 3;
1766      res |= m_sasibus->scsi_msg_r() << 4;
1767      res |= m_sasibus->scsi_bsy_r() << 5;
1768      res |= m_sasibus->scsi_ack_r() << 6;
1769      res |= m_sasibus->scsi_req_r() << 7;
1773      res |= m_sasi_ctrl_in->read();
17701774   }
17711775   else // read drive info
17721776   {
r29632r29633
17931797       ---- ---x irq enable
17941798   */
17951799
1796   m_sasibus->scsi_sel_w(BIT(data, 5));
1800   m_sasibus->write_sel(BIT(data, 5));
17971801
1798   if(m_sasi.ctrl & 8 && ((data & 8) == 0)) // 1 -> 0 transition
1802   if(m_sasi_ctrl & 8 && ((data & 8) == 0)) // 1 -> 0 transition
17991803   {
1800      m_sasibus->scsi_rst_w(1);
1804      m_sasibus->write_rst(1);
18011805//      m_timer_rst->adjust(attotime::from_nsec(100));
18021806   }
18031807   else
1804      m_sasibus->scsi_rst_w(0); // TODO
1808      m_sasibus->write_rst(0); // TODO
18051809
1806   m_sasi.ctrl = data;
1810   m_sasi_ctrl = data;
18071811
1808//  m_sasibus->scsi_sel_w(BIT(data, 0));
1812//  m_sasibus->write_sel(BIT(data, 0));
18091813}
18101814
18111815static ADDRESS_MAP_START( pc9801_map, AS_PROGRAM, 16, pc9801_state )
r29632r29633
18321836//  AM_RANGE(0x006c, 0x006f) border color / <undefined>
18331837   AM_RANGE(0x0070, 0x007b) AM_READWRITE8(pc9801_70_r,pc9801_70_w,0xffff) //display registers / i8253 pit
18341838//  AM_RANGE(0x0080, 0x0083) AM_READWRITE8(pc9801_sasi_r,pc9801_sasi_w,0xffff) //HDD SASI interface / <undefined>
1835   AM_RANGE(0x0080, 0x0081) AM_DEVREAD8(SASIBUS_TAG ":host", scsicb_device, scsi_data_r, 0x00ff) AM_WRITE8(sasi_data_w, 0x00ff)
1839   AM_RANGE(0x0080, 0x0081) AM_DEVREAD8("scsi_data_in", input_buffer_device, read, 0x00ff) AM_WRITE8(sasi_data_w, 0x00ff)
18361840   AM_RANGE(0x0082, 0x0083) AM_READWRITE8(sasi_status_r, sasi_ctrl_w,0x00ff)
18371841   AM_RANGE(0x0090, 0x0097) AM_READWRITE8(pc9801_fdc_2hd_r,pc9801_fdc_2hd_w,0xffff) //upd765a 2hd / cmt
18381842   AM_RANGE(0x00a0, 0x00af) AM_READWRITE8(pc9801_a0_r,pc9801_a0_w,0xffff) //upd7220 bitmap ports / display registers
r29632r29633
33783382
33793383   m_ipl_rom = memregion("ipl")->base();
33803384   m_sound_bios = memregion("sound_bios")->base();
3385
3386   save_item(NAME(m_sasi_data));
3387   save_item(NAME(m_sasi_data_enable));
3388   save_item(NAME(m_sasi_ctrl));
33813389}
33823390
33833391MACHINE_START_MEMBER(pc9801_state,pc9801f)
r29632r29633
35833591MACHINE_CONFIG_END
35843592
35853593static MACHINE_CONFIG_FRAGMENT( pc9801_sasi )
3586   MCFG_SCSIBUS_ADD(SASIBUS_TAG)
3587   MCFG_SCSIDEV_ADD(SASIBUS_TAG ":harddisk0", S1410, SCSI_ID_0) // TODO: correct one, perhaps ttl
3588   MCFG_SCSICB_ADD(SASIBUS_TAG ":host")
3589   MCFG_SCSICB_IO_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, pc9801_state, sasi_io_w))
3594   MCFG_DEVICE_ADD(SASIBUS_TAG, SCSI_PORT, 0)
3595   MCFG_SCSI_DATA_INPUT_BUFFER("sasi_data_in")
3596   MCFG_SCSI_IO_HANDLER(WRITELINE(pc9801_state, write_sasi_io)) // bit2
3597   MCFG_SCSI_CD_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit3))
3598   MCFG_SCSI_MSG_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit4))
3599   MCFG_SCSI_BSY_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit5))
3600   MCFG_SCSI_ACK_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit6))
3601   MCFG_SCSI_REQ_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit7))
3602
3603   MCFG_SCSIDEV_ADD(SASIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", S1410, SCSI_ID_0) // TODO: correct one, perhaps ttl
3604
3605   MCFG_SCSI_OUTPUT_LATCH_ADD("sasi_data_out", SASIBUS_TAG)
3606   MCFG_DEVICE_ADD("sasi_data_in", INPUT_BUFFER, 0)
3607   MCFG_DEVICE_ADD("sasi_ctrl_in", INPUT_BUFFER, 0)
35903608MACHINE_CONFIG_END
35913609
35923610
trunk/src/mess/drivers/ip20.c
r29632r29633
2121#include "machine/8530scc.h"
2222#include "machine/sgi.h"
2323#include "machine/eepromser.h"
24#include "machine/scsibus.h"
25#include "machine/scsicd.h"
24#include "bus/scsi/scsi.h"
25#include "bus/scsi/scsicd.h"
2626#include "machine/wd33c93.h"
2727
2828struct HPC_t
r29632r29633
5151      TIMER_RTC
5252   };
5353
54   ip20_state(const machine_config &mconfig, device_type type, const char *tag)
55      : driver_device(mconfig, type, tag),
56   m_wd33c93(*this, "scsi:wd33c93"),
57   m_scc(*this, "scc"),
58   m_eeprom(*this, "eeprom"),
59   m_maincpu(*this, "maincpu") { }
54   ip20_state(const machine_config &mconfig, device_type type, const char *tag) :
55      driver_device(mconfig, type, tag),
56      m_wd33c93(*this, "wd33c93"),
57      m_scc(*this, "scc"),
58      m_eeprom(*this, "eeprom"),
59      m_maincpu(*this, "maincpu")
60   {
61   }
6062
61
6263   HPC_t m_HPC;
6364   RTC_t m_RTC;
6465   DECLARE_READ32_MEMBER(hpc_r);
r29632r29633
580581};
581582#endif
582583
584static MACHINE_CONFIG_FRAGMENT( cdrom_config )
585   MCFG_DEVICE_MODIFY( "cdda" )
586   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "^^^^mono", 1.0)
587MACHINE_CONFIG_END
588
583589static MACHINE_CONFIG_START( ip204415, ip20_state )
584590   MCFG_CPU_ADD( "maincpu", R4600BE, 50000000*3 )
585591   MCFG_CPU_CONFIG( config )
r29632r29633
604610
605611   MCFG_DEVICE_ADD("sgi_mc", SGI_MC, 0)
606612
607   MCFG_SCSIBUS_ADD("scsi")
608   MCFG_SCSIDEV_ADD("scsi:cdrom", SCSICD, SCSI_ID_6)
609   MCFG_DEVICE_ADD("scsi:wd33c93", WD33C93, 0)
610   MCFG_WD33C93_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, ip20_state, scsi_irq))      /* command completion IRQ */
613   MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
614   MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "cdrom", SCSICD, SCSI_ID_6)
615   MCFG_SLOT_OPTION_MACHINE_CONFIG("cdrom", cdrom_config)
611616
612   MCFG_SOUND_MODIFY( "scsi:cdrom:cdda" )
613   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "^^^mono", 1.0)
617   MCFG_DEVICE_ADD("wd33c93", WD33C93, 0)
618   MCFG_LEGACY_SCSI_PORT("scsi")
619   MCFG_WD33C93_IRQ_CB(WRITELINE(ip20_state, scsi_irq))      /* command completion IRQ */
614620
615621   MCFG_EEPROM_SERIAL_93C56_ADD("eeprom")
616622MACHINE_CONFIG_END
trunk/src/mess/mess.mak
r29632r29633
469469MACHINES += S3C2440
470470MACHINES += S3C44B0
471471MACHINES += SATURN
472MACHINES += SCSI
473472MACHINES += SCUDSP
474473MACHINES += SECFLASH
475474MACHINES += SEIBU_COP
trunk/src/mess/machine/rmnimbus.c
r29632r29633
6565#include "machine/pit8253.h"
6666#include "machine/i8251.h"
6767#include "machine/6522via.h"
68#include "machine/scsibus.h"
68#include "bus/scsi/scsi.h"
6969
7070#include "includes/rmnimbus.h"
7171
r29632r29633
22052205   wd2793_device *fdc = machine().device<wd2793_device>(FDC_TAG);
22062206
22072207   m_nimbus_drives.reg400=0;
2208   m_nimbus_drives.reg410_in=0;
2209   m_nimbus_drives.reg410_out=0;
2208   m_scsi_ctrl_out->write(0);
22102209   m_nimbus_drives.int_ff=0;
22112210   fdc->set_pause_time(FDC_PAUSE);
22122211}
r29632r29633
22922291         result = fdc->data_r(space, 0);
22932292         break;
22942293      case 0x10 :
2295         m_nimbus_drives.reg410_in &= ~FDC_BITS_410;
2296         m_nimbus_drives.reg410_in |= (FDC_MOTOR() ? FDC_MOTOR_MASKI : 0x00);
2297         m_nimbus_drives.reg410_in |= (drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_INDEX) ? 0x00 : FDC_INDEX_MASK);
2298         m_nimbus_drives.reg410_in |= (drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY) ? FDC_READY_MASK : 0x00);
2299
2300         // Flip inverted bits
2301         result=m_nimbus_drives.reg410_in ^ INV_BITS_410;
2294         result |= !m_scsi_req << 7;
2295         result |= !m_scsi_cd << 6;
2296         result |= !m_scsi_io << 5;
2297         result |= !m_scsi_bsy << 4;
2298         result |= m_scsi_msg << 3;
2299         result |= FDC_MOTOR() << 2;
2300         result |= !drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_INDEX) << 1;
2301         result |= drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY) << 0;
23022302         break;
23032303      case 0x18 :
2304         result = m_scsibus->scsi_data_r();
2304         result = m_scsi_data_in->read();
23052305         hdc_post_rw();
23062306      default:
23072307         break;
r29632r29633
23752375         fdc->data_w(space, 0, data);
23762376         break;
23772377      case 0x10 :
2378         hdc_ctrl_write(data);
2378         m_scsi_ctrl_out->write(data);
23792379         break;
23802380
23812381      case 0x18 :
2382         m_scsibus->scsi_data_w(data);
2382         m_scsi_data_out->write(data);
23832383         hdc_post_rw();
23842384         break;
23852385   }
r29632r29633
23872387
23882388void rmnimbus_state::hdc_reset()
23892389{
2390   m_nimbus_drives.reg410_in=0;
2391   m_nimbus_drives.reg410_in |= (m_scsibus->scsi_req_r() ? 0 : HDC_REQ_MASK);
2392   m_nimbus_drives.reg410_in |= (m_scsibus->scsi_cd_r()  ? 0 : HDC_CD_MASK);
2393   m_nimbus_drives.reg410_in |= (m_scsibus->scsi_io_r()  ? 0 : HDC_IO_MASK);
2394   m_nimbus_drives.reg410_in |= (m_scsibus->scsi_bsy_r() ? 0 : HDC_BSY_MASK);
2395   m_nimbus_drives.reg410_in |= (m_scsibus->scsi_msg_r() ? 0 : HDC_MSG_MASK);
2396
23972390   m_nimbus_drives.drq_ff=0;
23982391}
23992392
2400void rmnimbus_state::hdc_ctrl_write(UINT8 data)
2393WRITE_LINE_MEMBER(rmnimbus_state::write_scsi_iena)
24012394{
2395   int last = m_scsi_iena;
2396   m_scsi_iena = state;
2397
24022398   // If we enable the HDC interupt, and an interrupt is pending, go deal with it.
2403   if(((data & HDC_IRQ_MASK) && (~m_nimbus_drives.reg410_out & HDC_IRQ_MASK)) &&
2404      ((~m_nimbus_drives.reg410_in & HDC_INT_TRIGGER)==HDC_INT_TRIGGER))
2399   if (m_scsi_iena && !last && !m_scsi_io && !m_scsi_cd && !m_scsi_req)
24052400      set_disk_int(1);
2406
2407   m_nimbus_drives.reg410_out=data;
2408
2409   m_scsibus->scsi_rst_w((data & HDC_RESET_MASK) ? 1 : 0);
2410   m_scsibus->scsi_sel_w((data & HDC_SEL_MASK) ? 1 : 0);
24112401}
24122402
24132403void rmnimbus_state::hdc_post_rw()
24142404{
2415   if((m_nimbus_drives.reg410_in & HDC_REQ_MASK)==0)
2416      m_scsibus->scsi_ack_w(1);
2405   if(!m_scsi_req)
2406      m_scsibus->write_ack(1);
24172407
24182408   m_nimbus_drives.drq_ff=0;
24192409}
r29632r29633
24262416   }
24272417}
24282418
2429WRITE_LINE_MEMBER( rmnimbus_state::nimbus_scsi_bsy_w )
2419WRITE_LINE_MEMBER( rmnimbus_state::write_scsi_bsy )
24302420{
2431   nimbus_scsi_linechange( HDC_BSY_MASK, state );
2421   m_scsi_bsy = state;
24322422}
24332423
2434WRITE_LINE_MEMBER( rmnimbus_state::nimbus_scsi_cd_w )
2424WRITE_LINE_MEMBER( rmnimbus_state::write_scsi_cd )
24352425{
2436   nimbus_scsi_linechange( HDC_CD_MASK, state );
2426   m_scsi_cd = state;
24372427}
24382428
2439WRITE_LINE_MEMBER( rmnimbus_state::nimbus_scsi_io_w )
2429WRITE_LINE_MEMBER( rmnimbus_state::write_scsi_io )
24402430{
2441   nimbus_scsi_linechange( HDC_IO_MASK, state );
2442}
2431   m_scsi_io = state;
24432432
2444WRITE_LINE_MEMBER( rmnimbus_state::nimbus_scsi_msg_w )
2445{
2446   nimbus_scsi_linechange( HDC_MSG_MASK, state );
2433   if (m_scsi_io)
2434   {
2435      m_scsi_data_out->write(0);
2436   }
24472437}
24482438
2449WRITE_LINE_MEMBER( rmnimbus_state::nimbus_scsi_req_w )
2439WRITE_LINE_MEMBER( rmnimbus_state::write_scsi_msg )
24502440{
2451   nimbus_scsi_linechange( HDC_REQ_MASK, state );
2441   m_scsi_msg = state;
24522442}
24532443
2454void rmnimbus_state::nimbus_scsi_linechange( UINT8 mask, UINT8 state )
2444WRITE_LINE_MEMBER( rmnimbus_state::write_scsi_req )
24552445{
2456   UINT8   last = 0;
2446   int last = m_scsi_req;
2447   m_scsi_req = state;
24572448
2458   last=m_nimbus_drives.reg410_in & mask;
2459
2460   if(!state)
2461      m_nimbus_drives.reg410_in|=mask;
2462   else
2463      m_nimbus_drives.reg410_in&=~mask;
2464
2465
2466   if(HDC_IRQ_ENABLED() && ((~m_nimbus_drives.reg410_in & HDC_INT_TRIGGER)==HDC_INT_TRIGGER))
2467      set_disk_int(1);
2468   else
2469      set_disk_int(0);
2470
2471   switch( mask )
2449   if (state)
24722450   {
2473   case HDC_REQ_MASK:
2474      if (state)
2451      if (m_scsi_cd && last)
24752452      {
2476         if(((m_nimbus_drives.reg410_in & HDC_CD_MASK)==HDC_CD_MASK) && (last!=0))
2477         {
2478            m_nimbus_drives.drq_ff=1;
2479            hdc_drq();
2480         }
2453         m_nimbus_drives.drq_ff=1;
2454         hdc_drq();
24812455      }
2482      else
2483      {
2484         m_scsibus->scsi_ack_w(0);
2485      }
2486      break;
2487
2488   case HDC_IO_MASK:
2489      if (state)
2490      {
2491         m_scsibus->scsi_data_w(0);
2492      }
2493      break;
24942456   }
2457   else
2458   {
2459      m_scsibus->write_ack(0);
2460   }
24952461}
24962462
24972463/* 8031/8051 Peripheral controler 80186 side */
trunk/src/mess/machine/fm_scsi.c
r29632r29633
3737 */
3838
3939fmscsi_device::fmscsi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
40   : device_t(mconfig, FMSCSI, "FM-SCSI", tag, owner, clock, "fmscsi", __FILE__),
40   : legacy_scsi_host_adapter(mconfig, FMSCSI, "FM-SCSI", tag, owner, clock, "fmscsi", __FILE__),
4141   m_irq_handler(*this),
4242   m_drq_handler(*this)
4343{
r29632r29633
5656   m_irq_handler.resolve_safe();
5757   m_drq_handler.resolve_safe();
5858
59   memset(m_SCSIdevices,0,sizeof(m_SCSIdevices));
60
61   // try to open the devices
62   for( device_t *device = owner()->first_subdevice(); device != NULL; device = device->next() )
63   {
64      scsihle_device *scsidev = dynamic_cast<scsihle_device *>(device);
65      if( scsidev != NULL )
66      {
67         m_SCSIdevices[scsidev->GetDeviceID()] = scsidev;
68      }
69   }
70
7159   // allocate read timer
7260   m_transfer_timer = timer_alloc(TIMER_TRANSFER);
7361   m_phase_timer = timer_alloc(TIMER_PHASE);
r29632r29633
133121      //logerror("FMSCSI: DATAIN phase read data %02x\n",m_data);
134122      m_result_index++;
135123      if(m_result_index % 512 == 0)
136         m_SCSIdevices[m_target]->ReadData(m_buffer,512);  // read next sector
124         read_data(m_buffer,512);  // read next sector
137125
138126      if(m_result_index >= m_result_length)
139127      {
r29632r29633
198186      m_buffer[m_result_index % 512] = m_data;
199187      m_result_index++;
200188      if(m_result_index % 512 == 0)
201         m_SCSIdevices[m_target]->WriteData(m_buffer,512);  // write buffer to disc
189         write_data(m_buffer,512);  // write buffer to disc
202190      if(m_result_index >= m_result_length)
203191      {
204192         // end of data transfer
r29632r29633
219207      if(m_command_index >= get_scsi_cmd_len(m_command[0]))
220208      {
221209         // command complete
222         m_SCSIdevices[m_target]->SetCommand(m_command,m_command_index);
223         m_SCSIdevices[m_target]->ExecCommand();
224         m_SCSIdevices[m_target]->GetLength(&m_result_length);
225         m_SCSIdevices[m_target]->GetPhase(&phase);
210         send_command(m_command,m_command_index);
211         m_result_length = get_length();
212         phase = get_phase();
226213         if(m_command[0] == 1)  // rezero unit command - not implemented in SCSI code
227214            m_phase_timer->adjust(attotime::from_usec(800),SCSI_PHASE_STATUS);
228215         else
r29632r29633
275262      set_input_line(FMSCSI_LINE_REQ,1);
276263      // start transfer timer
277264      m_transfer_timer->adjust(attotime::zero,0,attotime::from_hz(3000000));  // arbitrary value for now
278      m_SCSIdevices[m_target]->ReadData(m_buffer,512);
265      read_data(m_buffer,512);
279266      m_result_index = 0;
280267      logerror("FMSCSI: Starting transfer (%i)\n",m_result_length);
281268      break;
r29632r29633
356343   {
357344      if(state != 0 && !(m_output_lines & FMSCSI_LINE_SEL)) // low to high transition
358345      {
359         void *image;
360         m_SCSIdevices[m_target]->GetDevice(&image);
361         if (image != NULL)  // if device is mounted
346         if (select(m_target))
362347         {
363348            m_phase_timer->adjust(attotime::from_usec(800),SCSI_PHASE_COMMAND);
364349            m_data = 0x08;
trunk/src/mess/machine/fm_scsi.h
r29632r29633
88#ifndef FM_SCSI_H_
99#define FM_SCSI_H_
1010
11#include "machine/scsihle.h"
11#include "machine/legscsi.h"
1212
1313// SCSI input lines (from target)
1414#define FMSCSI_LINE_REQ   0x80
r29632r29633
3737   devcb = &fmscsi_device::set_irq_handler(*device, DEVCB2_##_devcb);
3838#define MCFG_FMSCSI_DRQ_HANDLER(_devcb) \
3939   devcb = &fmscsi_device::set_drq_handler(*device, DEVCB2_##_devcb);
40class fmscsi_device : public device_t
40
41class fmscsi_device : public legacy_scsi_host_adapter
4142{
4243public:
4344   // construction/destruction
r29632r29633
7879   devcb2_write_line m_irq_handler;
7980   devcb2_write_line m_drq_handler;
8081
81   scsihle_device* m_SCSIdevices[8];
8282   UINT8 m_command[32];
8383   //UINT8 m_result[32];
8484   UINT8 m_command_index;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team