Previous 199869 Revisions Next

r29400 Monday 7th April, 2014 at 03:22:38 UTC by Angelo Salese
Check-point, nw
[src/mame/drivers]4enlinea.c

trunk/src/mame/drivers/4enlinea.c
r29399r29400
214214
215215   required_device<ay8910_device> m_ay;
216216
217   DECLARE_READ8_MEMBER(unk_e000_r);
218   DECLARE_READ8_MEMBER(unk_e001_r);
217   DECLARE_READ8_MEMBER(serial_r);
218   DECLARE_READ8_MEMBER(serial_status_r);
219   DECLARE_WRITE8_MEMBER(serial_w);
220   DECLARE_WRITE8_MEMBER(serial_status_w);
221   DECLARE_READ8_MEMBER(hack_r);
219222   INTERRUPT_GEN_MEMBER(_4enlinea_irq);
223   INTERRUPT_GEN_MEMBER(_4enlinea_audio_irq);
224
220225   UINT8 m_irq_count;
226   UINT8 m_serial_flags;
227   UINT8 m_serial_data[2];
221228
222229   virtual void machine_start();
223230   virtual void machine_reset();
224231   required_device<cpu_device> m_maincpu;
232
225233};
226234
227235
r29399r29400
237245   isa8_cga_4enlinea_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
238246
239247   DECLARE_READ8_MEMBER( _4enlinea_io_read );
248   DECLARE_WRITE8_MEMBER( _4enlinea_mode_control_w );
240249   virtual void device_start();
241250   virtual const rom_entry *device_rom_region() const;
242251};
r29399r29400
272281   return data;
273282}
274283
284WRITE8_MEMBER( isa8_cga_4enlinea_device::_4enlinea_mode_control_w )
285{
286   // TODO
287}
275288
276289void isa8_cga_4enlinea_device::device_start()
277290{
r29399r29400
283296   m_vram.resize(m_vram_size);
284297
285298   m_update_row = NULL;
299   //m_isa->install_device(0x3bf, 0x3bf, 0, 0, NULL, write8_delegate( FUNC(isa8_cga_4enlinea_device::_4enlinea_mode_control_w), this ) );
286300   m_isa->install_device(0x3d0, 0x3df, 0, 0, read8_delegate( FUNC(isa8_cga_4enlinea_device::_4enlinea_io_read), this ), write8_delegate( FUNC(isa8_cga_device::io_write), this ) );
287301   m_isa->install_bank(0x8000, 0xbfff, 0, 0, "bank1", m_vram);
288302
r29399r29400
313327}
314328
315329
316READ8_MEMBER(_4enlinea_state::unk_e000_r)
330READ8_MEMBER(_4enlinea_state::serial_r)
317331{
318   logerror("read e000\n");
319//   return (machine().rand() & 0xff);
320   return 0xff;
321}
332   if(offset == 0)
333   {
334      m_maincpu->set_input_line(INPUT_LINE_NMI,CLEAR_LINE);
335      m_serial_flags |= 0x20;
336   }
322337
323READ8_MEMBER(_4enlinea_state::unk_e001_r)
324{
325   logerror("read e001\n");
326   return (machine().rand() & 0xff);   // after 30 seconds, random strings and gfx appear on the screen.
327//   return (machine().rand() & 0x0f);   // after 30 seconds, random gfx appear on the screen.
338   return m_serial_data[offset];
328339}
329340
341
342
330343/***********************************
331344*      Memory Map Information      *
332345***********************************/
r29399r29400
336349//   AM_RANGE(0x8000, 0xbfff) AM_RAM // CGA VRAM
337350   AM_RANGE(0xc000, 0xdfff) AM_RAM
338351
339   AM_RANGE(0xe000, 0xe000) AM_READ(unk_e000_r)
340   AM_RANGE(0xe001, 0xe001) AM_READ(unk_e001_r)
341
342   AM_RANGE(0xe002, 0xe3ff) AM_RAM   // bad... just temporary to allow writes for debug purposes.
343
352   AM_RANGE(0xe000, 0xe001) AM_READ(serial_r)
344353ADDRESS_MAP_END
345354
346
347355static ADDRESS_MAP_START( main_portmap, AS_IO, 8, _4enlinea_state )
348356   ADDRESS_MAP_GLOBAL_MASK(0x3ff)
349357
350358//   AM_RANGE(0x3d4, 0x3df) CGA regs
359   AM_RANGE(0x3bf, 0x3bf) AM_WRITENOP // CGA mode control, TODO
351360ADDRESS_MAP_END
352361
362READ8_MEMBER(_4enlinea_state::serial_status_r)
363{
364   return m_serial_flags;
365}
353366
367WRITE8_MEMBER(_4enlinea_state::serial_status_w)
368{
369   m_serial_flags = data; // probably just clears
370}
354371
372/* TODO: do this really routes to 0xe000-0xe001 of Main CPU? */
373WRITE8_MEMBER(_4enlinea_state::serial_w)
374{
375   m_serial_data[offset] = data;
376   if(offset == 0)
377      m_maincpu->set_input_line(INPUT_LINE_NMI,ASSERT_LINE);
378}
379
380READ8_MEMBER(_4enlinea_state::hack_r)
381{
382   return machine().rand();
383}
384
355385static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, _4enlinea_state )
356386   AM_RANGE(0x0000, 0x7fff) AM_ROM
357   AM_RANGE(0xe000, 0xffff) AM_RAM
387   AM_RANGE(0xf800, 0xfbff) AM_RAM
388   AM_RANGE(0xfc24, 0xfc24) AM_READ(hack_r)
389   AM_RANGE(0xfc28, 0xfc28) AM_READ(hack_r)
390   AM_RANGE(0xfc30, 0xfc31) AM_WRITE(serial_w)
391   AM_RANGE(0xfc32, 0xfc32) AM_READWRITE(serial_status_r,serial_status_w)
392   AM_RANGE(0xfc48, 0xfc49) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, address_data_w)
393
358394ADDRESS_MAP_END
359395
360396
r29399r29400
477513INTERRUPT_GEN_MEMBER(_4enlinea_state::_4enlinea_irq)
478514{
479515   if(m_irq_count == 0)
480      device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
516   {
517      //device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
518   }
481519   else
482520      device.execute().set_input_line(0, HOLD_LINE);
483521
r29399r29400
485523   m_irq_count&=3;
486524}
487525
526INTERRUPT_GEN_MEMBER(_4enlinea_state::_4enlinea_audio_irq)
527{
528   device.execute().set_input_line(0, HOLD_LINE);
529}
530
488531static MACHINE_CONFIG_START( 4enlinea, _4enlinea_state )
489532
490533   /* basic machine hardware */
r29399r29400
497540   MCFG_CPU_ADD("audiocpu", Z80, SND_CPU_CLOCK)
498541   MCFG_CPU_PROGRAM_MAP(audio_map)
499542   MCFG_CPU_IO_MAP(audio_portmap)
543   MCFG_CPU_PERIODIC_INT_DRIVER(_4enlinea_state, _4enlinea_audio_irq, 60) //TODO
500544
501545   MCFG_ISA8_BUS_ADD("isa", ":maincpu", _4enlinea_isabus_intf)
502546   MCFG_ISA8_SLOT_ADD("isa", "isa1", 4enlinea_isa8_cards, "4enlinea", true)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team