summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2019-05-16 20:33:32 -0400
committer AJR <ajrhacker@users.noreply.github.com>2019-05-16 20:33:32 -0400
commit7445de12e3e3a912b450bbaf8b8a2d873e53809f (patch)
tree1d94e09079663ace3e347ba43981e6319c4279a6
parentc883054e759dfb4f28bb05ef98cf3df191681d81 (diff)
atarifdc: Eliminate machine().device (nw)
-rw-r--r--src/mame/machine/atarifdc.cpp16
-rw-r--r--src/mame/machine/atarifdc.h5
2 files changed, 10 insertions, 11 deletions
diff --git a/src/mame/machine/atarifdc.cpp b/src/mame/machine/atarifdc.cpp
index 977db4392d3..f8eb9c08829 100644
--- a/src/mame/machine/atarifdc.cpp
+++ b/src/mame/machine/atarifdc.cpp
@@ -13,9 +13,6 @@
#include "emu.h"
#include "atarifdc.h"
-#include "machine/6821pia.h"
-#include "sound/pokey.h"
-
#include "formats/atari_dsk.h"
#include <ctype.h>
@@ -393,11 +390,10 @@ void atari_fdc_device::add_serout(int expect_data)
void atari_fdc_device::clr_serin(int ser_delay)
{
- pokey_device *pokey = machine().device<pokey_device>("pokey");
m_serin_chksum = 0;
m_serin_offs = 0;
m_serin_count = 0;
- pokey->serin_ready(ser_delay * 40);
+ m_pokey->serin_ready(ser_delay * 40);
}
void atari_fdc_device::add_serin(uint8_t data, int with_checksum)
@@ -674,8 +670,6 @@ READ8_MEMBER( atari_fdc_device::serin_r )
if (m_serin_count)
{
- pokey_device *pokey = machine().device<pokey_device>("pokey");
-
data = m_serin_buff[m_serin_offs];
ser_delay = 2 * 40;
if (m_serin_offs < 3)
@@ -688,7 +682,7 @@ READ8_MEMBER( atari_fdc_device::serin_r )
if (--m_serin_count == 0)
m_serin_offs = 0;
else
- pokey->serin_ready(ser_delay);
+ m_pokey->serin_ready(ser_delay);
}
if (VERBOSE_SERIAL)
@@ -699,8 +693,6 @@ READ8_MEMBER( atari_fdc_device::serin_r )
WRITE8_MEMBER( atari_fdc_device::serout_w )
{
- pia6821_device *pia = machine().device<pia6821_device>( "pia" );
-
/* ignore serial commands if no floppy image is specified */
if( !m_drv[0].image )
return;
@@ -718,7 +710,7 @@ WRITE8_MEMBER( atari_fdc_device::serout_w )
/* exclusive or written checksum with calculated */
m_serout_chksum ^= data;
/* if the attention line is high, this should be data */
- if (pia->irq_b_state())
+ if (m_pia->irq_b_state())
a800_serial_write();
}
else
@@ -763,6 +755,8 @@ DEFINE_DEVICE_TYPE(ATARI_FDC, atari_fdc_device, "atari_fdc", "Atari FDC")
atari_fdc_device::atari_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, ATARI_FDC, tag, owner, clock),
+ m_pokey(*this, "^pokey"),
+ m_pia(*this, "^pia"),
m_serout_count(0),
m_serout_offs(0),
m_serout_chksum(0),
diff --git a/src/mame/machine/atarifdc.h b/src/mame/machine/atarifdc.h
index c50742ac030..5fb245bc123 100644
--- a/src/mame/machine/atarifdc.h
+++ b/src/mame/machine/atarifdc.h
@@ -9,6 +9,8 @@
#define MAME_MACHINE_ATARIFDC_H
#include "imagedev/flopdrv.h"
+#include "machine/6821pia.h"
+#include "sound/pokey.h"
class atari_fdc_device : public device_t
{
@@ -49,6 +51,9 @@ private:
int sectors; /* total sectors, ie. tracks x heads x spt */
};
+ required_device<pokey_device> m_pokey;
+ required_device<pia6821_device> m_pia;
+
int m_serout_count;
int m_serout_offs;
uint8_t m_serout_buff[512];