summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/liberatr.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2016-01-03 16:47:42 -0500
committer AJR <ajrhacker@users.noreply.github.com>2016-01-03 16:47:42 -0500
commit944fcc074d846356bab9ad13677dc9d8bf43ad29 (patch)
tree8337543572bd0790b2a6859175fee417f649a68a /src/mame/drivers/liberatr.cpp
parent5bcf71db9a3974be1ef749070059bf421e485c43 (diff)
liberatr: fully disentangle from atarigen, fix typo
Diffstat (limited to 'src/mame/drivers/liberatr.cpp')
-rw-r--r--src/mame/drivers/liberatr.cpp54
1 files changed, 52 insertions, 2 deletions
diff --git a/src/mame/drivers/liberatr.cpp b/src/mame/drivers/liberatr.cpp
index f0f77750814..3c8362974f8 100644
--- a/src/mame/drivers/liberatr.cpp
+++ b/src/mame/drivers/liberatr.cpp
@@ -15,7 +15,7 @@
Liberator Memory Map (for the main set, the other one is rearranged)
(from the schematics/manual)
- HEX R/W D7 D6 D5 D4 D3 D2 D2 D0 function
+ HEX R/W D7 D6 D5 D4 D3 D2 D1 D0 function
---------+-----+------------------------+------------------------
0000 D D D D D D D D XCOORD
0001 D D D D D D D D YCOORD
@@ -144,7 +144,8 @@
void liberatr_state::machine_start()
{
- atarigen_state::machine_start();
+ save_item(NAME(m_earom_data));
+ save_item(NAME(m_earom_control));
save_item(NAME(m_trackball_offset));
save_item(NAME(m_ctrld));
@@ -152,6 +153,13 @@ void liberatr_state::machine_start()
}
+void liberatr_state::machine_reset()
+{
+ // reset the control latch on the EAROM
+ m_earom->set_control(0, 1, 1, 0, 0);
+}
+
+
/*************************************
*
@@ -210,6 +218,48 @@ READ8_MEMBER( liberatr_state::port0_r )
/*************************************
*
+ * Early raster EAROM interface
+ *
+ *************************************/
+
+READ8_MEMBER( liberatr_state::earom_r )
+{
+ // return data latched from previous clock
+ return m_earom->data();
+}
+
+
+WRITE8_MEMBER( liberatr_state::earom_w )
+{
+ // remember the value written
+ m_earom_data = data;
+
+ // output latch only enabled if control bit 2 is set
+ if (m_earom_control & 4)
+ m_earom->set_data(m_earom_data);
+
+ // always latch the address
+ m_earom->set_address(offset);
+}
+
+
+WRITE8_MEMBER( liberatr_state::earom_control_w )
+{
+ // remember the control state
+ m_earom_control = data;
+
+ // ensure ouput data is put on data lines prior to updating controls
+ if (m_earom_control & 4)
+ m_earom->set_data(m_earom_data);
+
+ // set the control lines; /CS2 is always held low
+ m_earom->set_control(data & 8, 1, ~data & 4, data & 2, data & 1);
+}
+
+
+
+/*************************************
+ *
* Main CPU memory handlers
*
*************************************/