Previous 199869 Revisions Next

r29303 Saturday 5th April, 2014 at 11:03:29 UTC by Nathan Woods
Merge branch 'master' of ssh://mess.org/mame into new_menus
[/shelves/new_menus/src/emu/imagedev]chd_cd.c
[/shelves/new_menus/src/emu/machine]6532riot.c 74123.c 74148.c 74153.c 74181.c aakart.c adc083x.c adc1038.c adc1213x.c ds1302.c
[/shelves/new_menus/src/emu/sound]pokey.c
[/shelves/new_menus/src/emu/video]h63484.c h63484.h hd63484.c huc6202.c huc6260.c huc6270.c mc6845.c pc_vga.c saa5050.c saa5050.h
[/shelves/new_menus/src/mame/drivers]gladiatr.c gsword.c kopunch.c littlerb.c malzak.c namcos23.c tempest.c
[/shelves/new_menus/src/mame/includes]gladiatr.h gsword.h kopunch.h
[/shelves/new_menus/src/mame/machine]cd32.c tait8741.c tait8741.h
[/shelves/new_menus/src/mame/video]kopunch.c ppu2c0x.c
[/shelves/new_menus/src/mess/drivers]a6809.c a7800.c abc80x.c bbc.c iskr103x.c p2000t.c pc.c poly.c
[/shelves/new_menus/src/mess/includes]abc80x.h
[/shelves/new_menus/src/mess/machine]a7800.c mega32x.c mega32x.h
[/shelves/new_menus/src/mess/video]a7800.c abc800.c abc802.c abc806.c

