summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/machine
diff options
context:
space:
mode:
author Ivan Vangelista <mesgnet@yahoo.it>2013-11-04 18:06:29 +0000
committer Ivan Vangelista <mesgnet@yahoo.it>2013-11-04 18:06:29 +0000
commitb7627dda188fbfd7661f23a8806694e6fdb9fa57 (patch)
treeb4ccbd47d4e210aeb3b729e018fb7e11cbe52fbc /src/mess/machine
parentaae15c6fe6805aae566ab9da7e721e67fd9aef5f (diff)
Modernized mc6854 device.(nw)
Superficial testing shows no breakage, but in-depth testing from someone familiar with the machines would be appreciated.
Diffstat (limited to 'src/mess/machine')
-rw-r--r--src/mess/machine/bbc.c12
-rw-r--r--src/mess/machine/thomflop.c31
2 files changed, 22 insertions, 21 deletions
diff --git a/src/mess/machine/bbc.c b/src/mess/machine/bbc.c
index e5a9c0a254b..a6585efa898 100644
--- a/src/mess/machine/bbc.c
+++ b/src/mess/machine/bbc.c
@@ -13,7 +13,6 @@
#include <ctype.h>
#include "emu.h"
#include "cpu/m6502/m6502.h"
-#include "sound/sn76496.h"
#include "sound/tms5220.h"
#include "machine/6522via.h"
#include "machine/wd17xx.h"
@@ -22,7 +21,6 @@
#include "machine/upd7002.h"
#include "machine/i8271.h"
#include "machine/mc146818.h"
-#include "machine/mc6854.h"
#include "bus/centronics/ctronics.h"
#include "imagedev/cassette.h"
@@ -576,8 +574,7 @@ READ8_MEMBER(bbc_state::bbcm_r)
{
via6522_device *via_0 = machine().device<via6522_device>("via6522_0");
via6522_device *via_1 = machine().device<via6522_device>("via6522_1");
- device_t *adlc = machine().device("mc6854");
-
+
myo = offset-0x200;
if ((myo>=0x00) && (myo<=0x07)) return bbc_6845_r(space, myo-0x00); /* Video Controller */
if ((myo>=0x08) && (myo<=0x0f))
@@ -598,7 +595,7 @@ READ8_MEMBER(bbc_state::bbcm_r)
if ((myo>=0x40) && (myo<=0x5f)) return via_0->read(space, myo-0x40);
if ((myo>=0x60) && (myo<=0x7f)) return via_1->read(space, myo-0x60);
if ((myo>=0x80) && (myo<=0x9f)) return 0xfe;
- if ((myo>=0xa0) && (myo<=0xbf)) return mc6854_r(adlc, space, myo & 0x03);
+ if ((myo>=0xa0) && (myo<=0xbf)) return m_adlc->read(space, myo & 0x03);
if ((myo>=0xc0) && (myo<=0xdf)) return 0xfe;
if ((myo>=0xe0) && (myo<=0xff)) return 0xfe;
}
@@ -614,8 +611,7 @@ WRITE8_MEMBER(bbc_state::bbcm_w)
{
via6522_device *via_0 = machine().device<via6522_device>("via6522_0");
via6522_device *via_1 = machine().device<via6522_device>("via6522_1");
- device_t *adlc = machine().device("mc6854");
-
+
myo=offset-0x200;
if ((myo>=0x00) && (myo<=0x07)) bbc_6845_w(space, myo-0x00, data); /* Video Controller */
if ((myo>=0x08) && (myo<=0x0f))
@@ -636,7 +632,7 @@ WRITE8_MEMBER(bbc_state::bbcm_w)
if ((myo>=0x40) && (myo<=0x5f)) via_0->write(space, myo-0x40, data);
if ((myo>=0x60) && (myo<=0x7f)) via_1->write(space, myo-0x60, data);
//if ((myo>=0x80) && (myo<=0x9f))
- if ((myo>=0xa0) && (myo<=0xbf)) mc6854_w(adlc, space, myo & 0x03, data);
+ if ((myo>=0xa0) && (myo<=0xbf)) m_adlc->write(space, myo & 0x03, data);
//if ((myo>=0xc0) && (myo<=0xdf))
//if ((myo>=0xe0) && (myo<=0xff))
}
diff --git a/src/mess/machine/thomflop.c b/src/mess/machine/thomflop.c
index 83e995e3ad5..543ba44f27a 100644
--- a/src/mess/machine/thomflop.c
+++ b/src/mess/machine/thomflop.c
@@ -1592,27 +1592,27 @@ void thomson_state::thmfc_floppy_init()
TIMER_CALLBACK_MEMBER( thomson_state::ans4 )
{
LOG(( "%f ans4\n", machine().time().as_double() ));
- mc6854_set_cts( machine().device("mc6854"), 0 );
+ m_mc6854->set_cts( 0 );
}
TIMER_CALLBACK_MEMBER( thomson_state::ans3 )
{
LOG(( "%f ans3\n", machine().time().as_double() ));
- mc6854_set_cts( machine().device("mc6854"), 1 );
+ m_mc6854->set_cts( 1 );
machine().scheduler().timer_set( attotime::from_usec( 100 ), timer_expired_delegate(FUNC(thomson_state::ans4),this));
}
TIMER_CALLBACK_MEMBER( thomson_state::ans2 )
{
LOG(( "%f ans2\n", machine().time().as_double() ));
- mc6854_set_cts( machine().device("mc6854"), 0 );
+ m_mc6854->set_cts( 0 );
machine().scheduler().timer_set( attotime::from_usec( 100 ), timer_expired_delegate(FUNC(thomson_state::ans3),this));
}
TIMER_CALLBACK_MEMBER( thomson_state::ans )
{
LOG(( "%f ans\n", machine().time().as_double() ));
- mc6854_set_cts( machine().device("mc6854"), 1 );
+ m_mc6854->set_cts( 1 );
machine().scheduler().timer_set( attotime::from_usec( 100 ), timer_expired_delegate(FUNC(thomson_state::ans2),this));
}
/* consigne DKBOOT
@@ -1657,7 +1657,7 @@ static void to7_network_got_frame( device_t *device, UINT8* data, int length )
thomson_state *state = device->machine().driver_data<thomson_state>();
LOG(( "to7_network_got_frame: %i phones %i\n", data[2], data[0] ));
device->machine().scheduler().timer_set( attotime::from_usec( 100 ), timer_expired_delegate(FUNC(thomson_state::ans),state));
- mc6854_set_cts( device, 0 );
+ state->m_mc6854->set_cts( 0 );
}
else if ( ! data[1] )
{
@@ -1673,13 +1673,18 @@ static void to7_network_got_frame( device_t *device, UINT8* data, int length )
(data[10] == 0) ? "TO7" : (data[10] == 1) ? "MO5" :
(data[10] == 2) ? "TO7/70" : "?", name ));
}
-
}
-
-const mc6854_interface to7_network_iface = { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, to7_network_got_frame, DEVCB_NULL, DEVCB_NULL };
-
+const mc6854_interface to7_network_iface =
+{
+ DEVCB_NULL,
+ DEVCB_NULL,
+ DEVCB_NULL,
+ to7_network_got_frame,
+ DEVCB_NULL,
+ DEVCB_NULL
+};
void thomson_state::to7_network_init()
@@ -1693,8 +1698,8 @@ void thomson_state::to7_network_init()
void thomson_state::to7_network_reset()
{
LOG(( "to7_network_reset: NR 07-005 network extension\n" ));
- mc6854_set_cts( machine().device("mc6854"), 0 );
- mc6854_set_cts( machine().device("mc6854"), 1 );
+ m_mc6854->set_cts( 0 );
+ m_mc6854->set_cts( 1 );
}
@@ -1702,7 +1707,7 @@ void thomson_state::to7_network_reset()
READ8_MEMBER( thomson_state::to7_network_r )
{
if ( offset < 4 )
- return mc6854_r( machine().device("mc6854"), space, offset );
+ return m_mc6854->read( space, offset );
if ( offset == 8 )
{
@@ -1721,7 +1726,7 @@ READ8_MEMBER( thomson_state::to7_network_r )
WRITE8_MEMBER( thomson_state::to7_network_w )
{
if ( offset < 4 )
- mc6854_w( machine().device("mc6854"), space, offset, data );
+ m_mc6854->write( space, offset, data );
else
{
logerror( "%f $%04x to7_network_w: invalid write offset %i (data=$%02X)\n",