trunk/src/emu/machine/wd33c93.c
r17438 | r17439 | |
781 | 781 | |
782 | 782 | void wd33c93_init( running_machine &machine, const struct WD33C93interface *interface ) |
783 | 783 | { |
784 | | int i; |
785 | | |
786 | 784 | // save interface pointer for later |
787 | 785 | intf = interface; |
788 | 786 | |
r17438 | r17439 | |
790 | 788 | memset(devices, 0, sizeof(devices)); |
791 | 789 | |
792 | 790 | // try to open the devices |
793 | | for (i = 0; i < interface->scsidevs->devs_present; i++) |
| 791 | for (int i = 0; i < interface->scsidevs->devs_present; i++) |
794 | 792 | { |
795 | 793 | scsidev_device *device = machine.device<scsidev_device>( interface->scsidevs->devices[i].tag ); |
796 | 794 | devices[device->GetDeviceID()] = device; |
trunk/src/emu/machine/ncr539x.c
r17438 | r17439 | |
149 | 149 | |
150 | 150 | void ncr539x_device::device_start() |
151 | 151 | { |
152 | | int i; |
153 | | |
154 | 152 | memset(m_scsi_devices, 0, sizeof(m_scsi_devices)); |
155 | 153 | |
156 | 154 | // resolve line callbacks |
r17438 | r17439 | |
158 | 156 | m_out_drq_func.resolve(m_out_drq_cb, *this); |
159 | 157 | |
160 | 158 | // try to open the devices |
161 | | for (i = 0; i < scsidevs->devs_present; i++) |
| 159 | for (int i = 0; i < scsidevs->devs_present; i++) |
162 | 160 | { |
163 | 161 | scsidev_device *device = machine().device<scsidev_device>( scsidevs->devices[i].tag ); |
164 | 162 | m_scsi_devices[device->GetDeviceID()] = device; |
r17438 | r17439 | |
192 | 190 | m_out_irq_func(CLEAR_LINE); |
193 | 191 | m_out_drq_func(CLEAR_LINE); |
194 | 192 | |
195 | | scan_devices(); |
| 193 | // try to open the devices |
| 194 | for (int i = 0; i < scsidevs->devs_present; i++) |
| 195 | { |
| 196 | scsidev_device *device = machine().device<scsidev_device>( scsidevs->devices[i].tag ); |
| 197 | m_scsi_devices[device->GetDeviceID()] = device; |
| 198 | } |
196 | 199 | } |
197 | 200 | |
198 | 201 | void ncr539x_device::dma_read_data(int bytes, UINT8 *pData) |
r17438 | r17439 | |
225 | 228 | } |
226 | 229 | } |
227 | 230 | |
228 | | void ncr539x_device::scan_devices() |
229 | | { |
230 | | int i; |
231 | | |
232 | | // try to open the devices |
233 | | for (i = 0; i < scsidevs->devs_present; i++) |
234 | | { |
235 | | scsidev_device *device = machine().device<scsidev_device>( scsidevs->devices[i].tag ); |
236 | | m_scsi_devices[device->GetDeviceID()] = device; |
237 | | } |
238 | | } |
239 | | |
240 | 231 | void ncr539x_device::device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr) |
241 | 232 | { |
242 | 233 | //printf("539X: device_timer expired, param = %d, m_command = %02x\n", param, m_command); |
trunk/src/mess/machine/fm_scsi.c
r17438 | r17439 | |
60 | 60 | |
61 | 61 | void fmscsi_device::device_start() |
62 | 62 | { |
63 | | int x; |
64 | | |
65 | 63 | m_input_lines = 0; |
66 | 64 | m_output_lines = 0; |
67 | 65 | m_data = 0; |
r17438 | r17439 | |
76 | 74 | memset(m_SCSIdevices,0,sizeof(m_SCSIdevices)); |
77 | 75 | |
78 | 76 | // initialise SCSI devices, if any present |
79 | | for(x=0;x<scsidevs->devs_present;x++) |
| 77 | for(int x=0;x<scsidevs->devs_present;x++) |
80 | 78 | { |
81 | 79 | scsidev_device *device = machine().device<scsidev_device>( scsidevs->devices[x].tag ); |
82 | 80 | m_SCSIdevices[device->GetDeviceID()] = device; |