trunk/src/emu/machine/wd33c93.c
r17474 | r17475 | |
744 | 744 | { |
745 | 745 | } |
746 | 746 | |
| 747 | void wd33c93_device::device_config_complete() |
| 748 | { |
| 749 | // inherit a copy of the static data |
| 750 | const WD33C93interface *intf = reinterpret_cast<const WD33C93interface *>(static_config()); |
| 751 | if (intf != NULL) |
| 752 | { |
| 753 | *static_cast<WD33C93interface *>(this) = *intf; |
| 754 | } |
| 755 | } |
| 756 | |
747 | 757 | void wd33c93_device::device_start() |
748 | 758 | { |
749 | 759 | memset(®s, 0, sizeof(regs)); |
r17474 | r17475 | |
772 | 782 | save_item( NAME( read_pending ) ); |
773 | 783 | } |
774 | 784 | |
775 | | void wd33c93_device::static_set_interface(device_t &device, const WD33C93interface &interface) |
776 | | { |
777 | | wd33c93_device &wd33c93 = downcast<wd33c93_device &>(device); |
778 | | static_cast<WD33C93interface &>(wd33c93) = interface; |
779 | | } |
780 | | |
781 | 785 | void wd33c93_device::get_dma_data( int bytes, UINT8 *pData ) |
782 | 786 | { |
783 | 787 | int len = bytes; |
trunk/src/emu/machine/wd33c93.h
r17474 | r17475 | |
52 | 52 | #define TEMP_INPUT_LEN 262144 |
53 | 53 | #define FIFO_SIZE 12 |
54 | 54 | |
55 | | #define MCFG_WD33C93_ADD( _tag, _interface ) \ |
| 55 | #define MCFG_WD33C93_ADD( _tag, _config ) \ |
56 | 56 | MCFG_DEVICE_ADD( _tag, WD33C93, 0 ) \ |
57 | | wd33c93_device::static_set_interface(*device, _interface); |
| 57 | MCFG_DEVICE_CONFIG(_config) |
58 | 58 | |
59 | 59 | class wd33c93_device : public device_t, |
60 | 60 | public WD33C93interface |
r17474 | r17475 | |
63 | 63 | // construction/destruction |
64 | 64 | wd33c93_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
65 | 65 | |
66 | | // inline configuration helpers |
67 | | static void static_set_interface(device_t &device, const WD33C93interface &interface); |
68 | | |
69 | 66 | DECLARE_READ8_MEMBER(read); |
70 | 67 | DECLARE_WRITE8_MEMBER(write); |
71 | 68 | |
r17474 | r17475 | |
76 | 73 | |
77 | 74 | protected: |
78 | 75 | // device-level overrides |
| 76 | virtual void device_config_complete(); |
79 | 77 | virtual void device_start(); |
80 | 78 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
81 | 79 | |
trunk/src/emu/machine/am53cf96.c
r17474 | r17475 | |
162 | 162 | { |
163 | 163 | } |
164 | 164 | |
| 165 | void am53cf96_device::device_config_complete() |
| 166 | { |
| 167 | // inherit a copy of the static data |
| 168 | const AM53CF96interface *intf = reinterpret_cast<const AM53CF96interface *>(static_config()); |
| 169 | if (intf != NULL) |
| 170 | { |
| 171 | *static_cast<AM53CF96interface *>(this) = *intf; |
| 172 | } |
| 173 | } |
| 174 | |
165 | 175 | void am53cf96_device::device_start() |
166 | 176 | { |
167 | 177 | memset(scsi_regs, 0, sizeof(scsi_regs)); |
r17474 | r17475 | |
186 | 196 | m_transfer_timer = timer_alloc( TIMER_TRANSFER ); |
187 | 197 | } |
188 | 198 | |
189 | | void am53cf96_device::static_set_interface(device_t &device, const AM53CF96interface &interface) |
190 | | { |
191 | | am53cf96_device &am53cf96 = downcast<am53cf96_device &>(device); |
192 | | static_cast<AM53CF96interface &>(am53cf96) = interface; |
193 | | } |
194 | | |
195 | 199 | // retrieve data from the SCSI controller |
196 | 200 | void am53cf96_device::dma_read_data(int bytes, UINT8 *pData) |
197 | 201 | { |
trunk/src/emu/machine/am53cf96.h
r17474 | r17475 | |
15 | 15 | void (*irq_callback)(running_machine &machine); /* irq callback */ |
16 | 16 | }; |
17 | 17 | |
18 | | #define MCFG_AM53CF96_ADD( _tag, _interface ) \ |
| 18 | #define MCFG_AM53CF96_ADD( _tag, _config ) \ |
19 | 19 | MCFG_DEVICE_ADD( _tag, AM53CF96, 0 ) \ |
20 | | am53cf96_device::static_set_interface(*device, _interface); |
| 20 | MCFG_DEVICE_CONFIG(_config) |
21 | 21 | |
22 | 22 | // 53CF96 register set |
23 | 23 | enum |
r17474 | r17475 | |
48 | 48 | // construction/destruction |
49 | 49 | am53cf96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
50 | 50 | |
51 | | // inline configuration helpers |
52 | | static void static_set_interface(device_t &device, const AM53CF96interface &interface); |
53 | | |
54 | 51 | DECLARE_READ8_MEMBER(read); |
55 | 52 | DECLARE_WRITE8_MEMBER(write); |
56 | 53 | |
r17474 | r17475 | |
59 | 56 | |
60 | 57 | protected: |
61 | 58 | // device-level overrides |
| 59 | virtual void device_config_complete(); |
62 | 60 | virtual void device_start(); |
63 | 61 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
64 | 62 | |