legacy wd17xx is now also a modern device (nw)

This commit is contained in:
Miodrag Milanovic 2014-03-18 13:31:41 +00:00
parent e1af1a2096
commit 59674b3fdf
57 changed files with 1234 additions and 1370 deletions

View File

@ -87,7 +87,7 @@ const rom_entry *bml3bus_mp1802_device::device_rom_region() const
READ8_MEMBER( bml3bus_mp1802_device::bml3_mp1802_r)
{
return wd17xx_drq_r(m_wd17xx) ? 0x00 : 0x80;
return m_wd17xx->drq_r() ? 0x00 : 0x80;
}
WRITE8_MEMBER( bml3bus_mp1802_device::bml3_mp1802_w)
@ -111,10 +111,10 @@ WRITE8_MEMBER( bml3bus_mp1802_device::bml3_mp1802_w)
break;
}
device_t *floppy = subdevice(floppy_name);
wd17xx_set_drive(m_wd17xx,drive);
m_wd17xx->set_drive(drive);
floppy_mon_w(floppy, !motor);
floppy_drive_set_ready_state(floppy, ASSERT_LINE, 0);
wd17xx_set_side(m_wd17xx,side);
m_wd17xx->set_side(side);
}
@ -143,8 +143,8 @@ void bml3bus_mp1802_device::device_start()
// install into memory
address_space &space_prg = machine().firstcpu->space(AS_PROGRAM);
space_prg.install_legacy_readwrite_handler(m_wd17xx, 0xff00, 0xff03, FUNC(wd17xx_r), FUNC(wd17xx_w));
space_prg.install_readwrite_handler(0xff04, 0xff04, read8_delegate( FUNC(bml3bus_mp1802_device::bml3_mp1802_r), this), write8_delegate(FUNC(bml3bus_mp1802_device::bml3_mp1802_w), this) );
space_prg.install_readwrite_handler(0xff00, 0xff03, read8_delegate(FUNC(mb8866_device::read),(mb8866_device*)m_wd17xx), write8_delegate(FUNC(mb8866_device::write),(mb8866_device*)m_wd17xx));
space_prg.install_readwrite_handler(0xff04, 0xff04, read8_delegate(FUNC(bml3bus_mp1802_device::bml3_mp1802_r), this), write8_delegate(FUNC(bml3bus_mp1802_device::bml3_mp1802_w), this) );
// overwriting the main ROM (rather than using e.g. install_rom) should mean that bank switches for RAM expansion still work...
UINT8 *mainrom = device().machine().root_device().memregion("maincpu")->base();
memcpy(mainrom + 0xf800, m_rom + 0xf800, 0x800);

View File

@ -70,7 +70,6 @@
#include "coco_fdc.h"
#include "imagedev/flopdrv.h"
#include "includes/coco.h"
#include "machine/wd17xx.h"
#include "imagedev/flopdrv.h"
#include "formats/coco_dsk.h"
@ -200,7 +199,7 @@ void coco_fdc_device::device_start()
m_drq = 1;
m_disto_msm6242 = subdevice<msm6242_device>(DISTO_TAG);
m_ds1315 = subdevice<ds1315_device>(CLOUD9_TAG);
m_wd17xx = subdevice(WD_TAG);
m_wd17xx = subdevice<wd2797_device>(WD_TAG);
m_dskreg = 0x00;
m_intrq = 0;
m_msm6242_rtc_address = 0;
@ -312,9 +311,9 @@ void coco_fdc_device::dskreg_w(UINT8 data)
update_lines();
wd17xx_set_drive(m_wd17xx, drive);
wd17xx_set_side(m_wd17xx, head);
wd17xx_dden_w(m_wd17xx, !BIT(m_dskreg, 5));
m_wd17xx->set_drive(drive);
m_wd17xx->set_side(head);
m_wd17xx->dden_w(!BIT(m_dskreg, 5));
}
/*-------------------------------------------------
@ -328,16 +327,16 @@ READ8_MEMBER(coco_fdc_device::read)
switch(offset & 0xEF)
{
case 8:
result = wd17xx_status_r(m_wd17xx, space, 0);
result = m_wd17xx->status_r(space, 0);
break;
case 9:
result = wd17xx_track_r(m_wd17xx, space, 0);
result = m_wd17xx->track_r(space, 0);
break;
case 10:
result = wd17xx_sector_r(m_wd17xx, space, 0);
result = m_wd17xx->sector_r(space, 0);
break;
case 11:
result = wd17xx_data_r(m_wd17xx, space, 0);
result = m_wd17xx->data_r(space, 0);
break;
}
@ -382,16 +381,16 @@ WRITE8_MEMBER(coco_fdc_device::write)
dskreg_w(data);
break;
case 8:
wd17xx_command_w(m_wd17xx, space, 0, data);
m_wd17xx->command_w(space, 0, data);
break;
case 9:
wd17xx_track_w(m_wd17xx, space, 0, data);
m_wd17xx->track_w(space, 0, data);
break;
case 10:
wd17xx_sector_w(m_wd17xx, space, 0, data);
m_wd17xx->sector_w(space, 0, data);
break;
case 11:
wd17xx_data_w(m_wd17xx, space, 0, data);
m_wd17xx->data_w(space, 0, data);
break;
};
@ -448,7 +447,7 @@ void dragon_fdc_device::device_start()
{
m_owner = dynamic_cast<cococart_slot_device *>(owner());
m_drq = 0;
m_wd17xx = subdevice(WD_TAG);
m_wd17xx = subdevice<wd2797_device>(WD_TAG);
m_dskreg = 0x00;
m_intrq = 0;
m_msm6242_rtc_address = 0;
@ -514,9 +513,9 @@ void dragon_fdc_device::dskreg_w(UINT8 data)
}
if (data & 0x04)
wd17xx_set_drive(m_wd17xx, data & 0x03);
m_wd17xx->set_drive(data & 0x03);
wd17xx_dden_w(m_wd17xx, BIT(data, 3));
m_wd17xx->dden_w(BIT(data, 3));
m_dskreg = data;
}
@ -532,16 +531,16 @@ READ8_MEMBER(dragon_fdc_device::read)
switch(offset & 0xEF)
{
case 0:
result = wd17xx_status_r(m_wd17xx, space, 0);
result = m_wd17xx->status_r(space, 0);
break;
case 1:
result = wd17xx_track_r(m_wd17xx, space, 0);
result = m_wd17xx->track_r(space, 0);
break;
case 2:
result = wd17xx_sector_r(m_wd17xx, space, 0);
result = m_wd17xx->sector_r(space, 0);
break;
case 3:
result = wd17xx_data_r(m_wd17xx, space, 0);
result = m_wd17xx->data_r(space, 0);
break;
}
return result;
@ -558,21 +557,21 @@ WRITE8_MEMBER(dragon_fdc_device::write)
switch(offset & 0xEF)
{
case 0:
wd17xx_command_w(m_wd17xx, space, 0, data);
m_wd17xx->command_w(space, 0, data);
/* disk head is encoded in the command byte */
/* Only for type 3 & 4 commands */
if (data & 0x80)
wd17xx_set_side(m_wd17xx, (data & 0x02) ? 1 : 0);
m_wd17xx->set_side((data & 0x02) ? 1 : 0);
break;
case 1:
wd17xx_track_w(m_wd17xx, space, 0, data);
m_wd17xx->track_w(space, 0, data);
break;
case 2:
wd17xx_sector_w(m_wd17xx, space, 0, data);
m_wd17xx->sector_w(space, 0, data);
break;
case 3:
wd17xx_data_w(m_wd17xx, space, 0, data);
m_wd17xx->data_w(space, 0, data);
break;
case 8: case 9: case 10: case 11:
case 12: case 13: case 14: case 15:

View File

@ -7,6 +7,8 @@
#include "cococart.h"
#include "machine/msm6242.h"
#include "machine/ds1315.h"
#include "machine/wd17xx.h"
//**************************************************************************
// TYPE DEFINITIONS
@ -62,7 +64,7 @@ protected:
UINT8 m_drq : 1;
UINT8 m_intrq : 1;
device_t *m_wd17xx; /* WD17xx */
wd2797_device *m_wd17xx; /* WD17xx */
ds1315_device *m_ds1315; /* DS1315 */
/* Disto RTC */

File diff suppressed because it is too large Load Diff

View File

@ -11,6 +11,22 @@
#define __WD17XX_H__
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
/* Interface */
struct wd17xx_interface
{
devcb_read_line in_dden_func;
devcb_write_line out_intrq_func;
devcb_write_line out_drq_func;
const char *floppy_drive_tags[4];
};
extern const wd17xx_interface default_wd17xx_interface;
extern const wd17xx_interface default_wd17xx_interface_2_drives;
/***************************************************************************
MACROS
***************************************************************************/
@ -20,18 +36,148 @@ class wd1770_device : public device_t
public:
wd1770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
wd1770_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
virtual ~wd1770_device();
// access to legacy token
struct wd1770_state *token() const { assert(m_token != NULL); return m_token; }
/* the following are not strictly part of the wd179x hardware/emulation
but will be put here for now until the flopdrv code has been finalised more */
void set_drive(UINT8); /* set drive wd179x is accessing */
void set_side(UINT8); /* set side wd179x is accessing */
void set_pause_time(int usec); /* default is 40 usec if not set */
void index_pulse_callback(device_t *img, int state);
DECLARE_READ8_MEMBER( status_r );
DECLARE_READ8_MEMBER( track_r );
DECLARE_READ8_MEMBER( sector_r );
DECLARE_READ8_MEMBER( data_r );
DECLARE_WRITE8_MEMBER( command_w );
DECLARE_WRITE8_MEMBER( track_w );
DECLARE_WRITE8_MEMBER( sector_w );
DECLARE_WRITE8_MEMBER( data_w );
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
WRITE_LINE_MEMBER( mr_w );
WRITE_LINE_MEMBER( rdy_w );
READ_LINE_MEMBER( mo_r );
WRITE_LINE_MEMBER( tr00_w );
WRITE_LINE_MEMBER( idx_w );
WRITE_LINE_MEMBER( wprt_w );
WRITE_LINE_MEMBER( dden_w );
READ_LINE_MEMBER( drq_r );
READ_LINE_MEMBER( intrq_r );
protected:
// device-level overrides
virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
private:
protected:
int wd17xx_dden();
void wd17xx_clear_drq();
void wd17xx_set_drq();
void wd17xx_clear_intrq();
void wd17xx_set_intrq();
TIMER_CALLBACK_MEMBER( wd17xx_command_callback );
TIMER_CALLBACK_MEMBER( wd17xx_data_callback );
void wd17xx_set_busy(attotime duration);
void wd17xx_command_restore();
void write_track();
void read_track();
void wd17xx_read_id();
int wd17xx_locate_sector();
int wd17xx_find_sector();
void wd17xx_side_compare(UINT8 command);
void wd17xx_read_sector();
void wd17xx_complete_command(int delay);
void wd17xx_write_sector();
void wd17xx_verify_seek();
TIMER_CALLBACK_MEMBER( wd17xx_read_sector_callback );
TIMER_CALLBACK_MEMBER( wd17xx_write_sector_callback );
void wd17xx_timed_data_request();
void wd17xx_timed_read_sector_request();
void wd17xx_timed_write_sector_request();
// internal state
struct wd1770_state *m_token;
/* callbacks */
devcb_resolved_read_line m_in_dden_func;
devcb_resolved_write_line m_out_intrq_func;
devcb_resolved_write_line m_out_drq_func;
/* input lines */
int m_mr; /* master reset */
int m_rdy; /* ready, enable precomp */
int m_tr00; /* track 00 */
int m_idx; /* index */
int m_wprt; /* write protect */
int m_dden; /* double density */
/* output lines */
int m_mo; /* motor on */
int m_dirc; /* direction */
int m_drq; /* data request */
int m_intrq; /* interrupt request */
/* register */
UINT8 m_data_shift;
UINT8 m_data;
UINT8 m_track;
UINT8 m_sector;
UINT8 m_command;
UINT8 m_status;
UINT8 m_interrupt;
int m_stepping_rate[4]; /* track stepping rate in ms */
unsigned short m_crc; /* Holds the current CRC value for write_track CRC calculation */
int m_crc_active; /* Flag indicating that CRC calculation in write_track is active. */
UINT8 m_track_reg; /* value of track register */
UINT8 m_command_type; /* last command type */
UINT8 m_head; /* current head # */
UINT8 m_read_cmd; /* last read command issued */
UINT8 m_write_cmd; /* last write command issued */
INT8 m_direction; /* last step direction */
UINT8 m_last_command_data; /* last command data */
UINT8 m_status_drq; /* status register data request bit */
UINT8 m_busy_count; /* how long to keep busy bit set */
UINT8 m_buffer[6144]; /* I/O buffer (holds up to a whole track) */
UINT32 m_data_offset; /* offset into I/O buffer */
INT32 m_data_count; /* transfer count from/into I/O buffer */
UINT8 *m_fmt_sector_data[256]; /* pointer to data after formatting a track */
UINT8 m_dam_list[256][4]; /* list of data address marks while formatting */
int m_dam_data[256]; /* offset to data inside buffer while formatting */
int m_dam_cnt; /* valid number of entries in the dam_list */
UINT16 m_sector_length; /* sector length (byte) */
UINT8 m_ddam; /* ddam of sector found - used when reading */
UINT8 m_sector_data_id;
int m_data_direction;
int m_hld_count; /* head loaded counter */
/* timers to delay execution/completion of commands */
emu_timer *m_timer_cmd, *m_timer_data, *m_timer_rs, *m_timer_ws;
/* this is the drive currently selected */
device_t *m_drive;
/* this is the head currently selected */
UINT8 m_hd;
/* pause time when writing/reading sector */
int m_pause_time;
/* Were we busy when we received a FORCE_INT command */
UINT8 m_was_busy;
/* Pointer to interface */
const wd17xx_interface *m_intf;
};
extern ATTR_DEPRECATED const device_type WD1770;
@ -223,63 +369,6 @@ public:
extern ATTR_DEPRECATED const device_type MB8877;
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
/* Interface */
struct wd17xx_interface
{
devcb_read_line in_dden_func;
devcb_write_line out_intrq_func;
devcb_write_line out_drq_func;
const char *floppy_drive_tags[4];
};
/***************************************************************************
FUNCTION PROTOTYPES
***************************************************************************/
void wd17xx_reset(device_t *device);
/* the following are not strictly part of the wd179x hardware/emulation
but will be put here for now until the flopdrv code has been finalised more */
void wd17xx_set_drive(device_t *device, UINT8); /* set drive wd179x is accessing */
void wd17xx_set_side(device_t *device, UINT8); /* set side wd179x is accessing */
void wd17xx_set_pause_time(device_t *device, int usec); /* default is 40 usec if not set */
void wd17xx_index_pulse_callback(device_t *controller, device_t *img, int state);
DECLARE_READ8_DEVICE_HANDLER( wd17xx_status_r );
DECLARE_READ8_DEVICE_HANDLER( wd17xx_track_r );
DECLARE_READ8_DEVICE_HANDLER( wd17xx_sector_r );
DECLARE_READ8_DEVICE_HANDLER( wd17xx_data_r );
DECLARE_WRITE8_DEVICE_HANDLER( wd17xx_command_w );
DECLARE_WRITE8_DEVICE_HANDLER( wd17xx_track_w );
DECLARE_WRITE8_DEVICE_HANDLER( wd17xx_sector_w );
DECLARE_WRITE8_DEVICE_HANDLER( wd17xx_data_w );
DECLARE_READ8_DEVICE_HANDLER( wd17xx_r );
DECLARE_WRITE8_DEVICE_HANDLER( wd17xx_w );
WRITE_LINE_DEVICE_HANDLER( wd17xx_mr_w );
WRITE_LINE_DEVICE_HANDLER( wd17xx_rdy_w );
READ_LINE_DEVICE_HANDLER( wd17xx_mo_r );
WRITE_LINE_DEVICE_HANDLER( wd17xx_tr00_w );
WRITE_LINE_DEVICE_HANDLER( wd17xx_idx_w );
WRITE_LINE_DEVICE_HANDLER( wd17xx_wprt_w );
WRITE_LINE_DEVICE_HANDLER( wd17xx_dden_w );
READ_LINE_DEVICE_HANDLER( wd17xx_drq_r );
READ_LINE_DEVICE_HANDLER( wd17xx_intrq_r );
extern const wd17xx_interface default_wd17xx_interface;
extern const wd17xx_interface default_wd17xx_interface_2_drives;
/***************************************************************************
DEVICE CONFIGURATION MACROS
***************************************************************************/

View File

@ -91,7 +91,7 @@ public:
protected:
required_device<cpu_device> m_maincpu;
optional_device<i2cmem_device> m_i2cmem;
optional_device<device_t> m_wd1772;
optional_device<wd1772_device> m_wd1772;
required_memory_region m_region_maincpu;
required_memory_region m_region_vram;
required_device<screen_device> m_screen;

View File

