summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/machine/trs80.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/machine/trs80.cpp')
-rw-r--r--src/mame/machine/trs80.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/mame/machine/trs80.cpp b/src/mame/machine/trs80.cpp
index 6b12bb3ab26..499bff7015d 100644
--- a/src/mame/machine/trs80.cpp
+++ b/src/mame/machine/trs80.cpp
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:Robbbert and unknown others
+// copyright-holders:Robbbert,FSanches and unknown others
/***************************************************************************
machine.c
@@ -204,6 +204,23 @@ READ8_MEMBER( trs80_state::trs80m4_ff_r )
return m_port_ec | m_cassette_data;
}
+READ8_MEMBER( trs80_state::cp500_a11_flipflop_toggle )
+{
+ /* The A11 flipflop is used for enabling access to
+ the system monitor code at the EPROM address range 3800-3fff */
+ uint8_t *rom = memregion("maincpu")->base();
+ uint8_t *bootrom = memregion("bootrom")->base();
+ int block;
+
+ m_a11_flipflop ^= 1; //toggle the flip-flop at every read at io addresses 0xf4-f7
+
+ for (block=0; block<8; block++){
+ memcpy(&rom[block * 0x800], &bootrom[(block | m_a11_flipflop) * 0x800], 0x800);
+ }
+
+ return 0x00; //really?!
+}
+
WRITE8_MEMBER( trs80_state::trs80m4_84_w )
{
@@ -841,6 +858,12 @@ MACHINE_RESET_MEMBER(trs80_state,lnw80)
lnw80_fe_w(space, 0, 0);
}
+MACHINE_RESET_MEMBER(trs80_state,cp500)
+{
+ m_a11_flipflop = 0;
+ MACHINE_RESET_CALL_MEMBER( trs80m4 );
+}
+
/***************************************************************************
PARAMETERS