Previous 199869 Revisions Next

r29539 Friday 11th April, 2014 at 19:21:50 UTC by Angelo Salese
Added first step in adding floppy hook-up to Acorn Archimedes, removed old device implementation in favor of new device core.
[src/mame/includes]archimds.h
[src/mame/machine]archimds.c
[src/mess/drivers]a310.c

trunk/src/mess/drivers/a310.c
r29538r29539
1515 *  \- some subtle memory paging fault
1616 *  \- missing RAM max size
1717 *  \- ARM bug?
18 *  - 38776b8
1819 *
1920 *
2021=======================================================================================
r29538r29539
5859
5960
6061#include "emu.h"
61#include "machine/wd17xx.h"
62#include "imagedev/flopdrv.h"
6362#include "cpu/arm/arm.h"
6463#include "sound/dac.h"
6564#include "includes/archimds.h"
6665#include "machine/i2cmem.h"
6766//#include "machine/aakart.h"
6867#include "machine/ram.h"
68#include "machine/wd_fdc.h"
69#include "formats/applix_dsk.h"
6970
7071
7172class a310_state : public archimedes_state
r29538r29539
8788   virtual void machine_start();
8889   virtual void machine_reset();
8990    DECLARE_INPUT_CHANGED_MEMBER(key_stroke);
91   DECLARE_FLOPPY_FORMATS( floppy_formats );
9092
9193
9294protected:
r29538r29539
296298   PORT_BIT (0xf8, 0x80, IPT_UNUSED)
297299INPUT_PORTS_END
298300
299static const wd17xx_interface a310_wd17xx_interface =
300{
301   DEVCB_NULL,
302   DEVCB_DRIVER_LINE_MEMBER(a310_state, a310_wd177x_intrq_w),
303   DEVCB_DRIVER_LINE_MEMBER(a310_state, a310_wd177x_drq_w),
304   {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3}
305};
301FLOPPY_FORMATS_MEMBER( a310_state::floppy_formats )
302   FLOPPY_APPLIX_FORMAT
303FLOPPY_FORMATS_END
306304
305static SLOT_INTERFACE_START( a310_floppies )
306   SLOT_INTERFACE( "35dd", FLOPPY_35_DD )
307SLOT_INTERFACE_END
308
307309WRITE_LINE_MEMBER( archimedes_state::a310_kart_tx_w )
308310{
309311   if(state)
r29538r29539
331333   ARM_COPRO_TYPE_VL86C020
332334};
333335
336
334337static MACHINE_CONFIG_START( a310, a310_state )
335338   /* basic machine hardware */
336339   MCFG_CPU_ADD("maincpu", ARM, 8000000)        /* 8 MHz */
337340   MCFG_CPU_PROGRAM_MAP(a310_mem)
338341   MCFG_CPU_CONFIG(a310_config)
339342
340   MCFG_AAKART_ADD("kart", 8000000/256, kart_interface) // TODO: frequency
343   MCFG_AAKART_ADD("kart", 8000000/256, kart_interface)
341344
342345   MCFG_I2CMEM_ADD("i2cmem")
343346   MCFG_I2CMEM_DATA_SIZE(0x100)
r29538r29539
356359   MCFG_RAM_DEFAULT_SIZE("2M")
357360   MCFG_RAM_EXTRA_OPTIONS("512K, 1M, 4M, 8M, 16M")
358361
359   MCFG_WD1772_ADD("wd1772", a310_wd17xx_interface )
362   MCFG_WD1772x_ADD("fdc", 8000000 / 2)
363   MCFG_FLOPPY_DRIVE_ADD("fdc:0", a310_floppies, "35dd", a310_state::floppy_formats)
364   MCFG_FLOPPY_DRIVE_ADD("fdc:1", a310_floppies, "35dd", a310_state::floppy_formats)
360365
361   //MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(a310_floppy_interface)
362
363366   MCFG_SPEAKER_STANDARD_MONO("mono")
364367   MCFG_SOUND_ADD("dac0", DAC, 0)
365368   MCFG_SOUND_ROUTE(0, "mono", 0.10)
trunk/src/mame/machine/archimds.c
r29538r29539
685685         {
686686            case 0: return ioc_ctrl_r(space,offset,mem_mask);
687687            case 1:
688               if (m_wd1772) {
688               if (m_fdc) {
689689                  logerror("17XX: R @ addr %x mask %08x\n", offset*4, mem_mask);
690                  return m_wd1772->data_r(space, offset&0xf);
690                  return m_fdc->data_r(space, offset&0xf);
691691               } else {
692692                  logerror("Read from FDC device?\n");
693693                  return 0;
r29538r29539
702702               logerror("IOC: Internal Podule Read\n");
703703               return 0xffff;
704704            case 5:
705               if (m_wd1772) {
705               if (m_fdc) {
706706                  switch(ioc_addr & 0xfffc)
707707                  {
708708                     case 0x50: return 0; //fdc type, new model returns 5 here
r29538r29539
740740         {
741741            case 0: ioc_ctrl_w(space,offset,data,mem_mask); return;
742742            case 1:
743                  if (m_wd1772) {
743                  if (m_fdc) {
744744                     logerror("17XX: %x to addr %x mask %08x\n", data, offset*4, mem_mask);
745                     m_wd1772->data_w(space, offset&0xf, data&0xff);
745                     m_fdc->data_w(space, offset&0xf, data&0xff);
746746                  } else {
747747                     logerror("Write to FDC device?\n");
748748                  }
r29538r29539
757757               logerror("IOC: Internal Podule Write\n");
758758               return;
759759            case 5:
760               if (m_wd1772) {
760               if (m_fdc) {
761761                  switch(ioc_addr & 0xfffc)
762762                  {
763763                     case 0x18: // latch B
764                        m_wd1772->dden_w(BIT(data, 1));
764                        m_fdc->dden_w(BIT(data, 1));
765765                        return;
766766
767767                     case 0x40: // latch A
768                        if (data & 1) { m_wd1772->set_drive(0); }
769                        if (data & 2) { m_wd1772->set_drive(1); }
770                        if (data & 4) { m_wd1772->set_drive(2); }
771                        if (data & 8) { m_wd1772->set_drive(3); }
768                        floppy_image_device *floppy = NULL;
772769
773                        m_wd1772->set_side((data & 0x10)>>4);
770                        if (data & 1) { floppy = m_floppy0->get_device(); }
771                        if (data & 2) { floppy = m_floppy1->get_device(); }
772                        //if (data & 4) { m_fdc->set_drive(2); }
773                        //if (data & 8) { m_fdc->set_drive(3); }
774
775                        m_fdc->set_floppy(floppy);
776
777                        if(floppy)
778                        {
779                           floppy->mon_w(BIT(data, 5));
780                           m_fdc->dden_w(BIT(data, 4));
781                        }
774782                        //bit 5 is motor on
775783                        return;
776784                  }
r29538r29539
920928
921929
922930      //#ifdef MAME_DEBUG
931      if(0)
923932      logerror("VIDC: %s = %d\n", vrnames[(reg-0x80)/4], m_vidc_regs[reg]);
924933      //#endif
925934
trunk/src/mame/includes/archimds.h
r29538r29539
1010#include "machine/aakart.h"
1111#include "sound/dac.h"
1212#include "machine/i2cmem.h"
13#include "machine/wd17xx.h"
13#include "machine/wd_fdc.h"
1414
1515// interrupt definitions.  these are for the real Archimedes computer - arcade
1616// and gambling knockoffs likely are a bit different.
r29538r29539
4747      m_kart(*this, "kart"),
4848      m_maincpu(*this, "maincpu"),
4949      m_i2cmem(*this, "i2cmem"),
50      m_wd1772(*this, "wd1772"),
50      m_fdc(*this, "fdc"),
51      m_floppy0(*this, "fdc:0"),
52      m_floppy1(*this, "fdc:1"),
5153      m_region_maincpu(*this, "maincpu"),
5254      m_region_vram(*this, "vram"),
5355      m_screen(*this, "screen"),
r29538r29539
9294protected:
9395   required_device<cpu_device> m_maincpu;
9496   optional_device<i2cmem_device> m_i2cmem;
95   optional_device<wd1772_device> m_wd1772;
97   optional_device<wd1772_t> m_fdc;
98   optional_device<floppy_connector> m_floppy0;
99   optional_device<floppy_connector> m_floppy1;
96100   required_memory_region m_region_maincpu;
97101   required_memory_region m_region_vram;
98102   required_device<screen_device> m_screen;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team