@ -664,7 +664,7 @@ READ32_MEMBER(archimedes_state::archimedes_ioc_r)
case 1:
if (m_wd1772) {
logerror("17XX: R @ addr %x mask %08x\n", offset*4, mem_mask);
return wd17xx_data_r(m_wd1772, space, offset&0xf);
return m_wd1772->data_r(space, offset&0xf);
} else {
logerror("Read from FDC device?\n");
return 0;
@ -719,7 +719,7 @@ WRITE32_MEMBER(archimedes_state::archimedes_ioc_w)
case 1:
if (m_wd1772) {
logerror("17XX: %x to addr %x mask %08x\n", data, offset*4, mem_mask);
wd17xx_data_w(m_wd1772, space, offset&0xf, data&0xff);
m_wd1772->data_w(space, offset&0xf, data&0xff);
} else {
logerror("Write to FDC device?\n");
}
@ -738,16 +738,16 @@ WRITE32_MEMBER(archimedes_state::archimedes_ioc_w)
switch(ioc_addr & 0xfffc)
{
case 0x18: // latch B
wd17xx_dden_w(m_wd1772, BIT(data, 1));
m_wd1772->dden_w(BIT(data, 1));
return;
case 0x40: // latch A
if (data & 1) { wd17xx_set_drive(m_wd1772,0); }
if (data & 2) { wd17xx_set_drive(m_wd1772,1); }
if (data & 4) { wd17xx_set_drive(m_wd1772,2); }
if (data & 8) { wd17xx_set_drive(m_wd1772,3); }
if (data & 1) { m_wd1772->set_drive(0); }
if (data & 2) { m_wd1772->set_drive(1); }
if (data & 4) { m_wd1772->set_drive(2); }
if (data & 8) { m_wd1772->set_drive(3); }
wd17xx_set_side(m_wd1772,(data & 0x10)>>4);
m_wd1772->set_side((data & 0x10)>>4);
//bit 5 is motor on
return;
}

View File

@ -258,7 +258,7 @@ WRITE8_MEMBER( apf_state::apf_dischw_w)
/* bit 3 is index of drive to select */
UINT8 drive = BIT(data, 3);
wd17xx_set_drive(m_fdc, drive);
m_fdc->set_drive(drive);
floppy_image_legacy *floppy;
floppy = flopimg_get_image(floppy_get_device(machine(), drive));
floppy_mon_w(floppy_get_device(machine(), drive), (floppy != NULL) ? 0 : 1);
@ -293,7 +293,7 @@ static ADDRESS_MAP_START( apfimag_map, AS_PROGRAM, 8, apf_state )
AM_RANGE( 0x6000, 0x63ff) AM_MIRROR(0x03fc) AM_DEVREADWRITE("pia1", pia6821_device, read, write)
// These need to be confirmed, disk does not work
AM_RANGE( 0x6400, 0x64ff) AM_READWRITE(serial_r, serial_w)
AM_RANGE( 0x6500, 0x6503) AM_DEVREADWRITE_LEGACY("fdc", wd17xx_r, wd17xx_w)
AM_RANGE( 0x6500, 0x6503) AM_DEVREADWRITE("fdc", fd1771_device, read, write)
AM_RANGE( 0x6600, 0x6600) AM_WRITE(apf_dischw_w)
AM_RANGE( 0xa000, 0xbfff) AM_RAM // standard
AM_RANGE( 0xc000, 0xdfff) AM_RAM // expansion

View File

@ -432,19 +432,19 @@ WRITE_LINE_MEMBER(fm7_state::fm7_fdc_drq_w)
READ8_MEMBER(fm7_state::fm7_fdc_r)
{
device_t* dev = machine().device("fdc");
mb8877_device *fdc = machine().device<mb8877_device>("fdc");
UINT8 ret = 0;
switch(offset)
{
case 0:
return wd17xx_status_r(dev,space, offset);
return fdc->status_r(space, offset);
case 1:
return wd17xx_track_r(dev,space, offset);
return fdc->track_r(space, offset);
case 2:
return wd17xx_sector_r(dev,space, offset);
return fdc->sector_r(space, offset);
case 3:
return wd17xx_data_r(dev,space, offset);
return fdc->data_r(space, offset);
case 4:
return m_fdc_side | 0xfe;
case 5:
@ -466,24 +466,24 @@ READ8_MEMBER(fm7_state::fm7_fdc_r)
WRITE8_MEMBER(fm7_state::fm7_fdc_w)
{
device_t* dev = machine().device("fdc");
mb8877_device *fdc = machine().device<mb8877_device>("fdc");
switch(offset)
{
case 0:
wd17xx_command_w(dev,space, offset,data);
fdc->command_w(space, offset,data);
break;
case 1:
wd17xx_track_w(dev,space, offset,data);
fdc->track_w(space, offset,data);
break;
case 2:
wd17xx_sector_w(dev,space, offset,data);
fdc->sector_w(space, offset,data);
break;
case 3:
wd17xx_data_w(dev,space, offset,data);
fdc->data_w(space, offset,data);
break;
case 4:
m_fdc_side = data & 0x01;
wd17xx_set_side(dev,data & 0x01);
fdc->set_side(data & 0x01);
logerror("FDC: wrote %02x to 0x%04x (side)\n",data,offset+0xfd18);
break;
case 5:
@ -494,7 +494,7 @@ WRITE8_MEMBER(fm7_state::fm7_fdc_w)
}
else
{
wd17xx_set_drive(dev,data & 0x03);
fdc->set_drive(data & 0x03);
floppy_mon_w(floppy_get_device(machine(), data & 0x03), !BIT(data, 7));
floppy_drive_set_ready_state(floppy_get_device(machine(), data & 0x03), data & 0x80,0);
logerror("FDC: wrote %02x to 0x%04x (drive)\n",data,offset+0xfd18);

View File

@ -499,20 +499,19 @@ WRITE_LINE_MEMBER( towns_state::mb8877a_drq_w )
READ8_MEMBER(towns_state::towns_floppy_r)
{
device_t* fdc = m_fdc;
device_image_interface* image;
UINT8 ret;
switch(offset)
{
case 0x00:
return wd17xx_status_r(fdc,space, offset/2);
return m_fdc->status_r(space, offset/2);
case 0x02:
return wd17xx_track_r(fdc,space, offset/2);
return m_fdc->track_r(space, offset/2);
case 0x04:
return wd17xx_sector_r(fdc,space, offset/2);
return m_fdc->sector_r(space, offset/2);
case 0x06:
return wd17xx_data_r(fdc,space, offset/2);
return m_fdc->data_r(space, offset/2);
case 0x08: // selected drive status?
//logerror("FDC: read from offset 0x08\n");
ret = 0x80; // always set
@ -548,8 +547,6 @@ READ8_MEMBER(towns_state::towns_floppy_r)
WRITE8_MEMBER(towns_state::towns_floppy_w)
{
device_t* fdc = m_fdc;
switch(offset)
{
case 0x00:
@ -558,16 +555,16 @@ WRITE8_MEMBER(towns_state::towns_floppy_w)
return;
if(data == 0xfe)
return;
wd17xx_command_w(fdc,space, offset/2,data);
m_fdc->command_w(space, offset/2,data);
break;
case 0x02:
wd17xx_track_w(fdc,space, offset/2,data);
m_fdc->track_w(space, offset/2,data);
break;
case 0x04:
wd17xx_sector_w(fdc,space, offset/2,data);
m_fdc->sector_w(space, offset/2,data);
break;
case 0x06:
wd17xx_data_w(fdc,space, offset/2,data);
m_fdc->data_w(space, offset/2,data);
break;
case 0x08:
// bit 5 - CLKSEL
@ -576,8 +573,8 @@ WRITE8_MEMBER(towns_state::towns_floppy_w)
floppy_mon_w(floppy_get_device(space.machine(), m_towns_selected_drive-1), !BIT(data, 4));
floppy_drive_set_ready_state(floppy_get_device(space.machine(), m_towns_selected_drive-1), data & 0x10,0);
}
wd17xx_set_side(fdc,(data & 0x04)>>2);
wd17xx_dden_w(fdc, BIT(~data, 1));
m_fdc->set_side((data & 0x04)>>2);
m_fdc->dden_w(BIT(~data, 1));
m_towns_fdc_irq6mask = data & 0x01;
logerror("FDC: write %02x to offset 0x08\n",data);
@ -590,19 +587,19 @@ WRITE8_MEMBER(towns_state::towns_floppy_w)
break;
case 0x01:
m_towns_selected_drive = 1;
wd17xx_set_drive(fdc,0);
m_fdc->set_drive(0);
break;
case 0x02:
m_towns_selected_drive = 2;
wd17xx_set_drive(fdc,1);
m_fdc->set_drive(1);
break;
case 0x04:
m_towns_selected_drive = 3;
wd17xx_set_drive(fdc,2);
m_fdc->set_drive(2);
break;
case 0x08:
m_towns_selected_drive = 4;
wd17xx_set_drive(fdc,3);
m_fdc->set_drive(3);
break;
}
logerror("FDC: drive select %02x\n",data);
@ -613,15 +610,13 @@ WRITE8_MEMBER(towns_state::towns_floppy_w)
}
READ16_MEMBER(towns_state::towns_fdc_dma_r)
{
device_t* fdc = m_fdc;
return wd17xx_data_r(fdc,generic_space(), 0);
{
return m_fdc->data_r(generic_space(), 0);
}
WRITE16_MEMBER(towns_state::towns_fdc_dma_w)
{
device_t* fdc = m_fdc;
wd17xx_data_w(fdc,generic_space(), 0,data);
m_fdc->data_w(generic_space(), 0,data);
}
/*
@ -2601,7 +2596,7 @@ void marty_state::driver_start()
void towns_state::machine_reset()
{
address_space &program = m_maincpu->space(AS_PROGRAM);
m_fdc = machine().device("fdc");
m_fdc = machine().device<mb8877_device>("fdc");
m_messram = m_ram;
m_cdrom = machine().device<cdrom_image_device>("cdrom");
m_cdda = machine().device<cdda_device>("cdda");

View File

@ -85,7 +85,7 @@ static ADDRESS_MAP_START( mbc200_io , AS_IO, 8, mbc200_state)
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0xe0, 0xe0) AM_DEVREADWRITE("i8251_1", i8251_device, data_r, data_w)
AM_RANGE(0xe1, 0xe1) AM_DEVREADWRITE("i8251_1", i8251_device, status_r, control_w)
AM_RANGE(0xe4, 0xe7) AM_DEVREADWRITE_LEGACY("fdc", wd17xx_r, wd17xx_w)
AM_RANGE(0xe4, 0xe7) AM_DEVREADWRITE("fdc", mb8876_device, read, write)
AM_RANGE(0xea, 0xea) AM_READ(ppi_hs_r)
AM_RANGE(0xe8, 0xeb) AM_DEVREADWRITE("ppi8255_2", i8255_device, read, write)
AM_RANGE(0xec, 0xec) AM_DEVREADWRITE("i8251_2", i8251_device, data_r, data_w)

View File

@ -70,10 +70,10 @@ static ADDRESS_MAP_START(ms0515_mem, AS_PROGRAM, 16, ms0515_state)
AM_RANGE(0177600, 0177607) AM_DEVREADWRITE8("ppi8255_1", i8255_device, read, write, 0x00ff)
AM_RANGE(0177640, 0177641) AM_DEVREADWRITE8_LEGACY("vg93", wd17xx_status_r, wd17xx_command_w,0x00ff)
AM_RANGE(0177642, 0177643) AM_DEVREADWRITE8_LEGACY("vg93", wd17xx_track_r, wd17xx_track_w,0x00ff)
AM_RANGE(0177644, 0177645) AM_DEVREADWRITE8_LEGACY("vg93", wd17xx_sector_r, wd17xx_sector_w,0x00ff)
AM_RANGE(0177646, 0177647) AM_DEVREADWRITE8_LEGACY("vg93", wd17xx_data_r, wd17xx_data_w,0x00ff)
AM_RANGE(0177640, 0177641) AM_DEVREADWRITE8("vg93", fd1793_device, status_r, command_w,0x00ff)
AM_RANGE(0177642, 0177643) AM_DEVREADWRITE8("vg93", fd1793_device, track_r, track_w,0x00ff)
AM_RANGE(0177644, 0177645) AM_DEVREADWRITE8("vg93", fd1793_device, sector_r, sector_w,0x00ff)
AM_RANGE(0177646, 0177647) AM_DEVREADWRITE8("vg93", fd1793_device, data_r, data_w,0x00ff)
//AM_RANGE(0177700, 0177701) // read data
//AM_RANGE(0177720, 0177721) // write data // protocol S2

View File

@ -126,10 +126,10 @@ WRITE8_MEMBER( myb3k_state::myb3k_video_mode_w )
WRITE8_MEMBER( myb3k_state::myb3k_fdc_output_w )
{
/* TODO: complete guesswork! (it just does a 0x24 -> 0x20 in there) */
wd17xx_set_drive(m_fdc, data & 3);
m_fdc->set_drive(data & 3);
floppy_mon_w(floppy_get_device(machine(), data & 3), !(data & 4) ? 1: 0);
floppy_drive_set_ready_state(floppy_get_device(machine(), data & 3), data & 0x4,0);
//wd17xx_set_side(m_fdc, (data & 0x10)>>4);
//m_fdc->set_side((data & 0x10)>>4);
}
static ADDRESS_MAP_START(myb3k_map, AS_PROGRAM, 8, myb3k_state)
@ -149,7 +149,7 @@ static ADDRESS_MAP_START(myb3k_io, AS_IO, 8, myb3k_state)
AM_RANGE(0x06, 0x06) AM_READ_PORT("DSW2")
AM_RANGE(0x1c, 0x1c) AM_WRITE(myb3k_6845_address_w)
AM_RANGE(0x1d, 0x1d) AM_WRITE(myb3k_6845_data_w)
AM_RANGE(0x20, 0x23) AM_DEVREADWRITE_LEGACY("fdc",wd17xx_r,wd17xx_w) //FDC, almost likely wd17xx
AM_RANGE(0x20, 0x23) AM_DEVREADWRITE("fdc", mb8877_device, read, write) //FDC, almost likely wd17xx
AM_RANGE(0x24, 0x24) AM_WRITE(myb3k_fdc_output_w)
// AM_RANGE(0x520,0x524) mirror of above
ADDRESS_MAP_END

View File

@ -120,7 +120,7 @@ public:
protected:
required_device<cpu_device> m_maincpu;
required_device<device_t> m_mb8877a;
required_device<mb8877_device> m_mb8877a;
required_device<pit8253_device> m_pit8253;
required_device<beep_device> m_beeper;
required_memory_region m_region_tvram;
@ -343,7 +343,7 @@ WRITE8_MEMBER(mz2000_state::mz2000_gvram_bank_w)
READ8_MEMBER(mz2000_state::mz2000_wd17xx_r)
{
if(m_has_fdc)
return wd17xx_r(m_mb8877a, space, offset) ^ 0xff;
return m_mb8877a->read(space, offset) ^ 0xff;
return 0xff;
}
@ -351,7 +351,7 @@ READ8_MEMBER(mz2000_state::mz2000_wd17xx_r)
WRITE8_MEMBER(mz2000_state::mz2000_wd17xx_w)
{
if(m_has_fdc)
wd17xx_w(m_mb8877a, space, offset, data ^ 0xff);
m_mb8877a->write(space, offset, data ^ 0xff);
}
WRITE8_MEMBER(mz2000_state::mz2000_fdc_w)
@ -359,12 +359,12 @@ WRITE8_MEMBER(mz2000_state::mz2000_fdc_w)
switch(offset+0xdc)
{
case 0xdc:
wd17xx_set_drive(m_mb8877a,data & 3);
m_mb8877a->set_drive(data & 3);
floppy_mon_w(floppy_get_device(machine(), data & 3), (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
floppy_drive_set_ready_state(floppy_get_device(machine(), data & 3), 1,0);
break;
case 0xdd:
wd17xx_set_side(m_mb8877a,(data & 1));
m_mb8877a->set_side((data & 1));
break;
}
}

View File

@ -1184,17 +1184,17 @@ WRITE8_MEMBER(mz2500_state::mz2500_irq_data_w)
WRITE8_MEMBER(mz2500_state::mz2500_fdc_w)
{
device_t* dev = machine().device("mb8877a");
mb8877_device *fdc = machine().device<mb8877_device>("mb8877a");
switch(offset+0xdc)
{
case 0xdc:
wd17xx_set_drive(dev,data & 3);
fdc->set_drive(data & 3);
floppy_mon_w(floppy_get_device(machine(), data & 3), (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
floppy_drive_set_ready_state(floppy_get_device(machine(), data & 3), 1,0);
break;
case 0xdd:
wd17xx_set_side(dev,(data & 1));
fdc->set_side((data & 1));
break;
}
}
@ -1282,14 +1282,14 @@ WRITE8_MEMBER(mz2500_state::palette4096_io_w)
READ8_MEMBER(mz2500_state::mz2500_wd17xx_r)
{
device_t *device = machine().device("mb8877a");
return wd17xx_r(device, space, offset) ^ m_fdc_reverse;
mb8877_device *fdc = machine().device<mb8877_device>("mb8877a");
return fdc->read(space, offset) ^ m_fdc_reverse;
}
WRITE8_MEMBER(mz2500_state::mz2500_wd17xx_w)
{
device_t *device = machine().device("mb8877a");
wd17xx_w(device, space, offset, data ^ m_fdc_reverse);
mb8877_device *fdc = machine().device<mb8877_device>("mb8877a");
fdc->write(space, offset, data ^ m_fdc_reverse);
}
READ8_MEMBER(mz2500_state::mz2500_bplane_latch_r)

View File

@ -105,7 +105,7 @@ static ADDRESS_MAP_START( nascom2_io, AS_IO, 8, nascom1_state )
AM_RANGE(0x01, 0x01) AM_READWRITE(nascom1_port_01_r, nascom1_port_01_w)
AM_RANGE(0x02, 0x02) AM_READ(nascom1_port_02_r)
AM_RANGE(0x04, 0x07) AM_DEVREADWRITE("z80pio", z80pio_device, read, write )
AM_RANGE(0xe0, 0xe3) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_r, wd17xx_w)
AM_RANGE(0xe0, 0xe3) AM_DEVREADWRITE("wd1793", fd1793_device, read, write)
AM_RANGE(0xe4, 0xe4) AM_READWRITE(nascom2_fdc_select_r, nascom2_fdc_select_w)
AM_RANGE(0xe5, 0xe5) AM_READ(nascom2_fdc_status_r)
ADDRESS_MAP_END

View File

@ -213,7 +213,7 @@ static ADDRESS_MAP_START( osbexec_io, AS_IO, 8, osbexec_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE( 0x00, 0x03 ) AM_MIRROR( 0xff00 ) AM_DEVREADWRITE( "pia_0", pia6821_device, read, write) /* 6821 PIA @ UD12 */
/* 0x04 - 0x07 - 8253 @UD1 */
AM_RANGE( 0x08, 0x0B ) AM_MIRROR( 0xff00 ) AM_DEVREADWRITE_LEGACY("mb8877", wd17xx_r, wd17xx_w ) /* MB8877 @ UB17 input clock = 1MHz */
AM_RANGE( 0x08, 0x0B ) AM_MIRROR( 0xff00 ) AM_DEVREADWRITE("mb8877", mb8877_device, read, write ) /* MB8877 @ UB17 input clock = 1MHz */
AM_RANGE( 0x0C, 0x0F ) AM_MIRROR( 0xff00 ) AM_DEVREADWRITE("sio", z80sio2_device, ba_cd_r, ba_cd_w ) /* SIO @ UD4 */
AM_RANGE( 0x10, 0x13 ) AM_MIRROR( 0xff00 ) AM_DEVREADWRITE( "pia_1", pia6821_device, read, write) /* 6821 PIA @ UD8 */
AM_RANGE( 0x14, 0x17 ) AM_MIRROR( 0xff00 ) AM_MASK( 0xff00 ) AM_READ(osbexec_kbd_r ) /* KBD */
@ -384,14 +384,14 @@ WRITE8_MEMBER(osbexec_state::osbexec_pia0_b_w)
switch ( data & 0x06 )
{
case 0x02:
wd17xx_set_drive( m_mb8877, 1 );
m_mb8877->set_drive( 1 );
break;
case 0x04:
wd17xx_set_drive( m_mb8877, 0 );
m_mb8877->set_drive( 0 );
break;
}
wd17xx_dden_w( m_mb8877, ( data & 0x01 ) ? 1 : 0 );
m_mb8877->dden_w(( data & 0x01 ) ? 1 : 0 );
}

View File

@ -11,7 +11,6 @@
#include "emu.h"
#include "cpu/i8085/i8085.h"
#include "machine/i8255.h"
#include "machine/wd17xx.h"
#include "imagedev/flopdrv.h"
#include "formats/basicdsk.h"
#include "includes/pk8020.h"

View File

@ -272,10 +272,10 @@ READ8_MEMBER( ql_state::disk_io_r )
switch (offset)
{
case 0x0000 : result=wd17xx_r(m_fdc, space, offset); break;
case 0x0001 : result=wd17xx_r(m_fdc, space, offset); break;
case 0x0002 : result=wd17xx_r(m_fdc, space, offset); break;
case 0x0003 : result=wd17xx_r(m_fdc, space, offset); break;
case 0x0000 : result=m_fdc->read(space, offset); break;
case 0x0001 : result=m_fdc->read(space, offset); break;
case 0x0002 : result=m_fdc->read(space, offset); break;
case 0x0003 : result=m_fdc->read(space, offset); break;
default : logerror("%s DiskIO undefined read : from %08X\n",machine().describe_context(),m_disk_io_base+offset); break;
}
@ -289,10 +289,10 @@ WRITE8_MEMBER( ql_state::disk_io_w )
switch (offset)
{
case 0x0000 : wd17xx_w(m_fdc, space, offset, data); break;
case 0x0001 : wd17xx_w(m_fdc, space, offset, data); break;
case 0x0002 : wd17xx_w(m_fdc, space, offset, data); break;
case 0x0003 : wd17xx_w(m_fdc, space, offset, data); break;
case 0x0000 : m_fdc->write(space, offset, data); break;
case 0x0001 : m_fdc->write(space, offset, data); break;
case 0x0002 : m_fdc->write(space, offset, data); break;
case 0x0003 : m_fdc->write(space, offset, data); break;
case 0x0004 : if(m_disk_type==DISK_TYPE_SANDY)
sandy_set_control(data);break;
case 0x0008 : if(m_disk_type==DISK_TYPE_SANDY)
@ -332,12 +332,12 @@ READ8_MEMBER( ql_state::cart_rom_r )
void ql_state::trump_card_set_control(UINT8 data)
{
if(data & TRUMP_DRIVE0_MASK)
wd17xx_set_drive(m_fdc,0);
m_fdc->set_drive(0);
if(data & TRUMP_DRIVE1_MASK)
wd17xx_set_drive(m_fdc,1);
m_fdc->set_drive(1);
wd17xx_set_side(m_fdc,(data & TRUMP_SIDE_MASK) >> TRUMP_SIDE_SHIFT);
m_fdc->set_side((data & TRUMP_SIDE_MASK) >> TRUMP_SIDE_SHIFT);
}
void ql_state::sandy_set_control(UINT8 data)
@ -347,12 +347,12 @@ void ql_state::sandy_set_control(UINT8 data)
m_disk_io_byte=data;
if(data & SANDY_DRIVE0_MASK)
wd17xx_set_drive(m_fdc,0);
m_fdc->set_drive(0);
if(data & SANDY_DRIVE1_MASK)
wd17xx_set_drive(m_fdc,1);
m_fdc->set_drive(1);
wd17xx_set_side(m_fdc,(data & SANDY_SIDE_MASK) >> SANDY_SIDE_SHIFT);
m_fdc->set_side((data & SANDY_SIDE_MASK) >> SANDY_SIDE_SHIFT);
if ((data & SANDY_SIDE_MASK) & (LOG_DISK_READ | LOG_DISK_WRITE))
{
logerror("Accessing side 1\n");

View File

@ -459,10 +459,10 @@ static ADDRESS_MAP_START( rainbowz80_io, AS_IO, 8, rainbow_state)
AM_RANGE(0x20, 0x20) AM_READWRITE(z80_generalstat_r, z80_diskdiag_read_w) // read to port 0x20 used by MS-DOS 2.x diskette loader.
AM_RANGE(0x21, 0x21) AM_READWRITE(z80_generalstat_r, z80_diskdiag_write_w)
AM_RANGE(0x40, 0x40) AM_READWRITE(z80_diskstatus_r, z80_diskcontrol_w)
AM_RANGE(0x60, 0x60) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_status_r, wd17xx_command_w)
AM_RANGE(0x61, 0x61) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_track_r, wd17xx_track_w)
AM_RANGE(0x62, 0x62) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_sector_r, wd17xx_sector_w)
AM_RANGE(0x63, 0x63) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_data_r, wd17xx_data_w)
AM_RANGE(0x60, 0x60) AM_DEVREADWRITE("wd1793", fd1793_device ,status_r, command_w)
AM_RANGE(0x61, 0x61) AM_DEVREADWRITE("wd1793", fd1793_device, track_r, track_w)
AM_RANGE(0x62, 0x62) AM_DEVREADWRITE("wd1793", fd1793_device, sector_r, sector_w)
AM_RANGE(0x63, 0x63) AM_DEVREADWRITE("wd1793", fd1793_device, data_r, data_w)
ADDRESS_MAP_END
/* Input ports */
@ -902,39 +902,39 @@ WRITE8_MEMBER(rainbow_state::z80_diskdiag_write_w)
// **********************************************************************
READ8_MEMBER(rainbow_state::z80_diskstatus_r)
{
static int last_track;
int track = wd17xx_track_r(m_fdc, space, 0);
static int last_track;
int track = m_fdc->track_r( space, 0);
if (track != last_track)
printf("\n%02d",track);
last_track = track;
if (track != last_track)
printf("\n%02d",track);
last_track = track;
// 40H diskette status Register **** READ ONLY *** ( 4-60 of TM100.pdf )
// 40H diskette status Register **** READ ONLY *** ( 4-60 of TM100.pdf )
// AND 00111011 - return what was WRITTEN to D5-D3, D1, D0 previously
// (except D7,D6,D2)
int data = m_z80_diskcontrol && 0x3b;
// AND 00111011 - return what was WRITTEN to D5-D3, D1, D0 previously
// (except D7,D6,D2)
int data = m_z80_diskcontrol && 0x3b;
// D7: DRQ: reflects status of DATA REQUEST signal from FDC.
// '1' indicates that FDC has read data OR requires new write data.
data |= wd17xx_drq_r(m_fdc) ? 0x80 : 0x00;
// D7: DRQ: reflects status of DATA REQUEST signal from FDC.
// '1' indicates that FDC has read data OR requires new write data.
data |= m_fdc->drq_r() ? 0x80 : 0x00;
// D6: IRQ: indicates INTERRUPT REQUEST signal from FDC. Indicates that a
// status bit has changed. Set to 1 at the completion of any
// command (.. see page 207 or 5-25).
data |= wd17xx_intrq_r(m_fdc) ? 0x40 : 0x00;
// D6: IRQ: indicates INTERRUPT REQUEST signal from FDC. Indicates that a
// status bit has changed. Set to 1 at the completion of any
// command (.. see page 207 or 5-25).
data |= m_fdc->intrq_r() ? 0x40 : 0x00;
// D5: SIDE 0H: status of side select signal at J2 + J3 of RX50 controller.
// For 1 sided drives, this bit will always read low (0).
// D5: SIDE 0H: status of side select signal at J2 + J3 of RX50 controller.
// For 1 sided drives, this bit will always read low (0).
// D4: MOTOR 1 ON L: 0 = indicates MOTOR 1 ON bit is set in drive control reg.
// D3: MOTOR 0 ON L: 0 = indicates MOTOR 0 ON bit is set in drive "
// D4: MOTOR 1 ON L: 0 = indicates MOTOR 1 ON bit is set in drive control reg.
// D3: MOTOR 0 ON L: 0 = indicates MOTOR 0 ON bit is set in drive "
// D2: TG43 L : 0 = INDICATES TRACK > 43 SIGNAL FROM FDC TO DISK DRIVE.
data |= ( track > 43) ? 0x00 : 0x04;
// D2: TG43 L : 0 = INDICATES TRACK > 43 SIGNAL FROM FDC TO DISK DRIVE.
data |= ( track > 43) ? 0x00 : 0x04;
// D1: DS1 H: reflect status of bits 0 and 1 form disk.control reg.
// D0: DS0 H: "
// D1: DS1 H: reflect status of bits 0 and 1 form disk.control reg.
// D0: DS0 H: "
return data;
}
@ -960,14 +960,14 @@ WRITE8_MEMBER(rainbow_state::z80_diskcontrol_w)
if (flopimg_get_image( floppy_get_device( machine(), drive ) ) != NULL)
{ selected_drive = drive;
wd17xx_set_drive(m_fdc, selected_drive);
m_fdc->set_drive(selected_drive);
}
// WD emulation (wd17xx.c) will ignore 'side select' if set to WD1793.
// Is it safe to * always assume * single sided 400 K disks?
wd17xx_set_side(m_fdc, (data & 20) ? 1 : 0);
m_fdc->set_side((data & 20) ? 1 : 0);
wd17xx_dden_w(m_fdc, 0); /* SEE 'WRITE_TRACK' : 1 = SD; 0 = DD; enable double density */
m_fdc->dden_w(0); /* SEE 'WRITE_TRACK' : 1 = SD; 0 = DD; enable double density */
output_set_value("driveled0", (selected_drive == 0) ? 1 : 0 );
output_set_value("driveled1", (selected_drive == 1) ? 1 : 0 );
@ -1065,7 +1065,7 @@ WRITE8_MEMBER( rainbow_state::diagnostic_w )
// reset device when going from high to low,
// restore command when going from low to high :
wd17xx_mr_w(m_fdc, (data & 1) ? 1 : 0);
m_fdc->mr_w((data & 1) ? 1 : 0);
m_diagnostic = data;
}

View File

@ -101,10 +101,10 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( rm380z_io , AS_IO, 8, rm380z_state)
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0xbf) AM_READWRITE(rm380z_portlow_r, rm380z_portlow_w)
AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE_LEGACY("wd1771", wd17xx_status_r, wd17xx_command_w)
AM_RANGE(0xc1, 0xc1) AM_DEVREADWRITE_LEGACY("wd1771", wd17xx_track_r, wd17xx_track_w)
AM_RANGE(0xc2, 0xc2) AM_DEVREADWRITE_LEGACY("wd1771", wd17xx_sector_r, wd17xx_sector_w)
AM_RANGE(0xc3, 0xc3) AM_DEVREADWRITE_LEGACY("wd1771", wd17xx_data_r, wd17xx_data_w)
AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE("wd1771", fd1771_device, status_r, command_w)
AM_RANGE(0xc1, 0xc1) AM_DEVREADWRITE("wd1771", fd1771_device, track_r, track_w)
AM_RANGE(0xc2, 0xc2) AM_DEVREADWRITE("wd1771", fd1771_device, sector_r, sector_w)
AM_RANGE(0xc3, 0xc3) AM_DEVREADWRITE("wd1771", fd1771_device, data_r, data_w)
AM_RANGE(0xc4, 0xc4) AM_WRITE(disk_0_control)
AM_RANGE(0xc5, 0xff) AM_READWRITE(rm380z_porthi_r, rm380z_porthi_w)
ADDRESS_MAP_END

View File

@ -402,13 +402,13 @@ READ8_MEMBER(smc777_state::smc777_fdc1_r)
switch(offset)
{
case 0x00:
return wd17xx_status_r(m_fdc,space, offset) ^ 0xff;
return m_fdc->status_r(space, offset) ^ 0xff;
case 0x01:
return wd17xx_track_r(m_fdc,space, offset) ^ 0xff;
return m_fdc->track_r(space, offset) ^ 0xff;
case 0x02:
return wd17xx_sector_r(m_fdc,space, offset) ^ 0xff;
return m_fdc->sector_r(space, offset) ^ 0xff;
case 0x03:
return wd17xx_data_r(m_fdc,space, offset) ^ 0xff;
return m_fdc->data_r(space, offset) ^ 0xff;
case 0x04: //irq / drq status
//popmessage("%02x %02x\n",m_fdc_irq_flag,m_fdc_drq_flag);
@ -425,21 +425,21 @@ WRITE8_MEMBER(smc777_state::smc777_fdc1_w)
switch(offset)
{
case 0x00:
wd17xx_command_w(m_fdc,space, offset,data ^ 0xff);
m_fdc->command_w(space, offset,data ^ 0xff);
break;
case 0x01:
wd17xx_track_w(m_fdc,space, offset,data ^ 0xff);
m_fdc->track_w(space, offset,data ^ 0xff);
break;
case 0x02:
wd17xx_sector_w(m_fdc,space, offset,data ^ 0xff);
m_fdc->sector_w(space, offset,data ^ 0xff);
break;
case 0x03:
wd17xx_data_w(m_fdc,space, offset,data ^ 0xff);
m_fdc->data_w(space, offset,data ^ 0xff);
break;
case 0x04:
// ---- xxxx select floppy drive (yes, 15 of them, A to P)
wd17xx_set_drive(m_fdc,data & 0x01);
// wd17xx_set_side(m_fdc,(data & 0x10)>>4);
m_fdc->set_drive(data & 0x01);
// m_fdc->set_side((data & 0x10)>>4);
if(data & 0xf0)
printf("floppy access %02x\n",data);
break;

View File

@ -158,10 +158,10 @@ static ADDRESS_MAP_START( model1_map, AS_PROGRAM, 8, trs80_state )
AM_RANGE(0x37e4, 0x37e7) AM_WRITE(trs80_cassunit_w)
AM_RANGE(0x37e8, 0x37eb) AM_READWRITE(trs80_printer_r, trs80_printer_w)
AM_RANGE(0x37ec, 0x37ec) AM_READ(trs80_wd179x_r)
AM_RANGE(0x37ec, 0x37ec) AM_DEVWRITE_LEGACY("wd179x", wd17xx_command_w)
AM_RANGE(0x37ed, 0x37ed) AM_DEVREADWRITE_LEGACY("wd179x", wd17xx_track_r, wd17xx_track_w)
AM_RANGE(0x37ee, 0x37ee) AM_DEVREADWRITE_LEGACY("wd179x", wd17xx_sector_r, wd17xx_sector_w)
AM_RANGE(0x37ef, 0x37ef) AM_DEVREADWRITE_LEGACY("wd179x", wd17xx_data_r, wd17xx_data_w)
AM_RANGE(0x37ec, 0x37ec) AM_DEVWRITE("wd179x", fd1793_device, command_w)
AM_RANGE(0x37ed, 0x37ed) AM_DEVREADWRITE("wd179x", fd1793_device, track_r, track_w)
AM_RANGE(0x37ee, 0x37ee) AM_DEVREADWRITE("wd179x", fd1793_device, sector_r, sector_w)
AM_RANGE(0x37ef, 0x37ef) AM_DEVREADWRITE("wd179x", fd1793_device, data_r, data_w)
AM_RANGE(0x3800, 0x38ff) AM_MIRROR(0x300) AM_READ(trs80_keyboard_r)
AM_RANGE(0x3c00, 0x3fff) AM_READWRITE(trs80_videoram_r, trs80_videoram_w) AM_SHARE("p_videoram")
AM_RANGE(0x4000, 0xffff) AM_RAM
@ -208,10 +208,10 @@ static ADDRESS_MAP_START( model3_io, AS_IO, 8, trs80_state )
AM_RANGE(0xeb, 0xeb) AM_READWRITE(trs80m4_eb_r, trs80m4_eb_w)
AM_RANGE(0xec, 0xef) AM_READWRITE(trs80m4_ec_r, trs80m4_ec_w)
AM_RANGE(0xf0, 0xf0) AM_READ(trs80_wd179x_r)
AM_RANGE(0xf0, 0xf0) AM_DEVWRITE_LEGACY("wd179x", wd17xx_command_w)
AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE_LEGACY("wd179x", wd17xx_track_r, wd17xx_track_w)
AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE_LEGACY("wd179x", wd17xx_sector_r, wd17xx_sector_w)
AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE_LEGACY("wd179x", wd17xx_data_r, wd17xx_data_w)
AM_RANGE(0xf0, 0xf0) AM_DEVWRITE("wd179x", fd1793_device, command_w)
AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE("wd179x", fd1793_device, track_r, track_w)
AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE("wd179x", fd1793_device, sector_r, sector_w)
AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE("wd179x", fd1793_device, data_r, data_w)
AM_RANGE(0xf4, 0xf4) AM_WRITE(trs80m4_f4_w)
AM_RANGE(0xf8, 0xfb) AM_READWRITE(trs80_printer_r, trs80_printer_w)
AM_RANGE(0xfc, 0xff) AM_READWRITE(trs80m4_ff_r, trs80m4_ff_w)
@ -230,10 +230,10 @@ static ADDRESS_MAP_START( model4_io, AS_IO, 8, trs80_state )
AM_RANGE(0xeb, 0xeb) AM_READWRITE(trs80m4_eb_r, trs80m4_eb_w)
AM_RANGE(0xec, 0xef) AM_READWRITE(trs80m4_ec_r, trs80m4_ec_w)
AM_RANGE(0xf0, 0xf0) AM_READ(trs80_wd179x_r)
AM_RANGE(0xf0, 0xf0) AM_DEVWRITE_LEGACY("wd179x", wd17xx_command_w)
AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE_LEGACY("wd179x", wd17xx_track_r, wd17xx_track_w)
AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE_LEGACY("wd179x", wd17xx_sector_r, wd17xx_sector_w)
AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE_LEGACY("wd179x", wd17xx_data_r, wd17xx_data_w)
AM_RANGE(0xf0, 0xf0) AM_DEVWRITE("wd179x", fd1793_device, command_w)
AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE("wd179x", fd1793_device, track_r, track_w)
AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE("wd179x", fd1793_device, sector_r, sector_w)
AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE("wd179x", fd1793_device, data_r, data_w)
AM_RANGE(0xf4, 0xf4) AM_WRITE(trs80m4_f4_w)
AM_RANGE(0xf8, 0xfb) AM_READWRITE(trs80_printer_r, trs80_printer_w)
AM_RANGE(0xfc, 0xff) AM_READWRITE(trs80m4_ff_r, trs80m4_ff_w)
@ -253,10 +253,10 @@ static ADDRESS_MAP_START( model4p_io, AS_IO, 8, trs80_state )
AM_RANGE(0xeb, 0xeb) AM_READWRITE(trs80m4_eb_r, trs80m4_eb_w)
AM_RANGE(0xec, 0xef) AM_READWRITE(trs80m4_ec_r, trs80m4_ec_w)
AM_RANGE(0xf0, 0xf0) AM_READ(trs80_wd179x_r)
AM_RANGE(0xf0, 0xf0) AM_DEVWRITE_LEGACY("wd179x", wd17xx_command_w)
AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE_LEGACY("wd179x", wd17xx_track_r, wd17xx_track_w)
AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE_LEGACY("wd179x", wd17xx_sector_r, wd17xx_sector_w)
AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE_LEGACY("wd179x", wd17xx_data_r, wd17xx_data_w)
AM_RANGE(0xf0, 0xf0) AM_DEVWRITE("wd179x", fd1793_device, command_w)
AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE("wd179x", fd1793_device, track_r, track_w)
AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE("wd179x", fd1793_device, sector_r, sector_w)
AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE("wd179x", fd1793_device, data_r, data_w)
AM_RANGE(0xf4, 0xf4) AM_WRITE(trs80m4_f4_w)
AM_RANGE(0xf8, 0xfb) AM_READWRITE(trs80_printer_r, trs80_printer_w)
AM_RANGE(0xfc, 0xff) AM_READWRITE(trs80m4_ff_r, trs80m4_ff_w)
@ -277,10 +277,10 @@ static ADDRESS_MAP_START( meritum_io, AS_IO, 8, trs80_state )
// eg. port F0 should be 5, port F2 should have bit 3 set.
//AM_RANGE(0x03, 0x03) unknown
AM_RANGE(0xf0, 0xf0) AM_READ(trs80_wd179x_r)
AM_RANGE(0xf0, 0xf0) AM_DEVWRITE_LEGACY("wd179x", wd17xx_command_w)
AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE_LEGACY("wd179x", wd17xx_track_r, wd17xx_track_w)
AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE_LEGACY("wd179x", wd17xx_sector_r, wd17xx_sector_w)
AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE_LEGACY("wd179x", wd17xx_data_r, wd17xx_data_w)
AM_RANGE(0xf0, 0xf0) AM_DEVWRITE("wd179x", fd1793_device, command_w)
AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE("wd179x", fd1793_device, track_r, track_w)
AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE("wd179x", fd1793_device, sector_r, sector_w)
AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE("wd179x", fd1793_device, data_r, data_w)
AM_RANGE(0xf4, 0xf4) AM_WRITE(trs80m4_f4_w)
AM_RANGE(0xf8, 0xfb) AM_READWRITE(trs80_printer_r, trs80_printer_w)
//AM_RANGE(0xfc, 0xfd) unknown

View File

@ -91,7 +91,7 @@ READ16_MEMBER( unixpc_state::line_printer_r )
data |= 1; // no dial tone detected
data |= 1 << 1; // no parity error
data |= 0 << 2; // hdc intrq
data |= wd17xx_intrq_r(m_wd2797) << 3;
data |= m_wd2797->intrq_r() << 3;
logerror("line_printer_r: %04x\n", data);
@ -120,7 +120,7 @@ WRITE16_MEMBER( unixpc_state::disk_control_w )
floppy_mon_w(m_floppy, !BIT(data, 5));
// bit 6 = floppy selected / not selected
wd17xx_set_drive(m_wd2797, 0);
m_wd2797->set_drive(0);
}
WRITE_LINE_MEMBER( unixpc_state::wd2797_intrq_w )
@ -161,7 +161,7 @@ static ADDRESS_MAP_START( unixpc_mem, AS_PROGRAM, 16, unixpc_state )
AM_RANGE(0x4a0000, 0x4a0001) AM_WRITE(misc_control_w)
AM_RANGE(0x4e0000, 0x4e0001) AM_WRITE(disk_control_w)
AM_RANGE(0x800000, 0xbfffff) AM_MIRROR(0x7fc000) AM_ROM AM_REGION("bootrom", 0)
AM_RANGE(0xe10000, 0xe10007) AM_DEVREADWRITE8_LEGACY("wd2797", wd17xx_r, wd17xx_w, 0x00ff)
AM_RANGE(0xe10000, 0xe10007) AM_DEVREADWRITE8("wd2797", wd2797_device, read, write, 0x00ff)
AM_RANGE(0xe43000, 0xe43001) AM_WRITE(romlmap_w)
ADDRESS_MAP_END

View File

@ -23,10 +23,10 @@ static ADDRESS_MAP_START(vector06_io, AS_IO, 8, vector06_state)
AM_RANGE( 0x00, 0x03) AM_READWRITE(vector06_8255_1_r, vector06_8255_1_w )
AM_RANGE( 0x04, 0x07) AM_READWRITE(vector06_8255_2_r, vector06_8255_2_w )
AM_RANGE( 0x0C, 0x0C) AM_WRITE(vector06_color_set)
AM_RANGE( 0x18, 0x18) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_data_r,wd17xx_data_w)
AM_RANGE( 0x19, 0x19) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_sector_r,wd17xx_sector_w)
AM_RANGE( 0x1A, 0x1A) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_track_r,wd17xx_track_w)
AM_RANGE( 0x1B, 0x1B) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_status_r,wd17xx_command_w)
AM_RANGE( 0x18, 0x18) AM_DEVREADWRITE("wd1793", fd1793_device, data_r, data_w)
AM_RANGE( 0x19, 0x19) AM_DEVREADWRITE("wd1793", fd1793_device, sector_r, sector_w)
AM_RANGE( 0x1A, 0x1A) AM_DEVREADWRITE("wd1793", fd1793_device, track_r, track_w)
AM_RANGE( 0x1B, 0x1B) AM_DEVREADWRITE("wd1793", fd1793_device, status_r, command_w)
AM_RANGE( 0x1C, 0x1C) AM_WRITE(vector06_disc_w)
ADDRESS_MAP_END

View File

@ -995,13 +995,13 @@ READ8_MEMBER( x1_state::x1_fdc_r )
switch(offset+0xff8)
{
case 0x0ff8:
return wd17xx_status_r(m_fdc,space, offset);
return m_fdc->status_r(space, offset);
case 0x0ff9:
return wd17xx_track_r(m_fdc,space, offset);
return m_fdc->track_r(space, offset);
case 0x0ffa:
return wd17xx_sector_r(m_fdc,space, offset);
return m_fdc->sector_r(space, offset);
case 0x0ffb:
return wd17xx_data_r(m_fdc,space, offset);
return m_fdc->data_r(space, offset);
case 0x0ffc:
printf("FDC: read FM type\n");
return 0xff;
@ -1024,22 +1024,22 @@ WRITE8_MEMBER( x1_state::x1_fdc_w )
switch(offset+0xff8)
{
case 0x0ff8:
wd17xx_command_w(m_fdc,space, offset,data);
m_fdc->command_w(space, offset,data);
break;
case 0x0ff9:
wd17xx_track_w(m_fdc,space, offset,data);
m_fdc->track_w(space, offset,data);
break;
case 0x0ffa:
wd17xx_sector_w(m_fdc,space, offset,data);
m_fdc->sector_w(space, offset,data);
break;
case 0x0ffb:
wd17xx_data_w(m_fdc,space, offset,data);
m_fdc->data_w(space, offset,data);
break;
case 0x0ffc:
wd17xx_set_drive(m_fdc,data & 3);
m_fdc->set_drive(data & 3);
floppy_mon_w(floppy_get_device(machine(), data & 3), !BIT(data, 7));
floppy_drive_set_ready_state(floppy_get_device(machine(), data & 3), data & 0x80,0);
wd17xx_set_side(m_fdc, BIT(data, 4));
m_fdc->set_side(BIT(data, 4));
break;
case 0x0ffd:
case 0x0ffe:

View File

@ -358,10 +358,10 @@ READ8_MEMBER( z100_state::z207_fdc_r )
switch(offset)
{
case 0: res = wd17xx_status_r(m_fdc,space, offset); break;
case 1: res = wd17xx_track_r(m_fdc,space, offset); break;
case 2: res = wd17xx_sector_r(m_fdc,space, offset); break;
case 3: res = wd17xx_data_r(m_fdc,space, offset); break;
case 0: res = m_fdc->status_r(space, offset); break;
case 1: res = m_fdc->track_r(space, offset); break;
case 2: res = m_fdc->sector_r(space, offset); break;
case 3: res = m_fdc->data_r(space, offset); break;
}
return res;
@ -371,12 +371,12 @@ WRITE8_MEMBER( z100_state::z207_fdc_w )
{
switch(offset)
{
case 0: wd17xx_command_w(m_fdc,space, offset,data); break;
case 1: wd17xx_track_w(m_fdc,space, offset,data); break;
case 2: wd17xx_sector_w(m_fdc,space, offset,data); break;
case 3: wd17xx_data_w(m_fdc,space, offset,data); break;
case 0: m_fdc->command_w(space, offset,data); break;
case 1: m_fdc->track_w(space, offset,data); break;
case 2: m_fdc->sector_w(space, offset,data); break;
case 3: m_fdc->data_w(space, offset,data); break;
case 4: // disk control
wd17xx_set_drive(m_fdc,data & 3);
m_fdc->set_drive(data & 3);
m_z207_cur_drive = data & 3;
break;
case 5: // aux control

View File

@ -98,9 +98,6 @@
#include "formats/z80ne_dsk.h"
#include "machine/ram.h"
/* peripheral chips */
#include "machine/wd17xx.h"
/* Layout */
#include "z80ne.lh"
#include "z80net.lh"

View File

@ -119,7 +119,7 @@ class towns_state : public driver_device
required_device<upd71071_device> m_dma_2;
required_device<palette_device> m_palette;
required_device<ram_device> m_ram;
device_t* m_fdc;
mb8877_device* m_fdc;
ram_device* m_messram;
cdrom_image_device* m_cdrom;
cdda_device* m_cdda;

View File

@ -146,7 +146,7 @@ public:
optional_device<k051649_device> m_k051649;
required_device<dac_device> m_dac;
optional_device<rp5c01_device> m_rtc;
optional_device<device_t> m_wd179x;
optional_device<fd1793_device> m_wd179x;
DECLARE_READ8_MEMBER(msx_psg_port_a_r);
DECLARE_READ8_MEMBER(msx_psg_port_b_r);
DECLARE_WRITE8_MEMBER(msx_psg_port_a_w);

View File

@ -11,6 +11,7 @@
#include "machine/pit8253.h"
#include "machine/pic8259.h"
#include "machine/i8251.h"
#include "machine/wd17xx.h"
#include "imagedev/cassette.h"
#include "sound/speaker.h"
#include "sound/wave.h"
@ -81,7 +82,7 @@ protected:
required_device<i8251_device> m_rs232;
required_device<i8251_device> m_lan;
required_device<ram_device> m_ram;
required_device<device_t> m_wd1793;
required_device<fd1793_device> m_wd1793;
required_device<pit8253_device> m_pit8253;
required_device<pic8259_device> m_pic8259;
required_device<speaker_sound_device> m_speaker;

View File

@ -15,6 +15,7 @@
#include "imagedev/cassette.h"
#include "machine/ay31015.h"
#include "machine/kr2376.h"
#include "machine/wd17xx.h"
/***************************************************************************
CONSTANTS
@ -147,7 +148,7 @@ protected:
required_device<cpu_device> m_maincpu;
required_device<cassette_image_device> m_cassette1;
required_device<cassette_image_device> m_cassette2;
optional_device<device_t> m_wd1771;
optional_device<fd1771_device> m_wd1771;
required_memory_region m_region_z80ne;
optional_memory_bank m_bank1;
optional_memory_bank m_bank2;

View File

@ -1628,18 +1628,18 @@ const wd17xx_interface bbc_wd17xx_interface =
WRITE8_MEMBER(bbc_state::bbc_wd177x_status_w)
{
device_t *fdc = machine().device("wd177x");
wd1770_device *fdc = machine().device<wd1770_device>("wd177x");
m_drive_control = data;
/* set drive */
if ((data>>0) & 0x01) wd17xx_set_drive(fdc,0);
if ((data>>1) & 0x01) wd17xx_set_drive(fdc,1);
if ((data>>0) & 0x01) fdc->set_drive(0);
if ((data>>1) & 0x01) fdc->set_drive(1);
/* set side */
wd17xx_set_side(fdc,(data>>2) & 0x01);
fdc->set_side((data>>2) & 0x01);
/* set density */
wd17xx_dden_w(fdc, BIT(data, 3));
fdc->dden_w(BIT(data, 3));
m_1770_IntEnabled=(((data>>4) & 0x01)==0);
}
@ -1649,20 +1649,20 @@ WRITE8_MEMBER(bbc_state::bbc_wd177x_status_w)
READ8_MEMBER(bbc_state::bbc_wd1770_read)
{
int retval=0xff;
device_t *fdc = machine().device("wd177x");
wd1770_device *fdc = machine().device<wd1770_device>("wd177x");
switch (offset)
{
case 4:
retval=wd17xx_status_r(fdc, space, 0);
retval=fdc->status_r(space, 0);
break;
case 5:
retval=wd17xx_track_r(fdc, space, 0);
retval=fdc->track_r(space, 0);
break;
case 6:
retval=wd17xx_sector_r(fdc, space, 0);
retval=fdc->sector_r(space, 0);
break;
case 7:
retval=wd17xx_data_r(fdc, space, 0);
retval=fdc->data_r(space, 0);
break;
default:
break;
@ -1674,7 +1674,7 @@ READ8_MEMBER(bbc_state::bbc_wd1770_read)
WRITE8_MEMBER(bbc_state::bbc_wd1770_write)
{
device_t *fdc = machine().device("wd177x");
wd1770_device *fdc = machine().device<wd1770_device>("wd177x");
logerror("wd177x write: $%02X $%02X\n", offset,data);
switch (offset)
{
@ -1682,16 +1682,16 @@ WRITE8_MEMBER(bbc_state::bbc_wd1770_write)
bbc_wd177x_status_w(space, 0, data);
break;
case 4:
wd17xx_command_w(fdc, space, 0, data);
fdc->command_w(space, 0, data);
break;
case 5:
wd17xx_track_w(fdc, space, 0, data);
fdc->track_w(space, 0, data);
break;
case 6:
wd17xx_sector_w(fdc, space, 0, data);
fdc->sector_w(space, 0, data);
break;
case 7:
wd17xx_data_w(fdc, space, 0, data);
fdc->data_w(space, 0, data);
break;
default:
break;
@ -1737,25 +1737,25 @@ AM_RANGE(0xfc00, 0xfdff) AM_READWRITE(bbc_opus_read , bbc_opus_write )
WRITE8_MEMBER(bbc_state::bbc_opus_status_w)
{
device_t *fdc = machine().device("wd177x");
wd1770_device *fdc = machine().device<wd1770_device>("wd177x");
m_drive_control = data;
/* set drive */
if ((data>>1) & 0x01) wd17xx_set_drive(fdc,0);
if ((data>>2) & 0x01) wd17xx_set_drive(fdc,1);
if ((data>>1) & 0x01) fdc->set_drive(0);
if ((data>>2) & 0x01) fdc->set_drive(1);
/* set side */
wd17xx_set_side(fdc,(data>>0) & 0x01);
fdc->set_side((data>>0) & 0x01);
/* set density */
wd17xx_dden_w(fdc, BIT(data, 5));
fdc->dden_w(BIT(data, 5));
m_1770_IntEnabled=(data>>4) & 0x01;
}
READ8_MEMBER(bbc_state::bbc_opus_read)
{
device_t *fdc = machine().device("wd177x");
wd1770_device *fdc = machine().device<wd1770_device>("wd177x");
logerror("wd177x read: $%02X\n", offset);
if (m_DFSType==6)
@ -1765,13 +1765,13 @@ READ8_MEMBER(bbc_state::bbc_opus_read)
switch (offset)
{
case 0xf8:
return wd17xx_status_r(fdc, space, 0);
return fdc->status_r(space, 0);
case 0xf9:
return wd17xx_track_r(fdc, space, 0);
return fdc->track_r(space, 0);
case 0xfa:
return wd17xx_sector_r(fdc, space, 0);
return fdc->sector_r(space, 0);
case 0xfb:
return wd17xx_data_r(fdc, space, 0);
return fdc->data_r(space, 0);
}
}
else
@ -1784,7 +1784,7 @@ READ8_MEMBER(bbc_state::bbc_opus_read)
WRITE8_MEMBER(bbc_state::bbc_opus_write)
{
device_t *fdc = machine().device("wd177x");
wd1770_device *fdc = machine().device<wd1770_device>("wd177x");
logerror("wd177x write: $%02X $%02X\n", offset,data);
if (m_DFSType==6)
@ -1794,16 +1794,16 @@ WRITE8_MEMBER(bbc_state::bbc_opus_write)
switch (offset)
{
case 0xf8:
wd17xx_command_w(fdc, space, 0, data);
fdc->command_w(space, 0, data);
break;
case 0xf9:
wd17xx_track_w(fdc, space, 0, data);
fdc->track_w(space, 0, data);
break;
case 0xfa:
wd17xx_sector_w(fdc, space, 0, data);
fdc->sector_w(space, 0, data);
break;
case 0xfb:
wd17xx_data_w(fdc, space, 0, data);
fdc->data_w(space, 0, data);
break;
case 0xfc:
bbc_opus_status_w(space, 0,data);
@ -1832,20 +1832,20 @@ BBC MASTER DISC SUPPORT
READ8_MEMBER(bbc_state::bbcm_wd1770_read)
{
int retval=0xff;
device_t *fdc = machine().device("wd177x");
wd1770_device *fdc = machine().device<wd1770_device>("wd177x");
switch (offset)
{
case 0:
retval=wd17xx_status_r(fdc, space, 0);
retval=fdc->status_r(space, 0);
break;
case 1:
retval=wd17xx_track_r(fdc, space, 0);
retval=fdc->track_r(space, 0);
break;
case 2:
retval=wd17xx_sector_r(fdc, space, 0);
retval=fdc->sector_r(space, 0);
break;
case 3:
retval=wd17xx_data_r(fdc, space, 0);
retval=fdc->data_r(space, 0);
break;
default:
break;
@ -1856,21 +1856,21 @@ READ8_MEMBER(bbc_state::bbcm_wd1770_read)
WRITE8_MEMBER(bbc_state::bbcm_wd1770_write)
{
device_t *fdc = machine().device("wd177x");
wd1770_device *fdc = machine().device<wd1770_device>("wd177x");
//logerror("wd177x write: $%02X $%02X\n", offset,data);
switch (offset)
{
case 0:
wd17xx_command_w(fdc, space, 0, data);
fdc->command_w(space, 0, data);
break;
case 1:
wd17xx_track_w(fdc, space, 0, data);
fdc->track_w(space, 0, data);
break;
case 2:
wd17xx_sector_w(fdc, space, 0, data);
fdc->sector_w(space, 0, data);
break;
case 3:
wd17xx_data_w(fdc, space, 0, data);
fdc->data_w(space, 0, data);
break;
default:
break;
@ -1885,18 +1885,18 @@ READ8_MEMBER(bbc_state::bbcm_wd1770l_read)
WRITE8_MEMBER(bbc_state::bbcm_wd1770l_write)
{
device_t *fdc = machine().device("wd177x");
wd1770_device *fdc = machine().device<wd1770_device>("wd177x");
m_drive_control = data;
/* set drive */
if ((data>>0) & 0x01) wd17xx_set_drive(fdc,0);
if ((data>>1) & 0x01) wd17xx_set_drive(fdc,1);
if ((data>>0) & 0x01) fdc->set_drive(0);
if ((data>>1) & 0x01) fdc->set_drive(1);
/* set side */
wd17xx_set_side(fdc,(data>>4) & 0x01);
fdc->set_side((data>>4) & 0x01);
/* set density */
wd17xx_dden_w(fdc, BIT(data, 5));
fdc->dden_w(BIT(data, 5));
// m_1770_IntEnabled=(((data>>4) & 0x01)==0);
m_1770_IntEnabled=1;

View File

@ -10,7 +10,6 @@
#include "emu.h"
#include "imagedev/flopdrv.h"
#include "formats/trd_dsk.h"
#include "machine/wd17xx.h"
#include "machine/beta.h"
@ -41,7 +40,7 @@ void beta_disk_device::device_start()
/* find our WD179x */
tempstring.printf("%s:%s", tag(), "wd179x");
m_wd179x = machine().device(tempstring);
m_wd179x = machine().device<wd2793_device>(tempstring);
}
//-------------------------------------------------
@ -99,7 +98,7 @@ static const wd17xx_interface beta_wd17xx_interface =
READ8_MEMBER(beta_disk_device::status_r)
{
if (m_betadisk_active==1) {
return wd17xx_status_r(m_wd179x, space, offset);
return m_wd179x->status_r(space, offset);
} else {
return 0xff;
}
@ -108,7 +107,7 @@ READ8_MEMBER(beta_disk_device::status_r)
READ8_MEMBER(beta_disk_device::track_r)
{
if (m_betadisk_active==1) {
return wd17xx_track_r(m_wd179x, space, offset);
return m_wd179x->track_r(space, offset);
} else {
return 0xff;
}
@ -117,7 +116,7 @@ READ8_MEMBER(beta_disk_device::track_r)
READ8_MEMBER(beta_disk_device::sector_r)
{
if (m_betadisk_active==1) {
return wd17xx_sector_r(m_wd179x, space, offset);
return m_wd179x->sector_r(space, offset);
} else {
return 0xff;
}
@ -126,7 +125,7 @@ READ8_MEMBER(beta_disk_device::sector_r)
READ8_MEMBER(beta_disk_device::data_r)
{
if (m_betadisk_active==1) {
return wd17xx_data_r(m_wd179x, space, offset);
return m_wd179x->data_r(space, offset);
} else {
return 0xff;
}
@ -144,12 +143,12 @@ READ8_MEMBER(beta_disk_device::state_r)
WRITE8_MEMBER(beta_disk_device::param_w)
{
if (m_betadisk_active==1) {
wd17xx_set_drive(m_wd179x, data & 3);
wd17xx_set_side (m_wd179x,(data & 0x10) ? 0 : 1 );
wd17xx_dden_w(m_wd179x, !BIT(data, 5));
m_wd179x->set_drive(data & 3);
m_wd179x->set_side ((data & 0x10) ? 0 : 1 );
m_wd179x->dden_w(!BIT(data, 5));
if ((data & 0x04) == 0) // reset
{
wd17xx_reset(m_wd179x);
m_wd179x->reset();
}
m_betadisk_status = (data & 0x3f) | m_betadisk_status;
}
@ -158,28 +157,28 @@ WRITE8_MEMBER(beta_disk_device::param_w)
WRITE8_MEMBER(beta_disk_device::command_w)
{
if (m_betadisk_active==1) {
wd17xx_command_w(m_wd179x, space, offset, data);
m_wd179x->command_w(space, offset, data);
}
}
WRITE8_MEMBER(beta_disk_device::track_w)
{
if (m_betadisk_active==1) {
wd17xx_track_w(m_wd179x, space, offset, data);
m_wd179x->track_w(space, offset, data);
}
}
WRITE8_MEMBER(beta_disk_device::sector_w)
{
if (m_betadisk_active==1) {
wd17xx_sector_w(m_wd179x, space, offset, data);
m_wd179x->sector_w(space, offset, data);
}
}
WRITE8_MEMBER(beta_disk_device::data_w)
{
if (m_betadisk_active==1) {
wd17xx_data_w(m_wd179x, space, offset, data);
m_wd179x->data_w(space, offset, data);
}
}

View File

@ -10,6 +10,8 @@
#ifndef __BETA_H__
#define __BETA_H__
#include "machine/wd17xx.h"
#define BETA_DISK_TAG "beta"
@ -51,7 +53,7 @@ protected:
private:
// internal state
device_t *m_wd179x;
wd2793_device *m_wd179x;
};
extern const device_type BETA_DISK;

View File

@ -323,74 +323,74 @@ WRITE8_MEMBER( cgenie_state::cgenie_psg_port_b_w )
READ8_MEMBER( cgenie_state::cgenie_status_r )
{
device_t *fdc = machine().device("wd179x");
fd1793_device *fdc = machine().device<fd1793_device>("wd179x");
/* If the floppy isn't emulated, return 0 */
if( (ioport("DSW0")->read() & 0x80) == 0 )
return 0;
return wd17xx_status_r(fdc, space, offset);
return fdc->status_r(space, offset);
}
READ8_MEMBER( cgenie_state::cgenie_track_r )
{
device_t *fdc = machine().device("wd179x");
fd1793_device *fdc = machine().device<fd1793_device>("wd179x");
/* If the floppy isn't emulated, return 0xff */
if( (ioport("DSW0")->read() & 0x80) == 0 )
return 0xff;
return wd17xx_track_r(fdc, space, offset);
return fdc->track_r(space, offset);
}
READ8_MEMBER( cgenie_state::cgenie_sector_r )
{
device_t *fdc = machine().device("wd179x");
fd1793_device *fdc = machine().device<fd1793_device>("wd179x");
/* If the floppy isn't emulated, return 0xff */
if( (ioport("DSW0")->read() & 0x80) == 0 )
return 0xff;
return wd17xx_sector_r(fdc, space, offset);
return fdc->sector_r(space, offset);
}
READ8_MEMBER( cgenie_state::cgenie_data_r )
{
device_t *fdc = machine().device("wd179x");
fd1793_device *fdc = machine().device<fd1793_device>("wd179x");
/* If the floppy isn't emulated, return 0xff */
if( (ioport("DSW0")->read() & 0x80) == 0 )
return 0xff;
return wd17xx_data_r(fdc, space, offset);
return fdc->data_r(space, offset);
}
WRITE8_MEMBER( cgenie_state::cgenie_command_w )
{
device_t *fdc = machine().device("wd179x");
fd1793_device *fdc = machine().device<fd1793_device>("wd179x");
/* If the floppy isn't emulated, return immediately */
if( (ioport("DSW0")->read() & 0x80) == 0 )
return;
wd17xx_command_w(fdc, space, offset, data);
fdc->command_w(space, offset, data);
}
WRITE8_MEMBER( cgenie_state::cgenie_track_w )
{
device_t *fdc = machine().device("wd179x");
fd1793_device *fdc = machine().device<fd1793_device>("wd179x");
/* If the floppy isn't emulated, ignore the write */
if( (ioport("DSW0")->read() & 0x80) == 0 )
return;
wd17xx_track_w(fdc, space, offset, data);
fdc->track_w(space, offset, data);
}
WRITE8_MEMBER( cgenie_state::cgenie_sector_w )
{
device_t *fdc = machine().device("wd179x");
fd1793_device *fdc = machine().device<fd1793_device>("wd179x");
/* If the floppy isn't emulated, ignore the write */
if( (ioport("DSW0")->read() & 0x80) == 0 )
return;
wd17xx_sector_w(fdc, space, offset, data);
fdc->sector_w(space, offset, data);
}
WRITE8_MEMBER( cgenie_state::cgenie_data_w )
{
device_t *fdc = machine().device("wd179x");
fd1793_device *fdc = machine().device<fd1793_device>("wd179x");
/* If the floppy isn't emulated, ignore the write */
if( (ioport("DSW0")->read() & 0x80) == 0 )
return;
wd17xx_data_w(fdc, space, offset, data);
fdc->data_w(space, offset, data);
}
READ8_MEMBER( cgenie_state::cgenie_irq_status_r )
@ -440,7 +440,7 @@ const wd17xx_interface cgenie_wd17xx_interface =
WRITE8_MEMBER( cgenie_state::cgenie_motor_w )
{
device_t *fdc = machine().device("wd179x");
fd1793_device *fdc = machine().device<fd1793_device>("wd179x");
UINT8 drive = 255;
logerror("cgenie motor_w $%02X\n", data);
@ -463,8 +463,8 @@ WRITE8_MEMBER( cgenie_state::cgenie_motor_w )
/* currently selected drive */
m_motor_drive = drive;
wd17xx_set_drive(fdc,drive);
wd17xx_set_side(fdc,m_head);
fdc->set_drive(drive);
fdc->set_side(m_head);
}
/*************************************

View File

@ -14,7 +14,6 @@
#include "machine/concept_exp.h"
// FDC controller
#include "machine/wd17xx.h"
#include "imagedev/flopdrv.h"
#include "formats/basicdsk.h"
@ -167,7 +166,7 @@ enum
void concept_fdc_device::device_start()
{
m_wd179x = subdevice("wd179x");
m_wd179x = subdevice<fd1793_device>("wd179x");
save_item(NAME(m_fdc_local_status));
save_item(NAME(m_fdc_local_command));
@ -213,16 +212,16 @@ READ8_MEMBER(concept_fdc_device::reg_r)
return m_fdc_local_status;
case 8: // FDC STATUS REG
return wd17xx_status_r(m_wd179x, space, offset);
return m_wd179x->status_r(space, offset);
case 9: // FDC TRACK REG
return wd17xx_track_r(m_wd179x, space, offset);
return m_wd179x->track_r(space, offset);
case 10: // FDC SECTOR REG
return wd17xx_sector_r(m_wd179x, space, offset);
return m_wd179x->sector_r(space, offset);
case 11: // FDC DATA REG
return wd17xx_data_r(m_wd179x, space, offset);
return m_wd179x->data_r(space, offset);
}
return 0;
@ -237,30 +236,30 @@ WRITE8_MEMBER(concept_fdc_device::reg_w)
case 0: // LOCAL COMMAND REG
m_fdc_local_command = data;
wd17xx_set_side(m_wd179x, (data & LC_FLPSD1_mask) != 0);
m_wd179x->set_side((data & LC_FLPSD1_mask) != 0);
current_drive = ((data >> LC_DE0_bit) & 1) | ((data >> (LC_DE1_bit-1)) & 2);
wd17xx_set_drive(m_wd179x, current_drive);
m_wd179x->set_drive(current_drive);
/*motor_on = (data & LC_MOTOROF_mask) == 0;*/
// floppy_drive_set_motor_state(floppy_get_device(machine(), current_drive), (data & LC_MOTOROF_mask) == 0 ? 1 : 0);
/*flp_8in = (data & LC_FLP8IN_mask) != 0;*/
wd17xx_dden_w(m_wd179x, BIT(data, 7));
m_wd179x->dden_w(BIT(data, 7));
floppy_drive_set_ready_state(floppy_get_device(machine(), current_drive), 1, 0);
break;
case 8: // FDC COMMAMD REG
wd17xx_command_w(m_wd179x, space, offset, data);
m_wd179x->command_w(space, offset, data);
break;
case 9: // FDC TRACK REG
wd17xx_track_w(m_wd179x, space, offset, data);
m_wd179x->track_w(space, offset, data);
break;
case 10: // FDC SECTOR REG
wd17xx_sector_w(m_wd179x, space, offset, data);
m_wd179x->sector_w(space, offset, data);
break;
case 11: // FDC DATA REG
wd17xx_data_w(m_wd179x, space, offset, data);
m_wd179x->data_w(space, offset, data);
break;
}
}

View File

@ -2,6 +2,7 @@
#define __CONCEPT_EXP__
#include "emu.h"
#include "machine/wd17xx.h"
class concept_exp_card_device;
@ -84,7 +85,7 @@ public:
virtual machine_config_constructor device_mconfig_additions() const;
protected:
device_t *m_wd179x;
fd1793_device *m_wd179x;
UINT8 m_fdc_local_status;
UINT8 m_fdc_local_command;

View File

@ -567,7 +567,7 @@ READ8_MEMBER(dgn_beta_state::d_pia1_pa_r)
WRITE8_MEMBER(dgn_beta_state::d_pia1_pa_w)
{
int HALT_DMA;
device_t *fdc = machine().device(FDC_TAG);
wd2797_device *fdc = machine().device<wd2797_device>(FDC_TAG);
/* Only play with halt line if halt bit changed since last write */
if((data & 0x80) != m_d_pia1_pa_last)
@ -589,10 +589,10 @@ WRITE8_MEMBER(dgn_beta_state::d_pia1_pa_w)
}
/* Drive selects are binary encoded on PA0 & PA1 */
wd17xx_set_drive(fdc, ~data & DSMask);
fdc->set_drive(~data & DSMask);
/* Set density of WD2797 */
wd17xx_dden_w(fdc, BIT(data, 6));
fdc->dden_w(BIT(data, 6));
LOG_DISK(("Set density %s\n", BIT(data, 6) ? "low" : "high"));
}
@ -813,22 +813,22 @@ const wd17xx_interface dgnbeta_wd17xx_interface =
READ8_MEMBER(dgn_beta_state::dgnbeta_wd2797_r)
{
int result = 0;
device_t *fdc = space.machine().device(FDC_TAG);
wd2797_device *fdc = machine().device<wd2797_device>(FDC_TAG);
switch(offset & 0x03)
{
case 0:
result = wd17xx_status_r(fdc, space, 0);
result = fdc->status_r(space, 0);
LOG_DISK(("Disk status=%2.2X\n",result));
break;
case 1:
result = wd17xx_track_r(fdc, space, 0);
result = fdc->track_r(space, 0);
break;
case 2:
result = wd17xx_sector_r(fdc, space, 0);
result = fdc->sector_r(space, 0);
break;
case 3:
result = wd17xx_data_r(fdc, space, 0);
result = fdc->data_r(space, 0);
break;
default:
break;
@ -839,7 +839,7 @@ READ8_MEMBER(dgn_beta_state::dgnbeta_wd2797_r)
WRITE8_MEMBER(dgn_beta_state::dgnbeta_wd2797_w)
{
device_t *fdc = space.machine().device(FDC_TAG);
wd2797_device *fdc = machine().device<wd2797_device>(FDC_TAG);
m_wd2797_written=1;
@ -849,17 +849,17 @@ WRITE8_MEMBER(dgn_beta_state::dgnbeta_wd2797_w)
/* disk head is encoded in the command byte */
/* But only for Type 3/4 commands */
if(data & 0x80)
wd17xx_set_side(fdc,(data & 0x02) ? 1 : 0);
wd17xx_command_w(fdc, space, 0, data);
fdc->set_side((data & 0x02) ? 1 : 0);
fdc->command_w(space, 0, data);
break;
case 1:
wd17xx_track_w(fdc, space, 0, data);
fdc->track_w(space, 0, data);
break;
case 2:
wd17xx_sector_w(fdc, space, 0, data);
fdc->sector_w(space, 0, data);
break;
case 3:
wd17xx_data_w(fdc, space, 0, data);
fdc->data_w(space, 0, data);
break;
};
}
@ -931,8 +931,8 @@ void dgn_beta_state::dgn_beta_line_interrupt (int data)
/********************************* Machine/Driver Initialization ****************************************/
void dgn_beta_state::machine_reset()
{
device_t *fdc = machine().device(FDC_TAG);
{
wd2797_device *fdc = machine().device<wd2797_device>(FDC_TAG);
pia6821_device *pia_0 = machine().device<pia6821_device>( PIA_0_TAG );
pia6821_device *pia_1 = machine().device<pia6821_device>( PIA_1_TAG );
pia6821_device *pia_2 = machine().device<pia6821_device>( PIA_2_TAG );
@ -971,12 +971,12 @@ void dgn_beta_state::machine_reset()
m_DMA_NMI_LAST = 0x80; /* start with DMA NMI inactive, as pulled up */
// DMA_NMI = CLEAR_LINE; /* start with DMA NMI inactive */
wd17xx_dden_w(fdc, CLEAR_LINE);
wd17xx_set_drive(fdc, 0);
fdc->dden_w(CLEAR_LINE);
fdc->set_drive(0);
m_videoram.set_target(m_ram->pointer(),m_videoram.bytes()); /* Point video ram at the start of physical ram */
wd17xx_reset(fdc);
fdc->reset();
m_wd2797_written=0;
m_maincpu->reset();

View File

@ -144,19 +144,19 @@ READ8_MEMBER( dragon_alpha_state::ff20_read )
break;
case 12:
result = wd17xx_data_r(m_fdc, space, 0);
result = m_fdc->data_r(space, 0);
break;
case 13:
result = wd17xx_sector_r(m_fdc, space, 0);
result = m_fdc->sector_r(space, 0);
break;
case 14:
result = wd17xx_track_r(m_fdc, space, 0);
result = m_fdc->track_r(space, 0);
break;
case 15:
result = wd17xx_status_r(m_fdc, space, 0);
result = m_fdc->status_r(space, 0);
break;
}
return result;
@ -185,19 +185,19 @@ WRITE8_MEMBER( dragon_alpha_state::ff20_write )
break;
case 12:
wd17xx_data_w(m_fdc, space, 0, data);
m_fdc->data_w(space, 0, data);
break;
case 13:
wd17xx_sector_w(m_fdc, space, 0, data);
m_fdc->sector_w(space, 0, data);
break;
case 14:
wd17xx_track_w(m_fdc, space, 0, data);
m_fdc->track_w(space, 0, data);
break;
case 15:
wd17xx_command_w(m_fdc, space, 0, data);
m_fdc->command_w(space, 0, data);
/* disk head is encoded in the command byte */
wd17xx_set_side(m_fdc,(data & 0x02) ? 1 : 0);
m_fdc->set_side((data & 0x02) ? 1 : 0);
break;
}
}
@ -317,16 +317,16 @@ WRITE8_MEMBER( dragon_alpha_state::psg_porta_write )
switch (data & 0xF)
{
case(0x01) :
wd17xx_set_drive(m_fdc, 0);
m_fdc->set_drive(0);
break;
case(0x02) :
wd17xx_set_drive(m_fdc, 1);
m_fdc->set_drive(1);
break;
case(0x04) :
wd17xx_set_drive(m_fdc, 2);
m_fdc->set_drive(2);
break;
case(0x08) :
wd17xx_set_drive(m_fdc, 3);
m_fdc->set_drive(3);
break;
}
}

View File

@ -102,9 +102,9 @@ TIMER_CALLBACK_MEMBER(hec2hrp_state::Callback_CK)
void hec2hrp_state::hector_minidisc_init()
{
device_t *fdc = machine().device("wd179x");
fd1793_device *fdc = machine().device<fd1793_device>("wd179x");
//set density
wd17xx_dden_w(fdc, 1);// density select => always 1 (0 ?a plante !)
fdc->dden_w(1);// density select => always 1 (0 ?a plante !)
/* FDC Motor Control - Bit 0/1 defines the state of the FDD 0/1 motor */
floppy_mon_w(floppy_get_device(machine(), 0), 0); // Moteur floppy A:
@ -118,22 +118,22 @@ void hec2hrp_state::hector_minidisc_init()
READ8_MEMBER(hec2hrp_state::hector_179x_register_r)
{
int data=0;
device_t *fdc = machine().device("wd179x");
fd1793_device *fdc = machine().device<fd1793_device>("wd179x");
switch (offset & 0x0ff)
{
/* minidisc floppy disc interface */
case 0x04:
data = wd17xx_status_r(fdc, space, 0);
data = fdc->status_r(space, 0);
break;
case 0x05:
data = wd17xx_track_r(fdc, space, 0);
data = fdc->track_r(space, 0);
break;
case 0x06:
data = wd17xx_sector_r(fdc, space, 0);
data = fdc->sector_r(space, 0);
break;
case 0x07:
data = wd17xx_data_r(fdc, space, 0);
data = fdc->data_r(space, 0);
break;
default:
break;
@ -143,22 +143,22 @@ device_t *fdc = machine().device("wd179x");
}
WRITE8_MEMBER(hec2hrp_state::hector_179x_register_w)
{
device_t *fdc = machine().device("wd179x");
fd1793_device *fdc = machine().device<fd1793_device>("wd179x");
switch (offset)
{
/* minidisc floppy disc interface */
case 0x04:
wd17xx_command_w(fdc, space, 0, data);
fdc->command_w(space, 0, data);
break;
case 0x05:
wd17xx_track_w(fdc, space, 0, data);
fdc->track_w(space, 0, data);
break;
case 0x06:
wd17xx_sector_w(fdc, space, 0, data);
fdc->sector_w(space, 0, data);
break;
case 0x07:
/*write into command register*/
wd17xx_data_w(fdc, space, 0, data);
fdc->data_w(space, 0, data);
break;
case 0x08:
/*General purpose port (0x08) for the minidisk I/O */
@ -167,11 +167,11 @@ switch (offset)
membank("bank2")->set_entry(BIT(data, 5) ? HECTOR_BANK_BASE : HECTOR_BANK_DISC );
// Set drive number
if (BIT(data, 6)) wd17xx_set_drive(fdc, 0); // Set the correct drive number 0
//if (BIT(data, 7)) wd17xx_set_drive(fdc, 1);// Set the correct drive number 1,never here
if (BIT(data, 6)) fdc->set_drive(0); // Set the correct drive number 0
//if (BIT(data, 7)) fdc->set_drive(1);// Set the correct drive number 1,never here
// Set side
wd17xx_set_side(fdc,BIT(data, 4) ? 1 : 0);// side select
fdc->set_side(BIT(data, 4) ? 1 : 0);// side select
}
break;
@ -230,6 +230,7 @@ WRITE8_MEMBER(hec2hrp_state::hector_keyboard_w)
READ8_MEMBER(hec2hrp_state::hector_keyboard_r)
{
UINT8 data = 0xff;
static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7", "KEY8" };
if (offset ==7) /* Only when joy reading*/
@ -254,8 +255,7 @@ READ8_MEMBER(hec2hrp_state::hector_keyboard_r)
/* floppy md master reset */
if (isHectorWithMiniDisc())
wd17xx_mr_w(machine().device("wd179x"), 1);
machine().device<fd1793_device>("wd179x")->mr_w(1);
}
else /* aviable for BR machines */

View File

@ -82,8 +82,8 @@ WRITE8_MEMBER( mbc55x_state::mbc55x_ppi_portb_w )
WRITE8_MEMBER( mbc55x_state::mbc55x_ppi_portc_w )
{
wd17xx_set_drive(m_fdc,(data & 0x03));
wd17xx_set_side(m_fdc, BIT(data, 2));
m_fdc->set_drive((data & 0x03));
m_fdc->set_side(BIT(data, 2));
}
I8255_INTERFACE( mbc55x_ppi8255_interface )
@ -156,12 +156,12 @@ WRITE8_MEMBER( mbc55x_state::vram_page_w )
READ8_MEMBER(mbc55x_state::mbc55x_disk_r)
{
return wd17xx_r(m_fdc, space, offset>>1);
return m_fdc->read(space, offset>>1);
}
WRITE8_MEMBER(mbc55x_state::mbc55x_disk_w)
{
wd17xx_w(m_fdc, space, offset>>1, data);
m_fdc->write(space, offset>>1, data);
}
WRITE_LINE_MEMBER( mbc55x_state::mbc55x_fdc_intrq_w )

View File

@ -1231,7 +1231,7 @@ MSX_SLOT_INIT(diskrom)
MSX_SLOT_RESET(diskrom)
{
msx_state *drvstate = machine.driver_data<msx_state>();
wd17xx_reset(drvstate->m_wd179x);
drvstate->m_wd179x->reset();
}
static READ8_HANDLER (msx_diskrom_page1_r)
@ -1239,10 +1239,10 @@ static READ8_HANDLER (msx_diskrom_page1_r)
msx_state *state = space.machine().driver_data<msx_state>();
switch (offset)
{
case 0: return wd17xx_status_r (state->m_wd179x, space, 0);
case 1: return wd17xx_track_r (state->m_wd179x, space, 0);
case 2: return wd17xx_sector_r (state->m_wd179x, space, 0);
case 3: return wd17xx_data_r (state->m_wd179x, space, 0);
case 0: return state->m_wd179x->status_r (space, 0);
case 1: return state->m_wd179x->track_r (space, 0);
case 2: return state->m_wd179x->sector_r (space, 0);
case 3: return state->m_wd179x->data_r (space, 0);
case 7: return state->m_dsk_stat;
default:
return state->m_state[1]->m_mem[offset + 0x3ff8];
@ -1257,13 +1257,13 @@ static READ8_HANDLER (msx_diskrom_page2_r)
switch (offset)
{
case 0x7f8:
return wd17xx_status_r (state->m_wd179x, space, 0);
return state->m_wd179x->status_r (space, 0);
case 0x7f9:
return wd17xx_track_r (state->m_wd179x, space, 0);
return state->m_wd179x->track_r (space, 0);
case 0x7fa:
return wd17xx_sector_r (state->m_wd179x, space, 0);
return state->m_wd179x->sector_r (space, 0);
case 0x7fb:
return wd17xx_data_r (state->m_wd179x, space, 0);
return state->m_wd179x->data_r (space, 0);
case 0x7ff:
return state->m_dsk_stat;
default:
@ -1314,23 +1314,23 @@ MSX_SLOT_WRITE(diskrom)
switch (addr)
{
case 0x7ff8:
wd17xx_command_w (drvstate->m_wd179x, space, 0, val);
drvstate->m_wd179x->command_w (space, 0, val);
break;
case 0x7ff9:
wd17xx_track_w (drvstate->m_wd179x, space, 0, val);
drvstate->m_wd179x->track_w (space, 0, val);
break;
case 0x7ffa:
wd17xx_sector_w (drvstate->m_wd179x, space, 0, val);
drvstate->m_wd179x->sector_w (space, 0, val);
break;
case 0x7ffb:
wd17xx_data_w (drvstate->m_wd179x, space, 0, val);
drvstate->m_wd179x->data_w (space, 0, val);
break;
case 0x7ffc:
wd17xx_set_side (drvstate->m_wd179x,val & 1);
drvstate->m_wd179x->set_side (val & 1);
state->m_mem[0x3ffc] = val | 0xfe;
break;
case 0x7ffd:
wd17xx_set_drive (drvstate->m_wd179x,val & 1);
drvstate->m_wd179x->set_drive (val & 1);
if ((state->m_mem[0x3ffd] ^ val) & 0x40)
{
set_led_status (machine, 0, !(val & 0x40));
@ -1358,7 +1358,7 @@ MSX_SLOT_INIT(diskrom2)
MSX_SLOT_RESET(diskrom2)
{
msx_state *drvstate = machine.driver_data<msx_state>();
wd17xx_reset (drvstate->m_wd179x);
drvstate->m_wd179x->reset();
}
static READ8_HANDLER (msx_diskrom2_page1_r)
@ -1366,10 +1366,10 @@ static READ8_HANDLER (msx_diskrom2_page1_r)
msx_state *state = space.machine().driver_data<msx_state>();
switch (offset)
{
case 0: return wd17xx_status_r(state->m_wd179x, space, 0);
case 1: return wd17xx_track_r(state->m_wd179x, space, 0);
case 2: return wd17xx_sector_r(state->m_wd179x, space, 0);
case 3: return wd17xx_data_r(state->m_wd179x, space, 0);
case 0: return state->m_wd179x->status_r(space, 0);
case 1: return state->m_wd179x->track_r(space, 0);
case 2: return state->m_wd179x->sector_r(space, 0);
case 3: return state->m_wd179x->data_r(space, 0);
case 4: return state->m_dsk_stat;
default:
return state->m_state[1]->m_mem[offset + 0x3ff8];
@ -1384,13 +1384,13 @@ static READ8_HANDLER (msx_diskrom2_page2_r)
switch (offset)
{
case 0x7b8:
return wd17xx_status_r (state->m_wd179x, space, 0);
return state->m_wd179x->status_r (space, 0);
case 0x7b9:
return wd17xx_track_r (state->m_wd179x, space, 0);
return state->m_wd179x->track_r (space, 0);
case 0x7ba:
return wd17xx_sector_r (state->m_wd179x, space, 0);
return state->m_wd179x->sector_r (space, 0);
case 0x7bb:
return wd17xx_data_r (state->m_wd179x, space, 0);
return state->m_wd179x->data_r (space, 0);
case 0x7bc:
return state->m_dsk_stat;
default:
@ -1440,21 +1440,21 @@ MSX_SLOT_WRITE(diskrom2)
switch (addr)
{
case 0x7fb8:
wd17xx_command_w (drvstate->m_wd179x, space, 0, val);
drvstate->m_wd179x->command_w (space, 0, val);
break;
case 0x7fb9:
wd17xx_track_w (drvstate->m_wd179x, space, 0, val);
drvstate->m_wd179x->track_w (space, 0, val);
break;
case 0x7fba:
wd17xx_sector_w (drvstate->m_wd179x, space, 0, val);
drvstate->m_wd179x->sector_w (space, 0, val);
break;
case 0x7fbb:
wd17xx_data_w (drvstate->m_wd179x, space, 0, val);
drvstate->m_wd179x->data_w (space, 0, val);
break;
case 0x7fbc:
wd17xx_set_side (drvstate->m_wd179x,val & 1);
drvstate->m_wd179x->set_side (val & 1);
state->m_mem[0x3fbc] = val | 0xfe;
wd17xx_set_drive (drvstate->m_wd179x,val & 1);
drvstate->m_wd179x->set_drive (val & 1);
if ((state->m_mem[0x3fbc] ^ val) & 0x40)
{
set_led_status (machine, 0, !(val & 0x40));

View File

@ -54,16 +54,16 @@ READ8_MEMBER(nascom1_state::nascom2_fdc_select_r)
WRITE8_MEMBER(nascom1_state::nascom2_fdc_select_w)
{
device_t *fdc = machine().device("wd1793");
fd1793_device *fdc = machine().device<fd1793_device>("wd179x");
m_nascom2_fdc.select = data;
logerror("nascom2_fdc_select_w: %02x\n", data);
if (data & 0x01) wd17xx_set_drive(fdc,0);
if (data & 0x02) wd17xx_set_drive(fdc,1);
if (data & 0x04) wd17xx_set_drive(fdc,2);
if (data & 0x08) wd17xx_set_drive(fdc,3);
if (data & 0x10) wd17xx_set_side(fdc,(data & 0x10) >> 4);
if (data & 0x01) fdc->set_drive(0);
if (data & 0x02) fdc->set_drive(1);
if (data & 0x04) fdc->set_drive(2);
if (data & 0x08) fdc->set_drive(3);
if (data & 0x10) fdc->set_side((data & 0x10) >> 4);
}

View File

@ -641,23 +641,23 @@ WRITE_LINE_MEMBER(oric_state::oric_jasmin_wd179x_drq_w)
READ8_MEMBER(oric_state::oric_jasmin_r)
{
device_t *fdc = machine().device("wd179x");
wd1770_device *fdc = machine().device<wd1770_device>("wd179x");
unsigned char data = 0x0ff;
switch (offset & 0x0f)
{
/* jasmin floppy disc interface */
case 0x04:
data = wd17xx_status_r(fdc, space, 0);
data = fdc->status_r(space, 0);
break;
case 0x05:
data =wd17xx_track_r(fdc, space, 0);
data = fdc->track_r(space, 0);
break;
case 0x06:
data = wd17xx_sector_r(fdc, space, 0);
data = fdc->sector_r(space, 0);
break;
case 0x07:
data = wd17xx_data_r(fdc, space, 0);
data = fdc->data_r(space, 0);
break;
default:
data = m_via6522_0->read(space,offset & 0x0f);
@ -671,29 +671,29 @@ READ8_MEMBER(oric_state::oric_jasmin_r)
WRITE8_MEMBER(oric_state::oric_jasmin_w)
{
device_t *fdc = machine().device("wd179x");
wd1770_device *fdc = machine().device<wd1770_device>("wd179x");
switch (offset & 0x0f)
{
/* microdisc floppy disc interface */
case 0x04:
wd17xx_command_w(fdc, space, 0, data);
fdc->command_w( space, 0, data);
break;
case 0x05:
wd17xx_track_w(fdc, space, 0, data);
fdc->track_w(space, 0, data);
break;
case 0x06:
wd17xx_sector_w(fdc, space, 0, data);
fdc->sector_w(space, 0, data);
break;
case 0x07:
wd17xx_data_w(fdc, space, 0, data);
fdc->data_w(space, 0, data);
break;
/* bit 0 = side */
case 0x08:
wd17xx_set_side(fdc,data & 0x01);
fdc->set_side(data & 0x01);
break;
/* any write will cause wd179x to reset */
case 0x09:
wd17xx_reset(fdc);
fdc->reset();
break;
case 0x0a:
//logerror("jasmin overlay ram w: %02x PC: %04x\n", data, m_maincpu->pc());
@ -710,7 +710,7 @@ WRITE8_MEMBER(oric_state::oric_jasmin_w)
case 0x0d:
case 0x0e:
case 0x0f:
wd17xx_set_drive(fdc,offset & 0x03);
fdc->set_drive(offset & 0x03);
break;
default:
@ -856,22 +856,22 @@ void oric_state::oric_microdisc_set_mem_0x0c000()
READ8_MEMBER(oric_state::oric_microdisc_r)
{
unsigned char data = 0x0ff;
device_t *fdc = machine().device("wd179x");
wd1770_device *fdc = machine().device<wd1770_device>("wd179x");
switch (offset & 0x0ff)
{
/* microdisc floppy disc interface */
case 0x00:
data = wd17xx_status_r(fdc, space, 0);
data = fdc->status_r(space, 0);
break;
case 0x01:
data =wd17xx_track_r(fdc, space, 0);
data = fdc->track_r(space, 0);
break;
case 0x02:
data = wd17xx_sector_r(fdc, space, 0);
data = fdc->sector_r(space, 0);
break;
case 0x03:
data = wd17xx_data_r(fdc, space, 0);
data = fdc->data_r(space, 0);
break;
case 0x04:
data = m_port_314_r | 0x07f;
@ -893,21 +893,21 @@ READ8_MEMBER(oric_state::oric_microdisc_r)
WRITE8_MEMBER(oric_state::oric_microdisc_w)
{
device_t *fdc = machine().device("wd179x");
wd1770_device *fdc = machine().device<wd1770_device>("wd179x");
switch (offset & 0x0ff)
{
/* microdisc floppy disc interface */
case 0x00:
wd17xx_command_w(fdc, space, 0, data);
fdc->command_w(space, 0, data);
break;
case 0x01:
wd17xx_track_w(fdc, space, 0, data);
fdc->track_w(space, 0, data);
break;
case 0x02:
wd17xx_sector_w(fdc, space, 0, data);
fdc->sector_w(space, 0, data);
break;
case 0x03:
wd17xx_data_w(fdc, space, 0, data);
fdc->data_w(space, 0, data);
break;
case 0x04:
{
@ -919,9 +919,9 @@ WRITE8_MEMBER(oric_state::oric_microdisc_w)
/* bit 4: side */
/* bit 3: double density enable */
/* bit 0: enable FDC IRQ to trigger IRQ on CPU */
wd17xx_set_drive(fdc,(data>>5) & 0x03);
wd17xx_set_side(fdc,(data>>4) & 0x01);
wd17xx_dden_w(fdc, !BIT(data, 3));
fdc->set_drive((data>>5) & 0x03);
fdc->set_side((data>>4) & 0x01);
fdc->dden_w(!BIT(data, 3));
oric_microdisc_set_mem_0x0c000();
oric_microdisc_refresh_wd179x_ints();

View File

@ -53,7 +53,7 @@ READ8_MEMBER( osborne1_state::osborne1_2000_r )
switch( offset & 0x0F00 )
{
case 0x100: /* Floppy */
data = wd17xx_r( m_fdc, space, offset );
data = m_fdc->read( space, offset );
break;
case 0x200: /* Keyboard */
/* Row 0 */
@ -104,7 +104,7 @@ WRITE8_MEMBER( osborne1_state::osborne1_2000_w )
switch( offset & 0x0F00 )
{
case 0x100: /* Floppy */
wd17xx_w( m_fdc, space, offset, data );
m_fdc->write(space, offset, data );
break;
case 0x900: /* IEEE488 PIA */
m_pia0->write(space, offset & 0x03, data );
@ -260,7 +260,7 @@ WRITE_LINE_MEMBER( osborne1_state::video_pia_out_cb2_dummy )
WRITE8_MEMBER( osborne1_state::video_pia_port_a_w )
{
wd17xx_dden_w(m_fdc, BIT(data, 0));
m_fdc->dden_w(BIT(data, 0));
data -= 0xea; // remove bias
@ -278,10 +278,10 @@ WRITE8_MEMBER( osborne1_state::video_pia_port_b_w )
m_beep_state = BIT(data, 5);
if (BIT(data, 6))
wd17xx_set_drive( m_fdc, 0 );
m_fdc->set_drive( 0 );
else
if (BIT(data, 7))
wd17xx_set_drive( m_fdc, 1 );
m_fdc->set_drive( 1 );
//logerror("Video pia port b write: %02X\n", data );
}
@ -396,19 +396,19 @@ static void osborne1_load_proc(device_image_interface &image)
switch( size )
{
case 40 * 10 * 256:
wd17xx_dden_w(state->m_fdc, ASSERT_LINE);
state->m_fdc->dden_w(ASSERT_LINE);
break;
case 40 * 5 * 1024:
wd17xx_dden_w(state->m_fdc, CLEAR_LINE);
state->m_fdc->dden_w(CLEAR_LINE);
break;
case 40 * 8 * 512:
wd17xx_dden_w(state->m_fdc, ASSERT_LINE);
state->m_fdc->dden_w(ASSERT_LINE);
break;
case 40 * 18 * 128:
wd17xx_dden_w(state->m_fdc, ASSERT_LINE);
state->m_fdc->dden_w(ASSERT_LINE);
break;
case 40 * 9 * 512:
wd17xx_dden_w(state->m_fdc, CLEAR_LINE);
state->m_fdc->dden_w(CLEAR_LINE);
break;
}
}

View File

@ -43,7 +43,7 @@ const wd17xx_interface partner_wd17xx_interface =
MACHINE_START_MEMBER(partner_state,partner)
{
wd17xx_set_pause_time(m_fdc, 10);
m_fdc->set_pause_time(10);
}
void partner_state::partner_window_1(UINT8 bank_num, UINT16 offset,UINT8 *rom)
@ -80,11 +80,11 @@ void partner_state::partner_window_2(UINT8 bank_num, UINT16 offset,UINT8 *rom)
READ8_MEMBER(partner_state::partner_floppy_r){
if (offset<0x100) {
switch(offset & 3) {
case 0x00 : return wd17xx_status_r(m_fdc,space, 0);
case 0x01 : return wd17xx_track_r(m_fdc,space, 0);
case 0x02 : return wd17xx_sector_r(m_fdc,space, 0);
case 0x00 : return m_fdc->status_r(space, 0);
case 0x01 : return m_fdc->track_r(space, 0);
case 0x02 : return m_fdc->sector_r(space, 0);
default :
return wd17xx_data_r(m_fdc,space, 0);
return m_fdc->data_r(space, 0);
}
} else {
return 0;
@ -94,25 +94,25 @@ READ8_MEMBER(partner_state::partner_floppy_r){
WRITE8_MEMBER(partner_state::partner_floppy_w){
if (offset<0x100) {
switch(offset & 3) {
case 0x00 : wd17xx_command_w(m_fdc,space, 0,data); break;
case 0x01 : wd17xx_track_w(m_fdc,space, 0,data);break;
case 0x02 : wd17xx_sector_w(m_fdc,space, 0,data);break;
default : wd17xx_data_w(m_fdc,space, 0,data);break;
case 0x00 : m_fdc->command_w(space, 0,data); break;
case 0x01 : m_fdc->track_w(space, 0,data);break;
case 0x02 : m_fdc->sector_w(space, 0,data);break;
default : m_fdc->data_w(space, 0,data);break;
}
} else {
floppy_mon_w(floppy_get_device(machine(), 0), 1);
floppy_mon_w(floppy_get_device(machine(), 1), 1);
if (((data >> 6) & 1)==1) {
wd17xx_set_drive(m_fdc,0);
m_fdc->set_drive(0);
floppy_mon_w(floppy_get_device(machine(), 0), 0);
floppy_drive_set_ready_state(floppy_get_device(machine(), 0), 1, 1);
}
if (((data >> 3) & 1)==1) {
wd17xx_set_drive(m_fdc,1);
m_fdc->set_drive(1);
floppy_mon_w(floppy_get_device(machine(), 1), 0);
floppy_drive_set_ready_state(floppy_get_device(machine(), 1), 1, 1);
}
wd17xx_set_side(m_fdc,data >> 7);
m_fdc->set_side(data >> 7);
}
}
@ -360,11 +360,11 @@ WRITE_LINE_MEMBER(partner_state::hrq_w)
READ8_MEMBER(partner_state::partner_fdc_r)
{
return wd17xx_data_r(m_fdc,space,offset);
return m_fdc->data_r(space,offset);
}
WRITE8_MEMBER(partner_state::partner_fdc_w)
{
wd17xx_data_w(m_fdc,space,offset,data);
m_fdc->data_w(space,offset,data);
}
I8257_INTERFACE( partner_dma )

View File

@ -156,10 +156,10 @@ READ8_MEMBER(pk8020_state::devices_r)
}
break;
case 0x18: switch(offset & 3) {
case 0 : return wd17xx_status_r(m_wd1793,space, 0);
case 1 : return wd17xx_track_r(m_wd1793,space, 0);
case 2 : return wd17xx_sector_r(m_wd1793,space, 0);
case 3 : return wd17xx_data_r(m_wd1793,space, 0);
case 0 : return m_wd1793->status_r(space, 0);
case 1 : return m_wd1793->track_r(space, 0);
case 2 : return m_wd1793->sector_r(space, 0);
case 3 : return m_wd1793->data_r(space, 0);
}
break;
case 0x20: switch(offset & 1) {
@ -186,10 +186,10 @@ WRITE8_MEMBER(pk8020_state::devices_w)
}
break;
case 0x18: switch(offset & 3) {
case 0 : wd17xx_command_w(m_wd1793,space, 0,data);break;
case 1 : wd17xx_track_w(m_wd1793,space, 0,data);break;
case 2 : wd17xx_sector_w(m_wd1793,space, 0,data);break;
case 3 : wd17xx_data_w(m_wd1793,space, 0,data);break;
case 0 : m_wd1793->command_w(space, 0,data);break;
case 1 : m_wd1793->track_w(space, 0,data);break;
case 2 : m_wd1793->sector_w(space, 0,data);break;
case 3 : m_wd1793->data_w(space, 0,data);break;
}
break;
case 0x20: switch(offset & 1) {
@ -844,21 +844,21 @@ WRITE8_MEMBER(pk8020_state::pk8020_portb_w)
floppy_mon_w(floppy_get_device(machine(), 1), 1);
floppy_mon_w(floppy_get_device(machine(), 2), 1);
floppy_mon_w(floppy_get_device(machine(), 3), 1);
wd17xx_set_side(m_wd1793,BIT(data,4));
m_wd1793->set_side(BIT(data,4));
if (BIT(data,0)) {
wd17xx_set_drive(m_wd1793,0);
m_wd1793->set_drive(0);
floppy_mon_w(floppy_get_device(machine(), 0), 0);
floppy_drive_set_ready_state(floppy_get_device(machine(), 0), 1, 1);
} else if (BIT(data,1)) {
wd17xx_set_drive(m_wd1793,1);
m_wd1793->set_drive(1);
floppy_mon_w(floppy_get_device(machine(), 1), 0);
floppy_drive_set_ready_state(floppy_get_device(machine(), 1), 1, 1);
} else if (BIT(data,2)) {
wd17xx_set_drive(m_wd1793,2);
m_wd1793->set_drive(2);
floppy_mon_w(floppy_get_device(machine(), 2), 0);
floppy_drive_set_ready_state(floppy_get_device(machine(), 2), 1, 1);
} else if (BIT(data,3)) {
wd17xx_set_drive(m_wd1793,3);
m_wd1793->set_drive(3);
floppy_mon_w(floppy_get_device(machine(), 3), 0);
floppy_drive_set_ready_state(floppy_get_device(machine(), 3), 1, 1);
}

View File

@ -208,7 +208,7 @@ WRITE8_MEMBER( rm380z_state::keyboard_put )
WRITE8_MEMBER( rm380z_state::disk_0_control )
{
device_t *fdc = machine().device("wd1771");
fd1771_device *fdc = machine().device<fd1771_device>("wd1771");
//printf("disk drive port0 write [%x]\n",data);
@ -216,13 +216,13 @@ WRITE8_MEMBER( rm380z_state::disk_0_control )
if (data&0x01)
{
// drive select bit 0
wd17xx_set_drive(fdc,0);
fdc->set_drive(0);
}
if (data&0x02)
{
// drive select bit 1
wd17xx_set_drive(fdc,1);
fdc->set_drive(1);
}
if (data&0x08)
@ -233,11 +233,11 @@ WRITE8_MEMBER( rm380z_state::disk_0_control )
// "MSEL (dir/side select bit)"
if (data&0x20)
{
wd17xx_set_side(fdc,1);
fdc->set_side(1);
}
else
{
wd17xx_set_side(fdc,0);
fdc->set_side(0);
}
// set drive en- (?)
@ -274,7 +274,7 @@ void rm380z_state::machine_reset()
memset(m_vram,0,RM380Z_SCREENSIZE);
config_memory_map();
wd17xx_reset(machine().device("wd1771"));
machine().device("wd1771")->reset();
init_graphic_chars();
}

View File

@ -2202,13 +2202,13 @@ READ16_MEMBER(rmnimbus_state::sio_serial_receive)
void rmnimbus_state::fdc_reset()
{
device_t *fdc = machine().device(FDC_TAG);
wd2793_device *fdc = machine().device<wd2793_device>(FDC_TAG);
m_nimbus_drives.reg400=0;
m_nimbus_drives.reg410_in=0;
m_nimbus_drives.reg410_out=0;
m_nimbus_drives.int_ff=0;
wd17xx_set_pause_time(fdc,FDC_PAUSE);
fdc->set_pause_time(FDC_PAUSE);
}
void rmnimbus_state::set_disk_int(int state)
@ -2271,7 +2271,7 @@ UINT8 rmnimbus_state::fdc_driveno(UINT8 drivesel)
READ8_MEMBER(rmnimbus_state::nimbus_disk_r)
{
int result = 0;
device_t *fdc = machine().device(FDC_TAG);
wd2793_device *fdc = machine().device<wd2793_device>(FDC_TAG);
int pc=space.device().safe_pc();
device_t *drive = machine().device(nimbus_wd17xx_interface.floppy_drive_tags[FDC_DRIVE()]);
@ -2279,17 +2279,17 @@ READ8_MEMBER(rmnimbus_state::nimbus_disk_r)
switch(offset*2)
{
case 0x08 :
result = wd17xx_status_r(fdc, space, 0);
result = fdc->status_r(space, 0);
if (LOG_DISK_FDD) logerror("Disk status=%2.2X\n",result);
break;
case 0x0A :
result = wd17xx_track_r(fdc, space, 0);
result = fdc->track_r(space, 0);
break;
case 0x0C :
result = wd17xx_sector_r(fdc, space, 0);
result = fdc->sector_r(space, 0);
break;
case 0x0E :
result = wd17xx_data_r(fdc, space, 0);
result = fdc->data_r(space, 0);
break;
case 0x10 :
m_nimbus_drives.reg410_in &= ~FDC_BITS_410;
@ -2337,7 +2337,7 @@ READ8_MEMBER(rmnimbus_state::nimbus_disk_r)
WRITE8_MEMBER(rmnimbus_state::nimbus_disk_w)
{
device_t *fdc = machine().device(FDC_TAG);
wd2793_device *fdc = machine().device<wd2793_device>(FDC_TAG);
int pc=space.device().safe_pc();
UINT8 reg400_old = m_nimbus_drives.reg400;
@ -2351,11 +2351,11 @@ WRITE8_MEMBER(rmnimbus_state::nimbus_disk_w)
{
case 0x00 :
m_nimbus_drives.reg400=data;
wd17xx_set_drive(fdc,FDC_DRIVE());
wd17xx_set_side(fdc, FDC_SIDE());
fdc->set_drive(FDC_DRIVE());
fdc->set_side(FDC_SIDE());
// Nimbus FDC is hard wired for double density
//wd17xx_set_density(fdc, DEN_MFM_LO);
//fdc->set_density(DEN_MFM_LO);
// if we enable hdc drq with a pending condition, act on it
if((data & HDC_DRQ_MASK) && (~reg400_old & HDC_DRQ_MASK))
@ -2363,16 +2363,16 @@ WRITE8_MEMBER(rmnimbus_state::nimbus_disk_w)
break;
case 0x08 :
wd17xx_command_w(fdc, space, 0, data);
fdc->command_w(space, 0, data);
break;
case 0x0A :
wd17xx_track_w(fdc, space, 0, data);
fdc->track_w(space, 0, data);
break;
case 0x0C :
wd17xx_sector_w(fdc, space, 0, data);
fdc->sector_w(space, 0, data);
break;
case 0x0E :
wd17xx_data_w(fdc, space, 0, data);
fdc->data_w(space, 0, data);
break;
case 0x10 :
hdc_ctrl_write(data);

View File

@ -291,15 +291,15 @@ const wd17xx_interface svi_wd17xx_interface =
WRITE8_MEMBER(svi318_state::svi318_fdc_drive_motor_w)
{
device_t *fdc = machine().device("wd179x");
fd1793_device *fdc = machine().device<fd1793_device>("wd179x");
switch (data & 3)
{
case 1:
wd17xx_set_drive(fdc,0);
fdc->set_drive(0);
m_fdc.driveselect = 0;
break;
case 2:
wd17xx_set_drive(fdc,1);
fdc->set_drive(1);
m_fdc.driveselect = 1;
break;
}
@ -307,10 +307,10 @@ WRITE8_MEMBER(svi318_state::svi318_fdc_drive_motor_w)
WRITE8_MEMBER(svi318_state::svi318_fdc_density_side_w)
{
device_t *fdc = machine().device("wd179x");
fd1793_device *fdc = machine().device<fd1793_device>("wd179x");
wd17xx_dden_w(fdc, BIT(data, 0));
wd17xx_set_side(fdc, BIT(data, 1));
fdc->dden_w(BIT(data, 0));
fdc->set_side(BIT(data, 1));
}
READ8_MEMBER(svi318_state::svi318_fdc_irqdrq_r)
@ -741,6 +741,8 @@ READ8_MEMBER(svi318_state::svi318_io_ext_r)
{
return 0xff;
}
fd1793_device *fdc = machine().device<fd1793_device>("wd179x");
switch( offset )
{
@ -771,20 +773,16 @@ READ8_MEMBER(svi318_state::svi318_io_ext_r)
break;
case 0x30:
device = machine().device("wd179x");
data = wd17xx_status_r(device, space, 0);
data = fdc->status_r(space, 0);
break;
case 0x31:
device = machine().device("wd179x");
data = wd17xx_track_r(device, space, 0);
data = fdc->track_r(space, 0);
break;
case 0x32:
device = machine().device("wd179x");
data = wd17xx_sector_r(device, space, 0);
data = fdc->sector_r(space, 0);
break;
case 0x33:
device = machine().device("wd179x");
data = wd17xx_data_r(device, space, 0);
data = fdc->data_r(space, 0);
break;
case 0x34:
data = svi318_fdc_irqdrq_r(space, 0);
@ -806,6 +804,8 @@ WRITE8_MEMBER(svi318_state::svi318_io_ext_w)
{
return;
}
fd1793_device *fdc = machine().device<fd1793_device>("wd179x");
switch( offset )
{
@ -840,20 +840,16 @@ WRITE8_MEMBER(svi318_state::svi318_io_ext_w)
break;
case 0x30:
device = machine().device("wd179x");
wd17xx_command_w(device, space, 0, data);
fdc->command_w(space, 0, data);
break;
case 0x31:
device = machine().device("wd179x");
wd17xx_track_w(device, space, 0, data);
fdc->track_w(space, 0, data);
break;
case 0x32:
device = machine().device("wd179x");
wd17xx_sector_w(device, space, 0, data);
fdc->sector_w(space, 0, data);
break;
case 0x33:
device = machine().device("wd179x");
wd17xx_data_w(device, space, 0, data);
fdc->data_w(space, 0, data);
break;
case 0x34:
svi318_fdc_drive_motor_w(space, 0, data);

View File

@ -273,10 +273,10 @@ static UINT8 to7_5p14_select;
READ8_MEMBER( thomson_state::to7_5p14_r )
{
device_t *fdc = machine().device("wd2793");
wd2793_device *fdc = machine().device<wd2793_device>("wd2793");
if ( offset < 4 )
return wd17xx_r( fdc, space, offset );
return fdc->read(space, offset );
else if ( offset == 8 )
return to7_5p14_select;
else
@ -288,9 +288,9 @@ READ8_MEMBER( thomson_state::to7_5p14_r )
WRITE8_HANDLER( thomson_state::to7_5p14_w )
{
device_t *fdc = machine().device("wd2793");
wd2793_device *fdc = machine().device<wd2793_device>("wd2793");
if ( offset < 4 )
wd17xx_w( fdc, space, offset, data );
fdc->write(space, offset, data );
else if ( offset == 8 )
{
/* drive select */
@ -307,15 +307,15 @@ WRITE8_HANDLER( thomson_state::to7_5p14_w )
logerror( "%f $%04x to7_5p14_w: invalid drive select pattern $%02X\n", machine().time().as_double(), m_maincpu->pc(), data );
}
wd17xx_dden_w(fdc, BIT(data, 7));
fdc->dden_w(BIT(data, 7));
to7_5p14_select = data;
if ( drive != -1 )
{
thom_floppy_active( 0 );
wd17xx_set_drive( fdc, drive );
wd17xx_set_side( fdc, side );
fdc->set_drive( drive );
fdc->set_side( side );
LOG(( "%f $%04x to7_5p14_w: $%02X set drive=%i side=%i density=%s\n",
machine().time().as_double(), m_maincpu->pc(),
data, drive, side, (BIT(data, 7) ? "FM" : "MFM")));
@ -330,9 +330,9 @@ WRITE8_HANDLER( thomson_state::to7_5p14_w )
void thomson_state::to7_5p14_reset()
{
device_t *fdc = machine().device("wd2793");
wd2793_device *fdc = machine().device<wd2793_device>("wd2793");
LOG(( "to7_5p14_reset: CD 90-640 controller\n" ));
wd17xx_reset(fdc);
fdc->reset();
}
@ -1926,7 +1926,7 @@ void thomson_state::thomson_index_callback(device_t *device, int state)
break;
case 2:
wd17xx_index_pulse_callback(machine().device("wd2793"), device, state);
machine().device<wd2793_device>("wd2793")->index_pulse_callback(device, state);
break;
case 3:

View File

@ -811,7 +811,7 @@ READ8Z_MEMBER(snug_bwg_legacy_device::readz)
// .... ..11 1111 0xx0
// Note that the value is inverted again on the board,
// so we can drop the inversion
if (!space.debugger_access()) *value = wd17xx_r(m_wd1773, space, (m_address >> 1)&0x03);
if (!space.debugger_access()) *value = m_wd1773->read(space, (m_address >> 1)&0x03);
if (TRACE_RW) logerror("bwg: read FDC: %04x -> %02x\n", m_address & 0xffff, *value);
if (TRACE_DATA)
{
@ -895,7 +895,7 @@ WRITE8_MEMBER(snug_bwg_legacy_device::write)
// Note that the value is inverted again on the board,
// so we can drop the inversion
if (TRACE_RW) logerror("bwg: write FDC: %04x <- %02x\n", m_address & 0xffff, data);
if (!space.debugger_access()) wd17xx_w(m_wd1773, space, (m_address >> 1)&0x03, data);
if (!space.debugger_access()) m_wd1773->write(space, (m_address >> 1)&0x03, data);
}
else
{
@ -998,7 +998,7 @@ WRITE8_MEMBER(snug_bwg_legacy_device::cruwrite)
if (m_DSEL != 0)
logerror("bwg: Multiple drives selected, %02x\n", m_DSEL);
m_DSEL |= drivebit;
wd17xx_set_drive(m_wd1773, drive);
m_wd1773->set_drive(drive);
}
}
else
@ -1009,13 +1009,13 @@ WRITE8_MEMBER(snug_bwg_legacy_device::cruwrite)
/* Select side of disk (bit 7) */
m_SIDE = data;
if (TRACE_CRU) logerror("bwg: set side (bit 7) = %d\n", data);
wd17xx_set_side(m_wd1773, m_SIDE);
m_wd1773->set_side(m_SIDE);
break;
case 10:
/* double density enable (active low) */
if (TRACE_CRU) logerror("bwg: set double density (bit 10) = %d\n", data);
wd17xx_dden_w(m_wd1773, (data != 0) ? ASSERT_LINE : CLEAR_LINE);
m_wd1773->dden_w((data != 0) ? ASSERT_LINE : CLEAR_LINE);
break;
case 11:

View File

@ -508,7 +508,7 @@ READ8Z_MEMBER(ti_fdc_legacy_device::readz)
if (m_WDsel && ((m_address & 9)==0))
{
if (!space.debugger_access()) reply = wd17xx_r(m_fd1771, space, (offset >> 1)&0x03);
if (!space.debugger_access()) reply = m_fd1771->read(space, (offset >> 1)&0x03);
if (TRACE_DATA)
{
if ((m_address & 0xffff)==0x5ff6) logerror("%02x ", ~reply & 0xff);
@ -534,7 +534,7 @@ WRITE8_MEMBER(ti_fdc_legacy_device::write)
// 0101 1111 1111 1xx0
if (m_WDsel && ((m_address & 9)==8))
{
if (!space.debugger_access()) wd17xx_w(m_fd1771, space, (offset >> 1)&0x03, data);
if (!space.debugger_access()) m_fd1771->write(space, (offset >> 1)&0x03, data);
}
}
}
@ -626,7 +626,7 @@ WRITE8_MEMBER(ti_fdc_legacy_device::cruwrite)
if (m_DSEL != 0)
logerror("tifdc: Multiple drives selected, %02x\n", m_DSEL);
m_DSEL |= drivebit;
wd17xx_set_drive(m_fd1771, drive);
m_fd1771->set_drive(drive);
}
}
else
@ -637,7 +637,7 @@ WRITE8_MEMBER(ti_fdc_legacy_device::cruwrite)
/* Select side of disk (bit 7) */
m_SIDSEL = data;
if (TRACE_CRU) logerror("tifdc: set side (bit 7) = %d\n", data);
wd17xx_set_side(m_fd1771, data);
m_fd1771->set_side(data);
break;
}
}

View File

@ -520,11 +520,11 @@ WRITE8_MEMBER( trs80_state::trs80m4_f4_w )
if (drive < 4)
{
wd17xx_set_drive(m_fdc,drive);
wd17xx_set_side(m_fdc,m_head);
m_fdc->set_drive(drive);
m_fdc->set_side(m_head);
}
wd17xx_dden_w(m_fdc, !BIT(data, 7));
m_fdc->dden_w(!BIT(data, 7));
/* CLEAR_LINE means to turn motors on */
floppy_mon_w(floppy_get_device(machine(), 0), (data & 0x0f) ? CLEAR_LINE : ASSERT_LINE);
@ -576,10 +576,10 @@ WRITE8_MEMBER( trs80_state::lnw80_fe_w )
mem.install_readwrite_handler (0x37e0, 0x37e3, read8_delegate(FUNC(trs80_state::trs80_irq_status_r), this), write8_delegate(FUNC(trs80_state::trs80_motor_w), this));
mem.install_readwrite_handler (0x37e8, 0x37eb, read8_delegate(FUNC(trs80_state::trs80_printer_r), this), write8_delegate(FUNC(trs80_state::trs80_printer_w), this));
mem.install_read_handler (0x37ec, 0x37ec, read8_delegate(FUNC(trs80_state::trs80_wd179x_r), this));
mem.install_legacy_write_handler (*m_fdc, 0x37ec, 0x37ec, FUNC(wd17xx_command_w));
mem.install_legacy_readwrite_handler (*m_fdc, 0x37ed, 0x37ed, FUNC(wd17xx_track_r), FUNC(wd17xx_track_w));
mem.install_legacy_readwrite_handler (*m_fdc, 0x37ee, 0x37ee, FUNC(wd17xx_sector_r), FUNC(wd17xx_sector_w));
mem.install_legacy_readwrite_handler (*m_fdc, 0x37ef, 0x37ef, FUNC(wd17xx_data_r), FUNC(wd17xx_data_w));
mem.install_write_handler (0x37ec, 0x37ec, write8_delegate(FUNC(fd1793_device::command_w),(fd1793_device*)m_fdc));
mem.install_readwrite_handler (0x37ed, 0x37ed, read8_delegate(FUNC(fd1793_device::track_r),(fd1793_device*)m_fdc), write8_delegate(FUNC(fd1793_device::track_w),(fd1793_device*)m_fdc));
mem.install_readwrite_handler (0x37ee, 0x37ee, read8_delegate(FUNC(fd1793_device::sector_r),(fd1793_device*)m_fdc), write8_delegate(FUNC(fd1793_device::sector_w),(fd1793_device*)m_fdc));
mem.install_readwrite_handler (0x37ef, 0x37ef, read8_delegate(FUNC(fd1793_device::data_r),(fd1793_device*)m_fdc),write8_delegate( FUNC(fd1793_device::data_w),(fd1793_device*)m_fdc));
mem.install_read_handler (0x3800, 0x38ff, 0, 0x0300, read8_delegate(FUNC(trs80_state::trs80_keyboard_r), this));
mem.install_readwrite_handler (0x3c00, 0x3fff, read8_delegate(FUNC(trs80_state::trs80_videoram_r), this), write8_delegate(FUNC(trs80_state::trs80_videoram_w), this));
}
@ -699,7 +699,7 @@ READ8_MEMBER( trs80_state::trs80_wd179x_r )
{
UINT8 data = 0xff;
if (BIT(m_io_config->read(), 7))
data = wd17xx_status_r(m_fdc, space, offset);
data = m_fdc->status_r(space, offset);
return data;
}
@ -788,8 +788,8 @@ WRITE8_MEMBER( trs80_state::trs80_motor_w )
return;
}
wd17xx_set_drive(m_fdc,drive);
wd17xx_set_side(m_fdc,m_head);
m_fdc->set_drive(drive);
m_fdc->set_side(m_head);
/* Turn motors on */
floppy_mon_w(floppy_get_device(machine(), 0), CLEAR_LINE);

View File

@ -157,8 +157,8 @@ WRITE8_MEMBER( vector06_state::vector06_disc_w )
{
// something here needs to turn the motor on
wd17xx_set_side (m_fdc,BIT(data, 2) ^ 1);
wd17xx_set_drive(m_fdc,BIT(data, 0));
m_fdc->set_side (BIT(data, 2) ^ 1);
m_fdc->set_drive(BIT(data, 0));
}
void vector06_state::machine_start()

View File

@ -677,9 +677,9 @@ WRITE8_MEMBER(z80ne_state::lx390_motor_w)
if (drive < 4)
{
LOG(("lx390_motor_w, set drive %1d\n", drive));
wd17xx_set_drive(m_wd1771,drive);
m_wd1771->set_drive(drive);
LOG(("lx390_motor_w, set side %1d\n", m_wd17xx_state.head));
wd17xx_set_side(m_wd1771, m_wd17xx_state.head);
m_wd1771->set_side(m_wd17xx_state.head);
}
}
@ -708,19 +708,19 @@ READ8_MEMBER(z80ne_state::lx390_fdc_r)
switch(offset)
{
case 0:
d = wd17xx_status_r(m_wd1771, space, 0) ^ 0xff;
d = m_wd1771->status_r(space, 0) ^ 0xff;
LOG(("lx390_fdc_r, WD17xx status: %02x\n", d));
break;
case 1:
d = wd17xx_track_r(m_wd1771, space, 0) ^ 0xff;
d = m_wd1771->track_r(space, 0) ^ 0xff;
LOG(("lx390_fdc_r, WD17xx track: %02x\n", d));
break;
case 2:
d = wd17xx_sector_r(m_wd1771, space, 0) ^ 0xff;
d = m_wd1771->sector_r(space, 0) ^ 0xff;
LOG(("lx390_fdc_r, WD17xx sector: %02x\n", d));
break;
case 3:
d = wd17xx_data_r(m_wd1771, space, 0) ^ 0xff;
d = m_wd1771->data_r(space, 0) ^ 0xff;
LOG(("lx390_fdc_r, WD17xx data3: %02x\n", d));
break;
case 6:
@ -728,7 +728,7 @@ READ8_MEMBER(z80ne_state::lx390_fdc_r)
lx390_reset_bank(space, 0);
break;
case 7:
d = wd17xx_data_r(m_wd1771, space, 3) ^ 0xff;
d = m_wd1771->data_r(space, 3) ^ 0xff;
LOG(("lx390_fdc_r, WD17xx data7, force: %02x\n", d));
break;
default:
@ -746,7 +746,7 @@ WRITE8_MEMBER(z80ne_state::lx390_fdc_w)
{
case 0:
LOG(("lx390_fdc_w, WD17xx command: %02x\n", d));
wd17xx_command_w(m_wd1771, space, offset, d ^ 0xff);
m_wd1771->command_w(space, offset, d ^ 0xff);
if (m_wd17xx_state.drive & 1)
output_set_value("drv0", 2);
else if (m_wd17xx_state.drive & 2)
@ -754,14 +754,14 @@ WRITE8_MEMBER(z80ne_state::lx390_fdc_w)
break;
case 1:
LOG(("lx390_fdc_w, WD17xx track: %02x\n", d));
wd17xx_track_w(m_wd1771, space, offset, d ^ 0xff);
m_wd1771->track_w(space, offset, d ^ 0xff);
break;
case 2:
LOG(("lx390_fdc_w, WD17xx sector: %02x\n", d));
wd17xx_sector_w(m_wd1771, space, offset, d ^ 0xff);
m_wd1771->sector_w(space, offset, d ^ 0xff);
break;
case 3:
wd17xx_data_w(m_wd1771, space, 0, d ^ 0xff);
m_wd1771->data_w(space, 0, d ^ 0xff);
LOG(("lx390_fdc_w, WD17xx data3: %02x\n", d));
break;
case 6:
@ -770,7 +770,7 @@ WRITE8_MEMBER(z80ne_state::lx390_fdc_w)
break;
case 7:
LOG(("lx390_fdc_w, WD17xx data7, force: %02x\n", d));
wd17xx_data_w(m_wd1771, space, 3, d ^ 0xff);
m_wd1771->data_w(space, 3, d ^ 0xff);
break;
}
}