diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2021-01-21 10:51:37 -0500 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2021-01-21 10:51:37 -0500 |
commit | 5a4d710e2608672b44aa94d5af001c3c069656b4 (patch) | |
tree | c7005e890bf55140e0d82cb42ad937952266df41 /src/devices/machine | |
parent | 40a05f4dbc1229e51a118e6c69998e52a5a12f65 (diff) |
6522via.cpp: Distinguish some different VIA types
Diffstat (limited to 'src/devices/machine')
-rw-r--r-- | src/devices/machine/6522via.cpp | 51 | ||||
-rw-r--r-- | src/devices/machine/6522via.h | 71 |
2 files changed, 113 insertions, 9 deletions
diff --git a/src/devices/machine/6522via.cpp b/src/devices/machine/6522via.cpp index 06f557c4355..0027ba7389a 100644 --- a/src/devices/machine/6522via.cpp +++ b/src/devices/machine/6522via.cpp @@ -165,8 +165,11 @@ void via6522_device::counter2_decrement() // LIVE DEVICE //************************************************************************** -// device type definition -DEFINE_DEVICE_TYPE(VIA6522, via6522_device, "via6522", "6522 VIA") +// device type definitions +DEFINE_DEVICE_TYPE(MOS6522, mos6522_device, "mos6522", "MOS 6522 VIA") +DEFINE_DEVICE_TYPE(R65C22, r65c22_device, "r65c22", "Rockwell R65C22 VIA") +DEFINE_DEVICE_TYPE(R65NC22, r65nc22_device, "r65nc22", "Rockwell R65NC22 VIA") +DEFINE_DEVICE_TYPE(W65C22S, w65c22s_device, "w65c22s", "WDC W65C22S VIA") void via6522_device::map(address_map &map) { @@ -177,8 +180,8 @@ void via6522_device::map(address_map &map) // via6522_device - constructor //------------------------------------------------- -via6522_device::via6522_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, VIA6522, tag, owner, clock), +via6522_device::via6522_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, type, tag, owner, clock), m_in_a_handler(*this), m_in_b_handler(*this), m_out_a_handler(*this), @@ -203,6 +206,46 @@ via6522_device::via6522_device(const machine_config &mconfig, const char *tag, d //------------------------------------------------- +// mos6522_device - constructor +//------------------------------------------------- + +mos6522_device::mos6522_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : via6522_device(mconfig, MOS6522, tag, owner, clock) +{ +} + + +//------------------------------------------------- +// r65c22_device - constructor +//------------------------------------------------- + +r65c22_device::r65c22_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : via6522_device(mconfig, R65C22, tag, owner, clock) +{ +} + + +//------------------------------------------------- +// r65c22_device - constructor +//------------------------------------------------- + +r65nc22_device::r65nc22_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : via6522_device(mconfig, R65NC22, tag, owner, clock) +{ +} + + +//------------------------------------------------- +// w65c22s_device - constructor +//------------------------------------------------- + +w65c22s_device::w65c22s_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : via6522_device(mconfig, W65C22S, tag, owner, clock) +{ +} + + +//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/6522via.h b/src/devices/machine/6522via.h index 1a705ab6a29..164104190e4 100644 --- a/src/devices/machine/6522via.h +++ b/src/devices/machine/6522via.h @@ -11,6 +11,29 @@ Written by Mathis Rosenhauer +********************************************************************** + _____ _____ + Vss 1 |* \_/ | 40 CA1 + PA0 2 | | 39 CA2 + PA1 3 | | 38 RS0 + PA2 4 | | 37 RS1 + PA3 5 | | 36 RS2 + PA4 6 | | 35 RS3 + PA5 7 | | 34 _RES + PA6 8 | | 33 D0 + PA7 9 | | 32 D1 + PB0 10 | | 31 D2 + PB1 11 | MCS6522 | 30 D3 + PB2 12 | | 29 D4 + PB3 13 | | 28 D5 + PB4 14 | | 27 D6 + PB5 15 | | 26 D7 + PB6 16 | | 25 ϕ2 + PB7 17 | | 24 CS1 + CB1 18 | | 23 _CS2 + CB2 19 | | 22 R/_W + Vcc 20 |_____________| 21 _IRQ + **********************************************************************/ #ifndef MAME_MACHINE_6522VIA_H @@ -48,9 +71,6 @@ public: VIA_PANH = 15 }; - // construction/destruction - via6522_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // TODO: REMOVE THESE auto readpa_handler() { return m_in_a_handler.bind(); } auto readpb_handler() { return m_in_b_handler.bind(); } @@ -94,6 +114,9 @@ public: void write_cb2(int state); protected: + // construction/destruction + via6522_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + // device-level overrides virtual void device_start() override; virtual void device_reset() override; @@ -184,9 +207,47 @@ private: uint8_t m_shift_counter; }; +// ======================> mos6522_device + +class mos6522_device : public via6522_device +{ +public: + // construction/destruction + mos6522_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +}; + +// ======================> r65c22_device + +class r65c22_device : public via6522_device +{ +public: + // construction/destruction + r65c22_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +}; + +// ======================> r65nc22_device + +class r65nc22_device : public via6522_device +{ +public: + // construction/destruction + r65nc22_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +}; + +// ======================> w65c22s_device + +class w65c22s_device : public via6522_device +{ +public: + // construction/destruction + w65c22s_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +}; -// device type definition -DECLARE_DEVICE_TYPE(VIA6522, via6522_device) +// device type declarations +DECLARE_DEVICE_TYPE(MOS6522, mos6522_device) +DECLARE_DEVICE_TYPE(R65C22, r65c22_device) +DECLARE_DEVICE_TYPE(R65NC22, r65nc22_device) +DECLARE_DEVICE_TYPE(W65C22S, w65c22s_device) #endif // MAME_MACHINE_6522VIA_H |