diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2018-08-22 20:51:56 -0400 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2018-08-22 20:53:09 -0400 |
commit | 5fdb04640766a623f8da1c996f281bd9722dabda (patch) | |
tree | 4c9b2ef4a2c49ba1b0ac30cc051d13941d3c7775 /src/devices | |
parent | 71759a512d89833fcd3304c6fe05b5fb3706acc7 (diff) |
i8155: Eliminate unnecessary memory interface for internal RAM (nw)
Diffstat (limited to 'src/devices')
-rw-r--r-- | src/devices/machine/i8155.cpp | 37 | ||||
-rw-r--r-- | src/devices/machine/i8155.h | 10 |
2 files changed, 11 insertions, 36 deletions
diff --git a/src/devices/machine/i8155.cpp b/src/devices/machine/i8155.cpp index 8d7adef7760..779874a244d 100644 --- a/src/devices/machine/i8155.cpp +++ b/src/devices/machine/i8155.cpp @@ -106,18 +106,6 @@ enum //************************************************************************** -// GLOBAL VARIABLES -//************************************************************************** - -// default address map -void i8155_device::i8155(address_map &map) -{ - map(0x00, 0xff).ram(); -} - - - -//************************************************************************** // INLINE HELPERS //************************************************************************** @@ -272,7 +260,6 @@ i8155_device::i8155_device(const machine_config &mconfig, const char *tag, devic i8155_device::i8155_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock), - device_memory_interface(mconfig, *this), m_in_pa_cb(*this), m_in_pb_cb(*this), m_in_pc_cb(*this), @@ -286,8 +273,7 @@ i8155_device::i8155_device(const machine_config &mconfig, device_type type, cons m_count_loaded(0), m_counter(0), m_count_extra(false), - m_to(0), - m_space_config("ram", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(), address_map_constructor(FUNC(i8155_device::i8155), this)) + m_to(0) { } @@ -317,6 +303,9 @@ void i8155_device::device_start() m_out_pc_cb.resolve_safe(); m_out_to_cb.resolve_safe(); + // allocate RAM + m_ram = make_unique_clear<uint8_t[]>(256); + // allocate timers m_timer = timer_alloc(); @@ -326,6 +315,7 @@ void i8155_device::device_start() save_item(NAME(m_command)); save_item(NAME(m_status)); save_item(NAME(m_output)); + save_pointer(NAME(m_ram), 256); save_item(NAME(m_count_length)); save_item(NAME(m_count_loaded)); save_item(NAME(m_count_extra)); @@ -413,19 +403,6 @@ void i8155_device::device_timer(emu_timer &timer, device_timer_id id, int param, //------------------------------------------------- -// memory_space_config - return a description of -// any address spaces owned by this device -//------------------------------------------------- - -device_memory_interface::space_config_vector i8155_device::memory_space_config() const -{ - return space_config_vector { - std::make_pair(0, &m_space_config) - }; -} - - -//------------------------------------------------- // io_r - register read //------------------------------------------------- @@ -574,7 +551,7 @@ WRITE8_MEMBER( i8155_device::io_w ) READ8_MEMBER( i8155_device::memory_r ) { - return this->space().read_byte(offset); + return m_ram[offset & 0xff]; } @@ -584,7 +561,7 @@ READ8_MEMBER( i8155_device::memory_r ) WRITE8_MEMBER( i8155_device::memory_w ) { - this->space().write_byte(offset, data); + m_ram[offset & 0xff] = data; } diff --git a/src/devices/machine/i8155.h b/src/devices/machine/i8155.h index 19117e06cea..a17692211e6 100644 --- a/src/devices/machine/i8155.h +++ b/src/devices/machine/i8155.h @@ -41,8 +41,7 @@ // ======================> i8155_device -class i8155_device : public device_t, - public device_memory_interface +class i8155_device : public device_t { public: // construction/destruction @@ -74,8 +73,6 @@ protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - virtual space_config_vector memory_space_config() const override; - private: devcb_read8 m_in_pa_cb; devcb_read8 m_in_pb_cb; @@ -97,6 +94,9 @@ private: uint8_t m_status; // status register uint8_t m_output[3]; // output latches + // RAM + std::unique_ptr<uint8_t[]> m_ram; + // counter uint16_t m_count_length; // count length register (assigned) uint16_t m_count_loaded; // count length register (loaded) @@ -118,8 +118,6 @@ private: inline void write_port(int port, uint8_t data); void register_w(int offset, uint8_t data); - - void i8155(address_map &map); }; |