Previous 199869 Revisions Next

r18867 Monday 5th November, 2012 at 19:45:46 UTC by Curt Coder
(MESS) wd1772.c: Added WD2793 variant and READ/WRITE8_MEMBERs for individual registers. (nw)
[src/mess/machine]wd1772.c wd1772.h

trunk/src/mess/machine/wd1772.c
r18866r18867
3838const device_type WD1770x = &device_creator<wd1770_t>;
3939const device_type WD1772x = &device_creator<wd1772_t>;
4040const device_type WD1773x = &device_creator<wd1773_t>;
41const device_type WD2793x = &device_creator<wd2793_t>;
4142
4243wd177x_t::wd177x_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
4344   device_t(mconfig, type, name, tag, owner, clock)
r18866r18867
13641365         if(read_one_bit(limit))
13651366            return;
13661367         if(cur_live.bit_counter != 16
1367            && cur_live.shift_reg != 0x4489
1368            && cur_live.shift_reg != 0x5224)
1368            && cur_live.shift_reg != 0x4489
1369            && cur_live.shift_reg != 0x5224)
13691370            break;
13701371
13711372         // Incorrect, hmmm
r18866r18867
17771778{
17781779   return false;
17791780}
1781
1782wd2793_t::wd2793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD2793x, "WD2793", tag, owner, clock)
1783{
1784}
1785
1786bool wd2793_t::has_motor() const
1787{
1788   return false;
1789}
1790
1791bool wd2793_t::has_side_check() const
1792{
1793   return false;
1794}
trunk/src/mess/machine/wd1772.h
r18866r18867
44#include "emu.h"
55#include "imagedev/floppy.h"
66
7#define MCFG_WD1770x_ADD(_tag, _clock)   \
7#define MCFG_WD1770x_ADD(_tag, _clock)  \
88   MCFG_DEVICE_ADD(_tag, WD1770x, _clock)
99
10#define MCFG_WD1772x_ADD(_tag, _clock)   \
10#define MCFG_WD1772x_ADD(_tag, _clock)  \
1111   MCFG_DEVICE_ADD(_tag, WD1772x, _clock)
1212
13#define MCFG_WD1773x_ADD(_tag, _clock)   \
13#define MCFG_WD1773x_ADD(_tag, _clock)  \
1414   MCFG_DEVICE_ADD(_tag, WD1773x, _clock)
1515
16#define MCFG_WD2793x_ADD(_tag, _clock)  \
17   MCFG_DEVICE_ADD(_tag, WD2793x, _clock)
18
1619class wd177x_t : public device_t {
1720public:
1821   typedef delegate<void (bool state)> line_cb;
r18866r18867
2629
2730   void cmd_w(UINT8 val);
2831   UINT8 status_r();
32   DECLARE_READ8_MEMBER( status_r ) { return status_r(); }
33   DECLARE_WRITE8_MEMBER( cmd_w ) { cmd_w(data); }
2934
3035   void track_w(UINT8 val);
3136   UINT8 track_r();
37   DECLARE_READ8_MEMBER( track_r ) { return track_r(); }
38   DECLARE_WRITE8_MEMBER( track_w ) { track_w(data); }
3239
3340   void sector_w(UINT8 val);
3441   UINT8 sector_r();
42   DECLARE_READ8_MEMBER( sector_r ) { return sector_r(); }
43   DECLARE_WRITE8_MEMBER( sector_w ) { sector_w(data); }
3544
3645   void data_w(UINT8 val);
3746   UINT8 data_r();
47   DECLARE_READ8_MEMBER( data_r ) { return data_r(); }
48   DECLARE_WRITE8_MEMBER( data_w ) { data_w(data); }
3849
3950   void gen_w(int reg, UINT8 val);
4051   UINT8 gen_r(int reg);
r18866r18867
314325   virtual bool has_side_check() const;
315326};
316327
328class wd2793_t : public wd177x_t {
329public:
330   wd2793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
331
332protected:
333   virtual bool has_motor() const;
334   virtual bool has_side_check() const;
335};
336
317337extern const device_type WD1770x;
318338extern const device_type WD1772x;
319339extern const device_type WD1773x;
340extern const device_type WD2793x;
320341
321342#endif

Previous 199869 Revisions Next


© 1997-2024 The MAME Team