diff options
Diffstat (limited to 'src/devices/machine/am53cf96.h')
-rw-r--r-- | src/devices/machine/am53cf96.h | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/src/devices/machine/am53cf96.h b/src/devices/machine/am53cf96.h index ec2697bab5b..f269ec34384 100644 --- a/src/devices/machine/am53cf96.h +++ b/src/devices/machine/am53cf96.h @@ -5,8 +5,8 @@ * */ -#ifndef _AM53CF96_H_ -#define _AM53CF96_H_ +#ifndef MAME_MACHINE_AM53CF96_H +#define MAME_MACHINE_AM53CF96_H #pragma once @@ -15,28 +15,6 @@ #define MCFG_AM53CF96_IRQ_HANDLER(_devcb) \ devcb = &am53cf96_device::set_irq_handler(*device, DEVCB_##_devcb); -// 53CF96 register set -enum -{ - REG_XFERCNTLOW = 0, // read = current xfer count lo byte, write = set xfer count lo byte - REG_XFERCNTMID, // read = current xfer count mid byte, write = set xfer count mid byte - REG_FIFO, // read/write = FIFO - REG_COMMAND, // read/write = command - - REG_STATUS, // read = status, write = destination SCSI ID (4) - REG_IRQSTATE, // read = IRQ status, write = timeout (5) - REG_INTSTATE, // read = internal state, write = sync xfer period (6) - REG_FIFOSTATE, // read = FIFO status, write = sync offset - REG_CTRL1, // read/write = control 1 - REG_CLOCKFCTR, // clock factor (write only) - REG_TESTMODE, // test mode (write only) - REG_CTRL2, // read/write = control 2 - REG_CTRL3, // read/write = control 3 - REG_CTRL4, // read/write = control 4 - REG_XFERCNTHI, // read = current xfer count hi byte, write = set xfer count hi byte - REG_DATAALIGN // data alignment (write only) -}; - class am53cf96_device : public legacy_scsi_host_adapter { public: @@ -44,7 +22,7 @@ public: am53cf96_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers - template<class _Object> static devcb_base &set_irq_handler(device_t &device, _Object object) { return downcast<am53cf96_device &>(device).m_irq_handler.set_callback(object); } + template <class Object> static devcb_base &set_irq_handler(device_t &device, Object &&cb) { return downcast<am53cf96_device &>(device).m_irq_handler.set_callback(std::forward<Object>(cb)); } DECLARE_READ8_MEMBER(read); DECLARE_WRITE8_MEMBER(write); @@ -53,12 +31,34 @@ public: void dma_write_data(int bytes, uint8_t *pData); protected: + // 53CF96 register set + enum + { + REG_XFERCNTLOW = 0, // read = current xfer count lo byte, write = set xfer count lo byte + REG_XFERCNTMID, // read = current xfer count mid byte, write = set xfer count mid byte + REG_FIFO, // read/write = FIFO + REG_COMMAND, // read/write = command + + REG_STATUS, // read = status, write = destination SCSI ID (4) + REG_IRQSTATE, // read = IRQ status, write = timeout (5) + REG_INTSTATE, // read = internal state, write = sync xfer period (6) + REG_FIFOSTATE, // read = FIFO status, write = sync offset + REG_CTRL1, // read/write = control 1 + REG_CLOCKFCTR, // clock factor (write only) + REG_TESTMODE, // test mode (write only) + REG_CTRL2, // read/write = control 2 + REG_CTRL3, // read/write = control 3 + REG_CTRL4, // read/write = control 4 + REG_XFERCNTHI, // read = current xfer count hi byte, write = set xfer count hi byte + REG_DATAALIGN // data alignment (write only) + }; + // device-level overrides virtual void device_start() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; private: - static const device_timer_id TIMER_TRANSFER = 0; + static constexpr device_timer_id TIMER_TRANSFER = 0; uint8_t scsi_regs[32]; uint8_t fifo[16]; @@ -71,6 +71,6 @@ private: }; // device type definition -extern const device_type AM53CF96; +DECLARE_DEVICE_TYPE(AM53CF96, am53cf96_device) -#endif +#endif // MAME_MACHINE_AM53CF96_H |