Previous 199869 Revisions Next

r31311 Friday 18th July, 2014 at 17:21:55 UTC by hap
took out preliminary (not-working) dleuro z80sio serial hookup. Replaced z80sio with z80dart device, even more preliminary hookup..., but we can get rid of the old device now
[src/mame/drivers]dlair.c

trunk/src/mame/drivers/dlair.c
r31310r31311
4141#include "machine/ldv1000.h"
4242#include "machine/ldstub.h"
4343#include "machine/z80ctc.h"
44#include "machine/z80sio.h"
44#include "machine/z80dart.h"
4545#include "sound/ay8910.h"
4646#include "sound/speaker.h"
4747#include "dlair.lh"
r31310r31311
5252public:
5353   dlair_state(const machine_config &mconfig, device_type type, const char *tag) :
5454      driver_device(mconfig, type, tag),
55      m_ldv1000(*this, "ld_ldv1000"),
56      m_pr7820(*this, "ld_pr7820"),
57      m_22vp932(*this, "ld_22vp932") ,
58      m_videoram(*this, "videoram"),
5955      m_maincpu(*this, "maincpu"),
6056      m_speaker(*this, "speaker"),
6157      m_gfxdecode(*this, "gfxdecode"),
62      m_palette(*this, "palette")
58      m_palette(*this, "palette"),
59      m_ldv1000(*this, "ld_ldv1000"),
60      m_pr7820(*this, "ld_pr7820"),
61      m_22vp932(*this, "ld_22vp932"),
62      m_videoram(*this, "videoram")
6363   {
6464   }
6565
66   required_device<cpu_device> m_maincpu;
67   optional_device<speaker_sound_device> m_speaker;
68   optional_device<gfxdecode_device> m_gfxdecode;
69   optional_device<palette_device> m_palette;
70   optional_device<pioneer_ldv1000_device> m_ldv1000;
71   optional_device<pioneer_pr7820_device> m_pr7820;
72   optional_device<phillips_22vp932_device> m_22vp932;
73   optional_shared_ptr<UINT8> m_videoram;
74
6675   void laserdisc_data_w(UINT8 data)
6776   {
6877      if (m_ldv1000 != NULL) m_ldv1000->data_w(data);
r31310r31311
102111      return CLEAR_LINE;
103112   }
104113
105   optional_device<pioneer_ldv1000_device> m_ldv1000;
106   optional_device<pioneer_pr7820_device> m_pr7820;
107   optional_device<phillips_22vp932_device> m_22vp932;
108   optional_shared_ptr<UINT8> m_videoram;
109114   UINT8 m_last_misc;
110115   UINT8 m_laserdisc_data;
111116   DECLARE_WRITE8_MEMBER(misc_w);
r31310r31311
123128   DECLARE_PALETTE_INIT(dleuro);
124129   UINT32 screen_update_dleuro(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
125130   DECLARE_WRITE_LINE_MEMBER(write_speaker);
126   DECLARE_WRITE_LINE_MEMBER(dleuro_interrupt);
127   DECLARE_WRITE16_MEMBER(serial_transmit);
128   DECLARE_READ16_MEMBER(serial_receive);
129   required_device<cpu_device> m_maincpu;
130   optional_device<speaker_sound_device> m_speaker;
131   optional_device<gfxdecode_device> m_gfxdecode;
132   optional_device<palette_device> m_palette;
133131};
134132
135133
r31310r31311
165163 *
166164 *************************************/
167165
168WRITE_LINE_MEMBER(dlair_state::dleuro_interrupt)
169{
170   m_maincpu->set_input_line(0, state);
171}
172
173
174WRITE16_MEMBER(dlair_state::serial_transmit)
175{
176   laserdisc_data_w(data);
177}
178
179
180READ16_MEMBER(dlair_state::serial_receive)
181{
182   /* if we still have data to send, do it now */
183   if (offset == 0 && laserdisc_data_available_r() == ASSERT_LINE)
184      return laserdisc_data_r();
185
186   return -1;
187}
188
189
190
191166WRITE_LINE_MEMBER(dlair_state::write_speaker)
192167{
193168   m_speaker->level_w(state);
r31310r31311
428403static ADDRESS_MAP_START( dleuro_io_map, AS_IO, 8, dlair_state )
429404   ADDRESS_MAP_GLOBAL_MASK(0xff)
430405   AM_RANGE(0x00, 0x03) AM_MIRROR(0x7c) AM_DEVREADWRITE("ctc", z80ctc_device, read, write)
431   AM_RANGE(0x80, 0x83) AM_MIRROR(0x7c) AM_DEVREADWRITE("sio", z80sio_device, read_alt, write_alt)
406   AM_RANGE(0x80, 0x83) AM_MIRROR(0x7c) AM_DEVREADWRITE("sio", z80dart_device, ba_cd_r, ba_cd_w)
432407ADDRESS_MAP_END
433408
434409
r31310r31311
730705   MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
731706   MCFG_Z80CTC_ZC0_CB(WRITELINE(dlair_state, write_speaker))
732707
733   MCFG_DEVICE_ADD("sio", Z80SIO, MASTER_CLOCK_EURO/4 /* same as "maincpu" */)
734   MCFG_Z80SIO_INT_CALLBACK(WRITELINE(dlair_state, dleuro_interrupt))
735   MCFG_Z80SIO_TRANSMIT_CALLBACK(WRITE16(dlair_state,serial_transmit))
736   MCFG_Z80SIO_RECEIVE_CALLBACK(READ16(dlair_state,serial_receive))
708   MCFG_Z80SIO0_ADD("sio", MASTER_CLOCK_EURO/4 /* same as "maincpu" */, 0, 0, 0, 0)
709   MCFG_Z80DART_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
710   // TODO: hook up tx and rx callbacks
737711
738712   MCFG_WATCHDOG_TIME_INIT(attotime::from_hz(MASTER_CLOCK_EURO/(16*16*16*16*16*8)))
739713

Previous 199869 Revisions Next


© 1997-2024 The MAME Team