Previous 199869 Revisions Next

r29627 Monday 14th April, 2014 at 05:05:30 UTC by Fabio Priuli
mm58274c: updated to use inline configs. nw.
[src/emu/bus/ti99_peb]bwg.c hfdc.c
[src/emu/machine]mm58274c.c mm58274c.h
[src/mess/drivers]compis.c concept.c geneve.c hunter2.c v6809.c wicat.c

trunk/src/emu/bus/ti99_peb/bwg.c
r29626r29627
594594   if (subdevice("3")!=NULL) m_floppy[3] = static_cast<floppy_image_device*>(subdevice("3")->first_subdevice());
595595}
596596
597static const mm58274c_interface bwg_mm58274c_interface =
598{
599   1,  /*  mode 24*/
600   0   /*  first day of week */
601};
602
603597INPUT_PORTS_START( bwg_fdc )
604598   PORT_START( "BWGDIP1" )
605599   PORT_DIPNAME( 0x01, 0x00, "BwG step rate" )
r29626r29627
634628   MCFG_WD1773x_ADD(FDC_TAG, XTAL_8MHz)
635629   MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(snug_bwg_device, fdc_irq_w))
636630   MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(snug_bwg_device, fdc_drq_w))
637   MCFG_MM58274C_ADD(CLOCK_TAG, bwg_mm58274c_interface)
638631
632   MCFG_DEVICE_ADD(CLOCK_TAG, MM58274C, 0)
633   MCFG_MM58274C_MODE24(1) // 24 hour
634   MCFG_MM58274C_DAY1(0)   // sunday
635
639636   MCFG_FLOPPY_DRIVE_ADD("0", bwg_floppies, "525dd", snug_bwg_device::floppy_formats)
640637   MCFG_FLOPPY_DRIVE_ADD("1", bwg_floppies, "525dd", snug_bwg_device::floppy_formats)
641638   MCFG_FLOPPY_DRIVE_ADD("2", bwg_floppies, NULL, snug_bwg_device::floppy_formats)
r29626r29627
11151112   { PFLOPPY_0, PFLOPPY_1, PFLOPPY_2, PFLOPPY_3 }
11161113};
11171114
1118static const mm58274c_interface floppyleg_mm58274c_interface =
1119{
1120   1,  /*  mode 24*/
1121   0   /*  first day of week */
1122};
1123
11241115INPUT_PORTS_START( bwg_fdc_legacy )
11251116   PORT_START( "BWGDIP1" )
11261117   PORT_DIPNAME( 0x01, 0x00, "BwG step rate" )
r29626r29627
11421133
11431134MACHINE_CONFIG_FRAGMENT( bwg_fdc_legacy )
11441135   MCFG_WD1773_ADD(FDCLEG_TAG, bwgleg_wd17xx_interface )
1145   MCFG_MM58274C_ADD(CLOCK_TAG, floppyleg_mm58274c_interface)
1136
1137   MCFG_DEVICE_ADD(CLOCK_TAG, MM58274C, 0)
1138   MCFG_MM58274C_MODE24(1) // 24 hour
1139   MCFG_MM58274C_DAY1(0)   // sunday
11461140MACHINE_CONFIG_END
11471141
11481142ROM_START( bwg_fdc_legacy )
trunk/src/emu/bus/ti99_peb/hfdc.c
r29626r29627
435435   FALSE,      /* do not use the full track layout */
436436};
437437
438static const mm58274c_interface floppy_mm58274c_interface =
439{
440   1,  /*  mode 24*/
441   0   /*  first day of week */
442};
443
444438MACHINE_CONFIG_FRAGMENT( ti99_hfdc )
445439   MCFG_SMC92X4_ADD(FDC_TAG, ti99_smc92x4_interface )
446440   MCFG_SMC92X4_INTRQ_CALLBACK(WRITELINE(myarc_hfdc_device, intrq_w))
r29626r29627
449443   MCFG_SMC92X4_AUXBUS_IN_CALLBACK(READ8(myarc_hfdc_device, auxbus_in))
450444   MCFG_SMC92X4_DMA_IN_CALLBACK(READ8(myarc_hfdc_device, read_buffer))
451445   MCFG_SMC92X4_DMA_OUT_CALLBACK(WRITE8(myarc_hfdc_device, write_buffer))
452   MCFG_MM58274C_ADD(CLOCK_TAG, floppy_mm58274c_interface)
446
447   MCFG_DEVICE_ADD(CLOCK_TAG, MM58274C, 0)
448   MCFG_MM58274C_MODE24(1) // 24 hour
449   MCFG_MM58274C_DAY1(0)   // sunday
453450MACHINE_CONFIG_END
454451
455452ROM_START( ti99_hfdc )
trunk/src/emu/machine/mm58274c.c
r29626r29627
4646
4747
4848mm58274c_device::mm58274c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
49            : device_t(mconfig, MM58274C, "National Semiconductor MM58274C", tag, owner, clock, "mm58274c", __FILE__)
49            : device_t(mconfig, MM58274C, "National Semiconductor MM58274C", tag, owner, clock, "mm58274c", __FILE__),
50               m_mode24(0),
51               m_day1(0)
5052{
5153}
5254
5355
5456//-------------------------------------------------
55//  device_config_complete - perform any
56//  operations now that the configuration is
57//  complete
58//-------------------------------------------------
59
60void mm58274c_device::device_config_complete()
61{
62   // inherit a copy of the static data
63   const mm58274c_interface *intf = reinterpret_cast<const mm58274c_interface *>(static_config());
64   if (intf != NULL)
65      *static_cast<mm58274c_interface *>(this) = *intf;
66   // or initialize to defaults if none provided
67   else
68   {
69      m_mode24 = 0;
70      m_day1 = 0;
71   }
72}
73
74//-------------------------------------------------
7557//  device_start - device-specific startup
7658//-------------------------------------------------
7759
trunk/src/emu/machine/mm58274c.h
r29626r29627
11#ifndef __MM58274C_H__
22#define __MM58274C_H__
33
4
5/*
6 Initializes the clock chip.
7 day1 must be set to a value from 0 (sunday), 1 (monday) ...
8 to 6 (saturday) and is needed to correctly retrieve the day-of-week
9 from the host system clock.
10 */
11
12struct mm58274c_interface
13{
14   int m_mode24;     /* 24/12 mode */
15   int m_day1;       /* first day of week */
16};
17
18
194/***************************************************************************
205    MACROS
216***************************************************************************/
227
23class mm58274c_device : public device_t,
24                  public mm58274c_interface
8class mm58274c_device : public device_t
259{
2610public:
2711   mm58274c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
2812   ~mm58274c_device() {}
2913
14   static void set_mode24(device_t &device, int mode) { downcast<mm58274c_device &>(device).m_mode24 = mode; }
15   static void set_day1(device_t &device, int day) { downcast<mm58274c_device &>(device).m_day1 = day; }
16
3017   DECLARE_READ8_MEMBER(read);
3118   DECLARE_WRITE8_MEMBER(write);
3219
r29626r29627
3522
3623protected:
3724   // device-level overrides
38   virtual void device_config_complete();
3925   virtual void device_start();
4026   virtual void device_reset();
4127
4228private:
4329   // internal state
30
31   // Initializion the clock chip:
32   // m_day1 must be set to a value from 0 (sunday), 1 (monday)...
33   // to 6 (saturday) and is needed to correctly retrieve the
34   // day-of-week from the host system clock.
35   int m_mode24;     /* 24/12 mode */
36   int m_day1;       /* first day of week */
37
4438   attotime interrupt_period_table(int val);
4539
4640   int m_status;     /* status register (*read* from address 0 = control register) */
r29626r29627
4943   int m_clk_set;    /* clock setting register */
5044   int m_int_ctl;    /* interrupt control register */
5145
52
5346   int m_wday;       /* day of the week (1-7 (1=day1 as set in init)) */
5447   int m_years1;     /* years (BCD: 0-99) */
5548   int m_years2;
r29626r29627
8073   MCFG_DEVICE_ADD(_tag, MM58274C, 0) \
8174   MCFG_DEVICE_CONFIG(_intrf)
8275
76#define MCFG_MM58274C_MODE24(_mode) \
77   mm58274c_device::set_mode24(*device, _mode);
78
79#define MCFG_MM58274C_DAY1(_day) \
80   mm58274c_device::set_day1(*device, _day);
81
82
8383#endif
trunk/src/mess/drivers/hunter2.c
r29626r29627
344344   palette.set_pen_color(1, rgb_t(92, 83, 88));
345345}
346346
347//-------------------------------------------------
348//  mm58274c_interface rtc_intf
349//-------------------------------------------------
350
351// this is all guess
352static const mm58274c_interface rtc_intf =
353{
354   0,  /*  mode 24*/
355   1   /*  first day of week */
356};
357
358347WRITE_LINE_MEMBER(hunter2_state::timer0_out)
359348{
360349   if(state == ASSERT_LINE)
r29626r29627
411400   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
412401
413402   /* Devices */
414   MCFG_MM58274C_ADD("rtc", rtc_intf)
415   //MCFG_TIMER_DRIVER_ADD_PERIODIC("hunter_a", hunter2_state, a_timer, attotime::from_hz(61))
403   MCFG_DEVICE_ADD("rtc", MM58274C, 0)
404   // this is all guess
405   MCFG_MM58274C_MODE24(0) // 12 hour
406   MCFG_MM58274C_DAY1(1)   // monday
416407
408//MCFG_TIMER_DRIVER_ADD_PERIODIC("hunter_a", hunter2_state, a_timer, attotime::from_hz(61))
409
417410   MCFG_NSC810_ADD("iotimer",XTAL_4MHz,XTAL_4MHz)
418411   MCFG_NSC810_PORTA_READ(READ8(hunter2_state,port00_r))
419412   MCFG_NSC810_PORTB_READ(READ8(hunter2_state,port01_r))
trunk/src/mess/drivers/compis.c
r29626r29627
625625
626626
627627//-------------------------------------------------
628//  mm58274c_interface rtc_intf
629//-------------------------------------------------
630
631static const mm58274c_interface rtc_intf =
632{
633   0,  /*  mode 24*/
634   1   /*  first day of week */
635};
636
637
638//-------------------------------------------------
639628//  cassette_interface compis_cassette_interface
640629//-------------------------------------------------
641630
r29626r29627
745734   MCFG_COMPIS_KEYBOARD_OUT_TX_HANDLER(DEVWRITELINE(I8251A_TAG, i8251_device, write_rxd))
746735
747736   MCFG_I8274_ADD(I8274_TAG, XTAL_16MHz/4, mpsc_intf)
748   MCFG_MM58274C_ADD(MM58174A_TAG, rtc_intf)
737
738   MCFG_DEVICE_ADD(MM58174A_TAG, MM58274C, 0)
739   MCFG_MM58274C_MODE24(0) // 12 hour
740   MCFG_MM58274C_DAY1(1)   // monday
741
749742   MCFG_CASSETTE_ADD(CASSETTE_TAG, compis_cassette_interface)
750743   MCFG_TIMER_DRIVER_ADD_PERIODIC("tape", compis_state, tape_tick, attotime::from_hz(44100))
751744
trunk/src/mess/drivers/geneve.c
r29626r29627
686686   m_mapper->dbin_in(state);
687687}
688688
689static const mm58274c_interface geneve_mm58274c_interface =
690{
691   1,  /*  mode 24*/
692   0   /*  first day of week */
693};
694
695689DRIVER_INIT_MEMBER(geneve_state,geneve)
696690{
697691}
r29626r29627
754748   MCFG_GENEVE_READY_HANDLER( WRITELINE(geneve_state, mapper_ready) )
755749
756750   // Clock
757   MCFG_MM58274C_ADD(GCLOCK_TAG, geneve_mm58274c_interface)
751   MCFG_DEVICE_ADD(GCLOCK_TAG, MM58274C, 0)
752   MCFG_MM58274C_MODE24(1) // 24 hour
753   MCFG_MM58274C_DAY1(0)   // sunday
758754
759755   // Peripheral expansion box (Geneve composition)
760756   MCFG_DEVICE_ADD( PERIBOX_TAG, PERIBOX_GEN, 0)
trunk/src/mess/drivers/v6809.c
r29626r29627
316316   SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
317317SLOT_INTERFACE_END
318318
319//-------------------------------------------------
320//  mm58274c_interface rtc_intf
321//-------------------------------------------------
322319
323// this is all guess
324static const mm58274c_interface rtc_intf =
325{
326   0,  /*  mode 24*/
327   1   /*  first day of week */
328};
329
330
331320// *** Machine ****
332321
333322static MACHINE_CONFIG_START( v6809, v6809_state )
r29626r29627
379368   MCFG_DEVICE_ADD("acia_clock", CLOCK, 10)
380369   MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(v6809_state, write_acia_clock))
381370
382   MCFG_MM58274C_ADD("rtc", rtc_intf)
371   MCFG_DEVICE_ADD("rtc", MM58274C, 0)
372// this is all guess
373   MCFG_MM58274C_MODE24(0) // 12 hour
374   MCFG_MM58274C_DAY1(1)   // monday
375
383376   MCFG_MB8876x_ADD("fdc", XTAL_16MHz / 16)
384377   MCFG_FLOPPY_DRIVE_ADD("fdc:0", v6809_floppies, "525dd", floppy_image_device::default_floppy_formats)
385378MACHINE_CONFIG_END
trunk/src/mess/drivers/wicat.c
r29626r29627
747747   }
748748}
749749
750static mm58274c_interface wicat_rtc_intf =
751{
752   0,  // 12 hour
753   1   // first day
754};
755
756750AM9517A_INTERFACE( wicat_videodma_intf )
757751{
758752   DEVCB_DRIVER_LINE_MEMBER(wicat_state,dma_hrq_w), // m_out_hreq_cb;
r29626r29627
776770   MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(wicat_state, via_b_w))
777771   MCFG_VIA6522_IRQ_HANDLER(INPUTLINE("maincpu", M68K_IRQ_1))
778772
779   MCFG_MM58274C_ADD("rtc",wicat_rtc_intf)  // actually an MM58174AN, but should be compatible
773   MCFG_DEVICE_ADD("rtc", MM58274C, 0)  // actually an MM58174AN, but should be compatible
774   MCFG_MM58274C_MODE24(0) // 12 hour
775   MCFG_MM58274C_DAY1(1)   // monday
780776
781777   // internal terminal
782778   MCFG_DEVICE_ADD("uart0", MC2661, XTAL_5_0688MHz)  // connected to terminal board
trunk/src/mess/drivers/concept.c
r29626r29627
190190/* init with simple, fixed, B/W palette */
191191/* Is the palette black on white or white on black??? */
192192
193static const mm58274c_interface concept_mm58274c_interface =
194{
195   0,  /*  mode 24*/
196   1   /*  first day of week */
197};
198
199
200193SLOT_INTERFACE_START( concept_exp_devices )
201194   SLOT_INTERFACE("fdc", CONCEPT_FDC)
202195   SLOT_INTERFACE("hdc", CONCEPT_HDC)
r29626r29627
227220   /* no sound? */
228221
229222   /* rtc */
230   MCFG_MM58274C_ADD("mm58274c", concept_mm58274c_interface)
223   MCFG_DEVICE_ADD("mm58274c", MM58274C, 0)
224   MCFG_MM58274C_MODE24(0) // 12 hour
225   MCFG_MM58274C_DAY1(1)   // monday
231226
232227   /* via */
233228   MCFG_DEVICE_ADD("via6522_0", VIA6522, 1022750)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team