Previous 15994 Revisions Next

r2202 Tuesday 1st April, 2008 at 17:51:00 UTC by Firewave
Removed more unnecessary machine->pens lookups
[src/mess/drivers]exelv.c
[src/mess/video]spectrum.c ssystem3.c ted7360.c thomson.c ti85.c tms3556.c tms3556.h vc4000.c vdc8563.c

src/mess/video/thomson.c
r2201r2202
416416
417417
418418
419typedef void ( *thom_scandraw ) ( running_machine *machine, UINT8* vram, UINT16* dst, UINT16* pal,
419typedef void ( *thom_scandraw ) ( UINT8* vram, UINT16* dst, UINT16* pal,
420420              int org, int len );
421421
422422
423423
424424#define UPDATE( name, res )                  \
425   static void name##_scandraw_##res ( running_machine *machine, UINT8* vram, UINT16* dst,   UINT16* pal, \
425   static void name##_scandraw_##res ( UINT8* vram, UINT16* dst,   UINT16* pal, \
426426                   int org, int len )      \
427427   {                        \
428428      unsigned gpl;                  \
r2201r2202
446446{
447447   int i;
448448   pen_t c[2];
449   c[0] = machine->pens[ pal[ ((ramb & 7) | ((ramb>>4) & 8)) ^ 8 ] ];
450   c[1] = machine->pens[ pal[ ((ramb >> 3) & 15) ^ 8 ] ];
449   c[0] = pal[ ((ramb & 7) | ((ramb>>4) & 8)) ^ 8 ];
450   c[1] = pal[ ((ramb >> 3) & 15) ^ 8 ];
451451   for ( i = 0; i < 16; i += 2, rama >>= 1 )
452452      dst[ 15 - i ] = dst[ 14 - i ] = c[ rama & 1 ];
453453}
r2201r2202
457457{
458458   int i;
459459   pen_t c[2];
460   c[0] = machine->pens[ pal[ ((ramb & 7) | ((ramb>>4) & 8)) ^ 8 ] ];
461   c[1] = machine->pens[ pal[ ((ramb >> 3) & 15) ^ 8 ] ];
460   c[0] = pal[ ((ramb & 7) | ((ramb>>4) & 8)) ^ 8 ];
461   c[1] = pal[ ((ramb >> 3) & 15) ^ 8 ];
462462   for ( i = 0; i < 8; i++, rama >>= 1 )
463463      dst[ 7 - i ] = c[ rama & 1 ];
464464}
r2201r2202
472472{
473473   int i;
474474   pen_t c[2];
475   c[0] = machine->pens[ pal[ ramb & 15 ] ];
476   c[1] = machine->pens[ pal[ ramb >> 4 ] ];
475   c[0] = pal[ ramb & 15 ];
476   c[1] = pal[ ramb >> 4 ];
477477   for ( i = 0; i < 16; i += 2, rama >>= 1 )
478478      dst[ 15 - i ] = dst[ 14 - i ] = c[ rama & 1 ];
479479}
r2201r2202
483483{
484484   int i;
485485   pen_t c[2];
486   c[0] = machine->pens[ pal[ ramb & 15 ] ];
487   c[1] = machine->pens[ pal[ ramb >> 4 ] ];
486   c[0] = pal[ ramb & 15 ];
487   c[1] = pal[ ramb >> 4 ];
488488   for ( i = 0; i < 8; i++, rama >>= 1 )
489489      dst[ 7 - i ] = c[ rama & 1 ];
490490}
r2201r2202
498498{
499499   int i;
500500   pen_t c[2];
501   c[0] = machine->pens[ pal[ (ramb & 7) | ((ramb>>4) & 8) ] ];
502   c[1] = machine->pens[ pal[ (ramb >> 3) & 15 ] ];
501   c[0] = pal[ (ramb & 7) | ((ramb>>4) & 8) ];
502   c[1] = pal[ (ramb >> 3) & 15 ];
503503   for ( i = 0; i < 16; i += 2, rama >>= 1 )
504504      dst[ 15 - i ] = dst[ 14 - i ] = c[ rama & 1 ];
505505}
r2201r2202
509509{
510510   int i;
511511   pen_t c[2];
512   c[0] = machine->pens[ pal[ (ramb & 7) | ((ramb>>4) & 8) ] ];
513   c[1] = machine->pens[ pal[ (ramb >> 3) & 15 ] ];
512   c[0] = pal[ (ramb & 7) | ((ramb>>4) & 8) ];
513   c[1] = pal[ (ramb >> 3) & 15 ];
514514   for ( i = 0; i < 8; i++, rama >>= 1 )
515515      dst[ 7 - i ] = c[ rama & 1 ];
516516}
r2201r2202
524524{
525525   int i;
526526   pen_t c[2][2];
527   c[0][0] = machine->pens[ pal[ 0 ] ];
528   c[0][1] = machine->pens[ pal[ 1 ] ];
529   c[1][0] = machine->pens[ pal[ 2 ] ];
530   c[1][1] = machine->pens[ pal[ 3 ] ];
527   c[0][0] = pal[ 0 ];
528   c[0][1] = pal[ 1 ];
529   c[1][0] = pal[ 2 ];
530   c[1][1] = pal[ 3 ];
531531   for ( i = 0; i < 16; i += 2, rama >>= 1, ramb >>= 1 )
532532      dst[ 15 - i ] =  dst[ 14 - i ] = c[ rama & 1 ] [ ramb & 1 ];
533533}
r2201r2202
537537{
538538   int i;
539539   pen_t c[2][2];
540   c[0][0] = machine->pens[ pal[ 0 ] ];
541   c[0][1] = machine->pens[ pal[ 1 ] ];
542   c[1][0] = machine->pens[ pal[ 2 ] ];
543   c[1][1] = machine->pens[ pal[ 3 ] ];
540   c[0][0] = pal[ 0 ];
541   c[0][1] = pal[ 1 ];
542   c[1][0] = pal[ 2 ];
543   c[1][1] = pal[ 3 ];
544544   for ( i = 0; i < 8; i++, rama >>= 1, ramb >>= 1 )
545545      dst[ 7 - i ] = c[ rama & 1 ] [ ramb & 1 ];
546546}
r2201r2202
554554{
555555   int i;
556556   pen_t c[4];
557   c[0] = machine->pens[ pal[ 0 ] ];
558   c[1] = machine->pens[ pal[ 1 ] ];
559   c[2] = machine->pens[ pal[ 2 ] ];
560   c[3] = machine->pens[ pal[ 3 ] ];
557   c[0] = pal[ 0 ];
558   c[1] = pal[ 1 ];
559   c[2] = pal[ 2 ];
560   c[3] = pal[ 3 ];
561561   for ( i = 0; i < 8; i += 2, ramb >>= 2 )
562562      dst[ 15 - i ] = dst[ 14 - i ] = c[ ramb & 3 ];
563563   for ( i = 0; i < 8; i += 2, rama >>= 2 )
r2201r2202
569569{
570570   int i;
571571   pen_t c[4];
572   c[0] = machine->pens[ pal[ 0 ] ];
573   c[1] = machine->pens[ pal[ 1 ] ];
574   c[2] = machine->pens[ pal[ 2 ] ];
575   c[3] = machine->pens[ pal[ 3 ] ];
572   c[0] = pal[ 0 ];
573   c[1] = pal[ 1 ];
574   c[2] = pal[ 2 ];
575   c[3] = pal[ 3 ];
576576   for ( i = 0; i < 4; i++, ramb >>= 2 )
577577      dst[ 7 - i ] = c[ ramb & 3 ];
578578   for ( i = 0; i < 4; i++, rama >>= 2 )
r2201r2202
586586
587587UPDATE_HI( bitmap16 )
588588{
589   dst[ 0] = dst[ 1] = dst[ 2] = dst[ 3] = machine->pens[ pal[ rama >> 4 ] ];
590   dst[ 4] = dst[ 5] = dst[ 6] = dst[ 7] = machine->pens[ pal[ rama & 15 ] ];
591   dst[ 8] = dst[ 9] = dst[10] = dst[11] = machine->pens[ pal[ ramb >> 4 ] ];
592   dst[12] = dst[13] = dst[14] = dst[15] = machine->pens[ pal[ ramb & 15 ] ];
589   dst[ 0] = dst[ 1] = dst[ 2] = dst[ 3] = pal[ rama >> 4 ];
590   dst[ 4] = dst[ 5] = dst[ 6] = dst[ 7] = pal[ rama & 15 ];
591   dst[ 8] = dst[ 9] = dst[10] = dst[11] = pal[ ramb >> 4 ];
592   dst[12] = dst[13] = dst[14] = dst[15] = pal[ ramb & 15 ];
593593}
594594END_UPDATE
595595
596596UPDATE_LOW( bitmap16 )
597597{
598   dst[0] = dst[1] = machine->pens[ pal[ rama >> 4 ] ];
599   dst[2] = dst[3] = machine->pens[ pal[ rama & 15 ] ];
600   dst[4] = dst[5] = machine->pens[ pal[ ramb >> 4 ] ];
601   dst[6] = dst[7] = machine->pens[ pal[ ramb & 15 ] ];
598   dst[0] = dst[1] = pal[ rama >> 4 ];
599   dst[2] = dst[3] = pal[ rama & 15 ];
600   dst[4] = dst[5] = pal[ ramb >> 4 ];
601   dst[6] = dst[7] = pal[ ramb & 15 ];
602602}
603603END_UPDATE
604604
r2201r2202
610610{
611611   int i;
612612   pen_t c[2];
613   c[0] = machine->pens[ pal[ 0 ] ];
614   c[1] = machine->pens[ pal[ 1 ] ];
613   c[0] = pal[ 0 ];
614   c[1] = pal[ 1 ];
615615   for ( i = 0; i < 8; i++, ramb >>= 1 )
616616      dst[ 15 - i ] = c[ ramb & 1 ];
617617   for ( i = 0; i < 8; i++, rama >>= 1 )
r2201r2202
624624   /* 640-pixel mode but 320 pixels emulated => we merge pixels */
625625   int i;
626626   pen_t c[4];
627   c[0] = machine->pens[ pal[ 0 ] ];
628   c[1] = c[2] = c[3] = machine->pens[ pal[ 1 ] ];
627   c[0] = pal[ 0 ];
628   c[1] = c[2] = c[3] = pal[ 1 ];
629629   for ( i = 0; i < 4; i++, ramb >>= 2 )
630630      dst[ 7 - i ] = c[ ramb & 3 ];
631631   for ( i = 0; i < 4; i++, rama >>= 2 )
r2201r2202
641641{
642642   int i;
643643   pen_t c[2];
644   c[0] = machine->pens[ pal[ 0 ] ];
645   c[1] = machine->pens[ pal[ 6 ] ];
644   c[0] = pal[ 0 ];
645   c[1] = pal[ 6 ];
646646   for ( i = 0; i < 8; i++, ramb >>= 1 )
647647      dst[ 15 - i ] = c[ ramb & 1 ];
648648   for ( i = 0; i < 8; i++, rama >>= 1 )
r2201r2202
654654{
655655   int i;
656656   pen_t c[4];
657   c[0] = machine->pens[ pal[ 0 ] ];
658   c[1] = c[2] = c[3] = machine->pens[ pal[ 6 ] ];
657   c[0] = pal[ 0 ];
658   c[1] = c[2] = c[3] = pal[ 6 ];
659659   for ( i = 0; i < 4; i++, ramb >>= 2 )
660660      dst[ 7 - i ] = c[ ramb & 3 ];
661661   for ( i = 0; i < 4; i++, rama >>= 2 )
r2201r2202
671671{
672672   int i;
673673   pen_t c[2];
674   c[0] = machine->pens[ pal[ 0 ] ];
675   c[1] = machine->pens[ pal[ 1 ] ];
674   c[0] = pal[ 0 ];
675   c[1] = pal[ 1 ];
676676   for ( i = 0; i < 16; i += 2, rama >>= 1 )
677677      dst[ 15 - i ] = dst[ 14 - i ] = c[ rama & 1 ];
678678   (void)ramb;
r2201r2202
683683{
684684   int i;
685685   pen_t c[2];
686   c[0] = machine->pens[ pal[ 0 ] ];
687   c[1] = machine->pens[ pal[ 1 ] ];
686   c[0] = pal[ 0 ];
687   c[1] = pal[ 1 ];
688688   for ( i = 0; i < 8; i++, rama >>= 1 )
689689      dst[ 7 - i ] = c[ rama & 1 ];
690690   (void)ramb;
r2201r2202
695695{
696696   int i;
697697   pen_t c[2];
698   c[0] = machine->pens[ pal[ 0 ] ];
699   c[1] = machine->pens[ pal[ 2 ] ];
698   c[0] = pal[ 0 ];
699   c[1] = pal[ 2 ];
700700   for ( i = 0; i < 16; i += 2, ramb >>= 1 )
701701      dst[ 15 - i ] = dst[ 14 - i ] = c[ ramb & 1 ];
702702   (void)rama;
r2201r2202
707707{
708708   int i;
709709   pen_t c[2];
710   c[0] = machine->pens[ pal[ 0 ] ];
711   c[1] = machine->pens[ pal[ 2 ] ];
710   c[0] = pal[ 0 ];
711   c[1] = pal[ 2 ];
712712   for ( i = 0; i < 8; i++, ramb >>= 1 )
713713      dst[ 7 - i ] = c[ ramb & 1 ];
714714   (void)rama;
r2201r2202
723723{
724724   int i;
725725   pen_t c[2][2];
726   c[0][0] = machine->pens[ pal[ 0 ] ];
727   c[0][1] = c[1][1] = machine->pens[ pal[ 1 ] ];
728   c[1][0] = machine->pens[ pal[ 2 ] ];
726   c[0][0] = pal[ 0 ];
727   c[0][1] = c[1][1] = pal[ 1 ];
728   c[1][0] = pal[ 2 ];
729729   for ( i = 0; i < 16; i += 2, rama >>= 1, ramb >>= 1 )
730730      dst[ 15 - i ] =  dst[ 14 - i ] = c[ ramb & 1 ] [ rama & 1 ];
731731}
r2201r2202
735735{
736736   int i;
737737   pen_t c[2][2];
738   c[0][0] = machine->pens[ pal[ 0 ] ];
739   c[0][1] = c[1][1] = machine->pens[ pal[ 1 ] ];
740   c[1][0] = machine->pens[ pal[ 2 ] ];
738   c[0][0] = pal[ 0 ];
739   c[0][1] = c[1][1] = pal[ 1 ];
740   c[1][0] = pal[ 2 ];
741741   for ( i = 0; i < 8; i++, rama >>= 1, ramb >>= 1 )
742742      dst[ 7 - i ] = c[ ramb & 1 ] [ rama & 1 ];
743743}
r2201r2202
755755   int i;
756756   for ( i = 0; i < 16; i += 4, rama >>= 1, ramb >>= 1 )
757757      dst[ 15 - i ] = dst[ 14 - i ] = dst[ 13 - i ] = dst[ 12 - i ] =
758         machine->pens[ pal[ p[ ramb & 1 ] [ (ramb >> 4) & 1 ]
759                   [ rama & 1 ] [ (rama >> 4) & 1 ] ] ];
758         pal[ p[ ramb & 1 ] [ (ramb >> 4) & 1 ]
759                   [ rama & 1 ] [ (rama >> 4) & 1 ] ];
760760}
761761END_UPDATE
762762
r2201r2202
768768   int i;
769769   for ( i = 0; i < 8; i += 2, rama >>= 1, ramb >>= 1 )
770770      dst[ 7 - i ] = dst[ 6 - i ] =
771         machine->pens[ pal[ p[ ramb & 1 ] [ (ramb >> 4) & 1 ]
772                   [ rama & 1 ] [ (rama >> 4) & 1 ] ] ];
771         pal[ p[ ramb & 1 ] [ (ramb >> 4) & 1 ]
772                   [ rama & 1 ] [ (rama >> 4) & 1 ] ];
773773}
774774END_UPDATE
775775
r2201r2202
810810            xx++;
811811         } while ( xx < 40 && thom_vmodepage[xx] == -1 );
812812         thom_scandraw_funcs[ mode ][ thom_hires ]
813            ( machine, thom_vram + y * 40 + page * 0x4000,
813            ( thom_vram + y * 40 + page * 0x4000,
814814              thom_vbody + y * 320 * (thom_hires+1),
815815              thom_last_pal, x, xx-x );
816816         x = xx;
r2201r2202
906906   const int yup = THOM_BORDER_HEIGHT + THOM_ACTIVE_HEIGHT;
907907   const int ybot = THOM_BORDER_HEIGHT + thom_bheight + 200;
908908   UINT16* v = thom_vbody;
909   pen_t border = screen->machine->pens[ 0 ];
909   pen_t border = 0;
910910   rectangle wrect = { 0, xright - 1, 0, 0 };
911911   rectangle lrect = { 0, xbleft - 1, 0, 0 };
912912   rectangle rrect = { xbright, xright - 1, 0, 0 };
r2201r2202
917917   for ( y = 0; y < THOM_BORDER_HEIGHT - thom_bheight; y++ )
918918   {
919919      if ( thom_border_l[ y ] != -1 )
920         border = screen->machine->pens[ thom_border_l[ y ] ];
920         border = thom_border_l[ y ];
921921   }
922922   ypos = 0;
923923   while ( y < THOM_BORDER_HEIGHT )
924924   {
925925      if ( thom_border_l[ y ] != -1 )
926         border = screen->machine->pens[ thom_border_l[ y ] ];
926         border = thom_border_l[ y ];
927927      wrect.min_y = ypos;
928928      do
929929      {
r2201r2202
939939   while ( y < yup )
940940   {
941941      if ( thom_border_l[ y ] != -1 )
942         border = screen->machine->pens[ thom_border_l[ y ] ];
942         border = thom_border_l[ y ];
943943      lrect.min_y = ypos;
944944      do
945945      {
r2201r2202
955955   while (y < ybot )
956956   {
957957      if ( thom_border_l[ y ] != -1 )
958         border = screen->machine->pens[ thom_border_l[ y ] ];
958         border = thom_border_l[ y ];
959959      wrect.min_y = ypos;
960960      do
961961      {
r2201r2202
969969   /* right border */
970970   for ( y = 0; y < THOM_BORDER_HEIGHT; y++ ) {
971971      if ( thom_border_r[ y ] != -1 )
972         border = screen->machine->pens[ thom_border_r[ y ] ];
972         border = thom_border_r[ y ];
973973   }
974974   ypos = thom_bheight /* * scale */;
975975   while ( y < yup )
976976   {
977977      if ( thom_border_r[ y ] != -1 )
978         border = screen->machine->pens[ thom_border_r[ y ] ];
978         border = thom_border_r[ y ];
979979      rrect.min_y = ypos;
980980      do
981981      {
src/mess/video/spectrum.c
r2201r2202
301301                        for (b=0x80;b!=0;b>>=1)
302302                        {
303303                                if (*scr&b)
304                                        spectrum_plot_pixel(bitmap,scrx++,SPEC_TOP_BORDER+scry,screen->machine->pens[ink]);
304                                        spectrum_plot_pixel(bitmap,scrx++,SPEC_TOP_BORDER+scry,ink);
305305                                else
306                                        spectrum_plot_pixel(bitmap,scrx++,SPEC_TOP_BORDER+scry,screen->machine->pens[pap]);
306                                        spectrum_plot_pixel(bitmap,scrx++,SPEC_TOP_BORDER+scry,pap);
307307         }
308308                scr++;
309309                attr++;
r2201r2202
341341 *******************************************************************/
342342
343343/* Draw a scanline in TS2068/TC2048 hires mode (code modified from COUPE.C) */
344static void ts2068_hires_scanline(running_machine *machine, bitmap_t *bitmap, int y, int borderlines)
344static void ts2068_hires_scanline(bitmap_t *bitmap, int y, int borderlines)
345345{
346346   int x,b,scrx,scry;
347347   unsigned short ink,pap;
r2201r2202
371371      {
372372                        if (*scr&b)
373373         {
374                                spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[ink]);
375                                spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[ink]);
374                                spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,ink);
375                                spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,ink);
376376         }
377377         else
378378         {
379                                spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[pap]);
380                                spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[pap]);
379                                spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,pap);
380                                spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,pap);
381381         }
382382      }
383383                scr++;
r2201r2202
386386}
387387
388388/* Draw a scanline in TS2068/TC2048 64-column mode */
389static void ts2068_64col_scanline(running_machine *machine, bitmap_t *bitmap, int y, int borderlines, unsigned short inkcolor)
389static void ts2068_64col_scanline(bitmap_t *bitmap, int y, int borderlines, unsigned short inkcolor)
390390{
391391   int x,b,scrx,scry;
392392        unsigned char *scr1, *scr2;
r2201r2202
402402      for (b=0x80;b!=0;b>>=1)
403403      {
404404                        if (*scr1&b)
405                                spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[inkcolor]);
405                                spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,inkcolor);
406406         else
407                                spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[7-inkcolor]);
407                                spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,7-inkcolor);
408408      }
409409                scr1++;
410410
411411      for (b=0x80;b!=0;b>>=1)
412412      {
413413                        if (*scr2&b)
414                                spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[inkcolor]);
414                                spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,inkcolor);
415415         else
416                                spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[7-inkcolor]);
416                                spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,7-inkcolor);
417417      }
418418                scr2++;
419419   }
420420}
421421
422422/* Draw a scanline in TS2068/TC2048 lores (normal Spectrum) mode */
423static void ts2068_lores_scanline(running_machine *machine, bitmap_t *bitmap, int y, int borderlines, int screen)
423static void ts2068_lores_scanline(bitmap_t *bitmap, int y, int borderlines, int screen)
424424{
425425   int x,b,scrx,scry;
426426   unsigned short ink,pap;
r2201r2202
450450      {
451451         if (*scr&b)
452452         {
453            spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[ink]);
454            spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[ink]);
453            spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,ink);
454            spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,ink);
455455         }
456456         else
457457         {
458            spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[pap]);
459            spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[pap]);
458            spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,pap);
459            spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,pap);
460460         }
461461      }
462462      scr++;
r2201r2202
475475                /* 64 Column mode */
476476                unsigned short inkcolor = (ts2068_port_ff_data & 0x38) >> 3;
477477                for (count = 0; count < 192; count++)
478                        ts2068_64col_scanline(screen->machine, bitmap, count, TS2068_TOP_BORDER, inkcolor);
478                        ts2068_64col_scanline(bitmap, count, TS2068_TOP_BORDER, inkcolor);
479479   }
480480        else if ((ts2068_port_ff_data & 7) == 2)
481481        {
482482                /* Extended Color mode */
483483                for (count = 0; count < 192; count++)
484                        ts2068_hires_scanline(screen->machine, bitmap, count, TS2068_TOP_BORDER);
484                        ts2068_hires_scanline(bitmap, count, TS2068_TOP_BORDER);
485485        }
486486        else if ((ts2068_port_ff_data & 7) == 1)
487487        {
488488                /* Screen 6000-7aff */
489489                for (count = 0; count < 192; count++)
490                        ts2068_lores_scanline(screen->machine, bitmap, count, TS2068_TOP_BORDER, 1);
490                        ts2068_lores_scanline(bitmap, count, TS2068_TOP_BORDER, 1);
491491        }
492492        else
493493        {
494494                /* Screen 4000-5aff */
495495                for (count = 0; count < 192; count++)
496                        ts2068_lores_scanline(screen->machine, bitmap, count, TS2068_TOP_BORDER, 0);
496                        ts2068_lores_scanline(bitmap, count, TS2068_TOP_BORDER, 0);
497497        }
498498
499499        draw_border(screen->machine, bitmap, full_refresh,
r2201r2202
515515      /* 64 Column mode */
516516      unsigned short inkcolor = (ts2068_port_ff_data & 0x38) >> 3;
517517      for (count = 0; count < 192; count++)
518         ts2068_64col_scanline(screen->machine, bitmap, count, SPEC_TOP_BORDER, inkcolor);
518         ts2068_64col_scanline(bitmap, count, SPEC_TOP_BORDER, inkcolor);
519519   }
520520   else if ((ts2068_port_ff_data & 7) == 2)
521521   {
522522      /* Extended Color mode */
523523      for (count = 0; count < 192; count++)
524         ts2068_hires_scanline(screen->machine, bitmap, count, SPEC_TOP_BORDER);
524         ts2068_hires_scanline(bitmap, count, SPEC_TOP_BORDER);
525525   }
526526   else if ((ts2068_port_ff_data & 7) == 1)
527527   {
528528      /* Screen 6000-7aff */
529529      for (count = 0; count < 192; count++)
530         ts2068_lores_scanline(screen->machine, bitmap, count, SPEC_TOP_BORDER, 1);
530         ts2068_lores_scanline(bitmap, count, SPEC_TOP_BORDER, 1);
531531   }
532532   else
533533   {
534534      /* Screen 4000-5aff */
535535      for (count = 0; count < 192; count++)
536         ts2068_lores_scanline(screen->machine, bitmap, count, SPEC_TOP_BORDER, 0);
536         ts2068_lores_scanline(bitmap, count, SPEC_TOP_BORDER, 0);
537537   }
538538
539539   draw_border(screen->machine, bitmap, full_refresh,
src/mess/video/vdc8563.c
r2201r2202
432432               if (k>0)
433433                  plot_box(bitmap, machine->gfx[0]->width*x+8,
434434                         height*y+height+CRTC6845_CURSOR_TOP,
435                         machine->gfx[0]->width, k, machine->pens[FRAMECOLOR]);
435                         machine->gfx[0]->width, k, FRAMECOLOR);
436436            }
437437
438438            vdc.dirty[i]=0;
r2201r2202
491491               if (k>0)
492492                  plot_box(bitmap, machine->gfx[0]->width*x+8,
493493                         height*y+height+CRTC6845_CURSOR_TOP,
494                         machine->gfx[0]->width, k, machine->pens[0x10|(vdc.ram[j]&0xf)]);
494                         machine->gfx[0]->width, k, 0x10|(vdc.ram[j]&0xf));
495495            }
496496
497497            vdc.dirty[i]=0;
r2201r2202
570570      int h=CRTC6845_CHAR_LINES;
571571      int height=CRTC6845_CHAR_HEIGHT;
572572
573      plot_box(bitmap, 0, 0, screen->machine->gfx[0]->width*(w+2), height, screen->machine->pens[FRAMECOLOR]);
573      plot_box(bitmap, 0, 0, screen->machine->gfx[0]->width*(w+2), height, FRAMECOLOR);
574574
575      plot_box(bitmap, 0, height, screen->machine->gfx[0]->width, height*h, screen->machine->pens[FRAMECOLOR]);
575      plot_box(bitmap, 0, height, screen->machine->gfx[0]->width, height*h, FRAMECOLOR);
576576
577577      plot_box(bitmap, screen->machine->gfx[0]->width*(w+1), height, screen->machine->gfx[0]->width, height*h,
578             screen->machine->pens[FRAMECOLOR]);
578             FRAMECOLOR);
579579
580580      plot_box(bitmap, 0, height*(h+1), screen->machine->gfx[0]->width*(w+2), height,
581             screen->machine->pens[FRAMECOLOR]);
581             FRAMECOLOR);
582582   }
583583
584584   vdc.changed=0;
src/mess/video/ssystem3.c
r2201r2202
8787        "  dddddddddddd"
8888};
8989
90static void ssystem3_draw_7segment(running_machine *machine, bitmap_t *bitmap,int value, int x, int y)
90static void ssystem3_draw_7segment(bitmap_t *bitmap,int value, int x, int y)
9191{
9292   int i, xi, yi, mask, color;
9393
r2201r2202
108108      }
109109
110110      if (mask!=0) {
111         color=machine->pens[(value&mask)?1:0];
111         color=(value&mask)?1:0;
112112         *BITMAP_ADDR16(bitmap, y+yi, x+xi) = color;
113113      }
114114      if (led[i]!='\r') xi++;
r2201r2202
193193   int i;
194194
195195   for (i=0; i<4; i++) {
196      ssystem3_draw_7segment(screen->machine, bitmap, ssystem3_lcd.data[1+i], ssystem3_led_pos[i].x, ssystem3_led_pos[i].y);
196      ssystem3_draw_7segment(bitmap, ssystem3_lcd.data[1+i], ssystem3_led_pos[i].x, ssystem3_led_pos[i].y);
197197   }
198198
199   ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&1?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '0'); //?
200   ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&2?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '5');
201   ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&4?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '7');
202   ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&8?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, 'b');
203   ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&0x10?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '9');
204   ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&0x20?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '8');
205   ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&0x40?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, 'c');
206   ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&0x80?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '6');
207   ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[1]&1?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '2');
208   ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[2]&1?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '1'); //?
209   ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[3]&1?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '3');
210   ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[4]&1?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '4');
199   ssystem3_draw_led(bitmap, ssystem3_lcd.data[0]&1?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '0'); //?
200   ssystem3_draw_led(bitmap, ssystem3_lcd.data[0]&2?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '5');
201   ssystem3_draw_led(bitmap, ssystem3_lcd.data[0]&4?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '7');
202   ssystem3_draw_led(bitmap, ssystem3_lcd.data[0]&8?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, 'b');
203   ssystem3_draw_led(bitmap, ssystem3_lcd.data[0]&0x10?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '9');
204   ssystem3_draw_led(bitmap, ssystem3_lcd.data[0]&0x20?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '8');
205   ssystem3_draw_led(bitmap, ssystem3_lcd.data[0]&0x40?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, 'c');
206   ssystem3_draw_led(bitmap, ssystem3_lcd.data[0]&0x80?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '6');
207   ssystem3_draw_led(bitmap, ssystem3_lcd.data[1]&1?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '2');
208   ssystem3_draw_led(bitmap, ssystem3_lcd.data[2]&1?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '1'); //?
209   ssystem3_draw_led(bitmap, ssystem3_lcd.data[3]&1?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '3');
210   ssystem3_draw_led(bitmap, ssystem3_lcd.data[4]&1?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '4');
211211
212212   if (readinputportbytag("Configuration")&1) { // playfield(optional device)
213213     const int lcd_signs_on[]={
r2201r2202
227227         int xp=263+x*22;
228228         int yp=55+(y^7)*28;
229229         ssystem3_playfield_getfigure(x, y, &figure, &black);       
230         ssystem3_draw_led(bitmap, screen->machine->pens[lcd_signs_on[figure]&1?1:0], xp, yp, '6');
231         ssystem3_draw_led(bitmap, screen->machine->pens[lcd_signs_on[figure]&2?1:0], xp, yp, '8');
232         ssystem3_draw_led(bitmap, screen->machine->pens[lcd_signs_on[figure]&4?1:0], xp, yp, '9');
233         ssystem3_draw_led(bitmap, screen->machine->pens[lcd_signs_on[figure]&8?1:0], xp, yp, 'b');
234         ssystem3_draw_led(bitmap, screen->machine->pens[lcd_signs_on[figure]&0x10?1:0], xp, yp, 'c');
235         ssystem3_draw_led(bitmap, screen->machine->pens[figure!=0 && black?1:0], xp, yp, '7');
230         ssystem3_draw_led(bitmap, lcd_signs_on[figure]&1?1:0, xp, yp, '6');
231         ssystem3_draw_led(bitmap, lcd_signs_on[figure]&2?1:0, xp, yp, '8');
232         ssystem3_draw_led(bitmap, lcd_signs_on[figure]&4?1:0, xp, yp, '9');
233         ssystem3_draw_led(bitmap, lcd_signs_on[figure]&8?1:0, xp, yp, 'b');
234         ssystem3_draw_led(bitmap, lcd_signs_on[figure]&0x10?1:0, xp, yp, 'c');
235         ssystem3_draw_led(bitmap, figure!=0 && black?1:0, xp, yp, '7');
236236         
237237       }
238238     }
src/mess/video/tms3556.c
r2201r2202
307307   draw a line of text (called by tms3556_draw_line_text and
308308   tms3556_draw_line_mixed)
309309*/
310static void tms3556_draw_line_text_common(running_machine *machine, UINT16 *ln)
310static void tms3556_draw_line_text_common(UINT16 *ln)
311311{
312312   int pattern, x, xx, i, name_offset;
313313   UINT16 fg, bg;
r2201r2202
335335      name_lo = nametbl[name_offset+1];
336336      pattern_ix = ((name_hi >> 2) & 2) | ((name_hi >> 4) & 1);
337337      alphanumeric_mode = (pattern_ix < 2) || ((pattern_ix == 3) && !(vdp.controlRegs[7] & 0x08));
338      fg = machine->pens[(name_hi >> 5) & 0x7];
338      fg = (name_hi >> 5) & 0x7;
339339      if (alphanumeric_mode)
340340      {
341341         if (name_hi & 4)
r2201r2202
421421   draw a line of bitmap (called by tms3556_draw_line_bitmap and
422422   tms3556_draw_line_mixed)
423423*/
424static void tms3556_draw_line_bitmap_common(running_machine *machine, UINT16 *ln)
424static void tms3556_draw_line_bitmap_common(UINT16 *ln)
425425{
426426   int x, xx;
427427   UINT8 *nametbl;
r2201r2202
443443      name_r = nametbl[vdp.name_offset+2];
444444      for (xx=0;xx<8;xx++)
445445      {
446         UINT16 color = machine->pens[((name_b >> 5) & 0x4) | ((name_g >> 6) & 0x2) | ((name_r >> 7) & 0x1)];
446         UINT16 color = ((name_b >> 5) & 0x4) | ((name_g >> 6) & 0x2) | ((name_r >> 7) & 0x1);
447447#if DOUBLE_WIDTH
448448         *ln++ = color;
449449#endif
r2201r2202
467467
468468   draw a line in text mode
469469*/
470static void tms3556_draw_line_text(running_machine *machine, UINT16 *ln)
470static void tms3556_draw_line_text(UINT16 *ln)
471471{
472472   if (vdp.char_line_counter == 0)
473473      vdp.char_line_counter = 10;
474474   vdp.char_line_counter--;
475   tms3556_draw_line_text_common(machine, ln);
475   tms3556_draw_line_text_common(ln);
476476}
477477
478478/*
r2201r2202
480480
481481   draw a line in bitmap mode
482482*/
483static void tms3556_draw_line_bitmap(running_machine *machine, UINT16 *ln)
483static void tms3556_draw_line_bitmap(UINT16 *ln)
484484{
485485   UINT8 *nametbl;
486486
487487
488   tms3556_draw_line_bitmap_common(machine, ln);
488   tms3556_draw_line_bitmap_common(ln);
489489   nametbl = vdp.vram + vdp.addressRegs[2];
490   vdp.bg_color = machine->pens[(nametbl[vdp.name_offset] >> 5) & 0x7];
490   vdp.bg_color = (nametbl[vdp.name_offset] >> 5) & 0x7;
491491   vdp.name_offset += 2;
492492}
493493
r2201r2202
496496
497497   draw a line in mixed mode
498498*/
499static void tms3556_draw_line_mixed(running_machine *machine, UINT16 *ln)
499static void tms3556_draw_line_mixed(UINT16 *ln)
500500{
501501   UINT8 *nametbl;
502502
503503
504504   if (vdp.cg_flag)
505505   {   /* bitmap line */
506      tms3556_draw_line_bitmap_common(machine, ln);
506      tms3556_draw_line_bitmap_common(ln);
507507      nametbl = vdp.vram + vdp.addressRegs[2];
508      vdp.bg_color = machine->pens[(nametbl[vdp.name_offset] >> 5) & 0x7];
508      vdp.bg_color = (nametbl[vdp.name_offset] >> 5) & 0x7;
509509      vdp.cg_flag = (nametbl[vdp.name_offset] >> 4) & 0x1;
510510      vdp.name_offset += 2;
511511   }
r2201r2202
514514      if (vdp.char_line_counter == 0)
515515         vdp.char_line_counter = 10;
516516      vdp.char_line_counter--;
517      tms3556_draw_line_text_common(machine, ln);
517      tms3556_draw_line_text_common(ln);
518518      if (vdp.char_line_counter == 0)
519519      {
520520         nametbl = vdp.vram + vdp.addressRegs[2];
521         vdp.bg_color = machine->pens[(nametbl[vdp.name_offset] >> 5) & 0x7];
521         vdp.bg_color = (nametbl[vdp.name_offset] >> 5) & 0x7;
522522         vdp.cg_flag = (nametbl[vdp.name_offset] >> 4) & 0x1;
523523         vdp.name_offset += 2;
524524      }
r2201r2202
530530
531531   draw a line.  If non-interlaced mode, duplicate the line.
532532*/
533static void tms3556_draw_line(running_machine *machine, bitmap_t *bmp, int line)
533static void tms3556_draw_line(bitmap_t *bmp, int line)
534534{
535535   int double_lines;
536536   UINT16 *ln, *ln2 = NULL;
r2201r2202
560560         tms3556_draw_line_empty(ln);
561561         break;
562562      case TMS3556_MODE_TEXT:
563         tms3556_draw_line_text(machine, ln);
563         tms3556_draw_line_text(ln);
564564         break;
565565      case TMS3556_MODE_BITMAP:
566         tms3556_draw_line_bitmap(machine, ln);
566         tms3556_draw_line_bitmap(ln);
567567         break;
568568      case TMS3556_MODE_MIXED:
569         tms3556_draw_line_mixed(machine, ln);
569         tms3556_draw_line_mixed(ln);
570570         break;
571571      }
572572   }
r2201r2202
581581
582582   Do vblank-time tasks
583583*/
584static void tms3556_interrupt_start_vblank(running_machine *machine)
584static void tms3556_interrupt_start_vblank(void)
585585{
586586   int i;
587587
r2201r2202
598598      vdp.blink_count = 60;   /*no idea what the real value is*/
599599   }
600600   /* reset background color */
601   vdp.bg_color = machine->pens[(vdp.controlRegs[7] >> 5) & 0x7];
601   vdp.bg_color = (vdp.controlRegs[7] >> 5) & 0x7;
602602   /* reset name offset */
603603   vdp.name_offset = 0;
604604   /* reset character line counter */
r2201r2202
615615
616616   scanline handler
617617*/
618void tms3556_interrupt(running_machine *machine)
618void tms3556_interrupt()
619619{
620620   /* check for start of vblank */
621621   if (vdp.scanline == 310)   /*no idea what the real value is*/
622      tms3556_interrupt_start_vblank( machine );
622      tms3556_interrupt_start_vblank();
623623
624624   /* render the current line */
625625   if ((vdp.scanline >= 0) && (vdp.scanline < TOTAL_HEIGHT))
626626   {
627627      //if (!video_skip_this_frame())
628         tms3556_draw_line(machine, tmpbitmap, vdp.scanline);
628         tms3556_draw_line(tmpbitmap, vdp.scanline);
629629   }
630630
631631   if (++vdp.scanline == 313)
src/mess/video/ti85.c
r2201r2202
156156           for (y=0; y<ti_screen_y_size; y++)
157157         for (x=0; x<ti_screen_x_size; x++)
158158            for (b=0; b<8; b++)
159               *BITMAP_ADDR16(bitmap, y, x*8+b) = screen->machine->pens[ti85_colortable[ti85_LCD_contrast&0x1f][6]];
159               *BITMAP_ADDR16(bitmap, y, x*8+b) = ti85_colortable[ti85_LCD_contrast&0x1f][6];
160160      return 0;
161161   }
162162
r2201r2202
179179                 + ((*(ti85_frames+4*ti_video_memory_size+y*ti_screen_x_size+x)>>(7-b)) & 0x01)
180180                 + ((*(ti85_frames+5*ti_video_memory_size+y*ti_screen_x_size+x)>>(7-b)) & 0x01);
181181
182            *BITMAP_ADDR16(bitmap, y, x*8+b) = screen->machine->pens[ti85_colortable[ti85_LCD_contrast&0x1f][brightnes]];
182            *BITMAP_ADDR16(bitmap, y, x*8+b) = ti85_colortable[ti85_LCD_contrast&0x1f][brightnes];
183183                   }
184184   return 0;
185185}
src/mess/video/tms3556.h
r2201r2202
99
1010extern void tms3556_init(int vram_size);
1111extern void tms3556_reset(void);
12extern void tms3556_interrupt(running_machine *machine);
12extern void tms3556_interrupt(void);
1313
1414MACHINE_DRIVER_EXTERN( tms3556 );
src/mess/video/ted7360.c
r2201r2202
800800         ted7360_drawlines (machine, lastline, rasterline);
801801         ted7360[offset] = data;
802802         monoinversed[1] = mono[0] = bitmapmulti[0] = multi[0] = colors[0] =
803            machine->pens[BACKGROUNDCOLOR];
803            BACKGROUNDCOLOR;
804804      }
805805      break;
806806   case 0x16:                     /* foregroundcolor */
r2201r2202
808808      {
809809         ted7360_drawlines (machine, lastline, rasterline);
810810         ted7360[offset] = data;
811         bitmapmulti[3] = multi[1] = colors[1] = machine->pens[FOREGROUNDCOLOR];
811         bitmapmulti[3] = multi[1] = colors[1] = FOREGROUNDCOLOR;
812812      }
813813      break;
814814   case 0x17:                     /* multicolor 1 */
r2201r2202
816816      {
817817         ted7360_drawlines (machine, lastline, rasterline);
818818         ted7360[offset] = data;
819         multi[2] = colors[2] = machine->pens[MULTICOLOR1];
819         multi[2] = colors[2] = MULTICOLOR1;
820820      }
821821      break;
822822   case 0x18:                     /* multicolor 2 */
r2201r2202
824824      {
825825         ted7360_drawlines (machine, lastline, rasterline);
826826         ted7360[offset] = data;
827         colors[3] = machine->pens[MULTICOLOR2];
827         colors[3] = MULTICOLOR2;
828828      }
829829      break;
830830   case 0x19:                     /* framecolor */
r2201r2202
832832      {
833833         ted7360_drawlines (machine, lastline, rasterline);
834834         ted7360[offset] = data;
835         colors[4] = machine->pens[FRAMECOLOR];
835         colors[4] = FRAMECOLOR;
836836      }
837837      break;
838838   case 0x1c:
r2201r2202
956956   decodegfx(cursorelement, cursormask, 0, 1);
957957   /* 7-Sep-2007 - After 0.118u5, you cannot revector the color table */
958958   /* cursorelement->colortable = cursorcolortable; */
959   cursorcolortable[1] = machine->pens[1];
959   cursorcolortable[1] = 1;
960960   cursorelement->total_colors = 2;
961961   ted7360_bitmap = auto_bitmap_alloc(width, height, BITMAP_FORMAT_INDEXED16);
962962   add_exit_callback(machine, ted7360_video_stop);
r2201r2202
10781078   if (!SCREENON)
10791079   {
10801080      for (line = first; (line < last) && (line < ted7360_bitmap->height); line++)
1081         memset16 (BITMAP_ADDR16(ted7360_bitmap, line, 0), machine->pens[0], ted7360_bitmap->width);
1081         memset16 (BITMAP_ADDR16(ted7360_bitmap, line, 0), 0, ted7360_bitmap->width);
10821082      return;
10831083   }
10841084
r2201r2202
10931093      end = y_begin + YPOS;
10941094   {
10951095      for (line = first; line < end; line++)
1096         memset16 (BITMAP_ADDR16(ted7360_bitmap, line, 0), machine->pens[FRAMECOLOR],
1096         memset16 (BITMAP_ADDR16(ted7360_bitmap, line, 0), FRAMECOLOR,
10971097            ted7360_bitmap->width);
10981098   }
10991099   if (LINES25)
r2201r2202
11251125            attr = vic_dma_read (machine, ((videoaddr) + offs));
11261126            c1 = ((ch >> 4) & 0xf) | (attr << 4);
11271127            c2 = (ch & 0xf) | (attr & 0x70);
1128            bitmapmulti[1] = c16_bitmap[1] = machine->pens[c1 & 0x7f];
1129            bitmapmulti[2] = c16_bitmap[0] = machine->pens[c2 & 0x7f];
1128            bitmapmulti[1] = c16_bitmap[1] = c1 & 0x7f;
1129            bitmapmulti[2] = c16_bitmap[0] = c2 & 0x7f;
11301130            if (MULTICOLORON)
11311131            {
11321132               ted7360_draw_bitmap_multi (machine, ybegin, yend, offs, yoff, xoff);
r2201r2202
11461146               // hardware reverse off
11471147               ecm = ch >> 6;
11481148               ecmcolor[0] = colors[ecm];
1149               ecmcolor[1] = machine->pens[attr & 0x7f];
1149               ecmcolor[1] = attr & 0x7f;
11501150               ted7360_draw_character (machine, ybegin, yend, ch & ~0xC0, yoff, xoff, ecmcolor);
11511151            }
11521152            else if (MULTICOLORON)
r2201r2202
11541154               // hardware reverse off
11551155               if (attr & 8)
11561156               {
1157                  multi[3] = machine->pens[attr & 0x77];
1157                  multi[3] = attr & 0x77;
11581158                  ted7360_draw_character_multi (machine, ybegin, yend, ch, yoff, xoff);
11591159               }
11601160               else
11611161               {
1162                  mono[1] = machine->pens[attr & 0x7f];
1162                  mono[1] = attr & 0x7f;
11631163                  ted7360_draw_character (machine, ybegin, yend, ch, yoff, xoff, mono);
11641164               }
11651165            }
r2201r2202
11671167            {
11681168#ifndef GFX
11691169               ted7360_draw_cursor (ybegin, yend, yoff, xoff,
1170                     machine->pens[attr & 0x7f]);
1170                     attr & 0x7f);
11711171#else
1172               drawgfx (ted7360_bitmap, cursorelement, 0, machine->pens[attr & 0x7f], 0, 0,
1172               drawgfx (ted7360_bitmap, cursorelement, 0, attr & 0x7f, 0, 0,
11731173                  xoff, yoff, 0, TRANSPARENCY_NONE, 0);
11741174#endif
11751175            }
11761176            else if (REVERSEON && (ch & 0x80))
11771177            {
1178               monoinversed[0] = machine->pens[attr & 0x7f];
1178               monoinversed[0] = attr & 0x7f;
11791179               if (cursor1 && (attr & 0x80))
11801180                  ted7360_draw_cursor (ybegin, yend, yoff, xoff, monoinversed[0]);
11811181               else
r2201r2202
11841184            }
11851185            else
11861186            {
1187               mono[1] = machine->pens[attr & 0x7f];
1187               mono[1] = attr & 0x7f;
11881188               if (cursor1 && (attr & 0x80))
11891189                  ted7360_draw_cursor (ybegin, yend, yoff, xoff, mono[0]);
11901190               else
r2201r2202
11951195
11961196      for (i = ybegin; i <= yend; i++)
11971197      {
1198         memset16 (BITMAP_ADDR16(ted7360_bitmap, yoff + i, 0), machine->pens[FRAMECOLOR], xbegin);
1199         memset16 (BITMAP_ADDR16(ted7360_bitmap, yoff + i, xend), machine->pens[FRAMECOLOR], ted7360_bitmap->width - xend);
1198         memset16 (BITMAP_ADDR16(ted7360_bitmap, yoff + i, 0), FRAMECOLOR, xbegin);
1199         memset16 (BITMAP_ADDR16(ted7360_bitmap, yoff + i, xend), FRAMECOLOR, ted7360_bitmap->width - xend);
12001200      }
12011201   }
12021202
r2201r2202
12071207
12081208   for (; line < end; line++)
12091209   {
1210      memset16 (BITMAP_ADDR16(ted7360_bitmap, line, 0), machine->pens[FRAMECOLOR], ted7360_bitmap->width);
1210      memset16 (BITMAP_ADDR16(ted7360_bitmap, line, 0), FRAMECOLOR, ted7360_bitmap->width);
12111211   }
12121212}
12131213
src/mess/video/vc4000.c
r2201r2202
257257   "iiiihhhhgggg"
258258};
259259
260static void vc4000_draw_digit(running_machine *machine, bitmap_t *bitmap, int x, int y, int d, int line)
260static void vc4000_draw_digit(bitmap_t *bitmap, int x, int y, int d, int line)
261261{
262262   static const int digit_to_segment[0x10]={
263263   0x0fff, 0x007c, 0x17df, 0x15ff, 0x1c7d, 0x1df7, 0x1ff7, 0x007f, 0x1fff, 0x1dff
r2201r2202
266266   i=line;
267267   for (j=0; j<sizeof(led[0]); j++) {
268268   if (digit_to_segment[d]&(1<<(led[i][j]-'a')) ) {
269       *BITMAP_ADDR16(bitmap, y+i, x+j) = machine->pens[((vc4000_video.reg.d.background>>4)&7)^7];
269       *BITMAP_ADDR16(bitmap, y+i, x+j) = ((vc4000_video.reg.d.background>>4)&7)^7;
270270   }
271271   }
272272}
r2201r2202
284284}
285285
286286
287static void vc4000_sprite_update(running_machine *machine, bitmap_t *bitmap, UINT8 *collision, SPRITE *This)
287static void vc4000_sprite_update(bitmap_t *bitmap, UINT8 *collision, SPRITE *This)
288288{
289289
290290   int i,j,m;
r2201r2202
317317               for (i=0; i<This->size; i++)
318318               {
319319                   *BITMAP_ADDR16(bitmap, vc4000_video.line, This->data->x1 + i + j*This->size) =
320                     machine->pens[This->scolor];
320                     This->scolor;
321321               }
322322            }
323323         }
r2201r2202
373373               for (i=0; i<This->size; i++)
374374               {
375375                   *BITMAP_ADDR16(bitmap, vc4000_video.line, This->data->x2 + i + j*This->size) =
376                     machine->pens[This->scolor];
376                     This->scolor;
377377               }
378378            }
379379         }
r2201r2202
401401
402402   if (vc4000_video.line>=height) return;
403403
404   plot_box(vc4000_video.bitmap, 0, vc4000_video.line, width, 1, machine->pens[(vc4000_video.reg.d.background)&7]);
404   plot_box(vc4000_video.bitmap, 0, vc4000_video.line, width, 1, (vc4000_video.reg.d.background)&7);
405405
406406   if (line<0 || line>=200) return;
407407   if (!vc4000_video.reg.d.background&8) return;
r2201r2202
441441         for (l=0; l<w; l++) {
442442         collision[x+l]|=0x10;
443443         }
444         plot_box(vc4000_video.bitmap, x, vc4000_video.line, w, 1, machine->pens[(vc4000_video.reg.d.background>>4)&7]);
444         plot_box(vc4000_video.bitmap, x, vc4000_video.line, w, 1, (vc4000_video.reg.d.background>>4)&7);
445445      }
446446      if (j==7) m=0x100;
447447   }
r2201r2202
468468   {
469469      vc4000_draw_grid(machine, collision);
470470
471      vc4000_sprite_update(machine, vc4000_video.bitmap, collision, &vc4000_video.sprites[0]);
472      vc4000_sprite_update(machine, vc4000_video.bitmap, collision, &vc4000_video.sprites[1]);
473      vc4000_sprite_update(machine, vc4000_video.bitmap, collision, &vc4000_video.sprites[2]);
474      vc4000_sprite_update(machine, vc4000_video.bitmap, collision, &vc4000_video.sprites[3]);
471      vc4000_sprite_update(vc4000_video.bitmap, collision, &vc4000_video.sprites[0]);
472      vc4000_sprite_update(vc4000_video.bitmap, collision, &vc4000_video.sprites[1]);
473      vc4000_sprite_update(vc4000_video.bitmap, collision, &vc4000_video.sprites[2]);
474      vc4000_sprite_update(vc4000_video.bitmap, collision, &vc4000_video.sprites[3]);
475475
476476      for (i=0; i<256; i++)
477477      {
r2201r2202
484484      if ((vc4000_video.line>=y)&&(vc4000_video.line<y+20))
485485      {
486486         x = 58;
487         vc4000_draw_digit(machine, vc4000_video.bitmap, x, y, vc4000_video.reg.d.bcd[0]>>4, vc4000_video.line-y);
488         vc4000_draw_digit(machine, vc4000_video.bitmap, x+16, y, vc4000_video.reg.d.bcd[0]&0xf, vc4000_video.line-y);
487         vc4000_draw_digit(vc4000_video.bitmap, x, y, vc4000_video.reg.d.bcd[0]>>4, vc4000_video.line-y);
488         vc4000_draw_digit(vc4000_video.bitmap, x+16, y, vc4000_video.reg.d.bcd[0]&0xf, vc4000_video.line-y);
489489         x = 106;
490490         if (vc4000_video.reg.d.score_control&2)
491491            x += 16;
492         vc4000_draw_digit(machine, vc4000_video.bitmap, x, y, vc4000_video.reg.d.bcd[1]>>4, vc4000_video.line-y);
493         vc4000_draw_digit(machine, vc4000_video.bitmap, x+16, y, vc4000_video.reg.d.bcd[1]&0xf, vc4000_video.line-y);
492         vc4000_draw_digit(vc4000_video.bitmap, x, y, vc4000_video.reg.d.bcd[1]>>4, vc4000_video.line-y);
493         vc4000_draw_digit(vc4000_video.bitmap, x+16, y, vc4000_video.reg.d.bcd[1]&0xf, vc4000_video.line-y);
494494      }
495495   }
496496   if (vc4000_video.line==269) vc4000_video.reg.d.sprite_collision |=0x40;
src/mess/drivers/exelv.c
r2201r2202
7474
7575static INTERRUPT_GEN( exelv_hblank_interrupt )
7676{
77   tms3556_interrupt( machine );
77   tms3556_interrupt();
7878}
7979
8080/*static DEVICE_IMAGE_LOAD(exelv_cart)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team