summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2017-07-31 01:00:45 -0400
committer AJR <ajrhacker@users.noreply.github.com>2017-07-31 01:00:45 -0400
commite4046d7f737722278edea5c31c4bdeafc70c90f1 (patch)
tree646c8a39012fc192be7c291b17d2f6bcd4353a9f /src
parente22d86fde4ea51e246dd9db6ab38cec94d0c639b (diff)
samsmem.cpp: Add 74LS259 (nw)
Diffstat (limited to 'src')
-rw-r--r--src/devices/bus/ti99/peb/samsmem.cpp22
-rw-r--r--src/devices/bus/ti99/peb/samsmem.h5
2 files changed, 21 insertions, 6 deletions
diff --git a/src/devices/bus/ti99/peb/samsmem.cpp b/src/devices/bus/ti99/peb/samsmem.cpp
index 132fc80aeef..ed0ae41a50e 100644
--- a/src/devices/bus/ti99/peb/samsmem.cpp
+++ b/src/devices/bus/ti99/peb/samsmem.cpp
@@ -36,6 +36,7 @@ sams_memory_expansion_device::sams_memory_expansion_device(const machine_config
device_t(mconfig, TI99_SAMSMEM, tag, owner, clock),
device_ti99_peribox_card_interface(mconfig, *this),
m_ram(*this, RAM_TAG),
+ m_crulatch(*this, "crulatch"),
m_map_mode(false), m_access_mapper(false)
{
}
@@ -106,16 +107,27 @@ READ8Z_MEMBER(sams_memory_expansion_device::crureadz)
WRITE8_MEMBER(sams_memory_expansion_device::cruwrite)
{
if ((offset & 0xff00)==SAMS_CRU_BASE)
- {
- if ((offset & 0x000e)==0) m_access_mapper = (data!=0);
- if ((offset & 0x000e)==2) m_map_mode = (data!=0);
- }
+ m_crulatch->write_bit((offset & 0x000e) >> 1, data);
+}
+
+WRITE_LINE_MEMBER(sams_memory_expansion_device::access_mapper_w)
+{
+ m_access_mapper = state;
+}
+
+WRITE_LINE_MEMBER(sams_memory_expansion_device::map_mode_w)
+{
+ m_map_mode = state;
}
MACHINE_CONFIG_MEMBER( sams_memory_expansion_device::device_add_mconfig )
MCFG_RAM_ADD(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("1M")
MCFG_RAM_DEFAULT_VALUE(0)
+
+ MCFG_DEVICE_ADD("crulatch", LS259, 0) // U8
+ MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(sams_memory_expansion_device, access_mapper_w))
+ MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(sams_memory_expansion_device, map_mode_w))
MACHINE_CONFIG_END
void sams_memory_expansion_device::device_start()
@@ -128,8 +140,6 @@ void sams_memory_expansion_device::device_start()
void sams_memory_expansion_device::device_reset()
{
// Resetting values
- m_map_mode = false;
- m_access_mapper = false;
for (auto & elem : m_mapper) elem = 0;
}
diff --git a/src/devices/bus/ti99/peb/samsmem.h b/src/devices/bus/ti99/peb/samsmem.h
index cd28b34eabf..c002252d773 100644
--- a/src/devices/bus/ti99/peb/samsmem.h
+++ b/src/devices/bus/ti99/peb/samsmem.h
@@ -18,6 +18,7 @@
#pragma once
#include "peribox.h"
+#include "machine/74259.h"
#include "machine/ram.h"
namespace bus { namespace ti99 { namespace peb {
@@ -39,8 +40,12 @@ protected:
virtual void device_add_mconfig(machine_config &config) override;
private:
+ DECLARE_WRITE_LINE_MEMBER(access_mapper_w);
+ DECLARE_WRITE_LINE_MEMBER(map_mode_w);
+
// Console RAM
required_device<ram_device> m_ram;
+ required_device<ls259_device> m_crulatch;
int m_mapper[16];
bool m_map_mode;
bool m_access_mapper;