shelves/new_menus/src/mame/machine/tait8741.c
r29302r29303
3131#define CMD_08 1
3232#define CMD_4a 2
3333
34struct I8741 {
35   UINT8 toData;    /* to host data      */
36   UINT8 fromData;  /* from host data    */
37   UINT8 fromCmd;   /* from host command */
38   UINT8 status;    /* b0 = rd ready,b1 = wd full,b2 = cmd ?? */
39   UINT8 mode;
40   UINT8 phase;
41   UINT8 txd[8];
42   UINT8 rxd[8];
43   UINT8 parallelselect;
44   UINT8 txpoint;
45   int connect;
46   UINT8 pending4a;
47   int serial_out;
48   int coins;
49   read8_space_func portHandler;
50   const  char *portName;
51};
34const device_type TAITO8741_4PACK = &device_creator<taito8741_4pack_device>;
5235
53static const struct TAITO8741interface *intf;
54//static I8741 *taito8741;
55static I8741 taito8741[MAX_TAITO8741];
36taito8741_4pack_device::taito8741_4pack_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
37   : device_t(mconfig, TAITO8741_4PACK, "Taito 8741 MCU 4 pack", tag, owner, clock, "taito8741_4pack", __FILE__),
38   m_port_handler_0_r(*this),
39   m_port_handler_1_r(*this),
40   m_port_handler_2_r(*this),
41   m_port_handler_3_r(*this)
42{
43}
5644
5745/* for host data , write */
58static void taito8741_hostdata_w(I8741 *st,int data)
46void taito8741_4pack_device::hostdata_w(I8741 *st,int data)
5947{
6048   st->toData = data;
6149   st->status |= 0x01;
6250}
6351
6452/* from host data , read */
65static int taito8741_hostdata_r(I8741 *st)
53int taito8741_4pack_device::hostdata_r(I8741 *st)
6654{
6755   if( !(st->status & 0x02) ) return -1;
6856   st->status &= 0xfd;
r29302r29303
7058}
7159
7260/* from host command , read */
73static int taito8741_hostcmd_r(I8741 *st)
61int taito8741_4pack_device::hostcmd_r(I8741 *st)
7462{
7563   if(!(st->status & 0x04)) return -1;
7664   st->status &= 0xfb;
r29302r29303
8068
8169/* TAITO8741 I8741 emulation */
8270
83static void taito8741_serial_rx(I8741 *st,UINT8 *data)
71void taito8741_4pack_device::serial_rx(I8741 *st,UINT8 *data)
8472{
8573   memcpy(st->rxd,data,8);
8674}
8775
8876/* timer callback of serial tx finish */
89static TIMER_CALLBACK( taito8741_serial_tx )
77TIMER_CALLBACK_MEMBER( taito8741_4pack_device::serial_tx )
9078{
9179   int num = param;
92   I8741 *st = &taito8741[num];
80   I8741 *st = &m_taito8741[num];
9381   I8741 *sst;
9482
9583   if( st->mode==TAITO8741_MASTER)
r29302r29303
9886   st->txpoint = 1;
9987   if(st->connect >= 0 )
10088   {
101      sst = &taito8741[st->connect];
89      sst = &m_taito8741[st->connect];
10290      /* transfer data */
103      taito8741_serial_rx(sst,st->txd);
91      serial_rx(sst,st->txd);
10492      LOG(("8741-%d Serial data TX to %d\n",num,st->connect));
10593      if( sst->mode==TAITO8741_SLAVE)
10694         sst->serial_out = 1;
10795   }
10896}
10997
110void TAITO8741_reset(int num)
98void taito8741_4pack_device::device_reset()
11199{
112   I8741 *st = &taito8741[num];
113   st->status = 0x00;
114   st->phase = 0;
115   st->parallelselect = 0;
116   st->txpoint = 1;
117   st->pending4a = 0;
118   st->serial_out = 0;
119   st->coins = 0;
120   memset(st->rxd,0,8);
121   memset(st->txd,0,8);
100   for (int i=0;i<4;i++)
101   {
102      I8741 *st = &m_taito8741[i];
103      st->number = i;
104      st->status = 0x00;
105      st->phase = 0;
106      st->parallelselect = 0;
107      st->txpoint = 1;
108      st->pending4a = 0;
109      st->serial_out = 0;
110      st->coins = 0;
111      memset(st->rxd,0,8);
112      memset(st->txd,0,8);
113   }
122114}
123115
124116/* 8741 update */
125static void taito8741_update(address_space &space, int num)
117void taito8741_4pack_device::update(int num)
126118{
127119   I8741 *st,*sst;
128120   int next = num;
r29302r29303
130122
131123   do{
132124      num = next;
133      st = &taito8741[num];
125      st = &m_taito8741[num];
134126      if( st->connect != -1 )
135            sst = &taito8741[st->connect];
127            sst = &m_taito8741[st->connect];
136128      else sst = 0;
137129      next = -1;
138130      /* check pending command */
r29302r29303
149141      case CMD_4a: /* wait for syncronus ? */
150142         if(!st->pending4a)
151143         {
152            taito8741_hostdata_w(st,0);
144            hostdata_w(st,0);
153145            st->phase = CMD_IDLE;
154146            next = num; /* continue this chip */
155147         }
156148         break;
157149      case CMD_IDLE:
158150         /* ----- data in port check ----- */
159         data = taito8741_hostdata_r(st);
151         data = hostdata_r(st);
160152         if( data != -1 )
161153         {
162154            switch(st->mode)
r29302r29303
177169               else
178170               { /* port select */
179171                  st->parallelselect = data & 0x07;
180                  taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space,st->parallelselect,0xff) : st->portName ? space.machine().root_device().ioport(st->portName)->read() : 0);
172                  hostdata_w(st,port_read(st->number,st->parallelselect));
181173               }
182174            }
183175         }
184176         /* ----- new command fetch ----- */
185         data = taito8741_hostcmd_r(st);
177         data = hostcmd_r(st);
186178         switch( data )
187179         {
188180         case -1: /* no command data */
189181            break;
190182         case 0x00: /* read from parallel port */
191            taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space,0,0xff) : st->portName ? space.machine().root_device().ioport(st->portName)->read() : 0 );
183            hostdata_w(st,port_read(st->number,0));
192184            break;
193185         case 0x01: /* read receive buffer 0 */
194186         case 0x02: /* read receive buffer 1 */
r29302r29303
198190         case 0x06: /* read receive buffer 5 */
199191         case 0x07: /* read receive buffer 6 */
200192//if (data == 2 && num==0 && st->rxd[data-1]&0x80) logerror("Coin Get\n");
201            taito8741_hostdata_w(st,st->rxd[data-1]);
193            hostdata_w(st,st->rxd[data-1]);
202194            break;
203195         case 0x08:  /* latch received serial data */
204            st->txd[0] = st->portHandler ? st->portHandler(space,0,0xff) : st->portName ? space.machine().root_device().ioport(st->portName)->read() : 0;
196            st->txd[0] = port_read(st->number,0);
205197            if( sst )
206198            {
207               space.machine().scheduler().synchronize(FUNC(taito8741_serial_tx), num);
199               machine().scheduler().synchronize(timer_expired_delegate(FUNC(taito8741_4pack_device::serial_tx),this), num);
208200               st->serial_out = 0;
209201               st->status |= 0x04;
210202               st->phase = CMD_08;
r29302r29303
230222               if(sst->pending4a)
231223               {
232224                  sst->pending4a = 0; /* syncronus */
233                  taito8741_hostdata_w(st,0); /* return for host */
225                  hostdata_w(st,0); /* return for host */
234226                  next = st->connect;
235227               }
236228               else st->phase = CMD_4a;
237229            }
238230            break;
239231         case 0x80:  /* 8741-3 : return check code */
240            taito8741_hostdata_w(st,0x66);
232            hostdata_w(st,0x66);
241233            break;
242234         case 0x81:  /* 8741-2 : return check code */
243            taito8741_hostdata_w(st,0x48);
235            hostdata_w(st,0x48);
244236            break;
245237         case 0xf0:  /* GSWORD 8741-1 : initialize ?? */
246238            break;
r29302r29303
252244   }while(next>=0);
253245}
254246
255int TAITO8741_start(const struct TAITO8741interface *taito8741intf)
247void taito8741_4pack_device::device_start()
256248{
257   int i;
258
259   intf = taito8741intf;
260
261   //taito8741 = (I8741 *)malloc(intf->num*sizeof(I8741));
262   //if( taito8741 == 0 ) return 1;
263
264   for(i=0;i<intf->num;i++)
265   {
266      taito8741[i].connect     = intf->serial_connect[i];
267      taito8741[i].portHandler = intf->portHandler_r[i];
268      taito8741[i].portName    = intf->portName_r[i];
269      taito8741[i].mode        = intf->mode[i];
270      TAITO8741_reset(i);
271   }
272   return 0;
249   m_port_handler_0_r.resolve_safe(0);
250   m_port_handler_1_r.resolve_safe(0);
251   m_port_handler_2_r.resolve_safe(0);
252   m_port_handler_3_r.resolve_safe(0);
273253}
274254
275255/* read status port */
276static int I8741_status_r(address_space &space, int num)
256int taito8741_4pack_device::status_r(int num)
277257{
278   I8741 *st = &taito8741[num];
279   taito8741_update(space, num);
280   LOG(("%s:8741-%d ST Read %02x\n",space.machine().describe_context(),num,st->status));
258   I8741 *st = &m_taito8741[num];
259   update(num);
260   LOG(("%s:8741-%d ST Read %02x\n",machine().describe_context(),num,st->status));
281261   return st->status;
282262}
283263
284264/* read data port */
285static int I8741_data_r(address_space &space, int num)
265int taito8741_4pack_device::data_r(int num)
286266{
287   I8741 *st = &taito8741[num];
267   I8741 *st = &m_taito8741[num];
288268   int ret = st->toData;
289269   st->status &= 0xfe;
290   LOG(("%s:8741-%d DATA Read %02x\n",space.machine().describe_context(),num,ret));
270   LOG(("%s:8741-%d DATA Read %02x\n",machine().describe_context(),num,ret));
291271
292272   /* update chip */
293   taito8741_update(space, num);
273   update(num);
294274
295275   switch( st->mode )
296276   {
297277   case TAITO8741_PORT: /* parallel data */
298      taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space, st->parallelselect, 0xff) : st->portName ? space.machine().root_device().ioport(st->portName)->read() : 0);
278      hostdata_w(st,port_read(st->number,st->parallelselect));
299279      break;
300280   }
301281   return ret;
302282}
303283
304284/* Write data port */
305static void I8741_data_w(address_space &space, int num, int data)
285void taito8741_4pack_device::data_w(int num, int data)
306286{
307   I8741 *st = &taito8741[num];
308   LOG(("%s:8741-%d DATA Write %02x\n",space.machine().describe_context(),num,data));
287   I8741 *st = &m_taito8741[num];
288   LOG(("%s:8741-%d DATA Write %02x\n",machine().describe_context(),num,data));
309289   st->fromData = data;
310290   st->status |= 0x02;
311291   /* update chip */
312   taito8741_update(space, num);
292   update(num);
313293}
314294
315295/* Write command port */
316static void I8741_command_w(address_space &space, int num, int data)
296void taito8741_4pack_device::command_w(int num, int data)
317297{
318   I8741 *st = &taito8741[num];
319   LOG(("%s:8741-%d CMD Write %02x\n",space.machine().describe_context(),num,data));
298   I8741 *st = &m_taito8741[num];
299   LOG(("%s:8741-%d CMD Write %02x\n",machine().describe_context(),num,data));
320300   st->fromCmd = data;
321301   st->status |= 0x04;
322302   /* update chip */
323   taito8741_update(space,num);
303   update(num);
324304}
325305
326/* Write port handler */
327WRITE8_HANDLER( TAITO8741_0_w )
306UINT8 taito8741_4pack_device::port_read(int num, int offset)
328307{
329   if(offset&1) I8741_command_w(space,0,data);
330   else         I8741_data_w(space,0,data);
308   switch(num)
309   {
310      case 0 : return m_port_handler_0_r(offset);
311      case 1 : return m_port_handler_1_r(offset);
312      case 2 : return m_port_handler_2_r(offset);
313      case 3 : return m_port_handler_3_r(offset);
314      default : return 0;
315   }
331316}
332WRITE8_HANDLER( TAITO8741_1_w )
333{
334   if(offset&1) I8741_command_w(space,1,data);
335   else         I8741_data_w(space,1,data);
336}
337WRITE8_HANDLER( TAITO8741_2_w )
338{
339   if(offset&1) I8741_command_w(space,2,data);
340   else         I8741_data_w(space,2,data);
341}
342WRITE8_HANDLER( TAITO8741_3_w )
343{
344   if(offset&1) I8741_command_w(space,3,data);
345   else         I8741_data_w(space,3,data);
346}
347317
348/* Read port handler */
349READ8_HANDLER( TAITO8741_0_r )
350{
351   if(offset&1) return I8741_status_r(space,0);
352   return I8741_data_r(space,0);
353}
354READ8_HANDLER( TAITO8741_1_r )
355{
356   if(offset&1) return I8741_status_r(space,1);
357   return I8741_data_r(space,1);
358}
359READ8_HANDLER( TAITO8741_2_r )
360{
361   if(offset&1) return I8741_status_r(space,2);
362   return I8741_data_r(space,2);
363}
364READ8_HANDLER( TAITO8741_3_r )
365{
366   if(offset&1) return I8741_status_r(space,3);
367   return I8741_data_r(space,3);
368}
369318/****************************************************************************
370319
371320joshi Vollyball set.
r29302r29303
378327
379328****************************************************************************/
380329
381static int josvolly_nmi_enable;
330const device_type JOSVOLLY8741_4PACK = &device_creator<josvolly8741_4pack_device>;
382331
383struct JV8741  {
384   UINT8 cmd;
385   UINT8 sts;
386   UINT8 txd;
387   UINT8 outport;
388   UINT8 rxd;
389   UINT8 connect;
332josvolly8741_4pack_device::josvolly8741_4pack_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
333   : device_t(mconfig, JOSVOLLY8741_4PACK, "joshi Vollyball 8741 MCU 4 pack", tag, owner, clock, "josvolly8741_4pack", __FILE__),
334   m_port_handler_0_r(*this),
335   m_port_handler_1_r(*this),
336   m_port_handler_2_r(*this),
337   m_port_handler_3_r(*this)
338{
339}
390340
391   UINT8 rst;
341void josvolly8741_4pack_device::device_start()
342{
343   m_port_handler_0_r.resolve_safe(0);
344   m_port_handler_1_r.resolve_safe(0);
345   m_port_handler_2_r.resolve_safe(0);
346   m_port_handler_3_r.resolve_safe(0);
347}
392348
393   const char *initReadPort;
394};
395349
396static JV8741 i8741[4];
397
398void josvolly_8741_reset(void)
350void josvolly8741_4pack_device::device_reset()
399351{
400   int i;
352   m_nmi_enable = 0;
401353
402   josvolly_nmi_enable = 0;
403
404   for(i=0;i<4;i++)
354   for(int i=0;i<4;i++)
405355   {
406      i8741[i].cmd = 0;
407      i8741[i].sts = 0; // 0xf0; /* init flag */
408      i8741[i].txd = 0;
409      i8741[i].outport = 0xff;
410      i8741[i].rxd = 0;
356      m_i8741[i].cmd = 0;
357      m_i8741[i].sts = 0; // 0xf0; /* init flag */
358      m_i8741[i].txd = 0;
359      m_i8741[i].outport = 0xff;
360      m_i8741[i].rxd = 0;
411361
412      i8741[i].rst = 1;
413
362      m_i8741[i].rst = 1;
414363   }
415   i8741[0].connect = 1;
416   i8741[1].connect = 0;
417
418   i8741[0].initReadPort = "DSW1";  /* DSW1 */
419   i8741[1].initReadPort = "DSW2";  /* DSW2 */
420   i8741[2].initReadPort = "DSW1";  /* DUMMY */
421   i8741[3].initReadPort = "DSW2";  /* DUMMY */
422
423364}
424365
425366/* transmit data finish callback */
426static TIMER_CALLBACK( josvolly_8741_tx )
367TIMER_CALLBACK_MEMBER( josvolly8741_4pack_device::tx )
427368{
428369   int num = param;
429   JV8741 *src = &i8741[num];
430   JV8741 *dst = &i8741[src->connect];
370   JV8741 *src = &m_i8741[num];
371   JV8741 *dst = &m_i8741[src->connect];
431372
432373   dst->rxd = src->txd;
433374
r29302r29303
435376   dst->sts |=  0x01; /* RX ready  ? */
436377}
437378
438static void josvolly_8741_do(running_machine &machine, int num)
379void josvolly8741_4pack_device::update(int num)
439380{
440   if( (i8741[num].sts & 0x02) )
381   if( (m_i8741[num].sts & 0x02) )
441382   {
442383      /* transmit data */
443      machine.scheduler().timer_set (attotime::from_usec(1), FUNC(josvolly_8741_tx), num);
384      machine().scheduler().timer_set (attotime::from_usec(1), timer_expired_delegate(FUNC(josvolly8741_4pack_device::tx),this), num);
444385   }
445386}
446387
447static void josvolly_8741_w(address_space &space, int num, int offset, int data)
388void josvolly8741_4pack_device::write(int num, int offset, int data)
448389{
449   JV8741 *mcu = &i8741[num];
390   JV8741 *mcu = &m_i8741[num];
450391
451392   if(offset==1)
452393   {
453      LOG(("%s:8741[%d] CW %02X\n", space.machine().describe_context(), num, data));
394      LOG(("%s:8741[%d] CW %02X\n", machine().describe_context(), num, data));
454395
455396      /* read pointer */
456397      mcu->cmd = data;
r29302r29303
472413         break;
473414      case 2:
474415#if 1
475         mcu->rxd = space.machine().root_device().ioport("DSW2")->read();
416         mcu->rxd = port_read(1);
476417         mcu->sts |= 0x01; /* RD ready */
477418#endif
478419         break;
r29302r29303
488429   else
489430   {
490431      /* data */
491      LOG(("%s:8741[%d] DW %02X\n", space.machine().describe_context(), num, data));
432      LOG(("%s:8741[%d] DW %02X\n", machine().describe_context(), num, data));
492433
493434      mcu->txd = data ^ 0x40; /* parity reverce ? */
494435      mcu->sts |= 0x02;     /* TXD busy         */
r29302r29303
496437      /* interrupt ? */
497438      if(num == 0)
498439      {
499         if(josvolly_nmi_enable)
440         if(m_nmi_enable)
500441         {
501            space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
502            josvolly_nmi_enable = 0;
442            machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
443            m_nmi_enable = 0;
503444         }
504445      }
505446#endif
506447   }
507   josvolly_8741_do(space.machine(), num);
448   update(num);
508449}
509450
510static INT8 josvolly_8741_r(address_space &space,int num,int offset)
451UINT8 josvolly8741_4pack_device::read(int num,int offset)
511452{
512   JV8741 *mcu = &i8741[num];
453   JV8741 *mcu = &m_i8741[num];
513454   int ret;
514455
515456   if(offset==1)
516457   {
517458      if(mcu->rst)
518         mcu->rxd = space.machine().root_device().ioport(mcu->initReadPort)->read(); /* port in */
459         mcu->rxd = port_read(num); /* port in */
519460      ret = mcu->sts;
520      LOG(("%s:8741[%d]       SR %02X\n",space.machine().describe_context(),num,ret));
461      LOG(("%s:8741[%d]       SR %02X\n",machine().describe_context(),num,ret));
521462   }
522463   else
523464   {
524465      /* clear status port */
525466      mcu->sts &= ~0x01; /* RD ready */
526467      ret = mcu->rxd;
527      LOG(("%s:8741[%d]       DR %02X\n",space.machine().describe_context(),num,ret));
468      LOG(("%s:8741[%d]       DR %02X\n",machine().describe_context(),num,ret));
528469      mcu->rst = 0;
529470   }
530471   return ret;
531472}
532473
533WRITE8_HANDLER( josvolly_8741_0_w ){ josvolly_8741_w(space,0,offset,data); }
534READ8_HANDLER( josvolly_8741_0_r ) { return josvolly_8741_r(space,0,offset); }
535WRITE8_HANDLER( josvolly_8741_1_w ) { josvolly_8741_w(space,1,offset,data); }
536READ8_HANDLER( josvolly_8741_1_r ) { return josvolly_8741_r(space,1,offset); }
537
538WRITE8_HANDLER( josvolly_nmi_enable_w )
474UINT8 josvolly8741_4pack_device::port_read(int num)
539475{
540   josvolly_nmi_enable = 1;
476   switch(num)
477   {
478      case 0 : return m_port_handler_0_r(0);
479      case 1 : return m_port_handler_1_r(0);
480      case 2 : return m_port_handler_2_r(0);
481      case 3 : return m_port_handler_3_r(0);
482      default : return 0;
483   }
541484}
485
shelves/new_menus/src/mame/machine/tait8741.h
r29302r29303
66  gladiatr and Great Swordsman set.
77****************************************************************************/
88
9#define MAX_TAITO8741 4
10
119/* NEC 8741 program mode */
1210#define TAITO8741_MASTER 0
1311#define TAITO8741_SLAVE  1
1412#define TAITO8741_PORT   2
1513
16struct TAITO8741interface
14#define MCFG_TAITO8741_ADD(_tag) \
15   MCFG_DEVICE_ADD(_tag, TAITO8741_4PACK, 0)
16
17#define MCFG_TAITO8741_PORT_HANDLERS(_devcb0, _devcb1, _devcb2, _devcb3) \
18   devcb = &taito8741_4pack_device::set_port_handler_0_callback(*device, DEVCB2_##_devcb0); \
19   devcb = &taito8741_4pack_device::set_port_handler_1_callback(*device, DEVCB2_##_devcb1); \
20    devcb = &taito8741_4pack_device::set_port_handler_2_callback(*device, DEVCB2_##_devcb2); \
21   devcb = &taito8741_4pack_device::set_port_handler_3_callback(*device, DEVCB2_##_devcb3);
22
23#define MCFG_TAITO8741_MODES(_mode0, _mode1, _mode2, _mode3) \
24   taito8741_4pack_device::static_set_mode(*device, 0, _mode0);   \
25   taito8741_4pack_device::static_set_mode(*device, 1, _mode1);   \
26   taito8741_4pack_device::static_set_mode(*device, 2, _mode2);   \
27   taito8741_4pack_device::static_set_mode(*device, 3, _mode3);
28
29
30#define MCFG_TAITO8741_CONNECT(_con0, _con1, _con2, _con3) \
31   taito8741_4pack_device::static_set_connect(*device, 0, _con0);   \
32   taito8741_4pack_device::static_set_connect(*device, 1, _con1);   \
33   taito8741_4pack_device::static_set_connect(*device, 2, _con2);   \
34   taito8741_4pack_device::static_set_connect(*device, 3, _con3);
35
36   
37class taito8741_4pack_device : public device_t
1738{
18   int num;
19   int mode[MAX_TAITO8741];            /* program select */
20   int serial_connect[MAX_TAITO8741];  /* serial port connection */
21   read8_space_func portHandler_r[MAX_TAITO8741]; /* parallel port handler */
22   const char *portName_r[MAX_TAITO8741];
39   struct I8741 {
40      int number;
41      UINT8 toData;    /* to host data      */
42      UINT8 fromData;  /* from host data    */
43      UINT8 fromCmd;   /* from host command */
44      UINT8 status;    /* b0 = rd ready,b1 = wd full,b2 = cmd ?? */
45      UINT8 mode;
46      UINT8 phase;
47      UINT8 txd[8];
48      UINT8 rxd[8];
49      UINT8 parallelselect;
50      UINT8 txpoint;
51      int connect;
52      UINT8 pending4a;
53      int serial_out;
54      int coins;
55   };
56
57public:
58   taito8741_4pack_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
59   ~taito8741_4pack_device() {}
60
61   template<class _Object> static devcb2_base &set_port_handler_0_callback(device_t &device, _Object object) { return downcast<taito8741_4pack_device &>(device).m_port_handler_0_r.set_callback(object); }
62   template<class _Object> static devcb2_base &set_port_handler_1_callback(device_t &device, _Object object) { return downcast<taito8741_4pack_device &>(device).m_port_handler_1_r.set_callback(object); }
63   template<class _Object> static devcb2_base &set_port_handler_2_callback(device_t &device, _Object object) { return downcast<taito8741_4pack_device &>(device).m_port_handler_2_r.set_callback(object); }
64   template<class _Object> static devcb2_base &set_port_handler_3_callback(device_t &device, _Object object) { return downcast<taito8741_4pack_device &>(device).m_port_handler_3_r.set_callback(object); }
65     
66   static void static_set_mode(device_t &device, int num, UINT8 mode) { downcast<taito8741_4pack_device &>(device).m_taito8741[num].mode = mode; }
67   static void static_set_connect(device_t &device, int num, int conn) { downcast<taito8741_4pack_device &>(device).m_taito8741[num].connect = conn; }
68   
69   DECLARE_READ8_MEMBER( read_0 ) { if(offset&1) return status_r(0); else return data_r(0); }
70   DECLARE_WRITE8_MEMBER( write_0 ) { if(offset&1) command_w(0,data); else data_w(0,data); }
71   DECLARE_READ8_MEMBER( read_1 ) { if(offset&1) return status_r(1); else return data_r(1); }
72   DECLARE_WRITE8_MEMBER( write_1 ) { if(offset&1) command_w(1,data); else data_w(1,data); }
73   DECLARE_READ8_MEMBER( read_2 ) { if(offset&1) return status_r(2); else return data_r(2); }
74   DECLARE_WRITE8_MEMBER( write_2 ) { if(offset&1) command_w(2,data); else data_w(2,data); }
75   DECLARE_READ8_MEMBER( read_3 ) { if(offset&1) return status_r(3); else return data_r(3); }
76   DECLARE_WRITE8_MEMBER( write_3 ) { if(offset&1) command_w(3,data); else data_w(3,data); }
77
78   TIMER_CALLBACK_MEMBER( serial_tx );
79   void update(int num);
80   int status_r(int num);
81   int data_r(int num);
82   void data_w(int num, int data);
83   void command_w(int num, int data);
84   
85   UINT8 port_read(int num, int offset);
86
87protected:
88   // device-level overrides
89   virtual void device_start();
90   virtual void device_reset();
91
92private:
93   void hostdata_w(I8741 *st,int data);
94   int hostdata_r(I8741 *st);
95   int hostcmd_r(I8741 *st);
96   void serial_rx(I8741 *st,UINT8 *data);
97
98   // internal state
99   I8741       m_taito8741[4];
100
101   devcb2_read8 m_port_handler_0_r;
102   devcb2_read8 m_port_handler_1_r;
103   devcb2_read8 m_port_handler_2_r;
104   devcb2_read8 m_port_handler_3_r;
23105};
24106
25int  TAITO8741_start(const struct TAITO8741interface *taito8741intf);
26107
27void TAITO8741_reset(int num);
108extern const device_type TAITO8741_4PACK;
28109
29/* write handler */
30DECLARE_WRITE8_HANDLER( TAITO8741_0_w );
31DECLARE_WRITE8_HANDLER( TAITO8741_1_w );
32DECLARE_WRITE8_HANDLER( TAITO8741_2_w );
33DECLARE_WRITE8_HANDLER( TAITO8741_3_w );
34/* read handler */
35DECLARE_READ8_HANDLER( TAITO8741_0_r );
36DECLARE_READ8_HANDLER( TAITO8741_1_r );
37DECLARE_READ8_HANDLER( TAITO8741_2_r );
38DECLARE_READ8_HANDLER( TAITO8741_3_r );
39110
40111/****************************************************************************
41112  joshi Volleyball set.
42113****************************************************************************/
43114
44void josvolly_8741_reset(void);
45DECLARE_WRITE8_HANDLER( josvolly_8741_0_w );
46DECLARE_WRITE8_HANDLER( josvolly_8741_1_w );
47DECLARE_READ8_HANDLER( josvolly_8741_0_r );
48DECLARE_READ8_HANDLER( josvolly_8741_1_r );
49DECLARE_WRITE8_HANDLER( josvolly_nmi_enable_w );
115#define MCFG_JOSVOLLY8741_ADD(_tag) \
116   MCFG_DEVICE_ADD(_tag, JOSVOLLY8741_4PACK, 0)
50117
118#define MCFG_JOSVOLLY8741_PORT_HANDLERS(_devcb0, _devcb1, _devcb2, _devcb3) \
119   devcb = &josvolly8741_4pack_device::set_port_handler_0_callback(*device, DEVCB2_##_devcb0); \
120   devcb = &josvolly8741_4pack_device::set_port_handler_1_callback(*device, DEVCB2_##_devcb1); \
121    devcb = &josvolly8741_4pack_device::set_port_handler_2_callback(*device, DEVCB2_##_devcb2); \
122   devcb = &josvolly8741_4pack_device::set_port_handler_3_callback(*device, DEVCB2_##_devcb3);
123
124#define MCFG_JOSVOLLY8741_CONNECT(_con0, _con1, _con2, _con3) \
125   josvolly8741_4pack_device::static_set_connect(*device, 0, _con0);   \
126   josvolly8741_4pack_device::static_set_connect(*device, 1, _con1);   \
127   josvolly8741_4pack_device::static_set_connect(*device, 2, _con2);   \
128   josvolly8741_4pack_device::static_set_connect(*device, 3, _con3);
129
130   
131class josvolly8741_4pack_device : public device_t
132{
133   struct JV8741  {
134      UINT8 cmd;
135      UINT8 sts;
136      UINT8 txd;
137      UINT8 outport;
138      UINT8 rxd;
139      UINT8 connect;
140      UINT8 rst;
141   };
142
143public:
144   josvolly8741_4pack_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
145   ~josvolly8741_4pack_device() {}
146
147   template<class _Object> static devcb2_base &set_port_handler_0_callback(device_t &device, _Object object) { return downcast<josvolly8741_4pack_device &>(device).m_port_handler_0_r.set_callback(object); }
148   template<class _Object> static devcb2_base &set_port_handler_1_callback(device_t &device, _Object object) { return downcast<josvolly8741_4pack_device &>(device).m_port_handler_1_r.set_callback(object); }
149   template<class _Object> static devcb2_base &set_port_handler_2_callback(device_t &device, _Object object) { return downcast<josvolly8741_4pack_device &>(device).m_port_handler_2_r.set_callback(object); }
150   template<class _Object> static devcb2_base &set_port_handler_3_callback(device_t &device, _Object object) { return downcast<josvolly8741_4pack_device &>(device).m_port_handler_3_r.set_callback(object); }
151     
152   static void static_set_connect(device_t &device, int num, int conn) { downcast<josvolly8741_4pack_device &>(device).m_i8741[num].connect = conn; }
153     
154   DECLARE_READ8_MEMBER( read_0 ) { return read(0,offset); }
155   DECLARE_WRITE8_MEMBER( write_0 ) { write(0,offset,data); }
156   DECLARE_READ8_MEMBER( read_1 ) { return read(1,offset); }
157   DECLARE_WRITE8_MEMBER( write_1 ) { write(1,offset,data); }
158   
159   DECLARE_WRITE8_HANDLER( nmi_enable_w ) { m_nmi_enable = 1; }
160
161   TIMER_CALLBACK_MEMBER( tx );
162protected:
163   // device-level overrides
164   virtual void device_start();
165   virtual void device_reset();
166
167private:
168   void update(int num);
169   void write(int num, int offset, int data);
170   UINT8 read(int num,int offset);
171   UINT8 port_read(int num);
172
173   // internal state
174   JV8741 m_i8741[4];
175   int m_nmi_enable;
176   
177   devcb2_read8 m_port_handler_0_r;
178   devcb2_read8 m_port_handler_1_r;
179   devcb2_read8 m_port_handler_2_r;
180   devcb2_read8 m_port_handler_3_r;
181};
182
183
184extern const device_type JOSVOLLY8741_4PACK;
185
186
51187#endif
shelves/new_menus/src/mame/machine/cd32.c
r29302r29303
2828const device_type AKIKO = &device_creator<akiko_device>;
2929
3030akiko_device::akiko_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
31   : device_t(mconfig, AKIKO, "Akiko", tag, owner, clock, "akiko", __FILE__),
31   : device_t(mconfig, AKIKO, "CBM AKIKO", tag, owner, clock, "akiko", __FILE__),
3232   m_c2p_input_index(0),
3333   m_c2p_output_index(0),
3434   m_i2c_scl_out(0),
shelves/new_menus/src/mame/includes/gsword.h
r29302r29303
4444   DECLARE_WRITE8_MEMBER(gsword_AY8910_control_port_1_w);
4545   DECLARE_READ8_MEMBER(gsword_fake_0_r);
4646   DECLARE_READ8_MEMBER(gsword_fake_1_r);
47   DECLARE_READ8_MEMBER( gsword_8741_2_r );
48   DECLARE_READ8_MEMBER( gsword_8741_3_r );
4749   DECLARE_WRITE8_MEMBER(gsword_adpcm_data_w);
4850   DECLARE_DRIVER_INIT(gsword);
49   DECLARE_DRIVER_INIT(gsword2);
51   DECLARE_DRIVER_INIT(gsword2);   
5052   TILE_GET_INFO_MEMBER(get_bg_tile_info);
5153   virtual void video_start();
5254   DECLARE_MACHINE_RESET(gsword);
shelves/new_menus/src/mame/includes/gladiatr.h
r29302r29303
3939   int m_fg_tile_bank;
4040   int m_bg_tile_bank;
4141
42   
43   DECLARE_READ8_MEMBER( gladiator_dsw1_r );
44   DECLARE_READ8_MEMBER( gladiator_dsw2_r );
45   DECLARE_READ8_MEMBER( gladiator_controls_r );
46   DECLARE_READ8_MEMBER( gladiator_button3_r );
4247   DECLARE_WRITE8_MEMBER(gladiatr_videoram_w);
4348   DECLARE_WRITE8_MEMBER(gladiatr_colorram_w);
4449   DECLARE_WRITE8_MEMBER(gladiatr_textram_w);
r29302r29303
6570   DECLARE_WRITE8_MEMBER(glad_adpcm_w);
6671   DECLARE_READ8_MEMBER(f1_r);
6772   DECLARE_DRIVER_INIT(gladiatr);
68   DECLARE_DRIVER_INIT(ppking);
73   DECLARE_DRIVER_INIT(ppking);   
6974   TILE_GET_INFO_MEMBER(bg_get_tile_info);
7075   TILE_GET_INFO_MEMBER(fg_get_tile_info);
7176   DECLARE_MACHINE_RESET(ppking);
shelves/new_menus/src/mame/includes/kopunch.h
r29302r29303
11/*************************************************************************
22
3  KO Punch
3  Sega KO Punch
44
55*************************************************************************/
66
r29302r29303
99public:
1010   kopunch_state(const machine_config &mconfig, device_type type, const char *tag)
1111      : driver_device(mconfig, type, tag),
12      m_videoram(*this, "videoram"),
13      m_videoram2(*this, "videoram2"),
1412      m_maincpu(*this, "maincpu"),
15      m_gfxdecode(*this, "gfxdecode") { }
13      m_gfxdecode(*this, "gfxdecode"),
14      m_vram_fg(*this, "vram_fg"),
15      m_vram_bg(*this, "vram_bg")
16   { }
1617
18   /* devices */
19   required_device<cpu_device> m_maincpu;
20   required_device<gfxdecode_device> m_gfxdecode;
21
1722   /* memory pointers */
18   required_shared_ptr<UINT8> m_videoram;
19   required_shared_ptr<UINT8> m_videoram2;
20   UINT8 *    m_colorram;
21   UINT8 *    m_spriteram;
22   size_t     m_spriteram_size;
23   required_shared_ptr<UINT8> m_vram_fg;
24   required_shared_ptr<UINT8> m_vram_bg;
2325
2426   /* video-related */
25   tilemap_t    *m_bg_tilemap;
26   tilemap_t    *m_fg_tilemap;
27   int        m_gfxbank;
27   tilemap_t *m_bg_tilemap;
28   tilemap_t *m_fg_tilemap;
29   UINT8 m_gfxbank;
30   UINT8 m_scrollx;
2831
29   /* devices */
30   required_device<cpu_device> m_maincpu;
31   required_device<gfxdecode_device> m_gfxdecode;
32   
3332   DECLARE_READ8_MEMBER(kopunch_in_r);
3433   DECLARE_WRITE8_MEMBER(kopunch_lamp_w);
3534   DECLARE_WRITE8_MEMBER(kopunch_coin_w);
36   DECLARE_WRITE8_MEMBER(kopunch_videoram_w);
37   DECLARE_WRITE8_MEMBER(kopunch_videoram2_w);
35   DECLARE_WRITE8_MEMBER(kopunch_fg_w);
36   DECLARE_WRITE8_MEMBER(kopunch_bg_w);
3837   DECLARE_WRITE8_MEMBER(kopunch_scroll_x_w);
3938   DECLARE_WRITE8_MEMBER(kopunch_scroll_y_w);
4039   DECLARE_WRITE8_MEMBER(kopunch_gfxbank_w);
40
4141   DECLARE_INPUT_CHANGED_MEMBER(left_coin_inserted);
4242   DECLARE_INPUT_CHANGED_MEMBER(right_coin_inserted);
43
4344   TILE_GET_INFO_MEMBER(get_fg_tile_info);
4445   TILE_GET_INFO_MEMBER(get_bg_tile_info);
46   DECLARE_PALETTE_INIT(kopunch);
47   UINT32 screen_update_kopunch(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
48
4549   virtual void machine_start();
46   virtual void machine_reset();
4750   virtual void video_start();
48   DECLARE_PALETTE_INIT(kopunch);
49   UINT32 screen_update_kopunch(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
51
5052   INTERRUPT_GEN_MEMBER(kopunch_interrupt);
5153};
shelves/new_menus/src/mame/video/kopunch.c
r29302r29303
1/*************************************************************************
2
3  Sega KO Punch
4
5  Functions to emulate the video hardware of the machine.
6
7*************************************************************************/
8
19#include "emu.h"
210#include "includes/kopunch.h"
311
r29302r29303
513PALETTE_INIT_MEMBER(kopunch_state, kopunch)
614{
715   const UINT8 *color_prom = memregion("proms")->base();
8   int i;
916
10   color_prom += 24;   /* first 24 colors are black */
11   for (i = 0; i < palette.entries(); i++)
17   color_prom += 24; // first 24 colors are black
18
19   for (int i = 0; i < palette.entries(); i++)
1220   {
1321      int bit0, bit1, bit2, r, g, b;
1422
r29302r29303
3341   }
3442}
3543
36WRITE8_MEMBER(kopunch_state::kopunch_videoram_w)
44WRITE8_MEMBER(kopunch_state::kopunch_fg_w)
3745{
38   m_videoram[offset] = data;
46   m_vram_fg[offset] = data;
3947   m_fg_tilemap->mark_tile_dirty(offset);
4048}
4149
42WRITE8_MEMBER(kopunch_state::kopunch_videoram2_w)
50WRITE8_MEMBER(kopunch_state::kopunch_bg_w)
4351{
44   m_videoram2[offset] = data;
52   m_vram_bg[offset] = data;
4553   m_bg_tilemap->mark_tile_dirty(offset);
4654}
4755
4856WRITE8_MEMBER(kopunch_state::kopunch_scroll_x_w)
4957{
58   m_scrollx = data;
5059   m_bg_tilemap->set_scrollx(0, data);
5160}
5261
r29302r29303
5766
5867WRITE8_MEMBER(kopunch_state::kopunch_gfxbank_w)
5968{
69   // d0-d2: bg gfx bank
6070   if (m_gfxbank != (data & 0x07))
6171   {
6272      m_gfxbank = data & 0x07;
6373      m_bg_tilemap->mark_all_dirty();
6474   }
6575
76   // d3: flip y, other bits: unused
6677   m_bg_tilemap->set_flip((data & 0x08) ? TILEMAP_FLIPY : 0);
6778}
6879
6980TILE_GET_INFO_MEMBER(kopunch_state::get_fg_tile_info)
7081{
71   int code = m_videoram[tile_index];
82   int code = m_vram_fg[tile_index];
7283
7384   SET_TILE_INFO_MEMBER(0, code, 0, 0);
7485}
7586
7687TILE_GET_INFO_MEMBER(kopunch_state::get_bg_tile_info)
7788{
78   int code = (m_videoram2[tile_index] & 0x7f) + 128 * m_gfxbank;
89   // note: highest bit is unused
90   int code = (m_vram_bg[tile_index] & 0x7f) | m_gfxbank << 7;
7991
8092   SET_TILE_INFO_MEMBER(1, code, 0, 0);
8193}
r29302r29303
8698   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(kopunch_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
8799
88100   m_fg_tilemap->set_transparent_pen(0);
89
90   m_bg_tilemap->set_scrolldx(16, 16);
91101}
92102
93103UINT32 kopunch_state::screen_update_kopunch(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
94104{
95   m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
105   bitmap.fill(0, cliprect);
106   
107   // background does not wrap around horizontally
108   rectangle bg_clip = cliprect;
109   bg_clip.max_x = m_scrollx ^ 0xff;
110
111   m_bg_tilemap->draw(screen, bitmap, bg_clip, 0, 0);
96112   m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
97113
98114   return 0;
shelves/new_menus/src/mame/video/ppu2c0x.c
r29302r29303
166166}
167167
168168// Playchoice 10
169ppu2c03b_device::ppu2c03b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : ppu2c0x_device(mconfig, PPU_2C03B, "2C03B PPU PPU", tag, owner, clock, "ppu2c03b", __FILE__)
169ppu2c03b_device::ppu2c03b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : ppu2c0x_device(mconfig, PPU_2C03B, "2C03B PPU", tag, owner, clock, "ppu2c03b", __FILE__)
170170{
171171}
172172
shelves/new_menus/src/mame/drivers/tempest.c
r29302r29303
595595   /* basic machine hardware */
596596   MCFG_CPU_ADD("maincpu", M6502, MASTER_CLOCK / 8)
597597   MCFG_CPU_PROGRAM_MAP(main_map)
598
599   /* needed to ensure routine at ae1c passes checks and does not corrupt data */
600   MCFG_QUANTUM_PERFECT_CPU("maincpu")
601
598602   MCFG_CPU_PERIODIC_INT_DRIVER(tempest_state, irq0_line_assert,  (double)MASTER_CLOCK / 4096 / 12)
599603   MCFG_WATCHDOG_TIME_INIT(attotime::from_hz(CLOCK_3KHZ / 256))
600604
shelves/new_menus/src/mame/drivers/gladiatr.c
r29302r29303
200200}
201201
202202
203static READ8_HANDLER( gladiator_dsw1_r )
203READ8_MEMBER(gladiatr_state::gladiator_dsw1_r )
204204{
205   int orig = space.machine().root_device().ioport("DSW1")->read()^0xff;
205   int orig = ioport("DSW1")->read()^0xff;
206206
207207   return BITSWAP8(orig, 0,1,2,3,4,5,6,7);
208208}
209209
210static READ8_HANDLER( gladiator_dsw2_r )
210READ8_MEMBER(gladiatr_state::gladiator_dsw2_r )
211211{
212   int orig = space.machine().root_device().ioport("DSW2")->read()^0xff;
212   int orig = ioport("DSW2")->read()^0xff;
213213
214214   return BITSWAP8(orig, 2,3,4,5,6,7,1,0);
215215}
216216
217static READ8_HANDLER( gladiator_controls_r )
217READ8_MEMBER(gladiatr_state::gladiator_controls_r )
218218{
219219   int coins = 0;
220220
221   if( space.machine().root_device().ioport("COINS")->read() & 0xc0 ) coins = 0x80;
221   if(ioport("COINS")->read() & 0xc0 ) coins = 0x80;
222222   switch(offset)
223223   {
224224   case 0x01: /* start button , coins */
225      return space.machine().root_device().ioport("IN0")->read() | coins;
225      return ioport("IN0")->read() | coins;
226226   case 0x02: /* Player 1 Controller , coins */
227      return space.machine().root_device().ioport("IN1")->read() | coins;
227      return ioport("IN1")->read() | coins;
228228   case 0x04: /* Player 2 Controller , coins */
229      return space.machine().root_device().ioport("IN2")->read() | coins;
229      return ioport("IN2")->read() | coins;
230230   }
231231   /* unknown */
232232   return 0;
233233}
234234
235static READ8_HANDLER( gladiator_button3_r )
235READ8_MEMBER(gladiatr_state::gladiator_button3_r )
236236{
237237   switch(offset)
238238   {
239239   case 0x01: /* button 3 */
240      return space.machine().root_device().ioport("IN3")->read();
240      return ioport("IN3")->read();
241241   }
242242   /* unknown */
243243   return 0;
244244}
245245
246static const struct TAITO8741interface gladiator_8741interface=
247{
248   4,         /* 4 chips */
249   {TAITO8741_MASTER,TAITO8741_SLAVE,TAITO8741_PORT,TAITO8741_PORT},/* program mode */
250   {1,0,0,0},  /* serial port connection */
251   {gladiator_dsw1_r,gladiator_dsw2_r,gladiator_button3_r,gladiator_controls_r}    /* port handler */
252};
253
254246MACHINE_RESET_MEMBER(gladiatr_state,gladiator)
255247{
256   TAITO8741_start(&gladiator_8741interface);
257248   /* 6809 bank memory set */
258249   {
259250      UINT8 *rom = memregion("audiocpu")->base() + 0x10000;
r29302r29303
437428   AM_RANGE(0xc002, 0xc002) AM_WRITE(gladiatr_bankswitch_w)
438429   AM_RANGE(0xc004, 0xc004) AM_WRITE(gladiatr_irq_patch_w) /* !!! patch to 2nd CPU IRQ !!! */
439430   AM_RANGE(0xc007, 0xc007) AM_WRITE(gladiatr_flipscreen_w)
440   AM_RANGE(0xc09e, 0xc09f) AM_READWRITE_LEGACY(TAITO8741_0_r, TAITO8741_0_w)
431   AM_RANGE(0xc09e, 0xc09f) AM_DEVREADWRITE("taito8741", taito8741_4pack_device, read_0, write_0)
441432   AM_RANGE(0xc0bf, 0xc0bf) AM_NOP // watchdog_reset_w doesn't work
442433ADDRESS_MAP_END
443434
444435static ADDRESS_MAP_START( gladiatr_cpu2_io, AS_IO, 8, gladiatr_state )
445436   ADDRESS_MAP_GLOBAL_MASK(0xff)
446437   AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write)
447   AM_RANGE(0x20, 0x21) AM_READWRITE_LEGACY(TAITO8741_1_r, TAITO8741_1_w)
438   AM_RANGE(0x20, 0x21) AM_DEVREADWRITE("taito8741", taito8741_4pack_device, read_1, write_1)
448439   AM_RANGE(0x40, 0x40) AM_NOP // WRITE(sub_irq_ack_w)
449   AM_RANGE(0x60, 0x61) AM_READWRITE_LEGACY(TAITO8741_2_r, TAITO8741_2_w)
450   AM_RANGE(0x80, 0x81) AM_READWRITE_LEGACY(TAITO8741_3_r, TAITO8741_3_w)
440   AM_RANGE(0x60, 0x61) AM_DEVREADWRITE("taito8741", taito8741_4pack_device, read_2, write_2)
441   AM_RANGE(0x80, 0x81) AM_DEVREADWRITE("taito8741", taito8741_4pack_device, read_3, write_3)
451442   AM_RANGE(0xa0, 0xa7) AM_NOP // filters on sound output
452443   AM_RANGE(0xe0, 0xe0) AM_WRITE(glad_cpu_sound_command_w)
453444ADDRESS_MAP_END
r29302r29303
716707   MCFG_MACHINE_RESET_OVERRIDE(gladiatr_state,gladiator)
717708   MCFG_NVRAM_ADD_0FILL("nvram")
718709
710   MCFG_TAITO8741_ADD("taito8741")
711   MCFG_TAITO8741_MODES(TAITO8741_MASTER,TAITO8741_SLAVE,TAITO8741_PORT,TAITO8741_PORT)
712   MCFG_TAITO8741_CONNECT(1,0,0,0)
713   MCFG_TAITO8741_PORT_HANDLERS(READ8(gladiatr_state,gladiator_dsw1_r),READ8(gladiatr_state,gladiator_dsw2_r),READ8(gladiatr_state,gladiator_button3_r),READ8(gladiatr_state,gladiator_controls_r))
714   
719715   /* video hardware */
720716   MCFG_SCREEN_ADD("screen", RASTER)
721717   MCFG_SCREEN_REFRESH_RATE(60)
shelves/new_menus/src/mame/drivers/gsword.c
r29302r29303
150150
151151
152152#if 0
153int ::gsword_coins_in(void)
153int gsword_state::gsword_coins_in(void)
154154{
155155   /* emulate 8741 coin slot */
156156   if (ioport("IN4")->read() & 0xc0)
r29302r29303
186186   return data;
187187}
188188
189static READ8_HANDLER( gsword_8741_2_r )
189READ8_MEMBER(gsword_state::gsword_8741_2_r )
190190{
191191   switch (offset)
192192   {
193193   case 0x01: /* start button , coins */
194      return space.machine().root_device().ioport("IN0")->read();
194      return ioport("IN0")->read();
195195   case 0x02: /* Player 1 Controller */
196      return space.machine().root_device().ioport("IN1")->read();
196      return ioport("IN1")->read();
197197   case 0x04: /* Player 2 Controller */
198      return space.machine().root_device().ioport("IN3")->read();
198      return ioport("IN3")->read();
199199//  default:
200200//      logerror("8741-2 unknown read %d PC=%04x\n",offset,space.device().safe_pc());
201201   }
r29302r29303
203203   return 0;
204204}
205205
206static READ8_HANDLER( gsword_8741_3_r )
206READ8_MEMBER(gsword_state::gsword_8741_3_r )
207207{
208208   switch (offset)
209209   {
210210   case 0x01: /* start button  */
211      return space.machine().root_device().ioport("IN2")->read();
211      return ioport("IN2")->read();
212212   case 0x02: /* Player 1 Controller? */
213      return space.machine().root_device().ioport("IN1")->read();
213      return ioport("IN1")->read();
214214   case 0x04: /* Player 2 Controller? */
215      return space.machine().root_device().ioport("IN3")->read();
215      return ioport("IN3")->read();
216216   }
217217   /* unknown */
218218//  logerror("8741-3 unknown read %d PC=%04x\n",offset,space.device().safe_pc());
219219   return 0;
220220}
221221
222static const struct TAITO8741interface gsword_8741interface=
223{
224   4,         /* 4 chips */
225   { TAITO8741_MASTER,TAITO8741_SLAVE,TAITO8741_PORT,TAITO8741_PORT },  /* program mode */
226   { 1,0,0,0 },                                 /* serial port connection */
227   { NULL,NULL,gsword_8741_2_r,gsword_8741_3_r },    /* port handler */
228   { "DSW2","DSW1",NULL,NULL }
229};
230
231222MACHINE_RESET_MEMBER(gsword_state,gsword)
232223{
233   int i;
234
235   for(i=0;i<4;i++) TAITO8741_reset(i);
236224   m_coins = 0;
237225
238226   /* snd CPU mask NMI during reset phase */
239227   m_nmi_enable   = 0;
240228   m_protect_hack = 0;
241
242   TAITO8741_start(&gsword_8741interface);
243229}
244230
245231MACHINE_RESET_MEMBER(gsword_state,josvolly)
246232{
247   josvolly_8741_reset();
248233}
249234
250235INTERRUPT_GEN_MEMBER(gsword_state::gsword_snd_interrupt)
r29302r29303
339324
340325static ADDRESS_MAP_START( cpu1_io_map, AS_IO, 8, gsword_state )
341326   ADDRESS_MAP_GLOBAL_MASK(0xff)
342   AM_RANGE(0x7e, 0x7f) AM_WRITE_LEGACY(TAITO8741_0_w) AM_READ_LEGACY(TAITO8741_0_r)
327   AM_RANGE(0x7e, 0x7f) AM_DEVREADWRITE("taito8741", taito8741_4pack_device, read_0, write_0)
343328ADDRESS_MAP_END
344329
345330static ADDRESS_MAP_START( josvolly_cpu1_io_map, AS_IO, 8, gsword_state )
346331   ADDRESS_MAP_GLOBAL_MASK(0xff)
347   AM_RANGE(0x7e, 0x7f) AM_WRITE_LEGACY(josvolly_8741_0_w) AM_READ_LEGACY(josvolly_8741_0_r)
332   AM_RANGE(0x7e, 0x7f) AM_DEVREADWRITE("josvolly_8741", josvolly8741_4pack_device, read_0, write_0)
348333ADDRESS_MAP_END
349334
350335//
r29302r29303
356341
357342static ADDRESS_MAP_START( cpu2_io_map, AS_IO, 8, gsword_state )
358343   ADDRESS_MAP_GLOBAL_MASK(0xff)
359   AM_RANGE(0x00, 0x01) AM_READWRITE_LEGACY(TAITO8741_2_r,TAITO8741_2_w)
360   AM_RANGE(0x20, 0x21) AM_READWRITE_LEGACY(TAITO8741_3_r,TAITO8741_3_w)
361   AM_RANGE(0x40, 0x41) AM_READWRITE_LEGACY(TAITO8741_1_r,TAITO8741_1_w)
344   AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("taito8741", taito8741_4pack_device, read_2, write_2)
345   AM_RANGE(0x20, 0x21) AM_DEVREADWRITE("taito8741", taito8741_4pack_device, read_3, write_3)
346   AM_RANGE(0x40, 0x41) AM_DEVREADWRITE("taito8741", taito8741_4pack_device, read_1, write_1)
362347   AM_RANGE(0x60, 0x60) AM_READWRITE(gsword_fake_0_r, gsword_AY8910_control_port_0_w)
363348   AM_RANGE(0x61, 0x61) AM_DEVREADWRITE("ay1", ay8910_device, data_r, data_w)
364349   AM_RANGE(0x80, 0x80) AM_READWRITE(gsword_fake_1_r, gsword_AY8910_control_port_1_w)
r29302r29303
388373   AM_RANGE(0x8002, 0x8002) AM_READ_PORT("IN0")    // START
389374
390375//  AM_RANGE(0x6000, 0x6000) AM_WRITE(adpcm_soundcommand_w)
391   AM_RANGE(0xA000, 0xA001) AM_WRITE_LEGACY(josvolly_8741_1_w) AM_READ_LEGACY(josvolly_8741_1_r)
376   AM_RANGE(0xA000, 0xA001) AM_DEVREADWRITE("josvolly_8741", josvolly8741_4pack_device, read_1, write_1)
392377ADDRESS_MAP_END
393378
394379static ADDRESS_MAP_START( josvolly_cpu2_io_map, AS_IO, 8, gsword_state )
r29302r29303
398383   AM_RANGE(0x40, 0x40) AM_READWRITE(gsword_fake_1_r, gsword_AY8910_control_port_1_w)
399384   AM_RANGE(0x41, 0x41) AM_DEVREADWRITE("ay2", ay8910_device, data_r, data_w)
400385
401   AM_RANGE(0x81, 0x81) AM_WRITE_LEGACY(josvolly_nmi_enable_w)
386   AM_RANGE(0x81, 0x81) AM_DEVWRITE("josvolly_8741", josvolly8741_4pack_device, nmi_enable_w)
402387   AM_RANGE(0xC1, 0xC1) AM_NOP // irq clear
403388
404389ADDRESS_MAP_END
r29302r29303
666651
667652   MCFG_MACHINE_RESET_OVERRIDE(gsword_state,gsword)
668653
654   MCFG_TAITO8741_ADD("taito8741")
655   MCFG_TAITO8741_MODES(TAITO8741_MASTER,TAITO8741_SLAVE,TAITO8741_PORT,TAITO8741_PORT)
656   MCFG_TAITO8741_CONNECT(1,0,0,0)
657   MCFG_TAITO8741_PORT_HANDLERS(IOPORT("DSW2"),IOPORT("DSW1"),READ8(gsword_state,gsword_8741_2_r),READ8(gsword_state,gsword_8741_3_r))
669658#if 1
670659   /* to MCU timeout champbbj */
671660   MCFG_QUANTUM_TIME(attotime::from_hz(6000))
r29302r29303
714703   MCFG_CPU_VBLANK_INT_DRIVER("screen", gsword_state,  irq0_line_hold)
715704
716705   MCFG_MACHINE_RESET_OVERRIDE(gsword_state,josvolly)
706   
707   MCFG_JOSVOLLY8741_ADD("josvolly_8741")
708   MCFG_JOSVOLLY8741_CONNECT(1,0,0,0)
709   MCFG_JOSVOLLY8741_PORT_HANDLERS(IOPORT("DSW1"),IOPORT("DSW2"),IOPORT("DSW1"),IOPORT("DSW2"))
717710
711
718712   /* video hardware */
719713   MCFG_SCREEN_ADD("screen", RASTER)
720714   MCFG_SCREEN_REFRESH_RATE(60)
shelves/new_menus/src/mame/drivers/malzak.c
r29302r29303
316316   return m_videoram[offset];
317317}
318318
319static SAA5050_INTERFACE( malzac_saa5050_intf )
320{
321   DEVCB_DRIVER_MEMBER(malzak_state, videoram_r),
322   42, 24, 64  /* x, y, size */
323};
324
325319void malzak_state::machine_start()
326320{
327321   membank("bank1")->configure_entries(0, 2, memregion("user2")->base(), 0x400);
r29302r29303
366360   MCFG_S2636_ADD("s2636_1", malzac_s2636_1_config)
367361   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
368362
369   MCFG_SAA5050_ADD("saa5050", 6000000, malzac_saa5050_intf)
363   MCFG_DEVICE_ADD("saa5050", SAA5050, 6000000)
364   MCFG_SAA5050_D_CALLBACK(READ8(malzak_state, videoram_r))
365   MCFG_SAA5050_SCREEN_SIZE(42, 24, 64)
370366
371367   /* sound hardware */
372368   MCFG_SPEAKER_STANDARD_MONO("mono")
shelves/new_menus/src/mame/drivers/littlerb.c
r29302r29303
9999   DECLARE_WRITE16_MEMBER(littlerb_l_sound_w);
100100   DECLARE_WRITE16_MEMBER(littlerb_r_sound_w);
101101   UINT8 sound_data_shift();
102   
103   TIMER_DEVICE_CALLBACK_MEMBER(littlerb_scanline_sound);
104102
103   TIMER_DEVICE_CALLBACK_MEMBER(littlerb_sound_step_cb);
104   TIMER_DEVICE_CALLBACK_MEMBER(littlerb_sound_cb);
105
105106};
106107
107108
r29302r29303
229230   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
230231INPUT_PORTS_END
231232
232TIMER_DEVICE_CALLBACK_MEMBER(littlerb_state::littlerb_scanline_sound)
233
234TIMER_DEVICE_CALLBACK_MEMBER(littlerb_state::littlerb_sound_cb)
233235{
234   int scanline = param;
236   UINT8 res;
237   UINT8 *sample_rom = memregion("samples")->base();
235238
236   if((scanline % 2) == 0)
237   {
238      UINT8 res;
239      UINT8 *sample_rom = memregion("samples")->base();
239   res = sample_rom[m_sound_pointer_l|(m_sound_index_l<<10)|0x40000];
240   m_dacl->write_signed8(res);
241   res = sample_rom[m_sound_pointer_r|(m_sound_index_r<<10)|0x00000];
242   m_dacr->write_signed8(res);
243   m_sound_pointer_l++;
244   m_sound_pointer_l&=0x3ff;
245   m_sound_pointer_r++;
246   m_sound_pointer_r&=0x3ff;
247}
240248
241      res = sample_rom[m_sound_pointer_l|(m_sound_index_l<<10)|0x40000];
242      m_dacl->write_signed8(res);
243      res = sample_rom[m_sound_pointer_r|(m_sound_index_r<<10)|0x00000];
244      m_dacr->write_signed8(res);
245      m_sound_pointer_l++;
246      m_sound_pointer_l&=0x3ff;
247      m_sound_pointer_r++;
248      m_sound_pointer_r&=0x3ff;
249   }
250
251   if (scanline == 0) m_soundframe++;
252
253//   printf("scanline %d\n", scanline);
249TIMER_DEVICE_CALLBACK_MEMBER(littlerb_state::littlerb_sound_step_cb)
250{
251   m_soundframe++;
254252}
255253
256
257
258254static MACHINE_CONFIG_START( littlerb, littlerb_state )
259255   MCFG_CPU_ADD("maincpu", M68000, 12000000)
260256   MCFG_CPU_PROGRAM_MAP(littlerb_main)
r29302r29303
262258   MCFG_INDER_VIDEO_ADD("inder_vid")
263259
264260   // should probably be done with a timer rather than relying on screen(!)
265   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", littlerb_state, littlerb_scanline_sound, "inder_vid:inder_screen", 0, 1)
261   MCFG_TIMER_DRIVER_ADD_PERIODIC("step_timer", littlerb_state, littlerb_sound_step_cb,  attotime::from_hz(7500/150)) // TODO: not accurate
262   MCFG_TIMER_DRIVER_ADD_PERIODIC("sound_timer", littlerb_state, littlerb_sound_cb,  attotime::from_hz(7500)) // TODO: not accurate
266263
267264   MCFG_SPEAKER_STANDARD_STEREO("lspeaker","rspeaker")
268265
shelves/new_menus/src/mame/drivers/namcos23.c
r29302r29303
7676        raise: c0.Count   = 10c8e0
7777               c0.Compare = 10d880
7878
79   Downhill bikers irq ack on level 3:
80        check ad000000 & 0400
81          if not, a4c3ff04 = 0
82        check ad000000 & 0800
83          if not, read a682000a, wait until it stops changing (?)
84        return
7985
86
8087****************************************************************************
8188
8289Namco System 23 and Super System 23 Hardware Overview (last updated 7th April 2013 at 12.49am)
r29302r29303
25572564      // how does it work exactly? it's not understood in namcos22 either (also has a c361)
25582565      case 5:
25592566         update_main_interrupts(m_main_irqcause & ~MAIN_C361_IRQ);
2560         return m_screen->vpos()*2 | (m_screen->vblank() ? 1 : 0);
2567         return (m_screen->vpos()*2) | (m_screen->vblank() ? 1 : 0);
25612568      case 6:
25622569         update_main_interrupts(m_main_irqcause & ~MAIN_C361_IRQ);
25632570         return m_screen->vblank() ? 1 : 0;
r29302r29303
26132620   {
26142621      // 0100 set freezes gorgon (polygon fifo flag)
26152622      case 1:
2616         return 0x0000 | ioport("DSW")->read();
2623         return 0x0000 | ioport("DSW")->read() | ((m_main_irqcause & MAIN_C361_IRQ) ? 0x400 : 0);
26172624      case 2: case 3:
26182625      {
26192626         UINT16 res = m_ctl_inp_buffer[offset-2] & 0x800 ? 0xffff : 0x0000;
shelves/new_menus/src/mame/drivers/kopunch.c
r29302r29303
11/********************************************************
22
3    KO Punch (c) 1981 Sega
3  KO Punch (c) 1981 Sega
4 
5  XTAL: ?
6  CPU: 8085 (proof: it uses SIM opcode)
47
8  TODO:
9  - discrete sound?
10  - figure out sensors
11  - coins sometimes don't register
12
13
14*********************************************************
15 
16  This is a simple boxing bag game, but for visual feedback
17  it has a small CRT instead of LEDs or a dial.
18 
19  Insert coin, select your weightclass (7 buttons on cab), and punch.
20 
21  Heavyweight   - 300K
22  Middleweight  - 260K
23  Welterweight  - 230K
24  Lightweight   - 200K
25  Featherweight - 170K
26  Bantamweight  - 140K
27  Flyweight     - 100K
28
529********************************************************/
630
731#include "emu.h"
832#include "cpu/i8085/i8085.h"
933#include "includes/kopunch.h"
1034
35
1136INTERRUPT_GEN_MEMBER(kopunch_state::kopunch_interrupt)
1237{
1338   device.execute().set_input_line(I8085_RST75_LINE, ASSERT_LINE);
r29302r29303
2651WRITE8_MEMBER(kopunch_state::kopunch_lamp_w)
2752{
2853   set_led_status(machine(), 0, ~data & 0x80);
29
30//  if ((data & 0x7f) != 0x7f)
31//      popmessage("port 38 = %02x",data);
3254}
3355
3456WRITE8_MEMBER(kopunch_state::kopunch_coin_w)
r29302r29303
3658   coin_counter_w(machine(), 0, ~data & 0x80);
3759   coin_counter_w(machine(), 1, ~data & 0x40);
3860
39//  if ((data & 0x3f) != 0x3f)
40//      popmessage("port 34 = %02x",data);
61//  if ((data & 0x3f) != 0x3e)
62//      printf("port 34 = %02x   ",data);
4163}
4264
4365
r29302r29303
4567static ADDRESS_MAP_START( kopunch_map, AS_PROGRAM, 8, kopunch_state )
4668   AM_RANGE(0x0000, 0x1fff) AM_ROM
4769   AM_RANGE(0x2000, 0x23ff) AM_RAM
48   AM_RANGE(0x6000, 0x63ff) AM_RAM_WRITE(kopunch_videoram_w) AM_SHARE("videoram")
49   AM_RANGE(0x7000, 0x70ff) AM_RAM_WRITE(kopunch_videoram2_w) AM_SHARE("videoram2")
50   AM_RANGE(0x7100, 0x7aff) AM_RAM // ???
70   AM_RANGE(0x6000, 0x63ff) AM_RAM_WRITE(kopunch_fg_w) AM_SHARE("vram_fg")
71   AM_RANGE(0x7000, 0x70ff) AM_RAM_WRITE(kopunch_bg_w) AM_SHARE("vram_bg")
72   AM_RANGE(0x7100, 0x73ff) AM_RAM // unused vram
5173ADDRESS_MAP_END
5274
5375static ADDRESS_MAP_START( kopunch_io_map, AS_IO, 8, kopunch_state )
r29302r29303
7092
7193INPUT_CHANGED_MEMBER(kopunch_state::left_coin_inserted)
7294{
73   /* left coin insertion causes a rst6.5 (vector 0x34) */
95   // left coin insertion causes a rst6.5 (vector 0x34)
7496   if (newval)
7597      m_maincpu->set_input_line(I8085_RST65_LINE, HOLD_LINE);
7698}
7799
78100INPUT_CHANGED_MEMBER(kopunch_state::right_coin_inserted)
79101{
80   /* right coin insertion causes a rst5.5 (vector 0x2c) */
102   // right coin insertion causes a rst5.5 (vector 0x2c)
81103   if (newval)
82104      m_maincpu->set_input_line(I8085_RST55_LINE, HOLD_LINE);
83105}
84106
85107static INPUT_PORTS_START( kopunch )
86108   PORT_START("P1")
87   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
88   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
89   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
90   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
91   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
92   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
93   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
94   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 )
95
96   PORT_START("SYSTEM")
97   PORT_BIT( 0x07, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* punch strength (high 3 bits) */
98   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, kopunch_state,right_coin_inserted, 0)
109   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
110   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
111   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 )
112   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 )
99113   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 )
100114   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON6 )
101115   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON7 )
102   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, kopunch_state,left_coin_inserted, 0)
116   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // related to above startbuttons
103117
118   PORT_START("SYSTEM")
119   PORT_BIT( 0x07, IP_ACTIVE_HIGH, IPT_SPECIAL ) // punch strength (high 3 bits)
120   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED_MEMBER(DEVICE_SELF, kopunch_state, right_coin_inserted, 0)
121   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SPECIAL ) // sensor
122   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SPECIAL ) // sensor
123   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) // sensor
124   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, kopunch_state, left_coin_inserted, 0)
125
104126   PORT_START("DSW")
105127   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
106128   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
r29302r29303
128150   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
129151
130152   PORT_START("P2")
131   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
132   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
133   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
134   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
135   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
136   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
137   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL
153   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
154   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // ? these 3 are read at the same time: p2>>4, and 7, <<1, read from a table
155   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // "
156   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // "
138157   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )
139158INPUT_PORTS_END
140159
r29302r29303
162181};
163182
164183static GFXDECODE_START( kopunch )
165   GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 1 )
184   GFXDECODE_ENTRY( "gfx1", 0, charlayout,    0, 1 )
166185   GFXDECODE_ENTRY( "gfx2", 0, charlayoutbig, 0, 1 )
167186GFXDECODE_END
168187
169188
170189void kopunch_state::machine_start()
171190{
191   // zerofill
192   m_gfxbank = 0;
193   m_scrollx = 0;
194
195   // savestates
172196   save_item(NAME(m_gfxbank));
197   save_item(NAME(m_scrollx));
173198}
174199
175void kopunch_state::machine_reset()
176{
177   m_gfxbank = 0;
178}
179
180200static MACHINE_CONFIG_START( kopunch, kopunch_state )
181201
182202   /* basic machine hardware */
183   MCFG_CPU_ADD("maincpu", I8085A, 4000000)    /* 4 MHz ???? Uses SIM, must be 8085 */
203   MCFG_CPU_ADD("maincpu", I8085A, 4000000) // 4 MHz?
184204   MCFG_CPU_PROGRAM_MAP(kopunch_map)
185205   MCFG_CPU_IO_MAP(kopunch_io_map)
186206   MCFG_CPU_VBLANK_INT_DRIVER("screen", kopunch_state, kopunch_interrupt)
187207
188
189208   /* video hardware */
190209   MCFG_SCREEN_ADD("screen", RASTER)
191210   MCFG_SCREEN_REFRESH_RATE(60)
r29302r29303
215234   ROM_LOAD( "epr1106.x",    0x1000, 0x1000, CRC(25a5c68b) SHA1(9761418c6f3903f8aaceece658739fe5bf5c0803) )
216235
217236   ROM_REGION( 0x1800, "gfx1", 0 )
218   ROM_LOAD( "epr1102",      0x0000, 0x0800, CRC(8a52de96) SHA1(5abdaa83c6bfea81395cb190f5364b72811927ba) )
219   ROM_LOAD( "epr1103",      0x0800, 0x0800, CRC(bae5e054) SHA1(95373123ab64543cdffb7ee9e02d0613c5c494bf) )
220   ROM_LOAD( "epr1104",      0x1000, 0x0800, CRC(7b119a0e) SHA1(454f01355fa9512a7442990cc92da7bc7a8d6b68) )
237   ROM_LOAD( "epr1103",      0x0000, 0x0800, CRC(bae5e054) SHA1(95373123ab64543cdffb7ee9e02d0613c5c494bf) )
238   ROM_LOAD( "epr1104",      0x0800, 0x0800, CRC(7b119a0e) SHA1(454f01355fa9512a7442990cc92da7bc7a8d6b68) )
239   ROM_LOAD( "epr1102",      0x1000, 0x0800, CRC(8a52de96) SHA1(5abdaa83c6bfea81395cb190f5364b72811927ba) )
221240
222241   ROM_REGION( 0x6000, "gfx2", 0 )
223242   ROM_LOAD( "epr1107",      0x0000, 0x1000, CRC(ca00244d) SHA1(690931ea1bef9d80dcd7bd2ea2462b083c884a89) )
r29302r29303
228247   ROM_LOAD( "epr1111",      0x5000, 0x1000, CRC(28530ec9) SHA1(1a8782d37128cdb43133fc891cde93d2bdd5476b) )
229248
230249   ROM_REGION( 0x0060, "proms", 0 )
231   ROM_LOAD( "epr1101",      0x0000, 0x0020, CRC(15600f5d) SHA1(130179f79761cb16316c544e3c689bc10431db30) )    /* palette */
232   ROM_LOAD( "epr1099",      0x0020, 0x0020, CRC(fc58c456) SHA1(f27c3ad669dfdc33bcd7e0481fa01bf34973e816) )    /* unknown */
233   ROM_LOAD( "epr1100",      0x0040, 0x0020, CRC(bedb66b1) SHA1(8e78bb205d900075b761e1baa5f5813174ff28ba) )    /* unknown */
250   ROM_LOAD( "epr1101",      0x0000, 0x0020, CRC(15600f5d) SHA1(130179f79761cb16316c544e3c689bc10431db30) ) /* palette */
251   ROM_LOAD( "epr1099",      0x0020, 0x0020, CRC(fc58c456) SHA1(f27c3ad669dfdc33bcd7e0481fa01bf34973e816) ) /* unknown */
252   ROM_LOAD( "epr1100",      0x0040, 0x0020, CRC(bedb66b1) SHA1(8e78bb205d900075b761e1baa5f5813174ff28ba) ) /* unknown */
234253ROM_END
235254
236GAME( 1981, kopunch, 0, kopunch, kopunch, driver_device, 0, ROT270, "Sega", "KO Punch", GAME_NO_SOUND | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
255GAME( 1981, kopunch, 0, kopunch, kopunch, driver_device, 0, ROT270, "Sega", "KO Punch", GAME_NO_SOUND | GAME_NOT_WORKING | GAME_MECHANICAL | GAME_SUPPORTS_SAVE )
shelves/new_menus/src/emu/imagedev/chd_cd.c
r29302r29303
2525//-------------------------------------------------
2626
2727cdrom_image_device::cdrom_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
28   : device_t(mconfig, CDROM, "Cdrom", tag, owner, clock, "cdrom_image", __FILE__),
28   : device_t(mconfig, CDROM, "CD-ROM Image", tag, owner, clock, "cdrom_image", __FILE__),
2929      device_image_interface(mconfig, *this)
3030{
3131}
shelves/new_menus/src/emu/machine/74181.c
r29302r29303
2525//-------------------------------------------------
2626
2727ttl74181_device::ttl74181_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
28   device_t(mconfig, TTL74181, "TTL74181", tag, owner, clock, "ttl74181", __FILE__),
28   device_t(mconfig, TTL74181, "TTL 74181", tag, owner, clock, "ttl74181", __FILE__),
2929   m_a(0),
3030   m_b(0),
3131   m_s(0),
shelves/new_menus/src/emu/machine/ds1302.c
r29302r29303
7676//-------------------------------------------------
7777
7878ds1302_device::ds1302_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
79   : device_t(mconfig, DS1302, "Dallas DS1302", tag, owner, clock, "ds1302", __FILE__),
79   : device_t(mconfig, DS1302, "DS1302", tag, owner, clock, "ds1302", __FILE__),
8080      device_rtc_interface(mconfig, *this),
8181      device_nvram_interface(mconfig, *this)
8282{
shelves/new_menus/src/emu/machine/74123.c
r29302r29303
2727//-------------------------------------------------
2828
2929ttl74123_device::ttl74123_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
30   : device_t(mconfig, TTL74123, "TTL74123", tag, owner, clock, "ttl74123", __FILE__)
30   : device_t(mconfig, TTL74123, "TTL 74123", tag, owner, clock, "ttl74123", __FILE__)
3131{
3232}
3333
shelves/new_menus/src/emu/machine/74148.c
r29302r29303
4545const device_type TTL74148 = &device_creator<ttl74148_device>;
4646
4747ttl74148_device::ttl74148_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
48   : device_t(mconfig, TTL74148, "74148", tag, owner, clock, "74148", __FILE__),
48   : device_t(mconfig, TTL74148, "TTL 74148", tag, owner, clock, "74148", __FILE__),
4949   m_enable_input(0),
5050   m_output(0),
5151   m_output_valid(0),
shelves/new_menus/src/emu/machine/6532riot.c
r29302r29303
397397//-------------------------------------------------
398398
399399riot6532_device::riot6532_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
400   : device_t(mconfig, RIOT6532, "6532 (RIOT)", tag, owner, clock, "riot6532", __FILE__),
400   : device_t(mconfig, RIOT6532, "6532 RIOT", tag, owner, clock, "riot6532", __FILE__),
401401      m_irq(CLEAR_LINE)
402402{
403403}
shelves/new_menus/src/emu/machine/adc083x.c
r29302r29303
6767}
6868
6969adc0831_device::adc0831_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
70   : adc083x_device(mconfig, ADC0831, "A/D Converters 0831", tag, owner, clock, "adc0831", __FILE__)
70   : adc083x_device(mconfig, ADC0831, "ADC0831", tag, owner, clock, "adc0831", __FILE__)
7171{
7272   m_mux_bits = 0;
7373}
7474
7575adc0832_device::adc0832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
76   : adc083x_device(mconfig, ADC0832, "A/D Converters 0832", tag, owner, clock, "adc0832", __FILE__)
76   : adc083x_device(mconfig, ADC0832, "ADC0832", tag, owner, clock, "adc0832", __FILE__)
7777{
7878   m_mux_bits = 2;
7979}
8080
8181adc0834_device::adc0834_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
82   : adc083x_device(mconfig, ADC0834, "A/D Converters 0834", tag, owner, clock, "adc0834", __FILE__)
82   : adc083x_device(mconfig, ADC0834, "ADC0834", tag, owner, clock, "adc0834", __FILE__)
8383{
8484   m_mux_bits = 3;
8585}
8686
8787adc0838_device::adc0838_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
88   : adc083x_device(mconfig, ADC0838, "A/D Converters 0838", tag, owner, clock, "adc0838", __FILE__)
88   : adc083x_device(mconfig, ADC0838, "ADC0838", tag, owner, clock, "adc0838", __FILE__)
8989{
9090   m_mux_bits = 4;
9191}
shelves/new_menus/src/emu/machine/74153.c
r29302r29303
4040const device_type TTL74153 = &device_creator<ttl74153_device>;
4141
4242ttl74153_device::ttl74153_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
43   : device_t(mconfig, TTL74153, "74153", tag, owner, clock, "74153", __FILE__),
43   : device_t(mconfig, TTL74153, "TTL 74153", tag, owner, clock, "74153", __FILE__),
4444   m_a(0),
4545   m_b(0)
4646{
shelves/new_menus/src/emu/machine/aakart.c
r29302r29303
3838//-------------------------------------------------
3939
4040aakart_device::aakart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
41   : device_t(mconfig, AAKART, "aakart", tag, owner, clock, "aakart", __FILE__)
41   : device_t(mconfig, AAKART, "AAKART", tag, owner, clock, "aakart", __FILE__)
4242{
4343}
4444
shelves/new_menus/src/emu/machine/adc1038.c
r29302r29303
1414const device_type ADC1038 = &device_creator<adc1038_device>;
1515
1616adc1038_device::adc1038_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
17   : device_t(mconfig, ADC1038, "A/D Converters 1038", tag, owner, clock, "adc1038", __FILE__)
17   : device_t(mconfig, ADC1038, "ADC1038", tag, owner, clock, "adc1038", __FILE__)
1818{
1919}
2020
shelves/new_menus/src/emu/machine/adc1213x.c
r29302r29303
3535const device_type ADC12130 = &device_creator<adc12130_device>;
3636
3737adc12130_device::adc12130_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
38   : adc12138_device(mconfig, ADC12130, "A/D Converter 12130", tag, owner, clock, "adc12130", __FILE__)
38   : adc12138_device(mconfig, ADC12130, "ADC12130", tag, owner, clock, "adc12130", __FILE__)
3939{
4040}
4141
r29302r29303
4343const device_type ADC12132 = &device_creator<adc12132_device>;
4444
4545adc12132_device::adc12132_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
46   : adc12138_device(mconfig, ADC12132, "A/D Converter 12132", tag, owner, clock, "adc12132", __FILE__)
46   : adc12138_device(mconfig, ADC12132, "ADC12132", tag, owner, clock, "adc12132", __FILE__)
4747{
4848}
4949
r29302r29303
5151const device_type ADC12138 = &device_creator<adc12138_device>;
5252
5353adc12138_device::adc12138_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
54   : device_t(mconfig, ADC12138, "A/D Converter 12138", tag, owner, clock, "adc12138", __FILE__)
54   : device_t(mconfig, ADC12138, "ADC12138", tag, owner, clock, "adc12138", __FILE__)
5555{
5656}
5757adc12138_device::adc12138_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
shelves/new_menus/src/emu/video/saa5050.c
r29302r29303
2929//**************************************************************************
3030
3131const device_type SAA5050 = &device_creator<saa5050_device>;
32const device_type SAA5051 = &device_creator<saa5051_device>;
3233const device_type SAA5052 = &device_creator<saa5052_device>;
34const device_type SAA5053 = &device_creator<saa5053_device>;
35const device_type SAA5054 = &device_creator<saa5054_device>;
36const device_type SAA5055 = &device_creator<saa5055_device>;
37const device_type SAA5056 = &device_creator<saa5056_device>;
38const device_type SAA5057 = &device_creator<saa5057_device>;
3339
3440
3541//-------------------------------------------------
r29302r29303
3743//-------------------------------------------------
3844
3945ROM_START( saa5050 )
40   ROM_REGION( 0x10000, "chargen", 0 )
46   ROM_REGION( 0xa00, "chargen", 0 )
4147   ROM_LOAD( "saa5050", 0x0140, 0x08c0, BAD_DUMP CRC(78c17e3e) SHA1(4e1c59dc484505de1dc0b1ba7e5f70a54b0d4ccc) )
4248ROM_END
4349
4450
4551//-------------------------------------------------
52//  ROM( saa5051 )
53//-------------------------------------------------
54
55ROM_START( saa5051 )
56   ROM_REGION( 0xa00, "chargen", 0 )
57   ROM_LOAD( "saa5051", 0x0140, 0x08c0, NO_DUMP )
58ROM_END
59
60
61//-------------------------------------------------
4662//  ROM( saa5052 )
4763//-------------------------------------------------
4864
4965ROM_START( saa5052 )
50   ROM_REGION( 0x10000, "chargen", 0 )
66   ROM_REGION( 0xa00, "chargen", 0 )
5167   ROM_LOAD( "saa5052", 0x0140, 0x08c0, BAD_DUMP CRC(cda3bf79) SHA1(cf5ea94459c09001d422dadc212bc970b4b4aa20) )
5268ROM_END
5369
5470
5571//-------------------------------------------------
72//  ROM( saa5053 )
73//-------------------------------------------------
74
75ROM_START( saa5053 )
76   ROM_REGION( 0xa00, "chargen", 0 )
77   ROM_LOAD( "saa5053", 0x0140, 0x08c0, NO_DUMP )
78ROM_END
79
80
81//-------------------------------------------------
82//  ROM( saa5054 )
83//-------------------------------------------------
84
85ROM_START( saa5054 )
86   ROM_REGION( 0xa00, "chargen", 0 )
87   ROM_LOAD( "saa5054", 0x0140, 0x08c0, NO_DUMP )
88ROM_END
89
90
91//-------------------------------------------------
92//  ROM( saa5055 )
93//-------------------------------------------------
94
95ROM_START( saa5055 )
96   ROM_REGION( 0xa00, "chargen", 0 )
97   ROM_LOAD( "saa5055", 0x0140, 0x08c0, NO_DUMP )
98ROM_END
99
100
101//-------------------------------------------------
102//  ROM( saa5056 )
103//-------------------------------------------------
104
105ROM_START( saa5056 )
106   ROM_REGION( 0xa00, "chargen", 0 )
107   ROM_LOAD( "saa5056", 0x0140, 0x08c0, NO_DUMP )
108ROM_END
109
110
111//-------------------------------------------------
112//  ROM( saa5057 )
113//-------------------------------------------------
114
115ROM_START( saa5057 )
116   ROM_REGION( 0xa00, "chargen", 0 )
117   ROM_LOAD( "saa5057", 0x0140, 0x08c0, NO_DUMP )
118ROM_END
119
120
121//-------------------------------------------------
56122//  rom_region - device-specific ROM region
57123//-------------------------------------------------
58124
59125const rom_entry *saa5050_device::device_rom_region() const
60126{
61   switch (m_variant)
62   {
63      default:        return ROM_NAME( saa5050 );
64      case TYPE_5052: return ROM_NAME( saa5052 );
65   }
127   return ROM_NAME( saa5050 );
66128}
67129
130const rom_entry *saa5051_device::device_rom_region() const
131{
132   return ROM_NAME( saa5051 );
133}
68134
135const rom_entry *saa5052_device::device_rom_region() const
136{
137   return ROM_NAME( saa5052 );
138}
69139
70//**************************************************************************
71//  MACROS / CONSTANTS
72//**************************************************************************
140const rom_entry *saa5053_device::device_rom_region() const
141{
142   return ROM_NAME( saa5053 );
143}
73144
74enum
145const rom_entry *saa5054_device::device_rom_region() const
75146{
76   NUL = 0,
77   ALPHA_RED,
78   ALPHA_GREEN,
79   ALPHA_YELLOW,
80   ALPHA_BLUE,
81   ALPHA_MAGENTA,
82   ALPHA_CYAN,
83   ALPHA_WHITE,
84   FLASH,
85   STEADY,
86   END_BOX,
87   START_BOX,
88   NORMAL_HEIGHT,
89   DOUBLE_HEIGHT,
90   S0,
91   S1,
92   DLE,
93   GRAPHICS_RED,
94   GRAPHICS_GREEN,
95   GRAPHICS_YELLOW,
96   GRAPHICS_BLUE,
97   GRAPHICS_MAGENTA,
98   GRAPHICS_CYAN,
99   GRAPHICS_WHITE,
100   CONCEAL_DISPLAY,
101   CONTIGUOUS_GFX,
102   SEPARATED_GFX,
103   ESC,
104   BLACK_BACKGROUND,
105   NEW_BACKGROUND,
106   HOLD_GRAPHICS,
107   RELEASE_GRAPHICS
108};
147   return ROM_NAME( saa5054 );
148}
109149
150const rom_entry *saa5055_device::device_rom_region() const
151{
152   return ROM_NAME( saa5055 );
153}
110154
111static const rgb_t PALETTE_SAA5050[] =
155const rom_entry *saa5056_device::device_rom_region() const
112156{
113   rgb_t::black,
114   rgb_t(0xff, 0x00, 0x00),
115   rgb_t(0x00, 0xff, 0x00),
116   rgb_t(0xff, 0xff, 0x00),
117   rgb_t(0x00, 0x00, 0xff),
118   rgb_t(0xff, 0x00, 0xff),
119   rgb_t(0x00, 0xff, 0xff),
120   rgb_t::white
121};
157   return ROM_NAME( saa5056 );
158}
122159
160const rom_entry *saa5057_device::device_rom_region() const
161{
162   return ROM_NAME( saa5057 );
163}
123164
124165
166
125167//**************************************************************************
126168//  LIVE DEVICE
127169//**************************************************************************
r29302r29303
130172//  saa5050_device - constructor
131173//-------------------------------------------------
132174
133saa5050_device::saa5050_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source)
134   : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
135      m_frame_count(0),
136      m_variant(variant)
175saa5050_device::saa5050_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
176   device_t(mconfig, type, name, tag, owner, clock, shortname, source),
177   m_char_rom(*this, "chargen"),
178   m_read_d(*this),
179   m_frame_count(0),
180   m_cols(0),
181   m_rows(0),
182   m_size(0)
137183{
138184}
139185
140saa5050_device::saa5050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
141   : device_t(mconfig, SAA5050, "SAA5050", tag, owner, clock, "saa5050", __FILE__),
142      m_frame_count(0),
143      m_variant(TYPE_5050)
186saa5050_device::saa5050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
187   device_t(mconfig, SAA5050, "SAA5050", tag, owner, clock, "saa5050", __FILE__),
188   m_char_rom(*this, "chargen"),
189   m_read_d(*this),
190   m_frame_count(0),
191   m_cols(0),
192   m_rows(0),
193   m_size(0)
144194{
145195}
146196
197saa5051_device::saa5051_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
198   : saa5050_device(mconfig, SAA5051, "SAA5051", tag, owner, clock, "saa5051", __FILE__) { }
199
147200saa5052_device::saa5052_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
148   : saa5050_device(mconfig, SAA5052, "SAA5052", tag, owner, clock, TYPE_5052, "saa5052", __FILE__)
149{
150}
201   : saa5050_device(mconfig, SAA5052, "SAA5052", tag, owner, clock, "saa5052", __FILE__) { }
151202
203saa5053_device::saa5053_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
204   : saa5050_device(mconfig, SAA5053, "SAA5053", tag, owner, clock, "saa5053", __FILE__) { }
152205
153//-------------------------------------------------
154//  device_config_complete - perform any
155//  operations now that the configuration is
156//  complete
157//-------------------------------------------------
206saa5054_device::saa5054_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
207   : saa5050_device(mconfig, SAA5054, "SAA5054", tag, owner, clock, "saa5054", __FILE__) { }
158208
159void saa5050_device::device_config_complete()
160{
161   // inherit a copy of the static code
162   const saa5050_interface *intf = reinterpret_cast<const saa5050_interface *>(static_config());
163   if (intf != NULL)
164      *static_cast<saa5050_interface *>(this) = *intf;
209saa5055_device::saa5055_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
210   : saa5050_device(mconfig, SAA5055, "SAA5055", tag, owner, clock, "saa5055", __FILE__) { }
165211
166   // or initialize to defaults if none provided
167   else
168   {
169      memset(&m_in_d_cb, 0, sizeof(m_in_d_cb));
170   }
171}
212saa5056_device::saa5056_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
213   : saa5050_device(mconfig, SAA5056, "SAA5056", tag, owner, clock, "saa5056", __FILE__) { }
172214
215saa5057_device::saa5057_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
216   : saa5050_device(mconfig, SAA5057, "SAA5057", tag, owner, clock, "saa5057", __FILE__) { }
173217
218
219
174220//-------------------------------------------------
175221//  device_start - device-specific startup
176222//-------------------------------------------------
r29302r29303
178224void saa5050_device::device_start()
179225{
180226   // resolve callbacks
181   m_in_d_func.resolve(m_in_d_cb, *this);
227   m_read_d.resolve_safe(0);
182228
183   // find memory regions
184   m_char_rom = memregion("chargen")->base();
185
186229   // register for state saving
187230   save_item(NAME(m_code));
188231   save_item(NAME(m_last_code));
r29302r29303
202245   save_item(NAME(m_double_height_bottom_row));
203246   save_item(NAME(m_hold));
204247   save_item(NAME(m_frame_count));
205   save_item(NAME(m_variant));
206248}
207249
208250
r29302r29303
330372   if (m_double_height && m_double_height_bottom_row) ra += 5;
331373
332374   offs_t char_rom_addr = (data * 10) + ra;
333   m_char_data = m_char_rom[char_rom_addr];
375   m_char_data = m_char_rom->base()[char_rom_addr];
334376}
335377
336378
r29302r29303
455497
456498      for (int sx = 0; sx < m_cols; sx++)
457499      {
458         UINT8 code = m_in_d_func(video_ram_addr++);
500         UINT8 code = m_read_d(video_ram_addr++);
459501
460502         write(code & 0x7f);
461503
shelves/new_menus/src/emu/video/saa5050.h
r29302r29303
3939//  INTERFACE CONFIGURATION MACROS
4040//**************************************************************************
4141
42#define MCFG_SAA5050_ADD(_tag, _clock, _config) \
43   MCFG_DEVICE_ADD(_tag, SAA5050, _clock) \
44   MCFG_DEVICE_CONFIG(_config)
42#define MCFG_SAA5050_D_CALLBACK(_read) \
43   devcb = &saa5050_device::set_d_rd_callback(*device, DEVCB2_##_read);
4544
46#define MCFG_SAA5052_ADD(_tag, _clock, _config) \
47   MCFG_DEVICE_ADD(_tag, SAA5052, _clock) \
48   MCFG_DEVICE_CONFIG(_config)
4945
46#define MCFG_SAA5050_SCREEN_SIZE(_cols, _rows, _size) \
47   saa5050_device::static_set_screen_size(*device, _cols, _rows, _size);
5048
51#define SAA5050_INTERFACE(name) \
52   const saa5050_interface (name) =
5349
5450
55
5651//**************************************************************************
5752//  TYPE DEFINITIONS
5853//**************************************************************************
5954
60// ======================> saa5050_interface
61
62struct saa5050_interface
63{
64   devcb_read8 m_in_d_cb;
65
66   int m_cols;
67   int m_rows;
68   int m_size;
69};
70
71
7255// ======================> saa5050_device
7356
74class saa5050_device :  public device_t,
75                  public saa5050_interface
57class saa5050_device :  public device_t
7658{
7759public:
7860   // construction/destruction
79   saa5050_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source);
61   saa5050_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
8062   saa5050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
8163
64   static void static_set_screen_size(device_t &device, int cols, int rows, int size) { downcast<saa5050_device &>(device).m_cols = cols; downcast<saa5050_device &>(device).m_rows = rows; downcast<saa5050_device &>(device).m_size = size; }
65
66   template<class _Object> static devcb2_base &set_d_rd_callback(device_t &device, _Object object) { return downcast<saa5050_device &>(device).m_read_d.set_callback(object); }
67
8268   // optional information overrides
8369   virtual const rom_entry *device_rom_region() const;
8470
r29302r29303
9581   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
9682
9783protected:
98   enum
99   {
100      TYPE_5050,
101      TYPE_5052
102   };
103
10484   // device-level overrides
105   virtual void device_config_complete();
10685   virtual void device_start();
10786   virtual void device_reset();
10887
10988private:
89   enum
90   {
91      NUL = 0,
92      ALPHA_RED,
93      ALPHA_GREEN,
94      ALPHA_YELLOW,
95      ALPHA_BLUE,
96      ALPHA_MAGENTA,
97      ALPHA_CYAN,
98      ALPHA_WHITE,
99      FLASH,
100      STEADY,
101      END_BOX,
102      START_BOX,
103      NORMAL_HEIGHT,
104      DOUBLE_HEIGHT,
105      S0,
106      S1,
107      DLE,
108      GRAPHICS_RED,
109      GRAPHICS_GREEN,
110      GRAPHICS_YELLOW,
111      GRAPHICS_BLUE,
112      GRAPHICS_MAGENTA,
113      GRAPHICS_CYAN,
114      GRAPHICS_WHITE,
115      CONCEAL_DISPLAY,
116      CONTIGUOUS_GFX,
117      SEPARATED_GFX,
118      ESC,
119      BLACK_BACKGROUND,
120      NEW_BACKGROUND,
121      HOLD_GRAPHICS,
122      RELEASE_GRAPHICS
123   };
124
110125   void process_control_character(UINT8 data);
111126   void get_character_data(UINT8 data);
112127
113   devcb_resolved_read8    m_in_d_func;
128   required_memory_region m_char_rom;
114129
115   const UINT8 *m_char_rom;
130   devcb2_read8    m_read_d;
131
116132   UINT8 m_code;
117133   UINT8 m_last_code;
118134   UINT8 m_char_data;
r29302r29303
132148   bool m_hold;
133149   int m_frame_count;
134150
135   int m_variant;
151   int m_cols;
152   int m_rows;
153   int m_size;
136154};
137155
138156
157// ======================> saa5051_device
158
159class saa5051_device :  public saa5050_device
160{
161public:
162   // construction/destruction
163   saa5051_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
164
165   // optional information overrides
166   virtual const rom_entry *device_rom_region() const;
167};
168
169
139170// ======================> saa5052_device
140171
141172class saa5052_device :  public saa5050_device
r29302r29303
143174public:
144175   // construction/destruction
145176   saa5052_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
177
178   // optional information overrides
179   virtual const rom_entry *device_rom_region() const;
146180};
147181
148182
183// ======================> saa5053_device
184
185class saa5053_device :  public saa5050_device
186{
187public:
188   // construction/destruction
189   saa5053_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
190
191   // optional information overrides
192   virtual const rom_entry *device_rom_region() const;
193};
194
195
196// ======================> saa5054_device
197
198class saa5054_device :  public saa5050_device
199{
200public:
201   // construction/destruction
202   saa5054_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
203
204   // optional information overrides
205   virtual const rom_entry *device_rom_region() const;
206};
207
208
209// ======================> saa5055_device
210
211class saa5055_device :  public saa5050_device
212{
213public:
214   // construction/destruction
215   saa5055_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
216
217   // optional information overrides
218   virtual const rom_entry *device_rom_region() const;
219};
220
221
222// ======================> saa5056_device
223
224class saa5056_device :  public saa5050_device
225{
226public:
227   // construction/destruction
228   saa5056_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
229
230   // optional information overrides
231   virtual const rom_entry *device_rom_region() const;
232};
233
234
235// ======================> saa5057_device
236
237class saa5057_device :  public saa5050_device
238{
239public:
240   // construction/destruction
241   saa5057_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
242
243   // optional information overrides
244   virtual const rom_entry *device_rom_region() const;
245};
246
247
149248// device type definition
150extern const device_type SAA5050;
151extern const device_type SAA5052;
249extern const device_type SAA5050; // English
250extern const device_type SAA5051; // German
251extern const device_type SAA5052; // Swedish/Finnish
252extern const device_type SAA5053; // Italian
253extern const device_type SAA5054; // Belgian
254extern const device_type SAA5055; // U.S. ASCII
255extern const device_type SAA5056; // Hebrew
256extern const device_type SAA5057; // Cyrillic
152257
153258
154259
shelves/new_menus/src/emu/video/mc6845.c
r29302r29303
124124}
125125
126126mc6845_device::mc6845_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
127   : device_t(mconfig, MC6845, "mc6845", tag, owner, clock, "mc6845", __FILE__),
127   : device_t(mconfig, MC6845, "MC6845 CRTC", tag, owner, clock, "mc6845", __FILE__),
128128      device_video_interface(mconfig, *this, false)
129129{
130130}
r29302r29303
13861386
13871387
13881388r6545_1_device::r6545_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1389   : mc6845_device(mconfig, R6545_1, "R6545-1", tag, owner, clock, "r6545_1", __FILE__)
1389   : mc6845_device(mconfig, R6545_1, "R6545-1 CRTC", tag, owner, clock, "r6545_1", __FILE__)
13901390{
13911391}
13921392
13931393
13941394h46505_device::h46505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1395   : mc6845_device(mconfig, H46505, "H46505", tag, owner, clock, "h46505", __FILE__)
1395   : mc6845_device(mconfig, H46505, "H46505 CRTC", tag, owner, clock, "h46505", __FILE__)
13961396{
13971397}
13981398
13991399
14001400mc6845_1_device::mc6845_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1401   : mc6845_device(mconfig, MC6845_1, "MC6845-1", tag, owner, clock, "mc6845_1", __FILE__)
1401   : mc6845_device(mconfig, MC6845_1, "MC6845-1 CRTC", tag, owner, clock, "mc6845_1", __FILE__)
14021402{
14031403}
14041404
14051405
14061406hd6845_device::hd6845_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1407   : mc6845_device(mconfig, HD6845, "HD6845", tag, owner, clock, "hd6845", __FILE__)
1407   : mc6845_device(mconfig, HD6845, "HD6845 CRTC", tag, owner, clock, "hd6845", __FILE__)
14081408{
14091409}
14101410
14111411
14121412c6545_1_device::c6545_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1413   : mc6845_device(mconfig, C6545_1, "C6545-1", tag, owner, clock, "c6545_1", __FILE__)
1413   : mc6845_device(mconfig, C6545_1, "C6545-1 CRTC", tag, owner, clock, "c6545_1", __FILE__)
14141414{
14151415}
14161416
14171417
14181418sy6545_1_device::sy6545_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1419   : mc6845_device(mconfig, SY6545_1, "SY6545-1", tag, owner, clock, "sy6545_1", __FILE__)
1419   : mc6845_device(mconfig, SY6545_1, "SY6545-1 CRTC", tag, owner, clock, "sy6545_1", __FILE__)
14201420{
14211421}
14221422
14231423
14241424sy6845e_device::sy6845e_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1425   : mc6845_device(mconfig, SY6845E, "SY6845E", tag, owner, clock, "sy6845e", __FILE__)
1425   : mc6845_device(mconfig, SY6845E, "SY6845E CRTC", tag, owner, clock, "sy6845e", __FILE__)
14261426{
14271427}
14281428
14291429
14301430hd6345_device::hd6345_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1431   : mc6845_device(mconfig, HD6345, "HD6345", tag, owner, clock, "hd6345", __FILE__)
1431   : mc6845_device(mconfig, HD6345, "HD6345 CRTC", tag, owner, clock, "hd6345", __FILE__)
14321432{
14331433}
14341434
14351435
14361436ams40041_device::ams40041_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1437   : mc6845_device(mconfig, AMS40041, "40041", tag, owner, clock, "ams40041", __FILE__)
1437   : mc6845_device(mconfig, AMS40041, "AMS40041 CRTC", tag, owner, clock, "ams40041", __FILE__)
14381438{
14391439}
14401440
shelves/new_menus/src/emu/video/huc6260.c
r29302r29303
6262
6363
6464huc6260_device::huc6260_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
65   :   device_t(mconfig, HUC6260, "HuC6260", tag, owner, clock, "huc6260", __FILE__),
65   :   device_t(mconfig, HUC6260, "HuC6260 VCE", tag, owner, clock, "huc6260", __FILE__),
6666      device_video_interface(mconfig, *this)
6767{
6868}
shelves/new_menus/src/emu/video/h63484.c
r29302r29303
826826   }
827827}
828828
829void h63484_device::draw_circle(INT16 cx, INT16 cy, double r, double s_angol, double e_angol, bool c)
829void h63484_device::draw_ellipse(INT16 cx, INT16 cy, double dx, double dy, double s_angol, double e_angol, bool c)
830830{
831   double inc = 1.0 / (r * 100);
831   double inc = 1.0 / (MAX(dx, dy) * 100);
832832   for (double angol = s_angol; fabs(angol - e_angol) >= inc*2; angol += inc * (c ? -1 : +1))
833833   {
834834      if (angol > DEGREE_TO_RADIAN(360))    angol -= DEGREE_TO_RADIAN(360);
835835      if (angol < DEGREE_TO_RADIAN(0))      angol += DEGREE_TO_RADIAN(360);
836836
837      double px = cos(angol) * r;
838      double py = sin(angol) * r;
837      double px = cos(angol) * dx;
838      double py = sin(angol) * dy;
839839      set_dot(cx + round(px), cy + round(py), 0, 0);
840840   }
841841}
r29302r29303
13731373   if (s_angol < 0)    s_angol += DEGREE_TO_RADIAN(360);
13741374   if (e_angol < 0)    e_angol += DEGREE_TO_RADIAN(360);
13751375
1376   draw_circle(xc, yc, r, s_angol, e_angol, BIT(m_cr, 8));
1376   draw_ellipse(xc, yc, r, r, s_angol, e_angol, BIT(m_cr, 8));
13771377
13781378   m_cpx = xe;
13791379   m_cpy = ye;
13801380}
13811381
1382void h63484_device::command_earc_exec()
1383{
1384   UINT16 a = m_pr[0];
1385   UINT16 b = m_pr[1];
1386   INT16 xc = (INT16)m_pr[2];
1387   INT16 yc = (INT16)m_pr[3];
1388   INT16 xe = (INT16)m_pr[4];
1389   INT16 ye = (INT16)m_pr[5];
1390
1391   if (BIT(m_cr, 10))
1392   {
1393      xc += m_cpx;
1394      yc += m_cpy;
1395      xe += m_cpx;
1396      ye += m_cpy;
1397   }
1398
1399   double r = sqrt(pow((double)(xc - m_cpx), 2) / a + pow((double)(yc - m_cpy), 2) / b);
1400   double dx = sqrt((double)a);
1401   double dy = sqrt((double)b);
1402   double s_angol = atan2((double)(m_cpy - yc) / dy, (double)(m_cpx - xc) / dx);
1403   double e_angol = atan2((double)(ye - yc) / dy, (double)(xe - xc) / dx);
1404   if (s_angol < 0)    s_angol += DEGREE_TO_RADIAN(360);
1405   if (e_angol < 0)    e_angol += DEGREE_TO_RADIAN(360);
1406
1407   draw_ellipse(xc, yc, r * dx, r * dy, s_angol, e_angol, BIT(m_cr, 8));
1408
1409   m_cpx = xe;
1410   m_cpy = ye;
1411}
1412
13821413void h63484_device::process_fifo()
13831414{
13841415   UINT8 data;
r29302r29303
16541685         if(m_param_ptr == 1)
16551686         {
16561687            if (CMD_LOG)    logerror("HD63484 '%s': CRCL (%d, %d, %d, %d) %d\n", tag(), BIT(m_cr, 8), (m_cr >> 5) & 0x07, (m_cr >> 3) & 0x03, (m_cr >> 0) & 0x07, m_pr[0]);
1657            draw_circle(m_cpx, m_cpy, m_pr[0] & 0x1fff, DEGREE_TO_RADIAN(0), DEGREE_TO_RADIAN(360), BIT(m_cr, 8));
1688            UINT16 r = m_pr[0] & 0x1fff;
1689            draw_ellipse(m_cpx, m_cpy, r, r, DEGREE_TO_RADIAN(0), DEGREE_TO_RADIAN(360), BIT(m_cr, 8));
16581690            command_end_seq();
16591691         }
16601692         break;
r29302r29303
16631695         if(m_param_ptr == 3)
16641696         {
16651697            if (CMD_LOG)    logerror("HD63484 '%s': ELPS (%d, %d, %d, %d) %d, %d, %d\n", tag(), BIT(m_cr, 8), (m_cr >> 5) & 0x07, (m_cr >> 3) & 0x03, (m_cr >> 0) & 0x07, m_pr[0], m_pr[1], m_pr[2]);
1698            double dx = (double)m_pr[3];
1699            double dy = sqrt(pow(dx, 2) / ((double)m_pr[0] / m_pr[1]));
1700            draw_ellipse(m_cpx, m_cpy, dx, dy, DEGREE_TO_RADIAN(0), DEGREE_TO_RADIAN(360), BIT(m_cr, 8));
16661701            command_end_seq();
1667            fatalerror("HD63484 COMMAND_ELPS!\n");
16681702         }
16691703         break;
16701704
r29302r29303
16831717         if(m_param_ptr == 6)
16841718         {
16851719            if (CMD_LOG)    logerror("HD63484 '%s': %cEARC (%d, %d, %d, %d) %d, %d, %d, %d, %d, %d\n", tag(), BIT(m_cr, 10) ? 'R' : 'A', BIT(m_cr, 8), (m_cr >> 5) & 0x07, (m_cr >> 3) & 0x03, (m_cr >> 0) & 0x07, m_pr[0], m_pr[1], m_pr[2], m_pr[3], m_pr[4], m_pr[5]);
1720            command_earc_exec();
16861721            command_end_seq();
1687            fatalerror("HD63484 COMMAND_AEARC!\n");
16881722         }
16891723         break;
16901724
shelves/new_menus/src/emu/video/hd63484.c
r29302r29303
2626const device_type HD63484 = &device_creator<hd63484_device>;
2727
2828hd63484_device::hd63484_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
29   : device_t(mconfig, HD63484, "HD63484", tag, owner, clock, "hd63484", __FILE__),
29   : device_t(mconfig, HD63484, "HD63484 CRTC", tag, owner, clock, "hd63484", __FILE__),
3030   m_ram(NULL),
3131   //m_reg[256/2],
3232   m_fifo_counter(0),
shelves/new_menus/src/emu/video/h63484.h
r29302r29303
8282   bool set_dot(INT16 x, INT16 y, INT16 px, INT16 py);
8383   bool set_dot(INT16 x, INT16 y, UINT16 color);
8484   void draw_line(INT16 sx, INT16 sy, INT16 ex, INT16 ey);
85   void draw_circle(INT16 cx, INT16 cy, double r, double s_angol, double e_angol, bool c);
85   void draw_ellipse(INT16 cx, INT16 cy, double dx, double dy, double s_angol, double e_angol, bool c);
8686   void paint(INT16 sx, INT16 sy);
8787
8888   void command_wpr_exec();
r29302r29303
9696   void command_plg_exec();
9797   void command_frct_exec();
9898   void command_arc_exec();
99   void command_earc_exec();
99100
100101   void process_fifo();
101102   void exec_abort_sequence();
shelves/new_menus/src/emu/video/pc_vga.c
r29302r29303
179179}
180180
181181cirrus_vga_device::cirrus_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
182   : svga_device(mconfig, CIRRUS_VGA, "CIRRUS_VGA", tag, owner, clock, "cirrus_vga", __FILE__)
182   : svga_device(mconfig, CIRRUS_VGA, "Cirrus Logic VGA", tag, owner, clock, "cirrus_vga", __FILE__)
183183{
184184}
185185
shelves/new_menus/src/emu/video/huc6202.c
r29302r29303
3939
4040
4141huc6202_device::huc6202_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
42   : device_t(mconfig, HUC6202, "HuC6202", tag, owner, clock, "huc6202", __FILE__)
42   : device_t(mconfig, HUC6202, "HuC6202 VPC", tag, owner, clock, "huc6202", __FILE__)
4343{
4444}
4545
shelves/new_menus/src/emu/video/huc6270.c
r29302r29303
111111
112112
113113huc6270_device::huc6270_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
114   : device_t(mconfig, HUC6270, "Hudson/NEC HuC6270", tag, owner, clock, "huc6270", __FILE__)
114   : device_t(mconfig, HUC6270, "HuC6270 VDC", tag, owner, clock, "huc6270", __FILE__)
115115{
116116}
117117
shelves/new_menus/src/emu/sound/pokey.c
r29302r29303
864864      if( m_AUDCTL & POLY9 )
865865      {
866866         data = m_poly9[m_p9] & 0xff;
867         synchronize(SYNC_NOOP); /* force resync */
868867         LOG_RAND(("POKEY '%s' rand9[$%05x]: $%02x\n", tag(), m_p9, data));
869868      }
870869      else
871870      {
872871         data = (m_poly17[m_p17] >> 8) & 0xff;
873         synchronize(SYNC_NOOP); /* force resync */
874872         LOG_RAND(("POKEY '%s' rand17[$%05x]: $%02x\n", tag(), m_p17, data));
875873      }
876874      break;
shelves/new_menus/src/mess/drivers/a6809.c
r29302r29303
154154      return m_p_videoram[offset&0x3ff];
155155}
156156
157static SAA5050_INTERFACE( a6809_saa5050_intf )
158{
159   DEVCB_DRIVER_MEMBER(a6809_state, videoram_r),
160   40, 25, 40  /* x, y, size */
161};
162
163157WRITE8_MEMBER( a6809_state::a6809_address_w )
164158{
165159   m_crtc->address_w( space, 0, data );
r29302r29303
271265   MCFG_VIA6522_IRQ_HANDLER(DEVWRITELINE("maincpu", m6809e_device, irq_line))
272266
273267   MCFG_MC6845_ADD("mc6845", MC6845, "screen", XTAL_4MHz / 2, a6809_crtc6845_interface)
274   MCFG_SAA5050_ADD("saa5050", 6000000, a6809_saa5050_intf)
268
269   MCFG_DEVICE_ADD("saa5050", SAA5050, 6000000)
270   MCFG_SAA5050_D_CALLBACK(READ8(a6809_state, videoram_r))
271   MCFG_SAA5050_SCREEN_SIZE(40, 25, 40)
272
275273   MCFG_ASCII_KEYBOARD_ADD("keyboard", kb_intf)
276274   MCFG_CASSETTE_ADD( "cassette", default_cassette_interface )
277275   MCFG_TIMER_DRIVER_ADD_PERIODIC("a6809_c", a6809_state, a6809_c, attotime::from_hz(4800))
shelves/new_menus/src/mess/drivers/pc.c
r29302r29303
302302   MCFG_CPU_PC(pc8, pc8, I8088, 12000000)
303303MACHINE_CONFIG_END
304304
305static MACHINE_CONFIG_DERIVED(mk88, pccga)
306   MCFG_DEVICE_REMOVE("maincpu")
307   MCFG_CPU_PC(pc16, pc16, I8086, 4772720)
305static MACHINE_CONFIG_DERIVED(mk88, poisk2)
306   MCFG_DEVICE_MODIFY("isa1")
307   MCFG_SLOT_DEFAULT_OPTION("cga_ec1841")
308308MACHINE_CONFIG_END
309309
310310ROM_START( bw230 )
r29302r29303
343343   ROM_SYSTEM_BIOS(2, "v392", "v3.92")
344344   ROMX_LOAD( "m88.bin", 0xfc000, 0x2000, CRC(fe1b4e36) SHA1(fcb420af0ff09a7d43fcb9b7d0b0233a2071c159), ROM_BIOS(3))
345345   ROMX_LOAD( "b88.bin", 0xfe000, 0x2000, CRC(58a418df) SHA1(216398d4e4302ee7efcc2c8f9ff9d8a1161229ea), ROM_BIOS(3))
346   ROM_REGION(0x2000,"gfx1", ROMREGION_ERASE00)
347   // Here CGA rom with cyrillic support should be added
348346ROM_END
349347
350348ROM_START( iskr3104 )
r29302r29303
354352   // EGA card from Iskra-3104
355353   //ROMX_LOAD( "143-03.bin", 0xc0001, 0x2000, CRC(d0706345) SHA1(e04bb40d944426a4ae2e3a614d3f4953d7132ede),ROM_SKIP(1))
356354   //ROMX_LOAD( "143-02.bin", 0xc0000, 0x2000, CRC(c8c18ebb) SHA1(fd6dac76d43ab8b582e70f1d5cc931d679036fb9),ROM_SKIP(1))
357
358   ROM_REGION(0x2000,"gfx1", ROMREGION_ERASE00)
359355ROM_END
360356
361357ROM_START( poisk2 )
shelves/new_menus/src/mess/drivers/p2000t.c
r29302r29303
212212   return m_videoram[offset];
213213}
214214
215static SAA5050_INTERFACE( p2000t_saa5050_intf )
216{
217   DEVCB_DRIVER_MEMBER(p2000t_state, videoram_r),
218   40, 24, 80  /* x, y, size */
219};
220
221215/* Machine definition */
222216static MACHINE_CONFIG_START( p2000t, p2000t_state )
223217   /* basic machine hardware */
r29302r29303
234228   MCFG_SCREEN_VISIBLE_AREA(0, 40 * 12 - 1, 0, 24 * 20 - 1)
235229   MCFG_SCREEN_UPDATE_DEVICE("saa5050", saa5050_device, screen_update)
236230
237   MCFG_SAA5050_ADD("saa5050", 6000000, p2000t_saa5050_intf)
231   MCFG_DEVICE_ADD("saa5050", SAA5050, 6000000)
232   MCFG_SAA5050_D_CALLBACK(READ8(p2000t_state, videoram_r))
233   MCFG_SAA5050_SCREEN_SIZE(40, 24, 80)
238234
239235   /* sound hardware */
240236   MCFG_SPEAKER_STANDARD_MONO("mono")
shelves/new_menus/src/mess/drivers/abc80x.c
r29302r29303
949949   save_item(NAME(m_pling));
950950   save_item(NAME(m_sb));
951951   save_item(NAME(m_ctc_z0));
952   save_item(NAME(m_sio_txcb));
952953   save_item(NAME(m_sio_txdb));
953954   save_item(NAME(m_sio_rtsb));
954955   save_item(NAME(m_dfd_out));
r29302r29303
991992   m_cassette_timer->adjust(attotime::from_hz(44100), 0, attotime::from_hz(44100));
992993
993994   // register for state saving
994   save_item(NAME(m_lrs));
995995   save_item(NAME(m_pling));
996996   save_item(NAME(m_sb));
997997   save_item(NAME(m_ctc_z0));
998   save_item(NAME(m_sio_txcb));
998999   save_item(NAME(m_sio_txdb));
9991000   save_item(NAME(m_sio_rtsb));
10001001   save_item(NAME(m_dfd_out));
10011002   save_item(NAME(m_dfd_in));
10021003   save_item(NAME(m_tape_ctr));
1004   save_item(NAME(m_lrs));
10031005}
10041006
10051007
r29302r29303
10591061   }
10601062
10611063   // register for state saving
1062   save_item(NAME(m_keydtr));
1063   save_item(NAME(m_eme));
10641064   save_item(NAME(m_fetch_charram));
1065   save_item(NAME(m_map));
1065   save_item(NAME(m_pling));
1066   save_item(NAME(m_sb));
10661067   save_item(NAME(m_ctc_z0));
1068   save_item(NAME(m_sio_txcb));
10671069   save_item(NAME(m_sio_txdb));
10681070   save_item(NAME(m_sio_rtsb));
10691071   save_item(NAME(m_dfd_out));
10701072   save_item(NAME(m_dfd_in));
10711073   save_item(NAME(m_tape_ctr));
1074   save_item(NAME(m_keydtr));
1075   save_item(NAME(m_eme));
1076   save_item(NAME(m_map));
10721077}
10731078
10741079
shelves/new_menus/src/mess/drivers/iskr103x.c
r29302r29303
9898   MCFG_IBM5160_MOTHERBOARD_ADD("mb","maincpu")
9999   MCFG_DEVICE_INPUT_DEFAULTS(iskr1031)
100100
101   MCFG_ISA8_SLOT_ADD("mb:isa", "isa1", pc_isa8_cards, "cga", false)
101   MCFG_ISA8_SLOT_ADD("mb:isa", "isa1", pc_isa8_cards, "cga_ec1841", false)
102102   MCFG_ISA8_SLOT_ADD("mb:isa", "isa2", pc_isa8_cards, "fdc_xt", false)
103103   MCFG_ISA8_SLOT_ADD("mb:isa", "isa3", pc_isa8_cards, NULL, false) // hdc is WIP
104104   MCFG_ISA8_SLOT_ADD("mb:isa", "isa4", pc_isa8_cards, NULL, false)
r29302r29303
132132   ROMX_LOAD( "150-06.bin", 0xfc000, 0x2000, CRC(1adbf969) SHA1(08c0a0fc50a75e6207b1987bae389cca60893eac), ROM_SKIP(1) | ROM_BIOS(2))
133133   ROMX_LOAD( "150-07.bin", 0xfc001, 0x2000, CRC(0dc4b65a) SHA1(c96f066251a7343eac8113ea9dcb2cb12d0334d5), ROM_SKIP(1) | ROM_BIOS(2))
134134
135   ROM_REGION(0x2000,"gfx1", 0)
136   ROM_LOAD( "iskra-1031_font.bin", 0x0000, 0x2000, CRC(f4d62e80) SHA1(ad7e81a0c9abc224671422bbcf6f6262da92b510))
135   //ROM_REGION(0x2000,"gfx1", 0)
136   //ROM_LOAD( "iskra-1031_font.bin", 0x0000, 0x2000, CRC(f4d62e80) SHA1(ad7e81a0c9abc224671422bbcf6f6262da92b510))
137137ROM_END
138138
139139/***************************************************************************
shelves/new_menus/src/mess/drivers/a7800.c
r29302r29303
10331033
10341034   /* video hardware */
10351035   MCFG_SCREEN_ADD("screen", RASTER)
1036   MCFG_SCREEN_RAW_PARAMS( 7159090, 456, 0, 320, 262, 26, 26 + 192 + 30 )
1036   MCFG_SCREEN_RAW_PARAMS( 7159090, 456, 0, 320, 263, 26, 26 + 192 + 30 )
10371037   MCFG_SCREEN_UPDATE_DRIVER(a7800_state, screen_update_a7800)
10381038   MCFG_SCREEN_PALETTE("palette")
10391039
r29302r29303
10721072//  MCFG_TIMER_ADD_SCANLINE("scantimer", a7800_interrupt, "screen", 0, 1)
10731073
10741074   MCFG_SCREEN_MODIFY( "screen" )
1075      MCFG_SCREEN_RAW_PARAMS( 7093788, 456, 0, 320, 312, 34, 34 + 228 + 30 )
1075      MCFG_SCREEN_RAW_PARAMS( 7093788, 456, 0, 320, 313, 34, 34 + 228 + 30 )
10761076
10771077   MCFG_PALETTE_MODIFY("palette")
10781078   MCFG_PALETTE_INIT_OWNER(a7800_state, a7800p )
r29302r29303
10991099
11001100ROM_START( a7800 )
11011101   ROM_REGION(0x100000, "maincpu", 0)
1102   ROM_FILL(0x0000, 0x40000, 0xff)
1102   ROM_FILL(0x0000, 0x100000, 0xff)
11031103   ROM_SYSTEM_BIOS( 0, "a7800", "Atari 7800" )
11041104   ROMX_LOAD("7800.u7", 0xf000, 0x1000, CRC(5d13730c) SHA1(d9d134bb6b36907c615a594cc7688f7bfcef5b43), ROM_BIOS(1))
11051105   ROM_SYSTEM_BIOS( 1, "a7800pr", "Atari 7800 (prototype with Asteroids)" )
r29302r29303
11081108
11091109ROM_START( a7800p )
11101110   ROM_REGION(0x100000, "maincpu", 0)
1111   ROM_FILL(0x0000, 0x40000, 0xff)
1111   ROM_FILL(0x0000, 0x100000, 0xff)
11121112   ROM_LOAD("7800pal.rom", 0xc000, 0x4000, CRC(d5b61170) SHA1(5a140136a16d1d83e4ff32a19409ca376a8df874))
11131113ROM_END
11141114
shelves/new_menus/src/mess/drivers/bbc.c
r29302r29303
623623   NULL
624624};
625625
626static SAA5050_INTERFACE( trom_intf )
627{
628   DEVCB_NULL,
629   40, 24, 40  // x, y, size
630};
631
632
633626static const mc6854_interface adlc_intf =
634627{
635628   DEVCB_NULL,
r29302r29303
695688
696689   MCFG_PALETTE_ADD("palette", 16)
697690   MCFG_PALETTE_INIT_OWNER(bbc_state,bbc)
698   MCFG_SAA5050_ADD("saa5050", XTAL_12MHz/2, trom_intf)
699691
692   MCFG_DEVICE_ADD("saa5050", SAA5050, XTAL_12MHz/2)
693   MCFG_SAA5050_SCREEN_SIZE(40, 24, 40)
694
700695   /* crtc */
701696   MCFG_MC6845_ADD("mc6845", MC6845, "screen", 2000000, bbc_mc6845_intf)
702697   MCFG_VIDEO_START_OVERRIDE(bbc_state, bbca)
r29302r29303
909904   MCFG_PALETTE_ADD("palette", 16)
910905   MCFG_PALETTE_INIT_OWNER(bbc_state,bbc)
911906
912   MCFG_SAA5050_ADD("saa5050", XTAL_12MHz/2, trom_intf)
907   MCFG_DEVICE_ADD("saa5050", SAA5050, XTAL_12MHz/2)
908   MCFG_SAA5050_SCREEN_SIZE(40, 24, 40)
913909
914910   /* crtc */
915911   MCFG_MC6845_ADD("mc6845", MC6845, "screen", 2000000, bbc_mc6845_intf)
shelves/new_menus/src/mess/drivers/poly.c
r29302r29303
140140   return m_videoram[offset];
141141}
142142
143static SAA5050_INTERFACE( poly_saa5050_intf )
144{
145   DEVCB_DRIVER_MEMBER(poly_state, videoram_r),
146   40, 24, 40  /* x, y, size */
147};
148
149143WRITE8_MEMBER( poly_state::kbd_put )
150144{
151145   m_term_data = data | 0x80;
r29302r29303
184178   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
185179
186180   /* Devices */
187   MCFG_SAA5050_ADD("saa5050", 6000000, poly_saa5050_intf)
181   MCFG_DEVICE_ADD("saa5050", SAA5050, 6000000)
182   MCFG_SAA5050_D_CALLBACK(READ8(poly_state, videoram_r))
183   MCFG_SAA5050_SCREEN_SIZE(40, 24, 40)
188184
189185   MCFG_DEVICE_ADD("pia0", PIA6821, 0)
190186   MCFG_PIA_IRQA_HANDLER(DEVWRITELINE("maincpu", m6809e_device, irq_line))
shelves/new_menus/src/mess/machine/a7800.c
r29302r29303
107107
108108DRIVER_INIT_MEMBER(a7800_state,a7800_ntsc)
109109{
110   a7800_driver_init(FALSE, 262);
110   a7800_driver_init(FALSE, 263);
111111}
112112
113113
114114DRIVER_INIT_MEMBER(a7800_state,a7800_pal)
115115{
116   a7800_driver_init(TRUE, 312);
116   a7800_driver_init(TRUE, 313);
117117}
118118
119119
r29302r29303
520520
521521WRITE8_MEMBER(a7800_state::a7800_TIA_w)
522522{
523   switch(offset) {
524   case 0x01:
523   if (offset<0x20) { //INPTCTRL covers TIA registers 0x00-0x1F until locked
525524      if(data & 0x01)
526525      {
527         m_maria_flag=1;
526         if ((m_ctrl_lock)&&(offset==0x01))
527            m_maria_flag=1;
528         else if (!m_ctrl_lock)
529            m_maria_flag=1;
528530      }
529531      if(!m_ctrl_lock)
530532      {
r29302r29303
536538         else
537539            memcpy( m_ROM + 0xC000, m_bios_bkup, 0x4000 );
538540      }
539      break;
540541   }
541542   m_tia->tia_sound_w(space, offset, data);
542543   m_ROM[offset] = data;
shelves/new_menus/src/mess/machine/mega32x.c
r29302r29303
15691569   else m_slave_cpu->set_input_line(SH2_VINT_IRQ_LEVEL,CLEAR_LINE);
15701570}
15711571
1572void sega_32x_device::_32x_scanline_cb0()
1573{
1574   m_sh2_master_vint_pending = 1;
1575   m_sh2_slave_vint_pending = 1;
1576   _32x_check_irqs();
1577}
1578
1579
1580void sega_32x_device::_32x_scanline_cb1(int scanline)
1581{
1582   m_32x_hcount_compare_val++;
1583
1584   if (m_32x_hcount_compare_val >= m_32x_hcount_reg)
1585   {
1586      m_32x_hcount_compare_val = -1;
1587
1588      if (scanline < 224 || m_sh2_hint_in_vbl)
1589      {
1590         if (m_sh2_master_hint_enable) { m_master_cpu->set_input_line(SH2_HINT_IRQ_LEVEL,ASSERT_LINE); }
1591         if (m_sh2_slave_hint_enable) { m_slave_cpu->set_input_line(SH2_HINT_IRQ_LEVEL,ASSERT_LINE); }
1592      }
1593   }
1594}
1595
15961572void sega_32x_device::_32x_interrupt_cb(int scanline, int irq6)
15971573{
15981574   if (scanline == irq6)
r29302r29303
17481724   }
17491725}
17501726
1751int sega_32x_device::_32x_render_videobuffer_to_screenbuffer_lopri(int x, UINT16 &lineptr)
1752{
1753   int drawn = 0;
1754
1755   if (m_32x_displaymode != 0)
1756   {
1757      if (!m_32x_videopriority)
1758      {
1759         if (!(m_32x_linerender[x] & 0x8000))
1760         {
1761            lineptr = m_32x_linerender[x] & 0x7fff;
1762            drawn = 1;
1763         }
1764      }
1765      else
1766      {
1767         if (m_32x_linerender[x] & 0x8000)
1768         {
1769            lineptr = m_32x_linerender[x] & 0x7fff;
1770            drawn = 1;
1771         }
1772      }
1773   }
1774
1775   return drawn;
1776}
1777
1778void sega_32x_device::_32x_render_videobuffer_to_screenbuffer_hipri(int x, UINT16 &lineptr)
1779{
1780   if (m_32x_displaymode != 0)
1781   {
1782      if (!m_32x_videopriority)
1783      {
1784         if (m_32x_linerender[x] & 0x8000)
1785            lineptr = m_32x_linerender[x] & 0x7fff;
1786      }
1787      else
1788      {
1789         if (!(m_32x_linerender[x] & 0x8000))
1790            lineptr = m_32x_linerender[x] & 0x7fff;
1791      }
1792   }
1793}
1794
17951727void sega_32x_device::_32x_render_videobuffer_to_screenbuffer(int x, UINT32 priority, UINT16 &lineptr)
17961728{
17971729   if (m_32x_displaymode != 0)
shelves/new_menus/src/mess/machine/mega32x.h
r29302r29303
113113   DECLARE_WRITE16_MEMBER( _32x_sh2_slave_401e_w );
114114
115115   void _32x_render_videobuffer_to_screenbuffer_helper(int scanline);
116   int _32x_render_videobuffer_to_screenbuffer_lopri(int x, UINT16 &lineptr);
117   void _32x_render_videobuffer_to_screenbuffer_hipri(int x, UINT16 &lineptr);
118116   void _32x_render_videobuffer_to_screenbuffer(int x, UINT32 priority, UINT16 &lineptr);
119117   int sh2_master_pwmint_enable, sh2_slave_pwmint_enable;
120118
121119   void _32x_check_framebuffer_swap(bool enabled);
122120   void _32x_check_irqs();
123   void _32x_scanline_cb0();
124   void _32x_scanline_cb1(int scanline);
125121   void _32x_interrupt_cb(int scanline, int irq6);
126122
127123   /* our main vblank handler resets this */
shelves/new_menus/src/mess/includes/abc80x.h
r29302r29303
133133   DECLARE_WRITE_LINE_MEMBER( sio_dtrb_w );
134134   DECLARE_WRITE_LINE_MEMBER( sio_rtsb_w );
135135
136   // cpu state
137   int m_fetch_charram;            // opcode fetched from character RAM region (0x7800-0x7fff)
136   // memory state
137   int m_fetch_charram;        // opcode fetched from character RAM region (0x7800-0x7fff)
138138
139   // video state
140   UINT8 m_hrs;                    // HR picture start scanline
141   UINT8 m_fgctl;                  // HR foreground control
142
143139   // sound state
144   int m_pling;                    // pling
140   int m_pling;
145141
146142   // serial state
147143   UINT8 m_sb;
r29302r29303
153149   int m_dfd_in;
154150   int m_tape_ctr;
155151
152   // video state
153   UINT8 m_hrs;                    // HR picture start scanline
154   UINT8 m_fgctl;                  // HR foreground control
155
156156   // timers
157157   emu_timer *m_ctc_timer;
158158   emu_timer *m_cassette_timer;
159159};
160160
161
162// ======================> abc800m_state
163
161164class abc800m_state : public abc800_state
162165{
163166public:
164   abc800m_state(const machine_config &mconfig, device_type type, const char *tag)
165      : abc800_state(mconfig, type, tag),
166         m_crtc(*this, MC6845_TAG),
167         m_palette(*this, "palette"),
168         m_fgctl_prom(*this, "hru2"),
169         m_char_rom(*this, MC6845_TAG)
167   abc800m_state(const machine_config &mconfig, device_type type, const char *tag) :
168      abc800_state(mconfig, type, tag),
169      m_crtc(*this, MC6845_TAG),
170      m_palette(*this, "palette"),
171      m_fgctl_prom(*this, "hru2"),
172      m_char_rom(*this, MC6845_TAG)
170173   { }
171174
172175   required_device<mc6845_device> m_crtc;
r29302r29303
183186   DECLARE_DIRECT_UPDATE_MEMBER( direct_update_handler );
184187};
185188
189
190// ======================> abc800c_state
191
186192class abc800c_state : public abc800_state
187193{
188194public:
189   abc800c_state(const machine_config &mconfig, device_type type, const char *tag)
190      : abc800_state(mconfig, type, tag),
191         m_trom(*this, SAA5052_TAG),
192         m_fgctl_prom(*this, "hru2")
195   abc800c_state(const machine_config &mconfig, device_type type, const char *tag) :
196      abc800_state(mconfig, type, tag),
197      m_trom(*this, SAA5052_TAG),
198      m_palette(*this, "palette"),
199      m_fgctl_prom(*this, "hru2")
193200   { }
194201
195202   required_device<saa5052_device> m_trom;
203   required_device<palette_device> m_palette;
196204   required_memory_region m_fgctl_prom;
197205
198206   DECLARE_DRIVER_INIT(driver_init);
r29302r29303
204212
205213   DECLARE_READ8_MEMBER( char_ram_r );
206214   DECLARE_DIRECT_UPDATE_MEMBER( direct_update_handler );
215   DECLARE_PALETTE_INIT( abc800c );
207216};
208217
218
209219// ======================> abc802_state
210220
211221class abc802_state : public abc800_state
r29302r29303
257267   abc806_state(const machine_config &mconfig, device_type type, const char *tag)
258268      : abc800_state(mconfig, type, tag),
259269         m_crtc(*this, MC6845_TAG),
270         m_palette(*this, "palette"),
260271         m_rtc(*this, E0516_TAG),
261272         m_rad_prom(*this, "rad"),
262273         m_hru2_prom(*this, "hru"),
263         m_char_rom(*this, MC6845_TAG)
274         m_char_rom(*this, MC6845_TAG),
275         m_attr_ram(*this, "attr_ram")
264276   { }
265277
266278   required_device<mc6845_device> m_crtc;
279   required_device<palette_device> m_palette;
267280   required_device<e0516_device> m_rtc;
268281   required_memory_region m_rad_prom;
269282   required_memory_region m_hru2_prom;
270283   required_memory_region m_char_rom;
284   optional_shared_ptr<UINT8> m_attr_ram;
271285
272286   DECLARE_DRIVER_INIT(driver_init);
273287   virtual void machine_start();
r29302r29303
295309   DECLARE_WRITE_LINE_MEMBER( hs_w );
296310   DECLARE_WRITE_LINE_MEMBER( vs_w );
297311   DECLARE_DIRECT_UPDATE_MEMBER( direct_update_handler );
312   DECLARE_PALETTE_INIT( abc806 );
298313
299314   // memory state
300315   int m_keydtr;               // keyboard DTR
301316   int m_eme;                  // extended memory enable
302   int m_fetch_charram;        // opcode fetched from character RAM region (0x7800-0x7fff)
303317   UINT8 m_map[16];            // memory page register
304318
305319   // video state
306   UINT8 *m_color_ram;         // attribute RAM
307
308320   int m_txoff;                // text display enable
309321   int m_40;                   // 40/80 column mode
310322   int m_flshclk_ctr;          // flash clock counter
311323   int m_flshclk;              // flash clock
312324   UINT8 m_attr_data;          // attribute data latch
313   UINT8 m_hrs;                // HR memory mapping
314325   UINT8 m_hrc[16];            // HR palette
315326   UINT8 m_sync;               // line synchronization delay
316327   UINT8 m_v50_addr;           // vertical sync PROM address
shelves/new_menus/src/mess/video/abc800.c
r29302r29303
1616#define VERTICAL_PORCH_HACK     29
1717
1818
19static const rgb_t PALETTE_ABC[] =
20{
21   rgb_t::black,
22   rgb_t(0xff, 0x00, 0x00), // red
23   rgb_t(0x00, 0xff, 0x00), // green
24   rgb_t(0xff, 0xff, 0x00), // yellow
25   rgb_t(0x00, 0x00, 0xff), // blue
26   rgb_t(0xff, 0x00, 0xff), // magenta
27   rgb_t(0x00, 0xff, 0xff), // cyan
28   rgb_t::white
29};
3019
31
32
3320//**************************************************************************
3421//  HIGH RESOLUTION GRAPHICS
3522//**************************************************************************
r29302r29303
8370
8471void abc800c_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect)
8572{
73   const pen_t *pen = m_palette->pens();
74   
8675   UINT16 addr = 0;
8776
8877   for (int y = m_hrs; y < MIN(cliprect.max_y + 1, m_hrs + 480); y += 2)
r29302r29303
10695
10796               if (black || opaque)
10897               {
109                  bitmap.pix32(y, x) = PALETTE_ABC[color];
110                  bitmap.pix32(y, x + 1) = PALETTE_ABC[color];
98                  bitmap.pix32(y, x) = pen[color];
99                  bitmap.pix32(y, x + 1) = pen[color];
111100
112                  bitmap.pix32(y + 1, x) = PALETTE_ABC[color];
113                  bitmap.pix32(y + 1, x + 1) = PALETTE_ABC[color];
101                  bitmap.pix32(y + 1, x) = pen[color];
102                  bitmap.pix32(y + 1, x + 1) = pen[color];
114103               }
115104            }
116105
r29302r29303
161150   return m_char_ram[translate_trom_offset(offset)];
162151}
163152
164static SAA5050_INTERFACE( trom_intf )
153
154//-------------------------------------------------
155//  PALETTE_INIT( abc800c )
156//-------------------------------------------------
157
158PALETTE_INIT_MEMBER( abc800c_state, abc800c )
165159{
166   DEVCB_DRIVER_MEMBER(abc800c_state, char_ram_r),
167   40, 24, 40  // x, y, size
168};
160   palette.set_pen_color(0, rgb_t(0x00, 0x00, 0x00)); // black
161   palette.set_pen_color(1, rgb_t(0xff, 0x00, 0x00)); // red
162   palette.set_pen_color(2, rgb_t(0x00, 0xff, 0x00)); // green
163   palette.set_pen_color(3, rgb_t(0xff, 0xff, 0x00)); // yellow
164   palette.set_pen_color(4, rgb_t(0x00, 0x00, 0xff)); // blue
165   palette.set_pen_color(5, rgb_t(0xff, 0x00, 0xff)); // magenta
166   palette.set_pen_color(6, rgb_t(0x00, 0xff, 0xff)); // cyan
167   palette.set_pen_color(7, rgb_t(0xff, 0xff, 0xff)); // white
168}
169169
170170
171171//-------------------------------------------------
r29302r29303
175175MACHINE_CONFIG_FRAGMENT( abc800c_video )
176176   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
177177   MCFG_SCREEN_UPDATE_DRIVER(abc800c_state, screen_update)
178
179178   MCFG_SCREEN_REFRESH_RATE(50)
180179   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
181180   MCFG_SCREEN_SIZE(480, 480)
182181   MCFG_SCREEN_VISIBLE_AREA(0, 480-1, 0, 480-1)
183182
184   MCFG_SAA5052_ADD(SAA5052_TAG, XTAL_12MHz/2, trom_intf)
183   MCFG_PALETTE_ADD("palette", 8)
184   MCFG_PALETTE_INIT_OWNER(abc800c_state, abc800c)
185
186   MCFG_DEVICE_ADD(SAA5052_TAG, SAA5052, XTAL_12MHz/2)
187   MCFG_SAA5050_D_CALLBACK(READ8(abc800c_state, char_ram_r))
188   MCFG_SAA5050_SCREEN_SIZE(40, 24, 40)
185189MACHINE_CONFIG_END
186190
187191
r29302r29303
271275
272276static MC6845_INTERFACE( crtc_intf )
273277{
274   false,
278   true,
275279   0,0,0,0,
276280   ABC800_CHAR_WIDTH,
277281   NULL,
r29302r29303
291295
292296UINT32 abc800m_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
293297{
294   // HACK expand visible area to workaround MC6845
295   screen.set_visible_area(0, 767, 0, 311);
296
297298   // clear screen
298299   bitmap.fill(rgb_t::black, cliprect);
299300
shelves/new_menus/src/mess/video/abc802.c
r29302r29303
182182
183183static MC6845_INTERFACE( crtc_intf )
184184{
185   false,
185   true,
186186   0,0,0,0,
187187   ABC800_CHAR_WIDTH,
188188   NULL,
r29302r29303
211211
212212UINT32 abc802_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
213213{
214   // HACK expand visible area to workaround MC6845
215   screen.set_visible_area(0, 767, 0, 311);
216
217214   // draw text
218215   m_crtc->screen_update(screen, bitmap, cliprect);
219216
shelves/new_menus/src/mess/video/abc806.c
r29302r29303
2020
2121
2222
23// these are needed because the MC6845 emulation does
24// not position the active display area correctly
2523#define HORIZONTAL_PORCH_HACK   109
2624#define VERTICAL_PORCH_HACK     27
2725
2826
29static const rgb_t PALETTE_ABC[] =
30{
31   rgb_t::black, // black
32   rgb_t(0xff, 0x00, 0x00), // red
33   rgb_t(0x00, 0xff, 0x00), // green
34   rgb_t(0xff, 0xff, 0x00), // yellow
35   rgb_t(0x00, 0x00, 0xff), // blue
36   rgb_t(0xff, 0x00, 0xff), // magenta
37   rgb_t(0x00, 0xff, 0xff), // cyan
38   rgb_t::white // white
39};
4027
41
4228//-------------------------------------------------
4329//  hrs_w - high resolution memory banking
4430//-------------------------------------------------
r29302r29303
8268
8369READ8_MEMBER( abc806_state::charram_r )
8470{
85   m_attr_data = m_color_ram[offset];
71   m_attr_data = m_attr_ram[offset];
8672
8773   return m_char_ram[offset];
8874}
r29302r29303
9480
9581WRITE8_MEMBER( abc806_state::charram_w )
9682{
97   m_color_ram[offset] = m_attr_data;
83   m_attr_ram[offset] = m_attr_data;
9884
9985   m_char_ram[offset] = data;
10086}
r29302r29303
239225static MC6845_UPDATE_ROW( abc806_update_row )
240226{
241227   abc806_state *state = device->machine().driver_data<abc806_state>();
228   const pen_t *pen = state->m_palette->pens();
242229
243230//  UINT8 old_data = 0xff;
244231   int fg_color = 7;
r29302r29303
254241   for (int column = 0; column < x_count; column++)
255242   {
256243      UINT8 data = state->m_char_ram[(ma + column) & 0x7ff];
257      UINT8 attr = state->m_color_ram[(ma + column) & 0x7ff];
244      UINT8 attr = state->m_attr_ram[(ma + column) & 0x7ff];
258245      UINT16 rad_addr;
259246      UINT8 rad_data;
260247
r29302r29303
283270            e6 = BIT(attr, 1);
284271
285272            // read attributes from next byte
286            attr = state->m_color_ram[(ma + column + 1) & 0x7ff];
273            attr = state->m_attr_ram[(ma + column + 1) & 0x7ff];
287274
288275            if (attr != 0x00)
289276            {
r29302r29303
327314         int color = BIT(chargen_data, 7) ? fg_color : bg_color;
328315         if (!de) color = 0;
329316
330         bitmap.pix32(y, x++) = PALETTE_ABC[color];
317         bitmap.pix32(y, x++) = pen[color];
331318
332319         if (e5 || e6)
333320         {
334            bitmap.pix32(y, x++) = PALETTE_ABC[color];
321            bitmap.pix32(y, x++) = pen[color];
335322         }
336323
337324         chargen_data <<= 1;
r29302r29303
431418
432419void abc806_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect)
433420{
421   const pen_t *pen = m_palette->pens();
422
434423   UINT32 addr = (m_hrs & 0x0f) << 15;
435424
436425   for (int y = m_sync + VERTICAL_PORCH_HACK; y < MIN(cliprect.max_y + 1, m_sync + VERTICAL_PORCH_HACK + 240); y++)
r29302r29303
446435
447436            if (BIT(dot, 15) || (bitmap.pix32(y, x) == rgb_t::black))
448437            {
449               bitmap.pix32(y, x) = PALETTE_ABC[(dot >> 12) & 0x07];
438               bitmap.pix32(y, x) = pen[(dot >> 12) & 0x07];
450439            }
451440
452441            dot <<= 4;
r29302r29303
471460
472461   // allocate memory
473462   m_char_ram.allocate(ABC806_CHAR_RAM_SIZE);
474   m_color_ram = auto_alloc_array(machine(), UINT8, ABC806_ATTR_RAM_SIZE);
463   m_attr_ram.allocate(ABC806_ATTR_RAM_SIZE);
475464
476465   // register for state saving
477   save_pointer(NAME(m_char_ram.target()), ABC806_CHAR_RAM_SIZE);
478   save_pointer(NAME(m_color_ram), ABC806_ATTR_RAM_SIZE);
479   save_pointer(NAME(m_video_ram.target()), ABC806_VIDEO_RAM_SIZE);
480466   save_item(NAME(m_txoff));
481467   save_item(NAME(m_40));
482468   save_item(NAME(m_flshclk_ctr));
r29302r29303
499485
500486UINT32 abc806_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
501487{
502   // HACK expand visible area to workaround MC6845
503   screen.set_visible_area(0, 767, 0, 311);
504
505488   // clear screen
506489   bitmap.fill(rgb_t::black, cliprect);
507490
r29302r29303
519502
520503
521504//-------------------------------------------------
505//  PALETTE_INIT( abc806 )
506//-------------------------------------------------
507
508PALETTE_INIT_MEMBER( abc806_state, abc806 )
509{
510   palette.set_pen_color(0, rgb_t(0x00, 0x00, 0x00)); // black
511   palette.set_pen_color(1, rgb_t(0xff, 0x00, 0x00)); // red
512   palette.set_pen_color(2, rgb_t(0x00, 0xff, 0x00)); // green
513   palette.set_pen_color(3, rgb_t(0xff, 0xff, 0x00)); // yellow
514   palette.set_pen_color(4, rgb_t(0x00, 0x00, 0xff)); // blue
515   palette.set_pen_color(5, rgb_t(0xff, 0x00, 0xff)); // magenta
516   palette.set_pen_color(6, rgb_t(0x00, 0xff, 0xff)); // cyan
517   palette.set_pen_color(7, rgb_t(0xff, 0xff, 0xff)); // white
518}
519
520
521//-------------------------------------------------
522522//  MACHINE_CONFIG_FRAGMENT( abc806_video )
523523//-------------------------------------------------
524524
r29302r29303
527527
528528   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
529529   MCFG_SCREEN_UPDATE_DRIVER(abc806_state, screen_update)
530
531530   MCFG_SCREEN_REFRESH_RATE(60)
532531   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
533532   MCFG_SCREEN_SIZE(768, 312)
534533   MCFG_SCREEN_VISIBLE_AREA(0, 768-1, 0, 312-1)
534
535   MCFG_PALETTE_ADD("palette", 8)
536   MCFG_PALETTE_INIT_OWNER(abc806_state, abc806)
535537MACHINE_CONFIG_END
shelves/new_menus/src/mess/video/a7800.c
r29302r29303
126126   int x, d, c, i, pixel_cell, cells;
127127   int maria_cycles;
128128
129   //maria_cycles = 0;
130129     if ( m_maria_offset == 0 )
131130             maria_cycles = 5+19; // DMA startup + last line shutdown
132131    else
r29302r29303
173172         if (ind)
174173         {
175174            c = READ_MEM(graph_adr + x) & 0xFF;
176            maria_cycles += 3;
177175            data_addr = (m_maria_charbase | c) + (m_maria_offset << 8);
178176            if (is_holey(data_addr))
179177               continue;
178            maria_cycles += 3;
180179            if( m_maria_cwidth ) // two data bytes per map byte
181180            {
182181               cells = write_line_ram(data_addr, hpos, pal);
r29302r29303
262261   if (frame_scanline == 16)
263262      m_maria_vblank = 0x00;
264263
265   if ( frame_scanline == ( m_lines - 4 ) )
264   if ( frame_scanline == ( m_lines - 5 ) )
266265   {
267266      m_maria_vblank = 0x80;
268267   }
r29302r29303
286285      m_maria_offset = READ_MEM(m_maria_dll) & 0x0f;
287286      m_maria_holey = (READ_MEM(m_maria_dll) & 0x60) >> 5;
288287      m_maria_nmi = READ_MEM(m_maria_dll) & 0x80;
289      m_maincpu->eat_cycles(6); // 24 Maria cycles minimum (DMA startup + shutdown list-list fetch)
290288      /*  logerror("DLL=%x\n",m_maria_dll); */
291289   }
292290
293291
294   if( ( frame_scanline > 15 ) && (frame_scanline < (m_lines - 4)) && m_maria_dmaon )
292   if( ( frame_scanline > 15 ) && (frame_scanline < (m_lines - 5)) && m_maria_dmaon )
295293   {
296294      maria_draw_scanline();
297295
r29302r29303
301299         m_maria_dl = (READ_MEM(m_maria_dll+1) << 8) | READ_MEM(m_maria_dll+2);
302300         m_maria_offset = READ_MEM(m_maria_dll) & 0x0f;
303301         m_maria_holey = (READ_MEM(m_maria_dll) & 0x60) >> 5;
304         m_maincpu->eat_cycles(5); // 20 Maria cycles (DMA startup + shutdown)
305302         if ( READ_MEM(m_maria_dll & 0x10) )
306303            logerror("dll bit 5 set!\n");
307304         m_maria_nmi = READ_MEM(m_maria_dll) & 0x80;
Property changes on: shelves/new_menus
Modified: svn:mergeinfo
   Merged /trunk:r29140-29152

Previous 199869 Revisions Next


© 1997-2024 The MAME Team