Previous 199869 Revisions Next

r29468 Tuesday 8th April, 2014 at 19:38:02 UTC by James Wallace
Added support for the Samsung 16LF01 series of VFDs (a Rockwell clone with different segment drive order). Changed all affected systems to use it.

Maygay M1 and MV1 converted to standard i8279 drivers. [J.Wallace]
[src/emu/machine]roc10937.c roc10937.h
[src/mame/drivers]bfmsys85.c globalfr.c jpmimpct.c jpmsys5.c maygay1b.c maygay1bsw.c maygayv1.c mpu3.c mpu4hw.c mpu4sw.c proconn.c
[src/mame/includes]jpmimpct.h jpmsys5.h maygay1b.h

trunk/src/mame/drivers/maygay1bsw.c
r29467r29468
22
33/*
44 the MSM6376 is on the ROM board, so some games might not have it
5 the YM2149F is on the MAIN board
5 the YM2149F is on the MAIN board, but it seems very rarely used for sound.
6 
7 On various PCBs, I've seen the AY slot filled with AY8913's, 8910's,
8 YM2419s and even AY8930s.
69
710 some of the sound roms we have look more like uPD7749 ones? did some
811 ROM boards use that instead?
trunk/src/mame/drivers/jpmimpct.c
r29467r29468
13501350   MCFG_CPU_PROGRAM_MAP(awp68k_program_map)
13511351
13521352   MCFG_QUANTUM_TIME(attotime::from_hz(30000))
1353   MCFG_ROC10937_ADD("vfd",0,RIGHT_TO_LEFT)
1353   MCFG_S16LF01_ADD("vfd",0)
13541354
13551355   MCFG_MACHINE_START_OVERRIDE(jpmimpct_state,impctawp)
13561356   MCFG_MACHINE_RESET_OVERRIDE(jpmimpct_state,impctawp)
trunk/src/mame/drivers/maygayv1.c
r29467r29468
128128#include "cpu/m68000/m68000.h"
129129#include "video/awpvid.h"
130130#include "cpu/mcs51/mcs51.h"
131#include "machine/i8279.h"
131132#include "machine/6821pia.h"
132133#include "machine/mc68681.h"
133134#include "sound/2413intf.h"
r29467r29468
202203};
203204
204205
205struct i8279_t
206{
207   UINT8   command;
208   UINT8   mode;
209   UINT8   prescale;
210   UINT8   inhibit;
211   UINT8   clear;
212   UINT8   fifo[8];
213   UINT8   ram[16];
214};
215
216206class maygayv1_state : public driver_device
217207{
218208public:
r29467r29468
230220   required_device<mc68681_device> m_duart68681;
231221   required_device<palette_device> m_palette;
232222
223   int m_lamp_strobe;
224   int m_old_lamp_strobe;
233225   int m_vsync_latch_preset;
234226   UINT8 m_p1;
235227   UINT8 m_p3;
236228   int m_d68681_val;
237229   i82716_t m_i82716;
238   i8279_t m_i8279;
239230   DECLARE_WRITE16_MEMBER(i82716_w);
240231   DECLARE_READ16_MEMBER(i82716_r);
241232   DECLARE_WRITE16_MEMBER(write_odd);
242233   DECLARE_READ16_MEMBER(read_odd);
243   DECLARE_READ16_MEMBER(maygay_8279_r);
244   DECLARE_WRITE16_MEMBER(maygay_8279_w);
245234   DECLARE_WRITE16_MEMBER(vsync_int_ctrl);
246235   DECLARE_READ8_MEMBER(mcu_r);
247236   DECLARE_WRITE8_MEMBER(mcu_w);
248237   DECLARE_READ8_MEMBER(b_read);
249238   DECLARE_WRITE8_MEMBER(b_writ);
239   DECLARE_WRITE8_MEMBER(strobe_w);
240   DECLARE_WRITE8_MEMBER(lamp_data_w);
241   DECLARE_READ8_MEMBER(kbd_r);
250242   DECLARE_DRIVER_INIT(screenpl);
251243   virtual void machine_start();
252244   virtual void machine_reset();
r29467r29468
506498   return 0;
507499}
508500
501/*************************************
502 *
503 *  8279 display/keyboard driver
504 *
505 *************************************/
509506
510/* TODO */
511static void update_outputs(i8279_t &i8279, UINT16 which)
507WRITE8_MEMBER( maygayv1_state::strobe_w )
512508{
513   int i;
514
515   /* update the items in the bitmask */
516   for (i = 0; i < 16; i++)
517      if (which & (1 << i))
518      {
519/*
520            int val;
521
522            val = i8279.ram[i] & 0xff;
523
524            val = i8279.ram[i] & 0x0f;
525            if (i8279.inhibit & 0x01)
526                val = i8279.clear & 0x0f;
527
528                if(val) printf("%x\n", val);
529
530            val = i8279.ram[i] >> 4;
531            if (i8279.inhibit & 0x02)
532                val = i8279.clear >> 4;
533
534                if(val) printf("%x\n", val);
535*/
536      }
509   m_lamp_strobe = data;
537510}
538511
539READ16_MEMBER(maygayv1_state::maygay_8279_r)
512WRITE8_MEMBER( maygayv1_state::lamp_data_w )
540513{
541   i8279_t &i8279 = m_i8279;
542   static const char *const portnames[] = { "STROBE1","STROBE2","STROBE3","STROBE4","STROBE5","STROBE6","STROBE7","STROBE8" };
543   UINT8 result = 0xff;
544   UINT8 addr;
545
546   /* read data */
547   if ((offset & 1) == 0)
514   //The two A/B ports are merged back into one, to make one row of 8 lamps.
515   
516   if (m_old_lamp_strobe != m_lamp_strobe)
548517   {
549      switch (i8279.command & 0xe0)
550      {
551         /* read sensor RAM */
552         case 0x40:
553            addr = i8279.command & 0x07;
518      // Because of the nature of the lamping circuit, there is an element of persistance
519      // As a consequence, the lamp column data can change before the input strobe without
520      // causing the relevant lamps to black out.
554521
555            result = ioport(portnames[addr])->read();
556
557            /* handle autoincrement */
558            if (i8279.command & 0x10)
559               i8279.command = (i8279.command & 0xf0) | ((addr + 1) & 0x0f);
560
561            break;
562
563         /* read display RAM */
564         case 0x60:
565
566            /* set the value of the corresponding outputs */
567            addr = i8279.command & 0x0f;
568            result = i8279.ram[addr];
569
570            /* handle autoincrement */
571            if (i8279.command & 0x10)
572               i8279.command = (i8279.command & 0xf0) | ((addr + 1) & 0x0f);
573            break;
522      for (int i = 0; i < 8; i++)
523      {
524         output_set_lamp_value((8*m_lamp_strobe)+i, ((data  & (1 << i)) !=0));
574525      }
526      m_old_lamp_strobe = m_lamp_strobe;
575527   }
576   /* read status word */
577   else
578   {
579      printf("read 0xfc%02x\n", offset);
580      result = 0x10;
581   }
582   return result;
528   
583529}
584530
585
586WRITE16_MEMBER(maygayv1_state::maygay_8279_w)
531READ8_MEMBER( maygayv1_state::kbd_r )
587532{
588   i8279_t &i8279 = m_i8279;
589   UINT8 addr;
533   static const char *const portnames[] = { "STROBE1","STROBE2","STROBE3","STROBE4","STROBE5","STROBE6","STROBE7","STROBE8" };
590534
591   data >>= 8;
592
593   /* write data */
594   if ((offset & 1) == 0)
595   {
596      switch (i8279.command & 0xe0)
597      {
598         /* write display RAM */
599         case 0x80:
600
601            /* set the value of the corresponding outputs */
602            addr = i8279.command & 0x0f;
603            if (!(i8279.inhibit & 0x04))
604               i8279.ram[addr] = (i8279.ram[addr] & 0xf0) | (data & 0x0f);
605            if (!(i8279.inhibit & 0x08))
606               i8279.ram[addr] = (i8279.ram[addr] & 0x0f) | (data & 0xf0);
607            update_outputs(i8279, 1 << addr);
608
609            /* handle autoincrement */
610            if (i8279.command & 0x10)
611               i8279.command = (i8279.command & 0xf0) | ((addr + 1) & 0x0f);
612            break;
613      }
614   }
615
616   /* write command */
617   else
618   {
619      i8279.command = data;
620
621      switch (data & 0xe0)
622      {
623         /* command 0: set mode */
624         /*
625             Display modes:
626
627             00 = 8 x 8-bit character display -- left entry
628             01 = 16 x 8-bit character display -- left entry
629             10 = 8 x 8-bit character display -- right entry
630             11 = 16 x 8-bit character display -- right entry
631
632             Keyboard modes:
633
634             000 = Encoded scan keyboard -- 2 key lockout
635             001 = Decoded scan keyboard -- 2 key lockout
636             010 = Encoded scan keyboard -- N-key rollover
637             011 = Decoded scan keyboard -- N-key rollover
638             100 = Encoded scan sensor matrix
639             101 = Decoded scan sensor matrix
640             110 = Strobed input, encoded display scan
641             111 = Strobed input, decoded display scan
642         */
643         case 0x00:
644            logerror("8279: display mode = %d, keyboard mode = %d\n", (data >> 3) & 3, data & 7);
645            i8279.mode = data & 0x1f;
646            break;
647
648         /* command 1: program clock */
649         case 0x20:
650            logerror("8279: clock prescaler set to %02X\n", data & 0x1f);
651            i8279.prescale = data & 0x1f;
652            break;
653
654         /* command 2: read FIFO/sensor RAM */
655         /* command 3: read display RAM */
656         /* command 4: write display RAM */
657         case 0x40:
658         case 0x60:
659         case 0x80:
660            break;
661
662         /* command 5: display write inhibit/blanking */
663         case 0xa0:
664            i8279.inhibit = data & 0x0f;
665            update_outputs(i8279, ~0);
666            logerror("8279: clock prescaler set to %02X\n", data & 0x1f);
667            break;
668
669         /* command 6: clear */
670         case 0xc0:
671            i8279.clear = (data & 0x08) ? ((data & 0x04) ? 0xff : 0x20) : 0x00;
672            if (data & 0x11)
673               memset(i8279.ram, i8279.clear, sizeof(i8279.ram));
674            break;
675
676         /* command 7: end interrupt/error mode set */
677         case 0xe0:
678            break;
679      }
680   }
535   return ioport(portnames[m_lamp_strobe&0x07])->read();
681536}
682537
538static I8279_INTERFACE( v1_i8279_intf )
539{
540   DEVCB_NULL,                                     // irq
541   DEVCB_DRIVER_MEMBER(maygayv1_state, strobe_w),  // scan SL lines
542   DEVCB_DRIVER_MEMBER(maygayv1_state, lamp_data_w),      // display A&B
543   DEVCB_NULL,                                     // BD
544   DEVCB_DRIVER_MEMBER(maygayv1_state,kbd_r),      // kbd RL lines
545   DEVCB_NULL,                                     // Shift key
546   DEVCB_NULL                                      // Ctrl-Strobe line
547};
683548
549
684550WRITE16_MEMBER(maygayv1_state::vsync_int_ctrl)
685551{
686552   m_vsync_latch_preset = data & 0x0100;
r29467r29468
694560   AM_RANGE(0x000000, 0x07ffff) AM_ROM
695561   AM_RANGE(0x080000, 0x083fff) AM_RAM AM_SHARE("nvram")
696562   AM_RANGE(0x100000, 0x17ffff) AM_ROM AM_REGION("maincpu", 0x80000)
697   AM_RANGE(0x820000, 0x820003) AM_READWRITE(maygay_8279_r, maygay_8279_w)
563   AM_RANGE(0x820000, 0x820001) AM_DEVREADWRITE8("i8279", i8279_device, data_r, data_w ,0xff)
564   AM_RANGE(0x820002, 0x820003) AM_DEVREADWRITE8("i8279", i8279_device, status_r, cmd_w,0xff)
698565   AM_RANGE(0x800000, 0x800003) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0xff00)
699566   AM_RANGE(0x860000, 0x86000d) AM_READWRITE(read_odd, write_odd)
700567   AM_RANGE(0x86000e, 0x86000f) AM_WRITE(vsync_int_ctrl)
r29467r29468
1041908   MCFG_MC68681_IRQ_CALLBACK(WRITELINE(maygayv1_state, duart_irq_handler))
1042909   MCFG_MC68681_A_TX_CALLBACK(WRITELINE(maygayv1_state, duart_txa))
1043910
911   MCFG_I8279_ADD("i8279", MASTER_CLOCK/4, v1_i8279_intf)    // unknown clock
912
1044913   MCFG_SPEAKER_STANDARD_MONO("mono")
1045914
1046915   MCFG_SOUND_ADD("ymsnd",YM2413, MASTER_CLOCK / 4)
trunk/src/mame/drivers/maygay1b.c
r29467r29468
6868            3x trimmer
6969
7070
71        TODO: Convert to stock i8279 implementation, as currently inputs aren't read.
72              Fix meter reading (possibly related to above)
71        TODO: I/O is generally a nightmare, probably needs a rebuild at the address level.
72           Inputs need a sort out.
73           Some games require dongles for security, need to figure this out.
7374******************************************************************************************/
7475#include "emu.h"
7576#include "includes/maygay1b.h"
7677
7778#include "maygay1b.lh"
7879
79
80void maygay1b_state::m1_draw_lamps(int data,int strobe, int col)
81{
82   int i;
83
84   for ( i = 0; i < 8; i++ )
85   {
86      m_lamppos = (strobe*8) + col + i;
87
88      if ((data>>i)&1)
89         m_Lamps[m_lamppos] = 1;
90      else
91         m_Lamps[m_lamppos] = 0;
92
93      output_set_lamp_value(m_lamppos, m_Lamps[m_lamppos]);
94   }
95}
96
97
98/*************************************
99 *
100 *  8279 display/keyboard driver
101 *
102 *************************************/
103
104void maygay1b_state::update_outputs(i8279_state *chip, UINT16 which)
105{
106   static const UINT8 ls48_map[16] =
107      { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0x00 };
108   int i;
109
110   /* update the items in the bitmask */
111   for (i = 0; i < 16; i++)
112      if (which & (1 << i))
113      {
114         int val;
115
116         val = chip->ram[i] & 0x0f;
117         if (chip->inhibit & 0x01)
118            val = chip->clear & 0x0f;
119         output_set_digit_value(i * 2 + 0, ls48_map[val]);
120
121         val = chip->ram[i] >> 4;
122         if (chip->inhibit & 0x02)
123            val = chip->clear >> 4;
124         output_set_digit_value(i * 2 + 1, ls48_map[val]);
125      }
126}
127
128READ8_MEMBER(maygay1b_state::m1_8279_r)
129{
130   i8279_state *chip = m_i8279 + 0;
131   static const char *const portnames[] = { "SW1","STROBE5","STROBE7","STROBE3","SW2","STROBE4","STROBE6","STROBE2" };
132   UINT8 result = 0xff;
133   UINT8 addr;
134
135   /* read data */
136   if ((offset & 1) == 0)
137   {
138      switch (chip->command & 0xe0)
139      {
140         /* read sensor RAM */
141         case 0x40:
142            addr = chip->command & 0x07;
143            result = ioport("SW1")->read();
144            /* handle autoincrement */
145            if (chip->command & 0x10)
146               chip->command = (chip->command & 0xf0) | ((addr + 1) & 0x0f);
147
148            break;
149
150
151         /* read display RAM */
152         case 0x60:
153
154            /* set the value of the corresponding outputs */
155            addr = chip->command & 0x0f;
156            result = chip->ram[addr];
157
158            /* handle autoincrement */
159            if (chip->command & 0x10)
160               chip->command = (chip->command & 0xf0) | ((addr + 1) & 0x0f);
161            break;
162      }
163   }
164
165   /* read status word */
166   else
167   {
168      if ( chip->read_sensor )
169      {
170      result = ioport(portnames[chip->sense_address])->read();
171//          break
172      }
173      if ( chip->sense_auto_inc )
174      {
175         chip->sense_address = (chip->sense_address + 1 ) & 7;
176      }
177      else
178      {
179         result = chip->ram[chip->disp_address];
180         if ( chip->disp_auto_inc )
181         chip->disp_address++;
182      }
183   }
184   return result;
185}
186
187WRITE8_MEMBER(maygay1b_state::m1_8279_w)
188{
189   i8279_state *chip = m_i8279 + 0;
190   UINT8 addr;
191
192   /* write data */
193   if ((offset & 1) == 0)
194   {
195      switch (chip->command & 0xe0)
196      {
197         /* write display RAM */
198         case 0x80:
199
200            /* set the value of the corresponding outputs */
201            addr = chip->command & 0x0f;
202            if (!(chip->inhibit & 0x04))
203               chip->ram[addr] = (chip->ram[addr] & 0xf0) | (data & 0x0f);
204            if (!(chip->inhibit & 0x08))
205               chip->ram[addr] = (chip->ram[addr] & 0x0f) | (data & 0xf0);
206            update_outputs(chip, 1 << addr);
207
208            /* handle autoincrement */
209            if (chip->command & 0x10)
210               chip->command = (chip->command & 0xf0) | ((addr + 1) & 0x0f);
211            break;
212      }
213   }
214
215   /* write command */
216   else
217   {
218      chip->command = data;
219
220      switch (data & 0xe0)
221      {
222         /* command 0: set mode */
223         /*
224             Display modes:
225
226             00 = 8 x 8-bit character display -- left entry
227             01 = 16 x 8-bit character display -- left entry
228             10 = 8 x 8-bit character display -- right entry
229             11 = 16 x 8-bit character display -- right entry
230
231             Keyboard modes:
232
233             000 = Encoded scan keyboard -- 2 key lockout
234             001 = Decoded scan keyboard -- 2 key lockout
235             010 = Encoded scan keyboard -- N-key rollover
236             011 = Decoded scan keyboard -- N-key rollover
237             100 = Encoded scan sensor matrix
238             101 = Decoded scan sensor matrix
239             110 = Strobed input, encoded display scan
240             111 = Strobed input, decoded display scan
241         */
242         case 0x00:
243            logerror("8279A: display mode = %d, keyboard mode = %d\n", (data >> 3) & 3, data & 7);
244            chip->mode = data & 0x1f;
245            break;
246
247         /* command 1: program clock */
248         case 0x20:
249            logerror("8279A: clock prescaler set to %02X\n", data & 0x1f);
250            chip->prescale = data & 0x1f;
251            break;
252
253         /* command 2: read FIFO/sensor RAM */
254         case 0x40:
255            chip->sense_address = data & 0x07;
256            chip->sense_auto_inc = data & 0x10;
257            chip->read_sensor = 1;
258            break;
259         /* command 3: read display RAM */
260         case 0x60:
261            chip->disp_address = data & 0x0f;
262            chip->disp_auto_inc = data & 0x10;
263            chip->read_sensor = 0;
264            break;
265         /* command 4: write display RAM */
266         case 0x80:
267            chip->disp_address = data & 0x0f;
268            chip->disp_auto_inc = data & 0x10;
269            chip->write_display = 1;
270            break;
271
272         /* command 5: display write inhibit/blanking */
273         case 0xa0:
274            chip->inhibit = data & 0x0f;
275            update_outputs(chip, 0);
276            logerror("8279: clock prescaler set to %02X\n", data & 0x1f);
277            break;
278
279            break;
280
281         /* command 6: clear */
282         case 0xc0:
283            chip->clear = (data & 0x08) ? ((data & 0x04) ? 0xff : 0x20) : 0x00;
284            if (data & 0x11)
285               memset(chip->ram, chip->clear, sizeof(chip->ram));
286            break;
287
288         /* command 7: end interrupt/error mode set */
289         case 0xe0:
290            break;
291      }
292   }
293   if ( chip->write_display )
294   {  // Data
295      assert(chip->disp_address < ARRAY_LENGTH(chip->ram));
296      if ( chip->ram[chip->disp_address] != data )
297      {
298         m1_draw_lamps(chip->ram[chip->disp_address],chip->disp_address, 0);
299      }
300      chip->ram[chip->disp_address] = data;
301
302      if ( chip->disp_auto_inc )
303         chip->disp_address ++;
304   }
305}
306
307READ8_MEMBER(maygay1b_state::m1_8279_2_r)
308{
309   i8279_state *chip = m_i8279 + 1;
310   UINT8 result = 0xff;
311   UINT8 addr;
312
313   /* read data */
314   if ((offset & 1) == 0)
315   {
316      switch (chip->command & 0xe0)
317      {
318         /* read sensor RAM */
319         case 0x40:
320            //result = ~ioport("DSW1")->read();  /* DSW 1 - inverted! */
321            break;
322
323         /* read display RAM */
324         case 0x60:
325
326            /* set the value of the corresponding outputs */
327            addr = chip->command & 0x0f;
328            result = chip->ram[addr];
329
330            /* handle autoincrement */
331            if (chip->command & 0x10)
332               chip->command = (chip->command & 0xf0) | ((addr + 1) & 0x0f);
333            break;
334      }
335   }
336
337   /* read status word */
338   else
339   {
340      logerror("read 0xfc%02x\n", offset);
341      result = 0x10;
342   }
343   return result;
344}
345
346
347WRITE8_MEMBER(maygay1b_state::m1_8279_2_w)
348{
349   i8279_state *chip = m_i8279 + 1;
350   UINT8 addr;
351
352   /* write data */
353   if ((offset & 1) == 0)
354   {
355      switch (chip->command & 0xe0)
356      {
357         /* write display RAM */
358         case 0x80:
359
360            /* set the value of the corresponding outputs */
361            addr = chip->command & 0x0f;
362            if (!(chip->inhibit & 0x04))
363               chip->ram[addr] = (chip->ram[addr] & 0xf0) | (data & 0x0f);
364            if (!(chip->inhibit & 0x08))
365               chip->ram[addr] = (chip->ram[addr] & 0x0f) | (data & 0xf0);
366            update_outputs(chip, 1 << addr);
367
368            /* handle autoincrement */
369            if (chip->command & 0x10)
370               chip->command = (chip->command & 0xf0) | ((addr + 1) & 0x0f);
371            break;
372      }
373   }
374
375   /* write command */
376   else
377   {
378      chip->command = data;
379
380      switch (data & 0xe0)
381      {
382         /* command 0: set mode */
383         /*
384             Display modes:
385
386             00 = 8 x 8-bit character display -- left entry
387             01 = 16 x 8-bit character display -- left entry
388             10 = 8 x 8-bit character display -- right entry
389             11 = 16 x 8-bit character display -- right entry
390
391             Keyboard modes:
392
393             000 = Encoded scan keyboard -- 2 key lockout
394             001 = Decoded scan keyboard -- 2 key lockout
395             010 = Encoded scan keyboard -- N-key rollover
396             011 = Decoded scan keyboard -- N-key rollover
397             100 = Encoded scan sensor matrix
398             101 = Decoded scan sensor matrix
399             110 = Strobed input, encoded display scan
400             111 = Strobed input, decoded display scan
401         */
402         case 0x00:
403            logerror("8279A: display mode = %d, keyboard mode = %d\n", (data >> 3) & 3, data & 7);
404            chip->mode = data & 0x1f;
405            break;
406
407         /* command 1: program clock */
408         case 0x20:
409            logerror("8279A: clock prescaler set to %02X\n", data & 0x1f);
410            chip->prescale = data & 0x1f;
411            break;
412
413         /* command 2: read FIFO/sensor RAM */
414         case 0x40:
415            chip->sense_address = data & 0x07;
416            chip->sense_auto_inc = data & 0x10;
417            chip->read_sensor = 1;
418            break;
419         /* command 3: read display RAM */
420         case 0x60:
421            chip->disp_address = data & 0x0f;
422            chip->disp_auto_inc = data & 0x10;
423            chip->read_sensor = 0;
424            break;
425         /* command 4: write display RAM */
426         case 0x80:
427            chip->disp_address = data & 0x0f;
428            chip->disp_auto_inc = data & 0x10;
429            chip->write_display = 1;
430            break;
431
432         /* command 5: display write inhibit/blanking */
433         case 0xa0:
434            break;
435
436         /* command 6: clear */
437         case 0xc0:
438            break;
439
440         /* command 7: end interrupt/error mode set */
441         case 0xe0:
442            break;
443      }
444   }
445   if ( chip->write_display )
446   {  // Data
447      if ( chip->ram[chip->disp_address] != data )
448      {
449         m1_draw_lamps(chip->ram[chip->disp_address],chip->disp_address, 128);
450      }
451      chip->ram[chip->disp_address] = data;
452      if ( chip->disp_auto_inc )
453         chip->disp_address ++;
454   }
455
456}
457
45880///////////////////////////////////////////////////////////////////////////
45981// called if board is reset ///////////////////////////////////////////////
46082///////////////////////////////////////////////////////////////////////////
r29467r29468
495117   return i;
496118}
497119
120READ8_MEMBER( maygay1b_state::m1_firq_clr_r )
121{
122   static int i = 0xff;
123   i ^= 0xff;
124   m_maincpu->set_input_line(M6809_FIRQ_LINE, CLEAR_LINE);
125   LOG(("6809 firq clr\n"));
126   return i;
127}
128
498129// NMI is periodic? or triggered by a write?
499130TIMER_DEVICE_CALLBACK_MEMBER( maygay1b_state::maygay1b_nmitimer_callback )
500131{
r29467r29468
784415
785416READ8_MEMBER(maygay1b_state::m1_meter_r)
786417{
787   //ay8910_device *ay8910 = machine().device<ay8910_device>("aysnd");
788   //return ay8910->data_r(space, offset);
789
790   //TODO: Game should read the meter state through Port A of the AY chip, but our timings aren't good enough (?)
418   //TODO: Can we just return the AY port A data?
791419   return m_meter;
792420}
421WRITE8_MEMBER(maygay1b_state::m1_lockout_w)
422{
423   int i;
424   for (i=0; i<6; i++)
425   {
426      coin_lockout_w(machine(), i, data & (1 << i) );
427   }
428}
793429
794430static ADDRESS_MAP_START( m1_memmap, AS_PROGRAM, 8, maygay1b_state )
795431   AM_RANGE(0x0000, 0x1fff) AM_RAM AM_SHARE("nvram")
r29467r29468
798434   AM_RANGE(0x2010, 0x2010) AM_WRITE(reel34_w)
799435   AM_RANGE(0x2020, 0x2020) AM_WRITE(reel56_w)
800436
801   // there is actually an 8279 and an 8051..
802   AM_RANGE(0x2030, 0x2031) AM_READWRITE(m1_8279_r,m1_8279_w)
803   AM_RANGE(0x2040, 0x2041) AM_READWRITE(m1_8279_2_r,m1_8279_2_w)
437   // there is actually an 8279 and an 8051 (which I guess is the MCU?).
438   AM_RANGE(0x2030, 0x2030) AM_DEVREADWRITE("i8279", i8279_device, data_r, data_w )
439   AM_RANGE(0x2031, 0x2031) AM_DEVREADWRITE("i8279", i8279_device, status_r, cmd_w)
440
441   //8051
442   AM_RANGE(0x2040, 0x2040) AM_DEVREADWRITE("i8279_2", i8279_device, data_r, data_w )
443   AM_RANGE(0x2041, 0x2041) AM_DEVREADWRITE("i8279_2", i8279_device, status_r, cmd_w)
804444//  AM_RANGE(0x2050, 0x2050)// SCAN on M1B
805445
806446   AM_RANGE(0x2070, 0x207f) AM_DEVREADWRITE("duart68681", mc68681_device, read, write )
r29467r29468
817457   AM_RANGE(0x2404, 0x2405) AM_READ(latch_st_lo)
818458   AM_RANGE(0x2406, 0x2407) AM_READ(latch_st_hi)
819459
460   AM_RANGE(0x2410, 0x2410) AM_READ(m1_firq_clr_r)
461
820462   AM_RANGE(0x2412, 0x2412) AM_READ(m1_firq_trg_r) // firq, sample playback?
821463
822464   AM_RANGE(0x2420, 0x2421) AM_WRITE(latch_ch2_w ) // oki
r29467r29468
831473   DEVCB_NULL,
832474   DEVCB_NULL,
833475   DEVCB_DRIVER_MEMBER(maygay1b_state,m1_meter_w),
834   DEVCB_NULL,
476   DEVCB_DRIVER_MEMBER(maygay1b_state,m1_lockout_w),
835477};
836478
479/*************************************
480 *
481 *  8279 display/keyboard driver
482 *
483 *************************************/
484
485WRITE8_MEMBER( maygay1b_state::scanlines_w )
486{
487   m_lamp_strobe = data;
488}
489
490WRITE8_MEMBER( maygay1b_state::lamp_data_w )
491{
492   //The two A/B ports are merged back into one, to make one row of 8 lamps.
493   
494   if (m_old_lamp_strobe != m_lamp_strobe)
495   {
496      // Because of the nature of the lamping circuit, there is an element of persistance
497      // As a consequence, the lamp column data can change before the input strobe without
498      // causing the relevant lamps to black out.
499
500      for (int i = 0; i < 8; i++)
501      {
502         output_set_lamp_value((8*m_lamp_strobe)+i, ((data  & (1 << i)) !=0));
503      }
504      m_old_lamp_strobe = m_lamp_strobe;
505   }
506   
507}
508
509READ8_MEMBER( maygay1b_state::kbd_r )
510{
511   ioport_port * portnames[] = { m_sw1_port, m_s2_port, m_s3_port, m_s4_port, m_s5_port, m_s6_port, m_s7_port, m_sw2_port};
512   return (portnames[m_lamp_strobe&0x07])->read();
513}
514
515static I8279_INTERFACE( m1_i8279_intf )
516{
517   DEVCB_NULL,                                     // irq
518   DEVCB_DRIVER_MEMBER(maygay1b_state, scanlines_w),  // scan SL lines
519   DEVCB_DRIVER_MEMBER(maygay1b_state, lamp_data_w),      // display A&B
520   DEVCB_NULL,                                     // BD
521   DEVCB_DRIVER_MEMBER(maygay1b_state,kbd_r),      // kbd RL lines
522   DEVCB_NULL,                                     // Shift key
523   DEVCB_NULL                                      // Ctrl-Strobe line
524};
525
526
527
528
529WRITE8_MEMBER( maygay1b_state::lamp_data_2_w )
530{
531   //The two A/B ports are merged back into one, to make one row of 8 lamps.
532   
533   if (m_old_lamp_strobe2 != m_lamp_strobe2)
534   {
535      // Because of the nature of the lamping circuit, there is an element of persistance
536      // As a consequence, the lamp column data can change before the input strobe without
537      // causing the relevant lamps to black out.
538
539      for (int i = 0; i < 8; i++)
540      {
541         output_set_lamp_value((8*m_lamp_strobe)+i+128, ((data  & (1 << i)) !=0));
542      }
543      m_old_lamp_strobe2 = m_lamp_strobe2;
544   }
545   
546}
547
548static I8279_INTERFACE( m1_i8279_2_intf )
549{
550   DEVCB_NULL,                                     // irq
551   DEVCB_NULL,  // scan SL lines
552   DEVCB_DRIVER_MEMBER(maygay1b_state, lamp_data_2_w),      // display A&B
553   DEVCB_NULL,                                     // BD
554   DEVCB_NULL,                                   // kbd RL lines
555   DEVCB_NULL,                                     // Shift key
556   DEVCB_NULL                                      // Ctrl-Strobe line
557};
558
837559// machine driver for maygay m1 board /////////////////////////////////
838560
839561
r29467r29468
851573   MCFG_PIA_WRITEPA_HANDLER(WRITE8(maygay1b_state, m1_pia_porta_w))
852574   MCFG_PIA_WRITEPB_HANDLER(WRITE8(maygay1b_state, m1_pia_portb_w))
853575
854   MCFG_MSC1937_ADD("vfd",0,RIGHT_TO_LEFT)
576   MCFG_S16LF01_ADD("vfd",0)
855577   MCFG_SPEAKER_STANDARD_MONO("mono")
856578   MCFG_SOUND_ADD("aysnd",YM2149, M1_MASTER_CLOCK)
857579   MCFG_SOUND_CONFIG(ay8910_config)
r29467r29468
863585   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
864586
865587   MCFG_TIMER_DRIVER_ADD_PERIODIC("nmitimer", maygay1b_state, maygay1b_nmitimer_callback, attotime::from_hz(75)) // freq?
588   MCFG_I8279_ADD("i8279", M1_MASTER_CLOCK/4, m1_i8279_intf)    // unknown clock
866589
590   MCFG_I8279_ADD("i8279_2", M1_MASTER_CLOCK/4, m1_i8279_2_intf)    // unknown clock
591
867592   MCFG_NVRAM_ADD_0FILL("nvram")
868593
869594   MCFG_DEFAULT_LAYOUT(layout_maygay1b)
trunk/src/mame/drivers/mpu4hw.c
r29467r29468
26332633MACHINE_CONFIG_FRAGMENT( mpu4_common )
26342634   MCFG_TIMER_DRIVER_ADD_PERIODIC("50hz", mpu4_state, gen_50hz, attotime::from_hz(100))
26352635
2636   MCFG_MSC1937_ADD("vfd",0,LEFT_TO_RIGHT)
2636   MCFG_MSC1937_ADD("vfd",0)
26372637   /* 6840 PTM */
26382638   MCFG_PTM6840_ADD("ptm_ic2", ptm_ic2_intf)
26392639
trunk/src/mame/drivers/proconn.c
r29467r29468
3030#include "sound/ay8910.h"
3131#include "video/awpvid.h"
3232#include "machine/roc10937.h"
33#include "machine/meters.h"
3334
3435#include "proconn.lh"
3536
r29467r29468
5051         m_ay(*this, "aysnd")
5152   { }
5253
53   optional_device<roc10937_t> m_vfd;
54   optional_device<s16lf01_t> m_vfd;
5455
5556   DECLARE_WRITE8_MEMBER( ay_w0 ) { m_ay->address_data_w(space, 0, data); }
5657   DECLARE_WRITE8_MEMBER( ay_w1 ) { m_ay->address_data_w(space, 1, data); }
r29467r29468
186187   required_device<z80sio_device> m_z80sio;
187188   required_device<ay8910_device> m_ay;
188189public:
190   int m_meter;
189191   DECLARE_DRIVER_INIT(proconn);
190192   virtual void machine_reset();
193   DECLARE_WRITE8_MEMBER(meter_w);
191194   DECLARE_WRITE16_MEMBER(serial_transmit);
192195   DECLARE_READ16_MEMBER(serial_receive);
193196};
r29467r29468
343346
344347READ16_MEMBER(proconn_state::serial_receive)
345348{
349   logerror("proconn serial receive read %x",offset);
346350   return -1;
347351}
348352
r29467r29468
357361   DEVCB_DRIVER_MEMBER16(proconn_state,serial_receive)     /* receive handler */
358362};
359363
364WRITE8_MEMBER(proconn_state::meter_w)
365{
366   int i;
367   for (i=0; i<8; i++)
368   {
369      if ( data & (1 << i) )
370      {
371         MechMtr_update(i, data & (1 << i) );
372         m_meter = data;
373      }
374   }
375}
376
360377static const ay8910_interface ay8910_config =
361378{
362379   AY8910_LEGACY_OUTPUT,
363380   AY8910_DEFAULT_LOADS,
364381   DEVCB_NULL,
365   DEVCB_NULL
382   DEVCB_NULL,
383   DEVCB_DRIVER_MEMBER(proconn_state,meter_w),
366384};
367385
368386
r29467r29468
383401   MCFG_CPU_CONFIG(z80_daisy_chain)
384402   MCFG_CPU_PROGRAM_MAP(proconn_map)
385403   MCFG_CPU_IO_MAP(proconn_portmap)
386   MCFG_ROC10937_ADD("vfd",0,LEFT_TO_RIGHT)
404   MCFG_S16LF01_ADD("vfd",0)
387405
388406   MCFG_Z80PIO_ADD( "z80pio_1", 4000000, pio_interface_1 ) /* ?? Mhz */
389407   MCFG_Z80PIO_ADD( "z80pio_2", 4000000, pio_interface_2 ) /* ?? Mhz */
trunk/src/mame/drivers/mpu4sw.c
r29467r29468
990990GAME_CUSTOM( 199?, m4eaw__bv, m4eaw,  "eun01r.p1",                0x0000, 0x010000, CRC(15b8eb9e) SHA1(e4babaf526e6dd45bb4b7f7441a08cfbec12c661), "Barcrest","Everyone's A Winner (Barcrest) (MPU4) (set 95)" )
991991GAME_CUSTOM( 199?, m4eaw__bw, m4eaw,  "eun01s.p1",                0x0000, 0x010000, CRC(d0b49fc6) SHA1(4062d9763010d42666660e383e52818d572b61b9), "Barcrest","Everyone's A Winner (Barcrest) (MPU4) (set 96)" )
992992GAME_CUSTOM( 199?, m4eaw__bx, m4eaw,  "eun01y.p1",                0x0000, 0x010000, CRC(88d3c370) SHA1(6c3839a9c89ae67f80ab932ec70ebaf1240de9bb), "Barcrest","Everyone's A Winner (Barcrest) (MPU4) (set 97)" )
993GAME_CUSTOM( 199?, m4eaw__bz, m4eaw,  "everyones a winner v2-5p", 0x0000, 0x008000, CRC(eb8f2fc5) SHA1(0d3614bd5ff561d17bef0d1e620f2f812b8fed5b), "Barcrest","Everyone's A Winner (Barcrest) (MPU4) (set 99)" )
994993
994ROM_START( m4eaw__bz ) \
995   ROM_REGION( 0x010000, "maincpu", 0 )
996   ROM_LOAD( "everyones a winner v2-5p", 0x8000, 0x008000, CRC(eb8f2fc5) SHA1(0d3614bd5ff561d17bef0d1e620f2f812b8fed5b))
997   M4EAW_EXTRA_ROMS
998ROM_END
995999
1000GAME(199?, m4eaw__bz, m4eaw ,mod4oki ,mpu4 , mpu4_state,m4_showstring ,ROT0,"Barcrest","Everyone's A Winner (Barcrest) (MPU4) (set 99)",GAME_FLAGS )
1001
9961002#define M4WTA_EXTRA_ROMS \
9971003   ROM_REGION( 0x48, "fakechr", 0 ) \
9981004   ROM_LOAD( "wn5s.chr", 0x0000, 0x000048, CRC(b90e5068) SHA1(14c57dcd7242104eb48a9be36192170b97bc5110) ) \
trunk/src/mame/drivers/globalfr.c
r29467r29468
77  Motherboard contains very few major components
88
99  Missing sound roms? (or is sound data in the program roms?)
10  NOTE: VFD is guessed as 16 segment, need to know more
10  NOTE: VFD is guessed as Samsung 16 segment, need to know more
1111*******************************************************************************/
1212
1313
r29467r29468
2828      { }
2929
3030   required_device<cpu_device> m_maincpu;
31   optional_device<roc10937_t> m_vfd;
31   optional_device<s16lf01_t> m_vfd;
3232
3333// serial vfd
3434   int m_alpha_clock;
r29467r29468
7777   /* basic machine hardware */
7878   MCFG_CPU_ADD("maincpu", M37710, 4000000)
7979   MCFG_CPU_PROGRAM_MAP(globalfr_map)
80   MCFG_ROC10937_ADD("vfd",0,RIGHT_TO_LEFT)
80   MCFG_S16LF01_ADD("vfd",0)
8181   MCFG_DEFAULT_LAYOUT(layout_globalfr)
8282MACHINE_CONFIG_END
8383
trunk/src/mame/drivers/jpmsys5.c
r29467r29468
646646
647647   MCFG_NVRAM_ADD_0FILL("nvram")
648648
649   MCFG_ROC10937_ADD("vfd",0,RIGHT_TO_LEFT)//for debug ports
649   MCFG_S16LF01_ADD("vfd",0)//for debug ports
650650
651651   MCFG_MACHINE_START_OVERRIDE(jpmsys5_state,jpmsys5v)
652652   MCFG_MACHINE_RESET_OVERRIDE(jpmsys5_state,jpmsys5v)
r29467r29468
864864   MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(jpmsys5_state, write_acia_clock))
865865
866866   MCFG_NVRAM_ADD_0FILL("nvram")
867   MCFG_ROC10937_ADD("vfd",0,RIGHT_TO_LEFT)
867   MCFG_S16LF01_ADD("vfd",0)
868868
869869   MCFG_MACHINE_START_OVERRIDE(jpmsys5_state,jpmsys5)
870870   MCFG_MACHINE_RESET_OVERRIDE(jpmsys5_state,jpmsys5)
r29467r29468
911911   MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(jpmsys5_state, write_acia_clock))
912912
913913   MCFG_NVRAM_ADD_0FILL("nvram")
914   MCFG_ROC10937_ADD("vfd",0,RIGHT_TO_LEFT)
914   MCFG_S16LF01_ADD("vfd",0)
915915
916916   MCFG_MACHINE_START_OVERRIDE(jpmsys5_state,jpmsys5)
917917   MCFG_MACHINE_RESET_OVERRIDE(jpmsys5_state,jpmsys5)
trunk/src/mame/drivers/mpu3.c
r29467r29468
8484MOD4- Some modifications on the PCB that didnt work, so field engineers reverted them to MOD3.
8585MOD5- board revision with bigger RAM and reset sensitivity circuit added on the PCB.
8686
87MOD6- adaption of the PCB to use small daughter card with 6116 RAM
87MOD6- adaptation of the PCB to use small daughter card with 6116 RAM
8888
8989Collectors have gone further with zero power RAM and the like, but these are the ones out in the wild.
9090
r29467r29468
850850   MCFG_CPU_ADD("maincpu", M6808, MPU3_MASTER_CLOCK)///4)
851851   MCFG_CPU_PROGRAM_MAP(mpu3_basemap)
852852
853   MCFG_MSC1937_ADD("vfd",0,LEFT_TO_RIGHT)
853   MCFG_MSC1937_ADD("vfd",0)
854854
855855   MCFG_TIMER_DRIVER_ADD_PERIODIC("50hz", mpu3_state, gen_50hz, attotime::from_hz(100))
856856   MCFG_TIMER_DRIVER_ADD_PERIODIC("555_ic10", mpu3_state, ic10_callback, PERIOD_OF_555_ASTABLE(10000,1000,0.0000001))
trunk/src/mame/drivers/bfmsys85.c
r29467r29468
415415   MCFG_CPU_ADD("maincpu", M6809, MASTER_CLOCK/4)          // 6809 CPU at 1 Mhz
416416   MCFG_CPU_PROGRAM_MAP(memmap)                        // setup read and write memorymap
417417   MCFG_CPU_PERIODIC_INT_DRIVER(bfmsys85_state, timer_irq,  1000)              // generate 1000 IRQ's per second
418   MCFG_MSC1937_ADD("vfd",0,RIGHT_TO_LEFT)
418   MCFG_MSC1937_ADD("vfd",0)
419419
420420   MCFG_DEVICE_ADD("acia6850_0", ACIA6850, 0)
421421   MCFG_ACIA6850_TXD_HANDLER(WRITELINE(bfmsys85_state,sys85_data_w))
trunk/src/mame/includes/maygay1b.h
r29467r29468
88#define M1_DUART_CLOCK  (XTAL_3_6864MHz)
99
1010#include "cpu/m6809/m6809.h"
11#include "machine/i8279.h"
12
1113#include "video/awpvid.h"       //Fruit Machines Only
1214#include "machine/6821pia.h"
1315#include "machine/mc68681.h"
r29467r29468
1921#include "sound/okim6376.h"
2022#include "machine/nvram.h"
2123
22struct i8279_state
23{
24   UINT8       command;
25   UINT8       mode;
26   UINT8       prescale;
27   UINT8       inhibit;
28   UINT8       clear;
29   UINT8       ram[16];
30   UINT8       read_sensor;
31   UINT8       write_display;
32   UINT8       sense_address;
33   UINT8       sense_auto_inc;
34   UINT8       disp_address;
35   UINT8       disp_auto_inc;
36};
37
38
3924class maygay1b_state : public driver_device
4025{
4126public:
r29467r29468
4328      : driver_device(mconfig, type, tag),
4429      m_maincpu(*this, "maincpu"),
4530      m_vfd(*this, "vfd"),
31      m_ay(*this, "aysnd"),
4632      m_msm6376(*this, "msm6376"),
47      m_duart68681(*this, "duart68681") {
48      m_NMIENABLE = 0;
49   }
33      m_duart68681(*this, "duart68681"),
34      m_sw1_port(*this, "SW1"),
35      m_sw2_port(*this, "SW2"),
36      m_s2_port(*this, "STROBE2"),
37      m_s3_port(*this, "STROBE3"),
38      m_s4_port(*this, "STROBE4"),
39      m_s5_port(*this, "STROBE5"),
40      m_s6_port(*this, "STROBE6"),
41      m_s7_port(*this, "STROBE7")
42   {}
5043
5144   required_device<cpu_device> m_maincpu;
52   optional_device<roc10937_t> m_vfd;
45   optional_device<s16lf01_t> m_vfd;
46   required_device<ay8910_device> m_ay;
5347   optional_device<okim6376_device> m_msm6376;
5448   required_device<mc68681_device> m_duart68681;
49   required_ioport m_sw1_port;
50   required_ioport m_sw2_port;
51   required_ioport m_s2_port;
52   required_ioport m_s3_port;
53   required_ioport m_s4_port;
54   required_ioport m_s5_port;
55   required_ioport m_s6_port;
56   required_ioport m_s7_port;
5557
5658   UINT8 m_lamppos;
59   int m_lamp_strobe;
60   int m_old_lamp_strobe;
61   int m_lamp_strobe2;
62   int m_old_lamp_strobe2;
5763   int m_alpha_clock;
5864   int m_RAMEN;
5965   int m_ALARMEN;
r29467r29468
6571   TIMER_DEVICE_CALLBACK_MEMBER( maygay1b_nmitimer_callback );
6672   UINT8 m_Lamps[256];
6773   int m_optic_pattern;
68   i8279_state m_i8279[2];
69   DECLARE_READ8_MEMBER(m1_8279_r);
70   DECLARE_WRITE8_MEMBER(m1_8279_w);
71   DECLARE_READ8_MEMBER(m1_8279_2_r);
72   DECLARE_WRITE8_MEMBER(m1_8279_2_w);
74   DECLARE_WRITE8_MEMBER(scanlines_w);
75   DECLARE_WRITE8_MEMBER(lamp_data_w);
76   DECLARE_WRITE8_MEMBER(lamp_data_2_w);
77   DECLARE_READ8_MEMBER(kbd_r);
7378   DECLARE_WRITE8_MEMBER(reel12_w);
7479   DECLARE_WRITE8_MEMBER(reel34_w);
7580   DECLARE_WRITE8_MEMBER(reel56_w);
r29467r29468
7883   DECLARE_READ8_MEMBER(latch_st_hi);
7984   DECLARE_READ8_MEMBER(latch_st_lo);
8085   DECLARE_WRITE8_MEMBER(m1ab_no_oki_w);
81   void m1_draw_lamps(int data,int strobe, int col);
8286   DECLARE_WRITE8_MEMBER(m1_pia_porta_w);
8387   DECLARE_WRITE8_MEMBER(m1_pia_portb_w);
88   DECLARE_WRITE8_MEMBER(m1_lockout_w);
8489   DECLARE_WRITE8_MEMBER(m1_meter_w);
8590   DECLARE_READ8_MEMBER(m1_meter_r);
91   DECLARE_READ8_MEMBER(m1_firq_clr_r);
8692   DECLARE_READ8_MEMBER(m1_firq_trg_r);
8793   DECLARE_WRITE_LINE_MEMBER(duart_irq_handler);
8894   DECLARE_READ8_MEMBER(m1_duart_r);
8995   DECLARE_DRIVER_INIT(m1);
9096   virtual void machine_start();
9197   virtual void machine_reset();
92   void update_outputs(i8279_state *chip, UINT16 which);
9398   void m1_stepper_reset();
9499};
trunk/src/mame/includes/jpmsys5.h
r29467r29468
3333   required_device<acia6850_device> m_acia6850_2;
3434   required_device<upd7759_device> m_upd7759;
3535   optional_device<tms34061_device> m_tms34061;
36   optional_device<roc10937_t> m_vfd;
36   optional_device<s16lf01_t> m_vfd;
3737   required_ioport m_direct_port;
3838   optional_device<palette_device> m_palette;
3939
trunk/src/mame/includes/jpmimpct.h
r29467r29468
7878   int m_slidesout;
7979   int m_hopper[3];
8080   int m_motor[3];
81   optional_device<roc10937_t> m_vfd;
81   optional_device<s16lf01_t> m_vfd;
8282   optional_shared_ptr<UINT16> m_vram;
8383   struct bt477_t m_bt477;
8484   DECLARE_READ16_MEMBER(duart_1_r);
trunk/src/emu/machine/roc10937.c
r29467r29468
3232*/
3333
3434static const UINT16 roc10937charset[]=
35{            // FEDC BA98 7654 3210
35{           // FEDC BA98 7654 3210
3636   0x507F, // 0101 0000 0111 1111 @.
3737   0x44CF, // 0100 0100 1100 1111 A.
3838   0x153F, // 0001 0101 0011 1111 B.
r29467r29468
9595         //                     -.
9696   0x2001, // 0010 0000 0000 0001 -
9797         //                     /.
98   0x2430, // 0010 0100 0011 0000 <.
98   0x2430, // 0010 0010 0011 0000 <.
9999   0x4430, // 0100 0100 0011 0000 =.
100100   0x8830, // 1000 1000 0011 0000 >.
101101   0x1407, // 0001 0100 0000 0111 ?.
102102};
103103
104
104105///////////////////////////////////////////////////////////////////////////
105106static const int roc10937poslut[]=
106107{
r29467r29468
128129   device_t(mconfig, type, name, tag, owner, clock, shortname, source)
129130{
130131   m_port_val=0;
131   m_reversed=0;
132132}
133133
134134
r29467r29468
138138   roc.m_port_val = val;
139139}
140140
141void rocvfd_t::static_set_zero(device_t &device, bool reversed)
142{
143   rocvfd_t &roc = downcast<rocvfd_t &>(device);
144   roc.m_reversed = reversed;
145}
146
147141void rocvfd_t::device_start()
148142{
149143   save_item(NAME(m_port_val));
150   save_item(NAME(m_reversed));
151144   save_item(NAME(m_cursor_pos));
152145   save_item(NAME(m_window_size));
153146   save_item(NAME(m_shift_count));
r29467r29468
196189   }
197190}
198191
192//Display on Rockwell chips is naturally backwards, due to the way it is wired. We emulate this by flipping the display at update time
199193void rocvfd_t::update_display()
200194{
201195   for (int i =0; i<16; i++)
202196   {
203      if (m_reversed)
204      {
205         m_outputs[i] = set_display(m_chars[15-i]);
206      }
207      else
208      {
209         m_outputs[i] = set_display(m_chars[i]);
210      }
197      m_outputs[i] = set_display(m_chars[15-i]);
211198      output_set_indexed_value("vfd", (m_port_val*16) + i, m_outputs[i]);
212199   }
213200}
r29467r29468
232219   : rocvfd_t(mconfig, ROC10937, "Rockwell 10937 VFD controller and compatible", tag, owner, clock, "roc10937", __FILE__)
233220{
234221   m_port_val=0;
235   m_reversed=0;
236222}
237223
238224const device_type MSC1937 = &device_creator<msc1937_t>;
r29467r29468
241227   : rocvfd_t(mconfig, MSC1937, "OKI MSC1937 VFD controller", tag, owner, clock, "msc1937", __FILE__)
242228{
243229   m_port_val=0;
244   m_reversed=0;
245230}
246231
247232void rocvfd_t::write_char(int data)
r29467r29468
301286   : rocvfd_t(mconfig, ROC10957, "Rockwell 10957 VFD controller and compatible", tag, owner, clock, "roc10957", __FILE__)
302287{
303288   m_port_val=0;
304   m_reversed=0;
305289}
306290
307291void roc10957_t::write_char(int data)
r29467r29468
363347      }
364348   }
365349}
350
351const device_type S16LF01 = &device_creator<s16lf01_t>;
352
353s16lf01_t::s16lf01_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
354   : rocvfd_t(mconfig, S16LF01, "Samsung 16LF01 Series VFD controller and compatible", tag, owner, clock, "s16lf01", __FILE__)
355{
356   m_port_val=0;
357}
358
359//Samsung chips fix the issue with the reversal of the drive.
360void s16lf01_t::update_display()
361{
362   for (int i =0; i<16; i++)
363   {
364      m_outputs[i] = set_display(m_chars[i]);
365      output_set_indexed_value("vfd", (m_port_val*16) + i, m_outputs[i]);
366   }
367}
trunk/src/emu/machine/roc10937.h
r29467r29468
11/**********************************************************************
22
3    Rockwell 10937/10957 interface and emulation by J.Wallace
4    OKI MSC1937 is a clone of this chip
3    Rockwell 10937/10957 interface and simlar chips
4   Emulation by J.Wallace
5    OKI MSC1937 is a clone of this chip, with many others.
56
67**********************************************************************/
78#pragma once
r29467r29468
910#ifndef ROC10937_H
1011#define ROC10937_H
1112
12#define LEFT_TO_RIGHT 1
13#define RIGHT_TO_LEFT 0
13#define MCFG_ROC10937_ADD(_tag,_val) \
14      MCFG_DEVICE_ADD(_tag, ROC10937,60)\
15      MCFG_ROC10937_PORT(_val)
1416
15#define MCFG_ROC10937_ADD(_tag,_val,_reversed) \
16      MCFG_DEVICE_ADD(_tag, ROC10937,60)\
17      MCFG_ROC10937_PORT(_val) \
18      MCFG_ROC10937_REVERSE(_reversed)
1917#define MCFG_ROC10937_PORT(_val) \
2018   roc10937_t::static_set_value(*device, _val);
21#define MCFG_ROC10937_REVERSE(_reversed) \
22   roc10937_t::static_set_zero(*device, _reversed);
2319#define MCFG_ROC10937_REMOVE(_tag) \
2420   MCFG_DEVICE_REMOVE(_tag)
2521
26#define MCFG_ROC10957_ADD(_tag,_val,_reversed) \
22#define MCFG_ROC10957_ADD(_tag,_val) \
2723      MCFG_DEVICE_ADD(_tag, ROC10957,60)\
28      MCFG_ROC10957_PORT(_val) \
29      MCFG_ROC10957_REVERSE(_reversed)
24      MCFG_ROC10957_PORT(_val)
25     
3026#define MCFG_ROC10957_PORT(_val) \
3127   roc10957_t::static_set_value(*device, _val);
32#define MCFG_ROC10957_REVERSE(_reversed) \
33   roc10957_t::static_set_zero(*device, _reversed);
3428#define MCFG_ROC10957_REMOVE(_tag) \
3529   MCFG_DEVICE_REMOVE(_tag)
3630
37#define MCFG_MSC1937_ADD(_tag,_val,_reversed) \
31#define MCFG_MSC1937_ADD(_tag,_val) \
3832      MCFG_DEVICE_ADD(_tag, ROC10937,60)\
39      MCFG_MSC1937_PORT(_val) \
40      MCFG_MSC1937_REVERSE(_reversed)
33      MCFG_MSC1937_PORT(_val)
34     
4135#define MCFG_MSC1937_PORT(_val) \
4236   MCFG_ROC10937_PORT(_val)
4337
44#define MCFG_MSC1937_REVERSE(_reversed) \
45   roc10937_t::static_set_zero(*device, _reversed);
4638#define MCFG_MSC1937_REMOVE(_tag) \
4739   MCFG_DEVICE_REMOVE(_tag)
4840
41#define MCFG_S16LF01_ADD(_tag,_val) \
42      MCFG_DEVICE_ADD(_tag, S16LF01,60)\
43      MCFG_S16LF01_PORT(_val)
4944
45#define MCFG_S16LF01_PORT(_val) \
46   MCFG_ROC10937_PORT(_val)
47
5048class rocvfd_t : public device_t {
5149public:
5250   rocvfd_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
5351
5452   // inline configuration helpers
5553   static void static_set_value(device_t &device, int val);
56   static void static_set_zero(device_t &device, bool reversed);
5754   virtual void update_display();
5855   UINT8   m_port_val;
59   bool m_reversed;
6056   void blank(int data);
6157   void shift_data(int data);
6258   void write_char(int data);
r29467r29468
110106
111107};
112108
109class s16lf01_t : public rocvfd_t {
110public:
111   s16lf01_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
112
113   virtual void update_display();
114protected:
115
116};
117
113118extern const device_type ROC10937;
114119extern const device_type MSC1937;
115120extern const device_type ROC10957;
121extern const device_type S16LF01;
116122
117123#endif

Previous 199869 Revisions Next


© 1997-2024 The MAME Team