Previous 15994 Revisions Next

r2201 Tuesday 1st April, 2008 at 17:20:24 UTC by Firewave
Removed unncessary machine->pens lookups
[src/mess/video]cdp1864.c crt.c dai.c electron.c enterp.c epnick.c epnick.h exidy.c galaxy.c gamecom.c gb.c hd66421.c hp48.c kc.c lviv.c nc.c nes.c odyssey2.c oric.c pcw.c pcw16.c pmd85.c primo.c

src/mess/video/hp48.c
r2200r2201
121121VIDEO_UPDATE( hp48 )
122122{
123123   int x, y, i, p, data, max_y;
124   int color[2];
125124//   int contrast=(hp48_hardware.data[1]|((hp48_hardware.data[2]&1)<<4));
126125
127   /* HJB: we cannot initialize array with values from other arrays, thus... */
128    color[0] = screen->machine->pens[0];
129   color[1] = screen->machine->pens[1];
130
131126   i = LCD_MAIN_BASE_ADDRESS;
132127   max_y = MIN(64, LCD_MAIN_SIZE + 1 );
133128   if ( max_y < 3 ) {
r2200r2201
169164   }
170165
171166   hp48_draw_special(bitmap,RIGHT+12,DOWN-13,hp48_orange,
172                 hp48_hardware.data[0xb]&1?color[1]:color[1]);
167                 hp48_hardware.data[0xb]&1?1:1);
173168   hp48_draw_special(bitmap,RIGHT+57,DOWN-13,hp48_blue,
174                 hp48_hardware.data[0xb]&2?color[1]:color[0]);
169                 hp48_hardware.data[0xb]&2?1:0);
175170   hp48_draw_special(bitmap,RIGHT+102,DOWN-13,hp48_alpha,
176                 hp48_hardware.data[0xb]&4?color[1]:color[0]);
171                 hp48_hardware.data[0xb]&4?1:0);
177172   hp48_draw_special(bitmap,RIGHT+147,DOWN-13,hp48_alarm,
178                 hp48_hardware.data[0xb]&8?color[1]:color[0]);
173                 hp48_hardware.data[0xb]&8?1:0);
179174   hp48_draw_special(bitmap,RIGHT+192,DOWN-13,hp48_busy,
180                 hp48_hardware.data[0xc]&1?color[1]:color[0]);
175                 hp48_hardware.data[0xc]&1?1:0);
181176   hp48_draw_special(bitmap,RIGHT+237,DOWN-13,hp48_transmit,
182                 hp48_hardware.data[0xc]&2?color[1]:color[0]);
177                 hp48_hardware.data[0xc]&2?1:0);
183178   return 0;
184179}
src/mess/video/dai.c
r2200r2201
132132                     {
133133                        current_colour = dai_4_colours_palette[(((current_data_1>>(7-k)) & 0x01)<<1) | ((current_data_2>>(7-k)) & 0x01)];
134134                        for (l=0; l<12; l++)
135                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*12+l) = screen->machine->pens[current_colour];
135                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*12+l) = current_colour;
136136                     }
137137                  }
138138               }
r2200r2201
149149                     {
150150                        current_colour = dai_4_colours_palette[(((current_data_1>>(7-k)) & 0x01)<<1) | ((current_data_2>>(7-k)) & 0x01)];
151151                        for (l=0; l<12; l++)
152                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*12+l) = screen->machine->pens[current_colour];
152                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*12+l) = current_colour;
153153                     }
154154                  }
155155               }
r2200r2201
171171                     {
172172                        current_colour = dai_4_colours_palette[(((current_data_1>>(7-k)) & 0x01)<<1) | ((current_data_2>>(7-k)) & 0x01)];
173173                        for (l=0; l<6; l++)
174                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*6+l) = screen->machine->pens[current_colour];
174                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*6+l) = current_colour;
175175                     }
176176                  }
177177               }
r2200r2201
188188                     {
189189                        current_colour = dai_4_colours_palette[(((current_data_1>>(7-k)) & 0x01)<<1) | ((current_data_2>>(7-k)) & 0x01)];
190190                        for (l=0; l<6; l++)
191                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*6+l) = screen->machine->pens[current_colour];
191                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*6+l) = current_colour;
192192                     }
193193                  }
194194               }
r2200r2201
210210                     {
211211                        current_colour = dai_4_colours_palette[(((current_data_1>>(7-k)) & 0x01)<<1) | ((current_data_2>>(7-k)) & 0x01)];
212212                        for (l=0; l<3; l++)
213                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*3+l) = screen->machine->pens[current_colour];
213                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*3+l) = current_colour;
214214                     }
215215                  }
216216               }
r2200r2201
226226                     {
227227                        current_colour = dai_4_colours_palette[(((current_data_1>>(7-k)) & 0x01)<<1) | ((current_data_2>>(7-k)) & 0x01)];
228228                        for (l=0; l<3; l++)
229                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*3+l) = screen->machine->pens[current_colour];
229                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*3+l) = current_colour;
230230                     }
231231                  }
232232               }
r2200r2201
248248                     {
249249                        current_colour = dai_4_colours_palette[(((current_data_1>>(7-k)) & 0x01)<<1) | ((current_data_2>>(7-k)) & 0x01)];
250250                        for (l=0; l<2; l++)
251                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*2+l) = screen->machine->pens[current_colour];
251                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*2+l) = current_colour;
252252                     }
253253                  }
254254               }
r2200r2201
264264                     {
265265                        current_colour = dai_4_colours_palette[(((current_data_1>>(7-k)) & 0x01)<<1) | ((current_data_2>>(7-k)) & 0x01)];
266266                        for (l=0; l<2; l++)
267                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*2+l) = screen->machine->pens[current_colour];
267                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*2+l) = current_colour;
268268                     }
269269                  }
270270               }
r2200r2201
293293                     {
294294                        current_colour = dai_4_colours_palette[(((current_data_2 >> k)&0x01)<<1) | ((char_rom[current_data_1*16+j]>>k) & 0x01)];
295295                        for (l=0; l<12; l++)
296                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*12+l) = screen->machine->pens[current_colour];
296                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*12+l) = current_colour;
297297                     }
298298                  }
299299               }
r2200r2201
311311                     {
312312                        current_colour = dai_4_colours_palette[(((current_data_2 >> k)&0x01)<<1) | ((char_rom[current_data_1*16+j]>>k) & 0x01)];
313313                        for (l=0; l<12; l++)
314                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*12+l) = screen->machine->pens[current_colour];
314                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*12+l) = current_colour;
315315                     }
316316                  }
317317               }
r2200r2201
334334                     {
335335                        current_colour = dai_4_colours_palette[(((current_data_2 >> k)&0x01)<<1) | ((char_rom[current_data_1*16+j]>>k) & 0x01)];
336336                        for (l=0; l<6; l++)
337                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*6+l) = screen->machine->pens[current_colour];
337                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*6+l) = current_colour;
338338                     }
339339                  }
340340               }
r2200r2201
352352                     {
353353                        current_colour = dai_4_colours_palette[(((current_data_2 >> k)&0x01)<<1) | ((char_rom[current_data_1*16+j]>>k) & 0x01)];
354354                        for (l=0; l<6; l++)
355                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*6+l) = screen->machine->pens[current_colour];
355                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*6+l) = current_colour;
356356                     }
357357                  }
358358               }
r2200r2201
375375                     {
376376                        current_colour = dai_4_colours_palette[(((current_data_2 >> k)&0x01)<<1) | ((char_rom[current_data_1*16+j]>>k) & 0x01)];
377377                        for (l=0; l<3; l++)
378                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*3+l) = screen->machine->pens[current_colour];
378                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*3+l) = current_colour;
379379                     }
380380                  }
381381               }
r2200r2201
392392                     {
393393                        current_colour = dai_4_colours_palette[(((current_data_2 >> k)&0x01)<<1) | ((char_rom[current_data_1*16+j]>>k) & 0x01)];
394394                        for (l=0; l<3; l++)
395                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*3+l) = screen->machine->pens[current_colour];
395                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*3+l) = current_colour;
396396                     }
397397                  }
398398               }
r2200r2201
414414                     {
415415                        current_colour = dai_4_colours_palette[(((current_data_2 >> k)&0x01)<<1) | ((char_rom[current_data_1*16+j]>>k) & 0x01)];
416416                        for (l=0; l<2; l++)
417                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*2+l) = screen->machine->pens[current_colour];
417                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*2+l) = current_colour;
418418                     }
419419                  }
420420               }
r2200r2201
431431                     {
432432                        current_colour = dai_4_colours_palette[(((current_data_2 >> k)&0x01)<<1) | ((char_rom[current_data_1*16+j]>>k) & 0x01)];
433433                        for (l=0; l<2; l++)
434                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*2+l) = screen->machine->pens[current_colour];
434                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*2+l) = current_colour;
435435                     }
436436                  }
437437               }
r2200r2201
459459                     {
460460                        current_colour = ((current_data_1>>(7-k)) & 0x01) ? (current_data_2>>4)&0x0f : current_data_2&0x0f;
461461                        for (l=0; l<12; l++)
462                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*12+l) = screen->machine->pens[current_colour];
462                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*12+l) = current_colour;
463463                     }
464464                  }
465465               }
r2200r2201
476476                     {
477477                        current_colour = ((current_data_1>>(7-k)) & 0x01) ? (current_data_2>>4)&0x0f : current_data_2&0x0f;
478478                        for (l=0; l<12; l++)
479                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*12+l) = screen->machine->pens[current_colour];
479                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*12+l) = current_colour;
480480                     }
481481                  }
482482               }
r2200r2201
498498                     {
499499                        current_colour = ((current_data_1>>(7-k)) & 0x01) ? (current_data_2>>4)&0x0f : current_data_2&0x0f;
500500                        for (l=0; l<6; l++)
501                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*6+l) = screen->machine->pens[current_colour];
501                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*6+l) = current_colour;
502502                     }
503503                  }
504504               }
r2200r2201
515515                     {
516516                        current_colour = ((current_data_1>>(7-k)) & 0x01) ? (current_data_2>>4)&0x0f : current_data_2&0x0f;
517517                        for (l=0; l<6; l++)
518                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*6+l) = screen->machine->pens[current_colour];
518                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*6+l) = current_colour;
519519                     }
520520                  }
521521               }
r2200r2201
537537                     {
538538                        current_colour = ((current_data_1>>(7-k)) & 0x01) ? (current_data_2>>4)&0x0f : current_data_2&0x0f;
539539                        for (l=0; l<3; l++)
540                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*3+l) = screen->machine->pens[current_colour];
540                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*3+l) = current_colour;
541541                     }
542542                  }
543543               }
r2200r2201
553553                     {
554554                        current_colour = ((current_data_1>>(7-k)) & 0x01) ? (current_data_2>>4)&0x0f : current_data_2&0x0f;
555555                        for (l=0; l<3; l++)
556                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*3+l) = screen->machine->pens[current_colour];
556                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*3+l) = current_colour;
557557                     }
558558                  }
559559               }
r2200r2201
575575                     {
576576                        current_colour = ((current_data_1>>(7-k)) & 0x01) ? (current_data_2>>4)&0x0f : current_data_2&0x0f;
577577                        for (l=0; l<2; l++)
578                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*2+l) = screen->machine->pens[current_colour];
578                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*2+l) = current_colour;
579579                     }
580580                  }
581581               }
r2200r2201
591591                     {
592592                        current_colour = ((current_data_1>>(7-k)) & 0x01) ? (current_data_2>>4)&0x0f : current_data_2&0x0f;
593593                        for (l=0; l<2; l++)
594                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*2+l) = screen->machine->pens[current_colour];
594                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*2+l) = current_colour;
595595                     }
596596                  }
597597               }
r2200r2201
618618                     {
619619                        current_colour = ((char_rom[current_data_1*16+j]>>k) & 0x01) ? (current_data_2>>4)&0x0f : current_data_2&0x0f;
620620                        for (l=0; l<12; l++)
621                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*12+l) = screen->machine->pens[current_colour];
621                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*12+l) = current_colour;
622622                     }
623623                  }
624624               }
r2200r2201
635635                     {
636636                        current_colour = ((char_rom[current_data_1*16+j]>>k) & 0x01) ? (current_data_2>>4)&0x0f : current_data_2&0x0f;
637637                        for (l=0; l<12; l++)
638                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*12+l) = screen->machine->pens[current_colour];
638                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*12+l) = current_colour;
639639                     }
640640                  }
641641               }
r2200r2201
657657                     {
658658                        current_colour = ((char_rom[current_data_1*16+j]>>k) & 0x01) ? (current_data_2>>4)&0x0f : current_data_2&0x0f;
659659                        for (l=0; l<6; l++)
660                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*6+l) = screen->machine->pens[current_colour];
660                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*6+l) = current_colour;
661661                     }
662662                  }
663663               }
r2200r2201
674674                     {
675675                        current_colour = ((char_rom[current_data_1*16+j]>>k) & 0x01) ? (current_data_2>>4)&0x0f : current_data_2&0x0f;
676676                        for (l=0; l<6; l++)
677                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*6+l) = screen->machine->pens[current_colour];
677                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*6+l) = current_colour;
678678                     }
679679                  }
680680               }
r2200r2201
696696                     {
697697                        current_colour = ((char_rom[current_data_1*16+j]>>k) & 0x01) ? (current_data_2>>4)&0x0f : current_data_2&0x0f;
698698                        for (l=0; l<3; l++)
699                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*3+l) = screen->machine->pens[current_colour];
699                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*3+l) = current_colour;
700700                     }
701701                  }
702702               }
r2200r2201
712712                     {
713713                        current_colour = ((char_rom[current_data_1*16+j]>>k) & 0x01) ? (current_data_2>>4)&0x0f : current_data_2&0x0f;
714714                        for (l=0; l<3; l++)
715                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*3+l) = screen->machine->pens[current_colour];
715                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*3+l) = current_colour;
716716                     }
717717                  }
718718               }
r2200r2201
733733                     {
734734                        current_colour = ((char_rom[current_data_1*16+j]>>k) & 0x01) ? (current_data_2>>4)&0x0f : current_data_2&0x0f;
735735                        for (l=0; l<2; l++)
736                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*2+l) = screen->machine->pens[current_colour];
736                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*2+l) = current_colour;
737737                     }
738738                  }
739739               }
r2200r2201
749749                     {
750750                        current_colour = ((char_rom[current_data_1*16+j]>>k) & 0x01) ? (current_data_2>>4)&0x0f : current_data_2&0x0f;
751751                        for (l=0; l<2; l++)
752                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*2+l) = screen->machine->pens[current_colour];
752                           *BITMAP_ADDR16(bitmap, current_scan_line/2 + j, (i*8+k)*2+l) = current_colour;
753753                     }
754754                  }
755755               }
src/mess/video/nc.c
r2200r2201
7070
7171      if (nc200_backlight)
7272      {
73         pens[0] = screen->machine->pens[2];
74         pens[1] = screen->machine->pens[3];
73         pens[0] = 2;
74         pens[1] = 3;
7575      }
7676      else
7777      {
78         pens[0] = screen->machine->pens[0];
79         pens[1] = screen->machine->pens[1];
78         pens[0] = 0;
79         pens[1] = 1;
8080      }
8181    }
8282    else
8383    {
8484      height = NC_SCREEN_HEIGHT;
8585      width = NC_SCREEN_WIDTH;
86      pens[0] = screen->machine->pens[2];
87      pens[1] = screen->machine->pens[3];
86      pens[0] = 2;
87      pens[1] = 3;
8888   }
8989
9090
src/mess/video/nes.c
r2200r2201
132132   if ((readinputport(PORT_CONFIG1) & 0x00f0) == 0x0030)
133133      sights |= 0x0002;
134134   if (sights & 0x0001)
135      draw_sight(bitmap, screen->machine->pens[0x30], readinputport(PORT_ZAPPER0_X), readinputport(PORT_ZAPPER0_Y));
135      draw_sight(bitmap, 0x30, readinputport(PORT_ZAPPER0_X), readinputport(PORT_ZAPPER0_Y));
136136   if (sights & 0x0002)
137      draw_sight(bitmap, screen->machine->pens[0x00], readinputport(PORT_ZAPPER1_X), readinputport(PORT_ZAPPER1_Y));
137      draw_sight(bitmap, 0x00, readinputport(PORT_ZAPPER1_X), readinputport(PORT_ZAPPER1_Y));
138138
139139   /* if this is a disk system game, check for the flip-disk key */
140140   if (nes.mapper == 20)
src/mess/video/gb.c
r2200r2201
241241   }
242242}
243243
244INLINE void gb_update_sprites ( running_machine *machine )
244INLINE void gb_update_sprites ( void )
245245{
246246   bitmap_t *bitmap = tmpbitmap;
247247   UINT8 height, tilemask, line, *oam, *vram;
r2200r2201
291291            {
292292               register int colour = ((data & 0x0100) ? 2 : 0) | ((data & 0x0001) ? 1 : 0);
293293               if (colour && !bg_zbuf[xindex] && xindex >= 0 && xindex < 160)
294                  gb_plot_pixel(bitmap, xindex, yindex, machine->pens[spal[colour]]);
294                  gb_plot_pixel(bitmap, xindex, yindex, spal[colour]);
295295               data >>= 1;
296296            }
297297            break;
r2200r2201
300300            {
301301               register int colour = ((data & 0x0100) ? 2 : 0) | ((data & 0x0001) ? 1 : 0);
302302               if (colour && xindex >= 0 && xindex < 160)
303                  gb_plot_pixel(bitmap, xindex, yindex, machine->pens[spal[colour]]);
303                  gb_plot_pixel(bitmap, xindex, yindex, spal[colour]);
304304               data >>= 1;
305305            }
306306            break;
r2200r2201
309309            {
310310               register int colour = ((data & 0x8000) ? 2 : 0) | ((data & 0x0080) ? 1 : 0);
311311               if (colour && !bg_zbuf[xindex] && xindex >= 0 && xindex < 160)
312                  gb_plot_pixel(bitmap, xindex, yindex, machine->pens[spal[colour]]);
312                  gb_plot_pixel(bitmap, xindex, yindex, spal[colour]);
313313               data <<= 1;
314314            }
315315            break;
r2200r2201
318318            {
319319               register int colour = ((data & 0x8000) ? 2 : 0) | ((data & 0x0080) ? 1 : 0);
320320               if (colour && xindex >= 0 && xindex < 160)
321                  gb_plot_pixel(bitmap, xindex, yindex, machine->pens[spal[colour]]);
321                  gb_plot_pixel(bitmap, xindex, yindex, spal[colour]);
322322               data <<= 1;
323323            }
324324            break;
r2200r2201
385385            r.min_y = r.max_y = gb_lcd.current_line;
386386            r.min_x = gb_lcd.start_x;
387387            r.max_x = gb_lcd.end_x - 1;
388            fillbitmap( bitmap, machine->pens[ gb_bpal[0] ], &r );
388            fillbitmap( bitmap, gb_bpal[0], &r );
389389         }
390390         while ( l < 2 ) {
391391            UINT8   xindex, *map, *tiles;
r2200r2201
413413            while ( i > 0 ) {
414414               while ( ( gb_lcd.layer[l].xshift < 8 ) && i ) {
415415                  register int colour = ( ( data & 0x8000 ) ? 2 : 0 ) | ( ( data & 0x0080 ) ? 1 : 0 );
416                  gb_plot_pixel( bitmap, xindex, gb_lcd.current_line, machine->pens[ gb_bpal[ colour ] ] );
416                  gb_plot_pixel( bitmap, xindex, gb_lcd.current_line, gb_bpal[ colour ] );
417417                  bg_zbuf[ xindex ] = colour;
418418                  xindex++;
419419                  data <<= 1;
r2200r2201
437437            l++;
438438         }
439439         if ( gb_lcd.end_x == 160 && LCDCONT & 0x02 ) {
440            gb_update_sprites( machine );
440            gb_update_sprites();
441441         }
442442         gb_lcd.start_x = gb_lcd.end_x;
443443      }
r2200r2201
449449               const device_config *screen = video_screen_first(machine->config);
450450               rectangle r = *video_screen_get_visible_area(screen);
451451               r.min_y = r.max_y = gb_lcd.current_line;
452               fillbitmap( bitmap, screen->machine->pens[0], &r );
452               fillbitmap( bitmap, 0, &r );
453453            }
454454            gb_lcd.previous_line = gb_lcd.current_line;
455455         }
r2200r2201
682682               r.max_x -= SGB_XOFFSET;
683683               r.min_y = SGB_YOFFSET;
684684               r.max_y -= SGB_YOFFSET;
685               fillbitmap( bitmap, machine->pens[0], &r );
685               fillbitmap( bitmap, 0, &r );
686686            } return;
687687         case 3: /* Blank screen (white - or should it be color 0?) */
688688            {
r2200r2201
692692               r.max_x -= SGB_XOFFSET;
693693               r.min_y = SGB_YOFFSET;
694694               r.max_y -= SGB_YOFFSET;
695               fillbitmap( bitmap, machine->pens[32767], &r );
695               fillbitmap( bitmap, 32767, &r );
696696            } return;
697697         }
698698
r2200r2201
711711            r.min_x = SGB_XOFFSET;
712712            r.max_x -= SGB_XOFFSET;
713713            r.min_y = r.max_y = gb_lcd.current_line + SGB_YOFFSET;
714            fillbitmap( bitmap, machine->pens[0], &r );
714            fillbitmap( bitmap, 0, &r );
715715         }
716716         while( l < 2 ) {
717717            UINT8   xindex, sgb_palette, *map, *tiles;
r2200r2201
782782               r.min_x = SGB_XOFFSET;
783783               r.max_x -= SGB_XOFFSET;
784784               r.min_y = r.max_y = gb_lcd.current_line + SGB_YOFFSET;
785               fillbitmap(bitmap, machine->pens[0], &r);
785               fillbitmap(bitmap, 0, &r);
786786            }
787787            gb_lcd.previous_line = gb_lcd.current_line;
788788         }
r2200r2201
848848            {
849849               register int colour = ((data & 0x0100) ? 2 : 0) | ((data & 0x0001) ? 1 : 0);
850850               if (colour && !bg_zbuf[xindex] && xindex >= 0 && xindex < 160)
851                  gb_plot_pixel(bitmap, xindex, yindex, machine->pens[cgb_spal[pal + colour]]);
851                  gb_plot_pixel(bitmap, xindex, yindex, cgb_spal[pal + colour]);
852852               data >>= 1;
853853            }
854854            break;
r2200r2201
859859               if((bg_zbuf[xindex] & 0x80) && (bg_zbuf[xindex] & 0x7f) && (LCDCONT & 0x1))
860860                  colour = 0;
861861               if (colour && xindex >= 0 && xindex < 160)
862                  gb_plot_pixel(bitmap, xindex, yindex, machine->pens[cgb_spal[pal + colour]]);
862                  gb_plot_pixel(bitmap, xindex, yindex, cgb_spal[pal + colour]);
863863               data >>= 1;
864864            }
865865            break;
r2200r2201
868868            {
869869               register int colour = ((data & 0x8000) ? 2 : 0) | ((data & 0x0080) ? 1 : 0);
870870               if (colour && !bg_zbuf[xindex] && xindex >= 0 && xindex < 160)
871                  gb_plot_pixel(bitmap, xindex, yindex, machine->pens[cgb_spal[pal + colour]]);
871                  gb_plot_pixel(bitmap, xindex, yindex, cgb_spal[pal + colour]);
872872               data <<= 1;
873873            }
874874            break;
r2200r2201
879879               if((bg_zbuf[xindex] & 0x80) && (bg_zbuf[xindex] & 0x7f) && (LCDCONT & 0x1))
880880                  colour = 0;
881881               if (colour && xindex >= 0 && xindex < 160)
882                  gb_plot_pixel(bitmap, xindex, yindex, machine->pens[cgb_spal[pal + colour]]);
882                  gb_plot_pixel(bitmap, xindex, yindex, cgb_spal[pal + colour]);
883883               data <<= 1;
884884            }
885885            break;
r2200r2201
947947            r.min_y = r.max_y = gb_lcd.current_line;
948948            r.min_x = gb_lcd.start_x;
949949            r.max_x = gb_lcd.end_x - 1;
950            fillbitmap( bitmap, machine->pens[ ( gbc_mode == GBC_MODE_MONO ) ? 0 : 32767 ], &r );
950            fillbitmap( bitmap, ( gbc_mode == GBC_MODE_MONO ) ? 0 : 32767, &r );
951951         }
952952         while ( l < 2 ) {
953953            UINT8   xindex, *map, *tiles, *gbcmap;
r2200r2201
996996                     colour = ( ( data & 0x8000 ) ? 2 : 0 ) | ( ( data & 0x0080 ) ? 1 : 0 );
997997                     data <<= 1;
998998                  }
999                  gb_plot_pixel( bitmap, xindex, gb_lcd.current_line, machine->pens[ cgb_bpal[ ( ( gbcmap[ gb_lcd.layer[l].xindex ] & 0x07 ) * 4 ) + colour ] ] );
999                  gb_plot_pixel( bitmap, xindex, gb_lcd.current_line, cgb_bpal[ ( ( gbcmap[ gb_lcd.layer[l].xindex ] & 0x07 ) * 4 ) + colour ] );
10001000                  bg_zbuf[ xindex ] = colour + ( gbcmap[ gb_lcd.layer[l].xindex ] & 0x80 );
10011001                  xindex++;
10021002                  gb_lcd.layer[l].xshift++;
r2200r2201
10391039               const device_config *screen = video_screen_first(machine->config);
10401040               rectangle r = *video_screen_get_visible_area(screen);
10411041               r.min_y = r.max_y = gb_lcd.current_line;
1042               fillbitmap( bitmap, machine->pens[ ( gbc_mode == GBC_MODE_MONO ) ? 0 : 32767 ], &r );
1042               fillbitmap( bitmap, ( gbc_mode == GBC_MODE_MONO ) ? 0 : 32767, &r );
10431043            }
10441044            gb_lcd.previous_line = gb_lcd.current_line;
10451045         }
src/mess/video/pcw16.c
r2200r2201
6565}
6666
6767/* 640, 1 bit per pixel */
68static void pcw16_vh_decode_mode0(running_machine *machine, bitmap_t *bitmap, int x, int y, unsigned char byte)
68static void pcw16_vh_decode_mode0(bitmap_t *bitmap, int x, int y, unsigned char byte)
6969{
7070   int b;
7171   int local_byte;
r2200r2201
7474
7575   local_byte = byte;
7676
77   cols[0] = machine->pens[pcw16_colour_palette[0]];
78   cols[1] = machine->pens[pcw16_colour_palette[1]];
77   cols[0] = pcw16_colour_palette[0];
78   cols[1] = pcw16_colour_palette[1];
7979
8080   px = x;
8181   for (b=0; b<8; b++)
r2200r2201
8888}
8989
9090/* 320, 2 bits per pixel */
91static void pcw16_vh_decode_mode1(running_machine *machine, bitmap_t *bitmap, int x, int y, unsigned char byte)
91static void pcw16_vh_decode_mode1(bitmap_t *bitmap, int x, int y, unsigned char byte)
9292{
9393   int b;
9494   int px;
r2200r2201
9797
9898   for (b=0; b<3; b++)
9999   {
100      cols[b] = machine->pens[pcw16_colour_palette[b]];
100      cols[b] = pcw16_colour_palette[b];
101101   }
102102
103103   local_byte = byte;
r2200r2201
119119}
120120
121121/* 160, 4 bits per pixel */
122static void pcw16_vh_decode_mode2(running_machine *machine, bitmap_t *bitmap, int x, int y, unsigned char byte)
122static void pcw16_vh_decode_mode2(bitmap_t *bitmap, int x, int y, unsigned char byte)
123123{
124124   int px;
125125   int b;
126126   int local_byte;
127127   int cols[2];
128128
129   cols[0] = machine->pens[pcw16_colour_palette[0]];
130   cols[1] = machine->pens[pcw16_colour_palette[1]];
129   cols[0] = pcw16_colour_palette[0];
130   cols[1] = pcw16_colour_palette[1];
131131   local_byte = byte;
132132
133133   px = x;
r2200r2201
176176      border_colour = pcw16_colour_palette[1];
177177   }
178178
179   border_colour = screen->machine->pens[border_colour];
180
181179   if ((pcw16_video_control & (1<<6))==0)
182180   {
183181      /* blank */
r2200r2201
248246            {
249247               case 0:
250248               {
251                  pcw16_vh_decode_mode0(screen->machine, bitmap,x,y+PCW16_BORDER_HEIGHT,byte);
249                  pcw16_vh_decode_mode0(bitmap,x,y+PCW16_BORDER_HEIGHT,byte);
252250               }
253251               break;
254252
255253               case 1:
256254               {
257                  pcw16_vh_decode_mode1(screen->machine, bitmap, x,y+PCW16_BORDER_HEIGHT, byte);
255                  pcw16_vh_decode_mode1(bitmap, x,y+PCW16_BORDER_HEIGHT, byte);
258256               }
259257               break;
260258
261259               case 3:
262260               case 2:
263261               {
264                  pcw16_vh_decode_mode2(screen->machine, bitmap, x, y+PCW16_BORDER_HEIGHT, byte);
262                  pcw16_vh_decode_mode2(bitmap, x, y+PCW16_BORDER_HEIGHT, byte);
265263               }
266264               break;
267265            }
src/mess/video/gamecom.c
r2200r2201
2222      rec.min_x = 0;
2323      rec.max_x = Y_PIXELS - 1;
2424      rec.min_y = rec.max_y = scanline;
25      fillbitmap( tmpbitmap, machine->pens[ 0 ], &rec );
25      fillbitmap( tmpbitmap, 0, &rec );
2626      return;
2727   } else {
2828      UINT8 *line = &gamecom_vram[ base_address + 40 * scanline ];
r2200r2201
5757      }
5858      for( i = 0; i < 40; i++ ) {
5959         UINT8 p = line[i];
60         *BITMAP_ADDR16(tmpbitmap, i * 4 + 0, scanline) = machine->pens[ pal[ ( p >> 6 ) & 3 ] ];
61         *BITMAP_ADDR16(tmpbitmap, i * 4 + 1, scanline) = machine->pens[ pal[ ( p >> 4 ) & 3 ] ];
62         *BITMAP_ADDR16(tmpbitmap, i * 4 + 2, scanline) = machine->pens[ pal[ ( p >> 2 ) & 3 ] ];
63         *BITMAP_ADDR16(tmpbitmap, i * 4 + 3, scanline) = machine->pens[ pal[ ( p      ) & 3 ] ];
60         *BITMAP_ADDR16(tmpbitmap, i * 4 + 0, scanline) = pal[ ( p >> 6 ) & 3 ];
61         *BITMAP_ADDR16(tmpbitmap, i * 4 + 1, scanline) = pal[ ( p >> 4 ) & 3 ];
62         *BITMAP_ADDR16(tmpbitmap, i * 4 + 2, scanline) = pal[ ( p >> 2 ) & 3 ];
63         *BITMAP_ADDR16(tmpbitmap, i * 4 + 3, scanline) = pal[ ( p      ) & 3 ];
6464      }
6565   }
6666
src/mess/video/epnick.c
r2200r2201
3030
3131// MESS specific
3232/* 8-bit pixel write! */
33static void nick_write_pixel(running_machine *machine, NICK_STATE *nick, int ci)
33static void nick_write_pixel(NICK_STATE *nick, int ci)
3434{
3535   if (nick->dest_pos < nick->dest_max_pos)
3636   {
37      nick->dest[nick->dest_pos++] = machine->pens[ci];
37      nick->dest[nick->dest_pos++] = ci;
3838   }
3939}
4040
r2200r2201
119119}
120120
121121/* write border colour */
122static void   Nick_WriteBorder(running_machine *machine, int Clocks)
122static void   Nick_WriteBorder(int Clocks)
123123{
124124   int i;
125125   int ColIndex = Nick.BORDER;
126126
127127   for (i=0; i<(Clocks<<4); i++)
128128   {
129      nick_write_pixel(machine, &Nick, ColIndex);
129      nick_write_pixel(&Nick, ColIndex);
130130   }
131131}
132132
133133
134static void Nick_DoLeftMargin(running_machine *machine, LPT_ENTRY *pLPT)
134static void Nick_DoLeftMargin(LPT_ENTRY *pLPT)
135135{
136136      unsigned char LeftMargin;
137137
r2200r2201
145145         LeftMarginVisible = LeftMargin-Nick_FirstVisibleClock;
146146
147147         /* render the border */
148         Nick_WriteBorder(machine, LeftMarginVisible);
148         Nick_WriteBorder(LeftMarginVisible);
149149      }
150150}
151151
152static void Nick_DoRightMargin(running_machine *machine, LPT_ENTRY *pLPT)
152static void Nick_DoRightMargin(LPT_ENTRY *pLPT)
153153{
154154      unsigned char RightMargin;
155155
r2200r2201
163163         RightMarginVisible = Nick_LastVisibleClock - RightMargin;
164164
165165         /* render the border */
166         Nick_WriteBorder(machine, RightMarginVisible);
166         Nick_WriteBorder(RightMarginVisible);
167167      }
168168}
169169
r2200r2201
179179   }
180180}
181181
182static void Nick_WritePixels2Colour(running_machine *machine, unsigned char Pen0, unsigned char Pen1, unsigned char DataByte)
182static void Nick_WritePixels2Colour(unsigned char Pen0, unsigned char Pen1, unsigned char DataByte)
183183{
184184   int i;
185185   int ColIndex[2];
r2200r2201
195195   {
196196      PenIndex = ColIndex[(Data>>7) & 0x01];
197197
198      nick_write_pixel(machine, &Nick, PenIndex);
198      nick_write_pixel(&Nick, PenIndex);
199199
200200      Data = Data<<1;
201201   }
202202}
203203
204static void Nick_WritePixels2ColourLPIXEL(running_machine *machine, unsigned char Pen0, unsigned char Pen1, unsigned char DataByte)
204static void Nick_WritePixels2ColourLPIXEL(unsigned char Pen0, unsigned char Pen1, unsigned char DataByte)
205205{
206206   int i;
207207   int ColIndex[2];
r2200r2201
217217   {
218218      PenIndex = ColIndex[(Data>>7) & 0x01];
219219
220      nick_write_pixel(machine, &Nick, PenIndex);
221      nick_write_pixel(machine, &Nick, PenIndex);
220      nick_write_pixel(&Nick, PenIndex);
221      nick_write_pixel(&Nick, PenIndex);
222222
223223      Data = Data<<1;
224224   }
225225}
226226
227227
228static void Nick_WritePixels(running_machine *machine, unsigned char DataByte, unsigned char CharIndex)
228static void Nick_WritePixels(unsigned char DataByte, unsigned char CharIndex)
229229{
230230   int i;
231231
r2200r2201
283283
284284
285285
286         Nick_WritePixels2Colour(machine, PenOffset,
286         Nick_WritePixels2Colour(PenOffset,
287287            (PenOffset|0x01), Data);
288288      }
289289      break;
r2200r2201
309309            PenIndex = Nick_PenIndexLookup_4Colour[Data];
310310            PalIndex = Nick.LPT.COL[PenIndex & 0x03];
311311
312            nick_write_pixel(machine, &Nick, PalIndex);
313            nick_write_pixel(machine, &Nick, PalIndex);
312            nick_write_pixel(&Nick, PalIndex);
313            nick_write_pixel(&Nick, PalIndex);
314314
315315            Data = Data<<1;
316316          }
r2200r2201
339339
340340            PalIndex = Nick_GetColourIndex(PenIndex);
341341
342            nick_write_pixel(machine, &Nick, PalIndex);
343            nick_write_pixel(machine, &Nick, PalIndex);
344            nick_write_pixel(machine, &Nick, PalIndex);
345            nick_write_pixel(machine, &Nick, PalIndex);
342            nick_write_pixel(&Nick, PalIndex);
343            nick_write_pixel(&Nick, PalIndex);
344            nick_write_pixel(&Nick, PalIndex);
345            nick_write_pixel(&Nick, PalIndex);
346346
347347            Data = Data<<1;
348348         }
r2200r2201
365365
366366         PalIndex = Data;
367367
368         nick_write_pixel(machine, &Nick, PalIndex);
369         nick_write_pixel(machine, &Nick, PalIndex);
370         nick_write_pixel(machine, &Nick, PalIndex);
371         nick_write_pixel(machine, &Nick, PalIndex);
372         nick_write_pixel(machine, &Nick, PalIndex);
373         nick_write_pixel(machine, &Nick, PalIndex);
374         nick_write_pixel(machine, &Nick, PalIndex);
375         nick_write_pixel(machine, &Nick, PalIndex);
368         nick_write_pixel(&Nick, PalIndex);
369         nick_write_pixel(&Nick, PalIndex);
370         nick_write_pixel(&Nick, PalIndex);
371         nick_write_pixel(&Nick, PalIndex);
372         nick_write_pixel(&Nick, PalIndex);
373         nick_write_pixel(&Nick, PalIndex);
374         nick_write_pixel(&Nick, PalIndex);
375         nick_write_pixel(&Nick, PalIndex);
376376
377377
378378      }
r2200r2201
380380   }
381381}
382382
383static void Nick_WritePixelsLPIXEL(running_machine *machine, unsigned char DataByte, unsigned char CharIndex)
383static void Nick_WritePixelsLPIXEL(unsigned char DataByte, unsigned char CharIndex)
384384{
385385   int i;
386386
r2200r2201
438438
439439
440440
441         Nick_WritePixels2ColourLPIXEL(machine, PenOffset,(PenOffset|0x01), Data);
441         Nick_WritePixels2ColourLPIXEL(PenOffset,(PenOffset|0x01), Data);
442442      }
443443      break;
444444
r2200r2201
463463            PenIndex = Nick_PenIndexLookup_4Colour[Data];
464464            PalIndex = Nick.LPT.COL[PenIndex & 0x03];
465465
466            nick_write_pixel(machine, &Nick, PalIndex);
467            nick_write_pixel(machine, &Nick, PalIndex);
468            nick_write_pixel(machine, &Nick, PalIndex);
469            nick_write_pixel(machine, &Nick, PalIndex);
466            nick_write_pixel(&Nick, PalIndex);
467            nick_write_pixel(&Nick, PalIndex);
468            nick_write_pixel(&Nick, PalIndex);
469            nick_write_pixel(&Nick, PalIndex);
470470
471471            Data = Data<<1;
472472          }
r2200r2201
495495
496496            PalIndex = Nick_GetColourIndex(PenIndex);
497497
498            nick_write_pixel(machine, &Nick, PalIndex);
499            nick_write_pixel(machine, &Nick, PalIndex);
500            nick_write_pixel(machine, &Nick, PalIndex);
501            nick_write_pixel(machine, &Nick, PalIndex);
502            nick_write_pixel(machine, &Nick, PalIndex);
503            nick_write_pixel(machine, &Nick, PalIndex);
504            nick_write_pixel(machine, &Nick, PalIndex);
505            nick_write_pixel(machine, &Nick, PalIndex);
498            nick_write_pixel(&Nick, PalIndex);
499            nick_write_pixel(&Nick, PalIndex);
500            nick_write_pixel(&Nick, PalIndex);
501            nick_write_pixel(&Nick, PalIndex);
502            nick_write_pixel(&Nick, PalIndex);
503            nick_write_pixel(&Nick, PalIndex);
504            nick_write_pixel(&Nick, PalIndex);
505            nick_write_pixel(&Nick, PalIndex);
506506
507507            Data = Data<<1;
508508         }
r2200r2201
525525
526526         PalIndex = Data;
527527
528         nick_write_pixel(machine, &Nick, PalIndex);
529         nick_write_pixel(machine, &Nick, PalIndex);
530         nick_write_pixel(machine, &Nick, PalIndex);
531         nick_write_pixel(machine, &Nick, PalIndex);
532         nick_write_pixel(machine, &Nick, PalIndex);
533         nick_write_pixel(machine, &Nick, PalIndex);
534         nick_write_pixel(machine, &Nick, PalIndex);
535         nick_write_pixel(machine, &Nick, PalIndex);
528         nick_write_pixel(&Nick, PalIndex);
529         nick_write_pixel(&Nick, PalIndex);
530         nick_write_pixel(&Nick, PalIndex);
531         nick_write_pixel(&Nick, PalIndex);
532         nick_write_pixel(&Nick, PalIndex);
533         nick_write_pixel(&Nick, PalIndex);
534         nick_write_pixel(&Nick, PalIndex);
535         nick_write_pixel(&Nick, PalIndex);
536536
537         nick_write_pixel(machine, &Nick, PalIndex);
538         nick_write_pixel(machine, &Nick, PalIndex);
539         nick_write_pixel(machine, &Nick, PalIndex);
540         nick_write_pixel(machine, &Nick, PalIndex);
541         nick_write_pixel(machine, &Nick, PalIndex);
542         nick_write_pixel(machine, &Nick, PalIndex);
543         nick_write_pixel(machine, &Nick, PalIndex);
544         nick_write_pixel(machine, &Nick, PalIndex);
537         nick_write_pixel(&Nick, PalIndex);
538         nick_write_pixel(&Nick, PalIndex);
539         nick_write_pixel(&Nick, PalIndex);
540         nick_write_pixel(&Nick, PalIndex);
541         nick_write_pixel(&Nick, PalIndex);
542         nick_write_pixel(&Nick, PalIndex);
543         nick_write_pixel(&Nick, PalIndex);
544         nick_write_pixel(&Nick, PalIndex);
545545
546546
547547      }
r2200r2201
550550}
551551
552552
553static void Nick_DoPixel(running_machine *machine, int ClocksVisible)
553static void Nick_DoPixel(int ClocksVisible)
554554{
555555   int i;
556556   unsigned char Buf1, Buf2;
r2200r2201
563563      Buf2 = Nick_FetchByte(Nick.LD1);
564564      Nick.LD1++;
565565
566      Nick_WritePixels(machine, Buf1,Buf1);
566      Nick_WritePixels(Buf1,Buf1);
567567
568      Nick_WritePixels(machine, Buf2,Buf1);
568      Nick_WritePixels(Buf2,Buf1);
569569   }
570570}
571571
572572
573static void Nick_DoLPixel(running_machine *machine, int ClocksVisible)
573static void Nick_DoLPixel(int ClocksVisible)
574574{
575575   int i;
576576   unsigned char Buf1;
r2200r2201
580580      Buf1 =  Nick_FetchByte(Nick.LD1);
581581      Nick.LD1++;
582582
583      Nick_WritePixelsLPIXEL(machine, Buf1,Buf1);
583      Nick_WritePixelsLPIXEL(Buf1,Buf1);
584584   }
585585}
586586
587static void Nick_DoAttr(running_machine *machine, int ClocksVisible)
587static void Nick_DoAttr(int ClocksVisible)
588588{
589589   int i;
590590   unsigned char Buf1, Buf2;
r2200r2201
601601         unsigned char BackgroundColour = ((Buf1>>4) & 0x0f);
602602         unsigned char ForegroundColour = (Buf1 & 0x0f);
603603
604         Nick_WritePixels2ColourLPIXEL(machine, BackgroundColour, ForegroundColour, Buf2);
604         Nick_WritePixels2ColourLPIXEL(BackgroundColour, ForegroundColour, Buf2);
605605      }
606606   }
607607}
608608
609static void Nick_DoCh256(running_machine *machine, int ClocksVisible)
609static void Nick_DoCh256(int ClocksVisible)
610610{
611611   int i;
612612   unsigned char Buf1, Buf2;
r2200r2201
617617      Nick.LD1++;
618618      Buf2 = Nick_FetchByte(ADDR_CH256(Nick.LD2, Buf1));
619619
620      Nick_WritePixelsLPIXEL(machine, Buf2,Buf1);
620      Nick_WritePixelsLPIXEL(Buf2,Buf1);
621621   }
622622}
623623
624static void Nick_DoCh128(running_machine *machine, int ClocksVisible)
624static void Nick_DoCh128(int ClocksVisible)
625625{
626626   int i;
627627   unsigned char Buf1, Buf2;
r2200r2201
632632      Nick.LD1++;
633633      Buf2 = Nick_FetchByte(ADDR_CH128(Nick.LD2, Buf1));
634634
635      Nick_WritePixelsLPIXEL(machine, Buf2,Buf1);
635      Nick_WritePixelsLPIXEL(Buf2,Buf1);
636636   }
637637}
638638
639static void Nick_DoCh64(running_machine *machine, int ClocksVisible)
639static void Nick_DoCh64(int ClocksVisible)
640640{
641641   int i;
642642   unsigned char Buf1, Buf2;
r2200r2201
647647      Nick.LD1++;
648648      Buf2 = Nick_FetchByte(ADDR_CH64(Nick.LD2, Buf1));
649649
650      Nick_WritePixelsLPIXEL(machine, Buf2,Buf1);
650      Nick_WritePixelsLPIXEL(Buf2,Buf1);
651651   }
652652}
653653
654654
655static void Nick_DoDisplay(running_machine *machine, LPT_ENTRY *pLPT)
655static void Nick_DoDisplay(LPT_ENTRY *pLPT)
656656{
657657   unsigned char ClocksVisible;
658658   unsigned char RightMargin, LeftMargin;
r2200r2201
718718      {
719719         case NICK_PIXEL_MODE:
720720         {
721                            Nick_DoPixel(machine, ClocksVisible);
721                            Nick_DoPixel(ClocksVisible);
722722         }
723723         break;
724724
725725         case NICK_ATTR_MODE:
726726         {
727727            //mame_printf_info("attr mode\r\n");
728                            Nick_DoAttr(machine, ClocksVisible);
728                            Nick_DoAttr( ClocksVisible);
729729         }
730730         break;
731731
732732         case NICK_CH256_MODE:
733733         {
734734            //mame_printf_info("ch256 mode\r\n");
735            Nick_DoCh256(machine, ClocksVisible);
735            Nick_DoCh256(ClocksVisible);
736736         }
737737         break;
738738
739739         case NICK_CH128_MODE:
740740         {
741            Nick_DoCh128(machine, ClocksVisible);
741            Nick_DoCh128(ClocksVisible);
742742         }
743743         break;
744744
745745         case NICK_CH64_MODE:
746746         {
747747            //mame_printf_info("ch64 mode\r\n");
748            Nick_DoCh64(machine, ClocksVisible);
748            Nick_DoCh64(ClocksVisible);
749749         }
750750         break;
751751
752752         case NICK_LPIXEL_MODE:
753753         {
754            Nick_DoLPixel(machine, ClocksVisible);
754            Nick_DoLPixel(ClocksVisible);
755755         }
756756         break;
757757
r2200r2201
799799}
800800
801801/* call here to render a line of graphics */
802static void   Nick_DoLine(running_machine *machine)
802static void   Nick_DoLine(void)
803803{
804804   unsigned char ScanLineCount;
805805
r2200r2201
814814   }
815815
816816      /* left border */
817      Nick_DoLeftMargin(machine, &Nick.LPT);
817      Nick_DoLeftMargin(&Nick.LPT);
818818
819819      /* do visible part */
820      Nick_DoDisplay(machine, &Nick.LPT);
820      Nick_DoDisplay(&Nick.LPT);
821821
822822      /* right border */
823      Nick_DoRightMargin(machine, &Nick.LPT);
823      Nick_DoRightMargin(&Nick.LPT);
824824
825825   // 0x0f7 is first!
826826   /* scan line count for this LPT */
r2200r2201
895895  }
896896}
897897
898void    Nick_DoScreen(running_machine *machine, bitmap_t *bm)
898void    Nick_DoScreen(bitmap_t *bm)
899899{
900900  int line = 0;
901901
r2200r2201
908908   Nick.dest_max_pos = bm->width;
909909
910910    /* write line */
911    Nick_DoLine(machine);
911    Nick_DoLine();
912912
913913    /* next line */
914914    line++;
src/mess/video/epnick.h
r2200r2201
127127extern PALETTE_INIT( nick );
128128
129129int Nick_vh_start(void);
130void Nick_DoScreen(running_machine *machine, bitmap_t *bm);
130void Nick_DoScreen(bitmap_t *bm);
131131
132132int Nick_reg_r(int);
133133WRITE8_HANDLER ( Nick_reg_w );
src/mess/video/pmd85.c
r2200r2201
3131{
3232}
3333
34static void pmd85_draw_scanline(running_machine *machine, bitmap_t *bitmap, int pmd85_scanline)
34static void pmd85_draw_scanline(bitmap_t *bitmap, int pmd85_scanline)
3535{
3636   int x, i;
3737   int pen0, pen1;
r2200r2201
5050      pen1 = data & 0x80 ? 1 : 2;
5151
5252      for (i=0; i<6; i++)
53         scanline[x+i] = machine->pens[(data & (0x01<<i)) ? pen1 : pen0];
53         scanline[x+i] = (data & (0x01<<i)) ? pen1 : pen0;
5454
5555   }
5656}
r2200r2201
6060   int pmd85_scanline;
6161
6262   for (pmd85_scanline=0; pmd85_scanline<256; pmd85_scanline++)
63      pmd85_draw_scanline (screen->machine, bitmap, pmd85_scanline);
63      pmd85_draw_scanline (bitmap, pmd85_scanline);
6464   return 0;
6565}
src/mess/video/lviv.c
r2200r2201
7878         data = lviv_video_ram[y*64+x/4];
7979
8080         pen = lviv_colortable[0][((data & 0x08) >> 3) | ((data & 0x80) >> (3+3))];
81         *BITMAP_ADDR16(bitmap, y, x + 0) = screen->machine->pens[pen];
81         *BITMAP_ADDR16(bitmap, y, x + 0) = pen;
8282
8383         pen = lviv_colortable[0][((data & 0x04) >> 2) | ((data & 0x40) >> (2+3))];
84         *BITMAP_ADDR16(bitmap, y, x + 1) = screen->machine->pens[pen];
84         *BITMAP_ADDR16(bitmap, y, x + 1) = pen;
8585
8686         pen = lviv_colortable[0][((data & 0x02) >> 1) | ((data & 0x20) >> (1+3))];
87         *BITMAP_ADDR16(bitmap, y, x + 2) = screen->machine->pens[pen];
87         *BITMAP_ADDR16(bitmap, y, x + 2) = pen;
8888
8989         pen = lviv_colortable[0][((data & 0x01) >> 0) | ((data & 0x10) >> (0+3))];
90         *BITMAP_ADDR16(bitmap, y, x + 3) = screen->machine->pens[pen];
90         *BITMAP_ADDR16(bitmap, y, x + 3) = pen;
9191      }
9292   return 0;
9393}
src/mess/video/exidy.c
r2200r2201
1515   int x,y;
1616   UINT16 pens[2];
1717
18   pens[0] = screen->machine->pens[0];
19   pens[1] = screen->machine->pens[1];
18   pens[0] = 0;
19   pens[1] = 1;
2020
2121   for (y=0; y<EXIDY_SCREEN_HEIGHT>>3; y++)
2222   {
src/mess/video/pcw.c
r2200r2201
6969      pen0^=1;
7070   }
7171
72   pen0 = screen->machine->pens[pen0];
73   pen1 = screen->machine->pens[pen1];
74
7572   /* video enable? */
7673   if ((pcw_vdu_video_control_register & (1<<6))!=0)
7774   {
src/mess/video/oric.c
r2200r2201
197197
198198/* render 6-pixels using foreground and background colours specified */
199199/* used in hires and text mode */
200static void oric_vh_render_6pixels(running_machine *machine, bitmap_t *bitmap,int x,int y, int fg, int bg,int data, int invert_flag)
200static void oric_vh_render_6pixels(bitmap_t *bitmap,int x,int y, int fg, int bg,int data, int invert_flag)
201201{
202202   int i;
203203   int pens[2];
r2200r2201
210210      bg ^=0x07;
211211   }
212212
213   pens[1] = machine->pens[fg];
214   pens[0] = machine->pens[bg];
213   pens[1] = fg;
214   pens[0] = bg;
215215
216216   px = x;
217217   for (i=0; i<6; i++)
r2200r2201
306306            oric_vh_update_attribute(c);
307307
308308            /* display background colour when attribute has been found */
309            oric_vh_render_6pixels(screen->machine, bitmap,x,y,vh_state.active_foreground_colour, vh_state.active_background_colour, 0,(c & 0x080));
309            oric_vh_render_6pixels(bitmap,x,y,vh_state.active_foreground_colour, vh_state.active_background_colour, 0,(c & 0x080));
310310
311311            if (y<200)
312312            {
r2200r2201
330330            {
331331               int pixel_data = c & 0x03f;
332332               /* plot hires pixels */
333               oric_vh_render_6pixels(screen->machine, bitmap,x,y,vh_state.active_foreground_colour, vh_state.active_background_colour, pixel_data,(c & 0x080));
333               oric_vh_render_6pixels(bitmap,x,y,vh_state.active_foreground_colour, vh_state.active_background_colour, pixel_data,(c & 0x080));
334334            }
335335            else
336336            {
r2200r2201
357357               char_data = vh_state.char_data[(char_index<<3) | ch_line] & 0x03f;
358358
359359               /* draw! */
360               oric_vh_render_6pixels(screen->machine, bitmap,x,y,
360               oric_vh_render_6pixels(bitmap,x,y,
361361                  vh_state.active_foreground_colour,
362362                  vh_state.active_background_colour, char_data, (c & 0x080));
363363            }
src/mess/video/enterp.c
r2200r2201
2424***************************************************************************/
2525VIDEO_UPDATE( enterprise )
2626{
27   Nick_DoScreen(screen->machine, tmpbitmap);
27   Nick_DoScreen(tmpbitmap);
2828   return VIDEO_UPDATE_CALL(generic_bitmapped);
2929}
3030
src/mess/video/electron.c
r2200r2201
8888   case 0:
8989      for( i = 0; i < 80; i++ ) {
9090         UINT8 pattern = read_vram( ula.screen_addr + i * 8 );
91         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>7)& 1] ] );
92         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>6)& 1] ] );
93         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>5)& 1] ] );
94         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>4)& 1] ] );
95         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>3)& 1] ] );
96         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>2)& 1] ] );
97         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>1)& 1] ] );
98         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>0)& 1] ] );
91         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>7)& 1] );
92         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>6)& 1] );
93         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>5)& 1] );
94         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>4)& 1] );
95         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>3)& 1] );
96         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>2)& 1] );
97         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>1)& 1] );
98         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>0)& 1] );
9999      }
100100      ula.screen_addr += 1;
101101      if ( ( scanline & 0x07 ) == 7 ) {
r2200r2201
106106      x = 0;
107107      for( i = 0; i < 80; i++ ) {
108108         UINT8 pattern = read_vram( ula.screen_addr + i * 8 );
109         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>3]] ] );
110         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>3]] ] );
111         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>2]] ] );
112         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>2]] ] );
113         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>1]] ] );
114         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>1]] ] );
115         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>0]] ] );
116         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>0]] ] );
109         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>3]] );
110         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>3]] );
111         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>2]] );
112         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>2]] );
113         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>1]] );
114         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>1]] );
115         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>0]] );
116         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>0]] );
117117      }
118118      ula.screen_addr += 1;
119119      if ( ( scanline & 0x07 ) == 7 ) {
r2200r2201
123123   case 2:
124124      for( i = 0; i < 80; i++ ) {
125125         UINT8 pattern = read_vram( ula.screen_addr + i * 8 );
126         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map16[pattern>>1]] ] );
127         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map16[pattern>>1]] ] );
128         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map16[pattern>>1]] ] );
129         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map16[pattern>>1]] ] );
130         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map16[pattern>>0]] ] );
131         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map16[pattern>>0]] ] );
132         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map16[pattern>>0]] ] );
133         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map16[pattern>>0]] ] );
126         electron_plot_pixel( bitmap, x++, scanline, pal[map16[pattern>>1]] );
127         electron_plot_pixel( bitmap, x++, scanline, pal[map16[pattern>>1]] );
128         electron_plot_pixel( bitmap, x++, scanline, pal[map16[pattern>>1]] );
129         electron_plot_pixel( bitmap, x++, scanline, pal[map16[pattern>>1]] );
130         electron_plot_pixel( bitmap, x++, scanline, pal[map16[pattern>>0]] );
131         electron_plot_pixel( bitmap, x++, scanline, pal[map16[pattern>>0]] );
132         electron_plot_pixel( bitmap, x++, scanline, pal[map16[pattern>>0]] );
133         electron_plot_pixel( bitmap, x++, scanline, pal[map16[pattern>>0]] );
134134      }
135135      ula.screen_addr += 1;
136136      if ( ( scanline & 0x07 ) == 7 ) {
r2200r2201
139139      break;
140140   case 3:
141141      if ( ( scanline > 249 ) || ( scanline % 10 >= 8 ) ) {
142         fillbitmap( bitmap, screen->machine->pens[7], &r );
142         fillbitmap( bitmap, 7, &r );
143143      } else {
144144         for( i = 0; i < 80; i++ ) {
145145            UINT8 pattern = read_vram( ula.screen_addr + i * 8 );
146            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>7)&1] ] );
147            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>6)&1] ] );
148            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>5)&1] ] );
149            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>4)&1] ] );
150            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>3)&1] ] );
151            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>2)&1] ] );
152            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>1)&1] ] );
153            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>0)&1] ] );
146            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>7)&1] );
147            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>6)&1] );
148            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>5)&1] );
149            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>4)&1] );
150            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>3)&1] );
151            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>2)&1] );
152            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>1)&1] );
153            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>0)&1] );
154154         }
155155         ula.screen_addr += 1;
156156         if ( ( scanline & 0x07 ) == 7 ) {
r2200r2201
162162   case 7:
163163      for( i = 0; i < 40; i++ ) {
164164         UINT8 pattern = read_vram( ula.screen_addr + i * 8 );
165         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>7)&1] ] );
166         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>7)&1] ] );
167         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>6)&1] ] );
168         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>6)&1] ] );
169         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>5)&1] ] );
170         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>5)&1] ] );
171         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>4)&1] ] );
172         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>4)&1] ] );
173         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>3)&1] ] );
174         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>3)&1] ] );
175         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>2)&1] ] );
176         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>2)&1] ] );
177         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>1)&1] ] );
178         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>1)&1] ] );
179         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>0)&1] ] );
180         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>0)&1] ] );
165         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>7)&1] );
166         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>7)&1] );
167         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>6)&1] );
168         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>6)&1] );
169         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>5)&1] );
170         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>5)&1] );
171         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>4)&1] );
172         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>4)&1] );
173         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>3)&1] );
174         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>3)&1] );
175         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>2)&1] );
176         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>2)&1] );
177         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>1)&1] );
178         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>1)&1] );
179         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>0)&1] );
180         electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>0)&1] );
181181      }
182182      ula.screen_addr += 1;
183183      if ( ( scanline & 0x07 ) == 7 ) {
r2200r2201
187187   case 5:
188188      for( i = 0; i < 40; i++ ) {
189189         UINT8 pattern = read_vram( ula.screen_addr + i * 8 );
190         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>3]] ] );
191         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>3]] ] );
192         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>3]] ] );
193         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>3]] ] );
194         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>2]] ] );
195         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>2]] ] );
196         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>2]] ] );
197         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>2]] ] );
198         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>1]] ] );
199         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>1]] ] );
200         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>1]] ] );
201         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>1]] ] );
202         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>0]] ] );
203         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>0]] ] );
204         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>0]] ] );
205         electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[map4[pattern>>0]] ] );
190         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>3]] );
191         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>3]] );
192         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>3]] );
193         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>3]] );
194         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>2]] );
195         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>2]] );
196         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>2]] );
197         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>2]] );
198         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>1]] );
199         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>1]] );
200         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>1]] );
201         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>1]] );
202         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>0]] );
203         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>0]] );
204         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>0]] );
205         electron_plot_pixel( bitmap, x++, scanline, pal[map4[pattern>>0]] );
206206      }
207207      ula.screen_addr += 1;
208208      if ( ( scanline & 0x07 ) == 7 ) {
r2200r2201
211211      break;
212212   case 6:
213213      if ( ( scanline > 249 ) || ( scanline % 10 >= 8 ) ) {
214         fillbitmap( bitmap, screen->machine->pens[7], &r );
214         fillbitmap( bitmap, 7, &r );
215215      } else {
216216         for( i = 0; i < 40; i++ ) {
217217            UINT8 pattern = read_vram( ula.screen_addr + i * 8 );
218            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>7)&1] ] );
219            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>7)&1] ] );
220            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>6)&1] ] );
221            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>6)&1] ] );
222            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>5)&1] ] );
223            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>5)&1] ] );
224            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>4)&1] ] );
225            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>4)&1] ] );
226            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>3)&1] ] );
227            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>3)&1] ] );
228            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>2)&1] ] );
229            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>2)&1] ] );
230            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>1)&1] ] );
231            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>1)&1] ] );
232            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>0)&1] ] );
233            electron_plot_pixel( bitmap, x++, scanline, screen->machine->pens[ pal[(pattern>>0)&1] ] );
218            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>7)&1] );
219            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>7)&1] );
220            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>6)&1] );
221            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>6)&1] );
222            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>5)&1] );
223            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>5)&1] );
224            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>4)&1] );
225            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>4)&1] );
226            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>3)&1] );
227            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>3)&1] );
228            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>2)&1] );
229            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>2)&1] );
230            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>1)&1] );
231            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>1)&1] );
232            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>0)&1] );
233            electron_plot_pixel( bitmap, x++, scanline, pal[(pattern>>0)&1] );
234234         }
235235         ula.screen_addr += 1;
236236         if ( ( scanline % 10 ) == 7 ) {
src/mess/video/cdp1864.c
r2200r2201
130130         color = cdp1864.colorram_r(cdp1864.dmaptr);
131131      }
132132
133      *BITMAP_ADDR16(cdptmpbitmap, y, sx + x) = Machine->pens[color];
133      *BITMAP_ADDR16(cdptmpbitmap, y, sx + x) = color;
134134
135135      data <<= 1;
136136   }
r2200r2201
224224{
225225   if (cdp1864.disp)
226226   {
227      fillbitmap(bitmap, screen->machine->pens[cdp1864_bgcolseq[cdp1864.bgcolor]], cliprect);
227      fillbitmap(bitmap, cdp1864_bgcolseq[cdp1864.bgcolor], cliprect);
228228      copybitmap_trans(bitmap, cdptmpbitmap, 0, 0, 0, 0, cliprect, cdp1864.bgcolor);
229229   }
230230   else
src/mess/video/odyssey2.c
r2200r2201
305305      rect.min_y = rect.max_y = vpos;
306306      rect.min_x = I824X_START_ACTIVE_SCAN;
307307      rect.max_x = I824X_END_ACTIVE_SCAN - 1;
308      fillbitmap( tmp_bitmap, machine->pens[ ( (o2_vdc.s.color >> 3) & 0x7 ) | ( ( lum << 3 ) ^ 0x08 ) ], &rect );
308      fillbitmap( tmp_bitmap, ( (o2_vdc.s.color >> 3) & 0x7 ) | ( ( lum << 3 ) ^ 0x08 ), &rect );
309309
310310      /* Clear collision map */
311311      memset( collision_map, 0, sizeof( collision_map ) );
312312
313313      /* Display grid if enabled */
314314      if ( o2_vdc.s.control & 0x08 ) {
315         UINT16   color = machine->pens[ ( o2_vdc.s.color & 7 ) | ( ( o2_vdc.s.color >> 3 ) & 0x08 ) | ( ( lum << 3 ) ^ 0x08 ) ];
315         UINT16   color = ( o2_vdc.s.color & 7 ) | ( ( o2_vdc.s.color >> 3 ) & 0x08 ) | ( ( lum << 3 ) ^ 0x08 );
316316         int      x_grid_offset = 8;
317317         int    y_grid_offset = 24;
318318         int      width = 16;
r2200r2201
368368            int   height = 8 - ( ( ( y >> 1 ) + o2_vdc.s.foreground[i].ptr ) & 7 );
369369
370370            if ( y <= ( vpos - start_vpos ) && ( vpos - start_vpos ) < y + height * 2 ) {
371               UINT16   color = machine->pens[ 16 + ( ( o2_vdc.s.foreground[i].color & 0x0E ) >> 1 ) ];
371               UINT16   color = 16 + ( ( o2_vdc.s.foreground[i].color & 0x0E ) >> 1 );
372372               int      offset = ( o2_vdc.s.foreground[i].ptr | ( ( o2_vdc.s.foreground[i].color & 0x01 ) << 8 ) ) + ( y >> 1 ) + ( ( vpos - start_vpos - y ) >> 1 );
373373               UINT8   chr = ((char*)o2_shape)[ offset & 0x1FF ];
374374               int      x = o2_vdc.s.foreground[i].x;
r2200r2201
405405               for ( j = 0; j < ARRAY_LENGTH( o2_vdc.s.quad[0].single ); j++, x += 8 ) {
406406                  int      char_height = 8 - ( ( ( y >> 1 ) + o2_vdc.s.quad[i].single[j].ptr ) & 7 );
407407                  if ( y <= ( vpos - start_vpos ) && ( vpos - start_vpos ) < y + char_height * 2 ) {
408                     UINT16 color = machine->pens[ 16 + ( ( o2_vdc.s.quad[i].single[j].color & 0x0E ) >> 1 ) ];
408                     UINT16 color = 16 + ( ( o2_vdc.s.quad[i].single[j].color & 0x0E ) >> 1 );
409409                     int   offset = ( o2_vdc.s.quad[i].single[j].ptr | ( ( o2_vdc.s.quad[i].single[j].color & 0x01 ) << 8 ) ) + ( y >> 1 ) + ( ( vpos - start_vpos - y ) >> 1 );
410410                     UINT8   chr = ((char*)o2_shape)[ offset & 0x1FF ];
411411                     UINT8   m;
r2200r2201
440440               /* Zoomed sprite */
441441               sprite_width[i] = 16;
442442               if ( y <= ( vpos - start_vpos ) && ( vpos - start_vpos ) < y + height * 4 ) {
443                  UINT16 color = machine->pens[ 16 + ( ( o2_vdc.s.sprites[i].color >> 3 ) & 0x07 ) ];
443                  UINT16 color = 16 + ( ( o2_vdc.s.sprites[i].color >> 3 ) & 0x07 );
444444                  UINT8   chr = o2_vdc.s.shape[i][ ( ( vpos - start_vpos - y ) >> 2 ) ];
445445                  int      x = o2_vdc.s.sprites[i].x;
446446                  UINT8   m;
r2200r2201
477477            } else {
478478               /* Regular sprite */
479479               if ( y <= ( vpos - start_vpos ) && ( vpos - start_vpos ) < y + height * 2 ) {
480                  UINT16 color = machine->pens[ 16 + ( ( o2_vdc.s.sprites[i].color >> 3 ) & 0x07 ) ];
480                  UINT16 color = 16 + ( ( o2_vdc.s.sprites[i].color >> 3 ) & 0x07 );
481481                  UINT8   chr = o2_vdc.s.shape[i][ ( ( vpos - start_vpos - y ) >> 1 ) ];
482482                  int      x = o2_vdc.s.sprites[i].x;
483483                  UINT8   m;
src/mess/video/primo.c
r2200r2201
1414UINT16 primo_video_memory_base;
1515
1616
17static void primo_draw_scanline(running_machine *machine, bitmap_t *bitmap, int primo_scanline)
17static void primo_draw_scanline(bitmap_t *bitmap, int primo_scanline)
1818{
1919   int x, i;
2020   UINT8 data;
r2200r2201
3030      data = primo_video_ram_line[x/8];
3131
3232      for (i=0; i<8; i++)
33         scanline[x+i]=machine->pens[(data & (0x80>>i)) ? 1 : 0];
33         scanline[x+i]=(data & (0x80>>i)) ? 1 : 0;
3434
3535   }
3636}
r2200r2201
4141   int primo_scanline;
4242
4343   for (primo_scanline=0; primo_scanline<192; primo_scanline++)
44      primo_draw_scanline(screen->machine, bitmap, primo_scanline);
44      primo_draw_scanline(bitmap, primo_scanline);
4545   return 0;
4646}
src/mess/video/crt.c
r2200r2201
170170            }
171171
172172            /* draw pixel on screen */
173            //plot_pixel(bitmap, x, y+crt_window_offset_y, machine->pens[node->intensity]);
174            line[x] = screen->machine->pens[node->intensity];
173            //plot_pixel(bitmap, x, y+crt_window_offset_y, node->intensity);
174            line[x] = node->intensity;
175175
176176            if (node->intensity != 0)
177177               p_i = i;   /* current node will be next iteration's previous node */
src/mess/video/hd66421.c
r2200r2201
144144      if (temp <  0) temp =  0;
145145      if (temp > 31) temp = 31;
146146      bright = 1.0 * temp / 31;
147      pen[i] = screen->machine->pens[i];
147      pen[i] = i;
148148      #ifdef BRIGHTNESS_DOES_NOT_WORK
149149      palette_set_color( screen->machine, pen[i], 255 * bright, 255 * bright, 255 * bright);
150150      #else
src/mess/video/galaxy.c
r2200r2201
6161      black_area.max_x = 32*8-1;
6262      black_area.min_y = 0;
6363      black_area.max_y = 16*13-1;
64      fillbitmap(bitmap, screen->machine->pens[1], &black_area);
64      fillbitmap(bitmap, 1, &black_area);
6565      fast_mode = TRUE;
6666      return 0;
6767   }
r2200r2201
8282      }
8383      if (horizontal_pos == 0x0b)
8484         black_area.min_x =  black_area.max_x = 0;
85      fillbitmap(bitmap, screen->machine->pens[1], &black_area);
85      fillbitmap(bitmap, 1, &black_area);
8686   }
8787
8888   for( offs = 0; offs < 512; offs++ )
src/mess/video/kc.c
r2200r2201
116116
117117
118118/* draw 8 pixels */
119static void kc85_draw_8_pixels(running_machine *machine, bitmap_t *bitmap,int x,int y, unsigned char colour_byte, unsigned char gfx_byte)
119static void kc85_draw_8_pixels(bitmap_t *bitmap,int x,int y, unsigned char colour_byte, unsigned char gfx_byte)
120120{
121121   int a;
122122   int background_pen;
r2200r2201
144144      foreground_pen = background_pen;
145145   }
146146
147    pens[0] = machine->pens[background_pen];
148   pens[1] = machine->pens[foreground_pen];
147    pens[0] = background_pen;
148   pens[1] = foreground_pen;
149149
150150   px = x;
151151
r2200r2201
288288
289289/* process visible cycles within a line */
290290/* the cycles will never span over the end of a line */
291static void kc85_common_process_cycles(running_machine *machine, struct video_update_state *video_update, int cycles)
291static void kc85_common_process_cycles(struct video_update_state *video_update, int cycles)
292292{
293293   while (cycles!=0)
294294   {
r2200r2201
322322               /* grab colour and pixel information */
323323               video_update->pixel_grab_callback(&video_update->grab_data,video_update->x,video_update->y,&colour_byte, &gfx_byte);
324324               /* draw to screen */
325               kc85_draw_8_pixels(machine, video_update->bitmap, video_update->render_x, video_update->render_y,colour_byte, gfx_byte);
325               kc85_draw_8_pixels(video_update->bitmap, video_update->render_x, video_update->render_y,colour_byte, gfx_byte);
326326               /* update render coordinate */
327327               video_update->render_x+=8;
328328               video_update->x++;
r2200r2201
373373}
374374
375375/* process a whole visible line */
376static int kc85_common_vh_process_line(running_machine *machine, struct video_update_state *video_update, int cycles)
376static int kc85_common_vh_process_line(struct video_update_state *video_update, int cycles)
377377{
378378   int cycles_to_do;
379379
r2200r2201
386386      //logerror("process line: cycles_to_do: %d\n",cycles_to_do);
387387
388388      /* do the cycles - draw them */
389      kc85_common_process_cycles(machine, video_update, cycles_to_do);
389      kc85_common_process_cycles(video_update, cycles_to_do);
390390
391391      video_update->horizontal.cycles_remaining -= cycles_to_do;
392392      cycles -=cycles_to_do;
r2200r2201
423423   return cycles;
424424}
425425
426static void kc85_common_vh_process_lines(running_machine *machine, struct video_update_state *video_update, int cycles)
426static void kc85_common_vh_process_lines(struct video_update_state *video_update, int cycles)
427427{
428428   while (cycles!=0)
429429   {
r2200r2201
451451            int cycles_remaining;
452452
453453            /* update cycles with number of cycles not processed */
454            cycles_remaining = kc85_common_vh_process_line(machine, video_update, cycles_to_do);
454            cycles_remaining = kc85_common_vh_process_line(video_update, cycles_to_do);
455455
456456            cycles_done = cycles_to_do - cycles_remaining;
457457
r2200r2201
529529      delta_cycles = pItem->Event_Time - cycles_offset;
530530
531531      //logerror("cycles between this event and next: %d\n",delta_cycles);
532      kc85_common_vh_process_lines(machine, &video_update, delta_cycles);
532      kc85_common_vh_process_lines(&video_update, delta_cycles);
533533
534534      /* update number of cycles remaining in frame */
535535      cycles_remaining_in_frame -= delta_cycles;
r2200r2201
546546
547547
548548   /* process remainder */
549   kc85_common_vh_process_lines(machine, &video_update, cycles_remaining_in_frame);
549   kc85_common_vh_process_lines(&video_update, cycles_remaining_in_frame);
550550   EventList_Reset();
551551   EventList_SetOffsetStartTime ( ATTOTIME_TO_CYCLES(0, attotime_mul(video_screen_get_scan_period(machine->primary_screen), video_screen_get_vpos(machine->primary_screen))) );
552552}
r2200r2201
673673         colour_byte = colour_ram[offset];
674674          gfx_byte = pixel_ram[offset];
675675
676         kc85_draw_8_pixels(machine, bitmap,(x<<3),y, colour_byte, gfx_byte);
676         kc85_draw_8_pixels(bitmap,(x<<3),y, colour_byte, gfx_byte);
677677
678678      }
679679   }
r2200r2201
770770            colour_byte = colour_ram[colour_offset];
771771            gfx_byte = pixel_ram[pixel_offset];
772772
773         kc85_draw_8_pixels(machine, bitmap,(x<<3),y, colour_byte, gfx_byte);
773         kc85_draw_8_pixels(bitmap,(x<<3),y, colour_byte, gfx_byte);
774774      }
775775   }
776776#endif

Previous 15994 Revisions Next


© 1998-2018 The MESS Team